Refactor system classes
[platform/core/uifw/dali-adaptor.git] / dali / internal / system / windows / timer-impl-win.h
1 #ifndef DALI_INTERNAL_ADAPTOR_SYSTEM_WINDOWS_TIMER_H
2 #define DALI_INTERNAL_ADAPTOR_SYSTEM_WINDOWS_TIMER_H
3
4 /*
5  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/system/common/timer-impl.h>
23
24 namespace Dali
25 {
26 namespace Internal
27 {
28 namespace Adaptor
29 {
30 class TimerWin;
31
32 typedef IntrusivePtr<TimerWin> TimerWinPtr;
33
34 /**
35  * @brief TimerWin class provides an Timer Windows implementation.
36  */
37 class TimerWin : public Timer
38 {
39 public:
40   static TimerWinPtr New(uint32_t milliSec);
41
42   /**
43    * Constructor
44    * @param[in]  milliSec  Interval in milliseconds.
45    */
46   TimerWin(uint32_t milliSec);
47
48   /**
49    * Destructor.
50    */
51   virtual ~TimerWin();
52
53 public:
54   /**
55    * @copydoc Dali::Timer::Start()
56    */
57   void Start() override;
58
59   /**
60    * @copydoc Dali::Timer::Stop()
61    */
62   void Stop() override;
63
64   /**
65    * @copydoc Dali::Timer::Pause()
66    */
67   void Pause() override;
68
69   /**
70    * @copydoc Dali::Timer::Resume()
71    */
72   void Resume() override;
73
74   /**
75    * @copydoc Dali::Timer::SetInterval()
76    */
77   void SetInterval(uint32_t interval, bool restart) override;
78
79   /**
80    * @copydoc Dali::Timer::GetInterval()
81    */
82   uint32_t GetInterval() const override;
83
84   /**
85    * @copydoc Dali::Timer::IsRunning()
86    */
87   bool IsRunning() const override;
88
89   /**
90    * Tick
91    */
92   bool Tick();
93
94 private: // Implementation
95   // not implemented
96   TimerWin(const TimerWin&) = delete;
97   TimerWin& operator=(const TimerWin&) = delete;
98
99   /**
100    * Resets any stored timer data.
101    */
102   void ResetTimerData();
103
104 private: // Data
105   // To hide away implementation details
106   struct Impl;
107   Impl* mImpl;
108 };
109
110 } // namespace Adaptor
111
112 } // namespace Internal
113
114 } // namespace Dali
115
116 #endif // DALI_INTERNAL_ADAPTOR_SYSTEM_WINDOWS_TIMER_H