1 #ifndef DALI_INTEGRATION_ANDROID_FRAMEWORK_IMPL_H
2 #define DALI_INTEGRATION_ANDROID_FRAMEWORK_IMPL_H
5 * Copyright (c) 2019 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 <dali/integration-api/adaptor-framework/android/android-framework.h>
25 #include <dali/internal/adaptor/common/framework.h>
36 /// Android application events
39 APP_WINDOW_CREATED = 0,
49 * AndroidFramework implementation to set/get Android native interfaces for Android Adaptor.
50 * Also passes Android application events to Android Adaptor internal framework.
52 class AndroidFramework
56 * @brief Create a new Android framework.
58 * @return a reference to the Android framework
60 static Dali::Integration::AndroidFramework& New();
63 * @brief Delete an Android framework.
68 * @copydoc Dali::Integration::AndroidFramework::SetNativeApplication()
70 void SetNativeApplication( android_app* application );
73 * @copydoc Dali::Integration::AndroidFramework::GetNativeApplication()
75 android_app* GetNativeApplication() const;
78 * @copydoc Dali::Integration::AndroidFramework::SetJVM()
80 void SetJVM( JavaVM* jvm );
83 * @copydoc Dali::Integration::AndroidFramework::GetJVM()
85 JavaVM* GetJVM() const;
88 * @copydoc Dali::Integration::AndroidFramework::SetApplicationAssets()
90 void SetApplicationAssets( AAssetManager* assets );
93 * @copydoc Dali::Integration::AndroidFramework::GetApplicationAssets()
95 AAssetManager* GetApplicationAssets() const;
98 * copydoc Dali::Integration::AndroidFramework::SetInternalDataPath()
100 void SetInternalDataPath( const std::string& path );
103 * copydoc Dali::Integration::AndroidFramework::GetInternalDataPath()
105 std::string GetInternalDataPath() const;
108 * @copydoc Dali::Integration::AndroidFramework::SetApplicationConfiguration()
110 void SetApplicationConfiguration( AConfiguration* configuration );
113 * @copydoc Dali::Integration::AndroidFramework::GetApplicationConfiguration()
115 AConfiguration* GetApplicationConfiguration() const;
118 * @copydoc Dali::Integration::AndroidFramework::SetApplicationWindow()
120 void SetApplicationWindow( ANativeWindow* window );
123 * @copydoc Dali::Integration::AndroidFramework::GetApplicationWindow()
125 ANativeWindow* GetApplicationWindow() const;
128 * @copydoc Dali::Integration::AndroidFramework::OnTerminate()
133 * @copydoc Dali::Integration::AndroidFramework::OnPause()
138 * @copydoc Dali::Integration::AndroidFramework::OnResume()
143 * @copydoc Dali::Integration::AndroidFramework::OnWindowCreated()
145 void OnWindowCreated( ANativeWindow* window );
148 * @copydoc Dali::Integration::AndroidFramework::OnWindowDestroyed()
150 void OnWindowDestroyed( ANativeWindow* window );
153 * @copydoc Dali::Integration::AndroidFramework::Get()
155 static Dali::Integration::AndroidFramework& Get();
158 * @brief Sets an internal framework.
160 void SetFramework( Framework* framework ) { mFramework = framework; }
163 * @brief Gets an internal framework.
165 * @return a pointer to the internal framework
167 Framework* GetFramework() { return mFramework; }
170 * Virtual destructor.
172 virtual ~AndroidFramework();
174 // Not copyable or movable
175 AndroidFramework( const AndroidFramework& ) = delete; ///< Deleted copy constructor
176 AndroidFramework( AndroidFramework&& ) = delete; ///< Deleted move constructor
177 AndroidFramework& operator=( const AndroidFramework& ) = delete; ///< Deleted copy assignment operator
178 AndroidFramework& operator=( AndroidFramework&& ) = delete; ///< Deleted move assignment operator
181 AndroidFramework( Dali::Integration::AndroidFramework* androidFramework );
182 Dali::Integration::AndroidFramework* mAndroidFramework;
183 Framework* mFramework;
185 android_app* mNativeApplication;
186 ANativeWindow* mWindow;
187 AAssetManager* mAssets;
188 std::string mInternalDataPath;
189 AConfiguration* mConfiguration;
193 static AndroidFramework& GetImplementation( Dali::Integration::AndroidFramework& androidFramework ) { return *androidFramework.mImpl; }
194 static Framework& GetFramework( Dali::Integration::AndroidFramework& androidFramework ) { return *androidFramework.mImpl->mFramework; }
197 } // namespace Internal
199 } // namespace Adaptor
203 #endif // DALI_INTEGRATION_ANDROID_FRAMEWORK_IMPL_H