From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- krdc/hostpreferences.h | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 krdc/hostpreferences.h (limited to 'krdc/hostpreferences.h') diff --git a/krdc/hostpreferences.h b/krdc/hostpreferences.h new file mode 100644 index 00000000..09b4abe6 --- /dev/null +++ b/krdc/hostpreferences.h @@ -0,0 +1,85 @@ +/*************************************************************************** + hostpreferences.h - per host preferences + ------------------- + begin : Fri May 09 19:02 CET 2003 + copyright : (C) 2003 by Tim Jansen + : (C) 2004 Nadeem Hasan + 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 +#include +#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 HostPrefPtr; +typedef QValueList 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 -- cgit v1.2.3