kalzium
kalziumschemetype.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 * Copyright (C) 2005, 2006 by Pino Toscano, toscano.pino@tiscali.it * 00003 * * 00004 * This program is free software; you can redistribute it and/or modify * 00005 * it under the terms of the GNU General Public License as published by * 00006 * the Free Software Foundation; either version 2 of the License, or * 00007 * (at your option) any later version. * 00008 * * 00009 * This program 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 * 00012 * GNU General Public License for more details. * 00013 * * 00014 * You should have received a copy of the GNU General Public License * 00015 * along with this program; if not, write to the * 00016 * Free Software Foundation, Inc., * 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 00018 ***************************************************************************/ 00019 00020 #ifndef KALZIUMSCHEMETYPE_H 00021 #define KALZIUMSCHEMETYPE_H 00022 00023 class KalziumSchemeType; 00024 00025 #include <QByteArray> 00026 #include <QColor> 00027 #include <QBrush> 00028 #include <QPair> 00029 #include <QRect> 00030 00031 typedef QPair<QString, QBrush> legendPair; 00032 00038 class KalziumSchemeTypeFactory 00039 { 00040 public: 00044 static KalziumSchemeTypeFactory* instance(); 00045 00050 KalziumSchemeType* build( int id ) const; 00056 KalziumSchemeType* build( const QByteArray& id ) const; 00057 00061 QStringList schemes() const; 00062 00063 private: 00064 KalziumSchemeTypeFactory(); 00065 00066 QList<KalziumSchemeType*> m_schemes; 00067 }; 00068 00074 class KalziumSchemeType 00075 { 00076 public: 00080 static KalziumSchemeType* instance(); 00081 00082 virtual ~KalziumSchemeType(); 00083 00088 virtual QByteArray name() const = 0; 00093 virtual QString description() const = 0; 00094 00104 virtual QBrush elementBrush( int el, const QRect& elrect ) const = 0; 00109 virtual QColor textColor( int el ) const = 0; 00110 00114 virtual QList<legendPair> legendItems() const = 0; 00115 00116 protected: 00117 KalziumSchemeType(); 00118 }; 00119 00125 class KalziumMonoColorSchemeType : public KalziumSchemeType 00126 { 00127 public: 00128 static KalziumMonoColorSchemeType* instance(); 00129 00130 QByteArray name() const; 00131 QString description() const; 00132 00133 QBrush elementBrush( int el, const QRect& elrect ) const; 00134 QColor textColor( int el ) const; 00135 00136 QList<legendPair> legendItems() const; 00137 00138 private: 00139 KalziumMonoColorSchemeType(); 00140 }; 00141 00147 class KalziumBlocksSchemeType : public KalziumSchemeType 00148 { 00149 public: 00150 static KalziumBlocksSchemeType* instance(); 00151 00152 QByteArray name() const; 00153 QString description() const; 00154 00155 QBrush elementBrush( int el, const QRect& elrect ) const; 00156 QColor textColor( int el ) const; 00157 00158 QList<legendPair> legendItems() const; 00159 00160 private: 00161 KalziumBlocksSchemeType(); 00162 }; 00163 00169 class KalziumIconicSchemeType : public KalziumSchemeType 00170 { 00171 public: 00172 static KalziumIconicSchemeType* instance(); 00173 00174 QByteArray name() const; 00175 QString description() const; 00176 00177 QBrush elementBrush( int el, const QRect& elrect ) const; 00178 QColor textColor( int el ) const; 00179 00180 QList<legendPair> legendItems() const; 00181 00182 private: 00183 KalziumIconicSchemeType(); 00184 }; 00185 00191 class KalziumFamilySchemeType : public KalziumSchemeType 00192 { 00193 public: 00194 static KalziumFamilySchemeType* instance(); 00195 00196 QByteArray name() const; 00197 QString description() const; 00198 00199 QBrush elementBrush( int el, const QRect& elrect ) const; 00200 QColor textColor( int el ) const; 00201 00202 QList<legendPair> legendItems() const; 00203 00204 private: 00205 KalziumFamilySchemeType(); 00206 }; 00207 00213 class KalziumGroupsSchemeType : public KalziumSchemeType 00214 { 00215 public: 00216 static KalziumGroupsSchemeType* instance(); 00217 00218 QByteArray name() const; 00219 QString description() const; 00220 00221 QBrush elementBrush( int el, const QRect& elrect ) const; 00222 QColor textColor( int el ) const; 00223 00224 QList<legendPair> legendItems() const; 00225 00226 private: 00227 KalziumGroupsSchemeType(); 00228 }; 00229 00230 //X /** 00231 //X * The scheme for the crystal structures. 00232 //X * 00233 //X * @author Carsten Niehaus 00234 //X */ 00235 //X class KalziumCrystalSchemeType : public KalziumSchemeType 00236 //X { 00237 //X public: 00238 //X static KalziumCrystalSchemeType* instance(); 00239 //X 00240 //X QByteArray name() const; 00241 //X QString description() const; 00242 //X 00243 //X QBrush elementBrush( int el, const QRect& elrect ) const; 00244 //X QColor textColor( int el ) const; 00245 //X 00246 //X QList<legendPair> legendItems() const; 00247 //X 00248 //X private: 00249 //X KalziumCrystalSchemeType(); 00250 //X }; 00251 00252 //X /** 00253 //X * @author Carsten Niehaus 00254 //X */ 00255 //X class KalziumDiscoverymapSchemeType : public KalziumSchemeType 00256 //X { 00257 //X public: 00258 //X static KalziumDiscoverymapSchemeType* instance(); 00259 //X 00260 //X QByteArray name() const; 00261 //X QString description() const; 00262 //X 00263 //X QBrush elementBrush( int el, const QRect& elrect ) const; 00264 //X QColor textColor( int el ) const; 00265 //X 00266 //X QList<legendPair> legendItems() const; 00267 //X 00268 //X private: 00269 //X KalziumDiscoverymapSchemeType(); 00270 //X }; 00271 00272 #endif // KALZIUMSCHEMETYPE_H
KDE 4.0 API Reference