virtual void enumerate(CMethodResult& oResult)
    {
        rho::Vector<rho::String> arIDs;
        arIDs.addElement("SC1");
        arIDs.addElement("SC2");

        oResult.set(arIDs);
    }
Exemple #2
0
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);
}
Exemple #3
0
void CSystemImplBase::getDevicePushId(CMethodResult& oResult)
{
    rho::String strDeviceID;
	if ( rho::sync::RhoconnectClientManager::haveRhoconnectClientImpl() ) 
		strDeviceID = rho::sync::RhoconnectClientManager::clientRegisterGetDevicePin();

    oResult.set( strDeviceID );
}
Exemple #4
0
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);
}
Exemple #6
0
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);
}
Exemple #8
0
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();
}
Exemple #10
0
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]);
        
    }
}
Exemple #12
0
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);
}
Exemple #14
0
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);
}
Exemple #15
0
void CSystemImpl::getIsMotorolaDevice(CMethodResult& oResult)
{
	oResult.set(false);
}
Exemple #16
0
void CSystemImpl::getScreenOrientation(CMethodResult& oResult)
{
    oResult.set(StringW(CMainWindow::getScreenWidth() <= CMainWindow::getScreenHeight() ? L"portrait" : L"landscape"));
}
Exemple #17
0
void CSystemImpl::getPpiX(CMethodResult& oResult)
{
    oResult.set(CMainWindow::getInstance()->getLogicalDpiX());
}
Exemple #18
0
void CSystemImpl::getIsEmulator(CMethodResult& oResult)
{
    oResult.set(true);
}
Exemple #19
0
void CSystemImpl::getScreenHeight(CMethodResult& oResult)
{
    oResult.set(CMainWindow::getScreenHeight());
}
Exemple #20
0
void CSystemImpl::getHttpProxyURI(CMethodResult& oResult)
{
	oResult.set(rho_sys_get_http_proxy_url());
}
Exemple #21
0
void CSystemImpl::getOsVersion(CMethodResult& oResult)
{
    oResult.set(String(RHOSIMULATOR_NAME " v" RHOSIMULATOR_VERSION));
}
Exemple #22
0
void CSystemImpl::getScreenAutoRotate(CMethodResult& oResult)
{
    oResult.set(false);
}
Exemple #23
0
void CSystemImpl::isApplicationInstalled( const rho::String& applicationName, CMethodResult& oResult)
{
	oResult.set(false);
}
Exemple #24
0
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);
}
Exemple #26
0
void CSystemImpl::getHasCalendar(CMethodResult& oResult)
{
	oResult.set(true);
}
Exemple #27
0
void CSystemImpl::getDeviceName(CMethodResult& oResult)
{
    oResult.set(String("Qt"));
}
Exemple #28
0
void CSystemImpl::getLocale(CMethodResult& oResult)
{
    oResult.set(String(QLocale::system().name().left(2).toStdString().c_str()));
}
Exemple #29
0
void CSystemImpl::getCountry(CMethodResult& oResult)
{
    oResult.set(String(QLocale::system().name().right(2).toStdString().c_str()));
}
Exemple #30
0
void CSystemImpl::getFullScreen(CMethodResult& oResult)
{
	//all apps working in full screen mode on WP8
    oResult.set(CMainWindow::getInstance()->getFullScreen());
}