Beispiel #1
0
ICQPlugin::~ICQPlugin()
{
    unregisterMessages();

    delete m_icq;
    delete m_aim;

    getContacts()->removePacketType(OscarPacket);
    getContacts()->removePacketType(ICQDirectPacket);
    getContacts()->removePacketType(AIMDirectPacket);

    Event eVisible(EventCommandRemove, (void*)CmdVisibleList);
    eVisible.process();

    Event eInvisible(EventCommandRemove, (void*)CmdInvisibleList);
    eInvisible.process();

    Event eCheckInvisible(EventCommandRemove, (void*)CmdCheckInvisible);
    eCheckInvisible.process();

    Event eCheckInvisibleAll(EventCommandRemove, (void*)CmdCheckInvisibleAll);
    eCheckInvisibleAll.process();

    Event eMenuSearch(EventMenuRemove, (void*)MenuSearchResult);
    eMenuSearch.process();

    Event eMenuGroups(EventMenuRemove, (void*)MenuIcqGroups);
    eMenuGroups.process();

    Event eMenuCheckInvisible(EventMenuRemove, (void*)MenuCheckInvisible);
    eMenuCheckInvisible.process();
}
Beispiel #2
0
ICQPlugin::ICQPlugin(unsigned base)
        : Plugin(base)
{
    Event ePlugin(EventGetPluginInfo, (void*)"_core");
    pluginInfo *info = (pluginInfo*)(ePlugin.process());
    core = static_cast<CorePlugin*>(info->plugin);

#if defined(WIN32) && (COMPAT_QT_VERSION < 0x030000)
    qInitJpeg();
#endif
    icq_plugin = this;

    OscarPacket = registerType();
    getContacts()->addPacketType(OscarPacket, "Oscar");
    ICQDirectPacket = registerType();
    getContacts()->addPacketType(ICQDirectPacket, "ICQ.Direct");
    AIMDirectPacket = registerType();
    getContacts()->addPacketType(AIMDirectPacket, "AIM.Direct");

    m_icq = new ICQProtocol(this);
    m_aim = new AIMProtocol(this);

    Event eMenuSearch(EventMenuCreate, (void*)MenuSearchResult);
    eMenuSearch.process();
    Event eMenuGroups(EventMenuCreate, (void*)MenuIcqGroups);
    eMenuGroups.process();
    Event eMenuCheckInvisible(EventMenuCreate, (void*)MenuCheckInvisible);
    eMenuCheckInvisible.process();

    Command cmd;
    cmd->id          = CmdVisibleList;
    cmd->text        = I18N_NOOP("Visible list");
    cmd->menu_id     = MenuContactGroup;
    cmd->menu_grp    = 0x8010;
    cmd->flags		 = COMMAND_CHECK_STATE;

    Event eCmd(EventCommandCreate, cmd);
    eCmd.process();

    cmd->id			 = CmdInvisibleList;
    cmd->text		 = I18N_NOOP("Invisible list");
    cmd->menu_grp	 = 0x8011;
    eCmd.process();

    cmd->id			 = CmdIcqSendMessage;
    cmd->text		 = I18N_NOOP("&Message");
    cmd->icon		 = "message";
    cmd->menu_id	 = MenuSearchResult;
    cmd->menu_grp	 = 0x1000;
    cmd->bar_id		 = 0;
    cmd->popup_id	 = 0;
    cmd->flags		 = COMMAND_DEFAULT;
    eCmd.process();

    cmd->id			 = CmdInfo;
    cmd->text		 = I18N_NOOP("User &info");
    cmd->icon		 = "info";
    cmd->menu_grp	 = 0x1001;
    eCmd.process();

    cmd->id			 = CmdGroups;
    cmd->text		 = I18N_NOOP("&Add to group");
    cmd->icon		 = NULL;
    cmd->menu_grp	 = 0x1002;
    cmd->popup_id	 = MenuIcqGroups;
    eCmd.process();

    cmd->id			 = CmdGroups;
    cmd->text		 = "_";
    cmd->menu_id	 = MenuIcqGroups;
    cmd->flags		 = COMMAND_CHECK_STATE;
    eCmd.process();

    cmd->id			 = CmdCheckInvisibleAll;
    cmd->text		 = I18N_NOOP("Check &invisible");
    cmd->icon		 = "ICQ_invisible";
    cmd->menu_id	 = MenuMain;
    cmd->menu_grp	 = 0x2090;
    cmd->popup_id	 = 0;
    cmd->flags		 = COMMAND_CHECK_STATE;
    eCmd.process();

    cmd->id			 = CmdCheckInvisibleAll;
    cmd->text		 = I18N_NOOP("&All");
    cmd->icon		 = NULL;
    cmd->menu_id	 = MenuCheckInvisible;
    cmd->menu_grp	 = 0x2000;
    cmd->popup_id	 = 0;
    cmd->flags		 = COMMAND_DEFAULT;
    eCmd.process();

    cmd->id			 = CmdCheckInvisible;
    cmd->text		 = I18N_NOOP("&Only invisible");
    cmd->icon		 = NULL;
    cmd->menu_id	 = MenuCheckInvisible;
    cmd->menu_grp	 = 0x2001;
    cmd->popup_id	 = 0;
    cmd->flags		 = COMMAND_DEFAULT;
    eCmd.process();

    registerMessages();

    RetrySendDND = registerType();
    RetrySendOccupied = registerType();
}
Beispiel #3
0
ICQPlugin::ICQPlugin(unsigned base, const char *cfg)
        : Plugin(base)
{
#ifdef WIN32
    qInitJpeg();
#endif
    icq_plugin = this;

    load_data(icqData, &data, cfg);

    OscarPacket = registerType();
    getContacts()->addPacketType(OscarPacket, "Oscar");
    ICQDirectPacket = registerType();
    getContacts()->addPacketType(ICQDirectPacket, "ICQ.Direct");

    IconDef icon;
    icon.name = "ICQ_online";
    icon.xpm = online;
    icon.isSystem = false;

    Event eIcon(EventAddIcon, &icon);
    eIcon.process();

    icon.name = "ICQ_offline";
    icon.xpm = offline;
    eIcon.process();

    icon.name = "ICQ_away";
    icon.xpm = away;
    eIcon.process();

    icon.name = "ICQ_na";
    icon.xpm = na;
    eIcon.process();

    icon.name = "ICQ_occupied";
    icon.xpm = occupied;
    eIcon.process();

    icon.name = "ICQ_dnd";
    icon.xpm = dnd;
    eIcon.process();

    icon.name = "ICQ_ffc";
    icon.xpm = ffc;
    eIcon.process();

    icon.name = "ICQ_invisible";
    icon.xpm = invisible;
    eIcon.process();

    icon.name = "birthday";
    icon.xpm = birthday;
    eIcon.process();

    icon.name = "more";
    icon.xpm = more;
    eIcon.process();

    icon.name = "interest";
    icon.xpm = interest;
    eIcon.process();

    icon.name = "past";
    icon.xpm = past;
    eIcon.process();

    icon.name = "useronline";
    icon.xpm = useronline;
    eIcon.process();

    icon.name = "useroffline";
    icon.xpm = useroffline;
    eIcon.process();

    icon.name = "userunknown";
    icon.xpm = userunknown;
    eIcon.process();

    icon.name = "encoding";
    icon.xpm = encoding;
    eIcon.process();

    icon.name = "url";
    icon.xpm = url;
    eIcon.process();

    icon.name = "contacts";
    icon.xpm = contacts;
    eIcon.process();

    icon.name = "web";
    icon.xpm = web;
    eIcon.process();

    icon.name = "mailpager";
    icon.xpm = mailpager;
    eIcon.process();

    icon.name = "icqphone";
    icon.xpm = icqphone;
    eIcon.process();

    icon.name = "icqphonebusy";
    icon.xpm = icqphonebusy;
    eIcon.process();

    icon.name = "sharedfiles";
    icon.xpm = sharedfiles;
    eIcon.process();

    icon.name = "pict";
    icon.xpm = pict;
    eIcon.process();

    icon.name = "AIM_offline";
    icon.xpm = aim_offline;
    eIcon.process();

    icon.name = "AIM_online";
    icon.xpm = aim_online;
    eIcon.process();

    icon.name = "AIM_away";
    icon.xpm = aim_away;
    eIcon.process();

    EventSearch = EventUser + registerType();
    EventSearchDone = EventUser + registerType();
    EventAutoReplyFail = EventUser + registerType();
    EventRandomChat = EventUser + registerType();
    EventRandomChatInfo = EventUser + registerType();
    EventServiceReady = EventUser + registerType();
    MenuEncoding = registerType();
    MenuSearchResult = registerType();
    MenuGroups = registerType();

    CmdVisibleList = registerType();
    CmdInvisibleList = registerType();
    CmdChangeEncoding = registerType();
    CmdAllEncodings = registerType();
    CmdSendMessage = registerType();
    CmdGroups = registerType();
    CmdCheckInvisibleAll = registerType();
    CmdCheckInvisible  = registerType();
	MenuCheckInvisible = registerType();

    m_icq = new ICQProtocol(this);
    m_aim = new AIMProtocol(this);

    Event eMenuEncoding(EventMenuCreate, (void*)MenuEncoding);
    eMenuEncoding.process();
    Event eMenuSearch(EventMenuCreate, (void*)MenuSearchResult);
    eMenuSearch.process();
    Event eMenuGroups(EventMenuCreate, (void*)MenuGroups);
    eMenuGroups.process();
    Event eMenuCheckInvisible(EventMenuCreate, (void*)MenuCheckInvisible);
    eMenuCheckInvisible.process();

    Command cmd;
    cmd->id          = CmdVisibleList;
    cmd->text        = I18N_NOOP("Visible list");
    cmd->menu_id     = MenuContactGroup;
    cmd->menu_grp    = 0x8010;
    cmd->flags		 = COMMAND_CHECK_STATE;

    Event eCmd(EventCommandCreate, cmd);
    eCmd.process();

    cmd->id			 = CmdInvisibleList;
    cmd->text		 = I18N_NOOP("Invisible list");
    cmd->menu_grp	 = 0x8011;
    eCmd.process();

    cmd->id			 = CmdChangeEncoding;
    cmd->text		 = "_";
    cmd->menu_id	 = MenuEncoding;
    cmd->menu_grp	 = 0x1000;
    eCmd.process();

    cmd->id			 = CmdAllEncodings;
    cmd->text		 = I18N_NOOP("&Show all encodings");
    cmd->menu_id	 = MenuEncoding;
    cmd->menu_grp	 = 0x8000;
    eCmd.process();

    cmd->id			 = CmdChangeEncoding;
    cmd->text		 = I18N_NOOP("Change &encoding");
    cmd->icon		 = "encoding";
    cmd->menu_id	 = 0;
    cmd->menu_grp	 = 0;
    cmd->bar_id		 = ToolBarContainer;
    cmd->bar_grp	 = 0x8080;
    cmd->popup_id	 = MenuEncoding;
    eCmd.process();

    cmd->id			 = CmdChangeEncoding;
    cmd->text		 = I18N_NOOP("Change &encoding");
    cmd->icon		 = "encoding";
    cmd->menu_id	 = 0;
    cmd->menu_grp	 = 0;
    cmd->bar_id		 = BarHistory;
    cmd->bar_grp	 = 0x8080;
    cmd->popup_id	 = MenuEncoding;
    eCmd.process();

    cmd->id			 = CmdSendMessage;
    cmd->text		 = I18N_NOOP("&Message");
    cmd->icon		 = "message";
    cmd->menu_id	 = MenuSearchResult;
    cmd->menu_grp	 = 0x1000;
    cmd->bar_id		 = 0;
    cmd->popup_id	 = 0;
    cmd->flags		 = COMMAND_DEFAULT;
    eCmd.process();

    cmd->id			 = CmdInfo;
    cmd->text		 = I18N_NOOP("User &info");
    cmd->icon		 = "info";
    cmd->menu_grp	 = 0x1001;
    eCmd.process();

    cmd->id			 = CmdGroups;
    cmd->text		 = I18N_NOOP("&Add to group");
    cmd->icon		 = NULL;
    cmd->menu_grp	 = 0x1002;
    cmd->popup_id	 = MenuGroups;
    eCmd.process();

    cmd->id			 = CmdGroups;
    cmd->text		 = "_";
    cmd->menu_id	 = MenuGroups;
    cmd->flags		 = COMMAND_CHECK_STATE;
    eCmd.process();

    cmd->id			 = CmdCheckInvisibleAll;
    cmd->text		 = I18N_NOOP("Check &invisible");
    cmd->icon		 = "ICQ_invisible";
    cmd->menu_id	 = MenuMain;
    cmd->menu_grp	 = 0x2090;
    cmd->popup_id	 = 0;
    cmd->flags		 = COMMAND_CHECK_STATE;
    eCmd.process();

    cmd->id			 = CmdCheckInvisibleAll;
    cmd->text		 = I18N_NOOP("&All");
    cmd->icon		 = NULL;
    cmd->menu_id	 = MenuCheckInvisible;
    cmd->menu_grp	 = 0x2000;
    cmd->popup_id	 = 0;
    cmd->flags		 = COMMAND_DEFAULT;
    eCmd.process();

    cmd->id			 = CmdCheckInvisible;
    cmd->text		 = I18N_NOOP("&Only invisible");
    cmd->icon		 = NULL;
    cmd->menu_id	 = MenuCheckInvisible;
    cmd->menu_grp	 = 0x2001;
    cmd->popup_id	 = 0;
    cmd->flags		 = COMMAND_DEFAULT;
    eCmd.process();

    registerMessages();

    RetrySendDND = registerType();
    RetrySendOccupied = registerType();
}