Back to index

scribus-ng  1.3.4.dfsg+svn20071115
colorcombo.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 /*
00008  *  colorcombo.h
00009  *  ScribusCVS
00010  *
00011  *  Created by Jean Ghali on 18.02.06.
00012  *  Copyright 2006 under GPL2. All rights reserved.
00013  *
00014  */
00015 
00016 #ifndef COLORCOMBO_H
00017 #define COLORCOMBO_H
00018 
00019 #include <qcombobox.h>
00020 #include "colorlistbox.h"
00021 
00022 #ifdef QT_MAC
00023 #include <qmacstyle_mac.h>
00024 #endif
00025 
00030 class ColorCombo : public QComboBox 
00031 {
00032        Q_OBJECT
00033 
00034 private:
00035 
00036 #ifdef QT_MAC
00037 
00038        class ScMacStyle : public QMacStyle 
00039        {
00040               virtual int ScMacStyle::styleHint(StyleHint sh, const QWidget * w, 
00041                                          const QStyleOption & so, 
00042                                          QStyleHintReturn * r) const
00043               {
00044               return sh != QStyle::SH_ComboBox_Popup && QMacStyle::styleHint(sh, w, so, r); 
00045               }
00046        };
00047 #endif
00048 
00049 public:
00050 
00051        enum PixmapType
00052        {
00053               smallPixmaps,
00054               widePixmaps,
00055               fancyPixmaps
00056        };
00057 
00058        ColorCombo( QWidget* parent=0, const char* name=0 );
00059        ColorCombo( bool rw, QWidget* parent=0, const char* name=0 );
00060 
00061        void updateBox(ColorList& list, ColorCombo::PixmapType pixType, bool insertNone = true);
00062 
00063        void insertItems(ColorList& list, ColorCombo::PixmapType type);
00064        void insertSmallItem( const ScColor& col, ScribusDoc* doc, const QString& colName );
00065        void insertWideItem ( const ScColor& col, ScribusDoc* doc, const QString& colName );
00066        void insertFancyItem( const ScColor& col, ScribusDoc* doc, const QString& colName );
00067 };
00068 
00069 #endif