Subversion Repositories Scribus

Rev

Rev 18204 | Rev 20173 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4690 mrdocs 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
 
9874 avox 19
#include <QComboBox>
4690 mrdocs 20
 
18247 craig 21
/*
22
 *#ifdef Q_OS_MAC
10223 cbradney 23
#include <QMacStyle>
4690 mrdocs 24
#endif
18247 craig 25
*/
12671 jghali 26
#include "scribusapi.h"
10223 cbradney 27
#include "colorlistbox.h"
28
 
4690 mrdocs 29
/*!
30
    \class ColorCombo colorcombo.h
31
    \brief The ColorCombo widget is a combo box for displaying list of colors.
32
*/
12671 jghali 33
class SCRIBUS_API ColorCombo : public QComboBox
4690 mrdocs 34
{
35
        Q_OBJECT
36
 
37
private:
38
 
18247 craig 39
                /*
18204 fschmid 40
#ifdef Q_OS_MAC
4690 mrdocs 41
        /// use listbox instead of popupmenu for combo boxes
42
        class ScMacStyle : public QMacStyle
43
        {
13062 cbradney 44
                virtual int styleHint(StyleHint sh,
10531 avox 45
                                          const QStyleOption * so,
46
                                          const QWidget * w,
4690 mrdocs 47
                                          QStyleHintReturn * r) const
48
                {
10531 avox 49
                return sh != QStyle::SH_ComboBox_Popup && QMacStyle::styleHint(sh, so, w, r);
4690 mrdocs 50
                }
51
        };
52
#endif
18247 craig 53
*/
4690 mrdocs 54
 
55
public:
56
 
57
        enum PixmapType
58
        {
59
                smallPixmaps,
60
                widePixmaps,
61
                fancyPixmaps
62
        };
63
 
10469 cbradney 64
        ColorCombo( QWidget* parent=0 );
65
        ColorCombo( bool rw, QWidget* parent=0 );
4690 mrdocs 66
 
9874 avox 67
        QString currentColor() const;
68
 
4690 mrdocs 69
        void updateBox(ColorList& list, ColorCombo::PixmapType pixType, bool insertNone = true);
70
 
7850 jghali 71
        void insertItems(ColorList& list, ColorCombo::PixmapType type);
7478 jghali 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 );
14389 cbradney 75
        void initColorList(ColorList* colorList, ScribusDoc* doc, QString colorValue);
4690 mrdocs 76
};
77
 
78
#endif