X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fcommon%2Fframework.h;h=6037d57ec15f63a914def71e266564841651fac3;hb=f26a828765b20d4d53a8b899b127cc75bab9f9ff;hp=aca0ec81d1c7b0e4f822b3ae373164e761187355;hpb=1b538ffac8f1c2d6c14e29438bcfd84040da3d25;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/common/framework.h b/adaptors/common/framework.h index aca0ec8..6037d57 100644 --- a/adaptors/common/framework.h +++ b/adaptors/common/framework.h @@ -2,7 +2,7 @@ #define __DALI_INTERNAL_FRAMEWORK_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,9 +21,12 @@ // EXTERNAL INCLUDES #include #include +#ifdef APPCORE_WATCH_AVAILABLE +#include "wearable/watch/watch-application.h" +#endif // INTERNAL INCLUDES -#include "abort-handler.h" +#include namespace Dali { @@ -35,13 +38,21 @@ namespace Adaptor { /** - * The Framework class is used to register callbacks with the TIZEN platform so that + * The Framework class is ideally placed to provide key API required by Applications. + * + * The class is also used to register callbacks with the TIZEN platform so that * we know when any of the application lifecycle events occur. This includes events * like when our application is to be initialised, terminated, paused, resumed etc. + * */ class Framework { public: + enum Type + { + NORMAL, ///< normal appFramework + WATCH ///< watch appFramework + }; /** * Observer class for the framework. @@ -81,6 +92,23 @@ public: */ virtual void OnAppControl(void *) {} +#ifdef APPCORE_WATCH_AVAILABLE + /** + * Invoked at every second + */ + virtual void OnTimeTick(WatchTime&) {} + + /** + * Invoked at every second in ambient mode + */ + virtual void OnAmbientTick(WatchTime&) {} + + /** + * Invoked when the device enters or exits ambient mode + */ + virtual void OnAmbientChanged(bool ambient) {} +#endif + /** * Invoked when the language of the device is changed. */ @@ -100,7 +128,6 @@ public: * Invoked when the memory level of the device is low. */ virtual void OnMemoryLow() {} - }; public: @@ -110,8 +137,9 @@ public: * @param[in] observer The observer of the Framework. * @param[in] argc A pointer to the number of arguments. * @param[in] argv A pointer the the argument list. + * @param[in] type The type of application */ - Framework(Observer& observer, int* argc, char ***argv, const std::string& name); + Framework( Observer& observer, int* argc, char ***argv, Type type = NORMAL ); /** * Destructor @@ -154,6 +182,11 @@ public: */ std::string GetBundleId() const; + /** + * Gets the path at which application resources are stored. + */ + static std::string GetResourcePath(); + private: // Undefined @@ -161,12 +194,18 @@ private: Framework& operator=(Framework&); private: + + /** + * Called when the application is created. + */ + bool Create(); + /** * Called by the App framework when an application lifecycle event occurs. - * @param[in] type The type of event occurred. + * @param[in] type The type of event occurred. * @param[in] bundleData The bundle data of event occurred. */ - bool AppStatusHandler(int type, void *bundleData); + bool AppStatusHandler(int type, void *bundleData); /** * Called app_reset callback was called with bundle. @@ -194,7 +233,6 @@ private: bool mRunning; int* mArgc; char*** mArgv; - std::string mName; std::string mBundleName; std::string mBundleId; AbortHandler mAbortHandler; @@ -203,7 +241,6 @@ private: // impl members struct Impl; Impl* mImpl; - }; } // namespace Adaptor