Source-highlight Qt Library
LanguageElemColorForm.h
00001 /*
00002  *  Copyright (C) 2008-2010  Lorenzo Bettini, http://www.lorenzobettini.it
00003  *  License: See COPYING file that comes with this distribution
00004  */
00005 
00006 #ifndef LANGUAGEELEMCOLORFORM_H
00007 #define LANGUAGEELEMCOLORFORM_H
00008 
00009 #include <QtGui/QWidget>
00010 
00011 namespace Ui {
00012     class LanguageElemColorForm;
00013 }
00014 
00015 namespace srchiliteqt {
00016 
00021 class LanguageElemColorForm : public QWidget {
00022     Q_OBJECT
00023     Q_DISABLE_COPY(LanguageElemColorForm)
00024 public:
00025     explicit LanguageElemColorForm(QWidget *parent = 0);
00026     virtual ~LanguageElemColorForm();
00027 
00032     void setColorDescription(const QString &name);
00033 
00038     void setColor(const QColor &color);
00039 
00044     void setBackgroundColor(const QColor &color);
00045 
00049     const QColor &getColor() const {
00050         return foreground;
00051     }
00052 
00056     const QColor &getBackgroundColor() const {
00057         return background;
00058     }
00059 
00060     bool isBold() const;
00061 
00062     void setBold(bool b);
00063 
00064     bool isItalic() const;
00065 
00066     void setItalic(bool i);
00067 
00068     bool isUnderline() const;
00069 
00070     void setUnderline(bool u);
00071 
00072     bool isMonospace() const;
00073 
00074     void setMonospace(bool m);
00075 
00076 protected:
00077     virtual void changeEvent(QEvent *e);
00078 
00079 private:
00080     Ui::LanguageElemColorForm *m_ui;
00081 
00082     QColor foreground;
00083 
00084     QColor background;
00085 
00086 private slots:
00087     void selectBackground();
00088     void selectForeground();
00089 };
00090 
00091 }
00092 
00093 #endif // LANGUAGEELEMCOLORFORM_H