virtual void enumerate(CMethodResult& oResult) { rho::Vector<rho::String> arIDs; arIDs.addElement("SC1"); arIDs.addElement("SC2"); oResult.set(arIDs); }
void CSystemImpl::getScreenAutoRotate(CMethodResult& oResult) { //not supported in XAML apps /*if(DisplayProperties::AutoRotationPreferences == Windows::Graphics::Display::DisplayOrientations::None) oResult.set(false); else */ oResult.set(true); }
void CSystemImplBase::getDevicePushId(CMethodResult& oResult) { rho::String strDeviceID; if ( rho::sync::RhoconnectClientManager::haveRhoconnectClientImpl() ) strDeviceID = rho::sync::RhoconnectClientManager::clientRegisterGetDevicePin(); oResult.set( strDeviceID ); }
void CSystemImpl::getCountry(CMethodResult& oResult) { wchar_t szCountry[20]; int nRes = GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT,LOCALE_SISO3166CTRYNAME , szCountry, sizeof(szCountry)/sizeof(szCountry[0])); szCountry[2] = 0; oResult.set(StringW(szCountry)); }
void CShareExtensionSingleton::enumerate(CMethodResult& oResult) { rho::Vector<rho::String> arIDs; arIDs.addElement("SC1"); arIDs.addElement("SC2"); oResult.set(arIDs); }
void CBarcodeSingleton::enumerate(CMethodResult& oResult) { rho::Vector<rho::StringW> arIDs; arIDs.addElement(L"SC1"); arIDs.addElement(L"SC2"); oResult.set(arIDs); }
void CGenPropBagSingleton::enumerate(CMethodResult& oResult) { rho::Vector<rho::String> arIDs; arIDs.addElement("ID1"); arIDs.addElement("ID2"); oResult.set(arIDs); }
void CEventsourceSingleton::enumerate(CMethodResult& oResult) { rho::Vector<rho::String> arIDs; arIDs.addElement("SC1"); arIDs.addElement("SC2"); oResult.set(arIDs); }
rho::String js_Barcode1_getDefaultID(rho::json::CJSONArray& argv, const rho::String& strObjID) { CMethodResult oRes; rho::StringW strDefaultID = CBarcode1FactoryBase::getBarcode1SingletonS()->getDefaultID(); oRes.set(strDefaultID); return oRes.toJSON(); }
void CSystemImpl::getLocale(CMethodResult& oResult) { wchar_t szLang[20]; int nRes = GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT,LOCALE_SABBREVLANGNAME , szLang, sizeof(szLang)/sizeof(szLang[0])); szLang[2] = 0; wcslwr(szLang); oResult.set(StringW(szLang)); }
void CMegamoduleBase::getProperty( const rho::String& propertyName, CMethodResult& oResult) { CMethodAccessor< IMegamodule >* pAccessor = m_mapPropAccessors[propertyName]; if ( pAccessor ) pAccessor->callGetter(this, oResult); else { oResult.set(m_hashProps[propertyName]); } }
void FcmPushClient::getDeviceId(CMethodResult& result) { String deviceId = m_hashProps["deviceId"]; if(deviceId.length() != 0) { LOG(TRACE) + "FCM deviceId: " + deviceId; result.set(deviceId); } else { LOG(TRACE) + "Still waiting for FCM deviceId"; m_deviceIdResult = result; } }
void CMegamoduleBase::getProperties( const rho::Vector<rho::String>& arrayofNames, CMethodResult& oResult) { rho::Hashtable<rho::String, rho::String> res; oResult.setCollectionMode(true); for ( int i = 0; i < (int)arrayofNames.size(); i++ ) { getProperty(arrayofNames[i], oResult); if ( oResult.isError() ) break; res[arrayofNames[i]] = oResult.toString(); } oResult.setCollectionMode(false); if ( oResult.isError() ) oResult.callCallback(); else oResult.set(res); }
void CSystemImplBase::zipFile( const rho::String& localPathToZip, const rho::String& localPathToFile, const rho::String& password, CMethodResult& oResult) { ZRESULT res; #if defined(UNICODE) && defined(WIN32) && !defined(OS_WP8) rho::StringW strZipFilePathW; convertToStringW(localPathToZip.c_str(), strZipFilePathW); CFilePath oPath(localPathToFile); rho::StringW strFileNameW; convertToStringW(oPath.getBaseName(), strFileNameW); rho::StringW strToZipPathW; convertToStringW(localPathToFile.c_str(), strToZipPathW); HZIP hz = CreateZip(strZipFilePathW.c_str(), password.c_str()); if ( !hz ) res = -1; else { res = ZipAdd( hz, strFileNameW.c_str(), strToZipPathW.c_str() ); res = CloseZip(hz); } #else HZIP hz = CreateZip((TCHAR*)localPathToZip.c_str(), password.c_str()); if(!hz) { res = -1; } else { CFilePath oPath(localPathToFile); res = ZipAdd(hz, (TCHAR*)oPath.getBaseName(), (TCHAR*)localPathToFile.c_str()); res = CloseZip(hz); } #endif oResult.set(res); }
void CSystemImpl::getIsMotorolaDevice(CMethodResult& oResult) { oResult.set(false); }
void CSystemImpl::getScreenOrientation(CMethodResult& oResult) { oResult.set(StringW(CMainWindow::getScreenWidth() <= CMainWindow::getScreenHeight() ? L"portrait" : L"landscape")); }
void CSystemImpl::getPpiX(CMethodResult& oResult) { oResult.set(CMainWindow::getInstance()->getLogicalDpiX()); }
void CSystemImpl::getIsEmulator(CMethodResult& oResult) { oResult.set(true); }
void CSystemImpl::getScreenHeight(CMethodResult& oResult) { oResult.set(CMainWindow::getScreenHeight()); }
void CSystemImpl::getHttpProxyURI(CMethodResult& oResult) { oResult.set(rho_sys_get_http_proxy_url()); }
void CSystemImpl::getOsVersion(CMethodResult& oResult) { oResult.set(String(RHOSIMULATOR_NAME " v" RHOSIMULATOR_VERSION)); }
void CSystemImpl::getScreenAutoRotate(CMethodResult& oResult) { oResult.set(false); }
void CSystemImpl::isApplicationInstalled( const rho::String& applicationName, CMethodResult& oResult) { oResult.set(false); }
void CSystemImplBase::getPlatform(CMethodResult& oResult) { #ifdef RHODES_EMULATOR rho::String strPlatform = RHOSIMCONF().getString("platform"); if ( strPlatform.compare("bb") == 0 || strPlatform.compare("bb6") == 0 ) oResult.set( L"Blackberry" ); else if ( strPlatform.compare("wm") == 0 ) oResult.set( L"WINDOWS" ); else if ( strPlatform.compare("win32") == 0 ) oResult.set( L"WINDOWS_DESKTOP" ); else if ( strPlatform.compare("wp") == 0 ) oResult.set( L"WP7" ); else if ( strPlatform.compare("wp8") == 0 ) oResult.set( L"WP8"); else if ( strPlatform.compare("android") == 0 ) oResult.set( L"ANDROID" ); else if ( strPlatform.compare("iphone") == 0 ) oResult.set( L"APPLE" ); else oResult.set( L"UNKNOWN" ); #else //!RHODES_EMULATOR #if defined(OS_MACOSX) oResult.set( PLATFORM_IOS ); #elif defined(OS_WINDOWS_DESKTOP) oResult.set( PLATFORM_WINDOWS_DESKTOP ); #elif defined(WINDOWS_PLATFORM) #if defined(OS_WP8) oResult.set( PLATFORM_WP8 ); #else oResult.set( PLATFORM_WM_CE ); #endif #elif defined(OS_ANDROID) oResult.set( PLATFORM_ANDROID ); #elif defined(OS_LINUX) oResult.set( L"LINUX" ); #else oResult.set( L"UNKNOWN" ); #endif #endif }
void CMegamoduleBase::getAllProperties(CMethodResult& oResult) { oResult.set(m_hashProps); }
void CSystemImpl::getHasCalendar(CMethodResult& oResult) { oResult.set(true); }
void CSystemImpl::getDeviceName(CMethodResult& oResult) { oResult.set(String("Qt")); }
void CSystemImpl::getLocale(CMethodResult& oResult) { oResult.set(String(QLocale::system().name().left(2).toStdString().c_str())); }
void CSystemImpl::getCountry(CMethodResult& oResult) { oResult.set(String(QLocale::system().name().right(2).toStdString().c_str())); }
void CSystemImpl::getFullScreen(CMethodResult& oResult) { //all apps working in full screen mode on WP8 oResult.set(CMainWindow::getInstance()->getFullScreen()); }