00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KO_CANVAS_RESOURCE_PROVIDER_
00020 #define KO_CANVAS_RESOURCE_PROVIDER_
00021
00022 #include <QObject>
00023 #include <QHash>
00024 #include <QVariant>
00025
00026 #include <KoID.h>
00027
00028 class KoColor;
00029
00030 namespace KoCanvasResource {
00031
00032 enum EnumCanvasResource {
00033 ForegroundColor,
00034 BackgroundColor,
00035 CompositeOperation,
00036 CompositeOpacity,
00037 KarbonStart = 1000,
00038 KexiStart = 2000,
00039 KivioStart = 3000,
00040 KPlatoStart = 4000,
00041 KPresenterStart = 5000,
00042 KritaStart = 6000,
00043
00044
00045
00046 HdrExposure,
00047 CurrentBrush,
00048 CurrentPattern,
00049 CurrentGradient,
00050 CurrentPaintop,
00051 CurrentPaintopSettings,
00052 CurrentKritaLayer,
00053 KSpreadStart = 7000,
00054 KWordStart = 8000
00055 };
00056
00057 }
00058
00065 class KoCanvasResourceProvider : public QObject {
00066
00067 Q_OBJECT
00068
00069 public:
00070
00071 KoCanvasResourceProvider(QObject * parent);
00072 ~KoCanvasResourceProvider() {}
00073
00074 void setResource( KoCanvasResource::EnumCanvasResource key, const QVariant & value );
00075
00078 QVariant resource(KoCanvasResource::EnumCanvasResource key);
00079
00080
00081 void setKoColor( KoCanvasResource::EnumCanvasResource key, const KoColor & color );
00082 KoColor koColor( KoCanvasResource::EnumCanvasResource key );
00083
00084 void setForegroundColor( const KoColor & color );
00085 KoColor foregroundColor();
00086
00087 void setBackgroundColor( const KoColor & color );
00088 KoColor backgroundColor();
00089
00090 void setKoID( KoCanvasResource::EnumCanvasResource key, const KoID & id );
00091 KoID koID(KoCanvasResource::EnumCanvasResource key);
00092
00093 signals:
00094
00095 void sigResourceChanged(KoCanvasResource::EnumCanvasResource key, const QVariant & res);
00096
00097 private:
00098
00099 KoCanvasResourceProvider(const KoCanvasResourceProvider&);
00100 KoCanvasResourceProvider& operator=(const KoCanvasResourceProvider&);
00101
00102 private:
00103 QVariant m_empty;
00104 QHash<int, QVariant> m_resources;
00105
00106 };
00107
00108 #endif // KO_CANVAS_RESOURCE_PROVIDER_