2 Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 #ifndef COLORSCHEMEEDITOR_H
21 #define COLORSCHEMEEDITOR_H
24 #include <QtGui/QWidget>
27 #include "ColorScheme.h"
29 class QTableWidgetItem
;
33 class ColorSchemeEditor
;
42 * A dialog for editing color schemes.
44 * After creation, the dialog can be initialised with the settings
45 * of a color scheme using the setup() method.
47 * The dialog creates a copy of the supplied color scheme to which
48 * any changes made are applied. The modified color scheme
49 * can be retrieved using the colorScheme() method.
51 * When changes are made the colorsChanged() signal is emitted.
53 class ColorSchemeEditor
: public QWidget
58 /** Constructs a new color scheme editor with the specified parent. */
59 ColorSchemeEditor(QWidget
* parent
= 0);
60 virtual ~ColorSchemeEditor();
62 /** Initialises the dialog with the properties of the specified color scheme. */
63 void setup(const ColorScheme
* scheme
);
64 /** Returns the modified color scheme. */
65 ColorScheme
* colorScheme() const;
68 /** Emitted when the colors in the color scheme change. */
69 void colorsChanged(ColorScheme
* scheme
);
72 /** Sets the text displayed in the description edit field. */
73 void setDescription(const QString
& description
);
76 void setTransparencyPercentLabel(int percent
);
77 void setRandomizedBackgroundColor(bool randomized
);
78 void editColorItem(QTableWidgetItem
* item
);
81 void setupColorTable(const ColorScheme
* table
);
83 Ui::ColorSchemeEditor
* _ui
;
89 #endif // COLORSCHEMEEDITOR_H