Fix namespaces + clean-up not used code 31/159231/3
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Mon, 6 Nov 2017 16:45:39 +0000 (17:45 +0100)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Thu, 9 Nov 2017 12:58:10 +0000 (13:58 +0100)
Change-Id: I41cb039b5e595213c1ad67f28c3f5b62a6e387fb

64 files changed:
clock-common/inc/Common/Alarm.h
clock-common/inc/Common/AlarmEvent.h
clock-common/inc/Common/AlarmList.h
clock-common/inc/Common/AlarmProvider.h
clock-common/inc/Common/Counter.h
clock-common/inc/Common/CounterView.h
clock-common/inc/Common/Defines.h
clock-common/inc/Common/RingEvent.h
clock-common/inc/Common/View.h
clock-common/inc/Common/WeekFlags.h
clock-common/inc/Utils/PopupManager.h
clock-common/inc/Utils/SystemSettings.h
clock-common/src/Common/Alarm.cpp
clock-common/src/Common/AlarmProvider.cpp
clock-common/src/Common/CounterView.cpp
clock-common/src/Common/WeekFlags.cpp
clock-common/src/Utils/PopupManager.cpp
clock-common/src/Utils/SystemSettings.cpp
clock-ring/inc/Controller/RingController.h
clock-ring/inc/Model/Ring.h
clock-ring/inc/Presenter/RingPresenter.h
clock-ring/inc/Ring.h
clock-ring/inc/View/RingView.h
clock-ring/src/Controller/RingController.cpp
clock-ring/src/Model/Ring.cpp
clock-ring/src/Presenter/RingPresenter.cpp
clock-ring/src/Ring.cpp
clock-ring/src/View/RingView.cpp
clock/.project
clock/inc/Clock.h
clock/inc/Controller/MainController.h
clock/inc/Model/StopWatch.h
clock/inc/Model/Timer.h
clock/inc/Presenter/AlarmListPresenter.h
clock/inc/Presenter/DeleteAlarmPresenter.h
clock/inc/Presenter/EditAlarmPresenter.h
clock/inc/Presenter/StopWatchPresenter.h
clock/inc/View/AlarmListView.h
clock/inc/View/DeleteAlarmView.h
clock/inc/View/EditAlarmView.h
clock/inc/View/MainView.h
clock/inc/View/PageView.h
clock/inc/View/StopWatchView.h
clock/inc/View/TimerView.h
clock/inc/View/View.h [deleted file]
clock/inc/View/WeekFlagsView.h
clock/inc/View/WorldClockMap.h
clock/inc/View/WorldClockView.h
clock/src/Clock.cpp
clock/src/Controller/MainController.cpp
clock/src/Model/Timer.cpp
clock/src/Presenter/AlarmListPresenter.cpp
clock/src/Presenter/DeleteAlarmPresenter.cpp
clock/src/Presenter/EditAlarmPresenter.cpp
clock/src/Presenter/TimerPresenter.cpp
clock/src/View/AlarmListView.cpp
clock/src/View/DeleteAlarmView.cpp
clock/src/View/EditAlarmView.cpp
clock/src/View/MainView.cpp
clock/src/View/StopWatchView.cpp
clock/src/View/TimerView.cpp
clock/src/View/WeekFlagsView.cpp
clock/src/View/WorldClockMap.cpp
clock/src/View/WorldClockView.cpp

index 8901528..b3a051b 100644 (file)
@@ -28,7 +28,7 @@
 #include "Utils/Log.h"
 #include "Utils/ObservableObject.h"
 
-namespace model {
+namespace common {
        typedef int AlarmId;
        /**
         * @brief Alarm is a wrapper class arount platform's alarm system.
@@ -202,13 +202,13 @@ namespace model {
                         *
                         * @see GetTime()
                         */
-                       WeekFlags GetWeekFlags() const;
+                       common::WeekFlags GetWeekFlags() const;
 
                        /**
                         * @brief Set week flags of alarm.
                         * @param[in] flags new week flags for alarm.
                         */
-                       void SetWeekFlags(WeekFlags flags);
+                       void SetWeekFlags(common::WeekFlags flags);
 
                        /**
                         * @brief Serialize Alarm using writer interface
@@ -252,7 +252,7 @@ namespace model {
                                double volume;
                        } sound;
                        std::string vibration;
-                       WeekFlags flags;
+                       common::WeekFlags flags;
                        bool activated = false;
                        bool snooze_enabled;
                        Type type_ = Type::VIBRATION_AND_SOUND;
index 75fd6e7..d7d7b35 100644 (file)
@@ -20,7 +20,7 @@
 #include "Utils/EventBus.h"
 #include "Common/AlarmList.h"
 
-namespace model {
+namespace common {
        /**
         * @brief Global event that is broadcast request to create new
         * alarm.
@@ -45,43 +45,23 @@ namespace model {
                         * @param[in] list alarm list which is a target of edition.
                         * @param[in] it iterator to element within list.
                         */
-                       AlarmEditRequestEvent(model::AlarmList& list, model::AlarmList::Iterator it)
+                       AlarmEditRequestEvent(common::AlarmList& list, common::AlarmList::Iterator it)
                                : alarm_list_(list), it_(it) {}
 
                        /**
                         * @brief Gets modification target
                         * @return List with alarm to be edited.
                         */
-                       model::AlarmList &GetAlarmList() { return alarm_list_;}
+                       common::AlarmList &GetAlarmList() { return alarm_list_;}
 
                        /**
                         * @brief Gets modification target iterator
                         * @return Alarm to be edited.
                         */
-                       model::AlarmList::Iterator &GetIterator() { return it_;}
+                       common::AlarmList::Iterator &GetIterator() { return it_;}
                private:
-                       model::AlarmList &alarm_list_;
-                       model::AlarmList::Iterator it_;
-       };
-
-       /**
-        * @brief Global event that is broadcast information that alarm
-        * data has been modified.
-        */
-       class AlarmEditedEvent : public utils::Event {
-               public:
-                       /**
-                        * @brief Creates AlarmEditedEvent instance
-                        * @param[in] alarm alarm which has been edited.
-                        */
-                       AlarmEditedEvent(model::Alarm& alarm) : alarm_(alarm) {}
-                       /** 
-                        * @brief Gets modification target 
-                        * @return Alarm which have been edited.
-                        */
-                       Alarm &GetAlarm() const { return alarm_;}
-               private:
-                       Alarm &alarm_;
+                       common::AlarmList &alarm_list_;
+                       common::AlarmList::Iterator it_;
        };
 } /* model */
 
index a594d50..048056c 100644 (file)
 #include "Common/Alarm.h"
 #include "Utils/Log.h"
 
