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 * @copydoc Dali::Integration::AndroidFramework::SetNativeApplication()
65 void SetNativeApplication( android_app* application );
68 * @copydoc Dali::Integration::AndroidFramework::GetNativeApplication()
70 android_app* GetNativeApplication() const;
73 * @copydoc Dali::Integration::AndroidFramework::SetJVM()
75 void SetJVM( JavaVM* jvm );
78 * @copydoc Dali::Integration::AndroidFramework::GetJVM()
80 JavaVM* GetJVM() const;
83 * @copydoc Dali::Integration::AndroidFramework::SetApplicationAssets()
85 void SetApplicationAssets( AAssetManager* assets );
88 * @copydoc Dali::Integration::AndroidFramework::GetApplicationAssets()
90 AAssetManager* GetApplicationAssets() const;
93 * @copydoc Dali::Integration::AndroidFramework::SetApplicationConfiguration()
95 void SetApplicationConfiguration( AConfiguration* configuration );
98 * @copydoc Dali::Integration::AndroidFramework::GetApplicationConfiguration()
100 AConfiguration* GetApplicationConfiguration() const;
103 * @copydoc Dali::Integration::AndroidFramework::SetApplicationWindow()
105 void SetApplicationWindow( ANativeWindow* window );
108 * @copydoc Dali::Integration::AndroidFramework::GetApplicationWindow()
110 ANativeWindow* GetApplicationWindow() const;
113 * @copydoc Dali::Integration::AndroidFramework::OnTerminate()
118 * @copydoc Dali::Integration::AndroidFramework::OnPause()
123 * @copydoc Dali::Integration::AndroidFramework::OnResume()
128 * @copydoc Dali::Integration::AndroidFramework::OnWindowCreated()
130 void OnWindowCreated( ANativeWindow* window );
133 * @copydoc Dali::Integration::AndroidFramework::OnWindowDestroyed()
135 void OnWindowDestroyed( ANativeWindow* window );
138 * @copydoc Dali::Integration::AndroidFramework::Get()
140 static Dali::Integration::AndroidFramework& Get();
143 * @brief Sets an internal framework.
145 void SetFramework( Framework* framework ) { mFramework = framework; }
148 * @brief Gets an internal framework.
150 * @return a pointer to the internal framework
152 Framework* GetFramework() { return mFramework; }
155 * Virtual destructor.
157 virtual ~AndroidFramework();
159 // Not copyable or movable
160 AndroidFramework( const AndroidFramework& ) = delete; ///< Deleted copy constructor
161 AndroidFramework( AndroidFramework&& ) = delete; ///< Deleted move constructor
162 AndroidFramework& operator=( const AndroidFramework& ) = delete; ///< Deleted copy assignment operator
163 AndroidFramework& operator=( AndroidFramework&& ) = delete; ///< Deleted move assignment operator
166 AndroidFramework( Dali::Integration::AndroidFramework& androidFramework );
167 Dali::Integration::AndroidFramework& mAndroidFramework;
168 Framework* mFramework;
170 android_app* mNativeApplication;
171 ANativeWindow* mWindow;
172 AAssetManager* mAssets;
173 AConfiguration* mConfiguration;
177 static AndroidFramework& GetImplementation( Dali::Integration::AndroidFramework& androidFramework ) { return *androidFramework.mImpl; }
178 static Framework& GetFramework( Dali::Integration::AndroidFramework& androidFramework ) { return *androidFramework.mImpl->mFramework; }
181 } // namespace Internal
183 } // namespace Adaptor
187 #endif // DALI_INTEGRATION_ANDROID_FRAMEWORK_IMPL_H