Subversion Repositories tpanel

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 andreas 1
/*
332 andreas 2
 * Copyright (C) 2020 to 2023 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"
281 andreas 42
#include "tbitmap.h"
429 andreas 43
#include "tbuttonstates.h"
3 andreas 44
 
14 andreas 45
#define REG_CMD(func, name)     registerCommand(bind(&TPageManager::func, this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3),name)
3 andreas 46
 
8 andreas 47
class TIcons;
14 andreas 48
class TPageManager;
21 andreas 49
 
50
extern bool prg_stopped;
8 andreas 51
extern TIcons *gIcons;
52
extern TPrjResources *gPrjResources;
14 andreas 53
extern TPageManager *gPageManager;
8 andreas 54
 
93 andreas 55
#ifdef __ANDROID__
56
#define NETSTATE_WIFI   1
57
#define NETSTATE_CELL   2
58
#endif
59
 
280 andreas 60
/**
61
 * @brief PGSUBVIEWATOM_T
62
 * This struct contains the elements of an item inside a subview list.
63
 */
64
typedef struct PGSUBVIEWATOM_T
65
{
289 andreas 66
    ulong handle{0};
67
    ulong parent{0};
280 andreas 68
    int top{0};
69
    int left{0};
70
    int width{0};
71
    int height{0};
72
    int instance{0};
281 andreas 73
    TColor::COLOR_T bgcolor{0};
74
    TBitmap image;
293 andreas 75
    std::string bounding;
289 andreas 76
 
77
    void clear()
78
    {
79
        handle = parent = 0;
80
        top = left = width = height = instance = 0;
81
        bgcolor.alpha = bgcolor.blue = bgcolor.green = bgcolor.red = 0;
82
        image.clear();
293 andreas 83
        bounding.clear();
289 andreas 84
    }
280 andreas 85
}PGSUBVIEWATOM_T;
86
 
87
/**
88
 * @brief PGSUBVIEWITEM_T
89
 * This struct contains the overall dimensions and definition of an item of a
90
 * subview list. Each item may consist of one or more buttons. Each item is a
91
 * subpage of it's own.
92
 * All subpage together are the subview list.
93
 */
94
typedef struct PGSUBVIEWITEM_T
95
{
289 andreas 96
    ulong handle{0};
97
    ulong parent{0};
280 andreas 98
    int width{0};
99
    int height{0};
300 andreas 100
    bool scrollbar{false};
101
    int scrollbarOffset{0};
102
    Button::SUBVIEW_POSITION_t position{Button::SVP_CENTER};
302 andreas 103
    bool wrap{false};
281 andreas 104
    TColor::COLOR_T bgcolor;
105
    TBitmap image;
293 andreas 106
    std::string bounding;
280 andreas 107
    std::vector<PGSUBVIEWATOM_T> atoms;
289 andreas 108
 
109
    void clear()
110
    {
111
        handle = parent = 0;
112
        width = height = 0;
113
        bgcolor.alpha = bgcolor.blue = bgcolor.green = bgcolor.red = 0;
302 andreas 114
        scrollbar = wrap = false;
115
        scrollbarOffset = 0;
116
        position = Button::SVP_CENTER;
289 andreas 117
        image.clear();
293 andreas 118
        bounding.clear();
289 andreas 119
        atoms.clear();
120
    }
280 andreas 121
}PGSUBVIEWITEM_T;
122
 
11 andreas 123
class TPageManager : public TAmxCommands
3 andreas 124
{
125
    public:
134 andreas 126
        typedef enum J_ORIENTATION
127
        {
128
            O_UNDEFINED = -1,
129
            O_LANDSCAPE = 0,
130
            O_PORTRAIT = 1,
131
            O_REVERSE_LANDSCAPE = 8,
132
            O_REVERSE_PORTRAIT = 9,
133
            O_FACE_UP = 15,
134
            O_FACE_DOWN = 16
135
        }J_ORIENTATION;
136
 
153 andreas 137
        typedef enum SWIPES
138
        {
139
            SW_UNKNOWN,
140
            SW_LEFT,
141
            SW_RIGHT,
142
            SW_UP,
143
            SW_DOWN
144
        }SWIPES;
145
 
3 andreas 146
        TPageManager();
147
        ~TPageManager();
148
 
279 andreas 149
        bool readPages();                                   //!< Read all pages and subpages
150
        bool readPage(const std::string& name);             //!< Read the page with name \p name
151
        bool readPage(int ID);                              //!< Read the page with id \p ID
152
        bool readSubPage(const std::string& name);          //!< Read the subpage with name \p name
153
        bool readSubPage(int ID);                           //!< Read the subpage with ID \p ID
154
        void updateActualPage();                            //!< Updates all elements of the actual page
155
        void updateSubpage(int ID);                         //!< Updates all elements of a subpage
156
        void updateSubpage(const std::string& name);        //!< Updates all elements of a subpage
157
        std::vector<TSubPage *> createSubViewList(int id);  //!< Create a list of subview pages
280 andreas 158
        void showSubViewList(int id, Button::TButton *bt);  //!< Creates and displays a subview list
300 andreas 159
        void updateSubViewItem(Button::TButton *bt);        //!< Updates an existing subview item
3 andreas 160
 
62 andreas 161
        TPageList *getPageList() { return mPageList; }      //!< Get the list of all pages
162
        TSettings *getSettings() { return mTSettings; }     //!< Get the (system) settings of the panel
197 andreas 163
        TSettings *getSystemSettings() { return mSystemSettings; } //!< Get the system settings of the setup pages
3 andreas 164
 
62 andreas 165
        TPage *getActualPage();                             //!< Get the actual page
166
        int getActualPageNumber() { return mActualPage; }   //!< Get the ID of the actual page
167
        int getPreviousPageNumber() { return mPreviousPage; }   //!< Get the ID of the previous page, if there was any.
4 andreas 168
        TSubPage *getFirstSubPage();
169
        TSubPage *getNextSubPage();
154 andreas 170
        TSubPage *getPrevSubPage();
171
        TSubPage *getLastSubPage();
11 andreas 172
        TSubPage *getFirstSubPageGroup(const std::string& group);
173
        TSubPage *getNextSubPageGroup();
174
        TSubPage *getNextSubPageGroup(const std::string& group, TSubPage *pg);
175
        TSubPage *getTopPage();
4 andreas 176
 
177
        TPage *getPage(int pageID);
178
        TPage *getPage(const std::string& name);
198 andreas 179
        bool setPage(int PageID, bool forget=false);
168 andreas 180
        bool setPage(const std::string& name, bool forget=false);
4 andreas 181
        TSubPage *getSubPage(int pageID);
182
        TSubPage *getSubPage(const std::string& name);
96 andreas 183
        TSubPage *deliverSubPage(const std::string& name, TPage **pg=nullptr);
198 andreas 184
        TSubPage *deliverSubPage(int number, TPage **pg=nullptr);
14 andreas 185
        bool havePage(const std::string& name);
186
        bool haveSubPage(const std::string& name);
187
        bool haveSubPage(int id);
188
        bool haveSubPage(const std::string& page, const std::string& name);
189
        bool haveSubPage(const std::string& page, int id);
50 andreas 190
        TFont *getFonts() { return mFonts; }
51 andreas 191
        Button::TButton *findButton(ulong handle);
427 andreas 192
        Button::TButton *findBargraph(int lp, int lv, ulong parent);
153 andreas 193
        void onSwipeEvent(SWIPES sw);
164 andreas 194
        double getDPI() { return mDPI; }
195
        void setDPI(const double dpi) { mDPI = dpi; }
4 andreas 196
 
391 andreas 197
        void registerCallbackDB(std::function<void(ulong handle, ulong parent, TBitmap buffer, int width, int height, int left, int top, bool passthrough, int marqtype, int marq)> displayButton) { _displayButton = displayButton; }
198
        void registerSetMarqueeText(std::function<void(Button::TButton *button)> marquee) { _setMarqueeText = marquee; }
190 andreas 199
        void registerDropButton(std::function<void(ulong hanlde)> dropButton) { _dropButton = dropButton; }
98 andreas 200
        void registerCBsetVisible(std::function<void(ulong handle, bool state)> setVisible) { _setVisible = setVisible; }
5 andreas 201
        void registerCallbackSP(std::function<void (ulong handle, int width, int height)> setPage) { _setPage = setPage; }
418 andreas 202
        void registerCallbackSSP(std::function<void (ulong handle, ulong parent, int left, int top, int width, int height, ANIMATION_t animate, bool modal)> setSubPage) { _setSubPage = setSubPage; }
262 andreas 203
#ifdef _OPAQUE_SKIA_
289 andreas 204
        void registerCallbackSB(std::function<void (ulong handle, TBitmap image, int width, int height, ulong color)> setBackground) {_setBackground = setBackground; }
262 andreas 205
#else
289 andreas 206
        void registerCallbackSB(std::function<void (ulong handle, TBitmap image, int width, int height, ulong color, int opacity)> setBackground) {_setBackground = setBackground; }
262 andreas 207
#endif
26 andreas 208
        void deployCallbacks();
36 andreas 209
#ifdef __ANDROID__
210
        void initNetworkState();
211
        void stopNetworkState();
38 andreas 212
        void initBatteryState();
213
        void stopBatteryState();
61 andreas 214
        void initPhoneState();
36 andreas 215
        void informTPanelNetwork(jboolean conn, jint level, jint type);
38 andreas 216
        void informBatteryStatus(jint level, jboolean charging, jint chargeType);
61 andreas 217
        void informPhoneState(bool call, const std::string& pnumber);
130 andreas 218
        void initOrientation();
255 andreas 219
        void enterSetup();
36 andreas 220
#endif
247 andreas 221
#ifdef Q_OS_IOS
222
        void informBatteryStatus(int level, int state);
250 andreas 223
        void informTPanelNetwork(bool conn, int level, int type);
247 andreas 224
#endif
11 andreas 225
        void regCallDropPage(std::function<void (ulong handle)> callDropPage) { _callDropPage = callDropPage; }
350 andreas 226
        void regCallDropSubPage(std::function<void (ulong handle, ulong parent)> callDropSubPage) { _callDropSubPage = callDropSubPage; }
21 andreas 227
        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; };
