Added pre and post procesing "event handlers" to the DB backends. Initially u
[qwerkisync] / Settings.h
index da1d08c..c8bad92 100644 (file)
@@ -19,6 +19,8 @@
 #ifndef SETTINGS_H
 #define SETTINGS_H
 
+#include "EventTypes/eEventTypes.h"
+
 #include <QString>
 
 class Settings
@@ -39,21 +41,12 @@ public:
        static const int kNumModes = MODE_EXPORT + 1;
 
        // Options for targets - sent or recieved
-       enum eTargets
-       {
-               TYPE_SENT,
-               TYPE_RECIEVED,
-       };
-       static const int kNumTargets = TYPE_RECIEVED + 1;
-
-       // Options for supported event types
-       enum eEventTypes
+       enum eDirection
        {
-               EVENTTYPE_SMS,
-               EVENTTYPE_MMS,
-               EVENTTYPE_CHAT,
+               OUTGOING,
+               INCOMING,
        };
-       static const int kNumEventTypes = EVENTTYPE_CHAT + 1;
+       static const int kNumTargets = INCOMING + 1;
 
 private:
        // The current UI mode of the application (Console/GUI)
@@ -66,7 +59,7 @@ private:
        eMode m_Mode;
 
        // The current targets & event types being processed
-       bool m_ShouldProcess[kNumTargets][kNumEventTypes];
+       bool m_ShouldProcess[kNumTargets][EventTypes::kNumEventTypes];
 
        // The root directory to import or export from
        QString m_Directory;
@@ -89,12 +82,12 @@ public:
        eMode const Mode() const { return m_Mode; }
        eMode const setMode(const eMode mode) { return m_Mode = mode; }
 
-       bool const ShouldProcess(const eTargets target, const eEventTypes eventType) const { return m_ShouldProcess[target][eventType]; }
-       bool const setShouldProcess(const eTargets target, const eEventTypes eventType, const bool shouldProcess = true){ return m_ShouldProcess[target][eventType] = shouldProcess; }
+       bool const ShouldProcess(const eDirection target, const EventTypes::eEventTypes eventType) const { return m_ShouldProcess[target][eventType]; }
+       bool const setShouldProcess(const eDirection target, const EventTypes::eEventTypes eventType, const bool shouldProcess = true){ return m_ShouldProcess[target][eventType] = shouldProcess; }
        bool const anyToProcess()
        {
                for(int targetIndex = 0; targetIndex < kNumTargets; ++targetIndex)
-                       for(int eventTypeIndex = 0; eventTypeIndex < kNumEventTypes; ++eventTypeIndex)
+                       for(int eventTypeIndex = 0; eventTypeIndex < EventTypes::kNumEventTypes; ++eventTypeIndex)
                                if (m_ShouldProcess[targetIndex][eventTypeIndex])
                                        return true;
                return false;