Exemplo n.º 1
0
void CSystemImpl::getScreenSleeping(rho::apiGenerator::CMethodResult& result)
{
    result.set(mScreenSleeping);
}
Exemplo n.º 2
0
 virtual void getTextZoomLevel(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set( 1. );//m_nTextZoom
 }
Exemplo n.º 3
0
 virtual void getActiveTab(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set( rho_webview_active_tab() );
 }
Exemplo n.º 4
0
 virtual void getMemoryPeriod(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set( (int)LOGCONF().getCollectMemoryInfoInterval() );
 }
Exemplo n.º 5
0
 virtual void getCacheSize(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set( RHOCONF().getInt("WebView.cacheSize") );
 }
Exemplo n.º 6
0
 virtual void getLevel(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set( LOGCONF().getMinSeverity() );
 }
Exemplo n.º 7
0
 virtual void getFileSize(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set( (int)LOGCONF().getMaxLogFileSize() );
 }
Exemplo n.º 8
0
 //Android only
 virtual void getEnableZoom(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set(true);
 }
Exemplo n.º 9
0
 virtual void getEnablePageLoadingIndication(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set(false);
 }
Exemplo n.º 10
0
void CNativeTabbar::CreateTabbarEx(const rho::Vector<rho::String>& tabbarElements, const rho::Hashtable<rho::String, rho::String>& tabBarProperties, rho::apiGenerator::CMethodResult& oResult)
{
    if (!rho_rhodesapp_check_mode() )
        return;

    RemoveTabbar();

	COLORREF   rgbBackColor;
    bool bHiddenTabs = false, bCreateOnInit = false;

    for ( Hashtable<rho::String, rho::String>::const_iterator it = tabBarProperties.begin(); it != tabBarProperties.end(); ++it )
    {
        const char *name = (it->first).c_str();
        const char *value = (it->second).c_str();
        if (strcasecmp(name, "backgroundColor") == 0) 
            rgbBackColor = getColorFromString(value);
        if (strcasecmp(name, "hiddenTabs") == 0) 
            bHiddenTabs = strcasecmp(value, "true") == 0;
        if (strcasecmp(name, "createOnInit") == 0) 
            bCreateOnInit = strcasecmp(value, "true") == 0;

    }

    if ( !bHiddenTabs )
    {
        LOG(WARNING) + "Illegal argument for create_nativebar: hiddenTabs should be true for Windows Mobile and Windows CE.";
        bHiddenTabs = true;
    }

    int nStartTab = -1;

    for (int i = 0; i < (int)tabbarElements.size(); ++i) 
    {
        const char *label = NULL;
        const char *action = NULL;
        const char *icon = NULL;
        const char *reload = NULL;
        const char *colored_icon = NULL;
        
    	COLORREF selected_color;
        const char *disabled = NULL;
		COLORREF web_bkg_color;
        const char* use_current_view_for_tab = NULL;
        bool bUseCurrentViewForTab = false, bReloadPage = false, bPerishable = false, bCreateOnInitTab = false;
        CJSONEntry oEntry(tabbarElements[i].c_str());

        if ( oEntry.hasName("label") )
            label = oEntry.getString("label");
        if ( oEntry.hasName("action") )
            action = oEntry.getString("action");
        if ( oEntry.hasName("icon") )
            icon = oEntry.getString("icon");
        if ( oEntry.hasName("coloredIcon") )
            colored_icon = oEntry.getString("coloredIcon");
        if ( oEntry.hasName("reload") )
        {
            reload = oEntry.getString("reload");
            if (strcasecmp(reload, "true") == 0)
                bReloadPage = true;
        }
        if ( oEntry.hasName("perishable") )
        {
            const char* perishable = oEntry.getString("perishable");
            if (strcasecmp(perishable, "true") == 0)
                bPerishable = true;
        }
        if ( oEntry.hasName("createOnInit") )
        {
            const char* createOnInit = oEntry.getString("createOnInit");
            if (strcasecmp(createOnInit, "true") == 0)
                bCreateOnInitTab = true;
        }

        if ( oEntry.hasName("selectedColor") )
            selected_color = getColorFromString(oEntry.getString("selectedColor"));
        if ( oEntry.hasName("disabled") )
            disabled = oEntry.getString("disabled");
        if ( oEntry.hasName("useCurrentViewForTab") )
        {
            use_current_view_for_tab = oEntry.getString("useCurrentViewForTab");
            if (strcasecmp(use_current_view_for_tab, "true") == 0)
                bUseCurrentViewForTab = true;
        }
        if (oEntry.hasName("backgroundColor")) 
            web_bkg_color = getColorFromString(oEntry.getString("backgroundColor"));

        if (label == NULL)
            label = "";
        if (action == NULL)
            action = "";
        
        m_arTabs.addElement(CTabBarItem(action, label, bUseCurrentViewForTab, bReloadPage, bPerishable, bCreateOnInitTab));

        if (m_strStartTabName.length()>0 && m_strStartTabName == label)
            nStartTab = i;

    }

    if ( oResult.hasCallback() )
        m_oCallback = oResult;

    for ( int i = 0; i < (int)m_arTabs.size(); i++ )
    {
        if ( m_arTabs[i].m_bCreateOnInit || bCreateOnInit )
            SwitchTab(i, true);
    }

    if (m_strStartTabName.length()>0&&nStartTab>=0)
    {
        //getAppWindow().SetTimer( TABBAR_TIMER_ID, 1000 );
        SwitchTabByName( m_strStartTabName.c_str(), false );
        m_strStartTabName = "";
    }else if ( m_arTabs.size() ) //&& !m_arTabs[0].m_bUseCurrentViewForTab )
        SwitchTab(0);

    m_bTabCreated = true;
}
Exemplo n.º 11
0
 virtual void getFullScreen(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set(rho_webview_get_full_screen() != 0 ? true : false );
 }
