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