Add support of writing DALi cache file for Android.
[platform/core/uifw/dali-adaptor.git] / dali / integration-api / adaptor-framework / android / android-framework.cpp
1 /*
2  * Copyright (c) 2019 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 <dali/integration-api/adaptor-framework/android/android-framework.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/debug.h>
23
24 // INTERNAL INCLUDES
25 #include <dali/internal/adaptor/android/android-framework-impl.h>
26
27 namespace Dali
28 {
29
30 namespace Integration
31 {
32
33 AndroidFramework& AndroidFramework::New()
34 {
35   return Internal::Adaptor::AndroidFramework::New();
36 }
37
38 void AndroidFramework::Delete()
39 {
40   Internal::Adaptor::AndroidFramework::Delete();
41 }
42
43 void AndroidFramework::SetNativeApplication( android_app* application )
44 {
45   mImpl->SetNativeApplication( application );
46 }
47
48 android_app* AndroidFramework::GetNativeApplication() const
49 {
50   return mImpl->GetNativeApplication();
51 }
52
53 void AndroidFramework::SetJVM( JavaVM* jvm )
54 {
55   mImpl->SetJVM( jvm );
56 }
57
58 JavaVM* AndroidFramework::GetJVM() const
59 {
60   return mImpl->GetJVM();
61 }
62
63 void AndroidFramework::SetApplicationAssets( AAssetManager* assets )
64 {
65   mImpl->SetApplicationAssets( assets );
66 }
67
68 AAssetManager* AndroidFramework::GetApplicationAssets() const
69 {
70   return mImpl->GetApplicationAssets();
71 }
72
73 void AndroidFramework::SetInternalDataPath( const std::string& path )
74 {
75   mImpl->SetInternalDataPath( path );
76 }
77
78 std::string AndroidFramework::GetInternalDataPath() const
79 {
80   return mImpl->GetInternalDataPath();
81 }
82
83 void AndroidFramework::SetApplicationConfiguration( AConfiguration* configuration )
84 {
85   mImpl->SetApplicationConfiguration( configuration );
86 }
87
88 AConfiguration* AndroidFramework::GetApplicationConfiguration() const
89 {
90   return mImpl->GetApplicationConfiguration();
91 }
92
93 void AndroidFramework::SetApplicationWindow( ANativeWindow* window )
94 {
95   mImpl->SetApplicationWindow( window );
96 }
97
98 ANativeWindow* AndroidFramework::GetApplicationWindow() const
99 {
100   return mImpl->GetApplicationWindow();
101 }
102
103 void AndroidFramework::OnTerminate()
104 {
105   mImpl->OnTerminate();
106 }
107
108 void AndroidFramework::OnPause()
109 {
110   mImpl->OnPause();
111 }
112
113 void AndroidFramework::OnResume()
114 {
115   mImpl->OnResume();
116 }
117
118 void AndroidFramework::OnWindowCreated( ANativeWindow* window )
119 {
120   mImpl->OnWindowCreated( window );
121 }
122
123 void AndroidFramework::OnWindowDestroyed( ANativeWindow* window )
124 {
125   mImpl->OnWindowDestroyed( window );
126 }
127
128 AndroidFramework::~AndroidFramework()
129 {
130   delete mImpl;
131   mImpl = nullptr;
132 }
133
134 AndroidFramework& AndroidFramework::Get()
135 {
136   return Internal::Adaptor::AndroidFramework::Get();
137 }
138
139 AndroidFramework::AndroidFramework()
140 : mImpl( nullptr )
141 {
142 }
143
144 } // namespace Integration
145
146 } // namespace Dali