krita

kis_colorspace_factory_registry.h

00001 /*
00002  *  Copyright (c) 2003 Patrick Julien  <freak@codepimps.org>
00003  *  Copyright (c) 2004 Cyrille Berger <cberger@cberger.net>
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018  */
00019 
00020 #ifndef KIS_COLORSPACE_FACTORY_REGISTRY_H_
00021 #define KIS_COLORSPACE_FACTORY_REGISTRY_H_
00022 #include "qobject.h"
00023 #include "kis_generic_registry.h"
00024 #include "kis_colorspace.h"
00025 
00026 class QStringList;
00027 class KisPaintDeviceAction;
00028 
00035 class KisColorSpaceFactoryRegistry : public QObject,  public KisGenericRegistry<KisColorSpaceFactory *> {
00036 
00037 
00038     Q_OBJECT
00039 
00040 public:
00041 
00050     KisColorSpaceFactoryRegistry(QStringList profileFileNames);
00051 
00052     virtual ~KisColorSpaceFactoryRegistry();
00053 
00057     void addProfile(KisProfile * p);
00058 
00063     KisProfile *  getProfileByName(const QString & name);
00064 
00068     QValueVector<KisProfile *>  profilesFor(KisColorSpaceFactory * cs);
00069 
00070     QValueVector<KisProfile *>  profilesFor(KisID id);
00071 
00075     KisColorSpace *  getColorSpace(const KisID & csID, const QString & profileName);
00076 
00080     KisColorSpace * getColorSpace(const KisID & csID, const KisProfile * profile);
00081 
00085     KisColorSpace * getAlpha8();
00086 
00090     KisColorSpace * getRGB8();
00091 
00098     void addPaintDeviceAction(KisColorSpace* cs, KisPaintDeviceAction* action);
00099 
00103     QValueVector<KisPaintDeviceAction *> paintDeviceActionsFor(KisColorSpace* cs);
00104 
00105 private:
00106     KisColorSpaceFactoryRegistry();
00107     KisColorSpaceFactoryRegistry(const KisColorSpaceFactoryRegistry&);
00108     KisColorSpaceFactoryRegistry operator=(const KisColorSpaceFactoryRegistry&);
00109 
00110 private:
00111 
00112     QMap<QString, KisProfile * > m_profileMap;
00113     QMap<QString, KisColorSpace * > m_csMap;
00114     typedef QValueVector<KisPaintDeviceAction *> PaintActionVector;
00115     QMap<KisID, PaintActionVector> m_paintDevActionMap;
00116     KisColorSpace *m_alphaCs;
00117 };
00118 
00119 #endif // KIS_COLORSPACE_FACTORY_REGISTRY_H_
00120 
KDE Home | KDE Accessibility Home | Description of Access Keys