diff options
author | Darrell Anderson <humanreadable@yahoo.com> | 2013-05-17 12:45:40 -0500 |
---|---|---|
committer | Darrell Anderson <humanreadable@yahoo.com> | 2013-05-17 12:45:40 -0500 |
commit | 359294c33620c8328d61f67635046d7cc060530c (patch) | |
tree | f2ac08fdad8860f7bc1ac76203e31013a799fda7 /tdelirc/tdelirc/modes.h | |
parent | 7be7990fc5770d2cbcd937772e8239167b5900c6 (diff) | |
download | tdeutils-359294c33620c8328d61f67635046d7cc060530c.tar.gz tdeutils-359294c33620c8328d61f67635046d7cc060530c.zip |
Rename kdessh -> tdessh and kdelirc -> tdelirc.
Diffstat (limited to 'tdelirc/tdelirc/modes.h')
-rw-r--r-- | tdelirc/tdelirc/modes.h | 62 |
1 files changed, 62 insertions, 0 deletions
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 <gav@kde.org>, (C) 2003 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef MODES_H +#define MODES_H + +#include <tqstring.h> +#include <tqmap.h> +#include <tqpair.h> +#include <tqvaluelist.h> + +#include "mode.h" + +/** +@author Gav Wood +*/ + +class TDEConfig; + +typedef TQValueList<Mode> ModeList; + +class Modes : protected TQMap<TQString, TQMap<TQString, Mode> > +{ + void purgeAllModes(TDEConfig &theConfig); + TQMap<TQString, TQString> 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 |