00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _NOTIFIERSETTINGS_H_
00021 #define _NOTIFIERSETTINGS_H_
00022
00023 #include <tqvaluelist.h>
00024 #include <tqmap.h>
00025
00026 #include "notifieraction.h"
00027 #include "notifierserviceaction.h"
00028
00029
00030 class NotifierSettings
00031 {
00032 public:
00033 NotifierSettings();
00034 ~NotifierSettings();
00035
00036 TQValueList<NotifierAction*> actions();
00037 TQValueList<NotifierAction*> actionsForMimetype( const TQString &mimetype );
00038
00039 bool addAction( NotifierServiceAction *action );
00040 bool deleteAction( NotifierServiceAction *action );
00041
00042 void setAutoAction( const TQString &mimetype, NotifierAction *action );
00043 void resetAutoAction( const TQString &mimetype );
00044 void clearAutoActions();
00045 NotifierAction *autoActionForMimetype( const TQString &mimetype );
00046
00047 const TQStringList &supportedMimetypes();
00048
00049 void reload();
00050 void save();
00051
00052 private:
00053 TQValueList<NotifierServiceAction*> listServices( const TQString &mimetype = TQString() ) const;
00054 bool shouldLoadActions( KDesktopFile &desktop, const TQString &mimetype ) const;
00055 TQValueList<NotifierServiceAction*> loadActions( KDesktopFile &desktop ) const;
00056
00057 TQStringList m_supportedMimetypes;
00058 TQValueList<NotifierAction*> m_actions;
00059 TQValueList<NotifierServiceAction*> m_deletedActions;
00060 TQMap<TQString,NotifierAction*> m_idMap;
00061 TQMap<TQString,NotifierAction*> m_autoMimetypesMap;
00062 };
00063 #endif