blob: 09b4abe6a5851fed406814a71f3a27bb9ce012c1 (
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
|
/***************************************************************************
hostpreferences.h - per host preferences
-------------------
begin : Fri May 09 19:02 CET 2003
copyright : (C) 2003 by Tim Jansen
: (C) 2004 Nadeem Hasan <nhasan@kde.org>
email : tim@tjansen.de
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef HOSTPREFERENCES_H
#define HOSTPREFERENCES_H
#include <qstring.h>
#include <qstringlist.h>
#include "smartptr.h"
class HostPreferences;
class KConfig;
class HostPref {
protected:
friend class HostPreferences;
QString m_host;
QString m_type;
KConfig *m_config;
HostPref(KConfig *conf, const QString &host, const QString &type);
virtual void load() = 0;
virtual void setDefaults() = 0;
virtual void save() = 0;
virtual void remove() = 0;
public:
virtual ~HostPref();
virtual QString prefDescription() const = 0;
QString host() const;
QString type() const;
QString prefix() const;
static QString prefix(const QString &host, const QString &type);
};
typedef SmartPtr<HostPref> HostPrefPtr;
typedef QValueList<HostPrefPtr> HostPrefPtrList;
class HostPreferences {
public:
static HostPreferences *instance();
~HostPreferences();
HostPrefPtr getHostPref(const QString &host, const QString &type);
HostPrefPtr createHostPref(const QString &host, const QString &type);
HostPrefPtrList getAllHostPrefs();
HostPrefPtr vncDefaults();
HostPrefPtr rdpDefaults();
void removeHostPref(HostPref *hostPref);
void setShowBrowsingPanel( bool b );
void setServerCompletions( const QStringList &list );
void setServerHistory( const QStringList &list );
bool showBrowsingPanel();
QStringList serverCompletions();
QStringList serverHistory();
void sync();
private:
HostPreferences();
KConfig *m_config;
static HostPreferences *m_instance;
};
#endif
|