00001 #ifndef MAINCOLORFORM_H 00002 #define MAINCOLORFORM_H 00003 00004 #include <QtGui/QWidget> 00005 #include <QColor> 00006 00007 namespace Ui { 00008 class MainColorForm; 00009 } 00010 00011 namespace srchiliteqt { 00012 00017 class MainColorForm : public QWidget { 00018 Q_OBJECT 00019 Q_DISABLE_COPY(MainColorForm) 00020 public: 00021 explicit MainColorForm(QWidget *parent = 0); 00022 virtual ~MainColorForm(); 00023 00028 void setColor(const QColor &color); 00029 00034 void setBackgroundColor(const QColor &color); 00035 00039 const QColor &getColor() const { 00040 return foreground; 00041 } 00042 00046 const QColor &getBackgroundColor() const { 00047 return background; 00048 } 00049 00050 protected: 00051 virtual void changeEvent(QEvent *e); 00052 00053 private: 00054 Ui::MainColorForm *m_ui; 00055 00056 QColor foreground; 00057 00058 QColor background; 00059 00060 private slots: 00061 void selectBackground(); 00062 void selectForeground(); 00063 }; 00064 00065 } 00066 00067 #endif // MAINCOLORFORM_H