291 andreas 228
        void regCallInputText(std::function<void (Button::TButton *button, Button::BITMAP_t& bm, int frame)> callInputText) { _callInputText = callInputText; }
229
        void regCallListBox(std::function<void (Button::TButton *button, Button::BITMAP_t& bm, int frame)> callListBox) { _callListBox = callListBox; }
63 andreas 230
        void regCallbackKeyboard(std::function<void (const std::string& init, const std::string& prompt, bool priv)> callKeyboard) { _callKeyboard = callKeyboard; }
231
        void regCallbackKeypad(std::function<void (const std::string& init, const std::string& prompt, bool priv)> callKeypad) { _callKeypad = callKeypad; }
232
        void regCallResetKeyboard(std::function<void ()> callResetKeyboard) { _callResetKeyboard = callResetKeyboard; }
64 andreas 233
        void regCallShowSetup(std::function<void ()> callShowSetup) { _callShowSetup = callShowSetup; }
36 andreas 234
        void regCallbackNetState(std::function<void (int level)> callNetState, ulong handle);
235
        void unregCallbackNetState(ulong handle);
247 andreas 236
#ifdef Q_OS_ANDROID
38 andreas 237
        void regCallbackBatteryState(std::function<void (int level, bool charging, int chargeType)> callBatteryState, ulong handle);
247 andreas 238
#endif
239
#ifdef Q_OS_IOS
240
        void regCallbackBatteryState(std::function<void (int level, int state)> callBatteryState, ulong handle);
241
#endif
242
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
38 andreas 243
        void unregCallbackBatteryState(ulong handle);
247 andreas 244
#endif
44 andreas 245
        void regCallbackResetSurface(std::function<void ()> resetSurface) { _resetSurface = resetSurface; }
64 andreas 246
        void regCallbackShutdown(std::function<void ()> shutdown) { _shutdown = shutdown; }
71 andreas 247
        void regCallbackPlaySound(std::function<void (const std::string& file)> playSound) { _playSound = playSound; }
141 andreas 248
        void regCallbackStopSound(std::function<void ()> stopSound) { _stopSound = stopSound; }
249
        void regCallbackMuteSound(std::function<void (bool state)> muteSound) { _muteSound = muteSound; }
335 andreas 250
        void regCallbackSetVolume(std::function<void (int volume)> setVolume) { _setVolume = setVolume; }
111 andreas 251
        void regSendVirtualKeys(std::function<void (const std::string& str)> sendVirtualKeys) { _sendVirtualKeys = sendVirtualKeys; }
140 andreas 252
        void regShowPhoneDialog(std::function<void (bool state)> showPhoneDialog) { _showPhoneDialog = showPhoneDialog; }
253
        void regSetPhoneNumber(std::function<void (const std::string& number)> setPhoneNumber) { _setPhoneNumber = setPhoneNumber; }
254
        void regSetPhoneStatus(std::function<void (const std::string& msg)> setPhoneStatus) { _setPhoneStatus = setPhoneStatus; }
255
        void regSetPhoneState(std::function<void (int state, int id)> setPhoneState) { _setPhoneState = setPhoneState; }
206 andreas 256
        void regDisplayMessage(std::function<void (const std::string& msg, const std::string& title)> msg) { _displayMessage = msg; }
401 andreas 257
        void regAskPassword(std::function<void (ulong handle, const std::string& msg, const std::string& title, int x, int y)> pw) { _askPassword = pw; }
209 andreas 258
        void regFileDialogFunction(std::function<void (ulong handle, const std::string& path, const std::string& extension, const std::string& suffix)> fdlg) { _fileDialog = fdlg; }
235 andreas 259
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
130 andreas 260
        void regOnOrientationChange(std::function<void (int orientation)> orientationChange) { _onOrientationChange = orientationChange; }
259 andreas 261
        void regOnSettingsChanged(std::function<void (const std::string& oldNetlinx, int oldPort, int oldChannelID, const std::string& oldSurface, bool oldToolbarSuppress, bool oldToolbarForce)> settingsChanged) { _onSettingsChanged = settingsChanged; }
130 andreas 262
#endif
142 andreas 263
        void regRepaintWindows(std::function<void ()> repaintWindows) { _repaintWindows = repaintWindows; }
151 andreas 264
        void regToFront(std::function<void (ulong handle)> toFront) { _toFront = toFront; }
197 andreas 265
        void regSetMainWindowSize(std::function<void (int width, int height)> setSize) { _setMainWindowSize = setSize; }
206 andreas 266
        void regDownloadSurface(std::function<void (const std::string& file, size_t size)> dl) { _downloadSurface = dl; }
260 andreas 267
        void regStartWait(std::function<void (const std::string& text)> sw) { _startWait = sw; }
268
        void regStopWait(std::function<void ()> sw) { _stopWait = sw; }
306 andreas 269
        void regPageFinished(std::function<void (ulong handle)> pf) { _pageFinished = pf; }
289 andreas 270
        void regDisplayViewButton(std::function<void (ulong handle, ulong parent, bool vertical, TBitmap buffer, int width, int height, int left, int top, int space, TColor::COLOR_T)> dvb) { _displayViewButton = dvb; }
280 andreas 271
        void regAddViewButtonItem(std::function<void (Button::TButton& button, unsigned char *buffer, int pixline)> avbi) { _addViewButtonItem = avbi; }
285 andreas 272
        void regAddViewButtonItems(std::function<void (ulong parent, std::vector<PGSUBVIEWITEM_T> items)> abvi) { _addViewButtonItems = abvi; }
300 andreas 273
        void regUpdateViewButton(std::function<void (ulong handle, ulong parent, TBitmap buffer, TColor::COLOR_T fillColor)> uvb) { _updateViewButton = uvb; }
274
        void regUpdateViewButtonItem(std::function<void (PGSUBVIEWITEM_T& item, ulong parent)> uvb) { _updateViewButtonItem = uvb; }
275
        void regShowSubViewItem(std::function<void (ulong handle, ulong parent, int position, int timer)> ssvi) { _showSubViewItem = ssvi; }
318 andreas 276
        void regToggleSubViewItem(std::function<void (ulong handle, ulong parent, int position, int timer)> tsvi) { _toggleSubViewItem = tsvi; }
277
        void regHideAllSubViewItems(std::function<void (ulong handle)> hasvi) { _hideAllSubViewItems = hasvi; }
278
        void regHideSubViewItem(std::function<void (ulong handle, ulong parent)> hsvi) { _hideSubViewItem = hsvi; }
279
        void regSetSubViewPadding(std::function<void (ulong handle, int padding)> ssvp) { _setSubViewPadding = ssvp; }
142 andreas 280
 
11 andreas 281
        /**
282
         * The following function must be called to start non graphics part
283
         * of the panel simulator. If everything worked well, it returns TRUE.
284
         * otherwise a FALSE is returned and the program should be terminated.
285
         */
5 andreas 286
        bool run();
11 andreas 287
        /**
288
         * Set an X value to add to the coordinated reported by the mouse catch
289
         * event. In case the X coordinate reported by the event is not the real
290
         * X coordinate, it's possible to set an X coordinate to translate the
291
         * internal used coordinates.
292
         *
14 andreas 293
         * @param x
294
         * The left most pixel which correspond to X = 0
11 andreas 295
         */
10 andreas 296
        void setFirstLeftPixel(int x) { mFirstLeftPixel = x; }
11 andreas 297
        /**
298
         * Set an Y value to add to the coordinated reported by the mouse catch
299
         * event. In case the Y coordinate reported by the event is not the real
300
         * Y coordinate, it's possible to set an Y coordinate to translate the
301
         * internal used coordinates.
302
         *
14 andreas 303
         * @param y
43 andreas 304
         * The top most pixel which correspond to Y = 0
11 andreas 305
         */
10 andreas 306
        void setFirstTopPixel(int y) { mFirstTopPixel = y; }
11 andreas 307
        /**
308
         * This function must be called from a GUI whenever the left mouse
309
         * button was pressed or released. Also if there was a touch event
14 andreas 310
         * this function must be called in the same way. It's up to any GUI
11 andreas 311
         * to handle the mouse and or touch events.
312
         *
14 andreas 313
         * @param x
314
         * the X coordinate of the mouse/touch event
315
         *
316
         * @param y
317
         * the y coordinate if the mouse/touch event
318
         *
319
         * @return
11 andreas 320
         * pressed TRUE = button was pressed; FALSE = button was released
321
         */
10 andreas 322
        void mouseEvent(int x, int y, bool pressed);
51 andreas 323
        /**
289 andreas 324
         * @brief mouseEvent
325
         * This function can be called from a GUI if the coordinates of the
326
         * mouse click are not available but the handle of an object who
327
         * received a mouse click.
328
         *
329
         * @param handle    The handle of an object
330
         * @param pressed   TRUE=The mouse button is pressed.
331
         */
332
        void mouseEvent(ulong handle, bool pressed);
333
        /**
409 andreas 334
         * @brief mouseMoveEvent - Moves bar on a bargraph
335
         * This method looks for an object which is a bargraph. If so it is
336
         * moved to the position of the mouse pointer. The behavior depends on
337
         * the settings.
338
         * This method just queues the event. For real handling of it look at
339
         * method _mouseEvent().
340
         *
341
         * @param x     The x coordinate of the mouse pointer
342
         * @param y     The y coordinate of the mouse pointer
343
         */
344
        void mouseMoveEvent(int x, int y);
345
        /**
51 andreas 346
         * Searches for a button with the handle \p handle and determines all
347
         * buttons with the same port and channel. Then it sets \p txt to all
348
         * found buttons.
349
         *
350
         * @param handle    The handle of a button.
351
         * @param txt       The text usualy comming from an input line.
208 andreas 352
         * @param redraw    If this is set to true the button is redrawn.
51 andreas 353
         */
208 andreas 354
        void setTextToButton(ulong handle, const std::string& txt, bool redraw=false);
51 andreas 355
        /**
356
         * Iterates through all active subpages of the active page and drops
357
         * them.
358
         */
14 andreas 359
        void dropAllSubPages();
51 andreas 360
        /**
361
         * Closes all subpages in the group \p group.
362
         *
363
         * @param group The name of the group.
364
         */
14 andreas 365
        void closeGroup(const std::string& group);
51 andreas 366
        /**
198 andreas 367
         * Displays the subpage \p name. If the subpage is part of a group
51 andreas 368
         * the open subpage in the group is closed, if there was one open. Then
369
         * the subpage is displayed. If the subpage is not already in the
370
         * internal buffer it's configuration file is read and the page is
371
         * created.
372
         *
373
         * @param name  The name of the subpage to display.
374
         */
14 andreas 375
        void showSubPage(const std::string& name);
51 andreas 376
        /**
198 andreas 377
         * Displays the subpage \p number. If the subpage is part of a group
378
         * the open subpage in the group is closed, if there was one open. Then
379
         * the subpage is displayed. If the subpage is not already in the
380
         * internal buffer it's configuration file is read and the page is
381
         * created.
382
         *
383
         * @param name  The name of the subpage to display.
384
         */
385
        void showSubPage(int number, bool force=false);
386
        /**
51 andreas 387
         * Hides the subpage \p name.
388
         *
389
         * @param name  The name of the subpage to hide.
390
         */
14 andreas 391
        void hideSubPage(const std::string& name);
192 andreas 392
        /**
393
         * This is called whenever an input button finished or changed it's
309 andreas 394
         * content. It is called indirectly out of the class TQEditLine.
192 andreas 395
         * The method writes the content into the text area of the button the
396
         * handle points to.
397
         *
398
         * @param handle   The handle of the button.
399
         * @param content  The content of the text area.
400
         */
401
        void inputButtonFinished(ulong handle, const std::string& content);
309 andreas 402
        void inputCursorPositionChanged(ulong handle, int oldPos, int newPos);
403
        void inputFocusChanged(ulong handle, bool in);
43 andreas 404
#ifdef _SCALE_SKIA_
24 andreas 405
        void setScaleFactor(double scale) { mScaleFactor = scale; }
406
        double getScaleFactor() { return mScaleFactor; }
31 andreas 407
        void setScaleFactorWidth(double scale) { mScaleFactorWidth = scale; }
408
        double getScaleFactorWidth() { return mScaleFactorWidth; }
409
        void setScaleFactorHeight(double scale) { mScaleFactorHeight = scale; }
410
        double getScaleFactorHeight() { return mScaleFactorHeight; }
43 andreas 411
#endif
62 andreas 412
        /**
413
         * This method handles some external buttons. Some original panels from
414
         * AMX have external hard buttons. TPanel simulates some of them like
415
         * the arrow keys, enter button and volume. The graphical surface may
416
         * display a toolbar on the right side (only if there is enough space
417
         * left) which offers this buttons. When such a button was pressed, this
418
         * method is called to send them to the controller.
419
         *
420
         * @param bt        The button who was pressed
421
         * @param checked   On button press this is TRUE, and on release it is FALSE.
422
         */
33 andreas 423
        void externalButton(extButtons_t bt, bool checked);
429 andreas 424
 
62 andreas 425
        void sendKeyboard(const std::string& text);
426
        void sendKeypad(const std::string& text);
427
        void sendString(uint handle, const std::string& text);
134 andreas 428
        void sendGlobalString(const std::string& text);
123 andreas 429
        void sendPHNcommand(const std::string& cmd);
111 andreas 430
        void sendKeyStroke(char key);
147 andreas 431
        void sendCommandString(int port, const std::string& cmd);
428 andreas 432
        void sendLevel(int lp, int lv, int level);
433
        void sendInternalLevel(int lp, int lv, int level);
401 andreas 434
        void callSetPassword(ulong handle, const std::string& pw, int x, int y);
431 andreas 435
        TButtonStates *addButtonState(BUTTONTYPE t, int rap, int rad, int rch, int rcp, int rlp, int rlv);
429 andreas 436
        TButtonStates *addButtonState(const TButtonStates& bs);
431 andreas 437
        TButtonStates *getButtonState(BUTTONTYPE t, int rap, int rad, int rch, int rcp, int rlp, int rlv);
438
        TButtonStates *getButtonState(uint32_t id);
439
        TButtonStates *getButtonState(BUTTONTYPE t, uint32_t id);
429 andreas 440
 
62 andreas 441
        /**
442
         * This starts the communication with the AMX controller. The method
443
         * registers the callbacks and starts a thread. This thread runs as
444
         * long as a valid communication is possible or until the communication
445
         * end by a command.
446
         */
38 andreas 447
        void startUp();
147 andreas 448
        /**
169 andreas 449
         * This starts a thread running the command loop. Each event from the
192 andreas 450
         * Netlinx is entered into a vector array (doCommand()) and this
169 andreas 451
         * method starts the event loop as a thread running as long as this
452
         * class exists.
453
         */
454
        void runCommands();
455
        /**
456
         * This method is the thread started by the command runCommands().
457
         */
458
        void commandLoop();
459
        /**
147 andreas 460
         * Callback function for the AMX controller part. This function must
461
         * be registered to the class TAmxNet and is called from this module
462
         * every time an event occured from the controller.
463
         * This method handles the commands comming from the controller and
464
         * draws the necessary elements before they are sent to the GUI.
465
         *
466
         * @param cmd
467
         * An ANET_COMMAND structure containing the received command.
468
         */
469
        void doCommand(const amx::ANET_COMMAND& cmd);
193 andreas 470
        /**
471
         * Returns the state of setup. If the setup pages are active it returns
472
         * TRUE.
473
         *
474
         * @return State of setup pages
475
         */
