libs/flake
KoCanvasResourceProvider.hGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KO_CANVAS_RESOURCE_PROVIDER_H
00022 #define KO_CANVAS_RESOURCE_PROVIDER_H
00023
00024 #include <QObject>
00025 #include <QHash>
00026 #include <QVariant>
00027 #include <QSizeF>
00028
00029 #include <KoID.h>
00030 #include "flake_export.h"
00031
00032 #include "FlakeColor.h"
00033
00034 class KoShape;
00035 class KoLineBorder;
00036
00043 namespace KoCanvasResource
00044 {
00045
00049 enum CanvasResource {
00050 ForegroundColor,
00051 BackgroundColor,
00052 ActiveBorder,
00053 HandleRadius,
00054 GrabSensitivity,
00055 PageSize,
00056 DocumentIsLoading,
00057 Unit,
00058 CurrentPage,
00059 ActiveStyleType,
00060 KarbonStart = 1000,
00061 KexiStart = 2000,
00062 KivioStart = 3000,
00063 KPlatoStart = 4000,
00064 KPresenterStart = 5000,
00065 KritaStart = 6000,
00066 KSpreadStart = 7000,
00067 KWordStart = 8000,
00068 KoPageAppStart = 9000
00069 };
00070
00071 }
00072
00080 class FLAKE_EXPORT KoCanvasResourceProvider : public QObject
00081 {
00082 Q_OBJECT
00083
00084 public:
00085
00090 explicit KoCanvasResourceProvider(QObject * parent = 0);
00091 ~KoCanvasResourceProvider();
00092
00098 void setResource(int key, const QVariant & value);
00099
00105 void setResource(int key, const KoColor & color);
00106
00112 void setResource(int key, const KoID & id);
00118 void setResource(int key, KoShape* shape);
00119
00125 QVariant resource(int key);
00126
00131 void setForegroundColor(const KoColor & color);
00132
00136 KoColor foregroundColor();
00137
00142 void setBackgroundColor(const KoColor & color);
00146 KoColor backgroundColor();
00147
00153 void setHandleRadius(int handleSize);
00155 int handleRadius();
00156
00162 void setGrabSensitivity(uint grabSensitivity);
00164 uint grabSensitivity();
00165
00167 void setActiveBorder( const KoLineBorder &border );
00168
00170 KoLineBorder activeBorder();
00171
00176 void setUnitChanged();
00177
00182 bool boolResource(int key) const;
00183
00188 int intResource(int key) const;
00189
00194 qreal doubleResource(int key) const;
00195
00200 KoColor koColorResource(int key);
00201
00206 KoID koIDResource(int key);
00207
00212 KoShape * koShapeResource(int key);
00213
00218 QString stringResource(int key);
00219
00224 QSizeF sizeResource(int key);
00225
00230 bool hasResource(int key);
00231
00237 void clearResource(int key);
00238
00239 signals:
00246 void resourceChanged(int key, const QVariant & value);
00247
00248 private:
00249 KoCanvasResourceProvider(const KoCanvasResourceProvider&);
00250 KoCanvasResourceProvider& operator=(const KoCanvasResourceProvider&);
00251
00252 private:
00253 class Private;
00254 Private *const d;
00255 };
00256
00257 #endif // KO_CANVAS_RESOURCE_PROVIDER_H
|