Scribus
Open source desktop publishing at your fingertips
colorcombo.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 /*
8  * colorcombo.h
9  * ScribusCVS
10  *
11  * Created by Jean Ghali on 18.02.06.
12  * Copyright 2006 under GPL2. All rights reserved.
13  *
14  */
15 
16 #ifndef COLORCOMBO_H
17 #define COLORCOMBO_H
18 
19 #include <QComboBox>
20 
21 /*
22  *#ifdef Q_OS_MAC
23 #include <QMacStyle>
24 #endif
25 */
26 #include "scribusapi.h"
27 #include "colorlistbox.h"
28 
33 class SCRIBUS_API ColorCombo : public QComboBox
34 {
35  Q_OBJECT
36 
37 private:
38 
39  /*
40 #ifdef Q_OS_MAC
42  class ScMacStyle : public QMacStyle
43  {
44  virtual int styleHint(StyleHint sh,
45  const QStyleOption * so,
46  const QWidget * w,
47  QStyleHintReturn * r) const
48  {
49  return sh != QStyle::SH_ComboBox_Popup && QMacStyle::styleHint(sh, so, w, r);
50  }
51  };
52 #endif
53 */
54 
55 public:
56 
57  enum PixmapType
58  {
59  smallPixmaps,
60  widePixmaps,
61  fancyPixmaps
62  };
63 
64  ColorCombo( QWidget* parent=0 );
65  ColorCombo( bool rw, QWidget* parent=0 );
66 
67  QString currentColor() const;
68 
69  void updateBox(ColorList& list, ColorCombo::PixmapType pixType, bool insertNone = true);
70 
71  void insertItems(ColorList& list, ColorCombo::PixmapType type);
72  void insertSmallItem(const ScColor& col, ScribusDoc* doc, const QString& colName);
73  void insertWideItem (const ScColor& col, ScribusDoc* doc, const QString& colName);
74  void insertFancyItem(const ScColor& col, ScribusDoc* doc, const QString& colName);
75  void initColorList(ColorList* colorList, ScribusDoc* doc, QString colorValue);
76 };
77 
78 #endif
Definition: sccolor.h:51
The ColorCombo widget is a combo box for displaying list of colors.
Definition: colorcombo.h:33
Definition: sccolor.h:155
the Document Class
Definition: scribusdoc.h:90