476
        bool isSetupActive() { return mSetupActive; }
197 andreas 477
        /**
478
         * Activates the setup pages unless they are not visible already.
479
         */
480
        void showSetup();
481
        /**
482
         * Deactivates the setup pages and restores the previous normal page.
483
         */
484
        void hideSetup();
485
        /**
205 andreas 486
         * Determines the page or subpage the handle points to and returns the
487
         * selected row of a list, if there is one.
488
         * The row index starts by 1!
489
         *
490
         * @param handle    The handle of the button.
491
         * @return If the button is a list and a row was selected then a number
492
         * grater than 0 is returned. Otherwise -1 is returned.
493
         */
494
        int getSelectedRow(ulong handle);
495
        /**
496
         * Finds the page or subpage and returns the selected item as a string.
497
         * If there was no list, or no items in the list, or nothing selected,
498
         * an empty string is returned.
499
         *
500
         * @param handle    The handle of the button
501
         * @return The string of the selected item or an empty string.
502
         */
503
        std::string getSelectedItem(ulong handle);
504
        /**
505
         * Finds the corresponding list and sets the selected row. The \b row
506
         * must be a value starting by 1. It must not be bigger that items in
507
         * the list.
508
         *
509
         * @param handle    The handle of the button
510
         * @param row       The number of the selected row.
511
         */
206 andreas 512
        void setSelectedRow(ulong handle, int row, const std::string& text);
383 andreas 513
        /**
514
         * @brief redrawObject - redraws an object
515
         * The method sends the last stored graphic to the surface where it is
516
         * drawn.
517
         * If the object is not visible, it is not redrawn.
518
         *
519
         * @param handle    The handle of the object.
520
         */
521
        void redrawObject(ulong handle);
247 andreas 522
#ifdef Q_OS_IOS
523
        void setBattery(int level, int state) { mLastBatteryLevel = level; mLastBatteryState = state; }
524
#endif
205 andreas 525
#ifdef _SCALE_SKIA_
526
        /**
197 andreas 527
         * Set the scale factor for the system setup pages. On a desktop this
528
         * factor is in relation to the size of the normal pages, if there any.
529
         * On a mobile device the factor is in relation to the resolution of
530
         * the display.
531
         * The scale factor is calculated in qtmain.cpp: MainWindow::calcScaleSetup()
532
         *
533
         * @param scale  The overall scale factor. This is used for calculations
534
         * and ensures that the ratio of the objects is maintained.
535
         * @param sw     The scale factor for the width.
536
         * @param sh     The scale factor for the height.
537
         */
538
        void setSetupScaleFactor(double scale, double sw, double sh);
198 andreas 539
#endif
62 andreas 540
        // Callbacks who will be registered by the graphical surface.
391 andreas 541
        std::function<void (ulong handle, ulong parent, TBitmap buffer, int width, int height, int left, int top, bool passthrough, int marqtype, int marq)> getCallbackDB() { return _displayButton; }
542
        std::function<void (Button::TButton *button)> getSetMarqueeText() { return _setMarqueeText; }
190 andreas 543
        std::function<void (ulong handle)> getCallDropButton() { return _dropButton; }
98 andreas 544
        std::function<void (ulong handle, bool state)> getVisible() { return _setVisible; };
262 andreas 545
#ifdef _OPAQUE_SKIA_
289 andreas 546
        std::function<void (ulong handle, TBitmap image, int width, int height, ulong color)> getCallbackBG() { return _setBackground; }
262 andreas 547
#else
289 andreas 548
        std::function<void (ulong handle, TBitmap image, int width, int height, ulong color, int opacity)> getCallbackBG() { return _setBackground; }
262 andreas 549
#endif
26 andreas 550
        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 551
        std::function<void (ulong handle, int width, int height)> getCallbackSetPage() { return _setPage; }
291 andreas 552
        std::function<void (Button::TButton *button, Button::BITMAP_t& bm, int frame)> getCallbackInputText() { return _callInputText; }
553
        std::function<void (Button::TButton *button, Button::BITMAP_t& bm, int frame)> getCallbackListBox() { return _callListBox; }
418 andreas 554
        std::function<void (ulong handle, ulong parent, int left, int top, int width, int height, ANIMATION_t animate, bool modal)> getCallbackSetSubPage() { return _setSubPage; }
38 andreas 555
        std::function<void (ulong handle)> getCallDropPage() { return _callDropPage; }
350 andreas 556
        std::function<void (ulong handle, ulong parent)> getCallDropSubPage() { return _callDropSubPage; }
71 andreas 557
        std::function<void (const std::string& file)> getCallPlaySound() { return _playSound; }
141 andreas 558
        std::function<void ()> getCallStopSound() { return _stopSound; }
559
        std::function<void (bool state)> getCallMuteSound() { return _muteSound; }
335 andreas 560
        std::function<void (int volume)> getCallSetVolume() { return _setVolume; }
111 andreas 561
        std::function<void (const std::string& str)> sendVirtualKeys() { return _sendVirtualKeys; }
140 andreas 562
        std::function<void (bool state)> getShowPhoneDialog() { return _showPhoneDialog; }
563
        std::function<void (const std::string& number)> getSetPhoneNumber() { return _setPhoneNumber; }
564
        std::function<void (const std::string& msg)> getSetPhoneStatus() { return _setPhoneStatus; }
565
        std::function<void (int state, int id)> getSetPhoneState() { return _setPhoneState; }
151 andreas 566
        std::function<void (ulong handle)> getToFront() { return _toFront; }
197 andreas 567
        std::function<void (int width, int height)> getMainWindowSizeFunc() { return _setMainWindowSize; }
206 andreas 568
        std::function<void (const std::string& file, size_t size)> getDownloadSurface() { return _downloadSurface; }
569
        std::function<void (const std::string& msg, const std::string& title)> getDisplayMessage() { return _displayMessage; }
401 andreas 570
        std::function<void (ulong handle, const std::string& msg, const std::string& title, int x, int y)> getAskPassword() { return _askPassword; }
209 andreas 571
        std::function<void (ulong handle, const std::string& path, const std::string& extension, const std::string& suffix)> getFileDialogFunction() { return _fileDialog; }
260 andreas 572
        std::function<void (const std::string& text)> getStartWait() { return _startWait; }
573
        std::function<void ()> getStopWait() { return _stopWait; }
306 andreas 574
        std::function<void (ulong handle)> getPageFinished() { return _pageFinished; }
289 andreas 575
        std::function<void (ulong handle, ulong parent, bool vertical, TBitmap buffer, int width, int height, int left, int top, int space, TColor::COLOR_T fillColor)> getDisplayViewButton() { return _displayViewButton; }
280 andreas 576
        std::function<void (Button::TButton& button, unsigned char *buffer, int pixline)> getAddViewButtonItem() { return _addViewButtonItem; }
285 andreas 577
        std::function<void (ulong parent, std::vector<PGSUBVIEWITEM_T> items)> getAddViewButtonItems() { return _addViewButtonItems; }
300 andreas 578
        std::function<void (ulong handle, ulong parent, TBitmap buffer, TColor::COLOR_T fillColor)> getUpdateViewButton() { return _updateViewButton; }
579
        std::function<void (PGSUBVIEWITEM_T& item, ulong parent)> getUpdateViewButtonItem() { return _updateViewButtonItem; }
580
        std::function<void (ulong handle, ulong parent, int position, int timer)> getShowSubViewItem() { return _showSubViewItem; }
318 andreas 581
        std::function<void (ulong handle, ulong parent, int position, int timer)> getToggleSubViewItem() { return _toggleSubViewItem; }
582
        std::function<void (ulong handle)> getHideAllSubViewItems() { return _hideAllSubViewItems; }
583
        std::function<void (ulong handle, ulong parent)> getHideSubViewItem() { return _hideSubViewItem; }
584
        std::function<void (ulong handle, int padding)> getSetSubViewPadding() { return _setSubViewPadding; }
235 andreas 585
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
130 andreas 586
        std::function<void (int orientation)> onOrientationChange() { return _onOrientationChange; }
259 andreas 587
        std::function<void (const std::string& oldNetlinx, int oldPort, int oldChannelID, const std::string& oldSurface, bool oldToolbarSuppress, bool oldToolbarForce)> onSettingsChanged() { return _onSettingsChanged; }
130 andreas 588
#endif
318 andreas 589
        bool getLevelSendState() { return mLevelSend; }
590
        bool getRxSendState() { return mRxOn; }
142 andreas 591
        std::function<void ()> getRepaintWindows() { return _repaintWindows; }
134 andreas 592
        int getOrientation() { return mOrientation; }
593
        void setOrientation(int ori) { mOrientation = ori; }
594
        bool getInformOrientation() { return mInformOrientation; }
595
        void sendOrientation();
71 andreas 596
        bool havePlaySound() { return _playSound != nullptr; }
73 andreas 597
        TSystemDraw *getSystemDraw() { return mSystemDraw; }
89 andreas 598
        void reset();
111 andreas 599
        bool getPassThrough() { return mPassThrough; }
113 andreas 600
        bool haveSetupPage() { return _callShowSetup != nullptr; }
601
        bool haveShutdown() { return _shutdown != nullptr; }
602
        void callSetupPage() { if (_callShowSetup) _callShowSetup(); }
603
        void callShutdown() { if (_shutdown) _shutdown(); }
129 andreas 604
#ifndef _NOSIP_
123 andreas 605
        bool getPHNautoanswer() { return mPHNautoanswer; }
606
        void sendPHN(std::vector<std::string>& cmds);
141 andreas 607
        void actPHN(std::vector<std::string>& cmds);
140 andreas 608
        void phonePickup(int id);
609
        void phoneHangup(int id);
129 andreas 610
#endif
206 andreas 611
        void addFtpSurface(const std::string& file, size_t size) { mFtpSurface.push_back(_FTP_SURFACE_t{file, size}); };
612
 
613
        inline size_t getFtpSurfaceSize(const std::string& file)
614
        {
615
            if (mFtpSurface.empty())
616
                return 0;
617
 
618
            std::vector<_FTP_SURFACE_t>::iterator iter;
619
 
620
            for (iter = mFtpSurface.begin(); iter != mFtpSurface.end(); ++iter)
621
            {
622
                if (iter->file == file)
623
                    return iter->size;
624
            }
625
 
626
            return 0;
627
        }
628
 
629
        void clearFtpSurface() { mFtpSurface.clear(); }
630
 
3 andreas 631
    protected:
632
        PAGELIST_T findPage(const std::string& name);
633
        PAGELIST_T findPage(int ID);
634
        SUBPAGELIST_T findSubPage(const std::string& name);
635
        SUBPAGELIST_T findSubPage(int ID);
636
 
637
        bool addPage(TPage *pg);
638
        bool addSubPage(TSubPage *pg);
11 andreas 639
        TSubPage *getCoordMatch(int x, int y);
40 andreas 640
        Button::TButton *getCoordMatchPage(int x, int y);
11 andreas 641
        void initialize();
642
        void dropAllPages();
92 andreas 643
        bool startComm();
3 andreas 644
 
645
    private:
391 andreas 646
        std::function<void (ulong handle, ulong parent, TBitmap image, int width, int height, int left, int top, bool passthrough, int marqtype, int marq)> _displayButton{nullptr};
647
        std::function<void (Button::TButton *button)> _setMarqueeText{nullptr};
190 andreas 648
        std::function<void (ulong handle)> _dropButton{nullptr};
98 andreas 649
        std::function<void (ulong handle, bool state)> _setVisible{nullptr};
5 andreas 650
        std::function<void (ulong handle, int width, int height)> _setPage{nullptr};
418 andreas 651
        std::function<void (ulong handle, ulong parent, int left, int top, int width, int height, ANIMATION_t animate, bool modal)> _setSubPage{nullptr};
262 andreas 652
#ifdef _OPAQUE_SKIA_
289 andreas 653
        std::function<void (ulong handle, TBitmap image, int width, int height, ulong color)> _setBackground{nullptr};
262 andreas 654
#else
289 andreas 655
        std::function<void (ulong handle, TBitmap image, int width, int height, ulong color, int opacity)> _setBackground{nullptr};
262 andreas 656
#endif
7 andreas 657
        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 658
        std::function<void (ulong handle)> _callDropPage{nullptr};
350 andreas 659
        std::function<void (ulong handle, ulong parent)> _callDropSubPage{nullptr};
21 andreas 660
        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};
291 andreas 661
        std::function<void (Button::TButton *button, Button::BITMAP_t& bm, int frame)> _callInputText{nullptr};
662
        std::function<void (Button::TButton *button, Button::BITMAP_t& bm, int frame)> _callListBox{nullptr};
63 andreas 663
        std::function<void (const std::string& init, const std::string& prompt, bool priv)> _callKeyboard{nullptr};
664
        std::function<void (const std::string& init, const std::string& prompt, bool priv)> _callKeypad{nullptr};
665
        std::function<void ()> _callResetKeyboard{nullptr};
64 andreas 666
        std::function<void ()> _callShowSetup{nullptr};
44 andreas 667
        std::function<void ()> _resetSurface{nullptr};
64 andreas 668
        std::function<void ()> _shutdown{nullptr};
71 andreas 669
        std::function<void (const std::string& file)> _playSound{nullptr};
141 andreas 670
        std::function<void ()> _stopSound{nullptr};
671
        std::function<void (bool state)> _muteSound{nullptr};
335 andreas 672
        std::function<void (int volume)> _setVolume{nullptr};
111 andreas 673
        std::function<void (const std::string& str)> _sendVirtualKeys{nullptr};
140 andreas 674
        std::function<void (bool state)> _showPhoneDialog{nullptr};
675
        std::function<void (const std::string& number)> _setPhoneNumber{nullptr};
676
        std::function<void (const std::string& msg)> _setPhoneStatus{nullptr};
677
        std::function<void (int state, int id)> _setPhoneState{nullptr};
142 andreas 678
        std::function<void ()> _repaintWindows{nullptr};
151 andreas 679
        std::function<void (uint handle)> _toFront{nullptr};
197 andreas 680
        std::function<void (int width, int height)> _setMainWindowSize{nullptr};
206 andreas 681
        std::function<void (const std::string& file, size_t size)> _downloadSurface{nullptr};
682
        std::function<void (const std::string& msg, const std::string& title)> _displayMessage{nullptr};
401 andreas 683
        std::function<void (ulong handle, const std::string& msg, const std::string& title, int x, int y)> _askPassword{nullptr};
209 andreas 684
        std::function<void (ulong handle, const std::string& path, const std::string& extension, const std::string& suffix)> _fileDialog{nullptr};
260 andreas 685
        std::function<void (const std::string& text)> _startWait{nullptr};
686
        std::function<void ()> _stopWait{nullptr};
306 andreas 687
        std::function<void (ulong handle)> _pageFinished{nullptr};
289 andreas 688
        std::function<void (ulong handle, ulong parent, bool vertical, TBitmap buffer, int width, int height, int left, int top, int space, TColor::COLOR_T fillColor)> _displayViewButton{nullptr};
280 andreas 689
        std::function<void (Button::TButton& button, unsigned char *buffer, int pixline)> _addViewButtonItem{nullptr};
300 andreas 690
        std::function<void (ulong handle, ulong parent, TBitmap buffer, TColor::COLOR_T fillColor)> _updateViewButton{nullptr};
285 andreas 691
        std::function<void (ulong parent, std::vector<PGSUBVIEWITEM_T> items)> _addViewButtonItems{nullptr};
300 andreas 692
        std::function<void (PGSUBVIEWITEM_T& item, ulong parent)> _updateViewButtonItem{nullptr};
693
        std::function<void (ulong handle, ulong parent, int position, int timer)> _showSubViewItem{nullptr};
318 andreas 694
        std::function<void (ulong handle, ulong parent, int position, int timer)> _toggleSubViewItem{nullptr};
695
        std::function<void (ulong handle)> _hideAllSubViewItems{nullptr};
696
        std::function<void (ulong handle, ulong parent)> _hideSubViewItem{nullptr};
697
        std::function<void (ulong handle, int padding)> _setSubViewPadding{nullptr};
259 andreas 698
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
130 andreas 699
        std::function<void (int orientation)> _onOrientationChange{nullptr};
259 andreas 700
        std::function<void (const std::string& oldNetlinx, int oldPort, int oldChannelID, const std::string& oldSurface, bool oldToolbarSuppress, bool oldToolbarForce)> _onSettingsChanged{nullptr};
130 andreas 701
#endif
206 andreas 702
        typedef struct _FTP_SURFACE_t
703
        {
704
            std::string file;
705
            size_t size{0};
706
        }_FTP_SURFACE_t;
707
 
409 andreas 708
        typedef enum _EVENT_TYPE
709
        {
710
            _EVENT_MOUSE_CLICK,
711
            _EVENT_MOUSE_MOVE
712
        }_EVENT_TYPE;
713
 
293 andreas 714
        typedef struct _CLICK_QUEUE_t
