common: add AlarmProviderEet class draft
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Wed, 27 Jul 2016 09:55:46 +0000 (11:55 +0200)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Wed, 27 Jul 2016 09:55:46 +0000 (11:55 +0200)
common/Build/flags.mk
common/inc/Internal/AlarmProviderEeet.h [new file with mode: 0644]
common/inc/Internal/AlarmProviderEet.h [new file with mode: 0644]
common/inc/Model/Alarm.h
common/inc/Model/AlarmProvider.h
common/src/Model/Alarm.cpp
common/src/Model/AlarmProvider.cpp [new file with mode: 0644]
common/src/Model/AlarmProviderEet.cpp [new file with mode: 0644]

index 1f3c7f8..1e37c68 100644 (file)
@@ -5,12 +5,12 @@ CPP_DEBUG_OP =
 OPTIMIZATION_OP = -O0 
 CPP_OPTIMIZATION_OP = 
 
-COMPILE_FLAGS = $(DEBUG_OP) $(OPTIMIZATION_OP) -Wall -c -fmessage-length=0 -fPIC 
+COMPILE_FLAGS = $(DEBUG_OP) $(OPTIMIZATION_OP) -Wall -c -fmessage-length=0 -fPIC
 
-CPP_COMPILE_FLAGS = $(CPP_DEBUG_OP) $(CPP_OPTIMIZATION_OP) 
+CPP_COMPILE_FLAGS = $(CPP_DEBUG_OP) $(CPP_OPTIMIZATION_OP) -std=c++11
 
 LINK_FLAGS = -shared -Wl,--no-undefined 
 
 AR_FLAGS = 
 
-EDC_COMPILE_FLAGS = 
\ No newline at end of file
+EDC_COMPILE_FLAGS = 
diff --git a/common/inc/Internal/AlarmProviderEeet.h b/common/inc/Internal/AlarmProviderEeet.h
new file mode 100644 (file)
index 0000000..0d649d8
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef _INTERNAL_ALARM_PROVIDER_EET_H_
+#define _INTERNAL_ALARM_PROVIDER_EET_H_
+
+#include "Model/AlarmPrivider.h"
+
+namespace internal {
+       namespace model {
+               class AlarmProviderEet : public AlarmProvider
+               {
+                       public:
+                               std::vector<std::reference_wrapper<Alarm>> GetAlarms();
+                               void Sync(Alarm& alarm);
+                               void SyncAll();
+                               void Add(Alarm& alarm);
+                               void Remove(Alarm& alarm);
+               };
+       } /* model */
+} /* internal */
+
+#endif
diff --git a/common/inc/Internal/AlarmProviderEet.h b/common/inc/Internal/AlarmProviderEet.h
new file mode 100644 (file)
index 0000000..6336c7c
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef _INTERNAL_ALARM_PROVIDER_EET_H_
+#define _INTERNAL_ALARM_PROVIDER_EET_H_
+
+#include "Model/AlarmProvider.h"
+
+namespace internal {
+       namespace model {
+               class AlarmProviderEet : public common::model::AlarmProvider
+               {
+                       public:
+                               std::vector<std::reference_wrapper<common::model::Alarm>> GetAlarms();
+                               void Sync(common::model::Alarm& alarm);
+                               void SyncAll();
+                               void Add(common::model::Alarm& alarm);
+                               void Remove(common::model::Alarm& alarm);
+                               AlarmProviderEet();
+               };
+       } /* model */
+} /* internal */
+
+#endif
index cfbaba7..8ee97e4 100644 (file)
@@ -2,18 +2,24 @@
 #define _CLOCK_ALARM_H_
 
 #include <string>
