kcoloractions.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef kcoloractions_h
00021 #define kcoloractions_h
00022
00023 #include <kaction.h>
00024
00029 class KColorAction : public KAction
00030 {
00031 Q_OBJECT
00032
00033 public:
00034 enum Type {
00035 TextColor,
00036 FrameColor,
00037 BackgroundColor
00038 };
00039
00040
00041 KColorAction( const QString& text, int accel = 0, QObject* parent = 0, const char* name = 0 );
00042 KColorAction( const QString& text, int accel,
00043 QObject* receiver, const char* slot, QObject* parent, const char* name = 0 );
00044 KColorAction( QObject* parent = 0, const char* name = 0 );
00045
00046
00047 KColorAction( const QString& text, Type type, int accel = 0,
00048 QObject* parent = 0, const char* name = 0 );
00049 KColorAction( const QString& text, Type type, int accel,
00050 QObject* receiver, const char* slot, QObject* parent, const char* name = 0 );
00051
00052 virtual void setColor( const QColor &c );
00053 QColor color() const;
00054
00055 virtual void setType( Type type );
00056 Type type() const;
00057
00058 private:
00059 void init();
00060 void createPixmap();
00061
00062 QColor col;
00063 Type typ;
00064 };
00065
00066
00067 class KSelectColorAction : public KAction
00068 {
00069 Q_OBJECT
00070 public:
00071 enum Type {
00072 TextColor,
00073 LineColor,
00074 FillColor
00075 };
00076
00077 KSelectColorAction( const QString& text, Type type,
00078 const QObject* receiver, const char* slot,
00079 KActionCollection* parent, const char* name );
00080 virtual ~KSelectColorAction();
00081
00082 virtual int plug( QWidget* w, int index = -1 );
00083
00084 QColor color() const;
00085 Type type() const;
00086
00087 public slots:
00088 virtual void setColor( const QColor &c );
00089 virtual void setType( Type t );
00090
00091 signals:
00092 void colorSelected( const QColor& color );
00093
00094 private:
00095 QString whatsThisWithIcon() const;
00096
00097 Type m_type;
00098 QColor m_color;
00099 };
00100
00101 #endif
This file is part of the documentation for lib Library Version 1.4.2.