merge common & worldclock namespaces
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Thu, 18 Aug 2016 14:25:22 +0000 (16:25 +0200)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Fri, 26 Aug 2016 07:31:09 +0000 (09:31 +0200)
Change-Id: Ieaadb5f6693331de1f0e998c31a060f44757ae15

46 files changed:
clock/inc/Controller/MainController.h
clock/inc/Internal/AlarmProviderFile.h
clock/inc/Internal/AlarmProviderStub.h
clock/inc/Model/Alarm.h
clock/inc/Model/AlarmProvider.h
clock/inc/Model/Location.h
clock/inc/Model/StopWatch.h
clock/inc/Model/StopWatchLap.h
clock/inc/Model/Timer.h
clock/inc/Model/WeekFlags.h
clock/inc/Model/WordlClock.h
clock/inc/Presenter/AlarmPresenter.h
clock/inc/UI/Time.h [deleted file]
clock/inc/UI/View.h
clock/inc/Utils/BinaryFileReader.h
clock/inc/Utils/BinaryFileWriter.h
clock/inc/Utils/Log.h
clock/inc/Utils/Reader.h
clock/inc/Utils/Serialization.h
clock/inc/Utils/Time.h
clock/inc/Utils/Utils.h
clock/inc/Utils/Writer.h
clock/inc/View/AlarmView.h
clock/inc/View/MainView.h
clock/inc/View/PageView.h
clock/inc/View/StopWatchView.h
clock/inc/View/TimerView.h
clock/inc/View/WorldClockView.h
clock/src/Clock.cpp
clock/src/Controller/MainController.cpp
clock/src/Model/Alarm.cpp
clock/src/Model/AlarmProvider.cpp
clock/src/Model/AlarmProviderFile.cpp
clock/src/Model/AlarmProviderStub.cpp
clock/src/Model/WeekFlags.cpp
clock/src/Presenter/AlarmPresenter.cpp
clock/src/Utils/BinaryFileReader.cpp
clock/src/Utils/BinaryFileWriter.cpp
clock/src/Utils/Time.cpp
clock/src/Utils/Utils.cpp
clock/src/View/AlarmView.cpp
clock/src/View/MainView.cpp
clock/src/View/PageView.cpp
clock/src/View/StopWatchView.cpp
clock/src/View/TimerView.cpp
clock/src/View/WorldClockView.cpp