715
        {
299 andreas 716
            bool coords{false};
717
            ulong handle{0};
718
            bool pressed{false};
719
            int x{0};
720
            int y{0};
409 andreas 721
            _EVENT_TYPE eventType{_EVENT_MOUSE_CLICK};
293 andreas 722
        }_CLICK_QUEUE_t;
723
 
32 andreas 724
        /**
725
         * @brief doOverlap checks for overlapping objects
726
         *
727
         * The function checks whether some objects on the surface overlap or
728
         * not. If they do it returns TRUE.
729
         * This is used for images where we should check for a transparent
730
         * pixel.
731
         *
732
         * @param r1    The rectangular of the first object
733
         * @param r2    The rectangular of the second object
734
         * @return If the objects \p r1 and \p r2 overlap at least partialy,
735
         * TRUE is returned. Otherwise FALSE.
736
         */
11 andreas 737
        bool doOverlap(RECT_T r1, RECT_T r2);
738
        /**
14 andreas 739
         * The following function is used internaly. It searches in the map
740
         * table for the button corresponding to the port and channel number
741
         * and puts the result into a chain of buttons. This chain is returned.
742
         *
743
         * If there are some pages not yet in memory, they will be created just
744
         * to be able to set the button(s).
745
         */
193 andreas 746
        std::vector<Button::TButton *> collectButtons(std::vector<TMap::MAP_T>& map);
44 andreas 747
        /**
748
         * This internal function frees and destroys all settings, loaded pages
749
         * and sub pages as well as all buttons ens elements belonging to this
750
         * pages. Wehen the function is finished, the state is the same as it
751
         * was immediately at startup.
752
         * This method is called when a filetransfer starts. It is necessary to
753
         * start all over and read in the changed pages.
754
         *
755
         * @return Returns TRUE on success. Else it returns FALSE and the error
756
         * flag is set.
757
         */
758
        bool destroyAll();
209 andreas 759
 
150 andreas 760
        bool overlap(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
209 andreas 761
        TPage *loadPage(PAGELIST_T& pl, bool *refresh=nullptr);
18 andreas 762
        void setButtonCallbacks(Button::TButton *bt);
110 andreas 763
        bool sendCustomEvent(int value1, int value2, int value3, const std::string& msg, int evType, int cp, int cn);
209 andreas 764
        void reloadSystemPage(TPage *page);
295 andreas 765
        bool _setPageDo(int pageID, const std::string& name, bool forget);
299 andreas 766
        void runClickQueue();
303 andreas 767
        void runUpdateSubViewItem();
299 andreas 768
        void _mouseEvent(int x, int y, bool pressed);
769
        void _mouseEvent(ulong handle, bool pressed);
303 andreas 770
        void _updateSubViewItem(Button::TButton *bt);
409 andreas 771
        void _mouseMoveEvent(int x, int y);
129 andreas 772
#ifndef _NOSIP_
127 andreas 773
        std::string sipStateToString(TSIPClient::SIP_STATE_t s);
129 andreas 774
#endif
11 andreas 775
        // List of command functions
23 andreas 776
        void doFTR(int port, std::vector<int>&, std::vector<std::string>& pars);
318 andreas 777
        void doLEVON(int, std::vector<int>&, std::vector<std::string>&);
778
        void doLEVOF(int, std::vector<int>&, std::vector<std::string>&);
779
        void doRXON(int, std::vector<int>&, std::vector<std::string>&);
780
        void doRXOF(int, std::vector<int>&, std::vector<std::string>&);
23 andreas 781
 
14 andreas 782
        void doON(int port, std::vector<int>& channels, std::vector<std::string>& pars);
783
        void doOFF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
15 andreas 784
        void doLEVEL(int port, std::vector<int>& channels, std::vector<std::string>& pars);
785
        void doBLINK(int port, std::vector<int>& channels, std::vector<std::string>& pars);
127 andreas 786
        void doVER(int port, std::vector<int>& channels, std::vector<std::string>& pars);
279 andreas 787
#ifndef _NOSIP_
127 andreas 788
        void doWCN(int port, std::vector<int>& channels, std::vector<std::string>& pars);
279 andreas 789
#endif
147 andreas 790
        void doAFP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
11 andreas 791
        void doAPG(int port, std::vector<int>& channels, std::vector<std::string>& pars);
792
        void doCPG(int port, std::vector<int>& channels, std::vector<std::string>& pars);
793
        void doDPG(int port, std::vector<int>& channels, std::vector<std::string>& pars);
15 andreas 794
        void doPHE(int port, std::vector<int>& channels, std::vector<std::string>& pars);
795
        void doPHP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
796
        void doPHT(int port, std::vector<int>& channels, std::vector<std::string>& pars);
11 andreas 797
        void doPPA(int port, std::vector<int>& channels, std::vector<std::string>& pars);
12 andreas 798
        void doPPF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
799
        void doPPG(int port, std::vector<int>& channels, std::vector<std::string>& pars);
800
        void doPPK(int port, std::vector<int>& channels, std::vector<std::string>& pars);
801
        void doPPM(int port, std::vector<int>& channels, std::vector<std::string>& pars);
802
        void doPPN(int port, std::vector<int>& channels, std::vector<std::string>& pars);
15 andreas 803
        void doPPT(int port, std::vector<int>& channels, std::vector<std::string>& pars);
12 andreas 804
        void doPPX(int port, std::vector<int>& channels, std::vector<std::string>& pars);
15 andreas 805
        void doPSE(int port, std::vector<int>& channels, std::vector<std::string>& pars);
806
        void doPSP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
807
        void doPST(int port, std::vector<int>& channels, std::vector<std::string>& pars);
12 andreas 808
        void doPAGE(int port, std::vector<int>& channels, std::vector<std::string>& pars);
11 andreas 809
 
38 andreas 810
        void doANI(int port, std::vector<int>& channels, std::vector<std::string>& pars);
15 andreas 811
        void doAPF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
43 andreas 812
        void doBAT(int port, std::vector<int>& channels, std::vector<std::string>& pars);
60 andreas 813
        void doBAU(int port, std::vector<int>& channels, std::vector<std::string>& pars);
43 andreas 814
        void doBCB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
82 andreas 815
        void getBCB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
60 andreas 816
        void doBCF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
82 andreas 817
        void getBCF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
60 andreas 818
        void doBCT(int port, std::vector<int>& channels, std::vector<std::string>& pars);
82 andreas 819
        void getBCT(int port, std::vector<int>& channels, std::vector<std::string>& pars);
60 andreas 820
        void doBDO(int port, std::vector<int>& channels, std::vector<std::string>& pars);
821
        void doBFB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
224 andreas 822
        void doBIM(int port, std::vector<int>& channels, std::vector<std::string>& pars);
106 andreas 823
        void doBMC(int port, std::vector<int>& channels, std::vector<std::string>& pars);
149 andreas 824
        void doBMF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
110 andreas 825
        void doBML(int port, std::vector<int>& channels, std::vector<std::string>& pars);
15 andreas 826
        void doBMP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
82 andreas 827
        void getBMP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
16 andreas 828
        void doBOP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
106 andreas 829
        void getBOP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
60 andreas 830
        void doBOR(int port, std::vector<int>& channels, std::vector<std::string>& pars);
107 andreas 831
        void doBOS(int port, std::vector<int>& channels, std::vector<std::string>& pars);
60 andreas 832
        void doBRD(int port, std::vector<int>& channels, std::vector<std::string>& pars);
107 andreas 833
        void getBRD(int port, std::vector<int>& channels, std::vector<std::string>& pars);
16 andreas 834
        void doBSP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
107 andreas 835
        void doBSM(int port, std::vector<int>& channels, std::vector<std::string>& pars);
836
        void doBSO(int port, std::vector<int>& channels, std::vector<std::string>& pars);
16 andreas 837
        void doBWW(int port, std::vector<int>& channels, std::vector<std::string>& pars);
108 andreas 838
        void getBWW(int port, std::vector<int>& channels, std::vector<std::string>& pars);
16 andreas 839
        void doCPF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
840
        void doDPF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
841
        void doENA(int port, std::vector<int>& channels, std::vector<std::string>& pars);
842
        void doFON(int port, std::vector<int>& channels, std::vector<std::string>& pars);
108 andreas 843
        void getFON(int port, std::vector<int>& channels, std::vector<std::string>& pars);
388 andreas 844
        void doGDI(int port, std::vector<int>& channels, std::vector<std::string>& pars);
416 andreas 845
        void doGIV(int port, std::vector<int>& channels, std::vector<std::string>& pars);
60 andreas 846
        void doGLH(int port, std::vector<int>& channels, std::vector<std::string>& pars);
847
        void doGLL(int port, std::vector<int>& channels, std::vector<std::string>& pars);
108 andreas 848
        void doGSC(int port, std::vector<int>& channels, std::vector<std::string>& pars);
388 andreas 849
        void doGRD(int port, std::vector<int>& channels, std::vector<std::string>& pars);
850
        void doGRU(int port, std::vector<int>& channels, std::vector<std::string>& pars);
361 andreas 851
        void doGSN(int port, std::vector<int>& channels, std::vector<std::string>& pars);
14 andreas 852
        void doICO(int port, std::vector<int>& channels, std::vector<std::string>& pars);
108 andreas 853
        void getICO(int port, std::vector<int>& channels, std::vector<std::string>& pars);
854
        void doJSB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
855
        void getJSB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
856
        void doJSI(int port, std::vector<int>& channels, std::vector<std::string>& pars);
857
        void getJSI(int port, std::vector<int>& channels, std::vector<std::string>& pars);
858
        void doJST(int port, std::vector<int>& channels, std::vector<std::string>& pars);
859
        void getJST(int port, std::vector<int>& channels, std::vector<std::string>& pars);
395 andreas 860
        void doMSP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
16 andreas 861
        void doSHO(int port, std::vector<int>& channels, std::vector<std::string>& pars);
108 andreas 862
        void doTEC(int port, std::vector<int>& channels, std::vector<std::string>& pars);
863
        void getTEC(int port, std::vector<int>& channels, std::vector<std::string>& pars);
110 andreas 864
        void doTEF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
865
        void getTEF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
14 andreas 866
        void doTXT(int port, std::vector<int>& channels, std::vector<std::string>& pars);
110 andreas 867
        void getTXT(int port, std::vector<int>& channels, std::vector<std::string>& pars);
104 andreas 868
        void doUNI(int port, std::vector<int>& channels, std::vector<std::string>& pars);
869
        void doUTF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
148 andreas 870
        void doVTP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
4 andreas 871
 
111 andreas 872
        void doKPS(int port, std::vector<int>& channels, std::vector<std::string>& pars);
873
        void doVKS(int port, std::vector<int>& channels, std::vector<std::string>& pars);
874
 
400 andreas 875
        void doAPWD(int port, std::vector<int>& channels, std::vector<std::string>& pars);
876
        void doPWD(int port, std::vector<int>& channels, std::vector<std::string>& pars);
877
 
21 andreas 878
        void doBBR(int port, std::vector<int>& channels, std::vector<std::string>& pars);
97 andreas 879
        void doRAF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
880
        void doRFR(int port, std::vector<int>& channels, std::vector<std::string>& pars);
21 andreas 881
        void doRMF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
111 andreas 882
        void doRSR(int port, std::vector<int>& channels, std::vector<std::string>& pars);
21 andreas 883
 
62 andreas 884
        void doAKB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
885
        void doAKEYB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
886
        void doAKP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
887
        void doAKEYP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
63 andreas 888
        void doAKEYR(int port, std::vector<int>& channels, std::vector<std::string>& pars);
889
        void doAKR(int port, std::vector<int>& channels, std::vector<std::string>& pars);
108 andreas 890
        void doABEEP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
891
        void doADBEEP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
71 andreas 892
        void doBEEP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
893
        void doDBEEP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
62 andreas 894
        void doEKP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
63 andreas 895
        void doPKB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
896
        void doPKP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
408 andreas 897
        void doRPP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
64 andreas 898
        void doSetup(int port, std::vector<int>& channels, std::vector<std::string>& pars);
899
        void doShutdown(int port, std::vector<int>& channels, std::vector<std::string>& pars);
82 andreas 900
        void doSOU(int port, std::vector<int>& channels, std::vector<std::string>& pars);
326 andreas 901
        void doMUT(int port, std::vector<int>& channels, std::vector<std::string>& pars);
63 andreas 902
        void doTKP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
903
        void doVKB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
400 andreas 904
 
905
        void doLPB(int port, std::vector<int>& channels, std::vector<std::string>& pars);
906
        void doLPC(int port, std::vector<int>& channels, std::vector<std::string>& pars);
907
        void doLPR(int port, std::vector<int>& channels, std::vector<std::string>& pars);
908
        void doLPS(int port, std::vector<int>& channels, std::vector<std::string>& pars);
909
 
129 andreas 910
#ifndef _NOSIP_
123 andreas 911
        void doPHN(int port, std::vector<int>& channels, std::vector<std::string>& pars);
127 andreas 912
        void getPHN(int port, std::vector<int>& channels, std::vector<std::string>& pars);
129 andreas 913
#endif
300 andreas 914
        // Commands for subviews (G4/G5)
318 andreas 915
        void doSHA(int port, std::vector<int>& channels, std::vector<std::string>& pars);
916
        void doSHD(int port, std::vector<int>& channels, std::vector<std::string>& pars);
917
        void doSPD(int port, std::vector<int>& channels, std::vector<std::string>& pars);
300 andreas 918
        void doSSH(int port, std::vector<int>& channels, std::vector<std::string>& pars);
318 andreas 919
        void doSTG(int port, std::vector<int>& channels, std::vector<std::string>& pars);
300 andreas 920
 
225 andreas 921
        // Commands for ListView (G5)
227 andreas 922
        void doLVD(int port, std::vector<int>& channels, std::vector<std::string>& pars);
230 andreas 923
        void doLVE(int port, std::vector<int>& channels, std::vector<std::string>& pars);
227 andreas 924
        void doLVF(int port, std::vector<int>& channels, std::vector<std::string>& pars);
230 andreas 925
        void doLVL(int port, std::vector<int>& channels, std::vector<std::string>& pars);
233 andreas 926
        void doLVM(int port, std::vector<int>& channels, std::vector<std::string>& pars);
927
        void doLVN(int port, std::vector<int>& channels, std::vector<std::string>& pars);
928
        void doLVR(int port, std::vector<int>& channels, std::vector<std::string>& pars);
929
        void doLVS(int port, std::vector<int>& channels, std::vector<std::string>& pars);
134 andreas 930
        // Commands inherited from TPControl (Touch Panel Control)
931
        void doTPCCMD(int port, std::vector<int>& channels, std::vector<std::string>& pars);
932
        void doTPCACC(int port, std::vector<int>& channels, std::vector<std::string>& pars);
279 andreas 933
#ifndef _NOSIP_
153 andreas 934
        void doTPCSIP(int port, std::vector<int>& channels, std::vector<std::string>& pars);
279 andreas 935
#endif
293 andreas 936
        std::mutex surface_mutex;
299 andreas 937
        std::mutex click_mutex;
303 andreas 938
        std::mutex updview_mutex;
293 andreas 939
 
318 andreas 940
        bool mLevelSend{false};                         // TRUE = Level changes are send to the master
941
        bool mRxOn{false};                              // TRUE = String changes are send to master
14 andreas 942
        int mActualPage{0};                             // The number of the actual visible page
15 andreas 943
        int mPreviousPage{0};                           // The number of the previous page
349 andreas 944
        int mLastSubPage{0};                            // The last sorted subpage accessed
197 andreas 945
        int mSavedPage{0};                              // The number of the last normal page. This is set immediately before a setup page is shown
14 andreas 946
        int mFirstLeftPixel{0};                         // Pixels to add to left (x) mouse coordinate
947
        int mFirstTopPixel{0};                          // Pixels to add to top (y) mouse position
948
        std::string mActualGroupName;                   // The name of the actual group
70 andreas 949
        TSubPage *mActualGroupPage{nullptr};            // Pointer to subpage of a group which is visible
14 andreas 950
 
951
        amx::TAmxNet *mAmxNet{nullptr};                 // Pointer to class TAmxNet; Handles the communication with the controller
952
        TPageList *mPageList{nullptr};                  // List of available pages and subpages
953
        PCHAIN_T *mPchain{nullptr};                     // Pointer to chain of pages in memory
954
        SPCHAIN_T *mSPchain{nullptr};                   // Pointer to chain of subpages in memory for the actual page
955
        TSettings *mTSettings{nullptr};                 // Pointer to basic settings for the panel
193 andreas 956
        TSettings *mSystemSettings{nullptr};            // Pointer to basic system settings for setup
14 andreas 957
        TPalette *mPalette{nullptr};                    // Pointer to the color handler
958
        TFont *mFonts{nullptr};                         // Pointer to the font handler
32 andreas 959
        TExternal *mExternal{nullptr};                  // Pointer to the external buttons (if any)
73 andreas 960
        TSystemDraw *mSystemDraw{nullptr};              // A pointer to the (optional) system resources
14 andreas 961
        std::thread mThreadAmxNet;                      // The thread handle to the controler handler
169 andreas 962
        TVector<amx::ANET_COMMAND> mCommands;           // Command queue of commands received from controller
14 andreas 963
        std::string mCmdBuffer;                         // Internal used buffer for commands who need more than one network package
62 andreas 964
        std::string mAkbText;                           // This is the text for the virtual keyboard (@AKB)
73 andreas 965
        std::string mAkpText;                           // This is the text for the virtual keyad (@AKP)
111 andreas 966
        bool mPassThrough{false};                       // Can ve set to true with the command ^KPS
134 andreas 967
        bool mInformOrientation{false};                 // TRUE = The actual screen orientation is reported to the controller if it change.
968
        int mOrientation{0};                            // Contains the actual orientation.
154 andreas 969
        int mLastPagePush{0};                           // The number of the last page received a push (key press / mouse hit)
164 andreas 970
        double mDPI{96.0};                              // DPI (Dots Per Inch) of the primary display.
169 andreas 971
        std::atomic<bool> cmdLoop_busy{false};          // As long as this is true the command loop thread is active
972
        std::thread mThreadCommand;                     // Thread handle for command loop thread.
193 andreas 973
        bool mSetupActive{false};                       // TRUE = Setup pages are active
198 andreas 974
        std::vector<int> mSavedSubpages;                // When setup pages are called this contains the actual open subpages
206 andreas 975
        std::vector<_FTP_SURFACE_t> mFtpSurface;        // Contains a list of TP4 surface files gained from a NetLinx.
299 andreas 976
        std::atomic<bool> mClickQueueRun{false};        // TRUE = The click queue thread is running. FALSE: the thread should stop or is not running.
293 andreas 977
        std::vector<_CLICK_QUEUE_t> mClickQueue;        // A queue holding click requests. Needed to serialize the clicks.
303 andreas 978
        std::vector<Button::TButton *> mUpdateViews;    // A queue for the method "updateSubViewItem()"
979
        bool mUpdateViewsRun{false};                    // TRUE = The thread for the queue mUpdateViews is running
429 andreas 980
        std::vector<TButtonStates *> mButtonStates;       // Holds the states for each button
123 andreas 981
        // SIP
129 andreas 982
#ifndef _NOSIP_
123 andreas 983
        bool mPHNautoanswer{false};                     // The state of the SIP autoanswer
127 andreas 984
        TSIPClient *mSIPClient{nullptr};                // Includes the SIP client
129 andreas 985
#endif
70 andreas 986
#ifdef _SCALE_SKIA_
24 andreas 987
        double mScaleFactor{1.0};                       // The scale factor to zoom or shrink all components
31 andreas 988
        double mScaleFactorWidth{1.0};                  // The individual scale factor for the width
989
        double mScaleFactorHeight{1.0};                 // The individual scale factor for the height
198 andreas 990
 
197 andreas 991
        double mScaleSystem{1.0};                       // The scale factor for the system setup pages
992
        double mScaleSystemWidth{1.0};                  // The width scale factor for the system setup pages
993
        double mScaleSystemHeight{1.0};                 // The height scale factor for the system setup pages
198 andreas 994
#endif
250 andreas 995
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
996
        int mNetState{0};                               // On Android and IOS remembers the type of connection to the network (cell or wifi)
93 andreas 997
#endif
36 andreas 998
        std::map<int, std::function<void (int level)> > mNetCalls;  // List of callbacks for the network state multistate bargraph
247 andreas 999
#ifdef Q_OS_ANDROID
38 andreas 1000
        std::map<int, std::function<void (int level, bool charging, int chargeType)> > mBatteryCalls;
247 andreas 1001
#endif
1002
#ifdef Q_OS_IOS
1003
        std::map<int, std::function<void (int level, int state)> > mBatteryCalls;
1004
        int mLastBatteryLevel{0};
1005
        int mLastBatteryState{0};
1006
#endif
3 andreas 1007
};
1008
 
