kchart

kchartColorConfigPage.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1999 Matthias Kalle Dalheimer <kalle@kde.org>
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 
00020 #ifndef __KCHARTCOLORCONFIGPAGE_H__
00021 #define __KCHARTCOLORCONFIGPAGE_H__
00022 
00023 
00024 #include <qwidget.h>
00025 #include <kcolorbutton.h>
00026 
00027 #include "koChart.h"
00028 #include "kchartcolorarray.h"
00029 
00030 class KListBox;
00031 
00032 
00033 namespace KChart
00034 {
00035 
00036 class KChartParams;
00037 
00038 // PENDING(kalle) Make this dynamic.
00039 #define NUMDATACOLORS 6
00040 
00041 class KChartColorConfigPage : public QWidget
00042 {
00043     Q_OBJECT
00044 
00045 public:
00046     KChartColorConfigPage( KChartParams* params, QWidget* parent, KDChartTableData *dat );
00047     void apply();
00048 
00049     void setBackgroundColor( QColor color );
00050     QColor backgroundColor() const;
00051     void setGridColor( QColor color );
00052     QColor gridColor() const;
00053     void setLineColor( QColor color );
00054     QColor lineColor() const;
00055     void setXTitleColor( QColor color );
00056     QColor xTitleColor() const;
00057     void setYTitleColor( QColor color );
00058     QColor yTitleColor() const;
00059 #if 0
00060     void setYTitle2Color( QColor color );
00061     QColor yTitle2Color() const;
00062 #endif
00063     void setXLabelColor( QColor color );
00064     QColor xLabelColor() const;
00065     void setXLineColor( QColor color );
00066     QColor xLineColor() const;
00067     void setXZeroLineColor( QColor color );
00068     QColor xZeroLineColor() const;
00069 
00070     void setYLabelColor( QColor color );
00071     QColor yLabelColor() const;
00072     void setYLineColor( QColor color );
00073     QColor yLineColor() const;
00074     void setYZeroLineColor( QColor color );
00075     QColor yZeroLineColor() const;
00076 #if 0
00077     void setYLabel2Color( QColor color );
00078     QColor yLabel2Color() const;
00079 #endif
00080     /*void setEdgeColor( QColor color );
00081     QColor edgeColor() const;*/
00082 /*     void setDataColor( uint dataset, QColor color ); */
00083 /*     QColor dataColor( uint dataset ) const; */
00084 
00085 private slots:
00086     void activeColorButton();
00087     void changeIndex( int );
00088 
00089 private:
00090     void initDataColorList();
00091 
00092     KChartParams      *m_params;
00093     KDChartTableData  *m_data;
00094 
00095     KColorButton* _lineCB;
00096     KColorButton* _gridCB;
00097     KColorButton* _xtitleCB;
00098     KColorButton* _ytitleCB;
00099 #if 0
00100     KColorButton* _ytitle2CB;
00101 #endif
00102     KColorButton* _xlabelCB;
00103     KColorButton* _ylabelCB;
00104 #if 0
00105     KColorButton* _ylabel2CB;
00106 #endif
00107     KColorButton* _xlineCB;
00108     KColorButton* _ylineCB;
00109 #if 0
00110     KColorButton* _yline2CB;
00111 #endif
00112     KColorButton* _xzerolineCB;
00113     KColorButton* _yzerolineCB;
00114 #if 0
00115     KColorButton* _yzeroline2CB;
00116 #endif
00117 
00118 //  KColorButton* _edgeCB;
00119 //  KColorButton* _dataCB[NUMDATACOLORS];
00120     KListBox* _dataColorLB;
00121     KColorButton* _dataColorCB;
00122     KChartColorArray extColor;
00123     uint index;
00124 };
00125 
00126 
00127 inline void KChartColorConfigPage::setGridColor( QColor color )
00128 {
00129     _gridCB->setColor( color );
00130 }
00131 
00132 
00133 inline QColor KChartColorConfigPage::gridColor() const
00134 {
00135     return _gridCB->color();
00136 }
00137 
00138 
00139 inline void KChartColorConfigPage::setLineColor( QColor color )
00140 {
00141     _lineCB->setColor( color );
00142 }
00143 
00144 
00145 inline QColor KChartColorConfigPage::lineColor() const
00146 {
00147     return _lineCB->color();
00148 }
00149 
00150 
00151 inline void KChartColorConfigPage::setXTitleColor( QColor color )
00152 {
00153     _xtitleCB->setColor( color );
00154 }
00155 
00156 
00157 inline QColor KChartColorConfigPage::xTitleColor() const
00158 {
00159     return _xtitleCB->color();
00160 }
00161 
00162 
00163 inline void KChartColorConfigPage::setYTitleColor( QColor color )
00164 {
00165     _ytitleCB->setColor( color );
00166 }
00167 
00168 
00169 inline QColor KChartColorConfigPage::yTitleColor() const
00170 {
00171     return _ytitleCB->color();
00172 }
00173 
00174 
00175 #if 0
00176 inline void KChartColorConfigPage::setYTitle2Color( QColor color )
00177 {
00178     _ytitle2CB->setColor( color );
00179 }
00180 
00181 
00182 inline QColor KChartColorConfigPage::yTitle2Color() const
00183 {
00184     return _ytitle2CB->color();
00185 }
00186 #endif
00187 
00188 inline void KChartColorConfigPage::setXLabelColor( QColor color )
00189 {
00190     _xlabelCB->setColor( color );
00191 }
00192 
00193 
00194 inline QColor KChartColorConfigPage::xLabelColor() const
00195 {
00196     return _xlabelCB->color();
00197 }
00198 
00199 
00200 inline void KChartColorConfigPage::setYLabelColor( QColor color )
00201 {
00202     _ylabelCB->setColor( color );
00203 }
00204 
00205 
00206 inline QColor KChartColorConfigPage::yLabelColor() const
00207 {
00208     return _ylabelCB->color();
00209 }
00210 
00211 
00212 #if 0
00213 inline void KChartColorConfigPage::setYLabel2Color( QColor color )
00214 {
00215     _ylabel2CB->setColor( color );
00216 }
00217 inline QColor KChartColorConfigPage::yLabel2Color() const
00218 {
00219     return _ylabel2CB->color();
00220 }
00221 #endif
00222 
00223 
00224 inline void KChartColorConfigPage::setXLineColor( QColor color )
00225 {
00226     _xlineCB->setColor( color );
00227 }
00228 inline QColor KChartColorConfigPage::xLineColor() const
00229 {
00230     return _xlineCB->color();
00231 }
00232 
00233 inline void KChartColorConfigPage::setYLineColor( QColor color )
00234 {
00235     _ylineCB->setColor( color );
00236 }
00237 inline QColor KChartColorConfigPage::yLineColor() const
00238 {
00239     return _ylineCB->color();
00240 }
00241 
00242 #if 0
00243 inline void KChartColorConfigPage::setYLine2Color( QColor color )
00244 {
00245     _yline2CB->setColor( color );
00246 }
00247 inline QColor KChartColorConfigPage::yLine2Color() const
00248 {
00249     return _yline2CB->color();
00250 }
00251 #endif
00252 
00253 
00254 inline void KChartColorConfigPage::setXZeroLineColor( QColor color )
00255 {
00256     _xzerolineCB->setColor( color );
00257 }
00258 inline QColor KChartColorConfigPage::xZeroLineColor() const
00259 {
00260     return _xzerolineCB->color();
00261 }
00262 
00263 inline void KChartColorConfigPage::setYZeroLineColor( QColor color )
00264 {
00265     _yzerolineCB->setColor( color );
00266 }
00267 inline QColor KChartColorConfigPage::yZeroLineColor() const
00268 {
00269     return _yzerolineCB->color();
00270 }
00271 
00272 #if 0
00273 inline void KChartColorConfigPage::setYZeroLine2Color( QColor color )
00274 {
00275     _yzeroline2CB->setColor( color );
00276 }
00277 inline QColor KChartColorConfigPage::yZeroLine2Color() const
00278 {
00279     return _yzeroline2CB->color();
00280 }
00281 #endif
00282 
00283 
00284 /*inline void KChartColorConfigPage::setEdgeColor( QColor color )
00285 {
00286     _edgeCB->setColor( color );
00287 }
00288 
00289 
00290 inline QColor KChartColorConfigPage::edgeColor() const
00291 {
00292     return _edgeCB->color();
00293 }*/
00294 
00295 }  //KChart namespace
00296 
00297 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys