1 #ifndef _TCUANDROIDNATIVEACTIVITY_HPP
2 #define _TCUANDROIDNATIVEACTIVITY_HPP
3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program Tester Core
5 * ----------------------------------------
7 * Copyright 2014 The Android Open Source Project
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * \brief C++ wrapper for Android NativeActivity.
25 * To use this wrapper, implement your NativeActivity by extending this
26 * class and create NativeActivity in ANativeActivity_onCreate().
28 * tcu::NativeActivity constructor will fill activity->callbacks and
29 * set instance pointer.
30 *//*--------------------------------------------------------------------*/
32 #include "tcuDefs.hpp"
34 #include <android/native_activity.h>
44 NativeActivity (ANativeActivity* activity);
45 virtual ~NativeActivity (void);
47 virtual void onStart (void);
48 virtual void onResume (void);
49 virtual void* onSaveInstanceState (size_t* outSize);
50 virtual void onPause (void);
51 virtual void onStop (void);
52 virtual void onDestroy (void);
54 virtual void onWindowFocusChanged (int hasFocus);
55 virtual void onNativeWindowCreated (ANativeWindow* window);
56 virtual void onNativeWindowResized (ANativeWindow* window);
57 virtual void onNativeWindowRedrawNeeded (ANativeWindow* window);
58 virtual void onNativeWindowDestroyed (ANativeWindow* window);
60 virtual void onInputQueueCreated (AInputQueue* queue);
61 virtual void onInputQueueDestroyed (AInputQueue* queue);
63 virtual void onContentRectChanged (const ARect* rect);
64 virtual void onConfigurationChanged (void);
65 virtual void onLowMemory (void);
67 ANativeActivity* getNativeActivity (void) { return m_activity; }
71 NativeActivity (const NativeActivity& other);
72 NativeActivity& operator= (const NativeActivity& other);
74 ANativeActivity* m_activity;
80 #endif // _TCUANDROIDNATIVEACTIVITY_HPP