LibreOffice Module vcl (master)  1
androidinst.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #ifndef INCLUDED_VCL_INC_ANDROID_ANDROIDINST_HXX
11 #define INCLUDED_VCL_INC_ANDROID_ANDROIDINST_HXX
12 
13 #include <jni.h>
14 #include <android/input.h>
15 #include <android/log.h>
16 #include <android/native_window.h>
17 #include <headless/svpinst.hxx>
18 #include <headless/svpframe.hxx>
19 
20 #define LOGTAG "LibreOffice/androidinst"
21 #define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, LOGTAG, __VA_ARGS__))
22 #define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, LOGTAG, __VA_ARGS__))
23 
24 class AndroidSalFrame;
26 {
27  // This JNIEnv is valid only in the thread where this
28  // AndroidSalInstance object is created, which is the "LO" thread
29  // in which soffice_main() runs
30  JNIEnv* m_pJNIEnv;
31 
32 public:
33  AndroidSalInstance(std::unique_ptr<SalYieldMutex> pMutex);
34  virtual ~AndroidSalInstance();
36 
37  virtual SalSystem* CreateSalSystem();
38 
39  // frame management
40  void GetWorkArea(tools::Rectangle& rRect);
43 
44  // mainloop pieces
45  virtual bool AnyInput(VclInputFlags nType);
46 
47  virtual void updateMainThread();
48  virtual void releaseMainThread();
49 };
50 
51 #endif // INCLUDED_VCL_INC_ANDROID_ANDROIDINST_HXX
52 
53 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AndroidSalInstance(std::unique_ptr< SalYieldMutex > pMutex)
VclInputFlags
Definition: inputtypes.hxx:25
virtual void updateMainThread()
Set the app's (somewhat) magic/main-thread to this one.
virtual void releaseMainThread()
Disconnect that - good for detaching from the JavaVM on Android.
virtual bool AnyInput(VclInputFlags nType)
static AndroidSalInstance * getInstance()
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
void GetWorkArea(tools::Rectangle &rRect)
virtual SalSystem * CreateSalSystem()
SalFrame * CreateChildFrame(SystemParentData *pParent, SalFrameStyleFlags nStyle)
SalFrameStyleFlags
Definition: salframe.hxx:64
SalFrame * CreateFrame(SalFrame *pParent, SalFrameStyleFlags nStyle)
virtual ~AndroidSalInstance()