~ubuntu-branches/ubuntu/hardy/xxdiff/hardy

« back to all changes in this revision

Viewing changes to src/markers.h

  • Committer: Bazaar Package Importer
  • Author(s): Tomas Pospisek
  • Date: 2005-03-29 08:43:56 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050329084356-nkwv8jf18nc7u5qf
Tags: 1:3.1-3
re-upload

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- c-file-style: "xxdiff" -*- */
 
2
/******************************************************************************\
 
3
 * $RCSfile: markers.h,v $
 
4
 *
 
5
 * Copyright (C) 1999-2003  Martin Blais <blais@furius.ca>
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation; either version 2 of the License, or
 
10
 * (at your option) any later version.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program; if not, write to the Free Software
 
19
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
20
 *
 
21
 ******************************************************************************/
 
22
 
 
23
#ifndef INCL_XXDIFF_MARKERS
 
24
#define INCL_XXDIFF_MARKERS
 
25
 
 
26
/*==============================================================================
 
27
 * EXTERNAL DECLARATIONS
 
28
 *============================================================================*/
 
29
 
 
30
#ifndef INCL_XXDIFF_DEFS
 
31
#include <defs.h>
 
32
#endif
 
33
 
 
34
#ifndef INCL_MARKERSWIDGETBASE
 
35
#include <markersWidgetBase.h>
 
36
#define INCL_MARKERSWIDGETBASE
 
37
#endif
 
38
 
 
39
#ifndef INCL_STD_QFILEDIALOG
 
40
#include <qfiledialog.h>
 
41
#define INCL_STD_QFILEDIALOG
 
42
#endif
 
43
 
 
44
/*==============================================================================
 
45
 * FORWARD DECLARATIONS
 
46
 *============================================================================*/
 
47
 
 
48
class QPushButton;
 
49
 
 
50
XX_NAMESPACE_BEGIN
 
51
 
 
52
/*==============================================================================
 
53
 * CLASS XxMarkersWidget
 
54
 *============================================================================*/
 
55
 
 
56
// <summary> widget for diff markers </summary>
 
57
 
 
58
// Note: although it should not be visible, this class must be present in the .h
 
59
// because of moc generation requirements.
 
60
 
 
61
class XxMarkersWidget : public XxMarkersWidgetBase {
 
62
 
 
63
   Q_OBJECT
 
64
 
 
65
   /*----- types and enumerations -----*/
 
66
 
 
67
   typedef XxMarkersWidgetBase BaseClass;
 
68
 
 
69
public:
 
70
 
 
71
   /*----- member functions -----*/
 
72
 
 
73
   // Constructor.
 
74
   XxMarkersWidget( 
 
75
      QWidget* parent,
 
76
      bool     threeWay
 
77
   );
 
78
 
 
79
   // Queries.
 
80
   // <group>
 
81
   bool useConditionals() const;
 
82
   bool removeEmptyConditionals() const;
 
83
   QString getConditionalVariable1() const;
 
84
   QString getConditionalVariable2() const;
 
85
   QString getConditionalVariable3() const;
 
86
   // </group>
 
87
 
 
88
 
 
89
public slots:
 
90
 
 
91
   /*----- member functions -----*/
 
92
 
 
93
   void onConflicts();
 
94
   void onConditionals();
 
95
 
 
96
};
 
97
 
 
98
/*==============================================================================
 
99
 * CLASS XxMarkersDialog
 
100
 *============================================================================*/
 
101
 
 
102
// <summary> a dialog for the markers </summary>
 
103
 
 
104
class XxMarkersDialog : public QDialog {
 
105
 
 
106
   Q_OBJECT
 
107
 
 
108
   /*----- types and enumerations -----*/
 
109
 
 
110
   typedef QDialog BaseClass;
 
111
 
 
112
public:
 
113
 
 
114
   /*----- member functions -----*/
 
115
 
 
116
   // Constructor.
 
117
   XxMarkersDialog(
 
118
      QWidget*    parent,
 
119
      const char* name,
 
120
      const bool  threeWay
 
121
   );
 
122
 
 
123
   // Disable the cancel button.
 
124
   void disableCancel();
 
125
 
 
126
   // Method to override the rejection.
 
127
   virtual void reject();
 
128
 
 
129
   /*----- static member functions -----*/
 
130
 
 
131
   // Run the dialog and get the markers.
 
132
   // Returns true on success.
 
133
   static bool getMarkers(
 
134
      QWidget*    parent,
 
135
      const char* name,
 
136
      bool        threeWay,
 
137
      bool&       useConditionals,
 
138
      bool&       removeEmptyConditionals,
 
139
      QString     conditionals[3],
 
140
      bool        noCancel
 
141
   );
 
142
 
 
143
private:
 
144
 
 
145
   /*----- data members -----*/
 
146
 
 
147
   XxMarkersWidget* _markersWidget;
 
148
   QPushButton*     _buttonOk;
 
149
   QPushButton*     _buttonCancel;
 
150
 
 
151
};
 
152
 
 
153
 
 
154
/*==============================================================================
 
155
 * CLASS XxMarkersFileDialog
 
156
 *============================================================================*/
 
157
 
 
158
// <summary> a file dialog with markers added to it </summary>
 
159
 
 
160
class XxMarkersFileDialog : public QFileDialog {
 
161
 
 
162
   Q_OBJECT
 
163
 
 
164
   /*----- types and enumerations -----*/
 
165
 
 
166
   typedef QFileDialog BaseClass;
 
167
 
 
168
public:
 
169
 
 
170
   /*----- member functions -----*/
 
171
 
 
172
   // Constructor.
 
173
   XxMarkersFileDialog( 
 
174
      const QString& dirName,
 
175
      const QString& filter,
 
176
      QWidget*       parent,
 
177
      const char*    name,
 
178
      bool           modal,
 
179
      bool           threeWay
 
180
   );
 
181
 
 
182
   /*----- static member functions -----*/
 
183
 
 
184
   // Special version of getSaveFileName which add marker selection widgets.
 
185
   static QString getSaveFileName( 
 
186
      const QString& startWith,
 
187
      const QString& filter,
 
188
      QWidget*       parent,
 
189
      const char*    name,
 
190
      bool           threeWay,
 
191
      bool&          useConditionals,
 
192
      bool&          removeEmptyConditionals,
 
193
      QString        conditionals[3]
 
194
   );
 
195
 
 
196
private:
 
197
 
 
198
   /*----- data members -----*/
 
199
 
 
200
   XxMarkersWidget* _markersWidget;
 
201
 
 
202
};
 
203
 
 
204
XX_NAMESPACE_END
 
205
 
 
206
#endif