[doxygen] Add documentation 94/104894/7
authorKamil Lipiszko <k.lipiszko@samsung.com>
Wed, 14 Dec 2016 11:14:13 +0000 (12:14 +0100)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Wed, 4 Jan 2017 13:00:44 +0000 (05:00 -0800)
Change-Id: I49a157fea8b4e381e2dbe26975064554890b3336

21 files changed:
clock/inc/Common/CounterAnimator.h
clock/inc/Controller/RingController.h
clock/inc/Model/Counter.h
clock/inc/Model/Ring.h
clock/inc/Model/RingEvent.h
clock/inc/Model/StopWatch.h
clock/inc/Model/Timer.h
clock/inc/Presenter/RingPresenter.h
clock/inc/Presenter/StopWatchPresenter.h
clock/inc/Presenter/TimerPresenter.h
clock/inc/Utils/FeedbackManager.h
clock/inc/Utils/Notifier.h
clock/inc/Utils/PopupManager.h
clock/inc/Utils/SoundManager.h
clock/inc/Utils/ThemeExtension.h
clock/inc/Utils/Translate.h
clock/inc/View/CounterView.h
clock/inc/View/RingView.h
clock/inc/View/StopWatchView.h
clock/inc/View/TimerView.h
clock/inc/View/WorldClockMap.h

