krita

kis_dlg_preferences.h

00001 /*
00002  *  preferencesdlg.h - part of KImageShop^WKrita
00003  *
00004  *  Copyright (c) 1999 Michael Koch <koch@kde.org>
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  */
00020 
00021 #ifndef __preferencesdlg_h__
00022 #define __preferencesdlg_h__
00023 
00024 #include <qwidget.h>
00025 
00026 #include <kdialogbase.h>
00027 
00028 #include <kopalettemanager.h>
00029 
00030 #include "kis_canvas.h"
00031 
00032 #include "wdggeneralsettings.h"
00033 #include "wdgtabletsettings.h"
00034 #include "wdgtabletdevicesettings.h"
00035 #include "wdgperformancesettings.h"
00036 #include "wdgdisplaysettings.h"
00037 #include "wdggridsettings.h"
00038 
00039 class QLineEdit;
00040 class QCheckBox;
00041 class KURLRequester;
00042 class WdgColorSettings;
00043 class KisCmbIDList;
00044 class KisID;
00045 
00049 class GeneralTab : public WdgGeneralSettings
00050 {
00051     Q_OBJECT
00052 
00053 public:
00054 
00055     GeneralTab( QWidget *parent = 0, const char *name = 0 );
00056 
00057     enumCursorStyle cursorStyle();
00058     enumKoDockability dockability();
00059     float dockerFontSize();
00060     
00061     void setDefault();
00062 
00063 };
00064 
00065 //=======================
00066 
00067 class ColorSettingsTab : public QWidget
00068 {
00069     Q_OBJECT
00070 
00071 public:
00072 
00073     ColorSettingsTab( QWidget *parent = 0, const char * name = 0 );
00074 
00075 private slots:
00076 
00077     void refillMonitorProfiles(const KisID & s);
00078     void refillPrintProfiles(const KisID & s);
00079 
00080 public:
00081     void setDefault();
00082     WdgColorSettings * m_page;
00083 };
00084 
00085 
00089 class PerformanceTab : public WdgPerformanceSettings
00090 {
00091 Q_OBJECT
00092 
00093 public:
00094     PerformanceTab( QWidget *parent = 0, const char *name = 0 );
00095 
00096 public:
00097     void setDefault();
00098 };
00099 
00100 //=======================
00101 
00102 
00106 class TabletSettingsTab : public WdgTabletSettings
00107 {
00108 Q_OBJECT
00109 
00110 public:
00111     TabletSettingsTab( QWidget *parent = 0, const char *name = 0 );
00112 
00113 public:
00114     void setDefault();
00115     void applySettings();
00116 
00117 private slots:
00118     void slotActivateDevice(int deviceIndex);
00119     void slotSetDeviceEnabled(bool enabled);
00120     void slotConfigureDevice();
00121     void applyTabletDeviceSettings();
00122 
00123 #ifdef EXTENDED_X11_TABLET_SUPPORT
00124 
00125 private:
00126     class DeviceSettings {
00127     public:
00128         DeviceSettings(KisCanvasWidget::X11TabletDevice *tabletDevice, bool enabled, 
00129                        Q_INT32 xAxis, Q_INT32 yAxis, Q_INT32 pressureAxis, 
00130                        Q_INT32 xTiltAxis, Q_INT32 yTiltAxis, Q_INT32 wheelAxis,
00131                        Q_INT32 toolIDAxis, Q_INT32 serialNumberAxis);
00132         DeviceSettings();
00133 
00134         void applySettings();
00135 
00136         void setEnabled(bool enabled);
00137         bool enabled() const;
00138     
00139         Q_INT32 numAxes() const;
00140 
00141         void setXAxis(Q_INT32 axis);
00142         void setYAxis(Q_INT32 axis);
00143         void setPressureAxis(Q_INT32 axis);
00144         void setXTiltAxis(Q_INT32 axis);
00145         void setYTiltAxis(Q_INT32 axis);
00146         void setWheelAxis(Q_INT32 axis);
00147         void setToolIDAxis(Q_INT32 axis);
00148         void setSerialNumberAxis(Q_INT32 axis);
00149     
00150         Q_INT32 xAxis() const;
00151         Q_INT32 yAxis() const;
00152         Q_INT32 pressureAxis() const;
00153         Q_INT32 xTiltAxis() const;
00154         Q_INT32 yTiltAxis() const;
00155         Q_INT32 wheelAxis() const;
00156         Q_INT32 toolIDAxis() const;
00157         Q_INT32 serialNumberAxis() const;
00158     
00159     private:
00160         KisCanvasWidget::X11TabletDevice *m_tabletDevice;
00161 
00162         bool m_enabled;
00163         Q_INT32 m_xAxis;
00164         Q_INT32 m_yAxis;
00165         Q_INT32 m_pressureAxis;
00166         Q_INT32 m_xTiltAxis;
00167         Q_INT32 m_yTiltAxis;
00168         Q_INT32 m_wheelAxis;
00169         Q_INT32 m_toolIDAxis;
00170         Q_INT32 m_serialNumberAxis;
00171     };
00172 
00173     class TabletDeviceSettingsDialog : public KDialogBase {
00174         typedef KDialogBase super;
00175     
00176     public:
00177         TabletDeviceSettingsDialog(const QString& deviceName,
00178                                    DeviceSettings settings,
00179                                    QWidget *parent = 0,
00180                                    const char *name = 0);
00181         virtual ~TabletDeviceSettingsDialog();
00182 
00183         DeviceSettings settings();
00184     
00185     private:
00186         WdgTabletDeviceSettings *m_page;
00187         DeviceSettings m_settings;
00188     };
00189     
00190     void initTabletDevices();
00191 
00192     QValueVector<DeviceSettings> m_deviceSettings;
00193 #endif
00194 };
00195 
00196 //=======================
00197 
00198 
00202 class DisplaySettingsTab : public WdgDisplaySettings
00203 {
00204 Q_OBJECT
00205 
00206 public:
00207     DisplaySettingsTab( QWidget *parent = 0, const char *name = 0 );
00208 
00209 public:
00210     void setDefault();
00211 protected slots:
00212     void slotUseOpenGLToggled(bool isChecked);
00213 };
00214 
00215 //=======================
00216 
00217 
00221 class GridSettingsTab : public WdgGridSettingsBase {
00222     Q_OBJECT
00223     public:
00224         GridSettingsTab(QWidget* parent);
00225     public:
00226         void setDefault();
00227     private slots:
00228         void linkSpacingToggled(bool);
00229         void spinBoxHSpacingChanged(int );
00230         void spinBoxVSpacingChanged(int );
00231     private:
00232         bool m_linkSpacing;
00233 };
00234 
00235 //=======================
00236 
00237 
00241 class PreferencesDialog : public KDialogBase
00242 {
00243     Q_OBJECT
00244 
00245 public:
00246 
00247     static bool editPreferences();
00248 
00249 
00250 protected:
00251 
00252     PreferencesDialog( QWidget *parent = 0, const char *name = 0 );
00253     ~PreferencesDialog();
00254 
00255 protected:
00256 
00257     GeneralTab* m_general;
00258     ColorSettingsTab* m_colorSettings;
00259     PerformanceTab* m_performanceSettings;
00260     TabletSettingsTab * m_tabletSettings;
00261     DisplaySettingsTab * m_displaySettings;
00262     GridSettingsTab* m_gridSettings;
00263 
00264 protected slots:
00265 
00266     void slotDefault();
00267 
00268 };
00269 
00270 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys