Subversion Repositories tpanel

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 andreas 1
/*
89 andreas 2
 * Copyright (C) 2020 to 2022 by Andreas Theofilu <andreas@theosys.at>
3 andreas 3
 *
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software Foundation,
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
17
 */
18
 
19
#ifndef __TPAGEMANAGER_H__
20
#define __TPAGEMANAGER_H__
21
 
5 andreas 22
#include <functional>
11 andreas 23
#include <thread>
36 andreas 24
#ifdef __ANDROID__
25
#include <jni.h>
26
#endif
235 andreas 27
#include <qglobal.h>
28
 
3 andreas 29
#include "tpagelist.h"
30
#include "tpage.h"
31
#include "tsubpage.h"
32
#include "tsettings.h"
4 andreas 33
#include "tpalette.h"
7 andreas 34
#include "tbutton.h"
35
#include "tfont.h"
32 andreas 36
#include "texternal.h"
11 andreas 37
#include "tamxnet.h"
38
#include "tamxcommands.h"
73 andreas 39
#include "tsystemdraw.h"
123 andreas 40
#include "tsipclient.h"
169 andreas 41
#include "tvector.h"
3 andreas 42
 
14 andreas 43
#define REG_CMD(func, name)     registerCommand(bind(&TPageManager::func, this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3),name)
3 andreas 44
 
8 andreas 45
class TIcons;
14 andreas 46
class TPageManager;
21 andreas 47
 
48
extern bool prg_stopped;
8 andreas 49
extern TIcons *gIcons;
50
extern TPrjResources *gPrjResources;
14 andreas 51
extern TPageManager *gPageManager;
8 andreas 52
 
93 andreas 53
#ifdef __ANDROID__
54
#define NETSTATE_WIFI   1
55
#define NETSTATE_CELL   2
56
#endif
57
 
11 andreas 58
class TPageManager : public TAmxCommands
3 andreas 59
{
60
    public:
134 andreas 61
        typedef enum J_ORIENTATION
62
        {
63
            O_UNDEFINED = -1,
64
            O_LANDSCAPE = 0,
65
            O_PORTRAIT = 1,
66
            O_REVERSE_LANDSCAPE = 8,
67
            O_REVERSE_PORTRAIT = 9,
68
            O_FACE_UP = 15,
69
            O_FACE_DOWN = 16
70
        }J_ORIENTATION;
71
 
153 andreas 72
        typedef enum SWIPES
73
        {
74
            SW_UNKNOWN,
75
            SW_LEFT,
76
            SW_RIGHT,
77
            SW_UP,
78
            SW_DOWN
79
        }SWIPES;
80
 
3 andreas 81
        TPageManager();
82
        ~TPageManager();
83
 
192 andreas 84
        bool readPages();                               //!< Read all pages and subpages
85
        bool readPage(const std::string& name);         //!< Read the page with name \p name
86
        bool readPage(int ID);                          //!< Read the page with id \p ID
87
        bool readSubPage(const std::string& name);      //!< Read the subpage with name \p name
88
        bool readSubPage(int ID);                       //!< Read the subpage with ID \p ID
89
        void updateActualPage();                        //!< Updates all elements of the actual page
90
        void updateSubpage(int ID);                     //!< Updates all elements of a subpage
91
        void updateSubpage(const std::string& name);    //!< Updates all elements of a subpage
3 andreas 92
 
62 andreas 93
        TPageList *getPageList() { return mPageList; }      //!< Get the list of all pages
94
        TSettings *getSettings() { return mTSettings; }     //!< Get the (system) settings of the panel
197 andreas 95
        TSettings *getSystemSettings() { return mSystemSettings; } //!< Get the system settings of the setup pages
3 andreas 96
 
62 andreas 97
        TPage *getActualPage();                             //!< Get the actual page
98
        int getActualPageNumber() { return mActualPage; }   //!< Get the ID of the actual page
99
        int getPreviousPageNumber() { return mPreviousPage; }   //!< Get the ID of the previous page, if there was any.
4 andreas 100
        TSubPage *getFirstSubPage();
101
        TSubPage *getNextSubPage();
154 andreas 102
        TSubPage *getPrevSubPage();
103
        TSubPage *getLastSubPage();
11 andreas 104
        TSubPage *getFirstSubPageGroup(const std::string& group);
105
        TSubPage *getNextSubPageGroup();
106
        TSubPage *getNextSubPageGroup(const std::string& group, TSubPage *pg);
107
        TSubPage *getTopPage();
4 andreas 108
 
109
        TPage *getPage(int pageID);
110
        TPage *getPage(const std::string& name);
198 andreas 111
        bool setPage(int PageID, bool forget=false);
168 andreas 112
        bool setPage(const std::string& name, bool forget=false);
4 andreas 113
        TSubPage *getSubPage(int pageID);
114
        TSubPage *getSubPage(const std::string& name);
96 andreas 115
        TSubPage *deliverSubPage(const std::string& name, TPage **pg=nullptr);
198 andreas 116
        TSubPage *deliverSubPage(int number, TPage **pg=nullptr);
14 andreas 117
        bool havePage(const std::string& name);
118
        bool haveSubPage(const std::string& name);
119
        bool haveSubPage(int id);
120
        bool haveSubPage(const std::string& page, const std::string& name);
121
        bool haveSubPage(const std::string& page, int id);
50 andreas 122
        TFont *getFonts() { return mFonts; }
51 andreas 123
        Button::TButton *findButton(ulong handle);
153 andreas 124
        void onSwipeEvent(SWIPES sw);
164 andreas 125
        double getDPI() { return mDPI; }
126
        void setDPI(const double dpi) { mDPI = dpi; }
4 andreas 127
 
6 andreas 128
        void registerCallbackDB(std::function<void(ulong handle, ulong parent, unsigned char *buffer, int width, int height, int pixline, int left, int top)> displayButton) { _displayButton = displayButton; }
190 andreas 129
        void registerDropButton(std::function<void(ulong hanlde)> dropButton) { _dropButton = dropButton; }
98 andreas 130
        void registerCBsetVisible(std::function<void(ulong handle, bool state)> setVisible) { _setVisible = setVisible; }
5 andreas 131
        void registerCallbackSP(std::function<void (ulong handle, int width, int height)> setPage) { _setPage = setPage; }
217 andreas 132
        void registerCallbackSSP(std::function<void (ulong handle, ulong parent, int left, int top, int width, int height, ANIMATION_t animate)> setSubPage) { _setSubPage = setSubPage; }
38 andreas 133
        void registerCallbackSB(std::function<void (ulong handle, unsigned char *image, size_t size, size_t rowBytes, int width, int height, ulong color)> setBackground) {_setBackground = setBackground; }
26 andreas 134
        void deployCallbacks();
36 andreas 135
#ifdef __ANDROID__
136
        void initNetworkState();
137
        void stopNetworkState();
38 andreas 138
        void initBatteryState();
139
        void stopBatteryState();
61 andreas 140
        void initPhoneState();
36 andreas 141
        void informTPanelNetwork(jboolean conn, jint level, jint type);
38 andreas 142
        void informBatteryStatus(jint level, jboolean charging, jint chargeType);
61 andreas 143
        void informPhoneState(bool call, const std::string& pnumber);
130 andreas 144
        void initOrientation();
36 andreas 145
#endif
11 andreas 146
        void regCallDropPage(std::function<void (ulong handle)> callDropPage) { _callDropPage = callDropPage; }
147
        void regCallDropSubPage(std::function<void (ulong handle)> callDropSubPage) { _callDropSubPage = callDropSubPage; }
21 andreas 148
        void regCallPlayVideo(std::function<void (ulong handle, ulong parent, int left, int top, int width, int height, const std::string& url, const std::string& user, const std::string& pw)> callPlayVideo) { _callPlayVideo = callPlayVideo; };
192 andreas 149
        void regCallInputText(std::function<void (Button::TButton *button, Button::BITMAP_t& bm, int frame)> callInputText) { _callInputText = callInputText; }
200 andreas 150
        void regCallListBox(std::function<void (Button::TButton *button, Button::BITMAP_t& bm, int frame)> callListBox) { _callListBox = callListBox; }
63 andreas 151
        void regCallbackKeyboard(std::function<void (const std::string& init, const std::string& prompt, bool priv)> callKeyboard) { _callKeyboard = callKeyboard; }
152
        void regCallbackKeypad(std::function<void (const std::string& init, const std::string& prompt, bool priv)> callKeypad) { _callKeypad = callKeypad; }
153
        void regCallResetKeyboard(std::function<void ()> callResetKeyboard) { _callResetKeyboard = callResetKeyboard; }
64 andreas 154
        void regCallShowSetup(std::function<void ()> callShowSetup) { _callShowSetup = callShowSetup; }
36 andreas 155
        void regCallbackNetState(std::function<void (int level)> callNetState, ulong handle);
156
        void unregCallbackNetState(ulong handle);
38 andreas 157
        void regCallbackBatteryState(std::function<void (int level, bool charging, int chargeType)> callBatteryState, ulong handle);
158
        void unregCallbackBatteryState(ulong handle);
44 andreas 159
        void regCallbackResetSurface(std::function<void ()> resetSurface) { _resetSurface = resetSurface; }
64 andreas 160
        void regCallbackShutdown(std::function<void ()> shutdown) { _shutdown = shutdown; }
71 andreas 161
        void regCallbackPlaySound(std::function<void (const std::string& file)> playSound) { _playSound = playSound; }
141 andreas 162
        void regCallbackStopSound(std::function<void ()> stopSound) { _stopSound = stopSound; }
163
        void regCallbackMuteSound(std::function<void (bool state)> muteSound) { _muteSound = muteSound; }
111 andreas 164
        void regSendVirtualKeys(std::function<void (const std::string& str)> sendVirtualKeys) { _sendVirtualKeys = sendVirtualKeys; }
140 andreas 165
        void regShowPhoneDialog(std::function<void (bool state)> showPhoneDialog) { _showPhoneDialog = showPhoneDialog; }
166
        void regSetPhoneNumber(std::function<void (const std::string& number)> setPhoneNumber) { _setPhoneNumber = setPhoneNumber; }
167
        void regSetPhoneStatus(std::function<void (const std::string& msg)> setPhoneStatus) { _setPhoneStatus = setPhoneStatus; }
168
        void regSetPhoneState(std::function<void (int state, int id)> setPhoneState) { _setPhoneState = setPhoneState; }
206 andreas 169
        void regDisplayMessage(std::function<void (const std::string& msg, const std::string& title)> msg) { _displayMessage = msg; }
209 andreas 170
        void regFileDialogFunction(std::function<void (ulong handle, const std::string& path, const std::string& extension, const std::string& suffix)> fdlg) { _fileDialog = fdlg; }
235 andreas 171
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
130 andreas 172
        void regOnOrientationChange(std::function<void (int orientation)> orientationChange) { _onOrientationChange = orientationChange; }
173
#endif
142 andreas 174
        void regRepaintWindows(std::function<void ()> repaintWindows) { _repaintWindows = repaintWindows; }
151 andreas 175
        void regToFront(std::function<void (ulong handle)> toFront) { _toFront = toFront; }
197 andreas 176
        void regSetMainWindowSize(std::function<void (int width, int height)> setSize) { _setMainWindowSize = setSize; }
206 andreas 177
        void regDownloadSurface(std::function<void (const std::string& file, size_t size)> dl) { _downloadSurface = dl; }
142 andreas 178
 
11 andreas 179
        /**
180
         * The following function must be called to start non graphics part
181
         * of the panel simulator. If everything worked well, it returns TRUE.
182
         * otherwise a FALSE is returned and the program should be terminated.
183
         */
5 andreas 184
        bool run();
11 andreas 185
        /**
186
         * Set an X value to add to the coordinated reported by the mouse catch
187
         * event. In case the X coordinate reported by the event is not the real
188
         * X coordinate, it's possible to set an X coordinate to translate the
189
         * internal used coordinates.
190
         *
14 andreas 191
         * @param x
192
         * The left most pixel which correspond to X = 0
11 andreas 193
         */
10 andreas 194
        void setFirstLeftPixel(int x) { mFirstLeftPixel = x; }
11 andreas 195
        /**
196
         * Set an Y value to add to the coordinated reported by the mouse catch
197
         * event. In case the Y coordinate reported by the event is not the real
198
         * Y coordinate, it's possible to set an Y coordinate to translate the
199
         * internal used coordinates.
200
         *
14 andreas 201
         * @param y
43 andreas 202
         * The top most pixel which correspond to Y = 0
11 andreas 203
         */
10 andreas 204
        void setFirstTopPixel(int y) { mFirstTopPixel = y; }
11 andreas 205
        /**
206
         * This function must be called from a GUI whenever the left mouse
207
         * button was pressed or released. Also if there was a touch event
14 andreas 208
         * this function must be called in the same way. It's up to any GUI
11 andreas 209
         * to handle the mouse and or touch events.
210
         *
14 andreas 211
         * @param x
212
         * the X coordinate of the mouse/touch event
213
         *
214
         * @param y
215
         * the y coordinate if the mouse/touch event
216
         *
217
         * @return
11 andreas 218
         * pressed TRUE = button was pressed; FALSE = button was released
219
         */
10 andreas 220
        void mouseEvent(int x, int y, bool pressed);
51 andreas 221
        /**
222
         * Searches for a button with the handle \p handle and determines all
223
         * buttons with the same port and channel. Then it sets \p txt to all
224
         * found buttons.
225
         *
226
         * @param handle    The handle of a button.
227
         * @param txt       The text usualy comming from an input line.
208 andreas 228
         * @param redraw    If this is set to true the button is redrawn.
51 andreas 229
         */
208 andreas 230
        void setTextToButton(ulong handle, const std::string& txt, bool redraw=false);
51 andreas 231
        /**
232
         * Iterates through all active subpages of the active page and drops
233
         * them.
234
         */
14 andreas 235
        void dropAllSubPages();
51 andreas 236
        /**
237
         * Closes all subpages in the group \p group.
238
         *
239
         * @param group The name of the group.
240
         */
14 andreas 241
        void closeGroup(const std::string& group);
51 andreas 242
        /**
198 andreas 243
         * Displays the subpage \p name. If the subpage is part of a group
51 andreas 244
         * the open subpage in the group is closed, if there was one open. Then
245
         * the subpage is displayed. If the subpage is not already in the
246
         * internal buffer it's configuration file is read and the page is
247
         * created.
248
         *
249
         * @param name  The name of the subpage to display.
250
         */
14 andreas 251
        void showSubPage(const std::string& name);
51 andreas 252
        /**
198 andreas 253
         * Displays the subpage \p number. If the subpage is part of a group
254
         * the open subpage in the group is closed, if there was one open. Then
255
         * the subpage is displayed. If the subpage is not already in the
256
         * internal buffer it's configuration file is read and the page is
257
         * created.
258
         *
259
         * @param name  The name of the subpage to display.
260
         */
261
        void showSubPage(int number, bool force=false);
262
        /**
51 andreas 263
         * Hides the subpage \p name.
264
         *
265
         * @param name  The name of the subpage to hide.
266
         */
14 andreas 267
        void hideSubPage(const std::string& name);
192 andreas 268
        /**
269
         * This is called whenever an input button finished or changed it's
270
         * content. It is called out of the class TQEditLine.
271
         * The method writes the content into the text area of the button the
272
         * handle points to.
273
         *
274
         * @param handle   The handle of the button.
275
         * @param content  The content of the text area.
276
         */
277
        void inputButtonFinished(ulong handle, const std::string& content);
43 andreas 278
#ifdef _SCALE_SKIA_
24 andreas 279
        void setScaleFactor(double scale) { mScaleFactor = scale; }
280
        double getScaleFactor() { return mScaleFactor; }
31 andreas 281
        void setScaleFactorWidth(double scale) { mScaleFactorWidth = scale; }
282
        double getScaleFactorWidth() { return mScaleFactorWidth; }
283
        void setScaleFactorHeight(double scale) { mScaleFactorHeight = scale; }
284
        double getScaleFactorHeight() { return mScaleFactorHeight; }
43 andreas 285
#endif
62 andreas 286
        /**
287
         * This method handles some external buttons. Some original panels from
288
         * AMX have external hard buttons. TPanel simulates some of them like
289
         * the arrow keys, enter button and volume. The graphical surface may
290
         * display a toolbar on the right side (only if there is enough space
291
         * left) which offers this buttons. When such a button was pressed, this
292
         * method is called to send them to the controller.
293
         *
294
         * @param bt        The button who was pressed
295
         * @param checked   On button press this is TRUE, and on release it is FALSE.
296
         */
33 andreas 297
        void externalButton(extButtons_t bt, bool checked);
62 andreas 298
        void sendKeyboard(const std::string& text);
299
        void sendKeypad(const std::string& text);
300
        void sendString(uint handle, const std::string& text);
134 andreas 301
        void sendGlobalString(const std::string& text);
123 andreas 302
        void sendPHNcommand(const std::string& cmd);
111 andreas 303
        void sendKeyStroke(char key);
147 andreas 304
        void sendCommandString(int port, const std::string& cmd);
62 andreas 305
        /**
306
         * This starts the communication with the AMX controller. The method
307
         * registers the callbacks and starts a thread. This thread runs as
308
         * long as a valid communication is possible or until the communication
309
         * end by a command.
310
         */
38 andreas 311
        void startUp();
147 andreas 312
        /**
169 andreas 313
         * This starts a thread running the command loop. Each event from the
192 andreas 314
         * Netlinx is entered into a vector array (doCommand()) and this
169 andreas 315
         * method starts the event loop as a thread running as long as this
316
         * class exists.
317
         */
318
        void runCommands();
319
        /**
320
         * This method is the thread started by the command runCommands().
321
         */
322
        void commandLoop();
323
        /**
147 andreas 324
         * Callback function for the AMX controller part. This function must
325
         * be registered to the class TAmxNet and is called from this module
326
         * every time an event occured from the controller.
327
         * This method handles the commands comming from the controller and
328
         * draws the necessary elements before they are sent to the GUI.
329
         *
330
         * @param cmd
331
         * An ANET_COMMAND structure containing the received command.
332
         */
333
        void doCommand(const amx::ANET_COMMAND& cmd);
193 andreas 334
        /**
335
         * Returns the state of setup. If the setup pages are active it returns
336
         * TRUE.
337
         *
338
         * @return State of setup pages
339
         */
340
        bool isSetupActive() { return mSetupActive; }
197 andreas 341
        /**
342
         * Activates the setup pages unless they are not visible already.
343
         */
344
        void showSetup();
345
        /**
346
         * Deactivates the setup pages and restores the previous normal page.
347
         */
348
        void hideSetup();
349
        /**
205 andreas 350
         * Determines the page or subpage the handle points to and returns the
351
         * selected row of a list, if there is one.
352
         * The row index starts by 1!
353
         *
354
         * @param handle    The handle of the button.
355
         * @return If the button is a list and a row was selected then a number
356
         * grater than 0 is returned. Otherwise -1 is returned.
357
         */
358
        int getSelectedRow(ulong handle);
359
        /**
360
         * Finds the page or subpage and returns the selected item as a string.
361
         * If there was no list, or no items in the list, or nothing selected,
362
         * an empty string is returned.
363
         *
364
         * @param handle    The handle of the button
365
         * @return The string of the selected item or an empty string.
366
         */
367
        std::string getSelectedItem(ulong handle);
368
        /**
369
         * Finds the corresponding list and sets the selected row. The \b row
370
         * must be a value starting by 1. It must not be bigger that items in
371
         * the list.
372
         *
373
         * @param handle    The handle of the button
374
         * @param row       The number of the selected row.
375
         */
206 andreas 376
        void setSelectedRow(ulong handle, int row, const std::string& text);
205 andreas 377
#ifdef _SCALE_SKIA_
378
        /**
197 andreas 379
         * Set the scale factor for the system setup pages. On a desktop this
380
         * factor is in relation to the size of the normal pages, if there any.
381
         * On a mobile device the factor is in relation to the resolution of
382
         * the display.
383
         * The scale factor is calculated in qtmain.cpp: MainWindow::calcScaleSetup()
384
         *
385
         * @param scale  The overall scale factor. This is used for calculations
386
         * and ensures that the ratio of the objects is maintained.
387
         * @param sw     The scale factor for the width.
388
         * @param sh     The scale factor for the height.
389
         */
390
        void setSetupScaleFactor(double scale, double sw, double sh);
198 andreas 391
#endif
62 andreas 392
        // Callbacks who will be registered by the graphical surface.
26 andreas 393
        std::function<void (ulong handle, ulong parent, unsigned char *buffer, int width, int height, int pixline, int left, int top)> getCallbackDB() { return _displayButton; }
190 andreas 394
        std::function<void (ulong handle)> getCallDropButton() { return _dropButton; }
98 andreas 395
        std::function<void (ulong handle, bool state)> getVisible() { return _setVisible; };
38 andreas 396
        std::function<void (ulong handle, unsigned char *image, size_t size, size_t rowBytes, int width, int height, ulong color)> getCallbackBG() { return _setBackground; }
26 andreas 397
        std::function<void (ulong handle, ulong parent, int left, int top, int width, int height, const std::string& url, const std::string& user, const std::string& pw)> getCallbackPV() { return _callPlayVideo; }
38 andreas 398
        std::function<void (ulong handle, int width, int height)> getCallbackSetPage() { return _setPage; }
192 andreas 399
        std::function<void (Button::TButton *button, Button::BITMAP_t& bm, int frame)> getCallbackInputText() { return _callInputText; }
200 andreas 400
        std::function<void (Button::TButton *button, Button::BITMAP_t& bm, int frame)> getCallbackListBox() { return _callListBox; }
217 andreas 401
        std::function<void (ulong handle, ulong parent, int left, int top, int width, int height, ANIMATION_t animate)> getCallbackSetSubPage() { return _setSubPage; }
38 andreas 402
        std::function<void (ulong handle)> getCallDropPage() { return _callDropPage; }
403
        std::function<void (ulong handle)> getCallDropSubPage() { return _callDropSubPage; }
71 andreas 404
        std::function<void (const std::string& file)> getCallPlaySound() { return _playSound; }
141 andreas 405
        std::function<void ()> getCallStopSound() { return _stopSound; }
406
        std::function<void (bool state)> getCallMuteSound() { return _muteSound; }
111 andreas 407
        std::function<void (const std::string& str)> sendVirtualKeys() { return _sendVirtualKeys; }
140 andreas 408
        std::function<void (bool state)> getShowPhoneDialog() { return _showPhoneDialog; }
409
        std::function<void (const std::string& number)> getSetPhoneNumber() { return _setPhoneNumber; }
410
        std::function<void (const std::string& msg)> getSetPhoneStatus() { return _setPhoneStatus; }
411
        std::function<void (int state, int id)> getSetPhoneState() { return _setPhoneState; }
151 andreas 412
        std::function<void (ulong handle)> getToFront() { return _toFront; }
197 andreas 413
        std::function<void (int width, int height)> getMainWindowSizeFunc() { return _setMainWindowSize; }
206 andreas 414
        std::function<void (const std::string& file, size_t size)> getDownloadSurface() { return _downloadSurface; }
415
        std::function<void (const std::string& msg, const std::string& title)> getDisplayMessage() { return _displayMessage; }
209 andreas 416
        std::function<void (ulong handle, const std::string& path, const std::string& extension, const std::string& suffix)> getFileDialogFunction() { return _fileDialog; }
235 andreas 417
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
130 andreas 418
        std::function<void (int orientation)> onOrientationChange() { return _onOrientationChange; }
419
#endif
142 andreas 420
        std::function<void ()> getRepaintWindows() { return _repaintWindows; }
134 andreas 421
        int getOrientation() { return mOrientation; }
422
        void setOrientation(int ori) { mOrientation = ori; }
423
        bool getInformOrientation() { return mInformOrientation; }
424
        void sendOrientation();
71 andreas 425
        bool havePlaySound() { return _playSound != nullptr; }
73 andreas 426
        TSystemDraw *getSystemDraw() { return mSystemDraw; }
89 andreas 427
        void reset();
111 andreas 428
        bool getPassThrough() { return mPassThrough; }
113 andreas 429
        bool haveSetupPage() { return _callShowSetup != nullptr; }
430
        bool haveShutdown() { return _shutdown != nullptr; }
431
        void callSetupPage() { if (_callShowSetup) _callShowSetup(); }
432
        void callShutdown() { if (_shutdown) _shutdown(); }
129 andreas 433
#ifndef _NOSIP_
123 andreas 434
        bool getPHNautoanswer() { return mPHNautoanswer; }
435
        void sendPHN(std::vector<std::string>& cmds);
141 andreas 436
        void actPHN(std::vector<std::string>& cmds);
140 andreas 437
        void phonePickup(int id);
438
        void phoneHangup(int id);
129 andreas 439
#endif
206 andreas 440
        void addFtpSurface(const std::string& file, size_t size) { mFtpSurface.push_back(_FTP_SURFACE_t{file, size}); };
441
 
442
        inline size_t getFtpSurfaceSize(const std::string& file)
443
        {
444
            if (mFtpSurface.empty())
445
                return 0;
446
 
447
            std::vector<_FTP_SURFACE_t>::iterator iter;
448
 
449
            for (iter = mFtpSurface.begin(); iter != mFtpSurface.end(); ++iter)
450
            {
451
                if (iter->file == file)
452
                    return iter->size;
453
            }
454
 
455
            return 0;
456
        }
457
 
458
        void clearFtpSurface() { mFtpSurface.clear(); }
459
 
3 andreas 460
    protected:
461
        PAGELIST_T findPage(const std::string& name);
462
        PAGELIST_T findPage(int ID);
463
        SUBPAGELIST_T findSubPage(const std::string& name);
464
        SUBPAGELIST_T findSubPage(int ID);
465
 
466
        bool addPage(TPage *pg);
467
        bool addSubPage(TSubPage *pg);
11 andreas 468
        TSubPage *getCoordMatch(int x, int y);
40 andreas 469
        Button::TButton *getCoordMatchPage(int x, int y);
11 andreas 470
        void initialize();
471
        void dropAllPages();
92 andreas 472
        bool startComm();
3 andreas 473
 
474
    private:
6 andreas 475
        std::function<void (ulong handle, ulong parent, unsigned char *buffer, int width, int height, int pixline, int left, int top)> _displayButton{nullptr};
190 andreas 476
        std::function<void (ulong handle)> _dropButton{nullptr};
98 andreas 477
        std::function<void (ulong handle, bool state)> _setVisible{nullptr};
5 andreas 478
        std::function<void (ulong handle, int width, int height)> _setPage{nullptr};
217 andreas 479
        std::function<void (ulong handle, ulong parent, int left, int top, int width, int height, ANIMATION_t animate)> _setSubPage{nullptr};
38 andreas 480
        std::function<void (ulong handle, unsigned char *image, size_t size, size_t rowBytes, int width, int height, ulong color)> _setBackground{nullptr};
7 andreas 481
        std::function<void (ulong handle, const std::string& text, const std::string& font, const std::string& family, int size, int x, int y, ulong color, ulong effectColor, FONT_STYLE style, Button::TEXT_ORIENTATION ori, Button::TEXT_EFFECT effect, bool ww)> _setText{nullptr};
11 andreas 482
        std::function<void (ulong handle)> _callDropPage{nullptr};
483
        std::function<void (ulong handle)> _callDropSubPage{nullptr};
21 andreas 484
        std::function<void (ulong handle, ulong parent, int left, int top, int width, int height, const std::string& url, const std::string& user, const std::string& pw)> _callPlayVideo{nullptr};
192 andreas 485
        std::function<void (Button::TButton *button, Button::BITMAP_t& bm, int frame)> _callInputText{nullptr};
200 andreas 486
        std::function<void (Button::TButton *button, Button::BITMAP_t& bm, int frame)> _callListBox{nullptr};
63 andreas 487
        std::function<void (const std::string& init, const std::string& prompt, bool priv)> _callKeyboard{nullptr};
488
        std::function<void (const std::string& init, const std::string& prompt, bool priv)> _callKeypad{nullptr};
489
        std::function<void ()> _callResetKeyboard{nullptr};
64 andreas 490
        std::function<void ()> _callShowSetup{nullptr};
44 andreas 491
        std::function<void ()> _resetSurface{nullptr};
64 andreas 492
        std::function<void ()> _shutdown{nullptr};
71 andreas 493
        std::function<void (const std::string& file)> _playSound{nullptr};
141 andreas 494
        std::function<void ()> _stopSound{nullptr};
495
        std::function<void (bool state)> _muteSound{nullptr};
111 andreas 496
        std::function<void (const std::string& str)> _sendVirtualKeys{nullptr};
140 andreas 497
        std::function<void (bool state)> _showPhoneDialog{nullptr};
498
        std::function<void (const std::string& number)> _setPhoneNumber{nullptr};
499
        std::function<void (const std::string& msg)> _setPhoneStatus{nullptr};
500
        std::function<void (int state, int id)> _setPhoneState{nullptr};
142 andreas 501
        std::function<void ()> _repaintWindows{nullptr};
151 andreas 502
        std::function<void (uint handle)> _toFront{nullptr};
197 andreas 503
        std::function<void (int width, int height)> _setMainWindowSize{nullptr};
206 andreas 504
        std::function<void (const std::string& file, size_t size)> _downloadSurface{nullptr};
505
        std::function<void (const std::string& msg, const std::string& title)> _displayMessage{nullptr};
209 andreas 506
        std::function<void (ulong handle, const std::string& path, const std::string& extension, const std::string& suffix)> _fileDialog{nullptr};
235 andreas 507
#if defined(__ANDROID__) || defined(Q_OS_IOS)
130 andreas 508
        std::function<void (int orientation)> _onOrientationChange{nullptr};
509
#endif
206 andreas 510
        typedef struct _FTP_SURFACE_t
511
        {
512
            std::string file;
513
            size_t size{0};
514
        }_FTP_SURFACE_t;
515
 
32 andreas 516
        /**
517
         * @brief doOverlap checks for overlapping objects
518
         *
519
         * The function checks whether some objects on the surface overlap or
520
         * not. If they do it returns TRUE.
521
         * This is used for images where we should check for a transparent
522
         * pixel.
523
         *
524
         * @param r1    The rectangular of the first object
525
         * @param r2    The rectangular of the second object
526
         * @return If the objects \p r1 and \p r2 overlap at least partialy,
527
         * TRUE is returned. Otherwise FALSE.
528
         */
11 andreas 529
        bool doOverlap(RECT_T r1, RECT_T r2);
530
        /**
14 andreas 531
         * The following function is used internaly. It searches in the map
532
         * table for the button corresponding to the port and channel number
533
         * and puts the result into a chain of buttons. This chain is returned.
534
         *
535
         * If there are some pages not yet in memory, they will be created just
536
         * to be able to set the button(s).
537
         */
193 andreas 538
        std::vector<Button::TButton *> collectButtons(std::vector<TMap::MAP_T>& map);
44 andreas 539
        /**
540
         * This internal function frees and destroys all settings, loaded pages
541
         * and sub pages as well as all buttons ens elements belonging to this
542
         * pages. Wehen the function is finished, the state is the same as it
543
         * was immediately at startup.
544
         * This method is called when a filetransfer starts. It is necessary to
545
         * start all over and read in the changed pages.
546
         *
547
         * @return Returns TRUE on success. Else it returns FALSE and the error
548
         * flag is set.
549
         */
550
        bool destroyAll();
209 andreas 551
 
150 andreas 552
        bool overlap(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
209 andreas 553
        TPage *loadPage(PAGELIST_T& pl, bool *refresh=nullptr);
18 andreas 554
        void setButtonCallbacks(Button::TButton *bt);
110 andreas 555
        bool sendCustomEvent(int value1, int value2, int value3, const std::string& msg, int evType, int cp, int cn);
209 andreas 556
        void reloadSystemPage(TPage *page);
129 andreas 557
#ifndef _NOSIP_
127 andreas 558
        std::string sipStateToString(TSIPClient::SIP_STATE_t s);
129 andreas 559
#endif
11 andreas 560
        // List of command functions
23 andreas 561
        void doFTR(int port, std::vector<int>&, std::vector<std::string>& pars);
562
 
14 andreas 563
        void doON(int port, std::vector<int>& channels, std::vector<std::string>& pars);
564
        void doOFF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
15 andreas 565
        void doLEVEL(int port, std::vector<int>& channels, std::vector<std::string>& pars);
566
        void doBLINK(int port, std::vector<int>& channels, std::vector<std::string>& pars);
127 andreas 567
        void doVER(int port, std::vector<int>& channels, std::vector<std::string>& pars);
568
        void doWCN(int port, std::vector<int>& channels, std::vector<std::string>& pars);
14 andreas 569
 
147 andreas 570
        void doAFP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
11 andreas 571
        void doAPG(int port, std::vector<int>& channels, std::vector<std::string>& pars);
572
        void doCPG(int port, std::vector<int>& channels, std::vector<std::string>& pars);
573
        void doDPG(int port, std::vector<int>& channels, std::vector<std::string>& pars);
15 andreas 574
        void doPHE(int port, std::vector<int>& channels, std::vector<std::string>& pars);
575
        void doPHP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
576
        void doPHT(int port, std::vector<int>& channels, std::vector<std::string>& pars);
11 andreas 577
        void doPPA(int port, std::vector<int>& channels, std::vector<std::string>& pars);
12 andreas 578
        void doPPF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
579
        void doPPG(int port, std::vector<int>& channels, std::vector<std::string>& pars);
580
        void doPPK(int port, std::vector<int>& channels, std::vector<std::string>& pars);
581
        void doPPM(int port, std::vector<int>& channels, std::vector<std::string>& pars);
582
        void doPPN(int port, std::vector<int>& channels, std::vector<std::string>& pars);
15 andreas 583
        void doPPT(int port, std::vector<int>& channels, std::vector<std::string>& pars);
12 andreas 584
        void doPPX(int port, std::vector<int>& channels, std::vector<std::string>& pars);
15 andreas 585
        void doPSE(int port, std::vector<int>& channels, std::vector<std::string>& pars);
586
        void doPSP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
587
        void doPST(int port, std::vector<int>& channels, std::vector<std::string>& pars);
12 andreas 588
        void doPAGE(int port, std::vector<int>& channels, std::vector<std::string>& pars);
11 andreas 589
 
38 andreas 590
        void doANI(int port, std::vector<int>& channels, std::vector<std::string>& pars);
15 andreas 591
        void doAPF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
43 andreas 592
        void doBAT(int port, std::vector<int>& channels, std::vector<std::string>& pars);
60 andreas 593
        void doBAU(int port, std::vector<int>& channels, std::vector<std::string>& pars);
43 andreas 594
        void doBCB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
82 andreas 595
        void getBCB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
60 andreas 596
        void doBCF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
82 andreas 597
        void getBCF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
60 andreas 598
        void doBCT(int port, std::vector<int>& channels, std::vector<std::string>& pars);
82 andreas 599
        void getBCT(int port, std::vector<int>& channels, std::vector<std::string>& pars);
60 andreas 600
        void doBDO(int port, std::vector<int>& channels, std::vector<std::string>& pars);
601
        void doBFB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
224 andreas 602
        void doBIM(int port, std::vector<int>& channels, std::vector<std::string>& pars);
106 andreas 603
        void doBMC(int port, std::vector<int>& channels, std::vector<std::string>& pars);
149 andreas 604
        void doBMF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
110 andreas 605
        void doBML(int port, std::vector<int>& channels, std::vector<std::string>& pars);
15 andreas 606
        void doBMP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
82 andreas 607
        void getBMP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
16 andreas 608
        void doBOP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
106 andreas 609
        void getBOP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
60 andreas 610
        void doBOR(int port, std::vector<int>& channels, std::vector<std::string>& pars);
107 andreas 611
        void doBOS(int port, std::vector<int>& channels, std::vector<std::string>& pars);
60 andreas 612
        void doBRD(int port, std::vector<int>& channels, std::vector<std::string>& pars);
107 andreas 613
        void getBRD(int port, std::vector<int>& channels, std::vector<std::string>& pars);
16 andreas 614
        void doBSP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
107 andreas 615
        void doBSM(int port, std::vector<int>& channels, std::vector<std::string>& pars);
616
        void doBSO(int port, std::vector<int>& channels, std::vector<std::string>& pars);
16 andreas 617
        void doBWW(int port, std::vector<int>& channels, std::vector<std::string>& pars);
108 andreas 618
        void getBWW(int port, std::vector<int>& channels, std::vector<std::string>& pars);
16 andreas 619
        void doCPF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
620
        void doDPF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
621
        void doENA(int port, std::vector<int>& channels, std::vector<std::string>& pars);
622
        void doFON(int port, std::vector<int>& channels, std::vector<std::string>& pars);
108 andreas 623
        void getFON(int port, std::vector<int>& channels, std::vector<std::string>& pars);
60 andreas 624
        void doGLH(int port, std::vector<int>& channels, std::vector<std::string>& pars);
625
        void doGLL(int port, std::vector<int>& channels, std::vector<std::string>& pars);
108 andreas 626
        void doGSC(int port, std::vector<int>& channels, std::vector<std::string>& pars);
14 andreas 627
        void doICO(int port, std::vector<int>& channels, std::vector<std::string>& pars);
108 andreas 628
        void getICO(int port, std::vector<int>& channels, std::vector<std::string>& pars);
629
        void doJSB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
630
        void getJSB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
631
        void doJSI(int port, std::vector<int>& channels, std::vector<std::string>& pars);
632
        void getJSI(int port, std::vector<int>& channels, std::vector<std::string>& pars);
633
        void doJST(int port, std::vector<int>& channels, std::vector<std::string>& pars);
634
        void getJST(int port, std::vector<int>& channels, std::vector<std::string>& pars);
16 andreas 635
        void doSHO(int port, std::vector<int>& channels, std::vector<std::string>& pars);
108 andreas 636
        void doTEC(int port, std::vector<int>& channels, std::vector<std::string>& pars);
637
        void getTEC(int port, std::vector<int>& channels, std::vector<std::string>& pars);
110 andreas 638
        void doTEF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
639
        void getTEF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
14 andreas 640
        void doTXT(int port, std::vector<int>& channels, std::vector<std::string>& pars);
110 andreas 641
        void getTXT(int port, std::vector<int>& channels, std::vector<std::string>& pars);
104 andreas 642
        void doUNI(int port, std::vector<int>& channels, std::vector<std::string>& pars);
643
        void doUTF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
148 andreas 644
        void doVTP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
4 andreas 645
 
111 andreas 646
        void doKPS(int port, std::vector<int>& channels, std::vector<std::string>& pars);
647
        void doVKS(int port, std::vector<int>& channels, std::vector<std::string>& pars);
648
 
21 andreas 649
        void doBBR(int port, std::vector<int>& channels, std::vector<std::string>& pars);
97 andreas 650
        void doRAF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
651
        void doRFR(int port, std::vector<int>& channels, std::vector<std::string>& pars);
21 andreas 652
        void doRMF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
111 andreas 653
        void doRSR(int port, std::vector<int>& channels, std::vector<std::string>& pars);
21 andreas 654
 
62 andreas 655
        void doAKB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
656
        void doAKEYB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
657
        void doAKP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
658
        void doAKEYP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
63 andreas 659
        void doAKEYR(int port, std::vector<int>& channels, std::vector<std::string>& pars);
660
        void doAKR(int port, std::vector<int>& channels, std::vector<std::string>& pars);
108 andreas 661
        void doABEEP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
662
        void doADBEEP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
71 andreas 663
        void doBEEP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
664
        void doDBEEP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
62 andreas 665
        void doEKP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
63 andreas 666
        void doPKB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
667
        void doPKP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
64 andreas 668
        void doSetup(int port, std::vector<int>& channels, std::vector<std::string>& pars);
669
        void doShutdown(int port, std::vector<int>& channels, std::vector<std::string>& pars);
82 andreas 670
        void doSOU(int port, std::vector<int>& channels, std::vector<std::string>& pars);
63 andreas 671
        void doTKP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
672
        void doVKB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
129 andreas 673
#ifndef _NOSIP_
123 andreas 674
        void doPHN(int port, std::vector<int>& channels, std::vector<std::string>& pars);
127 andreas 675
        void getPHN(int port, std::vector<int>& channels, std::vector<std::string>& pars);
129 andreas 676
#endif
225 andreas 677
        // Commands for ListView (G5)
227 andreas 678
        void doLVD(int port, std::vector<int>& channels, std::vector<std::string>& pars);
230 andreas 679
        void doLVE(int port, std::vector<int>& channels, std::vector<std::string>& pars);
227 andreas 680
        void doLVF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
230 andreas 681
        void doLVL(int port, std::vector<int>& channels, std::vector<std::string>& pars);
233 andreas 682
        void doLVM(int port, std::vector<int>& channels, std::vector<std::string>& pars);
683
        void doLVN(int port, std::vector<int>& channels, std::vector<std::string>& pars);
684
        void doLVR(int port, std::vector<int>& channels, std::vector<std::string>& pars);
685
        void doLVS(int port, std::vector<int>& channels, std::vector<std::string>& pars);
134 andreas 686
        // Commands inherited from TPControl (Touch Panel Control)
687
        void doTPCCMD(int port, std::vector<int>& channels, std::vector<std::string>& pars);
688
        void doTPCACC(int port, std::vector<int>& channels, std::vector<std::string>& pars);
153 andreas 689
        void doTPCSIP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
134 andreas 690
 
14 andreas 691
        int mActualPage{0};                             // The number of the actual visible page
15 andreas 692
        int mPreviousPage{0};                           // The number of the previous page
197 andreas 693
        int mSavedPage{0};                              // The number of the last normal page. This is set immediately before a setup page is shown
14 andreas 694
        int mFirstLeftPixel{0};                         // Pixels to add to left (x) mouse coordinate
695
        int mFirstTopPixel{0};                          // Pixels to add to top (y) mouse position
696
        std::string mActualGroupName;                   // The name of the actual group
70 andreas 697
        TSubPage *mActualGroupPage{nullptr};            // Pointer to subpage of a group which is visible
14 andreas 698
 
699
        amx::TAmxNet *mAmxNet{nullptr};                 // Pointer to class TAmxNet; Handles the communication with the controller
700
        TPageList *mPageList{nullptr};                  // List of available pages and subpages
701
        PCHAIN_T *mPchain{nullptr};                     // Pointer to chain of pages in memory
702
        SPCHAIN_T *mSPchain{nullptr};                   // Pointer to chain of subpages in memory for the actual page
703
        TSettings *mTSettings{nullptr};                 // Pointer to basic settings for the panel
193 andreas 704
        TSettings *mSystemSettings{nullptr};            // Pointer to basic system settings for setup
14 andreas 705
        TPalette *mPalette{nullptr};                    // Pointer to the color handler
706
        TFont *mFonts{nullptr};                         // Pointer to the font handler
32 andreas 707
        TExternal *mExternal{nullptr};                  // Pointer to the external buttons (if any)
73 andreas 708
        TSystemDraw *mSystemDraw{nullptr};              // A pointer to the (optional) system resources
14 andreas 709
        std::thread mThreadAmxNet;                      // The thread handle to the controler handler
169 andreas 710
        TVector<amx::ANET_COMMAND> mCommands;           // Command queue of commands received from controller
711
        std::atomic<bool> mBusy{false};                 // Internal used to block the command handler
14 andreas 712
        std::string mCmdBuffer;                         // Internal used buffer for commands who need more than one network package
62 andreas 713
        std::string mAkbText;                           // This is the text for the virtual keyboard (@AKB)
73 andreas 714
        std::string mAkpText;                           // This is the text for the virtual keyad (@AKP)
111 andreas 715
        bool mPassThrough{false};                       // Can ve set to true with the command ^KPS
134 andreas 716
        bool mInformOrientation{false};                 // TRUE = The actual screen orientation is reported to the controller if it change.
717
        int mOrientation{0};                            // Contains the actual orientation.
154 andreas 718
        int mLastPagePush{0};                           // The number of the last page received a push (key press / mouse hit)
164 andreas 719
        double mDPI{96.0};                              // DPI (Dots Per Inch) of the primary display.
169 andreas 720
        std::atomic<bool> cmdLoop_busy{false};          // As long as this is true the command loop thread is active
721
        std::thread mThreadCommand;                     // Thread handle for command loop thread.
193 andreas 722
        bool mSetupActive{false};                       // TRUE = Setup pages are active
198 andreas 723
        std::vector<int> mSavedSubpages;                // When setup pages are called this contains the actual open subpages
206 andreas 724
        std::vector<_FTP_SURFACE_t> mFtpSurface;        // Contains a list of TP4 surface files gained from a NetLinx.
123 andreas 725
        // SIP
129 andreas 726
#ifndef _NOSIP_
123 andreas 727
        bool mPHNautoanswer{false};                     // The state of the SIP autoanswer
127 andreas 728
        TSIPClient *mSIPClient{nullptr};                // Includes the SIP client
129 andreas 729
#endif
70 andreas 730
#ifdef _SCALE_SKIA_
24 andreas 731
        double mScaleFactor{1.0};                       // The scale factor to zoom or shrink all components
31 andreas 732
        double mScaleFactorWidth{1.0};                  // The individual scale factor for the width
733
        double mScaleFactorHeight{1.0};                 // The individual scale factor for the height
198 andreas 734
 
197 andreas 735
        double mScaleSystem{1.0};                       // The scale factor for the system setup pages
736
        double mScaleSystemWidth{1.0};                  // The width scale factor for the system setup pages
737
        double mScaleSystemHeight{1.0};                 // The height scale factor for the system setup pages
198 andreas 738
#endif
93 andreas 739
#ifdef __ANDROID__
740
        int mNetState{0};                               // On Android remembers the type of connection to the network (cell or wifi)
741
#endif
36 andreas 742
        std::map<int, std::function<void (int level)> > mNetCalls;  // List of callbacks for the network state multistate bargraph
38 andreas 743
        std::map<int, std::function<void (int level, bool charging, int chargeType)> > mBatteryCalls;
3 andreas 744
};
745
 
36 andreas 746
#ifdef __ANDROID__
747
extern "C" {
748
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_NetworkStatus_informTPanelNetwork(JNIEnv */*env*/, jclass /*clazz*/, jboolean conn, jint level, jint type);
38 andreas 749
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_BatteryState_informBatteryStatus(JNIEnv */*env*/, jclass /*clazz*/, jint level, jboolean charge, jint chargeType);
61 andreas 750
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_PhoneCallState_informPhoneState(JNIEnv *env, jclass cl, jboolean call, jstring pnumber);
751
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_Logger_logger(JNIEnv *env, jclass cl, jint mode, jstring msg);
130 andreas 752
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_Orientation_informTPanelOrientation(JNIEnv */*env*/, jclass /*clazz*/, jint orientation);
36 andreas 753
}
754
#endif  // __ANDROID__
755
 
3 andreas 756
#endif