enhance documentation 98/105398/9
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Fri, 16 Dec 2016 09:05:09 +0000 (10:05 +0100)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Thu, 5 Jan 2017 13:47:47 +0000 (05:47 -0800)
apply minor refactor:
* change type of parent for PageView
Change-Id: I006dccff30d667b3562633a8f75ff832768be206

38 files changed:
Doxyfile
clock/inc/Internal/AlarmBinaryStorage.h
clock/inc/Model/Alarm.h
clock/inc/Model/AlarmEvent.h
clock/inc/Model/AlarmProvider.h
clock/inc/Model/AlarmProviderEvent.h
clock/inc/Model/WeekFlags.h
clock/inc/Presenter/AlarmPresenter.h
clock/inc/Presenter/DeleteAlarmPresenter.h
clock/inc/Presenter/EditAlarmPresenter.h
clock/inc/Utils/BinaryFileReader.h
clock/inc/Utils/BinaryFileWriter.h
clock/inc/Utils/EventBus.h
clock/inc/Utils/Reader.h
clock/inc/Utils/RingtonePicker.h
clock/inc/Utils/Serialization.h
clock/inc/Utils/Time.h
clock/inc/Utils/Writer.h
clock/inc/View/AlarmView.h
clock/inc/View/DeleteAlarmView.h
clock/inc/View/EditAlarmView.h
clock/inc/View/MainView.h
clock/inc/View/PageView.h
clock/inc/View/View.h
clock/inc/View/WeekFlagsView.h
clock/inc/View/WorldClockDeleteItemsView.h
clock/inc/View/WorldClockReorderView.h
clock/src/Model/Alarm.cpp
clock/src/Model/AlarmBinaryStorage.cpp
clock/src/Presenter/EditAlarmPresenter.cpp
clock/src/Utils/Time.cpp
clock/src/View/AlarmView.cpp
clock/src/View/DeleteAlarmView.cpp
clock/src/View/EditAlarmView.cpp
clock/src/View/PageView.cpp
clock/src/View/WeekFlagsView.cpp
clock/src/View/WorldClockDeleteItemsView.cpp
clock/src/View/WorldClockReorderView.cpp

index c0e6127..5ae708c 100644 (file)
--- a/Doxyfile
+++ b/Doxyfile
@@ -743,7 +743,7 @@ WARN_LOGFILE           =
 # spaces.
 # Note: If this tag is empty the current directory is searched.
 
-INPUT                  = clock/inc/Utils clock/inc/Model clock/inc/View clock/inc/Controller clock/inc/Presenter clock/inc/Common clock/src/Utils clock/src/Model clock/src/View clock/src/Controller clock/src/Presenter clock/src/Common
+INPUT                  = clock/inc/Utils clock/inc/Model clock/inc/View clock/inc/Controller clock/inc/Presenter clock/inc/Common clock/inc/Internal clock/src/Utils clock/src/Model clock/src/View clock/src/Controller clock/src/Presenter clock/src/Common
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
index e1b515b..d672c96 100644 (file)
 #include "Utils/Serialization.h"
 
 namespace internal {
+       /**
+        * @brief Binary storage for Alarm list
+        */
        class AlarmBinaryStorage : utils::ISerializable
        {
                public:
+                       /**
+                        * @brief Fetch alarms from database
+                        */
                        std::vector<std::reference_wrapper<model::Alarm>> GetAlarms();
+
+                       /**
+                        * @brief Fetch alarms with id from database
+                        * @param[in] id id of the alarm.
+                        */
                        model::Alarm* GetAlarmWithId(model::AlarmId id);
+
+                       /**
+                        * @brief Add alarm to database
+                        * @param[in] alarm reference.
+                        */
                        void Add(model::Alarm& alarm);
+
+                       /**
+                        * @brief Remove alarm from database
+                        * @param[in] alarm reference obtained from GetAlarms()
+                        */
                        void Remove(std::reference_wrapper<model::Alarm> alarm);
+
+                       /**
+                        * @brief Constructor
+                        * @param[in] r reader interface.
+                        */
                        AlarmBinaryStorage(utils::IReader &r);
+
+                       /**
+                        * @brief Default destructor
+                        */
                        virtual ~AlarmBinaryStorage();
+
                        void Serialize(utils::IWriter &w) const;
+
+                       /**
+                        * @brief Return capactiy of database.
+                        * @return max number of elements possible to append to database.
+                        */
                        int Capacity() const;
+
+                       /**
+                        * @brief Return if database capacity is reached.
+                        * @return true if strage capacity is reached, false otherwise.
+                        */
                        bool IsFull() const;
-                       bool HasActiveAlarms();
                private:
                        std::list<model::Alarm> alarms;
-                       static const int db_schema_version;
        };
 } /* internal */
 
index dabb681..d0900f4 100644 (file)
 
 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);
