Subversion Repositories tpanel

Rev

Rev 235 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 235 Rev 247
Line 141... Line 141...
141
        void informTPanelNetwork(jboolean conn, jint level, jint type);
141
        void informTPanelNetwork(jboolean conn, jint level, jint type);
142
        void informBatteryStatus(jint level, jboolean charging, jint chargeType);
142
        void informBatteryStatus(jint level, jboolean charging, jint chargeType);
143
        void informPhoneState(bool call, const std::string& pnumber);
143
        void informPhoneState(bool call, const std::string& pnumber);
144
        void initOrientation();
144
        void initOrientation();
145
#endif
145
#endif
-
 
146
#ifdef Q_OS_IOS
-
 
147
        void informBatteryStatus(int level, int state);
-
 
148
#endif
146
        void regCallDropPage(std::function<void (ulong handle)> callDropPage) { _callDropPage = callDropPage; }
149
        void regCallDropPage(std::function<void (ulong handle)> callDropPage) { _callDropPage = callDropPage; }
147
        void regCallDropSubPage(std::function<void (ulong handle)> callDropSubPage) { _callDropSubPage = callDropSubPage; }
150
        void regCallDropSubPage(std::function<void (ulong handle)> callDropSubPage) { _callDropSubPage = callDropSubPage; }
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; };
151
        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; };
149
        void regCallInputText(std::function<void (Button::TButton *button, Button::BITMAP_t& bm, int frame)> callInputText) { _callInputText = callInputText; }
152
        void regCallInputText(std::function<void (Button::TButton *button, Button::BITMAP_t& bm, int frame)> callInputText) { _callInputText = callInputText; }
150
        void regCallListBox(std::function<void (Button::TButton *button, Button::BITMAP_t& bm, int frame)> callListBox) { _callListBox = callListBox; }
153
        void regCallListBox(std::function<void (Button::TButton *button, Button::BITMAP_t& bm, int frame)> callListBox) { _callListBox = callListBox; }
Line 152... Line 155...
152
        void regCallbackKeypad(std::function<void (const std::string& init, const std::string& prompt, bool priv)> callKeypad) { _callKeypad = callKeypad; }
155
        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; }
156
        void regCallResetKeyboard(std::function<void ()> callResetKeyboard) { _callResetKeyboard = callResetKeyboard; }
154
        void regCallShowSetup(std::function<void ()> callShowSetup) { _callShowSetup = callShowSetup; }
157
        void regCallShowSetup(std::function<void ()> callShowSetup) { _callShowSetup = callShowSetup; }
155
        void regCallbackNetState(std::function<void (int level)> callNetState, ulong handle);
158
        void regCallbackNetState(std::function<void (int level)> callNetState, ulong handle);
156
        void unregCallbackNetState(ulong handle);
159
        void unregCallbackNetState(ulong handle);
-
 
160
#ifdef Q_OS_ANDROID
157
        void regCallbackBatteryState(std::function<void (int level, bool charging, int chargeType)> callBatteryState, ulong handle);
161
        void regCallbackBatteryState(std::function<void (int level, bool charging, int chargeType)> callBatteryState, ulong handle);
-
 
162
#endif
-
 
163
#ifdef Q_OS_IOS
-
 
164
        void regCallbackBatteryState(std::function<void (int level, int state)> callBatteryState, ulong handle);
-
 
165
#endif
-
 
166
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
158
        void unregCallbackBatteryState(ulong handle);
167
        void unregCallbackBatteryState(ulong handle);
-
 
168
#endif
159
        void regCallbackResetSurface(std::function<void ()> resetSurface) { _resetSurface = resetSurface; }
169
        void regCallbackResetSurface(std::function<void ()> resetSurface) { _resetSurface = resetSurface; }
160
        void regCallbackShutdown(std::function<void ()> shutdown) { _shutdown = shutdown; }
170
        void regCallbackShutdown(std::function<void ()> shutdown) { _shutdown = shutdown; }
161
        void regCallbackPlaySound(std::function<void (const std::string& file)> playSound) { _playSound = playSound; }
171
        void regCallbackPlaySound(std::function<void (const std::string& file)> playSound) { _playSound = playSound; }
162
        void regCallbackStopSound(std::function<void ()> stopSound) { _stopSound = stopSound; }
172
        void regCallbackStopSound(std::function<void ()> stopSound) { _stopSound = stopSound; }
163
        void regCallbackMuteSound(std::function<void (bool state)> muteSound) { _muteSound = muteSound; }
173
        void regCallbackMuteSound(std::function<void (bool state)> muteSound) { _muteSound = muteSound; }
Line 372... Line 382...
372
         *
382
         *
373
         * @param handle    The handle of the button
383
         * @param handle    The handle of the button
374
         * @param row       The number of the selected row.
384
         * @param row       The number of the selected row.
375
         */
385
         */
376
        void setSelectedRow(ulong handle, int row, const std::string& text);
386
        void setSelectedRow(ulong handle, int row, const std::string& text);
-
 
387
#ifdef Q_OS_IOS
-
 
388
        void setBattery(int level, int state) { mLastBatteryLevel = level; mLastBatteryState = state; }
-
 
389
#endif
377
#ifdef _SCALE_SKIA_
390
#ifdef _SCALE_SKIA_
378
        /**
391
        /**
379
         * Set the scale factor for the system setup pages. On a desktop this
392
         * 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.
393
         * 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
394
         * On a mobile device the factor is in relation to the resolution of
Line 738... Line 751...
738
#endif
751
#endif
739
#ifdef __ANDROID__
752
#ifdef __ANDROID__
740
        int mNetState{0};                               // On Android remembers the type of connection to the network (cell or wifi)
753
        int mNetState{0};                               // On Android remembers the type of connection to the network (cell or wifi)
741
#endif
754
#endif
742
        std::map<int, std::function<void (int level)> > mNetCalls;  // List of callbacks for the network state multistate bargraph
755
        std::map<int, std::function<void (int level)> > mNetCalls;  // List of callbacks for the network state multistate bargraph
-
 
756
#ifdef Q_OS_ANDROID
743
        std::map<int, std::function<void (int level, bool charging, int chargeType)> > mBatteryCalls;
757
        std::map<int, std::function<void (int level, bool charging, int chargeType)> > mBatteryCalls;
-
 
758
#endif
-
 
759
#ifdef Q_OS_IOS
-
 
760
        std::map<int, std::function<void (int level, int state)> > mBatteryCalls;
-
 
761
        int mLastBatteryLevel{0};
-
 
762
        int mLastBatteryState{0};
-
 
763
#endif
744
};
764
};
745
 
765
 
746
#ifdef __ANDROID__
766
#ifdef __ANDROID__
747
extern "C" {
767
extern "C" {
748
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_NetworkStatus_informTPanelNetwork(JNIEnv */*env*/, jclass /*clazz*/, jboolean conn, jint level, jint type);
768
    JNIEXPORT void JNICALL Java_org_qtproject_theosys_NetworkStatus_informTPanelNetwork(JNIEnv */*env*/, jclass /*clazz*/, jboolean conn, jint level, jint type);