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 <wearable/watch/watch-application.h>
23 #include <application-impl.h>
35 class WatchApplication;
36 typedef IntrusivePtr<WatchApplication> WatchApplicationPtr;
38 enum WatchApplicationState
42 RESUMED = INITIALIZED,
47 * Implementation of the WatchApplication class.
49 class WatchApplication : public Application
52 typedef Dali::WatchApplication::WatchTimeSignal WatchTimeSignal;
53 typedef Dali::WatchApplication::WatchBoolSignal WatchBoolSignal;
57 * @param[in] argc A pointer to the number of arguments
58 * @param[in] argv A pointer to the argument list
59 * @param[in] stylesheet The path to user defined theme file
60 * @param[in] windowMode A member of Dali::Watch::WINDOW_MODE
62 static WatchApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
66 * @param[in] argc A pointer to the number of arguments
67 * @param[in] argv A pointer to the argument list
68 * @param[in] stylesheet The path to user defined theme file
69 * @param[in] windowMode A member of Dali::Watch::WINDOW_MODE
71 WatchApplication( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
76 virtual ~WatchApplication();
79 * Called when the framework is initialised.
81 virtual void OnInit();
84 * Called when the framework is terminated.
86 virtual void OnTerminate();
89 * Called when the framework is paused.
91 virtual void OnPause();
94 * Called when the framework resumes from a paused state.
96 virtual void OnResume();
101 void OnTimeTick(WatchTime& time);
104 * Called every second in ambient mode
106 void OnAmbientTick(WatchTime& time);
109 * Called when the device enters or exits ambient mode
111 void OnAmbientChanged(bool ambient);
115 // @brief Undefined copy constructor.
116 WatchApplication( const WatchApplication& );
118 // @brief Undefined assignment operator.
119 WatchApplication& operator=( const WatchApplication& );
124 WatchTimeSignal mTickSignal;
125 WatchTimeSignal mAmbientTickSignal;
126 WatchBoolSignal mAmbientChangeSignal;
129 WatchApplicationState mState;
132 inline WatchApplication& GetImplementation(Dali::WatchApplication& watch)
134 DALI_ASSERT_ALWAYS(watch && "watch handle is empty");
136 BaseObject& handle = watch.GetBaseObject();
138 return static_cast<Internal::Adaptor::WatchApplication&>(handle);
141 inline const WatchApplication& GetImplementation(const Dali::WatchApplication& watch)
143 DALI_ASSERT_ALWAYS(watch && "Time handle is empty");
145 const BaseObject& handle = watch.GetBaseObject();
147 return static_cast<const Internal::Adaptor::WatchApplication&>(handle);
151 } // namespace Adaptor
153 } // namespace Internal
157 #endif // __DALI_INTERNAL_WATCH_APPLICATION_H__