+       /**
+        * @brief Alarm is a wrapper class arount platform's alarm system.
+        * It implements scheduling, rescheduling, canceling alarms and also
+        * managing snoozing feature.
+        */
        class Alarm : public utils::ISerializable {
                public:
+                       /**
+                        * @brief Alarm type
+                        */
+                       enum class Type {
+                               SOUND_ONLY, /** Sound only on trigger */
+                               VIBRATION, /** Vibration only on trigger */
+                               VIBRATION_AND_SOUND /** Vibration and sound on trigger */
+                       };
+                       /**
+                        * @brief Defaul constructor
+                        */
                        Alarm();
-                       Alarm(utils::IReader &);
+
+                       /**
+                        * @brief Constructs Alarm instance from reader's data.
+                        * @param[in] r reader inteface.
+                        */
+                       Alarm(utils::IReader &r);
+
+                       /**
+                        * @brief Activates alarm
+                        * @details Activates means that alarm is scheduled.
+                        */
                        void Activate();
+
+                       /**
+                        * @brief Check activation status
+                        * @return activated status.
+                        */
                        bool IsActivated() const;
+
+                       /**
+                        * @brief Deactivates alarm
+                        * @details Removes alarm from scheduled alarms.
+                        */
                        void Deactivate();
+
+                       /**
+                        * @brief Snooze alarm
+                        *
+                        * @details This function schedules additional alarm that will be called
+                        * after GetSnoozeInterval seconds.
+                        *
+                        * If IsSnoozeEnabled returns false, this function do nothing.
+                        * Function increases also also internal snooze attempt counter.
+                        * If snooze attempt counter exceeds GetSnoozeMaxAttempts this function
+                        * do nothing.
+                        */
                        void Snooze();
+
+                       /**
+                        * @brief Enable snoozing feature on alarm
+                        */
                        void EnableSnooze();
+
+                       /**
+                        * @brief Disable snoozing feature on alarm
+                        */
                        void DisableSnooze();
+
+                       /**
+                        * @brief Check if snoozing feature is enabled
+                        * @return true if snooze is enabled for alarm, false otherwise.
+                        */
                        bool IsSnoozeEnabled() const;
+
+                       /**
+                        * @brief Check if snoozing is possible.
+                        *
+                        * @details This means that IsSnoozeEnabled must return true
+                        * and snooze attempts hasn't been exceeded.
+                        *
+                        * @return true if 'Snooze' can be invoked on alarm, false otherwise.
+                        */
                        bool CanSnooze() const;
+
+                       /**
+                        * @brief Sets time interval between snooze alarms
+                        * @param[in] seconds number of seconds for Snooze to be scheduled.
+                        */
                        void SetSnoozeInterval(unsigned int seconds);
+
+                       /**
+                        * @brief Gets time interval between snooze alarms
+                        * @return number of seconds till snooze alarm fires.
+                        */
                        unsigned int GetSnoozeInterval() const;
-                       void SetSnoozeMaxAttemps(unsigned int attemps);
+
+                       /**
+                        * @brief Sets snooze max attempts.
+                        * @param[in] attempts number of possible attempts of Snooze.
+                        */
+                       void SetSnoozeMaxAttemps(unsigned int attempts);
+
+                       /**
+                        * @brief Get snooze max attempts.
+                        * @return maximum possible attempts of 'Snooze' for alarm.
+                        */
                        unsigned int GetSnoozeMaxAttempts() const;
+
+                       /**
+                        * @brief Get alarm human-readable name.
+                        * @return alarm's current name.
+                        */
                        std::string GetName() const;
+
+                       /**
+                        * @brief Set alarm human-readable name.
+                        * @param[in] name new alarm name.
+                        */
                        void SetName(std::string name);
+
+                       /**
+                        * @brief Get alarm schedule time.
+                        * @return time
+                        */
                        utils::Time GetTime() const;
+
+                       /**
+                        * @brief Set alarm schedule time.
+                        * @param time alarm's time.
+                        */
                        void SetTime(utils::Time time);
+
+                       /**
+                        * @brief Get melody file filepath.
+                        * @return melody file path.
+                        */
                        std::string GetMelody() const;
+
+                       /**
+                        * @brief Set melody file filepath.
+                        * @param[in] path file path.
+                        */
                        void SetMelody(std::string path);
-                       AlarmType GetType() const;
-                       void SetType(AlarmType pattern);
+
+                       /**
+                        * @brief Get type of alarm.
+                        * @return alarm type.
+                        */
+                       Type GetType() const;
+
+                       /**
+                        * @brief Set type of alarm.
+                        * @param[in] type new alarm type
+                        */
+                       void SetType(Type type);
+
+                       /**
+                        * @brief Get week flags of alarm.
+                        *
+                        * @details The alarms can be scheduled on given time returned by GetTime
+                        * for particular days of the week.
+                        *
+                        * @return current week flags of the alarm.
+                        *
+                        * @see GetTime()
+                        */
                        WeekFlags GetWeekFlags() const;
+
+                       /**
+                        * @brief Set week flags of alarm.
+                        * @param[in] flags new week flags for alarm.
+                        */
                        void SetWeekFlags(WeekFlags flags);
+
+                       /**
+                        * @brief Serialize Alarm using writer interface
+                        * @param[in] w writer interface.
+                        */
                        void Serialize(utils::IWriter &w) const;
+
+                       /**
+                        * @brief Gets volume value, between 0.0 - 1.0
+                        * @return volume value.
+                        */
                        double GetVolume() const;
+
+                       /**
+                        * @brief Set volume value, between 0.0 - 1.0
+                        *
+                        * @remarks If value exceed 0.0 - 1.0 bounds it will adjusted
+                        * to nearest bound.
+                        *
+                        * @param[in] volume new volume value.
+                        */
                        void SetVolume(double volume);
+
+                       /**
+                        * @brief Dismiss alarm
+                        *
+                        * @details This means that alarm snooze attempts counter has been reseted.
+                        */
                        void Dismiss();
 
-               /** 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) || (this->snooze.alarm_id == id); }
-       private:
-               int alarm_id;
-               std::string name;
-               struct {
-                       std::string melody;
-                       double volume;
-               } sound;
-               std::string vibration;
-               WeekFlags flags;
-               bool activated;
-               bool snooze_enabled;
-               AlarmType type_;
-               struct {
+                       /** 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); }
+                       /** Two alarms are considered same if they have same AlarmId */
+                       inline bool operator==(const AlarmId id) { return (this->alarm_id == id) || (this->snooze.alarm_id == id); }
+               private:
                        int alarm_id;
-                       unsigned int interval;
-                       unsigned int attempt;
-                       unsigned int attempts_max;
-               } snooze;
-               utils::Time time;
+                       std::string name;
+                       struct {
+                               std::string melody;
+                               double volume;
+                       } sound;
+                       std::string vibration;
+                       WeekFlags flags;
+                       bool activated;
+                       bool snooze_enabled;
+                       Type type_;
+                       struct {
+                               int alarm_id;
+                               unsigned int interval;
+                               unsigned int attempt;
+                               unsigned int attempts_max;
+                       } snooze;
+                       utils::Time time;
        };
+       void Deserialize(utils::IReader &w, Alarm::Type &type);
+       void Serialize(utils::IWriter &w, Alarm::Type type);
 } /* model */
 
 #endif