index 6a0ee71..ca1e57c 100644 (file)
  * @{
  */
 
-namespace worldclock {
-       namespace controller {
-
+namespace controller {
        /**
         * @brief Application lifecycle main controller singleton class
         * @remarks This is singleton class.
         */
-               class MainController {
-                       public:
-                               /**
-                                * @brief Retrieves singleton instance.
-                                */
-                               static MainController &GetInstance();
-
-                               /**
-                                * @brief Destructor.
-                                */
-                               ~MainController();
-
-                               /**
-                                * @brief Initializes application.
-                                */
-                               int Init();
-
-                               /**
-                                * @brief Denitializes application.
-                                */
-                               void Deinit();
-
-                               /**
-                                * @brief Pause application.
-                                */
-                               void Pause();
-
-                               /**
-                                * @brief Resume application.
-                                */
-                               void Resume();
-
-                               /**
-                                * @briefs Copies this class object instance.
-                                * @remarks Customized for singleton purpose - make no effect.
-                                */
-                               MainController(MainController const&) = delete;
-
-                               /**
-                                * @briefs Overloads equation mark.
-                                * @remarks Customized for singleton purpose - make no effect.
-                                */
-                               void operator=(MainController const&) = delete;
-
-                       private:
-                               /**
-                                * @brief Constructs MainController class object.
-                                */
-                               MainController() {};
-               };
-
-       }
+       class MainController {
+               public:
+                       /**
+                        * @brief Retrieves singleton instance.
+                        */
+                       static MainController &GetInstance();
+
+                       /**
+                        * @brief Destructor.
+                        */
+                       ~MainController();
+
+                       /**
+                        * @brief Initializes application.
+                        */
+                       int Init();
+
+                       /**
+                        * @brief Denitializes application.
+                        */
+                       void Deinit();
+
+                       /**
+                        * @brief Pause application.
+                        */
+                       void Pause();
+
+                       /**
+                        * @brief Resume application.
+                        */
+                       void Resume();
+
+                       /**
+                        * @briefs Copies this class object instance.
+                        * @remarks Customized for singleton purpose - make no effect.
+                        */
+                       MainController(MainController const&) = delete;
+
+                       /**
+                        * @briefs Overloads equation mark.
+                        * @remarks Customized for singleton purpose - make no effect.
+                        */
+                       void operator=(MainController const&) = delete;
+
+               private:
+                       /**
+                        * @brief Constructs MainController class object.
+                        */
+                       MainController() {};
+       };
 }
 
 /**
index a3c9e20..2d530ea 100644 (file)
@@ -7,22 +7,20 @@
 #include "Model/AlarmProvider.h"
 
 namespace internal {
-       namespace model {
-               class AlarmProviderFile : public common::model::AlarmProvider
-               {
-                       public:
-                               std::vector<std::reference_wrapper<common::model::Alarm>> GetAlarms();
-                               common::model::Alarm* GetAlarmWithId(common::model::AlarmId id);
-                               void Add(common::model::Alarm& alarm);
-                               void Remove(common::model::Alarm& alarm);
-                               AlarmProviderFile(common::utils::IReader &r);
-                               ~AlarmProviderFile();
-                               void Serialize(common::utils::IWriter &w) const;
-                       private:
-                               std::list<common::model::Alarm> alarms;
-                               static const int db_schema_version;
-               };
-       } /* model */
+       class AlarmProviderFile : public model::AlarmProvider
+       {
+               public:
+                       std::vector<std::reference_wrapper<model::Alarm>> GetAlarms();
+                       model::Alarm* GetAlarmWithId(model::AlarmId id);
+                       void Add(model::Alarm& alarm);
+                       void Remove(model::Alarm& alarm);
+                       AlarmProviderFile(utils::IReader &r);
+                       ~AlarmProviderFile();
+                       void Serialize(utils::IWriter &w) const;
+               private:
+                       std::list<model::Alarm> alarms;
+                       static const int db_schema_version;
+       };
 } /* internal */
 
 #endif
index 4beec80..791e039 100644 (file)
@@ -4,20 +4,18 @@
 #include "Model/AlarmProvider.h"
 
 namespace internal {
-       namespace model {
-               class AlarmProviderStub : public common::model::AlarmProvider
-               {
-                       public:
-                               std::vector<std::reference_wrapper<common::model::Alarm>> GetAlarms();
-                               common::model::Alarm* GetAlarmWithId(common::model::AlarmId id);
-                               void Add(common::model::Alarm& alarm);
-                               void Remove(common::model::Alarm& alarm);
-                               AlarmProviderStub(common::utils::IReader &r);
-                               void Serialize(common::utils::IWriter &w) const {}
-                       private:
-                               std::vector<common::model::Alarm> alarms;
-               };
-       } /* model */
+       class AlarmProviderStub : public model::AlarmProvider
+       {
+               public:
+                       std::vector<std::reference_wrapper<model::Alarm>> GetAlarms();
+                       model::Alarm* GetAlarmWithId(model::AlarmId id);
+                       void Add(model::Alarm& alarm);
+                       void Remove(model::Alarm& alarm);
+                       AlarmProviderStub(utils::IReader &r);
+                       void Serialize(utils::IWriter &w) const {}
+               private:
+                       std::vector<model::Alarm> alarms;
+       };
 } /* internal */
 
 #endif
index 065294b..ddfa63c 100644 (file)
@@ -9,69 +9,68 @@
 #include "Utils/Serialization.h"
 #include "Utils/Time.h"
 
-namespace common {
-       namespace model {
-               typedef int AlarmId;
-               enum class AlarmType {
-                       SOUND_ONLY,
-                       VIBRATION,
-                       VIBRATION_AND_SOUND
-               };
-               void Serialize(utils::IWriter &w, AlarmType type);
-               void Deserialize(utils::IReader &w, AlarmType &type);
-               class CLOCK_EXPORT_API Alarm : public utils::ISerializable {
-                       public:
-                               Alarm();
-                               Alarm(utils::IReader &);
-                               void Activate();
-                               bool IsActivated() const;
-                               void Deactivate();
-                               void Snooze();
-                               void EnableSnooze();
-                               void DisableSnooze();
-                               bool IsSnoozeEnabled();
-                               void SetSnoozeInterval(unsigned int seconds);
-                               unsigned int GetSnoozeInterval() const;
-                               void SetSnoozeMaxAttemps(unsigned int attemps);
-                               unsigned int GetSnoozeMaxAttempts() const;
-                               std::string GetName() const;
-                               void SetName(std::string name);
-                               utils::Time GetTime() const;
-                               void SetTime(utils::Time time);
-                               std::string GetMelody() const;
-                               void SetMelody(std::string path);
-                               AlarmType GetType() const;
-                               void SetType(AlarmType pattern);
-                               WeekFlags GetWeekFlags() const;
-                               void SetWeekFlags(WeekFlags flags);
-                               void Serialize(utils::IWriter &w) const;
-                               unsigned int GetVolume() const;
-                               void SetVolume(unsigned int volume);
+namespace model {
+       typedef int AlarmId;
+       enum class AlarmType {
+               SOUND_ONLY,
+               VIBRATION,
+               VIBRATION_AND_SOUND
+       };
+       void Serialize(utils::IWriter &w, AlarmType type);
+       void Deserialize(utils::IReader &w, AlarmType &type);
+       class CLOCK_EXPORT_API Alarm : public utils::ISerializable {
+               public:
+                       Alarm();
+                       Alarm(utils::IReader &);
+                       void Activate();
+                       bool IsActivated() const;
+                       void Deactivate();
+                       void Snooze();
+                       void EnableSnooze();
+                       void DisableSnooze();
+                       bool IsSnoozeEnabled();
+                       void SetSnoozeInterval(unsigned int seconds);
+                       unsigned int GetSnoozeInterval() const;
+                       void SetSnoozeMaxAttemps(unsigned int attemps);
+                       unsigned int GetSnoozeMaxAttempts() const;
+                       std::string GetName() const;
+                       void SetName(std::string name);
+                       utils::Time GetTime() const;
+                       void SetTime(utils::Time time);
+                       std::string GetMelody() const;
+                       void SetMelody(std::string path);
+                       AlarmType GetType() const;
+                       void SetType(AlarmType pattern);
+                       WeekFlags GetWeekFlags() const;
+                       void SetWeekFlags(WeekFlags flags);
+                       void Serialize(utils::IWriter &w) const;
+                       unsigned int GetVolume() const;
+                       void SetVolume(unsigned int volume);
 
-                               /** Implement guideline requirement. Two alarms are considered
-                                * same if they have same time and name */
-                               inline bool operator==(const Alarm &a) { return (time == a.time) && (a.name == name); }
-                               inline bool operator==(const AlarmId id) { return this->alarm_id == id; }
-                       private:
-                               int alarm_id;
-                               std::string name;
-                               struct {
-                                       std::string melody;
-                                       unsigned int volume;
-                               } sound;
-                               AlarmType type_;
-                               WeekFlags flags;
-                               bool activated;
-                               bool snooze_enabled;
-                               struct {
-                                       int alarm_id;
-                                       unsigned int interval;
-                                       unsigned int attempt;
-                                       unsigned int attempts_max;
-                               } snooze;
-                               utils::Time time;
-               };
-       } /* model */
-} /* common */
+               /** Implement guideline requirement. Two alarms are considered
+                * same if they have same time and name */
+               inline bool operator==(const Alarm &a) { return (time == a.time) && (a.name == name); }
+               inline bool operator==(const AlarmId id) { return this->alarm_id == id; }
+       private:
+               int alarm_id;
+               std::string name;
+               struct {
+                       std::string melody;
+                       unsigned int volume;
+               } sound;
+               std::string vibration;
+               WeekFlags flags;
+               bool activated;
+               bool snooze_enabled;
+               AlarmType type_;
+               struct {
+                       int alarm_id;
+                       unsigned int interval;
+                       unsigned int attempt;
+                       unsigned int attempts_max;
+               } snooze;
+               utils::Time time;
+       };
+} /* model */
 
 #endif
index 7468100..a04939f 100644 (file)
 #include <functional>
 
 
-namespace common {
-       namespace model {
-               class CLOCK_EXPORT_API AlarmProvider : public utils::ISerializable {
-                       public:
-                               static AlarmProvider *GetInstance();
-                               static void Sync();
+namespace model {
+       class CLOCK_EXPORT_API AlarmProvider : public utils::ISerializable {
+               public:
+                       static AlarmProvider *GetInstance();
+                       static void Sync();
 
-                               virtual std::vector<std::reference_wrapper<Alarm>> GetAlarms() = 0;
-                               virtual Alarm *GetAlarmWithId(AlarmId id) = 0;
-                               virtual void Add(Alarm& alarm) = 0;
-                               virtual void Remove(Alarm& alarm) = 0;
-                       protected:
-                               AlarmProvider() {}
-                               virtual ~AlarmProvider() {}
-               };
-       } /* model */
-} /* common */
+                       virtual std::vector<std::reference_wrapper<Alarm>> GetAlarms() = 0;
+                       virtual Alarm *GetAlarmWithId(AlarmId id) = 0;
+                       virtual void Add(Alarm& alarm) = 0;
+                       virtual void Remove(Alarm& alarm) = 0;
+               protected:
+                       AlarmProvider() {}
+                       virtual ~AlarmProvider() {}
+       };
+} /* model */
 
 #endif
index 2f5a973..e8eefa8 100644 (file)
@@ -1,14 +1,15 @@
 #ifndef _CLOCK_LOCATION_H_
 #define _CLOCK_LOCATION_H_
 
-namespace clock {
-       namespace model {
-               struct Location {
-                       std::string Name;
-                       std::string Country;
-                       std::string Timezone;
-                       std::string TzPath;
-               };
-       } /* model */
-} /* clock */
+#include <string>
+
+namespace model {
+       struct Location {
+               std::string Name;
+               std::string Country;
+               std::string Timezone;
+               std::string TzPath;
+       };
+} /* model */
+
 #endif
index 3c25532..0e19576 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef _CLOCK_STOPWATCH_H_
 #define _CLOCK_STOPWATCH_H_
 
-namespace clock {
-       namespace model {
-               class StopWatch {
-                       public:
-                               void Start();
-                               void Stop();
-                               void EndLap();
-                               void Reset();
-                               time_t ElapsedTime();
-                               std::vector<StopWatchLap> GetLaps();
-                       private:
-                               time_t start_time;
-                               std::vector<StopWatchLap> laps;
-               };
-       } /* model */
-} /* clock */
+namespace model {
+       class StopWatch {
+               public:
+                       void Start();
+                       void Stop();
+                       void EndLap();
+                       void Reset();
+                       time_t ElapsedTime();
+                       std::vector<StopWatchLap> GetLaps();
+               private:
+                       time_t start_time;
+                       std::vector<StopWatchLap> laps;
+       };
+} /* model */
 
 #endif
index 3d21b6f..d55ac40 100644 (file)
@@ -1,16 +1,14 @@
 #ifndef _CLOCK_STOPWATCH_LAP_H_
 #define _CLOCK_STOPWATCH_LA_H_
 
-namespace clock {
-       namespace model {
-               class StopWatchLap {
-                       public:
-                               StopWatchLap(time_t start, time_t duration);
-                               ~StopWatchLap();
-                               time_t LapDuration();
-                               time_t LapStartTime();
-               };
-       } /* model */
-} /* clock */
+namespace model {
+       class StopWatchLap {
+               public:
+                       StopWatchLap(time_t start, time_t duration);
+                       ~StopWatchLap();
+                       time_t LapDuration();
+                       time_t LapStartTime();
+       };
+} /* model */
 
 #endif
index 945f521..ea2203a 100644 (file)
@@ -1,15 +1,13 @@
 #ifndef _CLOCK_TIMER_H_
 #define _CLOCK_TIMER_H_
 
-namespace clock {
-       namespace model {
-               class Timer {
-                       public:
-                               Start(time_t delay);
-                               time_t StartTime();
-                               time_t RemainingTime();
-               };
-       } /* model */
-} /* clock */
+namespace model {
+       class Timer {
+               public:
+                       Start(time_t delay);
+                       time_t StartTime();
+                       time_t RemainingTime();
+       };
+} /* model */
 
 #endif
index b020703..26612e4 100644 (file)
 
 #include <app_alarm.h>
 
-namespace common {
-       namespace model {
-               enum class WeekDay : int {
-                       MONDAY    = ALARM_WEEK_FLAG_MONDAY,
-                       TUESDAY   = ALARM_WEEK_FLAG_TUESDAY,
-                       WEDNESDAY = ALARM_WEEK_FLAG_WEDNESDAY,
-                       THURSDAY  = ALARM_WEEK_FLAG_THURSDAY,
-                       FRIDAY    = ALARM_WEEK_FLAG_FRIDAY,
-                       SATURDAY  = ALARM_WEEK_FLAG_SATURDAY,
-                       SUNDAY    = ALARM_WEEK_FLAG_SUNDAY,
-                       ALL_WEEK  = (MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY),
-                       WEEKEND   = (SATURDAY | SUNDAY),
-               };
-               inline constexpr WeekDay
-               operator|(WeekDay a, WeekDay b)
-               {
-                       return static_cast<WeekDay>(static_cast<int>(a) | static_cast<int>(b));
-               }
-               class CLOCK_EXPORT_API WeekFlags : public utils::ISerializable {
-                       public:
-                               WeekFlags();
-                               WeekFlags(utils::IReader &r);
-                               WeekFlags(WeekDay day);
-                               void AddDay(WeekDay day);
-                               void RemoveDay(WeekDay day);
-                               bool IsOn(WeekDay day);
-                               void Serialize(utils::IWriter &w) const;
-                               int GetBitMask() const;
-                               inline bool operator==(const WeekFlags &a) { return a.raw_flags == raw_flags; }
-                       private:
-                               int raw_flags;
-               };
-       } /* model */
-} /* common */
+namespace model {
+       enum class WeekDay : int {
+               MONDAY    = ALARM_WEEK_FLAG_MONDAY,
+               TUESDAY   = ALARM_WEEK_FLAG_TUESDAY,
+               WEDNESDAY = ALARM_WEEK_FLAG_WEDNESDAY,
+               THURSDAY  = ALARM_WEEK_FLAG_THURSDAY,
+               FRIDAY    = ALARM_WEEK_FLAG_FRIDAY,
+               SATURDAY  = ALARM_WEEK_FLAG_SATURDAY,
+               SUNDAY    = ALARM_WEEK_FLAG_SUNDAY,
+               ALL_WEEK  = (MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY),
+               WEEKEND   = (SATURDAY | SUNDAY),
+       };
+       inline constexpr WeekDay
+       operator|(WeekDay a, WeekDay b)
+       {
+               return static_cast<WeekDay>(static_cast<int>(a) | static_cast<int>(b));
+       }
+       class CLOCK_EXPORT_API WeekFlags : public utils::ISerializable {
+               public:
+                       WeekFlags();
+                       WeekFlags(utils::IReader &r);
+                       WeekFlags(WeekDay day);
+                       void AddDay(WeekDay day);
+                       void RemoveDay(WeekDay day);
+                       bool IsOn(WeekDay day);
+                       void Serialize(utils::IWriter &w) const;
+                       int GetBitMask() const;
+                       inline bool operator==(const WeekFlags &a) { return a.raw_flags == raw_flags; }
+               private:
+                       int raw_flags;
+       };
+} /* model */
 
 #endif
index 21b5ef8..7307218 100644 (file)
@@ -3,16 +3,15 @@
 
 #include <vector>
 
-namespace clock {
-       namespace model {
-               class WorldClock {
-                       public:
-                               const std::vector<Location> Locations;
-                               const std::vector<Location> UserLocations;
+namespace model {
+       class WorldClock {
+               public:
+                       const std::vector<Location> Locations;
+                       const std::vector<Location> UserLocations;
+
+                       void AddUserLocation(Location loc);
+                       void RemoveUserLocation(Location loc);
+       };
+} /* model */
 
-                               void AddUserLocation(Location loc);
-                               void RemoveUserLocation(Location loc);
-               };
-       } /* model */
-} /* clock */
 #endif
index bf974da..883c120 100644 (file)
 #include "View/AlarmView.h"
 #include "Model/AlarmProvider.h"
 
-namespace worldclock {
-       namespace presenters {
-               class AlarmPresenter {
-                       public:
-                               AlarmPresenter(view::AlarmView *view, common::model::AlarmProvider *model);
-                       private:
-                               view::AlarmView *view;
-                               common::model::AlarmProvider *model;
-                               void ShowAll();
-                               void OnItemSelected(int idx);
-                               void OnItemActiveStatusChanged(int idx);
-               };
-       } /* presenters */
-} /* worldclock */
+namespace presenter {
+       class AlarmPresenter {
+               public:
+                       AlarmPresenter(view::AlarmView *view, model::AlarmProvider *model);
+               private:
+                       view::AlarmView *view;
+                       model::AlarmProvider *model;
+                       void ShowAll();
+                       void OnItemSelected(int idx);
+                       void OnItemActiveStatusChanged(int idx);
+       };
+} /* presenters */
 
 #endif
diff --git a/clock/inc/UI/Time.h b/clock/inc/UI/Time.h
deleted file mode 100644 (file)
index 1d1a923..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _CLOCK_TIME_H_
-#define _CLOCK_TIME_H_
-
-#include <time.h>
-
-time_t MakeTime(int day, int month, int year, int hour, int min);
-
-#endif
index 432aa08..4593e91 100644 (file)
@@ -3,13 +3,11 @@
 
 #include <Elementary.h>
 
-namespace common {
 namespace ui {
        class IView {
                public:
                        virtual Evas_Object *GetEvasObject() = 0;
        };
 };
-};
 
 #endif
index 0582fcb..1e38683 100644 (file)
 #include "Utils/Utils.h"
 #include <vector>
 
-namespace common {
-       namespace utils {
-               class BinaryFileReader : public IReader {
-                       public:
-                               BinaryFileReader(Utils::AppSubdirectory dir, const char *filename);
-                               ~BinaryFileReader() {}
-                               void Read(void *buffer, size_t size);
-                       private:
-                               std::vector<unsigned char> buffer;
-                               unsigned int offset;
-               };
-       } /* utils */
-} /* common */
+namespace utils {
+       class BinaryFileReader : public IReader {
+               public:
+                       BinaryFileReader(Utils::AppSubdirectory dir, const char *filename);
+                       ~BinaryFileReader() {}
+                       void Read(void *buffer, size_t size);
+               private:
+                       std::vector<unsigned char> buffer;
+                       unsigned int offset;
+       };
+} /* utils */
 
 #endif
index e09c73d..1dad58b 100644 (file)
 
 #include <fstream>
 
-namespace common {
-       namespace utils {
-               class BinaryFileWriter : public IWriter {
-                       public:
-                               BinaryFileWriter(Utils::AppSubdirectory dir, const char *filename);
-                               ~BinaryFileWriter();
-                               void Write(const void *buffer, size_t size);
-                               void Flush();
-                       private:
-                               std::ofstream file;
-               };
-       } /* utils */
-} /* common */
+namespace utils {
+       class BinaryFileWriter : public IWriter {
+               public:
+                       BinaryFileWriter(Utils::AppSubdirectory dir, const char *filename);
+                       ~BinaryFileWriter();
+                       void Write(const void *buffer, size_t size);
+                       void Flush();
+               private:
+                       std::ofstream file;
+       };
+} /* utils */
 
 #endif
index 7809d98..30bc0d7 100644 (file)
@@ -1,10 +1,9 @@
 #ifndef _CLOCK_LOC
 #define _CLOCK_LOC
 
-namespace clock {
-       namespace utils {
-               class Log {
-               };
-       } /* utils */
-} /* clock */
+namespace utils {
+       class Log {
+       };
+} /* utils */
+
 #endif
index ba65b90..57de5e3 100644 (file)
 
 #include <cstdlib>
 
-namespace common {
-       namespace utils {
-               class IReader {
-                       public:
-                               virtual void Read(void *buffer, size_t size) = 0;
-                               virtual ~IReader() {}
-               };
-       } /* utils */
-} /* common */
+namespace utils {
+       class IReader {
+               public:
+                       virtual void Read(void *buffer, size_t size) = 0;
+                       virtual ~IReader() {}
+       };
+} /* utils */
+
 #endif
index 911e404..a4abff4 100644 (file)
 #include <list>
 #include <string>
 
-namespace common {
-       namespace utils {
-               class ISerializable {
-                       public:
-                               ISerializable() {}
-                               ISerializable(IReader &reader) {}
-                               virtual void Serialize(IWriter &writer) const = 0;
-                               virtual ~ISerializable() {}
-               };
+namespace utils {
+       class ISerializable {
+               public:
+                       ISerializable() {}
+                       ISerializable(IReader &reader) {}
+                       virtual void Serialize(IWriter &writer) const = 0;
+                       virtual ~ISerializable() {}
+       };
 
-               // serialization/deserialization for basic types
-               // ISerializable
-               inline void Serialize(IWriter &w, const ISerializable &o) {
-                       o.Serialize(w);
-               }
-               template<typename T>
-               inline void Deserialize(IReader &r, T &obj) {
-                       obj = T(r);
-               }
+       // serialization/deserialization for basic types
+       // ISerializable
+       inline void Serialize(IWriter &w, const ISerializable &o) {
+               o.Serialize(w);
+       }
+       template<typename T>
+       inline void Deserialize(IReader &r, T &obj) {
+               obj = T(r);
+       }
 
-               // int
-               inline void Serialize(IWriter &w, const int v) {
-                       w.Write(&v, sizeof(v));
-               }
-               inline void Deserialize(IReader &r, int *v) {
-                       r.Read(v, sizeof(v));
-               }
-               inline void Deserialize(IReader &r, int &v) {
-                       r.Read(&v, sizeof(v));
-               }
+       // int
+       inline void Serialize(IWriter &w, const int v) {
+               w.Write(&v, sizeof(v));
+       }
+       inline void Deserialize(IReader &r, int *v) {
+               r.Read(v, sizeof(v));
+       }
+       inline void Deserialize(IReader &r, int &v) {
+               r.Read(&v, sizeof(v));
+       }
 
-               // unsigned int
-               inline void Serialize(IWriter &w, const unsigned int v) {
-                       w.Write(&v, sizeof(v));
-               }
-               inline void Deserialize(IReader &r, unsigned int *v) {
-                       r.Read(v, sizeof(v));
-               }
-               inline void Deserialize(IReader &r, unsigned int &v) {
-                       r.Read(&v, sizeof(v));
-               }
+       // unsigned int
+       inline void Serialize(IWriter &w, const unsigned int v) {
+               w.Write(&v, sizeof(v));
+       }
+       inline void Deserialize(IReader &r, unsigned int *v) {
+               r.Read(v, sizeof(v));
+       }
+       inline void Deserialize(IReader &r, unsigned int &v) {
+               r.Read(&v, sizeof(v));
+       }
 
-               // bool
-               inline void Serialize(IWriter &w, const bool v) {
-                       w.Write(&v, sizeof(v));
-               }
-               inline void Deserialize(IReader &r, bool *v) {
-                       r.Read(v, sizeof(v));
-               }
-               inline void Deserialize(IReader &r, bool &v) {
-                       r.Read(&v, sizeof(v));
-               }
+       // bool
+       inline void Serialize(IWriter &w, const bool v) {
+               w.Write(&v, sizeof(v));
+       }
+       inline void Deserialize(IReader &r, bool *v) {
+               r.Read(v, sizeof(v));
+       }
+       inline void Deserialize(IReader &r, bool &v) {
+               r.Read(&v, sizeof(v));
+       }
 
-               // time_t
-               inline void Serialize(IWriter &w, const time_t v) {
-                       w.Write(&v, sizeof(v));
-               }
-               inline void Deserialize(IReader &r, time_t *v) {
-                       r.Read(v, sizeof(v));
-               }
-               inline void Deserialize(IReader &r, time_t &v) {
-                       r.Read(&v, sizeof(v));
-               }
+       // time_t
+       inline void Serialize(IWriter &w, const time_t v) {
+               w.Write(&v, sizeof(v));
+       }
+       inline void Deserialize(IReader &r, time_t *v) {
+               r.Read(v, sizeof(v));
+       }
+       inline void Deserialize(IReader &r, time_t &v) {
+               r.Read(&v, sizeof(v));
+       }
 
-               // serialization for std::string
-               inline void Serialize(IWriter &w, const std::string &v) {
-                       int len = v.size();
-                       w.Write(&len, sizeof(len));
-                       w.Write(v.c_str(), len);
-               }
-               inline void Deserialize(IReader &r, std::string &v) {
-                       int len;
-                       r.Read(&len, sizeof(len));
-                       char *buf = new char[len + 1];
-                       r.Read(buf, len);
-                       buf[len] = '\0';
-                       v = std::string(buf);
-                       delete buf;
-               };
+       // serialization for std::string
+       inline void Serialize(IWriter &w, const std::string &v) {
+               int len = v.size();
+               w.Write(&len, sizeof(len));
+               w.Write(v.c_str(), len);
+       }
+       inline void Deserialize(IReader &r, std::string &v) {
+               int len;
+               r.Read(&len, sizeof(len));
+               char *buf = new char[len + 1];
+               r.Read(buf, len);
+               buf[len] = '\0';
+               v = std::string(buf);
+               delete buf;
+       };
+
+       // serialization for std::list
+       template <typename T>
+       inline void Serialize(IWriter &w, const std::list<T> &list) {
+               int len = list.size();
+               w.Write(&len, sizeof(len));
+               for (auto it = list.begin(); it != list.end(); ++it) {
+                       Serialize(w, *it);
+               }
+       }
+       template <typename T>
+       inline void Deserialize(IReader &r, std::list<T> &list) {
+               int len;
+               r.Read(&len, sizeof(len));
+               for (int i = 0; i < len; i++) {
+                       T obj(r);
+                       list.push_back(std::move(obj));
+               }
+       }
+} /* utils */
 
-               // serialization for std::list
-               template <typename T>
-               inline void Serialize(IWriter &w, const std::list<T> &list) {
-                       int len = list.size();
-                       w.Write(&len, sizeof(len));
-                       for (auto it = list.begin(); it != list.end(); ++it) {
-                               Serialize(w, *it);
-                       }
-               }
-               template <typename T>
-               inline void Deserialize(IReader &r, std::list<T> &list) {
-                       int len;
-                       r.Read(&len, sizeof(len));
-                       for (int i = 0; i < len; i++) {
-                               T obj(r);
-                               list.push_back(std::move(obj));
-                       }
-               }
-       } /* utils */
-} /* common */
 #endif
index 06b5af5..6856453 100644 (file)
@@ -4,26 +4,24 @@
 #include "Common/Defines.h"
 #include "Utils/Serialization.h"
 
-namespace common {
-       namespace utils {
-               enum Format {
-                       FORMAT_12H,
-                       FORMAT_24H
-               };
-               class CLOCK_EXPORT_API Time : public utils::ISerializable {
-                       public:
-                               unsigned int Hour, Min, Sec;
-                               Time() : Hour(0), Min(0), Sec(0) {}
-                               Time(unsigned int h, unsigned int m, unsigned int s) : Hour(h), Min(m), Sec(s) {}
-                               Time(utils::IReader &);
-                               void Serialize(utils::IWriter &w) const;
-                               inline bool operator==(const Time &a) { return (a.Hour == Hour ) &&
-                                       (a.Min == Min) && (a.Sec == Sec); }
-                               std::string Format(enum Format format) const;
-                               std::string Meridiem() const;
-                               std::string getFormattedTime(const char *icu_format) const;
-               };
-       } /* utils */
-} /* common */
+namespace utils {
+       enum Format {
+               FORMAT_12H,
+               FORMAT_24H
+       };
+       class CLOCK_EXPORT_API Time : public utils::ISerializable {
+               public:
+                       unsigned int Hour, Min, Sec;
+                       Time() : Hour(0), Min(0), Sec(0) {}
+                       Time(unsigned int h, unsigned int m, unsigned int s) : Hour(h), Min(m), Sec(s) {}
+                       Time(utils::IReader &);
+                       void Serialize(utils::IWriter &w) const;
+                       inline bool operator==(const Time &a) { return (a.Hour == Hour ) &&
+                               (a.Min == Min) && (a.Sec == Sec); }
+                       std::string Format(enum Format format) const;
+                       std::string Meridiem() const;
+                       std::string getFormattedTime(const char *icu_format) const;
+       };
+} /* utils */
 
 #endif
index 8b9fb7e..288d832 100644 (file)
 #define _CLOCK_UTILS_H_
 
 
-namespace common {
-       namespace utils {
-
-               class Utils {
-               public:
-                       /*
-                        * @brief Application sub-directories type.
-                        */
-                       enum AppSubdirectory {
-                               APP_DIR_DATA,
-                               APP_DIR_CACHE,
-                               APP_DIR_RESOURCE,
-                               APP_DIR_SHARED_DATA,
-                               APP_DIR_SHARED_RESOURCE,
-                               APP_DIR_SHARED_TRUSTED,
-                               APP_DIR_EXTERNAL_DATA,
-                               APP_DIR_EXTERNAL_CACHE,
-                               APP_DIR_EXTERNAL_SHARED_DATA,
-                       };
-
-                       /**
-                        * @brief Returns absolute path to resource file located in applications directory.
-                        *
-                        * @param dir type of subdirectory
-                        * @param relative path of resource from starting from given sub dir.
-                        *        eg. for APP_DATA_DIR subdir and relative "database.db" => "/home/owner/apps/org.tizen.clock/data/database.db"
-                        * @return absolute path string.
-                        *
-                        * @note returns statically allocated string
-                        */
-                       static const char *GetAppResourcePath(enum AppSubdirectory dir, const char *relative);
+namespace utils {
+       class Utils {
+       public:
+               /*
+                * @brief Application sub-directories type.
+                */
+               enum AppSubdirectory {
+                       APP_DIR_DATA,
+                       APP_DIR_CACHE,
+                       APP_DIR_RESOURCE,
+                       APP_DIR_SHARED_DATA,
+                       APP_DIR_SHARED_RESOURCE,
+                       APP_DIR_SHARED_TRUSTED,
+                       APP_DIR_EXTERNAL_DATA,
+                       APP_DIR_EXTERNAL_CACHE,
+                       APP_DIR_EXTERNAL_SHARED_DATA,
                };
-       }
-}
 
+               /**
+                * @brief Returns absolute path to resource file located in applications directory.
+                *
+                * @param dir type of subdirectory
+                * @param relative path of resource from starting from given sub dir.
+                *        eg. for APP_DATA_DIR subdir and relative "database.db" => "/home/owner/apps/org.tizen.clock/data/database.db"
+                * @return absolute path string.
+                *
+                * @note returns statically allocated string
+                */
+               static const char *GetAppResourcePath(enum AppSubdirectory dir, const char *relative);
+       };
+}
 
 #endif /* _CLOCK_UTILS_H_ */
index da38d02..cce995e 100644 (file)
 
 #include <cstdlib>
 
-namespace common {
-       namespace utils {
-               class IWriter {
-                       public:
-                               virtual void Write(const void *buffer, size_t size) = 0;
-                               virtual ~IWriter() {}
-               };
-       } /* utils */
-} /* common */
+namespace utils {
+       class IWriter {
+               public:
+                       virtual void Write(const void *buffer, size_t size) = 0;
+                       virtual ~IWriter() {}
+       };
+} /* utils */
+
 #endif
index b9c3966..cda88ba 100644 (file)
 
 #include <functional>
 
-namespace worldclock {
-       namespace view {
-               class AlarmView : public common::ui::IView {
-                       public:
-                               typedef std::function<void(int)> SelectCallback;
-                               typedef std::function<void(int)> ToggleCallback;
-                               typedef std::function<void(void)> ButtonClickedCallback;
-
-                               AlarmView();
-                               void Clear();
-                               int ItemAppend(common::utils::Time time, const char *name,
-                                               const  common::model::WeekFlags flags, bool active);
-                               void RemoveItem(int idx);
-                               void ItemUpdate(int idx, common::utils::Time time, const char *name,
-                                               const common::model::WeekFlags flags, bool active);
-                               void ItemEnable(int idx);
-                               void ItemDisable(int idx);
-
-                               void SetItemToggleCallback(ToggleCallback func);
-                               void SetItemSelectCallback(SelectCallback func);;
-                               void SetButtonClickedCallback(ButtonClickedCallback func);
-                               Evas_Object *GetEvasObject();
-                       private:
-                               static Elm_Genlist_Item_Class alarm_itc;
-                               static Evas_Object *ContentGet(void *data, Evas_Object *obj, const char *part);
-                               static char *TextGet(void *data, Evas_Object *obj, const char *part);
-                               static void ItemClicked(void *data, Evas_Object *obj, void *info);
-                               static void ItemRealized(void *data, Evas_Object *obj, void *info);
-                               Evas_Object *genlist;
-                               SelectCallback onSelected;
-                               ToggleCallback onToggled;
-                               ButtonClickedCallback onClicked;;
-               };
-       }
+namespace view {
+       class AlarmView : public ui::IView {
+               public:
+                       typedef std::function<void(int)> SelectCallback;
+                       typedef std::function<void(int)> ToggleCallback;
+                       typedef std::function<void(void)> ButtonClickedCallback;
+
+                       AlarmView();
+                       void Clear();
+                       int ItemAppend(utils::Time time, const char *name,
+                                       const  model::WeekFlags flags, bool active);
+                       void RemoveItem(int idx);
+                       void ItemUpdate(int idx, utils::Time time, const char *name,
+                                       const model::WeekFlags flags, bool active);
+                       void ItemEnable(int idx);
+                       void ItemDisable(int idx);
+
+                       void SetItemToggleCallback(ToggleCallback func);
+                       void SetItemSelectCallback(SelectCallback func);;
+                       void SetButtonClickedCallback(ButtonClickedCallback func);
+                       Evas_Object *GetEvasObject();
+               private:
+                       static Elm_Genlist_Item_Class alarm_itc;
+                       static Evas_Object *ContentGet(void *data, Evas_Object *obj, const char *part);
+                       static char *TextGet(void *data, Evas_Object *obj, const char *part);
+                       static void ItemClicked(void *data, Evas_Object *obj, void *info);
+                       static void ItemRealized(void *data, Evas_Object *obj, void *info);
+                       Evas_Object *genlist;
+                       SelectCallback onSelected;
+                       ToggleCallback onToggled;
+                       ButtonClickedCallback onClicked;;
+       };
 }
 
-
 #endif /* ALARMVIEW_H_ */
index 5177089..bce1df6 100644 (file)
  * @{
  */
 
-namespace worldclock {
-       namespace view {
-
-               /**
-                * @brief Application main view class
-                * @remarks This is singleton class.
-                */
-               class MainView : public common::ui::IView {
-                       public:
-
-                               /**
-                                * @brief Retrieves singleton instance.
-                                */
-                               static MainView &GetInstance();
-
-                               /**
-                                * @brief Destructor
-                                */
-                               ~MainView();
-
-                               /**
-                                * @brief Creates content of application
-                                * @remarks It not creates base GUI
-                                */
-                               void CreateContent();
-
-                               /**
-                                * @brief Retrieves naviframe object.
-                                */
-                               Evas_Object *GetEvasObject();
-
-                               /**
-                                * @briefs Copies this class object instance.
-                                * @remarks Customized for singleton purpose - make no effect.
-                                */
-                               MainView(MainView const&) = delete;
-                               /**
-                                * @briefs Overloads equation mark.
-                                * @remarks Customized for singleton purpose - make no effect.
-                                */
-                               void operator=(MainView const&) = delete;
-                       private:
-
-                               /**
-                                * @brief Constructs MainView class object
-                                * @remarks Creates base GUI
-                                */
-                               MainView();
-
-                               /**
-                                * Adds conformant to window.
-                                */
-                               void ConformantAdd();
-
-                               /**
-                                * @brief Adds naviframe to conformant
-                                * @remarks it also fills indicator_bg part in conformant
-                                */
-                               void NaviframeAdd();
-
-                               /**
-                                * @brief Creates content for Alarm, World Clock, Stopwatch and Timer pages
-                                */
-                               void CreatePages();
-
-                               /**
-                                * @brief Creates toolbar buttons.
-                                */
-                               void CreateToolbarButtons();
-
-                               /**
-                                * @brief Creates toolbar.
-                                */
-                               void CreateToolbar();
-
-                               Evas_Object *window_;
-                               Evas_Object *conformant_;
-                               Evas_Object *naviframe_;
-
-                               /* Content */
-                               Evas_Object *toolbar_;
-
-                               IView *alarm_;
-                               IView *world_clock_;
-                               IView *stop_watch_;
-                               IView *timer_;
-               };
-       }
+namespace view {
+
+       /**
+        * @brief Application main view class
+        * @remarks This is singleton class.
+        */
+       class MainView : public ui::IView {
+               public:
+
+                       /**
+                        * @brief Retrieves singleton instance.
+                        */
+                       static MainView &GetInstance();
+
+                       /**
+                        * @brief Destructor
+                        */
+                       ~MainView();
+
+                       /**
+                        * @brief Creates content of application
+                        * @remarks It not creates base GUI
+                        */
+                       void CreateContent();
+
+                       /**
+                        * @brief Retrieves naviframe object.
+                        */
+                       Evas_Object *GetEvasObject();
+
+                       /**
+                        * @briefs Copies this class object instance.
+                        * @remarks Customized for singleton purpose - make no effect.
+                        */
+                       MainView(MainView const&) = delete;
+                       /**
+                        * @briefs Overloads equation mark.
+                        * @remarks Customized for singleton purpose - make no effect.
+                        */
+                       void operator=(MainView const&) = delete;
+               private:
+
+                       /**
+                        * @brief Constructs MainView class object
+                        * @remarks Creates base GUI
+                        */
+                       MainView();
+
+                       /**
+                        * Adds conformant to window.
+                        */
+                       void ConformantAdd();
+
+                       /**
+                        * @brief Adds naviframe to conformant
+                        * @remarks it also fills indicator_bg part in conformant
+                        */
+                       void NaviframeAdd();
+
+                       /**
+                        * @brief Creates content for Alarm, World Clock, Stopwatch and Timer pages
+                        */
+                       void CreatePages();
+
+                       /**
+                        * @brief Creates toolbar buttons.
+                        */
+                       void CreateToolbarButtons();
+
+                       /**
+                        * @brief Creates toolbar.
+                        */
+                       void CreateToolbar();
+
+                       Evas_Object *window_;
+                       Evas_Object *conformant_;
+                       Evas_Object *naviframe_;
+
+                       /* Content */
+                       Evas_Object *toolbar_;
+
+                       IView *alarm_;
+                       IView *world_clock_;
+                       IView *stop_watch_;
+                       IView *timer_;
+       };
 }
 
 /**
index fae0215..f28f62b 100644 (file)
  * @{
  */
 
-namespace worldclock {
-       namespace view {
-
-               /*
-                * @brief Base class for pages(Alarm, World Clock, StopWatch and Timer)
-                */
-               class PageView : public common::ui::IView {
-                       public:
-
-                               /**
-                                * @brief Constructs class object.
-                                */
-                               PageView(const char *title_label, Evas_Object *left_button, Evas_Object *right_button, Evas_Object *content);
-                               /**
-                                * @brief Cleans all resources needed to be cleaned up.
-                                */
-                               ~PageView();
-
-                               /**
-                                * @brief Gets object of the page.
-                                */
-                               virtual Evas_Object *GetEvasObject();
-
-                               /**
-                                * @brief Creates page content.
-                                */
-                               virtual void CreateContent(){};
-
-                               /**
-                                * @brief Requests data refresh.
-                                */
-                               virtual void RefreshContent(){};
-
-                               /**
-                                * @brief Creates new naviframe item page.
-                                * @remarks Used to create "Add ..." pages in Alarm or World Clock
-                                */
-                               virtual void CreateNewNaviPage(){};
-
-                       protected:
-
-                               /**
-                                * Requestes and retrives new naviframe item pushed to naviframe.
-                                */
-                               void PushNewNaviPage();
-
-                               Elm_Object_Item *subpage_;
-                               const char *title_label_;
-                               Evas_Object *left_button_;
-                               Evas_Object *right_button_;
-                               Evas_Object *content_;
-               };
+namespace view {
+
+       /*
+        * @brief Base class for pages(Alarm, World Clock, StopWatch and Timer)
+        */
+       class PageView : public ui::IView {
+               public:
+
+                       /**
+                        * @brief Constructs class object.
+                        */
+                       PageView(const char *title_label, Evas_Object *left_button, Evas_Object *right_button, Evas_Object *content);
+                       /**
+                        * @brief Cleans all resources needed to be cleaned up.
+                        */
+                       ~PageView();
+
+                       /**
+                        * @brief Gets object of the page.
+                        */
+                       virtual Evas_Object *GetEvasObject();
+
+                       /**
+                        * @brief Creates page content.
+                        */
+                       virtual void CreateContent(){};
+
+                       /**
+                        * @brief Requests data refresh.
+                        */
+                       virtual void RefreshContent(){};
+
+                       /**
+                        * @brief Creates new naviframe item page.
+                        * @remarks Used to create "Add ..." pages in Alarm or World Clock
+                        */
+                       virtual void CreateNewNaviPage(){};
+
+               protected:
+
+                       /**
+                        * Requestes and retrives new naviframe item pushed to naviframe.
+                        */
+                       void PushNewNaviPage();
+
+                       Elm_Object_Item *subpage_;
+                       const char *title_label_;
+                       Evas_Object *left_button_;
+                       Evas_Object *right_button_;
+                       Evas_Object *content_;
        };
 };
 
index 4bd1fad..ce5ef82 100644 (file)
 #include "View/PageView.h"
 #include "UI/View.h"
 
-namespace worldclock {
-       namespace view {
+namespace view {
 
-               class StopWatchView : public common::ui::IView {
-                       public:
-                       StopWatchView();
-                       Evas_Object *GetEvasObject(){return stopwatch_;};
+       class StopWatchView : public ui::IView {
+               public:
+               StopWatchView();
+               Evas_Object *GetEvasObject(){return stopwatch_;};
 
-               private:
-                       Evas_Object *stopwatch_;
-               };
-       }
+       private:
+               Evas_Object *stopwatch_;
+       };
 }
 
-
 #endif /* STOPWATCHVIEW_H_ */
index a32a5fa..8c10bec 100644 (file)
 #include "View/PageView.h"
 #include "UI/View.h"
 
-namespace worldclock {
-       namespace view {
-               class TimerView : public common::ui::IView {
-                       public:
-                               TimerView();
-                               Evas_Object *GetEvasObject(){return timer_;};
+namespace view {
+       class TimerView : public ui::IView {
+               public:
+                       TimerView();
+                       Evas_Object *GetEvasObject(){return timer_;};
 
-                       private:
-                               Evas_Object *timer_;
-               };
-       }
+               private:
+                       Evas_Object *timer_;
+       };
 }
 
-
 #endif /* TIMERVIEW_H_ */
index 183bcad..7910786 100644 (file)
 #include "View/PageView.h"
 #include "UI/View.h"
 
-namespace worldclock {
-       namespace view {
-               class WorldClockView : public common::ui::IView {
-                       public:
-                       WorldClockView();
-                       Evas_Object *GetEvasObject(){return world_clock_;};
+namespace view {
+       class WorldClockView : public ui::IView {
+               public:
+               WorldClockView();
+               Evas_Object *GetEvasObject(){return world_clock_;};
 
-               private:
-                       Evas_Object *world_clock_;
-               };
-       }
+       private:
+               Evas_Object *world_clock_;
+       };
 }
 
-
 #endif /* WORLDCLOCKVIEW_H_ */
index 7914a85..0efebdc 100644 (file)
@@ -21,7 +21,7 @@
 #include "Clock.h"
 #include "Controller/MainController.h"
 
-using namespace worldclock::controller;
+using namespace controller;
 
 
 static bool
index cc6e806..9cdc6f3 100644 (file)
@@ -18,8 +18,8 @@
 #include "View/MainView.h"
 #include "Controller/MainController.h"
 
-using namespace worldclock::controller;
-using namespace worldclock::view;
+using namespace controller;
+using namespace view;
 
 MainController &MainController::GetInstance()
 {
index f00210c..eae1826 100644 (file)
@@ -2,8 +2,8 @@
 #include "Model/Alarm.h"
 #include "Common/Defines.h"
 
-using namespace common::model;
-using namespace common::utils;
+using namespace model;
+using namespace utils;
 
 static app_control_h AppControlCreate()
 {
@@ -204,12 +204,12 @@ bool Alarm::IsActivated() const
        return activated;
 }
 
-void common::model::Serialize(IWriter &w, AlarmType type)
+void model::Serialize(IWriter &w, AlarmType type)
 {
-       common::utils::Serialize(w, static_cast<int>(type));
+       utils::Serialize(w, static_cast<int>(type));
 }
 
-void common::model::Deserialize(IReader &r, AlarmType &type)
+void model::Deserialize(IReader &r, AlarmType &type)
 {
        int tmp;
        utils::Deserialize(r, tmp);
@@ -226,7 +226,7 @@ Alarm::Alarm(IReader &r)
        utils::Deserialize(r, name);
        utils::Deserialize(r, sound.melody);
        utils::Deserialize(r, sound.volume);
-       common::model::Deserialize(r, type_);
+       model::Deserialize(r, type_);
        utils::Deserialize(r, flags);
        utils::Deserialize(r, activated);
        utils::Deserialize(r, snooze_enabled);
@@ -243,7 +243,7 @@ void Alarm::Serialize(utils::IWriter &w) const
        utils::Serialize(w, name);
        utils::Serialize(w, sound.melody);
        utils::Serialize(w, sound.volume);
-       common::model::Serialize(w, type_);
+       model::Serialize(w, type_);
        utils::Serialize(w, flags);
        utils::Serialize(w, activated);
        utils::Serialize(w, snooze_enabled);
index da0409b..035a292 100644 (file)
@@ -7,9 +7,9 @@
 
 static const char DATABASE_FILE[] = "alarmsdb.cfg";
 
-using namespace common::model;
-using namespace common::utils;
-using namespace internal::model;
+using namespace model;
+using namespace utils;
+using namespace internal;
 
 AlarmProvider *AlarmProvider::GetInstance()
 {
index 9a3f114..7703762 100644 (file)
@@ -4,14 +4,14 @@
 #include <cstdlib>
 #include <algorithm>
 
-using namespace internal::model;
-using namespace common::model;
-using namespace common::utils;
+using namespace internal;
+using namespace model;
+using namespace utils;
 
 const int AlarmProviderFile::db_schema_version = 1;
 
 
-void AlarmProviderFile::Add(common::model::Alarm& alarm)
+void AlarmProviderFile::Add(model::Alarm& alarm)
 {
        auto it = std::find(alarms.begin(), alarms.end(), alarm);
 
@@ -22,7 +22,7 @@ void AlarmProviderFile::Add(common::model::Alarm& alarm)
        //FIXME emit AlarmAddedEvent
 }
 
-void AlarmProviderFile::Remove(common::model::Alarm& alarm)
+void AlarmProviderFile::Remove(model::Alarm& alarm)
 {
        auto it = std::find(alarms.begin(), alarms.end(), alarm);
 
@@ -35,16 +35,16 @@ void AlarmProviderFile::Remove(common::model::Alarm& alarm)
 
 AlarmProviderFile::AlarmProviderFile(IReader &r)
 {
-       common::utils::Deserialize(r, alarms);
+       utils::Deserialize(r, alarms);
 }
 
 AlarmProviderFile::~AlarmProviderFile()
 {
 }
 
-std::vector<std::reference_wrapper<common::model::Alarm>> AlarmProviderFile::GetAlarms()
+std::vector<std::reference_wrapper<model::Alarm>> AlarmProviderFile::GetAlarms()
 {
-       return std::vector<std::reference_wrapper<common::model::Alarm>>(
+       return std::vector<std::reference_wrapper<model::Alarm>>(
                        alarms.begin(),
                        alarms.end());
 }
@@ -54,7 +54,7 @@ Alarm* AlarmProviderFile::GetAlarmWithId(AlarmId id)
        return nullptr;
 }
 
-void AlarmProviderFile::Serialize(common::utils::IWriter &w) const
+void AlarmProviderFile::Serialize(utils::IWriter &w) const
 {
-       common::utils::Serialize(w, alarms);
+       utils::Serialize(w, alarms);
 }
index 105cd75..14edc35 100644 (file)
@@ -4,9 +4,9 @@
 
 #include <algorithm>
 
-using namespace internal::model;
-using namespace common::model;
-using namespace common::utils;
+using namespace internal;
+using namespace model;
+using namespace utils;
 
 AlarmProviderStub::AlarmProviderStub(IReader &r)
 {
index eb24013..4fa395b 100644 (file)
@@ -1,6 +1,6 @@
 #include <Model/WeekFlags.h>
 
-using namespace common::model;
+using namespace model;
 
 WeekFlags::WeekFlags() {
        raw_flags = 0;
index 0bbbce9..4e58821 100644 (file)
@@ -1,9 +1,9 @@
 #include "Presenter/AlarmPresenter.h"
 #include "log.h"
 
-using namespace worldclock::presenters;
-using namespace worldclock::view;
-using namespace common::model;
+using namespace presenter;
+using namespace view;
+using namespace model;
 
 AlarmPresenter::AlarmPresenter(AlarmView *v, AlarmProvider *m) : model(m), view(v)
 {
index 4d53a90..26793c0 100644 (file)
@@ -4,7 +4,7 @@
 #include <cstdlib>
 #include <cstring>
 
-using namespace common::utils;
+using namespace utils;
 using namespace std;
 
 BinaryFileReader::BinaryFileReader(Utils::AppSubdirectory dir, const char *filename)
index c31eb95..3f66ac7 100644 (file)
@@ -2,7 +2,7 @@
 
 #include <fstream>
 
-using namespace common::utils;
+using namespace utils;
 using namespace std;
 
 BinaryFileWriter::BinaryFileWriter(Utils::AppSubdirectory dir, const char *filename) :
index 55c6cbf..90e3682 100644 (file)
@@ -1,7 +1,7 @@
 #include "Utils/Time.h"
 #include <utils_i18n.h>
 
-using namespace common::utils;
+using namespace utils;
 
 Time::Time(utils::IReader &r)
 {
index 1b92772..2f72b42 100644 (file)
@@ -23,7 +23,7 @@
 #include <Elementary.h>
 #include <limits.h>
 
-using namespace common::utils;
+using namespace utils;
 
 const char *Utils::GetAppResourcePath(enum AppSubdirectory dir, const char *relative)
 {
index 6ff2d2b..cf84ea6 100644 (file)
@@ -23,9 +23,9 @@
 
 #include "log.h"
 
-using namespace worldclock::view;
-using namespace common::model;
-using namespace common::utils;
+using namespace view;
+using namespace model;
+using namespace utils;
 
 struct ItemData {
        AlarmView *instance;
index 19614ec..a839125 100644 (file)
 #include "Presenter/AlarmPresenter.h"
 #include "Model/AlarmProvider.h"
 
-using namespace worldclock::view;
-using namespace worldclock::presenters;
-using namespace common::utils;
-using namespace common::model;
+using namespace view;
+using namespace presenter;
+using namespace utils;
+using namespace model;
 
 
 static void WinDeleteRequestCb(void *data, Evas_Object *obj, void *event_info)
index 4daef8f..1b6e9dc 100644 (file)
@@ -24,8 +24,8 @@
 
 #include <stdlib.h>
 
-using namespace worldclock::view;
-using namespace common::utils;
+using namespace view;
+using namespace utils;
 
 PageView::PageView(const char *title_label, Evas_Object *left_button, Evas_Object *right_button, Evas_Object *content) :
                title_label_(title_label), left_button_(left_button), right_button_(right_button), content_(content)
index 9b7bcc5..e9935b9 100644 (file)
@@ -18,8 +18,8 @@
 #include "View/MainView.h"
 #include "Utils/Utils.h"
 
-using namespace worldclock::view;
-using namespace common::utils;
+using namespace view;
+using namespace utils;
 
 StopWatchView::StopWatchView()
 {
index c375861..ebe506c 100644 (file)
@@ -18,8 +18,8 @@
 #include "View/MainView.h"
 #include "Utils/Utils.h"
 
-using namespace worldclock::view;
-using namespace common::utils;
+using namespace view;
+using namespace utils;
 
 
 TimerView::TimerView()
index a26068e..2efe90b 100644 (file)
@@ -18,8 +18,8 @@
 #include "View/MainView.h"
 #include "Utils/Utils.h"
 
-using namespace worldclock::view;
-using namespace common::utils;
+using namespace view;
+using namespace utils;
 
 WorldClockView::WorldClockView()
 {