summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/configuration_31compat.h
blob: 8ad6e09da617277e3142756c819dbdd42e292fa6 (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
/***************************************************************************
 *                                                                         *
 *   copyright (C) 2004 by Michael Buesch                                  *
 *   email: mbuesch@freenet.de                                             *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License version 2        *
 *   as published by the Free Software Foundation.                         *
 *                                                                         *
 ***************************************************************************/

/***************************************************************************
 * copyright (C) 2004 by Ulf Schenk
 * This file is originaly based on version 1.0.1 of pwmanager
 * and was modified to run on embedded devices that run microkde
 *
 * $Id$
 **************************************************************************/  

#ifndef CONFIGURATION_31COMPAT_H
#define CONFIGURATION_31COMPAT_H

#include "pwmexception.h"

#include <qsize.h>
#include <qfont.h>
#include <qstring.h>

#ifdef PWM_EMBEDDED
#include <configuration.h>
#endif

class KConfig;

/** This class is the compatibility layer for
  * running the new KDE-3.2 Configuration interface on KDE-3.1.
  * We have to keep this class in sync with the real configuration
  * interface.
  */
class Configuration_31compat
{
public:
	Configuration_31compat();
	~Configuration_31compat();

	static Configuration_31compat * obj()
		{
			PWM_ASSERT(_obj);
			return _obj;
		}
	static void init()
		{
			PWM_ASSERT(!_obj);
			_obj = new Configuration_31compat;
		}
	static void cleanup()
			{ delete_ifnot_null(_obj); }


	/** Read the configuration from the file.
	  * Normally this function has not to be called manually.
	  *
	  * This function is a NOP in KDE-3.1 compatibility layer.
	  */
	void readConfig()
			{ }
	/** Write the configuration to the file.
	  * Normally this function has not to be called manually.
	  *
	  * This function is a NOP in KDE-3.1 compatibility layer.
	  */
	void writeConfig()
			{ }
	/** reset the whole configuration to its defaults.
	  *
	  * This function is a NOP in KDE-3.1 compatibility layer.
	  * It should not be, but it is. :)
	  */
	void resetConfig()
			{ }
	/** show the configuration window */
	bool showConfWnd(QWidget *parent);

public:
	/* functions for reading the configuration settings */
	/* GLOBAL */
	QString confGlobAutoStart();
	QString confGlobBrowserCommand();
	QString confGlobXtermCommand();
	QFont confGlobEntryFont();
	int confGlobPwTimeout();
	int confGlobLockTimeout();
	int confGlobCompression();
	int confGlobFilePermissions();
	int confGlobMinimizeLock();
	bool confGlobUnlockOnOpen();
	bool confGlobTray();
	bool confGlobMakeFileBackup();
	bool confGlobAutostartDeepLocked();
	bool confGlobAutoDeepLock();
	bool confGlobKwalletEmu();
	bool confGlobNewEntrLockStat();
	/* WND */
	QSize confWndMainWndSize();
	int confWndMainViewStyle();
	bool confWndAutoMinimizeOnStart();
	bool confWndClose();

public:
	/* functions for writing the configuration settings */
	/* GLOBAL */
	void confGlobAutoStart(const QString &e);
	void confGlobBrowserCommand(const QString &e);
	void confGlobXtermCommand(const QString &e);
	void confGlobEntryFont(const QFont &e);
	void confGlobPwTimeout(int e);
	void confGlobLockTimeout(int e);
	void confGlobCompression(int e);
	void confGlobFilePermissions(int e);
	void confGlobMinimizeLock(int e);
	void confGlobUnlockOnOpen(bool e);
	void confGlobTray(bool e);
	void confGlobMakeFileBackup(bool e);
	void confGlobAutostartDeepLocked(bool e);
	void confGlobAutoDeepLock(bool e);
	void confGlobKwalletEmu(bool e);
	void confGlobNewEntrLockStat(bool e);
	/* WND */
	void confWndMainWndSize(const QSize &e);
	void confWndMainViewStyle(int e);
	void confWndAutoMinimizeOnStart(bool e);
	void confWndClose(bool e);

protected:
	/** static instance of this class returned by obj() */
	static Configuration_31compat *_obj;
	/** configuration object */
	KConfig *conf;
};

#ifdef Configuration
# error "Configuration already defined!"
#endif
#define Configuration	Configuration_31compat

#endif