index 4b205e3..4a74079 100644 (file)
 #include "Model/Alarm.h"
 
 namespace model {
+       /**
+        * @brief Global event that is broadcast request to create new
+        * alarm.
+        */
        class AlarmCreateRequestEvent : public utils::Event {
        };
+
+       /**
+        * @brief Global event that is broadcast request to delete alarms.
+        */
        class AlarmDeleteRequestEvent : public utils::Event {
        };
+
+       /**
+        * @brief Global event that is broadcast information that alarm
+        * data should be modified.
+        */
        class AlarmEditRequestEvent : public utils::Event {
                public:
+                       /**
+                        * @brief Creates AlarmEditRequestEvent instance
+                        * @param[in] alarm alarm which is a target of edition.
+                        */
                        AlarmEditRequestEvent(model::Alarm& alarm) : alarm_(alarm) {}
+                       /**
+                        * @brief Gets modification target
+                        * @return Alarm to be edited.
+                        */
                        Alarm &GetAlarm() const { return alarm_;}
                private:
                        Alarm &alarm_;
        };
+
+       /**
+        * @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_;
index e79a87a..af4346f 100644 (file)
@@ -24,6 +24,9 @@
 #include <functional>
 
 namespace model {
+       /**
+        * @brief Class providing list of currently registered alarms.
+        */
        class AlarmProvider {
                public:
                        /**
@@ -38,31 +41,37 @@ namespace model {
 
                        /**
                         * @brief Fetch alarms from provider's internal storage
+                        * @return vector of alarm references.
                         */
                        std::vector<std::reference_wrapper<Alarm>> GetAlarms();
 
                        /**
                         * @brief Get Alarms with specific id.
+                        * @param[in] id alarm id.
                         */
                        Alarm *GetAlarmWithId(AlarmId id);
 
                        /**
                         * @brief Add alarm to provider database.
+                        * @param[in] alarm alarm's reference.
                         */
                        void Add(Alarm& alarm);
 
                        /**
                         * @brief Remove alarm from provider's database.
+                        * @param[in] alarm alarm's reference.
                         */
                        void Remove(std::reference_wrapper<Alarm> alarm);
 
                        /**
                         * @brief Return capactiy of provider's internal storage
+                        * @return capacity of provider's storage.
                         */
                        int Capacity() const;
 
                        /**
-                        * @brief Check if provider's internal storage is full.
+                        * @brief Checks if provider's internal storage is full.
+                        * @return true if strage capacity is reached, false otherwise.
                         */
                        bool IsFull() const;
 
@@ -73,6 +82,8 @@ namespace model {
 
                        /**
                         * @brief returns true if container have any active alarms.
+                        * @return true if any active if container have any active alarms,
+                        * false otherwise.
                         */
                        bool HasActiveAlarms();
                private:
index 0307fd3..7539150 100644 (file)
 #include "Model/Alarm.h"
 
 namespace model {
+       /**
+        * @brief Global event that is announce that alarm was added to Provider
+        */
        class AlarmAddedEvent : public utils::Event {
                public:
+                       /**
+                        * @brief Creates AlarmAddedEvent instance
+                        * @param alarm added alarm.
+                        */
                        AlarmAddedEvent(Alarm &alarm) : alarm_(alarm) {}
+                       /**
+                        * @brief Gets event target 
+                        * @return added alarm.
+                        */
                        Alarm& GetAlarm() { return alarm_; }
                private:
                        Alarm &alarm_;
        };
+
+       /**
+        * @brief Global event that is announce that alarm was removed from Provider
+        */
        class AlarmRemovedEvent : public utils::Event {
                public:
+                       /**
+                        * @brief Creates AlarmRemovedEvent instance
+                        * @param alarm removed alarm reference.
+                        */
                        AlarmRemovedEvent(Alarm &alarm) : alarm_(alarm) {}
+                       /**
+                        * @brief Gets event target
+                        * @return removed alarm reference.
+                        */
                        Alarm& GetAlarm() { return alarm_; }
                private:
                        Alarm &alarm_;
index 2f243fa..7c8ff5f 100644 (file)
@@ -23,6 +23,7 @@
 #include <app_alarm.h>
 
 namespace model {
+       /** @brief Week flag enumarator */
        enum class WeekDay : int {
                MONDAY    = ALARM_WEEK_FLAG_MONDAY,
                TUESDAY   = ALARM_WEEK_FLAG_TUESDAY,
@@ -34,22 +35,72 @@ namespace model {
                ALL_WEEK  = (MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY),
                WEEKEND   = (SATURDAY | SUNDAY),
        };
+       /** @brief Day mask creation */
        inline constexpr WeekDay
        operator|(WeekDay a, WeekDay b)
        {
                return static_cast<WeekDay>(static_cast<int>(a) | static_cast<int>(b));
        }
+       /**
+        * @brief WeekFlags is a set for WeekDay values.
+        */
        class WeekFlags : public utils::ISerializable {
                public:
+                       /**
+                        * @brief Default constructor. None week flag is set
+                        */
                        WeekFlags();
+
+                       /**
+                        * @brief Constructos WeekFlags instance from reader interface.
+                        * @param[in] r reader inteface.
+                        */
                        WeekFlags(utils::IReader &r);
+
+                       /** 
+                        * @brief Default constructor using WeekDay flags
+                        * @param[in] day day mask.
+                        */
                        WeekFlags(WeekDay day);
+
+                       /**
+                        * @brief Add day to flags
+                        * @param[in] day flag to be added.
+                        */
                        void AddDay(WeekDay day);
+
+                       /** 
+                        * @brief Remove day flag from week flags
+                        * @param[in] day to remove.
+                        */
                        void RemoveDay(WeekDay day);
+
+                       /**
+                        * @brief Check if flag is set for given day
+                        * @param[in] day to check.
+                        * @return true, if week flag is set for particular day, false
+                        * otherwise.
+                        */
                        bool IsOn(WeekDay day);
+
+                       /** 
+                        * @brief Check if week flags is empty 
+                        * @return true if week flags empty.
+                        */
                        bool Empty() const;
+
                        void Serialize(utils::IWriter &w) const;
+
+                       /** 
+                        * @brief Check raw representation (int) of week flags 
+                        * @return bit mask with WeekDay flags.
+                        */
                        int GetBitMask() const;
+
+                       /** 
+                        * @brief Comparing operator 
+                        * @param[in] a WeekFlags reference.
+                        */
                        inline bool operator==(const WeekFlags &a) const { return a.raw_flags == raw_flags; }
                private:
                        int raw_flags;
index 6cca73c..4d19ade 100644 (file)
 #include <vector>
 
 namespace presenter {
+       /**
+        * @brief class managing displaying information on AlarmView and updating data in
+        * AlarmProvider class.
+        */
        class AlarmPresenter {
                public:
+                       /**
+                        * @brief Constructs object instance
+                        * @param view AlarmView instance which presenter will be managing
+                        * @param model AlarmProvider instance which presenter will be managing
+                        */
                        AlarmPresenter(view::AlarmView *view, model::AlarmProvider *model);
                        ~AlarmPresenter();
                private:
index dae8e53..a15fbb9 100644 (file)
 #include <map>
 
 namespace presenter {
+       /**
+        * @brief class managing displaying information on DeleteAlarmView and updating data in
+        * AlarmProvider class.
+        */
        class DeleteAlarmPresenter {
                public:
+                       /**
+                        * @brief Constructs object instance
+                        * @param view DeleteAlarmView instance which presenter will be managing
+                        * @param model AlarmProvider instance which presenter will be managing
+                        */
                        DeleteAlarmPresenter(view::DeleteAlarmView *view, model::AlarmProvider *model);
                        ~DeleteAlarmPresenter();
                private:
index 6d2dd5b..eb09955 100644 (file)
 #include "Model/AlarmProvider.h"
 
 namespace presenter {
+       /**
+        * @brief Class managing displaying information on EditAlarmView and updating data in
+        * AlarmProvider model.
+        */
        class EditAlarmPresenter {
                public:
+                       /**
+                        * @brief Constructs object instance
+                        *
+                        * @param provider AlarmProvider instance which presenter will be managing
+                        * @param alarm the instance of Alarm which should be edited
+                        * @param view Einstance which presenter will be managing
+                        */
                        EditAlarmPresenter(model::AlarmProvider *provider, model::Alarm *alarm, view::EditAlarmView& view);
                        ~EditAlarmPresenter();
                private:
index 143829f..cbe5355 100644 (file)
 #include <vector>
 
 namespace utils {
+       /**
+        * @brief class allowing to read binary data from file.
+        */
        class BinaryFileReader : public IReader {
                public:
+                       /**
+                        * @brief Constructs object instance
+                        * @param dir the application accessible directory
+                        * @param filename file name.
+                        */
                        BinaryFileReader(Utils::AppSubdirectory dir, const char *filename);
                        ~BinaryFileReader() {}
                        void Read(void *buffer, size_t size);
index 476d06c..6b1c700 100644 (file)
 #include <fstream>
 
 namespace utils {
+       /**
+        * @brief class allowing to write binary data to file.
+        */
        class BinaryFileWriter : public IWriter {
                public:
+                       /**
+                        * @brief Constructs object instance
+                        * @param dir the application accessible directory
+                        * @param filename file name.
+                        */
                        BinaryFileWriter(Utils::AppSubdirectory dir, const char *filename);
                        ~BinaryFileWriter();
                        void Write(const void *buffer, size_t size);
+                       /**
+                        * @brief Flushes data to file.
+                        */
                        void Flush();
                private:
                        std::ofstream file;
index f2a5c68..667376a 100644 (file)
@@ -138,7 +138,9 @@ namespace utils {
 
                        /**
                         * @brief Fire event. This means running all listener registered
-                        * with @AddListener function.
+                        * with AddListener function.
+                        *
+                        * @param[in] event to fire.
                         */
                        static void FireEvent(Event&);
 
index 9ec078a..4b8b17b 100644 (file)
 #include <cstdlib>
 
 namespace utils {
+       /**
+        * @brief Abstract interface for reading binary data
+        */
        class IReader {
                public:
+                       /** 
+                        * @brief reads size bytes to buffer
+                        *
+                        * @param[in] buffer to copy data to.
+                        * @param[in] size number of bytes to copy.
+                        */
                        virtual void Read(void *buffer, size_t size) = 0;
                        virtual ~IReader() {}
        };
index 5b7742e..b37ba56 100644 (file)
@@ -22,6 +22,9 @@
 
 namespace utils {
 
+/**
+ * @brief Utility class simpifying requesting ringtones from system dialogs.
+ */
 class RingtonePicker {
        public:
                /**
index 55dd598..df56565 100644 (file)
 #include <string>
 
 namespace utils {
+       /**
+        * @brief Abstract interface serializing data.
+        */
        class ISerializable {
                public:
                        ISerializable() {}
+                       /** 
+                        * @brief constructs object using reader interface.
+                        *
+                        * @param[in] reader interface
+                        */
                        ISerializable(IReader &reader) {}
+
+                       /** 
+                        * @brief Serializes object using writer interface.
+                        *
+                        * @param writer interface
+                        */
                        virtual void Serialize(IWriter &writer) const = 0;
                        virtual ~ISerializable() {}
        };
index fe656bd..f6d76c8 100644 (file)
@@ -26,6 +26,9 @@
 #include <utils_i18n.h>
 
 namespace utils {
+       /**
+        * @brief Utility class for managing time/dates using Gregorian calendar.
+        */
        class Time : public utils::ISerializable {
                public:
                        /**
@@ -35,11 +38,14 @@ namespace utils {
                         */
                        class PreferedTimeFormatChanged : public utils::Event {
                        };
-                       /** Predefined formats for convenience */
+                       /** @brief Predefined string for 12-hour format */
                        static const char *FORMAT_TIME_12H;// = "h:mm";
+                       /** @brief Predefined string for 32-hour format */
                        static const char *FORMAT_TIME_24H; // = "HH:mm";
+                       /** @brief Predefined string for meridiem */
                        static const char *FORMAT_TIME_AMPM; // = "a";
 
+                       /** @brief Year's month. */
                        enum class Month {
                                January   = I18N_UCALENDAR_JANUARY,
                                Febuary   = I18N_UCALENDAR_FEBRUARY,
@@ -55,6 +61,7 @@ namespace utils {
                                December  = I18N_UCALENDAR_DECEMBER,
                        };
 
+                       /** @brief Default constructor */
                        Time() : timezone_(GetCurrentTimezone()), milliseconds_(0) {}
 
                        /**
@@ -191,7 +198,7 @@ namespace utils {
                         *
                         * @param[in] timezone valid timezone id.
                         *
-                        * @ret difference in minutes between "timezone" and GMT:+00
+                        * @return difference in minutes between "timezone" and GMT:+00
                         * @note return INT_MAX when timezone string is invalid.
                         */
                        static int GetTimezoneOffset(const char *timezone);
index ea2ec1d..5373bdd 100644 (file)
 #include <cstdlib>
 
 namespace utils {
+       /**
+        * @brief Abstract interface for writing binary data
+        */
        class IWriter {
                public:
+                       /**
+                        * @brief Writes size bytes from buffer
+                        *
+                        * @param[in] buffer to copy data from.
+                        * @param[in] size number of bytes to copy.
+                        */
                        virtual void Write(const void *buffer, size_t size) = 0;
                        virtual ~IWriter() {}
        };
index 9b304a2..4bb8e0d 100644 (file)
 #include <functional>
 
 namespace view {
+       /**
+        * @brief View showing list of items which can be clicked.
+        *
+        * @note additionally displays "+" button and can display menu popup
+        */
        class AlarmView : public ui::IView {
                public:
+                       /** @brief Generic event function */
                        typedef std::function<void(int)> SelectCallback;
+                       /** @brief Selected event. Selected item identifier is passed in parameter. */
                        typedef std::function<void(int)> ToggleCallback;
+                       /** @brief Generic event function */
                        typedef std::function<void(void)> ButtonClickedCallback;
+                       /** @brief Generic event function */
                        typedef std::function<void(void)> MenuButtonClickedCallback;
 
+                       /**
+                        * @brief Creates AlarmView instance
+                        * @param main MainView instance
+                        */
                        AlarmView(ui::IView &main);
+
+                       /**
+                        * @brief Clear all items.
+                        */
                        void Clear();
+
+                       /**
+                        * @brief Appends item to view.
+                        *
+                        * @param[in] time time to be displayed.
+                        * @param[in] name name to be displayed.
+                        * @param[in] flags weekflags to be displayed.
+                        * @param[in] active item active status.
+                        *
+                        * @return return item identiefier.
+                        */
                        int ItemAppend(utils::Time time, const char *name,
                                        const model::WeekFlags flags, bool active);
+
+                       /**
+                        * @brief Remove item from view.
+                        * @param idx item identifier.
+                        */
                        void RemoveItem(int idx);
+
+                       /**
+                        * @brief Updates item.
+                        *
+                        * @param[in] idx index of item to be updated.
+                        * @param[in] time time to be displayed.
+                        * @param[in] name name to be displayed.
+                        * @param[in] flags weekflags to be displayed.
+                        * @param[in] active item active status.
+                        */
                        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);
+                       /**
+                        * @brief Registers callback emitted when user has cancelled edit
+                        * operation.
+                        *
+                        * @param[in] func callback to register.
+                        */
+                       void SetItemToggleCallback(ToggleCallback func) { onToggled_ = func; }
+
+                       /**
+                        * @brief Registers callback emitted when user has selected item on
+                        * list.
+                        *
+                        * @param[in] func callback to register.
+                        */
+                       void SetItemSelectCallback(SelectCallback func) { onSelected_ = func; }
+
+                       /**
+                        * @brief Registers callback emitted when user has clicked "+" floating button
+                        *
+                        * @param[in] func callback to register.
+                        */
+                       void SetButtonClickedCallback(ButtonClickedCallback func) { onClicked_ = func; }
+
+                       /**
+                        * @brief Registers callback emitted when user clicked Delete Item
+                        * on Delete popup
+                        *
+                        * @param[in] func callback to register.
+                        */
                        void SetDeleteItemClickedCallback(ButtonClickedCallback func) { onDeleteClicked_ = func;}
+                       /**
+                        * @brief Registers callback emitted when user clicked "Menu" hardware button
+                        *
+                        * @param[in] func callback to register.
+                        */
                        void SetMenuButtonClickedCallback(MenuButtonClickedCallback func) { onMenuClicked_ = func;}
                        Evas_Object *GetEvasObject();
 
+                       /**
+                        * @brief Shows "No Alarms" message in list background
+                        */
                        void ShowNoAlarmsBackgroundLabel();
+
+                       /**
+                        * @brief Hides "No Alarms" message in list background
+                        */
                        void HideNoAlarmsBackgroundLabel();
 
                        /**
                         * @brief Shows popup window with specified text
+                        *
+                        * @param[in] text text to be displayed on popup.
                         */
                        void ShowPopup(const std::string &text);
 
index 775a5fe..7323e70 100644 (file)
 #include <vector>
 
 namespace view {
+       /**
+        * @brief View showing list of items which can be selected/unselected
+        */
        class DeleteAlarmView : public PageView {
                public:
+                       /** @brief Generic event function */
                        typedef std::function<void(void)> ButtonClickedCallback;
 
-                       DeleteAlarmView(ui::IView &main);
+                       /**
+                        * @brief Creates DeleteAlarmView instance
+                        *
+                        * @param main MainView instance
+                        */
+                       DeleteAlarmView(view::MainView &main);
+
+                       /**
+                        * @brief Destructor
+                        */
                        ~DeleteAlarmView();
 
+                       /**
+                        * @brief Registers callback emitted when cancel button is clicked
+                        *
+                        * @param[in] cb callback to register.
+                        */
                        void RegisterCancelButtonClickedCallback(ButtonClickedCallback cb) { onCancelButtonClicked_ = cb; }
+
+                       /**
+                        * @brief Registers callback emitted when delete button is clicked
+                        *
+                        * @param[in] cb callback to register.
+                        */
                        void RegisterDeleteButtonClickedCallback(ButtonClickedCallback cb) { onDeleteButtonClicked_ = cb; }
                        Evas_Object *GetEvasObject() { return content_; }
 
+                       /**
+                        * @brief Appends item to view.
+                        *
+                        * @param[in] time time to be displayed.
+                        * @param[in] name name to be displayed.
+                        * @param[in] flags weekflags to be displayed.
+                        * @param[in] active item active status.
+                        *
+                        * @return item identifier.
+                        */
                        int ItemAppend(utils::Time time, const char *name,
                                        const model::WeekFlags flags, bool active);
+
+                       /**
+                        * @brief Gets identifiers of selected items.
+                        *
+                        * @return vector of selected items indentifiers.
+                        */
                        std::vector<int> GetSelectedItems() const;
                protected:
                        virtual void CreateContent(Evas_Object *parent);
index 134dbe2..def5a7f 100644 (file)
 #include "Utils/RingtonePicker.h"
 
 namespace view {
+       /**
+        * @brief Displays PageView with alarm information data.
+        */
        class EditAlarmView : public PageView {
                public:
+               /**
+                * @brief Data model displayed on EditAlarmView
+                */
                struct AlarmViewInfo {
+                       /** @brief Time to be set on datetime widget */
                        utils::Time time;
+                       /** @brief WeekFlags to be displayed on list item */
                        model::WeekFlags flags;
+                       /** @brief volume value to be set on slider */
                        double volume;
+                       /** @brief snooze flag to set on checkbox */
                        bool snooze;
+                       /** @brief name to be displayed in entry field. */
                        std::string name;
+                       /** @brief path to be displayed on list item */
                        std::string melody;
-                       model::AlarmType type;
+                       /** @brief type to be displayed on list item */
+                       model::Alarm::Type type;
                };
                        /**
                         * @brief Possible view modes.
@@ -46,49 +59,99 @@ namespace view {
                                Edit, /* Edit existing alarm mode */
                                Create, /* Create new alarm mode */
                        };
+
+                       /**
+                        * @brief Option enumerator
+                        */
                        enum class DiscardPopupOption {
-                               CANCEL,
-                               DISCARD
+                               CANCEL, /** User has requested to cancel discard operation */
+                               CONFIRM /** User has requested to confirmed discard operation */
                        };
-                       typedef std::function<void(AlarmViewInfo)> EditDoneCallback;
+
+                       /** @brief Generic event function */
+                       typedef std::function<void(void)> EditDoneCallback;
+                       /** @brief Generic event function */
                        typedef std::function<void(void)> EditCancelCallback;
+                       /** @brief Generic event function */
                        typedef std::function<void(void)> BackButtonCallback;
+                       /** @brief Event with operation result */
                        typedef std::function<void(DiscardPopupOption)> DiscardPopupCallback;
 
+                       /**
+                        * @brief Registers callback emitted when user has finished edit
+                        * operation.
+                        *
+                        * @param[in] cb callback to register.
+                        */
                        void RegisterEditDoneCallback(EditDoneCallback cb) { onEditDone_ = cb; }
+
+                       /**
+                        * @brief Registers callback emitted when user has cancelled edit
+                        * operation.
+                        *
+                        * @param[in] cb callback to register.
+                        */
                        void RegisterEditCancelCallback(EditCancelCallback cb) { onEditCancel_ = cb; }
 
                        /**
                         * @brief Registers callback emitted when back button is clicked
+                        *
+                        * @param[in] cb callback to register.
                         */
                        void RegisterBackButtonCallback(BackButtonCallback cb) { onBackButton = cb; }
 
                        /**
                         * @brief Registers callback emitted when option has been chosen on
                         * discard popup
+                        *
+                        * @param[in] cb callback to register.
                         */
                        void RegisterDiscardPopupCallback(DiscardPopupCallback cb) { onDiscardPopupCallback = cb; }
 
-                       EditAlarmView(ui::IView &main);
+                       /**
+                        * @brief Constructor
+                        * @param main MainView instance
+                        */
+                       EditAlarmView(view::MainView &main);
 
+                       /**
+                        * @brief Destructor
+                        */
                        ~EditAlarmView();
+
                        Evas_Object *GetEvasObject();
 
+                       /**
+                        * @brief Get current values of edited data.
+                        * @return AlarmViewInfo containing data from UI.
+                        */
                        const AlarmViewInfo& GetData() const { return data_; }
+
+                       /**
+                        * @brief Set data to be displayed on view.
+                        *
+                        * @param info data to be displayed.
+                        */
                        void SetData(const AlarmViewInfo &info);
 
                        /**
                         * @brief Set view mode.
+                        *
+                        * @param mode new view mode.
                         */
                        void SetMode(Mode mode) { mode_ = mode; }
 
                        /**
                         * @brief Get view mode.
+                        *
+                        * @return view mode.
                         */
                        Mode GetMode() const { return mode_; }
 
                        /**
                         * @brief Shows toast popup window
+                        *
+                        * @param[in] text text to be displayed on popup.
                         */
                        void ShowPopup(const std::string &text);
 
@@ -104,6 +167,8 @@ namespace view {
 
                        /**
                         * @brief Check if disard popup is visible
+                        *
+                        * @return true if discard popup is visible, false otherwise.
                         */
                        bool IsDiscardPopupVisible() const;
 
index f4c6096..8b199bc 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <Evas.h>
 
-#include "View/PageView.h"
 #include "View/View.h"
 
 /**
index b69a24d..290bdb1 100644 (file)
 #define NAVIFRAME_PAGE_VIEW_H_
 
 #include <Elementary.h>
+#include "View/MainView.h"
 #include "View/View.h"
 
 #include <vector>
 #include <functional>
 
 /**
- * @file pageView.h
+ * @file PageView.h
  */
 
 /**
 
 namespace view {
 
-       /*
-        * @brief Base class for pages(Alarm, World Clock, StopWatch and Timer)
+       /**
+        * @brief Base class for pages (Alarm, World Clock, StopWatch and Timer)
         */
        class PageView : public ui::IView {
                public:
-
                        /**
                         * @brief Constructs class object.
+                        *
+                        * @param main MainView instance
                         */
-                       PageView(ui::IView &main);
+                       PageView(view::MainView &main);
 
                        /**
                         * @brief Cleans all resources needed to be cleaned up.
@@ -66,25 +68,32 @@ namespace view {
                        virtual Evas_Object *GetEvasObject() = 0;
 
                        /**
-                        * Requestes and retrives new naviframe item pushed to naviframe.
+                        * @brief Pushed page on MainView.
+                        * @details The PageView becomes top-level on pages stack.
+                        * Function calls CreateContent virtual methods.
                         */
                        void PushPage();
 
                        /**
-                        * Requestes naviframe to pop page.
+                        * @brief Pops page from MainView.
+                        *
+                        * @details Function calls CreateContent virtual methods.
                         */
                        void PopPage();
 
-                       /*
-                        * Registers page popped callback
+                       /**
+                        * @brief Registers page popped callback
                         */
                        void RegisterPoppedCallback(std::function<void(void)>);
 
                protected:
+                       /**
+                        * @brief elm_naviframe item handle
+                        */
                        Elm_Object_Item *navi_item_;
 
                        /**
-                        * Returns naviframe parent of the page.
+                        * @brief Returns naviframe parent of the page.
                         */
                        Evas_Object *GetNaviframe();
                private:
index dacafeb..ad8b189 100644 (file)
 #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() {}
        };
index c4e0452..6d57cf2 100644 (file)
 #include <list>
 
 namespace view {
+       /**
+        * @brief WeekFlags class is a PagView view that
+        * enables user to edit WeekFlags data.
+        */
        class WeekFlagsView : public PageView {
                public:
-                       WeekFlagsView(ui::IView &main, model::WeekFlags &flags);
+                       /**
+                        * @brief Creates instance of WeekFlags view
+                        *
+                        * @param main parent view
+                        * @param flags model::WeekFlags to be edited
+                        */
+                       WeekFlagsView(view::MainView &main, model::WeekFlags &flags);
                        Evas_Object *GetEvasObject();
                protected:
                        virtual void CreateContent(Evas_Object *parent);
index eedfda0..339042f 100644 (file)
@@ -41,8 +41,9 @@ namespace view {
 
                        /**
                         * @brief Creates Class object, push new page and invokes CreateContent().
+                        * @param main MainView reference.
                         */
-                       WorldClockDeleteItemsView(ui::IView &main);
+                       WorldClockDeleteItemsView(view::MainView &main);
 
                        /**
                         * @brief Destroy all resources that can not be deleted automatically
index 6d1d740..bb5a23d 100644 (file)
@@ -37,9 +37,9 @@ namespace view {
                        };
 
                        /**
-                        * @brief Creates Class object, push new page and invokes CreateContent().
+                        * @brief Creates Class object.
                         */
-                       WorldClockReorderView(ui::IView &main);
+                       WorldClockReorderView(view::MainView &main);
 
                        /**
                         * @brief Destroy all resources that can not be deleted automatically
index 5878bb3..eccf076 100644 (file)
@@ -223,12 +223,12 @@ void Alarm::SetMelody(std::string path)
        sound.melody = path;
 }
 
-AlarmType Alarm::GetType() const
+Alarm::Type Alarm::GetType() const
 {
        return type_;
 }
 
-void Alarm::SetType(AlarmType type)
+void Alarm::SetType(Alarm::Type type)
 {
        type_ = type;
 }
@@ -256,16 +256,16 @@ bool Alarm::IsActivated() const
        return activated;
 }
 
-void model::Serialize(IWriter &w, AlarmType type)
+void model::Serialize(IWriter &w, Alarm::Type type)
 {
        utils::Serialize(w, static_cast<int>(type));
 }
 
-void model::Deserialize(IReader &r, AlarmType &type)
+void model::Deserialize(IReader &r, Alarm::Type &type)
 {
        int tmp;
        utils::Deserialize(r, tmp);
-       type = static_cast<AlarmType>(tmp);
+       type = static_cast<Alarm::Type>(tmp);
 }
 
 Alarm::Alarm(IReader &r)
@@ -309,6 +309,8 @@ double Alarm::GetVolume() const
 
 void Alarm::SetVolume(double volume)
 {
+       if (volume < 0.0) volume = 0.0;
+       if (volume > 1.0) volume = 1.0;
        sound.volume = volume;
 }
 
index 8d2cb4e..4511487 100644 (file)
@@ -27,7 +27,6 @@ using namespace internal;
 using namespace model;
 using namespace utils;
 
-const int AlarmBinaryStorage::db_schema_version = 1;
 const int AVAILABLE_ALARMS_MAX = 20;
 
 
index b146b37..6f56607 100644 (file)
@@ -57,7 +57,7 @@ view::EditAlarmView::AlarmViewInfo EditAlarmPresenter::GetDefaultInfo() const
        data.volume = 0.7;
        data.melody = Utils::GetAppResourcePath(
                                        Utils::APP_DIR_RESOURCE, SOUND_DEFAULT);
-       data.type = AlarmType::SOUND_ONLY;
+       data.type = Alarm::Type::SOUND_ONLY;
        data.name = "";
 
        return data;
@@ -195,7 +195,7 @@ void EditAlarmPresenter::OnDiscardPopupOptionClicked(EditAlarmView::DiscardPopup
                case EditAlarmView::DiscardPopupOption::CANCEL:
                        view_.HideDiscardPopup();
                        break;
-               case EditAlarmView::DiscardPopupOption::DISCARD:
+               case EditAlarmView::DiscardPopupOption::CONFIRM:
                        view_.HideDiscardPopup();
                        view_.PopPage();
                        break;
index 8c3fb62..4750560 100644 (file)
@@ -47,17 +47,26 @@ void Time::Serialize(utils::IWriter &w) const
        utils::Serialize(w, milliseconds_);
 }
 
-// Simple wrapper around i18n_uchar strings to simplify i18n_uchar strings
-// management
+/**
+ * @brief Simple wrapper around i18n_uchar (unicode) strings to simplify i18n_uchar strings
+ * management.
+ */
 class I18nString {
        public:
+               /** @brief Creates I18nString from UTF-8 string */
                I18nString(const char *str = nullptr);
+               /** @brief Creates I18nString std::string */
                I18nString(const std::string &str);
                ~I18nString();
+               /** @brief Reserves space for max_characters */
                void reserve(size_t max_characters);
+               /** @brief Returns c-string representation of I18N string */
                const i18n_uchar *i18n_str() const { return data_;}
+               /** @brief Returns std::string representation of I18N string */
                std::string std_string() const;
+               /** @brief Gets i18n_uchar on given index */
                i18n_uchar& operator[](int index);
+               /** @brief Returns current size of I18NString */
                size_t size() const { return size_;}
        private:
                i18n_uchar *data_;
index e005faa..17d8ac2 100644 (file)
@@ -30,12 +30,21 @@ using namespace view;
 using namespace model;
 using namespace utils;
 
+/**
+ * Genlist data
+ */
 struct ItemData {
+       /** Owner of data */
        AlarmView *instance;
+       /** Display text */
        char *name;
+       /** Activation flag */
        bool active;
+       /** Week flags to display */
        WeekFlags flags;
+       /** Time to display */
        Time time;
+       /** Iternal EFL handle */
        Elm_Object_Item *it;
 };
 
@@ -246,21 +255,6 @@ void AlarmView::RemoveItem(int idx)
        if (it) elm_object_item_del(it);
 }
 
-void AlarmView::SetItemToggleCallback(ToggleCallback func)
-{
-       onToggled_ = std::move(func);
-}
-
-void AlarmView::SetItemSelectCallback(SelectCallback func)
-{
-       onSelected_ = std::move(func);
-}
-
-void AlarmView::SetButtonClickedCallback(ButtonClickedCallback func)
-{
-       onClicked_ = std::move(func);
-}
-
 Evas_Object *AlarmView::GetEvasObject()
 {
        return content_;
index 25b8101..8ef3192 100644 (file)
@@ -24,14 +24,25 @@ using namespace utils;
 
 namespace view {
 
+/**
+ * @brief Genlist data
+ */
 struct ItemData {
+       /** Owner of ItemData */
        DeleteAlarmView *instance;
+       /** Name to be displyed on list item */
        char *name;
+       /** True if list item should be disabled (shadowed) */
        bool active;
+       /** True if item is selected */
        bool selected;
+       /** Week flags to be displayed */
        WeekFlags flags;
+       /** Time of alarm to be displayed */
        Time time;
+       /** Genlist item handle */
        Elm_Object_Item *it;
+       /** Checkbox displayed on list */
        Evas_Object *check;
 };
 
@@ -66,7 +77,7 @@ static char *Time2FormattedString(const Time &time)
        return strdup(formatted_time.str().c_str());
 }
 
-DeleteAlarmView::DeleteAlarmView(ui::IView &main)
+DeleteAlarmView::DeleteAlarmView(view::MainView &main)
        : PageView(main), all_selected_(false)
 {
        time_format_change_listener_ = EventBus::AddListener<Time::PreferedTimeFormatChanged>(
index deb3e5d..f75ecc5 100644 (file)
@@ -35,7 +35,7 @@ using namespace model;
 #define VIBRATION_ICON_PATH "images/01_volume_vibration.png"
 #define SOUND_ICON_PATH "images/00_volume_icon.png"
 
-EditAlarmView::EditAlarmView(ui::IView &main)
+EditAlarmView::EditAlarmView(view::MainView &main)
        : PageView(main), week_flags_view_(main, data_.flags), is_muted_(false), main_(main)
 {
        week_flags_view_.RegisterPoppedCallback(
@@ -150,14 +150,14 @@ inline static Time ConvertElmDatetimeTimeToTime(const Elm_Datetime_Time &time)
                        time.tm_hour, time.tm_min, 0, 0);
 }
 
-static std::string GetLabelForAlarmType(AlarmType type)
+static std::string GetLabelForAlarmType(Alarm::Type type)
 {
        switch (type) {
-               case AlarmType::SOUND_ONLY:
+               case Alarm::Type::SOUND_ONLY:
                        return Translate::Sprintf("IDS_ALM_BODY_ALERTTYEP_SOUND");
-               case AlarmType::VIBRATION:
+               case Alarm::Type::VIBRATION:
                        return Translate::Sprintf("IDS_ALM_BODY_ALERTTYEP_VIBRATION");
-               case AlarmType::VIBRATION_AND_SOUND:
+               case Alarm::Type::VIBRATION_AND_SOUND:
                        return Translate::Sprintf("IDS_ALM_BODY_ALERTTYEP_VIBRATION_AND_SOUND");
                default:
                        return Translate::Sprintf("IDS_COM_BODY_UNKNOWN");
@@ -168,14 +168,12 @@ void EditAlarmView::OnCancelButtonClickedCb(void *data, Evas_Object *obj, void *
 {
        EditAlarmView *view = static_cast<EditAlarmView*>(data);
        if (view->onEditCancel_) view->onEditCancel_();
-       view->PopPage();
 }
 
 void EditAlarmView::OnConfirmButtonClickedCb(void *data, Evas_Object *obj, void *event_info)
 {
        EditAlarmView *view = static_cast<EditAlarmView*>(data);
-       if (view->onEditDone_) view->onEditDone_(view->data_);
-       view->PopPage();
+       if (view->onEditDone_) view->onEditDone_();
 }
 
 const char *EditAlarmView::GetTitle()
@@ -530,7 +528,7 @@ void EditAlarmView::PopupListItemSelectedCallback(void *data, Evas_Object *obj,
 void EditAlarmView::PopupHide(void *data, Evas_Object *obj, void *event)
 {
        EditAlarmView *view = static_cast<EditAlarmView*>(data);
-       view->data_.type = static_cast<AlarmType>(elm_radio_value_get(view->main_radio_));
+       view->data_.type = static_cast<Alarm::Type>(elm_radio_value_get(view->main_radio_));
        // refresh type item
        elm_genlist_item_update(view->type_it_);
        evas_object_del(obj);
@@ -548,19 +546,19 @@ void EditAlarmView::ShowSetTypePopup()
 
        main_radio_ = elm_radio_add(list);
        elm_radio_state_value_set(main_radio_, 0);
-       elm_list_item_append(list, GetLabelForAlarmType(AlarmType::SOUND_ONLY).c_str(),
+       elm_list_item_append(list, GetLabelForAlarmType(Alarm::Type::SOUND_ONLY).c_str(),
                        NULL, main_radio_, EditAlarmView::PopupListItemSelectedCallback, main_radio_);
 
        Evas_Object *radio = elm_radio_add(list);
        elm_radio_state_value_set(radio, 1);
        elm_radio_group_add(radio, main_radio_);
-       elm_list_item_append(list, GetLabelForAlarmType(AlarmType::VIBRATION).c_str(),
+       elm_list_item_append(list, GetLabelForAlarmType(Alarm::Type::VIBRATION).c_str(),
                        NULL, radio, EditAlarmView::PopupListItemSelectedCallback, radio);
 
        radio = elm_radio_add(list);
        elm_radio_state_value_set(radio, 2);
        elm_radio_group_add(radio, main_radio_);
-       elm_list_item_append(list, GetLabelForAlarmType(AlarmType::VIBRATION_AND_SOUND).c_str(),
+       elm_list_item_append(list, GetLabelForAlarmType(Alarm::Type::VIBRATION_AND_SOUND).c_str(),
                        NULL, radio, EditAlarmView::PopupListItemSelectedCallback, radio);
 
        eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK,
@@ -603,7 +601,7 @@ void EditAlarmView::ShowPopup(const std::string &text)
 void EditAlarmView::PopupDiscardButtonClicked(void *data, Evas_Object *obj, void *event_info)
 {
        EditAlarmView *view = static_cast<EditAlarmView*>(data);
-       if (view->onDiscardPopupCallback) view->onDiscardPopupCallback(DiscardPopupOption::DISCARD);
+       if (view->onDiscardPopupCallback) view->onDiscardPopupCallback(DiscardPopupOption::CONFIRM);
 }
 
 void EditAlarmView::PopupCancelButtonClicked(void *data, Evas_Object *obj, void *event_info)
index 7eac52c..5bdf3cf 100644 (file)
@@ -33,7 +33,7 @@ PageView::~PageView()
        }
 }
 
-PageView::PageView(ui::IView &main)
+PageView::PageView(view::MainView &main)
        : navi_item_(nullptr), naviframe_(main.GetEvasObject())
 {
 }
index 653ac71..307101f 100644 (file)
@@ -27,7 +27,7 @@ using namespace utils;
 using namespace model;
 
 
-WeekFlagsView::WeekFlagsView(ui::IView &main, WeekFlags &flags)
+WeekFlagsView::WeekFlagsView(view::MainView &main, WeekFlags &flags)
        : PageView(main), flags_(flags)
 {
 }
index 4ba41a8..7509c0b 100644 (file)
@@ -221,7 +221,7 @@ Evas_Object *WorldClockDeleteItemsView::CreatePaddingObject(Evas_Object *parent,
 
 /*[END] Delete list View */
 
-WorldClockDeleteItemsView::WorldClockDeleteItemsView(ui::IView &main):
+WorldClockDeleteItemsView::WorldClockDeleteItemsView(view::MainView &main):
                PageView(main), all_selected_(false)
 {
        time_format_change_listener_ = EventBus::AddListener<Time::PreferedTimeFormatChanged>(
index fa270fa..a752e0d 100644 (file)
@@ -55,7 +55,7 @@ Elm_Genlist_Item_Class WorldClockReorderView::world_clock_reorder_items_view_itc
 
 
 
-WorldClockReorderView::WorldClockReorderView(ui::IView &main) :
+WorldClockReorderView::WorldClockReorderView(view::MainView &main) :
                PageView(main)
 {
        time_format_change_listener_ = EventBus::AddListener<Time::PreferedTimeFormatChanged>(