index a1556344a3471b02eb64f7f941f806760e72f421..3cbb426f35867cc9a8544c9ec747bdf3575eecbf 100644 (file)
 
 namespace common {
 
+       /**
+        * @brief Counter's animator
+        *
+        * This class creates animator for any view that has counter in its content.
+        * Animator is responsible for refreshing the related counter's view by requesting
+        * view update every frametime.
+        *
+        * After the CounterAnimator object is created there must be registered callback
+        * to be called on every animator's tick. Animator starts running on Start() and stops
+        * whenever Stop() or Remove() method is called. The animator stops by default
+        * during object's destruction.
+        */
        class CounterAnimator {
        public:
                CounterAnimator();
                ~CounterAnimator();
 
+               /**
+                * @brief Creates and runs ecore animator
+                *
+                * @return true on success, otherwise false
+                *
+                * @see Remove()
+                */
                bool Start(void);
+
+               /**
+                * @brief Freezes ecore animator
+                *
+                * @return true on success, otherwise false
+                *
+                * @see Start()
+                */
                bool Stop(void);
+
+               /**
+                * @brief Resumes ecore animator
+                *
+                * @return true on success, otherwise false
+                *
+                * @see Stop()
+                */
                bool Resume(void);
+
+               /**
+                * @brief Removes ecore animator
+                *
+                * @see Start()
+                */
                void Remove(void);
 
+               /**
+                * @brief Sets frametime for ecore animator
+                *
+                * @param[in] time The frametime
+                */
                void SetFrametime(double time);
 
+               /**
+                * @brief Registers animators callback
+                *
+                * This function registers callback to be called on
+                * every animator tick.
+                *
+                * @param[in] func Callback function to be registered
+                */
                void RegisterSignal(std::function<void(void)>func);
 
        private:
index cc8faf91ee06ecea9d34586a224daf71b7702194..b2bfd993b41ffe9bbfdc462504e544115424d76c 100644 (file)
 
 namespace controller {
 
-       struct RingStackItem {
-               model::Ring *model;
-               view::RingView *view;
-               presenter::RingPresenter *presenter;
-
-               model::Alarm *alarm;
-       };
-
+       /**
+        * @brief Ring controller
+        *
+        * This class provides Ring Controller singleton that handles incomming
+        * ring alarm, displays them, snoozes or destroys depending on user's
+        * choice. It is related with Ring's model that stores incoming alarm data
+        * and view for user interaction.
+        *
+        * Ring handles alarm depending on operation value in app control request.
+        * HandleAlarm() handles simple alarm with ID found in Clock's database file.
+        * HandleTimeout() handles alarm from Clock's Timer.
+        */
        class RingController {
        public:
+               /**
+                * @brief RingController constructor
+                *
+                * @param[in] provider AlarmProvider object
+                */
                RingController(model::AlarmProvider *provider);
                ~RingController();
 
+               /**
+                * @brief Returns the reference to RingController instance
+                *
+                * @return Reference to RingController singleton instance
+                */
+               static RingController &GetInstance(void);
+
+               /**
+                * @brief Operator = is deleted
+                */
                void operator=(RingController const&) = delete;
+
+               /**
+                * @brief Copy contstuctor is deleted
+                */
                RingController(RingController const&) = delete;
 
+               /**
+                * @brief Handles alarm
+                *
+                * Handles incoming alarm with id
+                *
+                * @param[in] alarmID ID of the alarm
+                */
                void HandleAlarm(int alarmID);
+
+               /**
+                * @brief Handles timeout alarm
+                *
+                * Handles timeout alarm that incomes when timer's time is up
+                */
                void HandleTimeout(void);
 
        private:
index 6ec303519792498f79ff5360a5fde5292d9966b1..f828aeb4382a1ff8c74a0db889dee5e4c615ae19 100644 (file)
@@ -27,23 +27,73 @@ namespace model {
 
        using namespace std::chrono;
 
+       /**
+        * @brief Checks whether template type is std::chrono::duration
+        *
+        * Counter works only with std::chrono::duration values. This structure
+        * is used by assert to warn about type collision during compilation
+        */
        template <typename Type>
        struct isDuration {
+
+               /**
+                * @brief Is duration flag
+                *
+                * This value will be returned if the type during compilation
+                * in Counter template is different than std::chrono::duration
+                */
                static constexpr bool value = false;
        };
 
+       /**
+        * @brief Checks whether template type is std::chrono::duration
+        *
+        * Counter works only with std::chrono::duration values. This structure
+        * is used by assert to warn about type collision during compilation
+        */
        template <typename Rep, typename Period>
        struct isDuration <duration<Rep, Period>>{
+
+               /**
+                * @brief Is duration flag
+                *
+                * This value will be returned if the type during compilation
+                * in Counter template is std::chrono::duration
+                */
                static constexpr bool value = true;
        };
 
+       /**
+        * @brief Counter's template
+        *
+        * This template provides Counter's model depending on template's type.
+        * The type must be one of the std::chrono::duration (hours, seconds and etc.),
+        * any other will be asserted during compilation as fault. Counter stores
+        * time elapsed from its start to any other time during Get...() access.
+        *
+        * Counter starts on Run() call and stops on Stop(). Stopped Counter can be
+        * resumed with Resume(). At any time Counter might be reseted with Reset().
+        * Reseting counter resets the measured time. Every stop is recorded,
+        * and time in total is equal to the sum of every running period.
+        */
        template <typename Duration = milliseconds> class Counter {
        public:
+               /**
+                * @brief Counter's constructor
+                *
+                */
                Counter() {
                        start_time_ = Duration::zero();
                        pause_time_ = Duration::zero();
                }
 
+               /**
+                * @brief Runs counter
+                *
+                * @return true on success, otherwise false
+                *
+                * @see Stop()
+                */
                bool Run()
                {
                        start_time_ = GetTimeSinceEpoch();
@@ -52,6 +102,13 @@ namespace model {
                        return true;
                }
 
+               /**
+                * @brief Resets current counter's time
+                *
+                * @return true on success, otherwise false
+                *
+                * @see Stop()
+                */
                bool Reset()
                {
                        pause_time_ = Duration::zero();
@@ -62,6 +119,15 @@ namespace model {
                        return true;
                }
 
+               /**
+                * @brief Resumes counter
+                *
+                * If counter is stopped, this method resumes it.
+                *
+                * @return true on success, otherwise false
+                *
+                * @see Stop()
+                */
                bool Resume()
                {
                        if (!Run()) {
@@ -71,6 +137,13 @@ namespace model {
                        return true;
                }
 
+               /**
+                * @brief Stops counter
+                *
+                * @return true on success, otherwise false
+                *
+                * @see Run()
+                */
                bool Stop()
                {
                        pause_time_ += GetTimeSinceEpoch() - start_time_;
@@ -79,31 +152,67 @@ namespace model {
                        return true;
                }
 
+               /**
+                * @brief Gets current counter's count time
+                *
+                * Returns counter's total running time. Every reset zeroes this value.
+                *
+                * @return Duration time
+                */
                Duration GetTime() const
                {
                        return GetTimeSinceEpoch() - start_time_ + pause_time_;
                }
 
+               /**
+                * @brief Gets time since epoch
+                *
+                * @return Duration time since epoch
+                */
                Duration GetTimeSinceEpoch() const
                {
                        return duration_cast<Duration>(system_clock::now().time_since_epoch());
                }
 
+               /**
+                * @brief Gets counter's start time
+                *
+                * @return Duration time
+                */
                Duration GetStartTime() const
                {
                        return start_time_;
                }
 
+               /**
+                * @brief Gets counter's count time hours
+                *
+                * @return Amount of hours
+                */
                unsigned GetHour() const
                {
                        return (unsigned)(duration_cast<hours>(GetTime()).count() % 99);
                }
 
+               /**
+                * @brief Gets counter's count time minutes.
+                *
+                * This method returns remaining time in minutes to the entire hour.
+                *
+                * @return Amount of minutes
+                */
                unsigned GetMinute() const
                {
                        return (unsigned)(duration_cast<minutes>(GetTime()).count() % 60);
                }
 
+               /**
+                * @brief Gets counter's count time seconds.
+                *
+                * This method returns remaining time in minutes to the entire minute.
+                *
+                * @return Amount of seconds
+                */
                unsigned GetSecond() const
                {
                        return (unsigned)(duration_cast<seconds>(GetTime()).count() % 60);
index 046518a659fe29123618100d52773f033a36eb38..30647c245ad37f12cfdfcaef04797d1725413367 100644 (file)
 
 namespace model {
 
+       /**
+        * @brief The enum of the ring alarm type
+        */
        enum class RingType {
-               RING_TYPE_NONE,
+               RING_TYPE_NONE, //ring's type is undefined
 
-               RING_TYPE_ALARM,
-               RING_TYPE_TIMER
+               RING_TYPE_ALARM, //ring is called on alarm
+               RING_TYPE_TIMER //ring is called on timer's time out
        };
 
+       /**
+        * @brief Ring model
+        *
+        * This class provides every functionality related with data stored in alarm
+        * to be accessed during its call. Ring object is responsible for dismissing
+        * and snoozing alarm depending on user's choice and running its vibration
+        * or ringtone.
+        *
+        * Ring object is created during app control request and stores alarm's data passed
+        * in AlarmAdd() call. Any other already running ring call is dismissed or snoozed,
+        * depending on alarm's snooze status.
+        */
        class Ring{
        public:
                Ring();
@@ -77,6 +92,15 @@ namespace model {
                 */
                RingType GetType() const;
 
+               /**
+                * @brief Gets ring's counter
+                *
+                * Ring uses Counter class object to measure the time left
+                * to ring's call. This method returns such a counter that
+                * belongs to current Ring object.
+                *
+                * @return Reference to the Counter object
+                */
                const Counter<std::chrono::seconds> &GetCounter() const { return (counter_); };
 
        private:
index f4bc5b7e9382fc2e7a94d9d2f218467bce7d5ca9..790f3e884b5babff7e814cbe098510071d036104 100644 (file)
 
 namespace model {
 
+       /**
+        * @brief Ring dismiss event class
+        *
+        * This class provides event info created during alarm's dismiss.
+        */
        class RingDismissEvent : public utils::Event {
        };
 
+       /**
+        * @brief Ring timeout event class
+        *
+        * This class provides event info created during alarm's timeout.
+        */
        class RingTimeoutEvent : public utils::Event {
        };
 
+       /**
+        * @brief Ring new alarm event class
+        *
+        * This class provides event info created during new alarm's call and
+        * stores its pointer for later access.
+        */
        class RingNewAlarmEvent : public utils::Event {
                public:
+                       /**
+                        * @brief RingNewAlarmEvent constuctor
+                        *
+                        * @param[in] alarm The alarm passed with event
+                        */
                        RingNewAlarmEvent(Alarm &alarm);
+
+                       /**
+                        * @Gets event's alarm
+                        *
+                        * This method returns event's alarm.
+                        *
+                        * @return The handled alarm
+                        */
                        Alarm *GetAlarm(void) const { return alarm_; };
                private:
                        Alarm *alarm_;
index 640005504d0a69be62bbad3020461dcd92a7d248..5ea89f16521e77135009a9dc03cf73946f316e98 100644 (file)
 
 namespace model {
 
+       /**
+        * @brief Lap's model class
+        *
+        * This class provides StopWatch lap's information. It stores its number,
+        * split time and lap time from the laps list.
+        */
        class Lap {
        public:
+               /**
+                * @brief Gets lap time in milliseconds
+                *
+                * @return Lap time in milliseconds
+                */
                inline std::chrono::milliseconds GetTime(void) const { return lap_time_; };
+
+               /**
+                * @brief Gets lap's split time in milliseconds
+                *
+                * @return Lap's split time in milliseconds
+                */
                inline std::chrono::milliseconds GetSplitTime(void) const { return split_time_; };
+
+               /**
+                * @brief Gets number of the lap in lap list
+                *
+                * @return The number of the lap
+                */
                inline unsigned GetNo(void) const { return No_; };
 
+               /**
+                * @brief Sets lap's time in milliseconds
+                *
+                * @param[in] time The time to be set
+                */
                inline void SetTime(std::chrono::milliseconds time) { lap_time_ = time; };
+
+               /**
+                * @brief Sets lap's split time in milliseconds
+                *
+                * @param[in] time The time to be set
+                */
                inline void SetSplitTime(std::chrono::milliseconds time) { split_time_ = time; };
+
+               /**
+                * @brief Sets lap's list number
+                *
+                * @param[in] num The number of the lap in list
+                */
                inline void SetNo(unsigned num) { No_ = num; };
        private:
                unsigned No_;
@@ -40,12 +80,40 @@ namespace model {
                std::chrono::milliseconds lap_time_;
        };
 
+       /**
+        * @brief Stopwatch model class
+        *
+        * This class stores the laps list information and related functionalities such as
+        * adding new record into the list with AddLap(), getting total amount of laps
+        * in list with GetLapsCount(), receiving last stored lap with GetLastLap().
+        */
        class StopWatch : public Counter<milliseconds> {
        public:
+               /**
+                * @brief Clears list of stored laps and their times
+                */
                void ClearList(void);
+
+               /**
+                * @brief Creates new lap
+                *
+                * This method creates new lap with the start time and split time
+                * from the moment of its call.
+                */
                void AddLap(void);
+
+               /**
+                * @brief Gets the total number of laps in the laps list
+                *
+                * @return Number of laps
+                */
                unsigned GetLapsCount(void);
 
+               /**
+                * @brief Gets the last lap in the laps list
+                *
+                * @return Last lap in the laps list.
+                */
                const Lap *GetLastLap(void);
        private:
                std::vector<Lap *> laps_;
index 7d0d34064a0c39d47c0b00bb8daf6370f6f29211..0f6034cbc7466cc0c7e81427679457ce7e5aea33 100644 (file)
 using namespace std::chrono;
 
 namespace model {
+
+       /**
+        * @brief Counter's model class
+        *
+        * This class is a backend for timer, stores its current time values
+        * such as hour, minute, second and registers or unregisters alarm with
+        * external API.
+        *
+        * Running Timer by user provide setting time in this object and register
+        * alarm in database. Stopping timer unregister alarm.
+        */
        class Timer : public Counter<seconds> {
        public:
                Timer();
                ~Timer();
 
+               /**
+                * @brief Sets timer's amount of hours
+                *
+                * This value is added to the whole timer's countdown time.
+                * After it reaches 0, the timer's ring alarm is called.
+                *
+                * @param[in] hour The hour to be set
+                */
                void SetHour(int hour);
+
+               /**
+                * @brief Sets timer's amount of minutes
+                *
+                * This value is added to the whole timer's countdown time.
+                * After it reaches 0, the timer's ring alarm is called.
+                *
+                * @param[in] minute The minute to be set
+                */
                void SetMinute(int minute);
+
+               /**
+                * @brief Sets timer's amount of seconds
+                *
+                * This value is added to the whole timer's countdown time.
+                * After it reaches 0, the timer's ring alarm is called.
+                *
+                * @param[in] second The second to be set
+                */
                void SetSecond(int second);
 
+               /**
+                * @brief Gets timer's hour
+                *
+                * @return Number of timer's hours
+                */
                unsigned GetHour(void) const;
+
+               /**
+                * @brief Gets timer's minutes
+                *
+                * @return Number of timer's minutes
+                */
                unsigned GetMinute(void) const;
+
+               /**
+                * @brief Gets timer's seconds
+                *
+                * @return Number of timer's seconds
+                */
                unsigned GetSecond(void) const;
 
+               /**
+                * @brief Sets total timer's countdown time
+                *
+                * @param[in] hour The timer's hour
+                * @param[in] minute The timer's minute
+                * @param[in] second The timer's second
+                */
                void SetTime(int hour, int minute, int second);
+
+               /**
+                * @brief Activates alarm after delay.
+                *
+                * This method uses external API to register alarm to be called
+                * on specified time. In this case the alarm's call begins after
+                * a@ delay time.
+                *
+                * @param[in] delay Alarm's ring call delay time
+                *
+                * @return true on success, otherwise false
+                */
                bool ActivateAlarm(int delay);
+
+               /**
+                * @brief Deactivates alarm
+                *
+                * This method deactives currently running timer's alarm.
+                *
+                * @return true on success, otherwise false
+                */
                bool DeactivateAlarm(void);
 
+               /**
+                * @brief Gets timers remaining time
+                *
+                * Returns time left to the timer's ring call.
+                *
+                * @return Remaining time in std::chrono::seconds
+                */
                seconds GetRemainingTime(void);
        private:
                unsigned hour_;
index 32890a3cc01963f7f0eec0816bd83dba45f596d5..87d2eb82c193dc7094d9758b02e5164dafe8ab28 100644 (file)
 
 namespace presenter {
 
+       /**
+        * @brief Ring presenter class
+        *
+        * This class creates presenter that stores incoming information from view in
+        * model and reacts on its change. Also refreshes view on backend data change.
+        */
        class RingPresenter {
        public:
+               /**
+                * @brief RingPresenter constructor
+                *
+                * @param[in] view The view object
+                * @param[in] model The model object
+                */
                RingPresenter(view::RingView *view, model::Ring *model);
                ~RingPresenter();
 
index 317654cb3fd069018428f34fed270648355401b4..6aa9b6e42dc1fe3b2917981db8ef3323b0ddd84b 100644 (file)
 
 namespace presenter {
 
+       /**
+        * @brief Stopwatch presenter class
+        *
+        * This class creates presenter that stores incoming information from view in
+        * model and reacts on its change. Also refreshes view on stored data change.
+        */
        class StopWatchPresenter {
        public:
+               /**
+                * @brief StopWatchPresenter constructor
+                *
+                * @param[in] ui The view object
+                * @param[in] model The model object
+                */
                StopWatchPresenter(view::StopWatchView *ui, model::StopWatch *model);
                ~StopWatchPresenter();
 
index 2ad0c4213b8384d0e38725c5d905e5876a883f12..bddc81567af05cc800cb7bcfec840770979e356c 100644 (file)
 
 namespace presenter {
 
+       /**
+        * @brief Timer's presenter class
+        *
+        * This class creates presenter that stores incoming information from view in
+        * model and reacts on its change. Also refreshes view on backend data change.
+        */
        class TimerPresenter {
        public:
+               /**
+                * @brief TimerPresenter constructor
+                *
+                * param[in] view The timer's view
+                * param[in] model The timer's model
+                */
                TimerPresenter(view::TimerView *view, model::Timer *model);
                ~TimerPresenter();
 
index ee0a93be361c22e30c7c5c87b3aed3679af8de80..36c06b3c511f2cff887951123534af99cca7728f 100644 (file)
 
 namespace utils {
 
+       /**
+        * @brief Feedback manager singleton class
+        *
+        * This object provides all features related with device fibration.
+        */
        class FeedbackManager {
        public:
 
index 68f0310e0c4fb93b3959d74e3ca8befdabb37410..fe7518f772c76f7655460c4777331d094fd9286a 100644 (file)
@@ -5,15 +5,34 @@
 
 namespace utils {
 
+       /**
+        * @brief Notifier singleton class
+        *
+        * This object notifies indicator about set alarm's. Notifier is responsible
+        * for displaying indicator's clock icon.
+        */
        class Notifier {
        public:
                virtual ~Notifier ();
+
+               /**
+                * @brief Gets instance of the Notifier
+                *
+                * @return Notifier singleton's reference
+                */
                static Notifier &GetInstance();
 
+               /**
+                * @brief Deletes singleton's operator=
+                */
                Notifier &operator=(const Notifier&) = delete;
+
+               /**
+                * @brief Deletes singleton's copy constructor
+                */
                Notifier(const Notifier &) = delete;
 
-               /*
+               /**
                 * @brief Posts alarm notification for indicator
                 *
                 * Posting notification for indicator to display alarm
@@ -23,7 +42,7 @@ namespace utils {
                 */
                bool AlarmNotiPost();
 
-               /*
+               /**
                 * @brief Removes alarm notification from indicator
                 *
                 * Removes alarm icon from indicator bar.
index 13fa4770f5b466ebae99c7ceeefbaabe27837f01..63e8a95b1e169c9ffd64619f75042af345e0847a 100644 (file)
 
 namespace utils {
 
+       /**
+        * @brief Popup menager static class
+        *
+        * This is a static class that displays simple popup with requested content.
+        */
        class PopupManager {
        public:
-               /*
+               /**
                 * @brief Creates new toast popup.
                 *
                 * @param[in] parent The parent view of the popup
@@ -35,7 +40,7 @@ namespace utils {
                 */
                static void CreatePopup(ui::IView &parent, const std::string &text, double timeout = 2.0);
 
-               /*
+               /**
                 * @brief Destroys currently visible toast popup.
                 *
                 * @note Destroys before timeout elapses.
@@ -47,7 +52,7 @@ namespace utils {
 
                PopupManager() {};
 
-               /*
+               /**
                 * @brief Callback function to be called on popup dismiss.
                 *
                 */
index b61f85da3f54ddb68d0c3842abe5c62da8456d56..34f27dc9b1f4b6254ea98e96450935cab1883510 100644 (file)
 
 namespace utils {
 
+       /**
+        * @brief Sound manager static class
+        *
+        * Class managing sound during alarm's ring call.
+        */
        class SoundManager {
 
        public:
                /**
-                * @brief Creates sound stream and plays music with the passed uri
-                *      path and relative to system volume value.
+                * @brief Creates sound stream
+                *
+                * Creates Sound stream and plays music with the passed uri
+                * path and relative to system volume value.
+                *
+                * @param[in] uri The uri of sound to be played
+                * @param[in] volume The volume of the sound
+                *
+                * @return true on success, otherwise false
                 */
                static bool SoundPlay(const std::string &uri, double volume = 1.0);
 
                /**
-                * @brief Stops the currently playing music and destroys created with SoundPlay
-                *      sound stream. After music is stopped, to play it againg it is necessary
-                *      to call SoundPlay method.
+                * @brief Stops the currently playing sound
+                *
+                * Stops the currently playing sound and destroys created with SoundPlay
+                * sound stream. After music is stopped, to play it againg it is necessary
+                * to call SoundPlay method.
+                *
+                * @return true on success, otherwise false
                 */
                static bool SoundStop(void);
 
                /**
                 * @brief Pauses the currently playing music without destroying sound stream.
+                *
+                * @return true on success, otherwise false
                 */
                static bool SoundPause(void);
 
                /**
                 * @brief Resumes paused music.
+                *
+                * @return true on success, otherwise false
                 */
                static bool SoundResume(void);
 
index ca42cd7ffd44d60830f196cf9a2c8e6eaf1c2e44..135bd5e45da9a9088e03fa50942a58f9f3fc222c 100644 (file)
 
 namespace utils {
 
-class ThemeExtension {
-public:
-
-       /**
-        * @brief Adds theme to the list of extensions.
-        *
-        * @param[in] path The path to the edje file
-        */
-       static void AddTheme(const std::string &path);
-
        /**
-        * @brief Removes theme from the list of extensions.
+        * @brief Theme extension static class
         *
-        * @param[in] path The path to the edje file
+        * Storage class for theme extensions. It prevents from duplicating
+        * themes in application.
         */
-       static void DelTheme(const std::string &path);
-
-private:
-       static std::set<std::string> themes_;
-       ThemeExtension() {};
-};
+       class ThemeExtension {
+       public:
+
+               /**
+                * @brief Adds theme to the list of extensions
+                *
+                * @param[in] path The path to the edje file
+                */
+               static void AddTheme(const std::string &path);
+
+               /**
+                * @brief Removes theme from the list of extensions
+                *
+                * @param[in] path The path to the edje file
+                */
+               static void DelTheme(const std::string &path);
+
+       private:
+               static std::set<std::string> themes_;
+               ThemeExtension() {};
+       };
 }
 
 #endif //_CLOCK_UTILS_THEME_MANAGER_H_
index f2624631eb68c722f038bc1a48cff4dab02e7e8b..8997d2e693a3a6eba08fe7e649b11fefa64ee295 100644 (file)
 
 namespace utils {
 
-class Translate {
-public:
-
        /**
-        * @brief Returns string with translation dependent on local language
-        *              in singular form.
-        *
-        * Function gets message id set up in po file and returns string
-        * in currently set language.
-        *
-        * @param[in] msgid The id of the text set up in po files.
-        * @param[in] ... Arguments for the format.
+        * @brief Translate static class
         *
-        * @return String of the text in local language.
+        * This class provides methods handling translations.
         */
-       static std::string Sprintf(const char *msgid, ...);
+       class Translate {
+       public:
 
-       /**
-        * @brief Returns string with translation dependent on local language
-        *              in singular or plural form.
-        *
-        * Function gets message id of the singular set up in po file and
-        * returns string in currently set language with variadic number
-        * of arguments and form dependent on count number.
-        *
-        * @param[in] count Value the form depends on.
-        * @param[in] singularForm The id of the singular form.
-        * @param[in] pluralForm The id of the plural form.
-        * @param[in] ... Arguments for the format.
-        *
-        * @return String of the text in local language..
-        */
-       static std::string Sprintf(int count, const char *singularForm, const char *pluralForm, ...);
+               /**
+                * @brief Returns string with translation dependent on local language
+                *              in singular form.
+                *
+                * Function gets message id set up in po file and returns string
+                * in currently set language.
+                *
+                * @param[in] msgid The id of the text set up in po files.
+                * @param[in] ... Arguments for the format.
+                *
+                * @return String of the text in local language.
+                */
+               static std::string Sprintf(const char *msgid, ...);
+
+               /**
+                * @brief Returns string with translation dependent on local language
+                *              in singular or plural form.
+                *
+                * Function gets message id of the singular set up in po file and
+                * returns string in currently set language with variadic number
+                * of arguments and form dependent on count number.
+                *
+                * @param[in] count Value the form depends on.
+                * @param[in] singularForm The id of the singular form.
+                * @param[in] pluralForm The id of the plural form.
+                * @param[in] ... Arguments for the format.
+                *
+                * @return String of the text in local language..
+                */
+               static std::string Sprintf(int count, const char *singularForm, const char *pluralForm, ...);
 
-private:
-       Translate() {};
-};
+       private:
+               Translate() {};
+       };
 }
 
 #endif //_CLOCK_UTILS_TRANSLATOR_H_
index 73114669f3e44e2ddb5b829e1bd85d2e649264b6..0ff24feeb592c482bd6cff2a029e789fb4c9dc0e 100644 (file)
@@ -23,6 +23,9 @@
 
 namespace view {
 
+       /**
+        * @brief Counter's type enum
+        */
        enum class CounterType {
                COUNTER_TYPE_STOPWATCH,
                COUNTER_TYPE_STOPWATCH_EXPANDED,
@@ -31,22 +34,72 @@ namespace view {
                COUNTER_TYPE_HIDDEN
        };
 
+       /**
+        * @brief Counter's view class
+        *
+        * Class displays ui view of the counter, changes its values during running state,
+        * and responds on user's activities.
+        */
        class CounterView : public ui::IView {
        public:
                CounterView(ui::IView &parent, CounterType type = CounterType::COUNTER_TYPE_STOPWATCH);
                ~CounterView();
 
+               /**
+                * @brief Gets Evas_Object of the CounterView
+                *
+                * @return Counter's view Evas_Object
+                */
                Evas_Object *GetEvasObject(void);
 
+               /**
+                * @brief Sets counters time to be displayed
+                *
+                * @param[in] hour The hour to be set
+                * @param[in] min The minute to be set
+                * @param[in] sec The second to be set
+                * @param[in] msec The millisecond to be set, 0 by default
+                */
                void DisplayTime(int hour, int min, int sec, int msec = 0);
 
+               /**
+                * @brief Shows counter's view
+                */
                void Show(void);
+
+               /**
+                * @brief Hides counter's view
+                */
                void Hide(void);
 
+               /**
+                * @brief Expands counter's view
+                *
+                * Whenever counter reaches time above 59 minutes 59 seconds and 59 milliseconds,
+                * the counter's view is expanded to show the hours.
+                */
                void Expand(void);
+
+               /**
+                * @brief Contracts counter's view
+                *
+                * Whenever counter reaches time below 1 hour, the counter's view is contracted
+                * and hours are not displayed anymore.
+                */
                void Contract(void);
+
+               /**
+                * @brief Resets counter's time value
+                *
+                * This method sets counter's view time value to 00:00:00.
+                */
                void Reset(void);
 
+               /**
+                * @brief Gets counter's visibility status
+                *
+                * @return true if counter's view is visible, otherwise false
+                */
                bool IsVisible(void);
        private:
                Evas_Object *layout_;
index a9a9e393de35a7eca5c3d93d772abe79861dccae..4e1b2492804a79e79bffbe962d6d815e8ce9dbe4 100644 (file)
@@ -25,6 +25,9 @@
 
 namespace view {
 
+       /**
+        * @brief Ring view signal type
+        */
        enum class RingSignal {
                BUTTON_DISMISS_CLICKED,
                BUTTON_SNOOZE_CLICKED,
@@ -32,6 +35,12 @@ namespace view {
                MAX,
        };
 
+       /**
+        * @brief Ring's view class
+        *
+        * Class creates and displays ring alarm view that shows incoming alarm's
+        * major information and provides dismiss and snooze options for user.
+        */
        class RingView : public ui::IView {
        public:
                /**
@@ -106,44 +115,48 @@ namespace view {
                void PlayMusic(const char *uri, double volume);
 
                /**
-                * @brief Stops the currently playing music and destroys created with PlayMusic
-                *      sound stream. After music is stopped, to play it againg it is necessary
-                *      to call PlayMusic method.
+                * @brief Stops currently playing music
+                *
+                * Stops the currently playing music and destroys created with PlayMusic
+                * sound stream. After music is stopped, to play it againg it is necessary
+                * to call PlayMusic method.
                 */
                void StopMusic(void);
 
                /**
-                * @brief Pauses the currently playing music without destroying sound stream.
+                * @brief Pauses the currently playing music without destroying sound stream
                 */
                void PauseMusic(void);
 
                /**
-                * @brief Resumes paused music.
+                * @brief Resumes paused music
                 */
                void ResumeMusic(void);
 
                /**
-                * @brief Starts device vibration.
+                * @brief Starts device vibration
                 */
                void StartVibration(void);
 
                /**
-                * @brief Stops device vibration.
+                * @brief Stops device vibration
                 */
                void StopVibration(void);
 
                /**
-                * @brief Destroys and zeroes player handler.
+                * @brief Destroys and zeroes player handler
                 */
                void DestroyPlayer(void);
 
                /**
-                * @brief Destroys and zeroes stream info handler.
+                * @brief Destroys and zeroes stream info handler
                 */
                void DestroyStreamInfo(void);
 
                /**
-                * @brief Returns the Evas_Object of the view.
+                * @brief Returns the Evas_Object of the view
+                *
+                * @return View's Evas_Object
                 */
                Evas_Object *GetEvasObject();
 
index e95051ebf5cfc19212226be09180dab38827df0c..1e8bca4e19a93813718521b59611fa3a438006b4 100644 (file)
@@ -30,6 +30,9 @@
 
 namespace view {
 
+       /**
+        * @brief StopWatch signal type
+        */
        enum class Signal {
                BUTTON_START_CLICKED,
                BUTTON_STOP_CLICKED,
@@ -39,13 +42,47 @@ namespace view {
                MAX
        };
 
+       /**
+        * @brief Lap class
+        *
+        * Class helper for StopWatch view that stores displayed information
+        * about laps (list number, split time and lap time).
+        */
        class Lap {
        public:
+               /**
+                * @brief Lap constructor
+                *
+                * @param[in] no The number of the lap in the list
+                * @param[in] splitTime The lap's split time
+                * @param[in] lapTime The lap's time
+                */
                Lap(const char *no, const char *splitTime, const char *lapTime);
+
+               /**
+                * @brief Lap destructor
+                */
                ~Lap();
 
+               /**
+                * @brief Gets lap's list number
+                *
+                * @return Lap's list number string
+                */
                char *GetNo(void) {return No_; };
+
+               /**
+                * @brief Gets lap's split time
+                *
+                * @return Lap's split time string
+                */
                char *GetSplitTime(void) {return split_time_; };
+
+               /**
+                * @brief Gets lap's time
+                *
+                * @return Lap's time string
+                */
                char *GetLapTime(void) {return lap_time_; };
 
        private:
@@ -54,27 +91,118 @@ namespace view {
                char *lap_time_;
        };
 
+       /**
+        * @brief Stopwatch view class
+        *
+        * Class displays Stopwatch view for user interaction. Allows to run, stop,
+        * resume and record lap in its lap list.
+        */
        class StopWatchView : public ui::IView {
        public:
+               /**
+                * @brief StopWatchView constructor
+                *
+                * @param[in] main The parent's view
+                */
                StopWatchView(ui::IView &main);
+
+               /**
+                * @brief StopWatchView desctructor
+                */
                ~StopWatchView();
 
+               /**
+                * @brief Gets StopWatchView Evas_Object
+                *
+                * @return Evas_Object of the view
+                */
                Evas_Object *GetEvasObject(void);
 
+               /**
+                * @brief Registers StopWatchView callbacks
+                *
+                * @param[in] func The callback
+                * @param[in] type The type of the signal
+                */
                void RegisterSignal(std::function<void(void)>func, Signal type);
 
+               /**
+                * @brief Shows running menu
+                *
+                * This method shows running menu with buttons
+                * Stop and Lap.
+                */
                void ShowRunningMenu(void);
+
+               /**
+                * @brief Shows stopped menu
+                *
+                * This method shows stopped menu with buttons
+                * Resume and Reset.
+                */
                void ShowStoppedMenu(void);
+
+               /**
+                * @brief Shows startup menu
+                *
+                * This method shows startup menu with button Start
+                */
                void ShowStartupMenu(void);
 
+               /**
+                * @brief Adds lap into the lap list
+                *
+                * @param[in] no The number of lap in the list
+                * @param[in] splitTime The split time of the lap
+                * @param[in] lapTime The lap's time
+                */
                void AddLap(const char *no, const char *splitTime, const char *lapTime);
+
+               /**
+                * @brief Hides lap list
+                */
                void HideList(void);
+
+               /**
+                * @brief Shows lap list
+                */
                void ShowList(void);
 
+               /**
+                * @brief Displays time
+                *
+                * This method displays time in the main counter view.
+                *
+                * @param[in] hour The hour to be displayed
+                * @param[in] minute The minute to be displayed
+                * @param[in] second The second to be displayed
+                * @param[in] millisecond The millisecond to be displayed
+                */
                void DisplayTime(unsigned hour, unsigned minute, unsigned second, unsigned millisecond);
+
+               /**
+                * @brief Displays current lap time
+                *
+                * This method displays time in the lap time counter view.
+                *
+                * @param[in] hour The hour to be displayed
+                * @param[in] minute The minute to be displayed
+                * @param[in] second The second to be displayed
+                * @param[in] millisecond The millisecond to be displayed
+                */
                void DisplayLapTime(unsigned hour, unsigned minute, unsigned second, unsigned millisecond);
+
+               /**
+                * @brief Shows max records reached popup
+                *
+                * Shows popup warning about maximum number of records
+                * in lap list have been reached.
+                */
                void ShowMaxRecordsReachedPopup();
 
+               /**
+                * @brief The maximum lap list records count
+                */
                static const unsigned MAX_LAPS_RECORDS = 999;
 
        private:
index a4cca92bb7b0760aa0aab7526be0ac2c86f5591e..ae185342139131d718805b63777296f339ec550d 100644 (file)
@@ -29,6 +29,9 @@
 
 namespace view {
 
+       /**
+        * @brief Timer's signal type
+        */
        enum class TimerSignal {
                BUTTON_HOUR_INCREASE_CLICKED,
                BUTTON_MINUTE_INCREASE_CLICKED,
@@ -50,27 +53,110 @@ namespace view {
                MAX,
        };
 
+       /**
+        * @brief Timer's view class
+        *
+        * Class displays timer's view for user interaction with backend.
+        * Provides features such as setting timer's time, running, stopping and
+        * resuming timer.
+        */
        class TimerView : public ui::IView {
        public:
 
+               /**
+                * @brief TimerView constructor
+                *
+                * @param[in] main The parent's view
+                */
                TimerView(ui::IView &main);
                ~TimerView();
 
+               /**
+                * @brief Gets TimerView Evas_Object
+                *
+                * @return Evas_Object of the view
+                */
                Evas_Object *GetEvasObject();
 
+               /**
+                * @brief Registers TimerView callback
+                *
+                * @param[in] func The function to be called
+                * @param[in] type The type of the signal on which callback is called
+                */
                void RegisterSignal(std::function<void(void)>func, TimerSignal type);
 
+               /**
+                * @brief Enables Start button
+                *
+                * When time selector's time is set to 00:00:00 which is default value,
+                * the Start button is disabled. This might be changed whenever this
+                * value changes.
+                *
+                * @param[in] enable The enable flag
+                */
                void SetEnabledStartButton(bool enable);
+
+               /**
+                * @brief Displays time in counter's view
+                *
+                * @param[in] hour The hour to be set
+                * @param[in] min The minute to be set
+                * @param[in] sec The second to be set
+                */
                void DisplayTime(int hour, int min, int sec);
 
+               /**
+                * @brief Gets currently set time
+                *
+                * @param[in] hour The hour to be set
+                * @param[in] minute The minute to be set
+                * @param[in] second The second to be set
+                */
                void GetTime(int *hour, int *minute, int *second);
 
+               /**
+                * @brief Shows startup menu
+                *
+                * This method shows startup menu with Start and Reset button.
+                */
                void ShowStartupMenu(void);
+
+               /**
+                * @brief Shows running menu
+                *
+                * This method shows running menu with Pause and Cancel button.
+                */
                void ShowRunningMenu(void);
+
+               /**
+                * @brief Shows paused menu
+                *
+                * This method shows paused menu with Resume and Cancel button.
+                */
                void ShowPausedMenu(void);
+
+               /**
+                * @brief Shows editing menu
+                *
+                * This method shows editing menu with Start and Reset button.
+                */
                void ShowEditingMenu(void);
 
+               /**
+                * @brief Shows time selector
+                *
+                * During time editing the time selector is shown and timer's counter
+                * hidden.
+                */
                void ShowSelector();
+
+               /**
+                * @brief Shows time counter
+                *
+                * Whenever timer is running it's counter should be shown and time
+                * selector hidden.
+                */
                void ShowCounter();
 
        private:
index aa2c6f6c1505b9077358b0a0b4ba655b94fef2f9..1cbb99fb981bdc3c31dc2c79506c03fdf050a7ad 100644 (file)
 
 namespace view {
 
-class WorldClockMap : public ui::IView {
-public:
-
-       Evas_Object *GetEvasObject();
-       WorldClockMap(ui::IView &parent);
-       ~WorldClockMap();
-
-private:
-
-       Evas_Object *map_;
-       Evas_Object *scroller_;
-       Evas_Object *line_scroller_;
-       Evas_Object *shadow_;
-       Evas_Object *line_;
-       Ecore_Timer *timer_;
-
-       cairo_t *line_cairo_;
-       cairo_surface_t *line_surface_;
-
-       cairo_t *shadow_cairo_;
-       cairo_surface_t *shadow_surface_;
-
-       int mapX = -1, mapY = -1, mapW = -1, mapH = -1;
-       int currentYDay = -1;
-
-       static const int LATITUDE_RESOLUTION_ = 181;
-       std::vector<int> day_times_ = std::vector<int>(LATITUDE_RESOLUTION_, 0);
-
-       /**
-        * @brief Returns today's sun declination angle.
-        *
-        * During the Earth movement, sun's position on the horizon
-        * changes from -23.44 to +23.44 degree. This value stores the
-        * angle for current day.
-        *
-        * @param now Current time structure.
-        *
-        * @return Sun declination angle in degrees.
-        *
-        * @note Returned value is double so for example 21o15' is
-        *      21.25 in floating point value.
-        */
-       double SunDeclination(std::tm now);
-
        /**
-        * @brief Returns angle of the time where currently is day.
+        * @brief Worldclock map view class
         *
-        * @param latitude The latitude
-        * @param declination The sun declination of current day.
-        *
-        * @return Angle in degrees.
-        *
-        * @see GetSunDeclination()
-        */
-       double TimeAngle(int latitude, double declination);
-
-       /**
-        * @brief Requests for map update.
-        *
-        */
-       void MapUpdate();
-
-       /**
-        * @brief Draws night shadow with day/night line.
-        *
-        * @param now The current time structure
-        * @param declination The declination of the current day
-        *
-        * @return True on success, false on failure.
-        */
-       bool ShadowCreate(std::tm now, double declination);
-
-       /**
-        * @brief Creates night shadow.
+        * Class creates map view and responds on local time or current time change.
+        * It displays map with day and night line and colors underlying map into
+        * light and shadow color depending on time of the day.
         */
-       void ShadowDraw();
-
-       /**
-        * @brief Creates day/night line.
-        */
-       void LineDraw();
-
-       /**
-        * @brief Creates scroller for night shadow.
-        */
-       void ShadowScrollerCreate();
-
-       /**
-        * @brief Creates scroller for day/night line.
-        */
-       void LineScrollerCreate();
-
-       /**
-        * @brief Creates scroller.
-        *
-        * @param part The parent's swallow part.
-        *
-        * @return The Evas_Object of created scroller.
-        */
-       Evas_Object *ScrollerCreate();
-
-       /**
-        * @brief Changes scroller's visible area position.
-        *
-        * @param minutes The move offset
-        */
-       void ShadowMove(int minutes);
-
-       /**
-        * @brief Task to be done on particular time update request.
-        */
-       static Eina_Bool TimerCb(void *data);
-
-       /**
-        * @brief Callback called on properly shown map image.
-        */
-       static void ScrollerResizeCb(void *data, Evas *e, Evas_Object *obj, void *event_info);
-
-       /**
-        * @brief Callback called on time or timezone change.
-        */
-       static void TimeChangedCb(system_settings_key_e key, void *user_data);
-
-};
+       class WorldClockMap : public ui::IView {
+       public:
+
+               /**
+                * @brief Gets view's Evas_Object
+                *
+                * @return Evas_Object of the view
+                */
+               Evas_Object *GetEvasObject();
+
+               /**
+                * @brief WorldClockMap constructor
+                *
+                * @parm[in] parent The parent of the map
+                */
+               WorldClockMap(ui::IView &parent);
+               ~WorldClockMap();
+
+       private:
+
+               Evas_Object *map_;
+               Evas_Object *scroller_;
+               Evas_Object *line_scroller_;
+               Evas_Object *shadow_;
+               Evas_Object *line_;
+               Ecore_Timer *timer_;
+
+               cairo_t *line_cairo_;
+               cairo_surface_t *line_surface_;
+
+               cairo_t *shadow_cairo_;
+               cairo_surface_t *shadow_surface_;
+
+               int mapX = -1, mapY = -1, mapW = -1, mapH = -1;
+               int currentYDay = -1;
+
+               static const int LATITUDE_RESOLUTION_ = 181;
+               std::vector<int> day_times_ = std::vector<int>(LATITUDE_RESOLUTION_, 0);
+
+               /**
+                * @brief Returns today's sun declination angle.
+                *
+                * During the Earth movement, sun's position on the horizon
+                * changes from -23.44 to +23.44 degree. This value stores the
+                * angle for current day.
+                *
+                * @param now Current time structure.
+                *
+                * @return Sun declination angle in degrees.
+                *
+                * @note Returned value is double so for example 21 degrees and 15 minutes is
+                *      21.25 in floating point value.
+                */
+               double SunDeclination(std::tm now);
+
+               /**
+                * @brief Returns angle of the time where currently is day.
+                *
+                * @param latitude The latitude
+                * @param declination The sun declination of current day.
+                *
+                * @return Angle in degrees.
+                *
+                * @see GetSunDeclination()
+                */
+               double TimeAngle(int latitude, double declination);
+
+               /**
+                * @brief Requests for map update.
+                *
+                */
+               void MapUpdate();
+
+               /**
+                * @brief Draws night shadow with day/night line.
+                *
+                * @param now The current time structure
+                * @param declination The declination of the current day
+                *
+                * @return True on success, false on failure.
+                */
+               bool ShadowCreate(std::tm now, double declination);
+
+               /**
+                * @brief Creates night shadow.
+                */
+               void ShadowDraw();
+
+               /**
+                * @brief Creates day/night line.
+                */
+               void LineDraw();
+
+               /**
+                * @brief Creates scroller for night shadow.
+                */
+               void ShadowScrollerCreate();
+
+               /**
+                * @brief Creates scroller for day/night line.
+                */
+               void LineScrollerCreate();
+
+               /**
+                * @brief Creates scroller.
+                *
+                * @param part The parent's swallow part.
+                *
+                * @return The Evas_Object of created scroller.
+                */
+               Evas_Object *ScrollerCreate();
+
+               /**
+                * @brief Changes scroller's visible area position.
+                *
+                * @param minutes The move offset
+                */
+               void ShadowMove(int minutes);
+
+               /**
+                * @brief Task to be done on particular time update request.
+                */
+               static Eina_Bool TimerCb(void *data);
+
+               /**
+                * @brief Callback called on properly shown map image.
+                */
+               static void ScrollerResizeCb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+
+               /**
+                * @brief Callback called on time or timezone change.
+                */
+               static void TimeChangedCb(system_settings_key_e key, void *user_data);
+
+       };
 
 }