platform/shared/common/RhodesApp.h in rhodes-3.3.5 vs platform/shared/common/RhodesApp.h in rhodes-3.4.2

- old
+ new

@@ -36,10 +36,11 @@ #include "net/HttpServer.h" #include "SplashScreen.h" #include "AppMenu.h" #include "ExtManager.h" +#include "push/RhoPushManager.h" #undef DEFAULT_LOGCATEGORY #define DEFAULT_LOGCATEGORY "RhodesApp" namespace rho { @@ -72,21 +73,21 @@ Vector<String> m_currentUrls; Vector<String> m_arAppBackUrl, m_arAppBackUrlOrig; Vector<ICallbackObject*> m_arCallbackObjects; - common::CMutex m_mxPushCallback; + mutable common::CMutex m_mxPushCallback; String m_strPushCallback, m_strPushCallbackParams; + RhoPushManager m_appPushMgr; common::CMutex m_mxScreenRotationCallback; String m_strScreenRotationCallback, m_strScreenRotationCallbackParams; boolean m_bDeactivationMode; //int m_activateCounter; common::CAutoPtr<common::CThreadQueue> m_appCallbacksQueue; - boolean m_bSendingLog; CExtManager* m_pExtManager; public: ~CRhodesApp(void); #if defined(WINDOWS_PLATFORM) @@ -145,32 +146,35 @@ CRhoTimer& getTimer(){ return m_oTimer; } void setExtManager( CExtManager* pExtManager ){m_pExtManager = pExtManager; } CExtManager& getExtManager(){ return *m_pExtManager; } - boolean sendLog(const String& strCallbackUrl); - String addCallbackObject(ICallbackObject* pCallbackObject, String strName); unsigned long getCallbackObject(int nIndex); const String& getRhoMessage(int nError, const char* szName); void runCallbackInThread(const String& strCallback, const String& strBody); - void setPushNotification(String strUrl, String strParams ); - boolean callPushCallback(String strData); + IRhoPushClient* getDefaultPushClient() {return m_appPushMgr.getDefaultClient(); } + void addPushClient(IRhoPushClient* pClient) { m_appPushMgr.addClient(pClient); } + void setPushNotification(const String& strUrl, const String& strParams, const String& types); + //void checkPushRegistration(const String& strUrl, const String& strParams, const String& type); + + // Deprecated + boolean callPushCallback(const String& strData) const; + boolean callPushCallbackWithJsonBody(const String& strUrl, const String& strData); void setScreenRotationNotification(String strUrl, String strParams); void callScreenRotationCallback(int width, int height, int degrees); void loadUrl(String url); void notifyLocalServerStarted(); const char* getFreeListeningPort(); int determineFreeListeningPort(); - void setSendingLog(boolean bSending){m_bSendingLog = bSending; } protected: virtual void run(); void initHttpServer(); void initAppUrls(); @@ -240,9 +244,10 @@ void rho_rhodesapp_setViewMenu(unsigned long valMenu); const char* rho_rhodesapp_getappbackurl(); int rho_rhodesapp_callPushCallback(const char* szData); +int rho_rhodesapp_callPushCallbackWithJsonBody(const char* szUrl, const char* szData); void rho_rhodesapp_callScreenRotationCallback(int width, int height, int degrees); void rho_rhodesapp_callPopupCallback(const char *strCallbackUrl, const char *id, const char *title); int rho_conf_send_log(const char* callback_url);