#include "Application.h" #include "MethodResultJni.h" #include "rhodes/JNIRhoJS.h" #include "logging/RhoLog.h" #undef DEFAULT_LOGCATEGORY #define DEFAULT_LOGCATEGORY "ApplicationJS" typedef rho::CApplicationProxy > ObjectProxy; using namespace rho::apiGenerator; rho::String js_s_Application_getAppBundleFolder(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getAppBundleFolder(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getAppsBundleFolder(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getAppsBundleFolder(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getBundleFolder(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getBundleFolder(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getUserFolder(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getUserFolder(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getConfigPath(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getConfigPath(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getModelsManifestPath(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getModelsManifestPath(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getDatabaseBlobFolder(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getDatabaseBlobFolder(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getPublicFolder(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getPublicFolder(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getStartURI(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getStartURI(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_setStartURI(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 1) || (argc > 1)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::setStartURI(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getSettingsPageURI(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getSettingsPageURI(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_setSettingsPageURI(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 1) || (argc > 1)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::setSettingsPageURI(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getSplash(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getSplash(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getVersion(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getVersion(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getTitle(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getTitle(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_setTitle(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 1) || (argc > 1)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::setTitle(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getAppName(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getAppName(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getNativeMenu(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getNativeMenu(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_setNativeMenu(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 1) || (argc > 1)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::setNativeMenu(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getSecurityTokenNotPassed(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getSecurityTokenNotPassed(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getInvalidSecurityTokenStartPath(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getInvalidSecurityTokenStartPath(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getRhoPlatformVersion(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getRhoPlatformVersion(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_getBadLinkURI(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getBadLinkURI(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_modelFolderPath(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 1) || (argc > 1)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::modelFolderPath(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_databaseFilePath(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 1) || (argc > 1)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::databaseFilePath(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_expandDatabaseBlobFilePath(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 1) || (argc > 1)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::expandDatabaseBlobFilePath(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_relativeDatabaseBlobFilePath(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 1) || (argc > 1)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::relativeDatabaseBlobFilePath(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_quit(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::quit(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_minimize(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::minimize(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_restore(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::restore(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_Application_setApplicationNotify(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } if(!result.hasCallback()) { if(!result.isError()) { result.setArgError("No callback handler provided"); } RAWLOG_ERROR1("Error setting callback: %s", result.getErrorMessage().c_str()); return CMethodResultConvertor().toJSON(result); } ObjectProxy::setApplicationNotify(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; }