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 setTitleColor( QColor color );
00056     QColor titleColor() const;
00057     void setXTitleColor( QColor color );
00058     QColor xTitleColor() const;
00059     void setYTitleColor( QColor color );
00060     QColor yTitleColor() const;
00061 #if 0
00062     void setYTitle2Color( QColor color );
00063     QColor yTitle2Color() const;
00064 #endif
00065     void setXLabelColor( QColor color );
00066     QColor xLabelColor() const;
00067     void setYLabelColor( QColor color );
00068     QColor yLabelColor() const;
00069 #if 0
00070     void setYLabel2Color( QColor color );
00071     QColor yLabel2Color() const;
00072 #endif
00073     /*void setEdgeColor( QColor color );
00074     QColor edgeColor() const;*/
00075 /*     void setDataColor( uint dataset, QColor color ); */
00076 /*     QColor dataColor( uint dataset ) const; */
00077 
00078 private slots:
00079     void activeColorButton();
00080     void changeIndex( int );
00081 
00082 private:
00083     void initDataColorList();
00084 
00085     KChartParams      *m_params;
00086     KDChartTableData  *m_data;
00087 
00088     KColorButton* _lineCB;
00089     KColorButton* _gridCB;
00090     KColorButton* _xtitleCB;
00091     KColorButton* _ytitleCB;
00092 #if 0
00093     KColorButton* _ytitle2CB;
00094 #endif
00095     KColorButton* _xlabelCB;
00096     KColorButton* _ylabelCB;
00097 #if 0
00098     KColorButton* _ylabel2CB;
00099 #endif
00100     //KColorButton* _edgeCB;
00101 //    KColorButton* _dataCB[NUMDATACOLORS];
00102     KListBox* _dataColorLB;
00103     KColorButton* _dataColorCB;
00104     KChartColorArray extColor;
00105     uint index;
00106 };
00107 
00108 
00109 inline void KChartColorConfigPage::setGridColor( QColor color )
00110 {
00111     _gridCB->setColor( color );
00112 }
00113 
00114 
00115 inline QColor KChartColorConfigPage::gridColor() const
00116 {
00117     return _gridCB->color();
00118 }
00119 
00120 
00121 inline void KChartColorConfigPage::setLineColor( QColor color )
00122 {
00123     _lineCB->setColor( color );
00124 }
00125 
00126 
00127 inline QColor KChartColorConfigPage::lineColor() const
00128 {
00129     return _lineCB->color();
00130 }
00131 
00132 
00133 inline void KChartColorConfigPage::setXTitleColor( QColor color )
00134 {
00135     _xtitleCB->setColor( color );
00136 }
00137 
00138 
00139 inline QColor KChartColorConfigPage::xTitleColor() const
00140 {
00141     return _xtitleCB->color();
00142 }
00143 
00144 
00145 inline void KChartColorConfigPage::setYTitleColor( QColor color )
00146 {
00147     _ytitleCB->setColor( color );
00148 }
00149 
00150 
00151 inline QColor KChartColorConfigPage::yTitleColor() const
00152 {
00153     return _ytitleCB->color();
00154 }
00155 
00156 
00157 #if 0
00158 inline void KChartColorConfigPage::setYTitle2Color( QColor color )
00159 {
00160     _ytitle2CB->setColor( color );
00161 }
00162 
00163 
00164 inline QColor KChartColorConfigPage::yTitle2Color() const
00165 {
00166     return _ytitle2CB->color();
00167 }
00168 #endif
00169 
00170 inline void KChartColorConfigPage::setXLabelColor( QColor color )
00171 {
00172     _xlabelCB->setColor( color );
00173 }
00174 
00175 
00176 inline QColor KChartColorConfigPage::xLabelColor() const
00177 {
00178     return _xlabelCB->color();
00179 }
00180 
00181 
00182 inline void KChartColorConfigPage::setYLabelColor( QColor color )
00183 {
00184     _ylabelCB->setColor( color );
00185 }
00186 
00187 
00188 inline QColor KChartColorConfigPage::yLabelColor() const
00189 {
00190     return _ylabelCB->color();
00191 }
00192 
00193 
00194 #if 0
00195 inline void KChartColorConfigPage::setYLabel2Color( QColor color )
00196 {
00197     _ylabel2CB->setColor( color );
00198 }
00199 
00200 
00201 inline QColor KChartColorConfigPage::yLabel2Color() const
00202 {
00203     return _ylabel2CB->color();
00204 }
00205 #endif
00206 
00207 /*inline void KChartColorConfigPage::setEdgeColor( QColor color )
00208 {
00209     _edgeCB->setColor( color );
00210 }
00211 
00212 
00213 inline QColor KChartColorConfigPage::edgeColor() const
00214 {
00215     return _edgeCB->color();
00216 }*/
00217 
00218 }  //KChart namespace
00219 
00220 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys