1
/* -*- c-file-style: "xxdiff" -*- */
2
/******************************************************************************\
3
* $RCSfile: markers.h,v $
5
* Copyright (C) 1999-2003 Martin Blais <blais@furius.ca>
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.
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.
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.
21
******************************************************************************/
23
#ifndef INCL_XXDIFF_MARKERS
24
#define INCL_XXDIFF_MARKERS
26
/*==============================================================================
27
* EXTERNAL DECLARATIONS
28
*============================================================================*/
30
#ifndef INCL_XXDIFF_DEFS
34
#ifndef INCL_MARKERSWIDGETBASE
35
#include <markersWidgetBase.h>
36
#define INCL_MARKERSWIDGETBASE
39
#ifndef INCL_STD_QFILEDIALOG
40
#include <qfiledialog.h>
41
#define INCL_STD_QFILEDIALOG
44
/*==============================================================================
45
* FORWARD DECLARATIONS
46
*============================================================================*/
52
/*==============================================================================
53
* CLASS XxMarkersWidget
54
*============================================================================*/
56
// <summary> widget for diff markers </summary>
58
// Note: although it should not be visible, this class must be present in the .h
59
// because of moc generation requirements.
61
class XxMarkersWidget : public XxMarkersWidgetBase {
65
/*----- types and enumerations -----*/
67
typedef XxMarkersWidgetBase BaseClass;
71
/*----- member functions -----*/
81
bool useConditionals() const;
82
bool removeEmptyConditionals() const;
83
QString getConditionalVariable1() const;
84
QString getConditionalVariable2() const;
85
QString getConditionalVariable3() const;
91
/*----- member functions -----*/
94
void onConditionals();
98
/*==============================================================================
99
* CLASS XxMarkersDialog
100
*============================================================================*/
102
// <summary> a dialog for the markers </summary>
104
class XxMarkersDialog : public QDialog {
108
/*----- types and enumerations -----*/
110
typedef QDialog BaseClass;
114
/*----- member functions -----*/
123
// Disable the cancel button.
124
void disableCancel();
126
// Method to override the rejection.
127
virtual void reject();
129
/*----- static member functions -----*/
131
// Run the dialog and get the markers.
132
// Returns true on success.
133
static bool getMarkers(
137
bool& useConditionals,
138
bool& removeEmptyConditionals,
139
QString conditionals[3],
145
/*----- data members -----*/
147
XxMarkersWidget* _markersWidget;
148
QPushButton* _buttonOk;
149
QPushButton* _buttonCancel;
154
/*==============================================================================
155
* CLASS XxMarkersFileDialog
156
*============================================================================*/
158
// <summary> a file dialog with markers added to it </summary>
160
class XxMarkersFileDialog : public QFileDialog {
164
/*----- types and enumerations -----*/
166
typedef QFileDialog BaseClass;
170
/*----- member functions -----*/
174
const QString& dirName,
175
const QString& filter,
182
/*----- static member functions -----*/
184
// Special version of getSaveFileName which add marker selection widgets.
185
static QString getSaveFileName(
186
const QString& startWith,
187
const QString& filter,
191
bool& useConditionals,
192
bool& removeEmptyConditionals,
193
QString conditionals[3]
198
/*----- data members -----*/
200
XxMarkersWidget* _markersWidget;