summaryrefslogtreecommitdiffstats
path: root/src/komposesettings.h
blob: 7d2efa5067aeeea318f62f5bef5f1d254d7b97b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
//
// C++ Interface: komposesettings
//
// Description:
//
//
// Author: Hans Oischinger <hans.oischinger@kde-mail.net>, (C) 2004
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef KOMPOSESETTINGS_H
#define KOMPOSESETTINGS_H

#include <tqobject.h>
#include <tqcolor.h>
#include <tqfont.h>

#define MAX_DESKTOPS 16

enum KomposeDisplay { KOMPOSEDISPLAY_WORLD, KOMPOSEDISPLAY_VIRTUALDESKS, KOMPOSEDISPLAY_CURRENTDESK };

class TDEGlobalAccel;
class TQFontMetrics;


/**
@author Hans Oischinger
*/
class KomposeSettings : public TQObject
{
  Q_OBJECT
protected:
  KomposeSettings(TQObject *parent = 0, const char *name = 0);

  ~KomposeSettings();

public:
  static KomposeSettings *instance();
  void readConfig();
  void writeConfig();

  bool hasDialogOpen() { return dialogOpen; }
  TDEGlobalAccel *getGlobalAccel() const { return globalAccel; }

  bool getUseComposite() const { return useComposite; }
  void setUseComposite( bool b ) { useComposite = b; }

  bool getPassiveScreenshots() const { return passiveScreenshots; }
  void setPassiveScreenshots( bool b ) { passiveScreenshots = b; }
  uint getScreenshotGrabDelay() { return screenshotGrabDelay; }
  void setScreenshotGrabDelay( uint val ) { screenshotGrabDelay=val; }
  bool getDynamicVirtDeskLayout() const { return dynamicVirtDeskLayout; }
  void setDynamicVirtDeskLayout( bool b ) { dynamicVirtDeskLayout = b; }
  bool getImageEffects() const { return imageEffects; }
  void setImageEffects( bool b ) { imageEffects = b; }

  int  getDefaultView() const { return defaultView; }
  void setDefaultView( int d ) { defaultView = d; }
  int getIconSize() { return iconSize; }
  void setIconSize( int i ) { iconSize = i; }
  int getShowIcons() { return showIcons; }
  void setShowIcons( bool b ) { showIcons = b; }
  int getIconSizePixels();

  void setWindowTitleFont( TQFont f ) { windowTitleFont = f; }
  const TQFont& getWindowTitleFont() const { return windowTitleFont; }
  int getShowWindowTitles() { return showWindowTitles; }
  void setShowWindowTitles( bool b ) { showWindowTitles = b; }
  int getShowWindowTitleShadow() { return showWindowTitleShadow; }
  void setShowWindowTitleShadow( bool b ) { showWindowTitleShadow = b; }
  const TQColor& getWindowTitleFontColor() const { return windowTitleFontColor; }
  void setWindowTitleFontColor( TQColor c ) { windowTitleFontColor = c; }
  const TQColor& getWindowTitleFontShadowColor() const { return windowTitleFontShadowColor; }
  void setWindowTitleFontShadowColor( TQColor c ) { windowTitleFontShadowColor = c; }

  const TQFontMetrics* getWindowTitleFontMetrics() { return windowTitleFontMetrics; }
  int getWindowTitleFontAscent() { return windowTitleFontAscent; }
  int getWindowTitleFontHeight() { return windowTitleFontHeight; }

  void setDesktopTitleFont( TQFont f ) { desktopTitleFont = f; }
  const TQFont& getDesktopTitleFont() const { return desktopTitleFont; }
  const TQColor& getDesktopTitleFontColor() const { return desktopTitleFontColor; }
  void setDesktopTitleFontColor( TQColor c ) { desktopTitleFontColor = c; }
  const TQColor& getDesktopTitleFontHighlightColor() const { return desktopTitleFontHighlightColor; }
  void setDesktopTitleFontHighlightColor( TQColor c ) { desktopTitleFontHighlightColor = c; }

  bool getCacheScaledPixmaps() const { return cacheScaledPixmaps; }
  void setCacheScaledPixmaps( bool b ) { cacheScaledPixmaps = b; }

  bool getActivateOnTopLeftCorner() const { return activateOnTopLeftCorner; }
  void setActivateOnTopLeftCorner( bool b ) { activateOnTopLeftCorner = b; }
  bool getActivateOnTopRightCorner() const { return activateOnTopRightCorner; }
  void setActivateOnTopRighCorner( bool b ) { activateOnTopRightCorner = b; }
  bool getActivateOnBottomLeftCorner() const { return activateOnBottomLeftCorner; }
  void setActivateOnBottomLeftCorner( bool b ) { activateOnBottomLeftCorner = b; }
  bool getActivateOnBottomRightCorner() const { return activateOnBottomRightCorner; }
  void setActivateOnBottomRightCorner( bool b ) { activateOnBottomRightCorner = b; }

  bool getActivateOnTopEdge() const { return activateOnTopEdge; }
  void setActivateOnTopEdge( bool b ) { activateOnTopEdge = b; }
  bool getActivateOnLeftEdge() const { return activateOnLeftEdge; }
  void setActivateOnLeftEdge( bool b ) { activateOnLeftEdge= b; }
  bool getActivateOnBottomEdge() const { return activateOnBottomEdge; }
  void setActivateOnBottomEdge( bool b ) { activateOnBottomEdge = b; }
  bool getActivateOnRightEdge() const { return activateOnRightEdge; }
  void setActivateOnRightEdge( bool b ) { activateOnRightEdge = b; }

  uint getAutoLockDelay() { return autoLockDelay; }
  void setAutoLockDelay( uint val ) { autoLockDelay=val; }

  void setShowDesktopNum( bool b ) { showDesktopNum = b; }
  bool getShowDesktopNum() const { return showDesktopNum; }

  void setViewScreen( int screen ) { viewScreen = screen; }
  int getViewScreen() const { return viewScreen; }

public slots:
  void showPreferencesDlg();

protected slots:
  void calcFontMetrics();

signals:
  void settingsChanged();

private:
  TDEGlobalAccel *globalAccel;
  bool dialogOpen;

  bool useComposite;
  bool passiveScreenshots;
  uint screenshotGrabDelay;

  bool dynamicVirtDeskLayout;

  bool imageEffects;
  int defaultView;

  int iconSize;
  bool showIcons;

  bool showWindowTitles;
  TQFont windowTitleFont;
  TQFontMetrics *windowTitleFontMetrics;
  int windowTitleFontAscent;
  int windowTitleFontHeight;
  TQColor windowTitleFontColor;
  bool showWindowTitleShadow;
  TQColor windowTitleFontShadowColor;

  TQFont desktopTitleFont;
  TQColor desktopTitleFontColor;
  TQColor desktopTitleFontHighlightColor;

  bool cacheScaledPixmaps;

  bool activateOnTopLeftCorner;
  bool activateOnTopRightCorner;
  bool activateOnBottomLeftCorner;
  bool activateOnBottomRightCorner;

  bool activateOnTopEdge;
  bool activateOnLeftEdge;
  bool activateOnBottomEdge;
  bool activateOnRightEdge;

  uint autoLockDelay;

  bool showDesktopNum;
  int viewScreen;
};

#endif