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 =
--- /dev/null
+#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
--- /dev/null
+#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
#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();
std::string vibration;
WeekFlags flags;
bool activated;
+ bool snooze_enabled;
+ time_t time;
};
} /* model */
} /* clock */
-#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 */
+#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)
+{
+}
--- /dev/null
+#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;
+}
--- /dev/null
+#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)
+{
+}