Source-highlight Qt Library
LanguageElemColorForm.h
1 /*
2  * Copyright (C) 2008-2010 Lorenzo Bettini, http://www.lorenzobettini.it
3  * License: See COPYING file that comes with this distribution
4  */
5 
6 #ifndef LANGUAGEELEMCOLORFORM_H
7 #define LANGUAGEELEMCOLORFORM_H
8 
9 #include <QtGui/QWidget>
10 
11 namespace Ui {
12  class LanguageElemColorForm;
13 }
14 
15 namespace srchiliteqt {
16 
21 class LanguageElemColorForm : public QWidget {
22  Q_OBJECT
23  Q_DISABLE_COPY(LanguageElemColorForm)
24 public:
25  explicit LanguageElemColorForm(QWidget *parent = 0);
26  virtual ~LanguageElemColorForm();
27 
32  void setColorDescription(const QString &name);
33 
38  void setColor(const QColor &color);
39 
44  void setBackgroundColor(const QColor &color);
45 
49  const QColor &getColor() const {
50  return foreground;
51  }
52 
56  const QColor &getBackgroundColor() const {
57  return background;
58  }
59 
60  bool isBold() const;
61 
62  void setBold(bool b);
63 
64  bool isItalic() const;
65 
66  void setItalic(bool i);
67 
68  bool isUnderline() const;
69 
70  void setUnderline(bool u);
71 
72  bool isMonospace() const;
73 
74  void setMonospace(bool m);
75 
76 protected:
77  virtual void changeEvent(QEvent *e);
78 
79 private:
81 
82  QColor foreground;
83 
84  QColor background;
85 
86 private slots:
87  void selectBackground();
88  void selectForeground();
89 };
90 
91 }
92 
93 #endif // LANGUAGEELEMCOLORFORM_H
Definition: ColorDialog.cpp:12
Definition: ColorDialog.h:15
void setColorDescription(const QString &name)
Sets the color description label.
Definition: LanguageElemColorForm.cpp:47
const QColor & getColor() const
Definition: LanguageElemColorForm.h:49
const QColor & getBackgroundColor() const
Definition: LanguageElemColorForm.h:56
void setColor(const QColor &color)
Sets the color of the foreground button (if valid)
Definition: LanguageElemColorForm.cpp:51
A form that can be used to select the style of a language element to highlight (for instance...
Definition: LanguageElemColorForm.h:21
Definition: ui_LanguageElemColorForm.h:109
void setBackgroundColor(const QColor &color)
Sets the color of the background button (if valid)
Definition: LanguageElemColorForm.cpp:58