F:/KPlato/koffice/libs/flake/KoCanvasResourceProvider.h

Aller à la documentation de ce fichier.
00001 /*
00002  *  Copyright (c) 2006 Boudewijn Rempt
00003  *
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017    Boston, MA 02110-1301, USA.
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         // XXX: Maybe we should move the next section to Kritas classes.
00044         //      (where there is a new enum with the first value being
00045         //          Foo = KoCanvasResourceProvider::Krita+1
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_

Généré le Wed Nov 22 23:40:59 2006 pour KPlato par  doxygen 1.5.1-p1