////////////////////////////////////////////////////////////////////////////////
    // virtual
    void onNavigateComplete(const EventType& event)
    {
        if(mInitState >= INIT_STATE_NAVIGATE_COMPLETE)
        {
            if(mInitState < INIT_STATE_RUNNING)
            {
                setInitState(INIT_STATE_RUNNING);

                // Clear the history, so the "back" button doesn't take you back to "about:blank".
                LLQtWebKit::getInstance()->clearHistory(mBrowserWindowId);
            }

            LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_complete");
            message.setValue("uri", event.getEventUri());
            message.setValueS32("result_code", event.getIntValue());
            message.setValue("result_string", event.getStringValue());
            message.setValueBoolean("history_back_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_BACK));
            message.setValueBoolean("history_forward_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_FORWARD));
            sendMessage(message);

            setStatus(STATUS_LOADED);
        }
        else if(mInitState == INIT_STATE_NAVIGATING)
        {
            setInitState(INIT_STATE_NAVIGATE_COMPLETE);
        }

    }
    ////////////////////////////////////////////////////////////////////////////////
    // virtual
    void onCursorChanged(const EventType& event)
    {
        LLQtWebKit::ECursor llqt_cursor = (LLQtWebKit::ECursor)event.getIntValue();
        std::string name;

        switch(llqt_cursor)
        {
        case LLQtWebKit::C_ARROW:
            name = "arrow";
            break;
        case LLQtWebKit::C_IBEAM:
            name = "ibeam";
            break;
        case LLQtWebKit::C_SPLITV:
            name = "splitv";
            break;
        case LLQtWebKit::C_SPLITH:
            name = "splith";
            break;
        case LLQtWebKit::C_POINTINGHAND:
            name = "hand";
            break;

        default:
            llwarns << "Unknown cursor ID: " << (int)llqt_cursor << llendl;
            break;
        }

        LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "cursor_changed");
        message.setValue("name", name);
        sendMessage(message);
    }
Exemplo n.º 3
0
////////////////////////////////////////////////////////////////////////////////
// virtual
void LLMediaImplLLMozLib::onNavigateComplete( const EventType& eventIn )
{
    // force an update when the page is finished
    mNeedsUpdate = true;

    // pass in url and HTML response code (200/404 etc.)
    LLMediaEvent event( this, eventIn.getEventUri(), eventIn.getIntValue() );
    mEventEmitter.update( &LLMediaObserver::onNavigateComplete, event );
}
 ////////////////////////////////////////////////////////////////////////////////
 // virtual
 void onUpdateProgress(const EventType& event)
 {
     if(mInitState >= INIT_STATE_NAVIGATE_COMPLETE)
     {
         LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "progress");
         message.setValueS32("percent", event.getIntValue());
         sendMessage(message);
     }
 }
Exemplo n.º 5
0
		////////////////////////////////////////////////////////////////////////////////
		// virtual
		void onNavigateErrorPage( const EventType& event )
		{
			std::cout << "Error page hit with code of " << event.getIntValue() << " - navigating to another URL" << std::endl;
			LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, "http://bestbuy.com" );
		};
Exemplo n.º 6
0
		////////////////////////////////////////////////////////////////////////////////
		// virtual
		void onCookieChanged( const EventType& eventIn )
		{
			int dead = eventIn.getIntValue();
			std::cout << (dead?"deleting cookie: ":"setting cookie: ") << eventIn.getStringValue() << std::endl;
		}
Exemplo n.º 7
0
		////////////////////////////////////////////////////////////////////////////////
		// virtual
		void onUpdateProgress( const EventType& eventIn )
		{
			std::cout << "Event: progress value updated to " << eventIn.getIntValue() << std::endl;
		};
Exemplo n.º 8
0
		////////////////////////////////////////////////////////////////////////////////
		// virtual
		void onNavigateComplete( const EventType& eventIn )
		{
			std::cout << "Event: end navigation to " << eventIn.getEventUri() << " with response status of " << eventIn.getIntValue() << std::endl;
		};
Exemplo n.º 9
0
////////////////////////////////////////////////////////////////////////////////
// virtual
void LLMediaImplLLMozLib::onUpdateProgress( const EventType& eventIn )
{
    LLMediaEvent event( this, eventIn.getIntValue() );
    mEventEmitter.update( &LLMediaObserver::onUpdateProgress, event );
}
Exemplo n.º 10
0
////////////////////////////////////////////////////////////////////////////////
// virtual
void LLWebBrowserCtrl::onUpdateProgress( const EventType& eventIn )
{
	// chain this event on to observers of an instance of LLWebBrowserCtrl
	LLWebBrowserCtrlEvent event( eventIn.getIntValue() );
	mEventEmitter.update( &LLWebBrowserCtrlObserver::onUpdateProgress, event );
}