Exemplo n.º 12
0
 virtual void joinStrings( const rho::String& a,  const rho::String& b, rho::apiGenerator::CMethodResult& oResult) {
      oResult.set(a+b);
 }
Exemplo n.º 13
0
 virtual void calcSumm( int a,  int b, rho::apiGenerator::CMethodResult& oResult) {
      oResult.set(a+b);
 }
Exemplo n.º 14
0
void CMainWindow::createTabbarEx(const rho::Vector<rho::String>& tabbarElements, const rho::Hashtable<rho::String, rho::String>& tabBarProperties, rho::apiGenerator::CMethodResult& oResult)
{
    if (!rho_rhodesapp_check_mode() || !rho_wmsys_has_touchscreen() )
        return;

	std::auto_ptr<QColor> background_color (NULL);

    for ( Hashtable<rho::String, rho::String>::const_iterator it = tabBarProperties.begin(); it != tabBarProperties.end(); ++it )
    {
        const char *name = (it->first).c_str();
        const char *value = (it->second).c_str();
        if (strcasecmp(name, "backgroundColor") == 0) 
            background_color.reset(new QColor(getColorFromString(value)));
    }

    ((QtMainWindow*)qtMainWindow)->tabbarInitialize();
    int nStartTab = -1;
    for (int i = 0; i < (int)tabbarElements.size(); ++i) 
    {
        const char *label = NULL;
        const char *action = NULL;
        const char *icon = NULL;
        const char *reload = NULL;
        const char *colored_icon = NULL;
        
    	std::auto_ptr<QColor> selected_color (NULL);
        const char *disabled = NULL;
		std::auto_ptr<QColor> web_bkg_color (NULL);
        const char* use_current_view_for_tab = NULL;

        CJSONEntry oEntry(tabbarElements[i].c_str());

        if ( oEntry.hasName("label") )
            label = oEntry.getString("label");
        if ( oEntry.hasName("action") )
            action = oEntry.getString("action");
        if ( oEntry.hasName("icon") )
            icon = oEntry.getString("icon");
        if ( oEntry.hasName("coloredIcon") )
            colored_icon = oEntry.getString("coloredIcon");
        if ( oEntry.hasName("reload") )
            reload = oEntry.getString("reload");
        if ( oEntry.hasName("selectedColor") )
            selected_color.reset(new QColor(getColorFromString(oEntry.getString("selectedColor"))));
        if ( oEntry.hasName("disabled") )
            disabled = oEntry.getString("disabled");
        if ( oEntry.hasName("useCurrentViewForTab") )
        {
            use_current_view_for_tab = oEntry.getString("useCurrentViewForTab");
            if (strcasecmp(use_current_view_for_tab, "true") == 0) {
                action = "none";
            }
        }
        if (oEntry.hasName("backgroundColor")) 
            web_bkg_color.reset(new QColor(getColorFromString(oEntry.getString("backgroundColor"))));

        if (label == NULL)
            label = "";
        
        if ( label == NULL || action == NULL) {
            RAWLOG_ERROR("Illegal argument for create_nativebar");
            return;
        }

        QtMainWindow::QTabBarRuntimeParams tbrp;
        tbrp["label"] = QString(label);
        tbrp["action"] = QString(action);
        tbrp["reload"] = charToBool(reload);
        tbrp["use_current_view_for_tab"] = charToBool(use_current_view_for_tab);
        tbrp["background_color"] = background_color.get() != NULL ? background_color->name() : QString("");
		tbrp["selected_color"] = selected_color.get() != NULL ? selected_color->name() : QString("");
        String strIconPath = icon ? CFilePath::join( RHODESAPP().getAppRootPath(), icon) : String();

        ((QtMainWindow*)qtMainWindow)->tabbarAddTab(QString(label), icon ? strIconPath.c_str() : NULL, charToBool(disabled), web_bkg_color.get(), tbrp);

        if (m_strStartTabName.length()>0 && m_strStartTabName == label)
            nStartTab = i;
    }

    if (oResult.hasCallback())
        ((QtMainWindow*)qtMainWindow)->tabbarSetSwitchCallback(oResult);

    ((QtMainWindow*)qtMainWindow)->tabbarShow();

    if (m_strStartTabName.length()>0&&nStartTab>=0)
    {
        tabbarSwitch(nStartTab);
        m_strStartTabName = "";
    }

    m_started = true;
}
Exemplo n.º 15
0
 virtual void getSkipPost(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set( RHOCONF().getBool("log_skip_post") );
 }
