1 #ifndef __DALI_INTERNAL_WATCH_APPLICATION_H__
2 #define __DALI_INTERNAL_WATCH_APPLICATION_H__
5 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/watch/watch-application.h>
23 #include <dali/internal/adaptor/common/application-impl.h>
35 class WatchApplication;
36 typedef IntrusivePtr<WatchApplication> WatchApplicationPtr;
38 enum WatchApplicationState
43 RESUMED = INITIALIZED,
48 * Implementation of the WatchApplication class.
50 class WatchApplication : public Application
53 typedef Dali::WatchApplication::WatchTimeSignal WatchTimeSignal;
54 typedef Dali::WatchApplication::WatchBoolSignal WatchBoolSignal;
58 * @param[in] argc A pointer to the number of arguments
59 * @param[in] argv A pointer to the argument list
60 * @param[in] stylesheet The path to user defined theme file
61 * @param[in] windowMode A member of Dali::Watch::WINDOW_MODE
63 static WatchApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
67 * @param[in] argc A pointer to the number of arguments
68 * @param[in] argv A pointer to the argument list
69 * @param[in] stylesheet The path to user defined theme file
70 * @param[in] windowMode A member of Dali::Watch::WINDOW_MODE
72 WatchApplication( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
77 virtual ~WatchApplication();
80 * Called when the framework is initialised.
82 virtual void OnInit();
85 * Called when the framework is terminated.
87 virtual void OnTerminate();
90 * Called when the framework is paused.
92 virtual void OnPause();
95 * Called when the framework resumes from a paused state.
97 virtual void OnResume();
100 * Called every second
102 void OnTimeTick(WatchTime& time);
105 * Called every second in ambient mode
107 void OnAmbientTick(WatchTime& time);
110 * Called when the device enters or exits ambient mode
112 void OnAmbientChanged(bool ambient);
116 // @brief Undefined copy constructor.
117 WatchApplication( const WatchApplication& );
119 // @brief Undefined assignment operator.
120 WatchApplication& operator=( const WatchApplication& );
125 WatchTimeSignal mTickSignal;
126 WatchTimeSignal mAmbientTickSignal;
127 WatchBoolSignal mAmbientChangeSignal;
130 WatchApplicationState mState;
133 inline WatchApplication& GetImplementation(Dali::WatchApplication& watch)
135 DALI_ASSERT_ALWAYS(watch && "watch handle is empty");
137 BaseObject& handle = watch.GetBaseObject();
139 return static_cast<Internal::Adaptor::WatchApplication&>(handle);
142 inline const WatchApplication& GetImplementation(const Dali::WatchApplication& watch)
144 DALI_ASSERT_ALWAYS(watch && "Time handle is empty");
146 const BaseObject& handle = watch.GetBaseObject();
148 return static_cast<const Internal::Adaptor::WatchApplication&>(handle);
152 } // namespace Adaptor
154 } // namespace Internal
158 #endif // __DALI_INTERNAL_WATCH_APPLICATION_H__