Back to index

scribus-ng  1.3.4.dfsg+svn20071115
colorlistbox.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #ifndef COLORLISTBOX_H
00008 #define COLORLISTBOX_H
00009 
00010 #include <qlistbox.h>
00011 #include <qcolor.h>
00012 #include <qguardedptr.h>
00013 
00014 #include "colorsetmanager.h"
00015 #include "scribusapi.h"
00016 #include "scribusstructs.h"
00017 #include "sclistboxpixmap.h"
00018 #include "query.h"
00019 #include "scguardedptr.h"
00020 
00021 class DynamicTip;
00022 class ScribusDoc;
00023 class ColorListBox;
00024 
00025 class SCRIBUS_API ColorSmallPixmapItem : public ScListBoxPixmap<15,15>
00026 {
00027        protected:
00028               ScColor m_color;
00029               ScGuardedPtr<ScribusDoc> m_doc;
00030        public:
00031               ColorSmallPixmapItem( const ScColor& col, ScribusDoc* doc, const QString colName );
00032               ~ColorSmallPixmapItem() {};
00033 
00034               virtual void redraw(void);
00035               virtual int rtti() const { return 654873547; };
00036 };
00037 
00038 class SCRIBUS_API ColorWidePixmapItem : public ScListBoxPixmap<30,15>
00039 {
00040        protected:
00041               ScColor m_color;
00042               ScGuardedPtr<ScribusDoc> m_doc;
00043        public:
00044               ColorWidePixmapItem( const ScColor& col, ScribusDoc* doc, const QString colName );
00045               ~ColorWidePixmapItem() {};
00046 
00047               virtual void redraw(void);
00048               virtual int rtti() const { return 654873548; };
00049 };
00050 
00051 class SCRIBUS_API ColorFancyPixmapItem : public ScListBoxPixmap<60,15>
00052 {
00053        protected:
00054               ScColor m_color;
00055               ScGuardedPtr<ScribusDoc> m_doc;
00056        public:
00057               ColorFancyPixmapItem( const ScColor& col, ScribusDoc* doc, const QString colName );
00058               ~ColorFancyPixmapItem() {};
00059 
00060               virtual void redraw(void);
00061               virtual int rtti() const { return 654873549; };
00062 };
00063 
00071 class SCRIBUS_API ColorListBox : public QListBox
00072 {
00073        Q_OBJECT
00074 
00075        public:
00076 
00077               enum PixmapType
00078               {
00079                      smallPixmap,
00080                      widePixmap,
00081                      fancyPixmap
00082               };
00083 
00086               ColorListBox(QWidget * parent = 0, const char * name = 0, WFlags f = 0);
00087 
00093               void updateBox(ColorList& list, ColorListBox::PixmapType type);
00094 
00099               void insertItems(ColorList& list, ColorListBox::PixmapType type);
00100 
00103               void insertSmallPixmapItems(ColorList& list);
00104 
00107               void insertWidePixmapItems(ColorList& list);
00108 
00111               void insertFancyPixmapItems(ColorList& list);
00112 };
00113 
00114 #endif