36 andreas 1009
#ifdef __ANDROID__
1010
extern "C" {
1011
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_NetworkStatus_informTPanelNetwork(JNIEnv */*env*/, jclass /*clazz*/, jboolean conn, jint level, jint type);
38 andreas 1012
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_BatteryState_informBatteryStatus(JNIEnv */*env*/, jclass /*clazz*/, jint level, jboolean charge, jint chargeType);
61 andreas 1013
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_PhoneCallState_informPhoneState(JNIEnv *env, jclass cl, jboolean call, jstring pnumber);
1014
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_Logger_logger(JNIEnv *env, jclass cl, jint mode, jstring msg);
130 andreas 1015
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_Orientation_informTPanelOrientation(JNIEnv */*env*/, jclass /*clazz*/, jint orientation);
255 andreas 1016
    // Settings
256 andreas 1017
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setNetlinxIp(JNIEnv *env, jclass clazz, jstring ip);
1018
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setNetlinxPort(JNIEnv *env, jclass clazz, jint port);
1019
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setNetlinxChannel(JNIEnv *env, jclass clazz, jint channel);
1020
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setNetlinxType(JNIEnv *env, jclass clazz, jstring type);
1021
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setNetlinxFtpUser(JNIEnv *env, jclass clazz, jstring user);
1022
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setNetlinxFtpPassword(JNIEnv *env, jclass clazz, jstring pw);
1023
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setNetlinxSurface(JNIEnv *env, jclass clazz, jstring surface);
1024
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setNetlinxFtpPassive(JNIEnv *env, jclass clazz, jboolean passive);
1025
 
1026
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setViewScale(JNIEnv *env, jclass clazz, jboolean scale);
1027
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setViewToolbar(JNIEnv *env, jclass clazz, jboolean bar);
1028
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setViewToolbarForce(JNIEnv *env, jclass clazz, jboolean bar);
1029
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setViewRotation(JNIEnv *env, jclass clazz, jboolean rotate);
1030
 
1031
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSoundSystem(JNIEnv *env, jclass clazz, jstring sound);
1032
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSoundSingle(JNIEnv *env, jclass clazz, jstring sound);
1033
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSoundDouble(JNIEnv *env, jclass clazz, jstring sound);
1034
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSoundEnable(JNIEnv *env, jclass clazz, jboolean sound);
1035
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSoundVolume(JNIEnv *env, jclass clazz, jint sound);
1036
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSoundGaim(JNIEnv *env, jclass clazz, jint sound);
1037
 
257 andreas 1038
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSipProxy(JNIEnv *env, jclass clazz, jstring sip);
1039
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSipPort(JNIEnv *env, jclass clazz, jint sip);
1040
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSipTlsPort(JNIEnv *env, jclass clazz, jint sip);
1041
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSipStun(JNIEnv *env, jclass clazz, jstring sip);
1042
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSipDomain(JNIEnv *env, jclass clazz, jstring sip);
1043
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSipUser(JNIEnv *env, jclass clazz, jstring sip);
1044
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSipPassword(JNIEnv *env, jclass clazz, jstring sip);
1045
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSipIpv4(JNIEnv *env, jclass clazz, jboolean sip);
1046
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSipIpv6(JNIEnv *env, jclass clazz, jboolean sip);
1047
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSipEnabled(JNIEnv *env, jclass clazz, jboolean sip);
1048
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setSipIphone(JNIEnv *env, jclass clazz, jboolean sip);
1049
 
1050
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setLogInfo(JNIEnv *env, jclass clazz, jboolean log);
1051
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setLogWarning(JNIEnv *env, jclass clazz, jboolean log);
1052
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setLogError(JNIEnv *env, jclass clazz, jboolean log);
1053
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setLogTrace(JNIEnv *env, jclass clazz, jboolean log);
1054
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setLogDebug(JNIEnv *env, jclass clazz, jboolean log);
1055
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setLogProfile(JNIEnv *env, jclass clazz, jboolean log);
1056
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setLogLongFormat(JNIEnv *env, jclass clazz, jboolean log);
1057
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setLogEnableFile(JNIEnv *env, jclass clazz, jboolean log);
1058
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setLogFile(JNIEnv *env, jclass clazz, jstring log);
1059
 
397 andreas 1060
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setPassword1(JNIEnv *env, jclass clazz, jstring pw);
1061
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setPassword2(JNIEnv *env, jclass clazz, jstring pw);
1062
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setPassword3(JNIEnv *env, jclass clazz, jstring pw);
1063
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_setPassword4(JNIEnv *env, jclass clazz, jstring pw);
1064
 
256 andreas 1065
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_SettingsActivity_saveSettings(JNIEnv *env, jclass clazz);
36 andreas 1066
}
1067
#endif  // __ANDROID__
1068
 
3 andreas 1069
#endif