[4.0] (VectorAnimationRenderer) Add SetSize method
[platform/core/uifw/dali-adaptor.git] / adaptors / devel-api / adaptor-framework / lifecycle-controller.h
1 #ifndef __DALI_LIFECYCLE_CONTROLLER_H__
2 #define __DALI_LIFECYCLE_CONTROLLER_H__
3
4 /*
5  * Copyright (c) 2015 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 // EXTERNAL INCLUDES
22 #include <dali/public-api/object/base-handle.h>
23 #include <dali/public-api/signals/dali-signal.h>
24
25 namespace Dali
26 {
27
28 namespace Internal DALI_INTERNAL
29 {
30 namespace Adaptor
31 {
32 class LifecycleController;
33 }
34 }
35
36 /**
37  * @brief Provides application lifecycle events.
38  *
39  * Connect to the signals of this class to receive notification of events in the lifecycle
40  * of the application. The following example shows how to connect to the Init signal. This
41  * could be done for example in the constructor of a singleton that is known to be created
42  * at startup.
43  *
44  * @code
45  * void MyClass::MyClass()
46  * {
47  *   LifecycleController::Get().InitSignal().Connect( this, &MyClass::OnApplicationInit );
48  * }
49  *
50  * void MyClass::OnApplicationInit()
51  * {
52  *   // ... Do something on init
53  * }
54  * @endcode
55  */
56 class DALI_IMPORT_API LifecycleController : public BaseHandle
57 {
58 public: // Typedefs
59
60   typedef Signal< void (void) > LifecycleSignalType;   ///< Lifecycle Signal type
61
62 public: // Creation & Destruction
63
64   /**
65    * @brief Create an uninitialized LifecycleController handle.
66    *
67    * Calling member functions when uninitialized is not allowed.
68    */
69   LifecycleController();
70
71   /**
72    * @brief Creates a copy of the handle.
73    *
74    * The copy will point to the same implementation as the original.
75    * @param[in]  monitor  The LifecycleController to copy from.
76    */
77   LifecycleController(const LifecycleController& monitor);
78
79   /**
80    * @brief Retrieve the initialized instance of the LifecycleController.
81    * @return Handle to LifecycleController.
82    */
83   static LifecycleController Get();
84
85   /**
86    * @brief Destructor
87    *
88    * This is non-virtual since derived Handle types must not contain data or virtual methods.
89    */
90   ~LifecycleController();
91
92 public: // Signals
93
94   /**
95    * The user should connect to this signal to determine when they should initialise
96    * their application.
97    */
98   LifecycleSignalType& InitSignal();
99
100   /**
101    * The user should connect to this signal to determine when they should terminate
102    * their application
103    */
104   LifecycleSignalType& TerminateSignal();
105
106   /**
107    * The user should connect to this signal if they need to perform any special
108    * activities when the application is about to be paused.
109    */
110   LifecycleSignalType& PauseSignal();
111
112   /**
113    * The user should connect to this signal if they need to perform any special
114    * activities when the application has resumed.
115    */
116   LifecycleSignalType& ResumeSignal();
117
118   /**
119    * This signal is sent when the system requires the user to reinitialise itself.
120    */
121   LifecycleSignalType& ResetSignal();
122
123   /**
124    * This signal is emitted when the window the application is rendering on is resized.
125    */
126   LifecycleSignalType& ResizeSignal();
127
128   /**
129    * This signal is emitted when the language is changed on the device.
130    */
131   LifecycleSignalType& LanguageChangedSignal();
132
133 public: // Operators
134
135   /**
136    * @brief Assignment operator.
137    *
138    * The handle points to the same implementation as the one being copied from.
139    * @param[in]  controller  The LifecycleController to copy from.
140    * @return reference to this object
141    */
142   LifecycleController& operator=(const LifecycleController& controller);
143
144 public: // Not intended for application developers
145   /**
146    * @brief This constructor is used internally to create a handle from an object pointer.
147    * @param [in] lifecycleController A pointer to the internal LifecycleController.
148    */
149   explicit DALI_INTERNAL LifecycleController(Internal::Adaptor::LifecycleController* lifecycleController);
150 };
151
152 } // namespace Dali
153
154 #endif // __DALI_LIFECYCLE_CONTROLLER_H__