2 Copyright (C) 2003 Tim Jansen <tim@tjansen.de>
3 Copyright (C) 2004 Nadeem Hasan <nhasan@kde.org>
5 /***************************************************************************
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
12 ***************************************************************************/
14 #ifndef HOSTPREFERENCES_H
15 #define HOSTPREFERENCES_H
18 #include <QStringList>
20 #include <ksharedconfig.h>
24 class HostPreferences
;
28 friend class HostPreferences
;
31 KSharedConfigPtr m_config
;
33 HostPref(KSharedConfigPtr conf
, const QString
&host
, const QString
&type
);
35 virtual void load() = 0;
36 virtual void setDefaults() = 0;
37 virtual void save() = 0;
38 virtual void remove() = 0;
42 virtual QString
prefDescription() const = 0;
45 QString
prefix() const;
46 static QString
prefix(const QString
&host
, const QString
&type
);
49 typedef SmartPtr
<HostPref
> HostPrefPtr
;
50 typedef QList
<HostPrefPtr
> HostPrefPtrList
;
52 class HostPreferences
{
54 static HostPreferences
*instance();
57 HostPrefPtr
getHostPref(const QString
&host
, const QString
&type
);
58 HostPrefPtr
createHostPref(const QString
&host
, const QString
&type
);
59 HostPrefPtrList
getAllHostPrefs();
60 HostPrefPtr
vncDefaults();
61 HostPrefPtr
rdpDefaults();
62 void removeHostPref(HostPref
*hostPref
);
64 void setShowBrowsingPanel( bool b
);
65 void setServerCompletions( const QStringList
&list
);
66 void setServerHistory( const QStringList
&list
);
68 bool showBrowsingPanel();
69 QStringList
serverCompletions();
70 QStringList
serverHistory();
77 KSharedConfigPtr m_config
;
78 static HostPreferences
*m_instance
;