Exemplo n.º 16
0
 virtual void getEnableWebPlugins(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set(true);
 }
Exemplo n.º 17
0
 virtual void getDestinationURI(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set( RHOCONF().getString("Log.destinationURI") );
 }
Exemplo n.º 18
0
 virtual void getNavigationTimeout(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set(m_nNavigationTimeout);
 }
Exemplo n.º 19
0
 virtual void getExcludeCategories(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set(LOGCONF().getDisabledCategories());
 }
Exemplo n.º 20
0
 virtual void getScrollTechnique(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set( RHOCONF().getString("WebView.scrollTechnique") );
 }
Exemplo n.º 21
0
 virtual void getFilePath(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set( LOGCONF().getLogFilePath() );
 }
Exemplo n.º 22
0
 virtual void getFontFamily(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set( RHOCONF().getString("WebView.fontFamily") );
 }
Exemplo n.º 23
0
 virtual void getViewportWidth(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set( RHOCONF().getInt("WebView.viewportWidth") );
 }
Exemplo n.º 24
0
 virtual void getUserAgent(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set( RHOCONF().getString("WebView.userAgent") );
 }
Exemplo n.º 25
0
 virtual void getZoomPage(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set(m_dZoomPage);
 }
Exemplo n.º 26
0
 virtual void getViewportEnabled(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set( RHOCONF().getBool("WebView.viewportEnabled") );
 }
Exemplo n.º 27
0
 virtual void currentLocation( int tabIndex, rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set( rho_webview_current_location(tabIndex) );
 }
Exemplo n.º 28
0
 virtual void getNetTrace(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set( RHOCONF().getBool("net_trace") );
 }
Exemplo n.º 29
0
 virtual void getFramework(rho::apiGenerator::CMethodResult& oResult)
 {
     oResult.set(System::getWebviewFramework());
 }
Exemplo n.º 30
0
void CSystemImpl::getScreenSleeping(rho::apiGenerator::CMethodResult& oResult)
{
    oResult.set(false);
}