00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __KCMSTYLE_H
00028 #define __KCMSTYLE_H
00029
00030 #include <tqstring.h>
00031 #include <tqtimer.h>
00032
00033 #include <kcmodule.h>
00034
00035 #include "stylepreview.h"
00036 #include "menupreview.h"
00037
00038 class KComboBox;
00039 class TQCheckBox;
00040 class TQComboBox;
00041 class TQFrame;
00042 class TQGroupBox;
00043 class TQLabel;
00044 class TQListBox;
00045 class TQListViewItem;
00046 class TQSettings;
00047 class TQSlider;
00048 class TQSpacerItem;
00049 class TQStyle;
00050 class TQTabWidget;
00051 class TQVBoxLayout;
00052 class StyleConfigDialog;
00053 class WidgetPreview;
00054
00055 struct StyleEntry {
00056 TQString name;
00057 TQString desc;
00058 TQString configPage;
00059 bool hidden;
00060 };
00061
00062 class KCMStyle : public KCModule
00063 {
00064 Q_OBJECT
00065
00066 public:
00067 KCMStyle( TQWidget* parent = 0, const char* name = 0 );
00068 ~KCMStyle();
00069
00070 virtual void load();
00071 virtual void load(bool useDefaults);
00072 virtual void save();
00073 virtual void defaults();
00074
00075 protected:
00076 bool findStyle( const TQString& str, int& combobox_item );
00077 void switchStyle(const TQString& styleName, bool force = false);
00078 void setStyleRecursive(TQWidget* w, TQStyle* s);
00079
00080 void loadStyle( KConfig& config );
00081 void loadEffects( KConfig& config );
00082 void loadMisc( KConfig& config );
00083 void addWhatsThis();
00084
00085 protected slots:
00086 void styleSpecificConfig();
00087 void updateConfigButton();
00088
00089 void setEffectsDirty();
00090 void setToolbarsDirty();
00091 void setStyleDirty();
00092
00093 void styleChanged();
00094 void menuEffectChanged( bool enabled );
00095 void menuEffectChanged();
00096 void menuEffectTypeChanged();
00097
00098 private:
00099 TQString currentStyle();
00100
00101 bool m_bEffectsDirty, m_bStyleDirty, m_bToolbarsDirty;
00102 TQDict<StyleEntry> styleEntries;
00103 TQMap <TQString,TQString> nameToStyleKey;
00104
00105 TQVBoxLayout* mainLayout;
00106 TQTabWidget* tabWidget;
00107 TQWidget *page1, *page2, *page3;
00108 TQVBoxLayout* page1Layout;
00109 TQVBoxLayout* page2Layout;
00110 TQVBoxLayout* page3Layout;
00111
00112
00113 TQGroupBox* gbWidgetStyle;
00114 TQVBoxLayout* gbWidgetStyleLayout;
00115 TQHBoxLayout* hbLayout;
00116 KComboBox* cbStyle;
00117 TQPushButton* pbConfigStyle;
00118 TQLabel* lblStyleDesc;
00119 StylePreview* stylePreview;
00120 TQStyle* appliedStyle;
00121 TQPalette palette;
00122
00123
00124 TQCheckBox* cbEnableEffects;
00125
00126 TQFrame* containerFrame;
00127 TQGridLayout* containerLayout;
00128 TQComboBox* comboTooltipEffect;
00129 TQComboBox* comboRubberbandEffect;
00130 TQComboBox* comboComboEffect;
00131 TQComboBox* comboMenuEffect;
00132 TQComboBox* comboMenuHandle;
00133
00134 TQLabel* lblTooltipEffect;
00135 TQLabel* lblRubberbandEffect;
00136 TQLabel* lblComboEffect;
00137 TQLabel* lblMenuEffect;
00138 TQLabel* lblMenuHandle;
00139 TQSpacerItem* comboSpacer;
00140
00141 TQFrame* menuContainer;
00142 TQGridLayout* menuContainerLayout;
00143 MenuPreview* menuPreview;
00144 TQVBox* sliderBox;
00145 TQSlider* slOpacity;
00146 TQComboBox* comboMenuEffectType;
00147 TQLabel* lblMenuEffectType;
00148 TQLabel* lblMenuOpacity;
00149 TQCheckBox* cbMenuShadow;
00150
00151
00152 TQGroupBox* gbVisualAppearance;
00153
00154 TQCheckBox* cbHoverButtons;
00155 TQCheckBox* cbTransparentToolbars;
00156 TQCheckBox* cbEnableTooltips;
00157 TQComboBox* comboToolbarIcons;
00158
00159 TQCheckBox* cbIconsOnButtons;
00160 TQCheckBox* cbTearOffHandles;
00161 };
00162
00163 #endif // __KCMSTYLE_H
00164
00165