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
;
29 friend class HostPreferences
;
32 KSharedConfigPtr m_config
;
34 HostPref(KSharedConfigPtr conf
, const QString
&host
, const QString
&type
);
36 virtual void load() = 0;
37 virtual void setDefaults() = 0;
38 virtual void save() = 0;
39 virtual void remove() = 0;
43 virtual QString
prefDescription() const = 0;
46 QString
prefix() const;
47 static QString
prefix(const QString
&host
, const QString
&type
);
50 typedef SmartPtr
<HostPref
> HostPrefPtr
;
51 typedef QList
<HostPrefPtr
> HostPrefPtrList
;
53 class HostPreferences
{
55 static HostPreferences
*instance();
58 HostPrefPtr
getHostPref(const QString
&host
, const QString
&type
);
59 HostPrefPtr
createHostPref(const QString
&host
, const QString
&type
);
60 HostPrefPtrList
getAllHostPrefs();
61 HostPrefPtr
vncDefaults();
62 HostPrefPtr
rdpDefaults();
63 void removeHostPref(HostPref
*hostPref
);
65 void setShowBrowsingPanel( bool b
);
66 void setServerCompletions( const QStringList
&list
);
67 void setServerHistory( const QStringList
&list
);
69 bool showBrowsingPanel();
70 QStringList
serverCompletions();
71 QStringList
serverHistory();
78 KSharedConfigPtr m_config
;
79 static HostPreferences
*m_instance
;