+#include <time.h>
 
 #include "Model/WeekFlags.h"
 
 namespace common {
        namespace model {
+               enum AlarmType {
+               };
                class Alarm {
                        public:
+                               Alarm(int alarm_id);
                                Alarm();
-                               ~Alarm();
                                void Activate();
                                void Deactivate();
                                void Snooze();
+                               void EnableSnooze();
+                               void DisableSnooze();
+                               bool SnoozeEnabled();
                                std::string GetName();
                                void SetName(std::string name);
                                time_t GetTime();
@@ -31,6 +37,8 @@ namespace common {
                                std::string vibration;
                                WeekFlags flags;
                                bool activated;
+                               bool snooze_enabled;
+                               time_t time;
                };
        } /* model */
 } /* clock */
index 2c43f02..0b0d551 100644 (file)
@@ -1,26 +1,25 @@
-#ifndef _CLOCK_ALARM_PROVIDER_H
-#define _CLOCK_ALARM_PROVIDER_H
+#ifndef _CLOCK_ALARM_PROVIDER_H_
+#define _CLOCK_ALARM_PROVIDER_H_
 
 #include "Model/Alarm.h"
 
-#include <vector.h>
-#include <functional.h>
+#include <vector>
+#include <functional>
 
-namespace clock {
+namespace common {
        namespace model {
                class AlarmProvider {
                        public:
                                static AlarmProvider& GetInstance();
 
-                               void std::vector<std::reference_wrapper<Alarm>> GetAlarms();
-
-                               void Sync(Alarm& alarm);
-                               void SyncAll();
-                               void Add(Alarm& alarm);
-                               void Remove(Alarm& alarm);
-
-                       private:
-                               std::vector<Alarm> alarms;
+                               virtual std::vector<std::reference_wrapper<Alarm>> GetAlarms() = 0;
+                               virtual void Sync(Alarm& alarm) = 0;
+                               virtual void SyncAll() = 0;
+                               virtual void Add(Alarm& alarm) = 0;
+                               virtual void Remove(Alarm& alarm) = 0;
+                       protected:
+                               AlarmProvider();
+                               virtual ~AlarmProvider();
                };
        } /* model */
 } /* clock */
index 5c9572a..11c75ad 100644 (file)
@@ -1,10 +1,92 @@
+#include <app_alarm.h>
 #include "Model/Alarm.h"
 
 using namespace common::model;
 
 
-Alarm::Alarm() {
-};
+Alarm::Alarm(int alarm_id)
+{
+       alarm_id = alarm_id;
+       activated = true;
+}
 
-Alarm::~Alarm() {
-};
+Alarm::Alarm()
+{
+       activated = false;
+}
+
+void Alarm::Activate()
+{
+       if (!activated) {
+       }
+}
+
+void Alarm::Deactivate()
+{
+       if (activated) {
+       }
+}
+
+void Alarm::Snooze()
+{
+}
+
+void Alarm::EnableSnooze()
+{
+}
+
+void Alarm::DisableSnooze()
+{
+}
+
+bool Alarm::SnoozeEnabled()
+{
+       return snooze_enabled;
+}
+
+std::string Alarm::GetName()
+{
+       return name;
+}
+
+void Alarm::SetName(std::string nm)
+{
+       name = nm;
+}
+
+time_t Alarm::GetTime()
+{
+       return time;
+}
+
+void Alarm::SetTime(time_t tm)
+{
+       time = tm;
+}
+
+std::string Alarm::GetMelody()
+{
+       return melody;
+}
+
+void Alarm::SetMelody(std::string path)
+{
+}
+
+std::string Alarm::GetVibration()
+{
+       return vibration;
+}
+
+void Alarm::SetVibration(std::string pattern)
+{
+}
+
+WeekFlags Alarm::GetWeekFlags()
+{
+       return flags;
+}
+
+void Alarm::SetWeekFlags(WeekFlags flags)
+{
+}
diff --git a/common/src/Model/AlarmProvider.cpp b/common/src/Model/AlarmProvider.cpp
new file mode 100644 (file)
index 0000000..9aebab3
--- /dev/null
@@ -0,0 +1,20 @@
+#include "Model/AlarmProvider.h"
+#include "Internal/AlarmProviderEet.h"
+
+using namespace common::model;
+using namespace internal::model;
+
+
+AlarmProvider::AlarmProvider()
+{
+}
+
+AlarmProvider::~AlarmProvider()
+{
+}
+
+AlarmProvider &AlarmProvider::GetInstance()
+{
+       static AlarmProviderEet instance;
+       return instance;
+}
diff --git a/common/src/Model/AlarmProviderEet.cpp b/common/src/Model/AlarmProviderEet.cpp
new file mode 100644 (file)
index 0000000..3236da8
--- /dev/null
@@ -0,0 +1,29 @@
+#include "Internal/AlarmProviderEet.h"
+
+#include <Eet.h>
+
+using namespace internal::model;
+
+AlarmProviderEet::AlarmProviderEet()
+{
+}
+
+std::vector<std::reference_wrapper<common::model::Alarm>> AlarmProviderEet::GetAlarms()
+{
+}
+
+void AlarmProviderEet::Sync(common::model::Alarm& alarm)
+{
+}
+
+void AlarmProviderEet::SyncAll()
+{
+}
+
+void AlarmProviderEet::Add(common::model::Alarm& alarm)
+{
+}
+
+void AlarmProviderEet::Remove(common::model::Alarm& alarm)
+{
+}