From 359294c33620c8328d61f67635046d7cc060530c Mon Sep 17 00:00:00 2001 From: Darrell Anderson Date: Fri, 17 May 2013 12:45:40 -0500 Subject: Rename kdessh -> tdessh and kdelirc -> tdelirc. --- tdelirc/tdelirc/modes.h | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 tdelirc/tdelirc/modes.h (limited to 'tdelirc/tdelirc/modes.h') diff --git a/tdelirc/tdelirc/modes.h b/tdelirc/tdelirc/modes.h new file mode 100644 index 0000000..d0de17a --- /dev/null +++ b/tdelirc/tdelirc/modes.h @@ -0,0 +1,62 @@ +// +// +// C++ Interface: $MODULE$ +// +// Description: +// +// +// Author: Gav Wood , (C) 2003 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef MODES_H +#define MODES_H + +#include +#include +#include +#include + +#include "mode.h" + +/** +@author Gav Wood +*/ + +class TDEConfig; + +typedef TQValueList ModeList; + +class Modes : protected TQMap > +{ + void purgeAllModes(TDEConfig &theConfig); + TQMap theDefaults; + +public: + void loadFromConfig(TDEConfig &theConfig); + void saveToConfig(TDEConfig &theConfig); + void generateNulls(const TQStringList &theRemotes); + + const Mode &getMode(const TQString &remote, const TQString &mode) const; + ModeList getModes(const TQString &remote) const; + const Mode getDefault(const TQString &remote) const; + bool isDefault(const Mode &mode) const; + + /** + * Call when you've changed a previously getMode'd mode and you want the changes + * to be recorded + **/ + void updateMode(const Mode &mode) { operator[](mode.remote())[mode.name()] = mode; } + void setDefault(const Mode &mode) { theDefaults[mode.remote()] = mode.name(); } + void erase(const Mode &mode); + void add(const Mode &mode); + + // dont use this without renaming all the modes in the actions!!! + void rename(Mode &mode, const TQString name); + + Modes(); + ~Modes(); +}; + +#endif -- cgit v1.2.3