Merge branch 'tizen' into devel/new_mesh
[platform/core/uifw/dali-adaptor.git] / adaptors / public-api / adaptor-framework / application.cpp
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include "application.h"
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/debug.h>
23
24 // INTERNAL INCLUDES
25 #include <application-impl.h>
26
27 namespace Dali
28 {
29
30 Application Application::New()
31 {
32   return New( NULL, NULL );
33 }
34
35 Application Application::New( int* argc, char **argv[] )
36 {
37   Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, "", OPAQUE );
38   return Application(internal.Get());
39 }
40
41 Application Application::New( int* argc, char **argv[], const std::string& stylesheet )
42 {
43   Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, OPAQUE );
44   return Application(internal.Get());
45 }
46
47 Application Application::New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode )
48 {
49   Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode );
50   return Application(internal.Get());
51 }
52
53 Application::~Application()
54 {
55 }
56
57 Application::Application()
58 {
59 }
60
61 Application::Application(const Application& application)
62 : BaseHandle(application)
63 {
64 }
65
66 Application& Application::operator=(const Application& application)
67 {
68   if( *this != application )
69   {
70     BaseHandle::operator=( application );
71   }
72   return *this;
73 }
74
75 void Application::MainLoop()
76 {
77   Internal::Adaptor::GetImplementation(*this).MainLoop(Configuration::APPLICATION_HANDLES_CONTEXT_LOSS);
78 }
79
80 void Application::MainLoop(Configuration::ContextLoss configuration)
81 {
82   Internal::Adaptor::GetImplementation(*this).MainLoop(configuration);
83 }
84
85 void Application::Lower()
86 {
87   Internal::Adaptor::GetImplementation(*this).Lower();
88 }
89
90 void Application::Quit()
91 {
92   Internal::Adaptor::GetImplementation(*this).Quit();
93 }
94
95 bool Application::AddIdle( CallbackBase* callback )
96 {
97   return Internal::Adaptor::GetImplementation(*this).AddIdle( callback );
98 }
99
100 Window Application::GetWindow()
101 {
102   return Internal::Adaptor::GetImplementation(*this).GetWindow();
103 }
104
105 void Application::ReplaceWindow(PositionSize windowPosition, const std::string& name)
106 {
107   Internal::Adaptor::GetImplementation(*this).ReplaceWindow(windowPosition, name);
108 }
109
110 void Application::SetViewMode( ViewMode viewMode )
111 {
112   Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode );
113 }
114
115 ViewMode Application::GetViewMode() const
116 {
117   return Internal::Adaptor::GetImplementation(*this).GetViewMode();
118 }
119
120 void Application::SetStereoBase( float stereoBase )
121 {
122   Internal::Adaptor::GetImplementation(*this).SetStereoBase( stereoBase );
123 }
124
125 float Application::GetStereoBase() const
126 {
127   return Internal::Adaptor::GetImplementation(*this).GetStereoBase();
128 }
129
130 Application::AppSignalType& Application::InitSignal()
131 {
132   return Internal::Adaptor::GetImplementation(*this).InitSignal();
133 }
134
135 Application::AppSignalType& Application::TerminateSignal()
136 {
137   return Internal::Adaptor::GetImplementation(*this).TerminateSignal();
138 }
139
140 Application::AppSignalType& Application::PauseSignal()
141 {
142   return Internal::Adaptor::GetImplementation(*this).PauseSignal();
143 }
144
145 Application::AppSignalType& Application::ResumeSignal()
146 {
147   return Internal::Adaptor::GetImplementation(*this).ResumeSignal();
148 }
149
150 Application::AppSignalType& Application::ResetSignal()
151 {
152   return Internal::Adaptor::GetImplementation(*this).ResetSignal();
153 }
154
155 Application::AppSignalType& Application::ResizeSignal()
156 {
157   return Internal::Adaptor::GetImplementation(*this).ResizeSignal();
158 }
159
160 Application::AppControlSignalType & Application::AppControlSignal()
161 {
162   return Internal::Adaptor::GetImplementation(*this).AppControlSignal();
163 }
164
165 Application::AppSignalType& Application::LanguageChangedSignal()
166 {
167   return Internal::Adaptor::GetImplementation(*this).LanguageChangedSignal();
168 }
169
170 Application::AppSignalType& Application::RegionChangedSignal()
171 {
172   return Internal::Adaptor::GetImplementation(*this).RegionChangedSignal();
173 }
174
175 Application::AppSignalType& Application::BatteryLowSignal()
176 {
177   return Internal::Adaptor::GetImplementation(*this).BatteryLowSignal();
178 }
179
180 Application::AppSignalType& Application::MemoryLowSignal()
181 {
182   return Internal::Adaptor::GetImplementation(*this).MemoryLowSignal();
183 }
184
185 Application::Application(Internal::Adaptor::Application* application)
186 : BaseHandle(application)
187 {
188 }
189
190
191 } // namespace Dali