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;
39 * Implementation of the WatchApplication class.
41 class WatchApplication : public Application
44 typedef Dali::WatchApplication::WatchTimeSignal WatchTimeSignal;
45 typedef Dali::WatchApplication::WatchBoolSignal WatchBoolSignal;
49 * @param[in] argc A pointer to the number of arguments
50 * @param[in] argv A pointer to the argument list
51 * @param[in] stylesheet The path to user defined theme file
52 * @param[in] windowMode A member of Dali::Watch::WINDOW_MODE
54 static WatchApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
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 WatchApplication( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode );
68 virtual ~WatchApplication();
73 void OnTimeTick(WatchTime& time);
76 * Called every second in ambient mode
78 void OnAmbientTick(WatchTime& time);
81 * Called when the device enters or exits ambient mode
83 void OnAmbientChanged(bool ambient);
87 // @brief Undefined copy constructor.
88 WatchApplication( const WatchApplication& );
90 // @brief Undefined assignment operator.
91 WatchApplication& operator=( const WatchApplication& );
96 WatchTimeSignal mTickSignal;
97 WatchTimeSignal mAmbientTickSignal;
98 WatchBoolSignal mAmbientChangeSignal;
101 inline WatchApplication& GetImplementation(Dali::WatchApplication& watch)
103 DALI_ASSERT_ALWAYS(watch && "watch handle is empty");
105 BaseObject& handle = watch.GetBaseObject();
107 return static_cast<Internal::Adaptor::WatchApplication&>(handle);
110 inline const WatchApplication& GetImplementation(const Dali::WatchApplication& watch)
112 DALI_ASSERT_ALWAYS(watch && "Time handle is empty");
114 const BaseObject& handle = watch.GetBaseObject();
116 return static_cast<const Internal::Adaptor::WatchApplication&>(handle);
120 } // namespace Adaptor
122 } // namespace Internal
126 #endif // __DALI_INTERNAL_WATCH_APPLICATION_H__