////////////////////////////////////////////////////////////////////////////////
// virtual
void LLMediaImplLLMozLib::onClickLinkNoFollow( const EventType& eventIn )
{
	LLMediaEvent event( this, eventIn.getStringValue() );
	mEventEmitter.update( &LLMediaObserver::onClickLinkNoFollow, event );
}
Esempio n. 2
0
////////////////////////////////////////////////////////////////////////////////
// virtual
void LLWebBrowserCtrl::onClickLinkHref( const EventType& eventIn )
{
	// if there is a value for the target (passed in stringValueEx)
	if ( eventIn.getStringValueEx().length() )
	{
		// if the target = "_new"
		if ( eventIn.getStringValueEx() == "_external" )		
		{
			mExternalUrl = eventIn.getStringValue();
			LLSD payload;
			payload["external_url"] = mExternalUrl;
			LLNotifications::instance().add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget);
			return;
		}
	}

	const std::string protocol1( "http://" );
	const std::string protocol2( "https://" );
	if( mOpenLinksInExternalBrowser )
	{
		if ( eventIn.getStringValue().length() )
		{
			if ( LLStringUtil::compareInsensitive( eventIn.getStringValue().substr( 0, protocol1.length() ), protocol1 ) == 0 ||
				 LLStringUtil::compareInsensitive( eventIn.getStringValue().substr( 0, protocol2.length() ), protocol2 ) == 0 )
			{
				LLWeb::loadURLExternal( eventIn.getStringValue() );
			}
		}
	}
	else
	if( mOpenLinksInInternalBrowser )
	{
		if ( eventIn.getStringValue().length() )
		{
			if ( LLStringUtil::compareInsensitive( eventIn.getStringValue().substr( 0, protocol1.length() ), protocol1 ) == 0 ||
				 LLStringUtil::compareInsensitive( eventIn.getStringValue().substr( 0, protocol2.length() ), protocol2 ) == 0 )
			{
				// If we spawn a new LLFloaterHTML, assume we want it to
				// follow this LLWebBrowserCtrl's trust for whether or
				// not to open secondlife:///app/ links. JC.
				const bool open_links_externally = false;
				LLFloaterHtml::getInstance()->show( 
					eventIn.getStringValue(), 
						"Second Life Browser",
							open_links_externally,
								mTrusted);
			}
		}
	}

	// chain this event on to observers of an instance of LLWebBrowserCtrl
	LLWebBrowserCtrlEvent event( eventIn.getStringValue(), eventIn.getStringValueEx() );
	mEventEmitter.update( &LLWebBrowserCtrlObserver::onClickLinkHref, event );
}
void
dmz::NetModulePacketCodecBasic::_discover_codec (const Plugin *PluginPtr) {

   const String Name (PluginPtr ? PluginPtr->get_plugin_name () : "");

   NetExtPacketCodecObject *objCodec (NetExtPacketCodecObject::cast (PluginPtr));
   NetExtPacketCodecEvent *eventCodec (NetExtPacketCodecEvent::cast (PluginPtr));

   if (Name && (objCodec || eventCodec)) {

      PacketStruct *hs (_packetTable.lookup (Name));

      if (hs) {

         DecodeStruct *ds (0);
         if (objCodec) { ds = new DecodeStruct (hs->PacketID, *objCodec); }
         else if (eventCodec) { ds = new DecodeStruct (hs->PacketID, *eventCodec); }

         if (ds && _decodeTable.store (hs->PacketID, ds)) {

            if (objCodec && hs->objects.get_count ()) {

               EncodeObjectStruct *eos (
                  new EncodeObjectStruct (hs->PacketID, *objCodec));

               if (eos && _objEncodeTable.store (hs->PacketID, eos)) {

                  ObjectTypeIterator it;

                  ObjectType type;

                  Boolean found (hs->objects.get_first (it, type));

                  while (found) {

                     _objTypeTable.store (type.get_handle (), eos);
                     found = hs->objects.get_next (it, type);
                  }
               }
               else if (eos) { delete eos; eos = 0; }
            }
            else if (eventCodec && hs->events.get_count ()) {

               EncodeEventStruct *ees (
                  new EncodeEventStruct (hs->PacketID, *eventCodec));

               if (ees && _eventEncodeTable.store (hs->PacketID, ees)) {

                  EventTypeIterator it;

                  EventType type;

                  Boolean found (hs->events.get_first (it, type));

                  while (found) {

                     _eventTypeTable.store (type.get_handle (), ees);
                     found = hs->events.get_next (it, type);
                  }
               }
               else if (ees) { delete ees; ees = 0; }
            }
         }
         else if (ds) {

            delete ds; ds = 0;
         }
      }
   }
}
Esempio n. 4
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 );
}
Esempio n. 5
0
////////////////////////////////////////////////////////////////////////////////
// virtual
void LLWebBrowserCtrl::onLocationChange( const EventType& eventIn )
{
	// chain this event on to observers of an instance of LLWebBrowserCtrl
	LLWebBrowserCtrlEvent event( eventIn.getStringValue() );
	mEventEmitter.update( &LLWebBrowserCtrlObserver::onLocationChange, event );
}
Esempio n. 6
0
////////////////////////////////////////////////////////////////////////////////
// virtual
void LLWebBrowserCtrl::onNavigateBegin( const EventType& eventIn )
{
	LLWebBrowserCtrlEvent event( eventIn.getStringValue() );
	mEventEmitter.update( &LLWebBrowserCtrlObserver::onNavigateBegin, event );
}
Esempio n. 7
0
void GlobalConfig::saveOptions()
{
    // color options
    ConfigGroup* colorConfig = ConfigStorage::group("CostColors");
    int count = 1;
    foreach(ConfigColorSetting* cs, _colors) {
	if ( !cs->_automatic ) {
	    colorConfig->setValue( QString("Name%1").arg(count),
				   cs->_name);
	    colorConfig->setValue( QString("Color%1").arg(count),
				   cs->_color);
	    count++;
	}
    }
    colorConfig->setValue("Count", count-1);
    delete colorConfig;

    // source options
    ConfigGroup* sourceConfig = ConfigStorage::group("Source");
    sourceConfig->setValue("Dirs", _generalSourceDirs);
    QHashIterator<QString,QStringList> it( _objectSourceDirs );
    count = 1;
    while( it.hasNext() ) {
	it.next();
	sourceConfig->setValue( QString("Object%1").arg(count),
				it.key() );
	sourceConfig->setValue( QString("Dirs%1").arg(count),
				it.value() );
	count++;
    }
    sourceConfig->setValue("Count", count-1);
    delete sourceConfig;

    // general options
    ConfigGroup* generalConfig = ConfigStorage::group("GeneralSettings");
    generalConfig->setValue("ShowPercentage", _showPercentage,
			    DEFAULT_SHOWPERCENTAGE);
    generalConfig->setValue("ShowExpanded", _showExpanded,
			    DEFAULT_SHOWEXPANDED);
    generalConfig->setValue("ShowCycles", _showCycles,
			    DEFAULT_SHOWCYCLES);
    generalConfig->setValue("CycleCut", _cycleCut,
			    DEFAULT_CYCLECUT);
    generalConfig->setValue("PercentPrecision", _percentPrecision,
			    DEFAULT_PERCENTPRECISION);
    generalConfig->setValue("MaxSymbolLength", _maxSymbolLength,
			    DEFAULT_MAXSYMBOLLENGTH);
    generalConfig->setValue("MaxSymbolCount", _maxSymbolCount,
			    DEFAULT_MAXSYMBOLCOUNT);
    generalConfig->setValue("MaxListCount", _maxListCount,
			    DEFAULT_MAXLISTCOUNT);
    generalConfig->setValue("Context", _context,
			    DEFAULT_CONTEXT);
    generalConfig->setValue("NoCostInside", _noCostInside,
			    DEFAULT_NOCOSTINSIDE);
    generalConfig->setValue("HideTemplates", _hideTemplates,
                            DEFAULT_HIDETEMPLATES);
    delete generalConfig;

    // event types
    ConfigGroup* etConfig = ConfigStorage::group("EventTypes");
    int etCount = EventType::knownTypeCount();
    etConfig->setValue( "Count", etCount);
    for (int i=0; i<etCount; i++) {
	EventType* t = EventType::knownType(i);
	etConfig->setValue( QString("Name%1").arg(i+1), t->name());
	etConfig->setValue( QString("Longname%1").arg(i+1),
			    t->longName(),
			    knownLongName(t->name()) );
	etConfig->setValue( QString("Formula%1").arg(i+1),
			    t->formula(), knownFormula(t->name()) );
    }
    delete etConfig;
}
 ////////////////////////////////////////////////////////////////////////////////
 // virtual
 void onWindowCloseRequested(const EventType& event)
 {
     LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "close_request");
     message.setValue("uuid", event.getStringValue());
     sendMessage(message);
 }
 ////////////////////////////////////////////////////////////////////////////////
 // virtual
 void onClickLinkNoFollow(const EventType& event)
 {
     LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_nofollow");
     message.setValue("uri", event.getEventUri());
     sendMessage(message);
 }
Esempio n. 10
0
// Checked: 2009-05-17 (RLVa-0.2.0a)
BOOL RlvExtGetSet::onReplyCommand(const EventType& rlvEvent)
{
	return processCommand(rlvEvent.getSenderID(), rlvEvent.getCommand());
}