-namespace model {
+namespace common {
        /**
         * @brief AlarmList is an observable list of alarms with limited size.
         */
-       class AlarmList : public utils::ObservableList<model::Alarm>, utils::ISerializable
+       class AlarmList : public utils::ObservableList<common::Alarm>, utils::ISerializable
        {
                public:
                        /**
                         * @brief AlarmList iterator
                         */
-                       typedef utils::ObservableList<model::Alarm>::Iterator Iterator;
+                       typedef utils::ObservableList<common::Alarm>::Iterator Iterator;
 
                        /**
                         * @brief Default AlarmList constructor
@@ -63,11 +63,11 @@ namespace model {
                         *
                         * @return Iterator to last element
                         */
-                       Iterator Add(model::Alarm &alarm)
+                       Iterator Add(common::Alarm &alarm)
                        {
                                if (Size() >= max_size_)
                                        return End();
-                               return utils::ObservableList<Alarm>::Add(alarm);
+                               return utils::ObservableList<common::Alarm>::Add(alarm);
                        }
 
                        /**
index 57d020d..698a476 100644 (file)
@@ -26,7 +26,7 @@
 #include <Ecore.h>
 #include <tizen.h>
 
-namespace model {
+namespace common {
        /**
         * @brief Class providing list of currently registered alarms.
         */
@@ -45,16 +45,16 @@ namespace model {
                        /**
                         * @brief Returns reference to observable list of alarms
                         */
-                       model::AlarmList& GetAlarms();
+                       common::AlarmList& GetAlarms();
                private:
-                       model::AlarmList alarms_;
+                       common::AlarmList alarms_;
                        Ecore_Idler *idler_job_;
 
                        void Sync();
                        void ScheduleSync();
                        bool HasActiveAlarms();
                        static Eina_Bool IdlerCallback(void *data);
-                       void AlarmListChanged(model::AlarmList::Iterator it);
+                       void AlarmListChanged(common::AlarmList::Iterator it);
                        std::vector<utils::Connection> connections_;
        };
 } /* model */
index 9e5aed3..3c0bd75 100644 (file)
@@ -23,7 +23,7 @@
 #include <Ecore.h>
 #include "Utils/Log.h"
 
-namespace model {
+namespace common {
 
        using namespace std::chrono;
 
index 07bfe94..78fb01f 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "Common/View.h"
 
-namespace view {
+namespace common {
 
        /**
         * @brief Counter's type enum
@@ -41,7 +41,7 @@ namespace view {
         * Class displays ui view of the counter, changes its values during running state,
         * and responds on user's activities.
         */
-       class EXPORT_API CounterView : public ui::IView {
+       class EXPORT_API CounterView : public common::IView {
        public:
                /**
                 * @brief Constructor
@@ -49,7 +49,7 @@ namespace view {
                 * @param[in] parent parent View
                 * @param[in] type type of counter
                 */
-               CounterView(ui::IView &parent, CounterType type = CounterType::COUNTER_TYPE_STOPWATCH);
+               CounterView(common::IView &parent, CounterType type = CounterType::COUNTER_TYPE_STOPWATCH);
                ~CounterView();
 
                /**
index 336adfe..42c02cc 100644 (file)
@@ -17,7 +17,8 @@
 #ifndef _CLOCK_COMMON_DEFINES_H_
 #define _CLOCK_COMMON_DEFINES_H_
 
-#define PACKAGE "org.tizen.clock"
+#define PACKAGE_CLOCK "org.tizen.clock"
+#define PACKAGE_RING "org.tizen.clock-ring"
 
 #define APP_CONTROL_OPERATION_TIMEOUT "http://tizen.org/appcontrol/operation/timeout"
 #define APP_CONTROL_OPERATION_ALARM "http://tizen.org/appcontrol/operation/alarm"
 #define ARRAY_SIZE(x) sizeof(x)/sizeof(x[0])
 #define DEFAULT_RINGTONE_PATH "ringtones/alarm.mp3"
 
-#if !defined(PACKAGE)
-#define PACKAGE "org.tizen.clock"
-#endif
-
 #define EDJ_FILE "edje/clock.edj"
 #define GRP_MAIN "main"
 
index f980546..a874bd5 100644 (file)
@@ -20,7 +20,7 @@
 #include "Utils/EventBus.h"
 #include "Common/Alarm.h"
 
-namespace model {
+namespace common {
 
        /**
         * @brief Ring dismiss event class
@@ -51,7 +51,7 @@ namespace model {
                         *
                         * @param[in] alarm The alarm passed with event
                         */
-                       RingNewAlarmEvent(Alarm &alarm) : alarm_(&alarm) {};
+                       RingNewAlarmEvent(common::Alarm &alarm) : alarm_(&alarm) {};
 
                        /**
                         * @brief Gets event's alarm
@@ -60,9 +60,9 @@ namespace model {
                         *
                         * @return The handled alarm
                         */
-                       Alarm *GetAlarm(void) const { return alarm_; };
+                       common::Alarm *GetAlarm(void) const { return alarm_; };
                private:
-                       Alarm *alarm_;
+                       common::Alarm *alarm_;
        };
 }
 
index ad8b189..e9a9222 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <Elementary.h>
 
-namespace ui {
+namespace common {
        /**
         * @brief Abstract interface representing Native UI toolkit object.
         */
index 7afa705..bbcd188 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <app_alarm.h>
 
-namespace model {
+namespace common {
        /** @brief Week flag enumarator */
        enum class EXPORT_API WeekDay : int {
                MONDAY    = ALARM_WEEK_FLAG_MONDAY,
index d197ec8..7283d0c 100644 (file)
@@ -39,7 +39,7 @@ namespace utils {
                 * @param[in] timeout The time after popup will be destroyed
                 *
                 */
-               static void CreatePopup(ui::IView &parent, const std::string &text, double timeout = 2.0);
+               static void CreatePopup(common::IView &parent, const std::string &text, double timeout = 2.0);
 
                /**
                 * @brief Destroys currently visible toast popup.
index 6948000..c01056b 100644 (file)
@@ -75,7 +75,7 @@ public:
        /**
         * @brief Gets first day of the week for current calendar.
         */
-       static model::WeekDay GetFirstDayOfWeek();
+       static common::WeekDay GetFirstDayOfWeek();
 
        SystemSettings() = delete;
        SystemSettings(const SystemSettings &) = delete;
index 18e7f3f..c8733f8 100644 (file)
@@ -21,8 +21,8 @@
 #include "Utils/Log.h"
 #include "Utils/Comparators.h"
 
-using namespace model;
 using namespace utils;
+using namespace common;
 
 static app_control_h AppControlCreate()
 {
@@ -34,7 +34,7 @@ static app_control_h AppControlCreate()
                return NULL;
        }
 
-       err = app_control_set_app_id(ctrl, PACKAGE);
+       err = app_control_set_app_id(ctrl, PACKAGE_CLOCK);
        if (err != APP_CONTROL_ERROR_NONE) {
                ERR("app_control_set_app_id failed: %s", get_error_message(err));
                app_control_destroy(ctrl);
@@ -309,12 +309,12 @@ bool Alarm::IsActivated() const
        return activated;
 }
 
-void model::Serialize(IWriter &w, Alarm::Type type)
+void common::Serialize(IWriter &w, Alarm::Type type)
 {
        utils::Serialize(w, static_cast<int>(type));
 }
 
-void model::Deserialize(IReader &r, Alarm::Type &type)
+void common::Deserialize(IReader &r, Alarm::Type &type)
 {
        int tmp;
        utils::Deserialize(r, tmp);
@@ -331,7 +331,7 @@ Alarm::Alarm(IReader &r)
        utils::Deserialize(r, name);
        utils::Deserialize(r, sound.melody);
        utils::Deserialize(r, sound.volume);
-       model::Deserialize(r, type_);
+       common::Deserialize(r, type_);
        utils::Deserialize(r, flags);
        utils::Deserialize(r, activated);
        utils::Deserialize(r, snooze_enabled);
@@ -348,7 +348,7 @@ void Alarm::Serialize(utils::IWriter &w) const
        utils::Serialize(w, name);
        utils::Serialize(w, sound.melody);
        utils::Serialize(w, sound.volume);
-       model::Serialize(w, type_);
+       common::Serialize(w, type_);
        utils::Serialize(w, flags);
        utils::Serialize(w, activated);
        utils::Serialize(w, snooze_enabled);
index f2b1850..a98233d 100644 (file)
@@ -25,8 +25,8 @@ static const char DATABASE_FILE[] = "alarmsdb.cfg";
 
 const int MAX_ALARMS  = 20;
 
-using namespace model;
 using namespace utils;
+using namespace common;
 using std::placeholders::_1;
 
 AlarmProvider::AlarmProvider() : idler_job_(nullptr)
@@ -97,7 +97,7 @@ Eina_Bool AlarmProvider::IdlerCallback(void *data)
        return EINA_FALSE;
 }
 
-void AlarmProvider::AlarmListChanged(model::AlarmList::Iterator it)
+void AlarmProvider::AlarmListChanged(common::AlarmList::Iterator it)
 {
        ScheduleSync();
 }
index ee2bfc9..40d5acf 100644 (file)
 #define SIGNAL_SET_COUNTER_LAP "counter,lap,set"
 #define SIGNAL_SET_COUNTER_HIDDEN "counter,hidden,set"
 
-namespace view {
+namespace common {
 
 const char *CounterView::EDJE_FILE = "edje/Counter.edj";
 const char *CounterView::GROUP = "Counter";
 
-CounterView::CounterView(ui::IView &parent, CounterType type)
+CounterView::CounterView(common::IView &parent, CounterType type)
 {
        Evas_Object *parentEo = parent.GetEvasObject();
        layout_ = elm_layout_add(parentEo);
index c844455..057b8bf 100644 (file)
@@ -17,7 +17,7 @@
 #include <Common/WeekFlags.h>
 #include <Utils/Log.h>
 
-using namespace model;
+using namespace common;
 
 WeekFlags::WeekFlags() {
        raw_flags = 0;
@@ -72,22 +72,22 @@ WeekDay WeekFlags::GetNextWeekDay(WeekDay day)
 {
        switch (day)
        {
-               case model::WeekDay::SUNDAY:
-                       return model::WeekDay::MONDAY;
-               case model::WeekDay::MONDAY:
-                       return model::WeekDay::TUESDAY;
-               case model::WeekDay::TUESDAY:
-                       return model::WeekDay::WEDNESDAY;
-               case model::WeekDay::WEDNESDAY:
-                       return model::WeekDay::THURSDAY;
-               case model::WeekDay::THURSDAY:
-                       return model::WeekDay::FRIDAY;
-               case model::WeekDay::FRIDAY:
-                       return model::WeekDay::SATURDAY;
-               case model::WeekDay::SATURDAY:
-                       return model::WeekDay::SUNDAY;
+               case common::WeekDay::SUNDAY:
+                       return common::WeekDay::MONDAY;
+               case common::WeekDay::MONDAY:
+                       return common::WeekDay::TUESDAY;
+               case common::WeekDay::TUESDAY:
+                       return common::WeekDay::WEDNESDAY;
+               case common::WeekDay::WEDNESDAY:
+                       return common::WeekDay::THURSDAY;
+               case common::WeekDay::THURSDAY:
+                       return common::WeekDay::FRIDAY;
+               case common::WeekDay::FRIDAY:
+                       return common::WeekDay::SATURDAY;
+               case common::WeekDay::SATURDAY:
+                       return common::WeekDay::SUNDAY;
                default:
                        FAT("Invalid WeekDay");
-                       return model::WeekDay::MONDAY;
+                       return common::WeekDay::MONDAY;
        }
 }
index 4b1a4bd..f7a8f1a 100644 (file)
@@ -21,7 +21,7 @@ namespace utils {
 
 Evas_Object *PopupManager::popup_;
 
-void PopupManager::CreatePopup(ui::IView &parent, const std::string &text, double timeout)
+void PopupManager::CreatePopup(common::IView &parent, const std::string &text, double timeout)
 {
        if (popup_)
                DestroyPopup();
index 1e2bce3..84d3b49 100644 (file)
@@ -112,31 +112,31 @@ bool SystemSettings::Is24HourFormatPrefered()
        return is_24hour_format_prefered_;
 }
 
-static model::WeekDay ucalendar_weekday_to_clock_weekday(int32_t i18n_weekday)
+static common::WeekDay ucalendar_weekday_to_clock_weekday(int32_t i18n_weekday)
 {
        switch (i18n_weekday)
        {
                case I18N_UCALENDAR_SUNDAY:
-                       return model::WeekDay::SUNDAY;
+                       return common::WeekDay::SUNDAY;
                case I18N_UCALENDAR_MONDAY:
-                       return model::WeekDay::MONDAY;
+                       return common::WeekDay::MONDAY;
                case I18N_UCALENDAR_TUESDAY:
-                       return model::WeekDay::TUESDAY;
+                       return common::WeekDay::TUESDAY;
                case I18N_UCALENDAR_WEDNESDAY:
-                       return model::WeekDay::WEDNESDAY;
+                       return common::WeekDay::WEDNESDAY;
                case I18N_UCALENDAR_THURSDAY:
-                       return model::WeekDay::THURSDAY;
+                       return common::WeekDay::THURSDAY;
                case I18N_UCALENDAR_FRIDAY:
-                       return model::WeekDay::FRIDAY;
+                       return common::WeekDay::FRIDAY;
                case I18N_UCALENDAR_SATURDAY:
-                       return model::WeekDay::SATURDAY;
+                       return common::WeekDay::SATURDAY;
                default:
                        FAT("Invalid I18N weekday value: %d", i18n_weekday);
-                       return model::WeekDay::MONDAY;
+                       return common::WeekDay::MONDAY;
        }
 }
 
-model::WeekDay SystemSettings::GetFirstDayOfWeek()
+common::WeekDay SystemSettings::GetFirstDayOfWeek()
 {
        i18n_ucalendar_h calendar;
        int err;
@@ -147,7 +147,7 @@ model::WeekDay SystemSettings::GetFirstDayOfWeek()
        if (err != I18N_ERROR_NONE)
        {
                ERR("i18n_ucalendar_create failed: %s", get_error_message(err));
-               return model::WeekDay::MONDAY;
+               return common::WeekDay::MONDAY;
        }
 
        err = i18n_ucalendar_get_attribute(calendar, I18N_UCALENDAR_FIRST_DAY_OF_WEEK, &weekday);
@@ -155,7 +155,7 @@ model::WeekDay SystemSettings::GetFirstDayOfWeek()
        {
                ERR("i18n_ucalendar_get_attribute failed: %s", get_error_message(err));
                i18n_ucalendar_destroy(calendar);
-               return model::WeekDay::MONDAY;
+               return common::WeekDay::MONDAY;
        }
 
        i18n_ucalendar_destroy(calendar);
index cc7701b..dc9dc81 100644 (file)
@@ -44,7 +44,7 @@ namespace controller {
                 *
                 * @param[in] list AlarmList object
                 */
-               RingController(model::AlarmList &list);
+               RingController(common::AlarmList &list);
                ~RingController();
 
                /**
@@ -84,12 +84,12 @@ namespace controller {
                presenter::RingPresenter *presenter_;
                model::Ring *model_;
                view::RingView *view_;
-               model::AlarmList &list_;
+               common::AlarmList &list_;
                utils::Connection listener_;
 
                void RingCreate(void);
                void RingDestroy(utils::Event &e);
-               model::Alarm *GetAlarmWithId(int alarmID);
+               common::Alarm *GetAlarmWithId(int alarmID);
        };
 
 } //namespace model
index cfc5a83..fdfd3ba 100644 (file)
@@ -56,7 +56,7 @@ namespace model {
                 *
                 * @return True on success, otherwise false.
                 */
-               bool AlarmAdd(Alarm *alarm, RingType type);
+               bool AlarmAdd(common::Alarm *alarm, RingType type);
 
                /**
                 * @brief Snoozes alarm.
@@ -85,7 +85,7 @@ namespace model {
                /**
                 * @brief Returns currently handled alarm.
                 */
-               Alarm *GetAlarm() const;
+               common::Alarm *GetAlarm() const;
 
                /**
                 * @brief Return type of the currently handled alarm.
@@ -101,13 +101,13 @@ namespace model {
                 *
                 * @return Reference to the Counter object
                 */
-               const Counter<std::chrono::seconds> &GetCounter() const { return (counter_); };
+               const common::Counter<std::chrono::seconds> &GetCounter() const { return (counter_); };
 
        private:
-               Alarm *alarm_;
+               common::Alarm *alarm_;
                RingType ring_type_;
 
-               Counter<std::chrono::seconds> counter_;
+               common::Counter<std::chrono::seconds> counter_;
 
                void SoundPlay();
                void SoundStop();
index 975476b..eb3e9db 100644 (file)
@@ -45,7 +45,7 @@ namespace presenter {
        private:
                view::RingView &view_;
                model::Ring &model_;
-               model::Alarm *alarm_ = nullptr;
+               common::Alarm *alarm_ = nullptr;
 
                std::vector<utils::Connection> connections_;
 
index a6978cf..6586906 100644 (file)
@@ -81,7 +81,7 @@ class RingApp : public utils::TizenApp {
                 */
                bool OnCreate() override;
        private:
-               model::AlarmProvider *provider_ = nullptr;
+               common::AlarmProvider *provider_ = nullptr;
                controller::RingController *ring_ctrl_ = nullptr;
 };
 
index 28acf8b..f194346 100644 (file)
@@ -32,7 +32,7 @@ namespace view {
         * Class creates and displays ring alarm view that shows incoming alarm's
         * major information and provides dismiss and snooze options for user.
         */
-       class RingView : public ui::IView {
+       class RingView : public common::IView {
        public:
                /**
                 * @brief Creates class object and ring view.
@@ -164,7 +164,7 @@ namespace view {
                Evas_Object *dismissButton_ = NULL;
                Evas_Object *snoozeButton_ = NULL;
 
-               view::CounterView *counter_ = NULL;
+               common::CounterView *counter_ = NULL;
 
                static const char *GROUP;
                static const char *EDJE_FILE;
index 3e0f957..2877ae6 100644 (file)
 
 namespace controller {
 
-RingController::RingController(model::AlarmList &list) :
+RingController::RingController(common::AlarmList &list) :
        presenter_(nullptr), model_(nullptr), view_(nullptr), list_(list)
 {
-       listener_ = utils::EventBus::AddListener<model::RingDismissEvent>(std::bind(&RingController::RingDestroy,
+       listener_ = utils::EventBus::AddListener<common::RingDismissEvent>(std::bind(&RingController::RingDestroy,
                                this, std::placeholders::_1));
 }
 
@@ -36,7 +36,7 @@ RingController::~RingController()
 {
 }
 
-model::Alarm *RingController::GetAlarmWithId(int alarmID)
+common::Alarm *RingController::GetAlarmWithId(int alarmID)
 {
        auto it = std::find(list_.Begin(), list_.End(), alarmID);
 
@@ -48,7 +48,7 @@ model::Alarm *RingController::GetAlarmWithId(int alarmID)
 
 void RingController::HandleAlarm(int alarmID)
 {
-       model::Alarm *alarm = GetAlarmWithId(alarmID);
+       common::Alarm *alarm = GetAlarmWithId(alarmID);
 
        if (!alarm) {
                ERR("Alarm not found");
@@ -57,7 +57,7 @@ void RingController::HandleAlarm(int alarmID)
 
        RingCreate();
 
-       model::RingNewAlarmEvent ev(*alarm);
+       common::RingNewAlarmEvent ev(*alarm);
        utils::EventBus::FireEvent(ev);
 }
 
@@ -65,7 +65,7 @@ void RingController::HandleTimeout()
 {
        RingCreate();
 
-       model::RingTimeoutEvent ev;
+       common::RingTimeoutEvent ev;
        utils::EventBus::FireEvent(ev);
 }
 
index a84a414..36847a6 100644 (file)
@@ -21,6 +21,8 @@
 
 #define DEFAULT_SOUND_PATH "ringtones/alarm.mp3"
 
+using namespace common;
+
 namespace model {
 
        Ring::Ring() : alarm_(NULL), ring_type_(RingType::RING_TYPE_NONE)
index 1e63105..7f5d852 100644 (file)
@@ -34,10 +34,10 @@ RingPresenter::RingPresenter(view::RingView &view, model::Ring &model)
        connections_.push_back(view_.OnSnoozeButtonClicked.Connect(
                                std::bind(&RingPresenter::SnoozeButtonClicked, this)));
 
-       connections_.push_back(utils::EventBus::AddListener<model::RingNewAlarmEvent>(
+       connections_.push_back(utils::EventBus::AddListener<common::RingNewAlarmEvent>(
                                std::bind(&RingPresenter::AlarmHandle,
                                this, std::placeholders::_1)));
-       connections_.push_back(utils::EventBus::AddListener<model::RingTimeoutEvent>(
+       connections_.push_back(utils::EventBus::AddListener<common::RingTimeoutEvent>(
                                std::bind(&RingPresenter::TimeoutHandle,
                                this, std::placeholders::_1)));
 }
@@ -61,7 +61,7 @@ void RingPresenter::DismissButtonClicked()
 
        animator_.Remove();
 
-       model::RingDismissEvent ev;
+       common::RingDismissEvent ev;
        utils::EventBus::FireEvent(ev);
 }
 
@@ -71,17 +71,17 @@ void RingPresenter::SnoozeButtonClicked()
 
        animator_.Remove();
 
-       model::RingDismissEvent ev;
+       common::RingDismissEvent ev;
        utils::EventBus::FireEvent(ev);
 }
 
 void RingPresenter::AlarmHandle(utils::Event &e)
 {
-       model::RingNewAlarmEvent &event = dynamic_cast<model::RingNewAlarmEvent &>(e);
+       common::RingNewAlarmEvent &event = dynamic_cast<common::RingNewAlarmEvent &>(e);
 
        animator_.Remove();
 
-       model::Alarm *alarm = event.GetAlarm();
+       common::Alarm *alarm = event.GetAlarm();
 
        model_.AlarmAdd(alarm, alarm ? model::RingType::RING_TYPE_ALARM : model::RingType::RING_TYPE_TIMER);
 
index cd8644f..ff571d9 100644 (file)
@@ -30,7 +30,7 @@ bool RingApp::OnCreate()
        }
 
        elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
-       provider_ = new model::AlarmProvider();
+       provider_ = new common::AlarmProvider();
        ring_ctrl_ = new controller::RingController(provider_->GetAlarms());
 
        return true;
index 69b727b..f73a2f4 100644 (file)
@@ -112,7 +112,7 @@ void RingView::SetTitle(const char *title)
 void RingView::ShowCounter()
 {
        if (!counter_)
-               counter_ = new view::CounterView(*this, view::CounterType::COUNTER_TYPE_TIMER);
+               counter_ = new common::CounterView(*this, common::CounterType::COUNTER_TYPE_TIMER);
 
        SetMainContent(counter_->GetEvasObject());
 
index 5e7bc59..b70d08e 100644 (file)
@@ -4,6 +4,7 @@
        <comment></comment>
        <projects>
                <project>clock-common</project>
+               <project>clock-ring</project>
        </projects>
        <buildSpec>
                <buildCommand>
index 34d19a3..d38c20c 100644 (file)
@@ -81,7 +81,7 @@ class ClockApp : public utils::TizenApp {
                 */
                bool OnCreate() override;
        private:
-               model::AlarmProvider *provider_ = nullptr;
+               common::AlarmProvider *provider_ = nullptr;
                controller::MainController *main_ctrl_ = nullptr;
 };
 
index 6288f7e..102bfb8 100644 (file)
@@ -70,7 +70,7 @@ namespace controller {
                        /**
                         * @brief Constructs MainController class object.
                         */
-                       MainController(model::AlarmProvider*);
+                       MainController(common::AlarmProvider*);
 
                        /**
                         * @brief Destructor.
@@ -132,7 +132,7 @@ namespace controller {
                         */
                        void CreateNewWorldClockReorderPage(utils::Event &e);
 
-                       model::AlarmProvider *provider_;
+                       common::AlarmProvider *provider_;
 
                        model::WorldClock *world_clock_model_;
                        model::StopWatch *stop_watch_model_;
index 932c7ad..5a1cdae 100644 (file)
@@ -87,7 +87,7 @@ namespace model {
         * adding new record into the list with AddLap(), getting total amount of laps
         * in list with GetLapsCount(), receiving last stored lap with GetLastLap().
         */
-       class StopWatch : public Counter<milliseconds> {
+       class StopWatch : public common::Counter<std::chrono::milliseconds> {
        public:
                /**
                 * @brief Clears list of stored laps and their times
index 784ae22..de40deb 100644 (file)
@@ -21,8 +21,6 @@
 
 #include "Common/Counter.h"
 
-using namespace std::chrono;
-
 namespace model {
 
        /**
@@ -35,7 +33,7 @@ namespace model {
         * Running Timer by user provide setting time in this object and register
         * alarm in database. Stopping timer unregister alarm.
         */
-       class Timer : public Counter<seconds> {
+       class Timer : public common::Counter<std::chrono::seconds> {
        public:
                Timer();
                ~Timer();
@@ -45,7 +43,7 @@ namespace model {
                 *
                 * @param[in] time Time in seconds
                 */
-               void SetTime(seconds time);
+               void SetTime(std::chrono::seconds time);
 
                /**
                 * @brief Activates alarm after delay.
@@ -76,9 +74,9 @@ namespace model {
                 *
                 * @return Remaining time in std::chrono::seconds
                 */
-               seconds GetRemainingTime(void);
+               std::chrono::seconds GetRemainingTime(void);
        private:
-               seconds remaining_time_ = seconds(0);
+               std::chrono::seconds remaining_time_ = std::chrono::seconds(0);
 
                int alarm_id_ = 0;
 
index 22287c3..5c009d9 100644 (file)
@@ -36,22 +36,22 @@ namespace presenter {
                         * @param view AlarmListView instance which presenter will be managing
                         * @param list AlarmList instance which presenter will be managing
                         */
-                       AlarmListPresenter(view::AlarmListView &view, model::AlarmList &list);
+                       AlarmListPresenter(view::AlarmListView &view, common::AlarmList &list);
                        ~AlarmListPresenter();
                private:
                        view::AlarmListView &view_;
-                       model::AlarmList &alarm_list_;
+                       common::AlarmList &alarm_list_;
                        void ShowAll();
                        void OnItemSelected(int idx);
                        void OnAddButtonClicked();
                        void OnItemActiveStatusChanged(int idx);
-                       void OnAlarmAddedEvent(model::AlarmList::Iterator e);
-                       void OnAlarmRemovedEvent(model::AlarmList::Iterator e);
-                       void OnAlarmEditedEvent(model::AlarmList::Iterator e);
+                       void OnAlarmAddedEvent(common::AlarmList::Iterator e);
+                       void OnAlarmRemovedEvent(common::AlarmList::Iterator e);
+                       void OnAlarmEditedEvent(common::AlarmList::Iterator e);
                        void OnDeleteItemClicked();
                        void UpdateBackgroundLabel();
-                       void AddItem(model::AlarmList::Iterator iterator);
-                       std::map<int, model::AlarmList::Iterator> alarms_;
+                       void AddItem(common::AlarmList::Iterator iterator);
+                       std::map<int, common::AlarmList::Iterator> alarms_;
                        std::vector<utils::Connection> connections_;
                        std::vector<utils::Connection> object_connections_;
                        bool CheckModelSizeLimit();
index 4b6c9b3..231249f 100644 (file)
@@ -35,15 +35,15 @@ namespace presenter {
                         * @param view DeleteAlarmView instance which presenter will be managing
                         * @param model AlarmList instance which presenter will be managing
                         */
-                       DeleteAlarmPresenter(view::DeleteAlarmView &view, model::AlarmList &model);
+                       DeleteAlarmPresenter(view::DeleteAlarmView &view, common::AlarmList &model);
                        ~DeleteAlarmPresenter();
                private:
                        view::DeleteAlarmView &view_;
-                       model::AlarmList &alarm_list_;
+                       common::AlarmList &alarm_list_;
                        void OnDeleteButtonClicked();
                        void OnCancelButtonClicked();
                        std::vector<utils::Connection> connections_;
-                       std::map<int, model::AlarmList::Iterator> alarms_;
+                       std::map<int, common::AlarmList::Iterator> alarms_;
        };
 } /* presenter */
 
index 17d7dcf..17d6ac6 100644 (file)
@@ -38,7 +38,7 @@ namespace presenter {
                         * @param model AlarmList instance which presenter will be managing
                         * @param it the iterator to element in model to be edited.
                         */
-                       EditAlarmPresenter(view::EditAlarmView &view, model::AlarmList &model, model::AlarmList::Iterator it);
+                       EditAlarmPresenter(view::EditAlarmView &view, common::AlarmList &model, common::AlarmList::Iterator it);
 
                        /**
                         * @brief Construct new presenter for new alarm creation.
@@ -46,22 +46,22 @@ namespace presenter {
                         * @param view instance which presenter will be managing
                         * @param model AlarmList instance which presenter will be managing
                         */
-                       EditAlarmPresenter(view::EditAlarmView &view, model::AlarmList &model);
+                       EditAlarmPresenter(view::EditAlarmView &view, common::AlarmList &model);
 
                        ~EditAlarmPresenter();
                private:
-                       model::AlarmList &alarm_list_;
-                       model::AlarmList::Iterator iterator_;
+                       common::AlarmList &alarm_list_;
+                       common::AlarmList::Iterator iterator_;
                        view::EditAlarmView &view_;
                        view::EditAlarmView::AlarmViewInfo info_;
                        void OnEditDone();
                        void OnEditCancel();
                        view::EditAlarmView::AlarmViewInfo GetDefaultInfo() const;
-                       view::EditAlarmView::AlarmViewInfo GetInfoForAlarm(const model::Alarm &alarm) const;
-                       void SetAlarmProperties(model::Alarm &alarm, const view::EditAlarmView::AlarmViewInfo &data);
+                       view::EditAlarmView::AlarmViewInfo GetInfoForAlarm(const common::Alarm &alarm) const;
+                       void SetAlarmProperties(common::Alarm &alarm, const view::EditAlarmView::AlarmViewInfo &data);
                        void CreateNewAlarm();
-                       void UpdateAlarm(model::AlarmList::Iterator it);
-                       model::AlarmList::Iterator GetMatchingAlarm(const std::string &name, const utils::Time &time);
+                       void UpdateAlarm(common::AlarmList::Iterator it);
+                       common::AlarmList::Iterator GetMatchingAlarm(const std::string &name, const utils::Time &time);
                        void ShowAlarmUpdatedPopup(const utils::Time &time);
                        void OnBackButton();
                        void OnDiscardPopupOptionClicked(view::EditAlarmView::DiscardPopupOption option);
index ba025b5..b0498d4 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "View/StopWatchView.h"
 #include "Common/CounterView.h"
-#include "View/View.h"
+#include "Common/View.h"
 #include "Utils/Signal.h"
 #include "Model/StopWatch.h"
 #include "Common/CounterAnimator.h"
index dbb4d64..34b6873 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef ALARMVIEW_H_
 #define ALARMVIEW_H_
 
-#include "View/View.h"
+#include "Common/View.h"
 #include "Common/WeekFlags.h"
 #include "Utils/Signal.h"
 #include "Utils/Time.h"
@@ -30,7 +30,7 @@ namespace view {
         *
         * @note additionally displays "+" button and can display menu popup
         */
-       class AlarmListView : public ui::IView {
+       class AlarmListView : public common::IView {
                public:
                        typedef uintptr_t ItemId;
                        /**
@@ -39,7 +39,7 @@ namespace view {
                         * @param[in] main The main view object
                         *
                         */
-                       AlarmListView(ui::IView &main);
+                       AlarmListView(common::IView &main);
 
                        /**
                         * @brief Clear all items.
@@ -57,7 +57,7 @@ namespace view {
                         * @return return item identiefier.
                         */
                        ItemId ItemPrepend(utils::Time time, const char *name,
-                                       const model::WeekFlags flags, bool active, bool is_snoozed);
+                                       const common::WeekFlags flags, bool active, bool is_snoozed);
 
                        /**
                         * @brief Remove item from view.
@@ -76,7 +76,7 @@ namespace view {
                         * @param[in] is_snoozed item snooze status.
                         */
                        void ItemUpdate(ItemId id, utils::Time time, const char *name,
-                                       const model::WeekFlags flags, bool active, bool is_snoozed);
+                                       const common::WeekFlags flags, bool active, bool is_snoozed);
 
                        /**
                         * @brief Signal emitted when user clicked "delete" item on Delete popup
@@ -151,7 +151,7 @@ namespace view {
                        void CreateNoContentLayout(Evas_Object *parent);
                        static void SetItemCheckboxStatus(Elm_Object_Item *item, bool is_snoozed);
                        static void SetItemActiveStatus(Elm_Object_Item *it, bool active);
-                       static void SetItemVisibleDateOnly(Elm_Object_Item *it, model::WeekFlags flags);
+                       static void SetItemVisibleDateOnly(Elm_Object_Item *it, common::WeekFlags flags);
                        static void SetCheckboxStatus(Evas_Object *check, bool is_snoozed);
                        static void UpdateItemData(ItemData *data);
        };
index d5b2b64..b29974f 100644 (file)
@@ -65,7 +65,7 @@ namespace view {
                         * @return item identifier.
                         */
                        int ItemAppend(utils::Time time, const char *name,
-                                       const model::WeekFlags flags, bool active);
+                                       const common::WeekFlags flags, bool active);
 
                        /**
                         * @brief Gets identifiers of selected items.
index 7a051d4..cc5bab4 100644 (file)
@@ -40,7 +40,7 @@ namespace view {
                        /** @brief Time to be set on datetime widget */
                        utils::Time time;
                        /** @brief WeekFlags to be displayed on list item */
-                       model::WeekFlags flags;
+                       common::WeekFlags flags;
                        /** @brief volume value to be set on slider */
                        double volume;
                        /** @brief snooze flag to set on checkbox */
@@ -50,7 +50,7 @@ namespace view {
                        /** @brief path to be displayed on list item */
                        std::string melody;
                        /** @brief type to be displayed on list item */
-                       model::Alarm::Type type;
+                       common::Alarm::Type type;
                };
                        /**
                         * @brief Possible view modes.
@@ -246,7 +246,7 @@ namespace view {
                        void RingtonePathUpdateCallback();
                        const char *GetTitle();
                        std::string GetDate();
-                       void SetType(model::Alarm::Type type);
+                       void SetType(common::Alarm::Type type);
                        void UpdateType();
 
                        utils::Connection time_format_change_listener_;
index b37a212..3a9e6f2 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <Evas.h>
 
-#include "View/View.h"
+#include "Common/View.h"
 
 /**
  * @file MainView.h
@@ -51,7 +51,7 @@ namespace view {
         * @brief Application main view class
         * @remarks This is singleton class.
         */
-       class MainView : public ui::IView {
+       class MainView : public common::IView {
                public:
 
                        /**
@@ -136,10 +136,10 @@ namespace view {
                        /* Content */
                        Evas_Object *toolbar_;
 
-                       IView *alarm_ = nullptr;
-                       IView *world_clock_ = nullptr;
-                       IView *stop_watch_ = nullptr;
-                       IView *timer_ = nullptr;
+                       common::IView *alarm_ = nullptr;
+                       common::IView *world_clock_ = nullptr;
+                       common::IView *stop_watch_ = nullptr;
+                       common::IView *timer_ = nullptr;
 
                        static void ToolbarItemCb(void *data, Evas_Object *obj, void *event_info);
        };
index c1a4921..8660706 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <Elementary.h>
 #include "View/MainView.h"
-#include "View/View.h"
+#include "Common/View.h"
 #include "Utils/Signal.h"
 
 #include <vector>
@@ -39,7 +39,7 @@ namespace view {
        /**
         * @brief Base class for pages (Alarm, World Clock, StopWatch and Timer)
         */
-       class PageView : public ui::IView {
+       class PageView : public common::IView {
                public:
                        /**
                         * @brief Constructs class object.
index 2b38bdf..ffd97ef 100644 (file)
@@ -22,7 +22,7 @@
 #include <vector>
 
 #include "Common/CounterView.h"
-#include "View/View.h"
+#include "Common/View.h"
 #include "Utils/Signal.h"
 
 #define PART_LAP_NO "txt.lap.no"
@@ -86,14 +86,14 @@ namespace view {
         * Class displays Stopwatch view for user interaction. Allows to run, stop,
         * resume and record lap in its lap list.
         */
-       class StopWatchView : public ui::IView {
+       class StopWatchView : public common::IView {
        public:
                /**
                 * @brief StopWatchView constructor
                 *
                 * @param[in] main The parent's view
                 */
-               StopWatchView(ui::IView &main);
+               StopWatchView(common::IView &main);
 
                /**
                 * @brief Makes class non-copyable
@@ -222,8 +222,8 @@ namespace view {
                static const unsigned MAX_LAPS_RECORDS = 999;
 
        private:
-               CounterView *main_counter_ = nullptr;
-               CounterView *lap_counter_ = nullptr;
+               common::CounterView *main_counter_ = nullptr;
+               common::CounterView *lap_counter_ = nullptr;
                Evas_Object *layout_ = nullptr;
 
                void CreateButton(Evas_Object *parent, const char *name,
index 205fdf0..1a3aaa2 100644 (file)
@@ -23,7 +23,7 @@
 #include <vector>
 #include <functional>
 
-#include "View/View.h"
+#include "Common/View.h"
 #include "View/PageView.h"
 #include "Common/CounterView.h"
 #include "Utils/Signal.h"
@@ -37,7 +37,7 @@ namespace view {
         * Provides features such as setting timer's time, running, stopping and
         * resuming timer.
         */
-       class TimerView : public ui::IView {
+       class TimerView : public common::IView {
        public:
 
                /**
@@ -45,7 +45,7 @@ namespace view {
                 *
                 * @param[in] main The parent's view
                 */
-               TimerView(ui::IView &main);
+               TimerView(common::IView &main);
 
                /**
                 * @brief Makes class non-copyable
@@ -187,7 +187,7 @@ namespace view {
                Evas_Object *layout_ = NULL;
                Evas_Object *selector_ = NULL;
                Evas_Object *conformant = NULL;
-               view::CounterView *counter_ = NULL;
+               common::CounterView *counter_ = NULL;
 
                enum class ButtonArrowDirection {
                        ARROW_UP,
diff --git a/clock/inc/View/View.h b/clock/inc/View/View.h
deleted file mode 100644 (file)
index ad8b189..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-* Copyright 2016  Samsung Electronics Co., Ltd
-*
-* Licensed under the Flora License, Version 1.1 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://floralicense.org/license/
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-#ifndef _CLOCK_UI_VIEW_H_
-#define _CLOCK_UI_VIEW_H_
-
-#include <Elementary.h>
-
-namespace ui {
-       /**
-        * @brief Abstract interface representing Native UI toolkit object.
-        */
-       class IView {
-               public:
-                       /**
-                        * @brief Get Native UI toolkit representation
-                        */
-                       virtual Evas_Object *GetEvasObject() = 0;
-                       virtual ~IView() {}
-       };
-};
-
-#endif
index 5df2825..0822ee0 100644 (file)
@@ -33,9 +33,9 @@ namespace view {
                         * @brief Creates instance of WeekFlags view
                         *
                         * @param main parent view
-                        * @param flags model::WeekFlags to be edited
+                        * @param flags common::WeekFlags to be edited
                         */
-                       WeekFlagsView(view::MainView &main, model::WeekFlags &flags);
+                       WeekFlagsView(view::MainView &main, common::WeekFlags &flags);
                        Evas_Object *GetEvasObject();
                protected:
                        virtual void CreateContent(Evas_Object *parent);
@@ -43,18 +43,18 @@ namespace view {
                private:
                        struct CheckBoxDesc {
                                Evas_Object *check;
-                               model::WeekDay day;
+                               common::WeekDay day;
                                WeekFlagsView *context;
                        };
                        Evas_Object *list_ = nullptr;
-                       model::WeekFlags &flags_;
-                       void AppendCheckableListItem(model::WeekDay);
+                       common::WeekFlags &flags_;
+                       void AppendCheckableListItem(common::WeekDay);
                        void CheckBoxStatusUpdate();
-                       void Toggle(model::WeekDay);
+                       void Toggle(common::WeekDay);
                        void CreateList();
                        static void ItemSelectedCallback(void *, Evas_Object *, void *);
                        std::list<CheckBoxDesc*> check_boxes_;
-                       static const char *GetLabelForWeekDay(model::WeekDay day);
+                       static const char *GetLabelForWeekDay(common::WeekDay day);
                        void UpdateList();
                        utils::Connection language_change_listener_;
        };
index e088176..33cecbc 100644 (file)
@@ -23,7 +23,7 @@
 #include <vector>
 #include <ctime>
 
-#include "View/View.h"
+#include "Common/View.h"
 
 namespace view {
 
@@ -34,7 +34,7 @@ namespace view {
         * It displays map with day and night line and colors underlying map into
         * light and shadow color depending on time of the day.
         */
-       class WorldClockMap : public ui::IView {
+       class WorldClockMap : public common::IView {
        public:
 
                /**
@@ -49,7 +49,7 @@ namespace view {
                 *
                 * @param[in] parent The parent of the map
                 */
-               WorldClockMap(ui::IView &parent);
+               WorldClockMap(common::IView &parent);
                ~WorldClockMap();
 
        private:
index d53b833..77a317c 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "Model/WorldClock.h"
 #include "View/PageView.h"
-#include "View/View.h"
+#include "Common/View.h"
 #include "View/WorldClockMap.h"
 #include "Utils/Signal.h"
 
@@ -34,7 +34,7 @@ namespace view {
         * @details It communicates with external classes by sending signals and do
         * not touch any external resources directly except utils.
         */
-       class WorldClockView: public ui::IView {
+       class WorldClockView: public common::IView {
                public:
 
                        /**
@@ -51,7 +51,7 @@ namespace view {
                         *
                         * @param main parent of the world clock view object
                         */
-                       WorldClockView(ui::IView &main);
+                       WorldClockView(common::IView &main);
 
                        /**
                         * @brief Makes class non-copyable
index 3dd4680..a6715fe 100644 (file)
@@ -30,7 +30,7 @@ bool ClockApp::OnCreate()
        }
 
        elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
-       provider_ = new model::AlarmProvider();
+       provider_ = new common::AlarmProvider();
        main_ctrl_ = new controller::MainController(provider_);
 
        return true;
index ac65fd9..6267294 100644 (file)
@@ -36,9 +36,10 @@ using namespace view;
 using namespace utils;
 using namespace presenter;
 using namespace model;
+using namespace common;
 using std::placeholders::_1;
 
-MainController::MainController(model::AlarmProvider *provider) :
+MainController::MainController(common::AlarmProvider *provider) :
        provider_(provider)
 {
 }
index 6e7a884..3a27a27 100644 (file)
@@ -20,6 +20,8 @@
 #include "Common/Defines.h"
 #include "Utils/Log.h"
 
+using namespace std::chrono;
+
 namespace model {
 
 Timer::Timer()
@@ -50,7 +52,7 @@ app_control_h Timer::CreateAppControl()
                return NULL;
        }
 
-       ret = app_control_set_app_id(appControl, PACKAGE);
+       ret = app_control_set_app_id(appControl, PACKAGE_RING);
        if (ret != APP_CONTROL_ERROR_NONE) {
                ERR("app_control_set_app_id failed");
                app_control_destroy(appControl);
index ca5b554..81bf257 100644 (file)
@@ -22,8 +22,8 @@
 
 using namespace presenter;
 using namespace view;
-using namespace model;
 using namespace utils;
+using namespace common;
 using std::placeholders::_1;
 
 
index c8ae37c..53ca301 100644 (file)
@@ -16,8 +16,9 @@
 
 #include "Presenter/DeleteAlarmPresenter.h"
 
-using namespace model;
 using namespace view;
+using namespace common;
+
 namespace presenter {
 DeleteAlarmPresenter::DeleteAlarmPresenter(DeleteAlarmView &view, AlarmList &model)
        : view_(view), alarm_list_(model)
index 8becaa4..b0e0840 100644 (file)
@@ -25,8 +25,9 @@
 
 using namespace presenter;
 using namespace view;
-using namespace model;
 using namespace utils;
+using namespace common;
+
 using std::placeholders::_1;
 
 const double time_truncate_factor = 60 * 1000; // 60 seconds
index 60b14a1..9c33e44 100644 (file)
@@ -38,7 +38,7 @@ TimerPresenter::TimerPresenter(view::TimerView &view, model::Timer &model)
        connections_.push_back(animator_.OnTick.Connect(
                                std::bind(&TimerPresenter::TimeUpdateRequest, this)));
 
-       connections_.push_back(utils::EventBus::AddListener<model::RingDismissEvent>(
+       connections_.push_back(utils::EventBus::AddListener<common::RingDismissEvent>(
                                std::bind(&TimerPresenter::RingDismissHandle,
                                this, std::placeholders::_1)));
 }
index 4de2940..5a1d200 100644 (file)
@@ -31,8 +31,8 @@
 #include "Utils/SystemSettings.h"
 
 using namespace view;
-using namespace model;
 using namespace utils;
+using namespace common;
 
 /**
  * Genlist data
@@ -275,7 +275,7 @@ void AlarmListView::Del(void *data, Evas_Object *obj)
        delete id;
 }
 
-AlarmListView::AlarmListView(ui::IView &main) : popup_(nullptr), nocontent_layout_(nullptr)
+AlarmListView::AlarmListView(common::IView &main) : popup_(nullptr), nocontent_layout_(nullptr)
 {
        /* Base Layout */
        content_ = elm_layout_add(main.GetEvasObject());
index 385ed83..7c86dae 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <sstream>
 
-using namespace model;
+using namespace common;
 using namespace utils;
 
 namespace view {
@@ -285,7 +285,7 @@ void DeleteAlarmView::OnDeleteButtonClickedCb(void *data, Evas_Object *obj, void
 }
 
 int DeleteAlarmView::ItemAppend(utils::Time time, const char *name,
-       const model::WeekFlags flags, bool active)
+       const common::WeekFlags flags, bool active)
 {
        ItemData *data = new ItemData;
        Elm_Genlist_Item_Class *itc;
index 4a27a7b..1383d28 100644 (file)
@@ -32,7 +32,7 @@
 
 using namespace view;
 using namespace utils;
-using namespace model;
+using namespace common;
 
 
 #define VIBRATION_ICON_PATH "images/01_volume_vibration.png"
@@ -243,11 +243,11 @@ void EditAlarmView::DateTimeChangedCallback(void *data, Evas_Object *obj, void *
 void EditAlarmView::UpdateAlarmType(bool mute)
 {
        if (mute) {
-               if (data_.type == model::Alarm::Type::SOUND_ONLY)
-                       data_.type = model::Alarm::Type::VIBRATION;
+               if (data_.type == common::Alarm::Type::SOUND_ONLY)
+                       data_.type = common::Alarm::Type::VIBRATION;
        } else {
-               if (data_.type == model::Alarm::Type::VIBRATION)
-                       data_.type = model::Alarm::Type::SOUND_ONLY;
+               if (data_.type == common::Alarm::Type::VIBRATION)
+                       data_.type = common::Alarm::Type::SOUND_ONLY;
        }
        elm_genlist_item_update(type_it_);
 }
@@ -778,7 +778,7 @@ void EditAlarmView::UpdateType()
        }
 }
 
-void EditAlarmView::SetType(model::Alarm::Type type)
+void EditAlarmView::SetType(common::Alarm::Type type)
 {
        data_.type = type;
 
@@ -788,7 +788,7 @@ void EditAlarmView::SetType(model::Alarm::Type type)
 void EditAlarmView::PopupHide(void *data, Evas_Object *obj, void *event)
 {
        EditAlarmView *view = static_cast<EditAlarmView*>(data);
-       model::Alarm::Type type = static_cast<Alarm::Type>(elm_radio_value_get(view->main_radio_));
+       common::Alarm::Type type = static_cast<Alarm::Type>(elm_radio_value_get(view->main_radio_));
 
        view->SetType(type);
 
index 4b5018f..2e7bd23 100644 (file)
@@ -66,7 +66,7 @@ void MainView::ToolbarItemCb(void *data, Evas_Object *obj, void *event_info)
 {
        ViewType *type = static_cast<ViewType*>(data);
        MainView *mainView = static_cast<MainView *>(evas_object_data_get(obj, "parent"));
-       ui::IView *page = mainView->GetView(*type);
+       common::IView *page = mainView->GetView(*type);
        if (!page) return;
 
        Evas_Object *layout = elm_object_parent_widget_get(obj);
@@ -209,7 +209,7 @@ Evas_Object *MainView::GetConformant()
        return conformant_;
 }
 
-ui::IView *MainView::GetView(ViewType type)
+common::IView *MainView::GetView(ViewType type)
 {
        switch (type){
                case ALARM:
index 6cac2a7..979d9c2 100644 (file)
@@ -22,6 +22,8 @@
 #include "Utils/Log.h"
 #include "Utils/Translate.h"
 
+using namespace common;
+
 namespace view {
 
 const char *StopWatchView::EDJE_FILE = "edje/StopWatch.edj";
@@ -35,7 +37,7 @@ const Elm_Genlist_Item_Class StopWatchView::list_itc = {
        }
 };
 
-StopWatchView::StopWatchView(ui::IView &main)
+StopWatchView::StopWatchView(common::IView &main)
 {
        layout_ = elm_layout_add(main.GetEvasObject());
 
index a9b4d33..3161e36 100644 (file)
@@ -28,6 +28,7 @@
 namespace view {
 
 using namespace utils;
+using namespace common;
 
 const char *TimerView::EDJE_FILE = "edje/Timer.edj";
 const char *TimerView::GROUP = "Timer";
@@ -37,7 +38,7 @@ static Elm_Entry_Filter_Limit_Size limit_size = {
        .max_byte_count = 0
 };
 
-TimerView::TimerView(ui::IView &main) : set_time_()
+TimerView::TimerView(common::IView &main) : set_time_()
 {
        layout_ = elm_layout_add(main.GetEvasObject());
 
index 5a18ae0..4da44c9 100644 (file)
@@ -25,7 +25,7 @@
 
 using namespace view;
 using namespace utils;
-using namespace model;
+using namespace common;
 
 
 WeekFlagsView::WeekFlagsView(view::MainView &main, WeekFlags &flags)
index 8d69414..8f7c41b 100644 (file)
@@ -25,7 +25,7 @@ namespace view {
 
 using namespace utils;
 
-WorldClockMap::WorldClockMap(ui::IView &parent)
+WorldClockMap::WorldClockMap(common::IView &parent)
 {
        map_ = elm_layout_add(parent.GetEvasObject());
        if (!elm_layout_file_set(map_,
index 4776816..ae1c3a8 100644 (file)
@@ -218,7 +218,7 @@ Eina_Bool WorldClockView::TimeUpdateCb(void *data)
        return EINA_TRUE;
 }
 
-WorldClockView::WorldClockView(ui::IView &main)
+WorldClockView::WorldClockView(common::IView &main)
 {
        double time_delta;