コード例 #1
0
ファイル: main.cpp プロジェクト: Seldom/miranda-ng
int SystemModulesLoaded(WPARAM, LPARAM)
{
	//Insert "Check mail (YAMN)" item to Miranda's menu
	CMenuItem mi;
	
	SET_UID(mi, 0xa01ff3d9, 0x53cb, 0x4406, 0x85, 0xd9, 0xf1, 0x90, 0x3a, 0x94, 0xed, 0xf4);
	mi.position = 0xb0000000;
	mi.hIcolibItem = g_GetIconHandle(0);
	mi.name.a = LPGEN("Check &mail (All Account)");
	mi.pszService = MS_YAMN_FORCECHECK;
	hMenuItemMain = Menu_AddMainMenuItem(&mi);

	SET_UID(mi, 0xfe22191f, 0x40c8, 0x479f, 0x93, 0x5d, 0xa5, 0x17, 0x1f, 0x57, 0x2f, 0xcb);
	mi.name.a = LPGEN("Check &mail (This Account)");
	mi.pszService = MS_YAMN_CLISTCONTEXT;
	hMenuItemCont = Menu_AddContactMenuItem(&mi, YAMN_DBMODULE);

	SET_UID(mi, 0x147c7800, 0x12d0, 0x4209, 0xab, 0xcc, 0xfa, 0x64, 0xc6, 0xb0, 0xa6, 0xeb);
	mi.hIcolibItem = g_GetIconHandle(1);
	mi.name.a = LPGEN("Launch application");
	mi.pszService = MS_YAMN_CLISTCONTEXTAPP;
	hMenuItemContApp = Menu_AddContactMenuItem(&mi, YAMN_DBMODULE);

	CheckMenuItems();

	if (hAccountFolder = FoldersRegisterCustomPathT(LPGEN("YAMN"), LPGEN("YAMN Account Folder"), UserDirectory))
		FoldersGetCustomPathT(hAccountFolder, UserDirectory, MAX_PATH, UserDirectory);

	RegisterPOP3Plugin(0, 0);
	return 0;
}
コード例 #2
0
ファイル: jabber_menu.cpp プロジェクト: Seldom/miranda-ng
int g_OnToolbarInit(WPARAM, LPARAM)
{
    if (g_Instances.getCount() == 0)
        return 0;

    TTBButton ttb = { 0 };
    ttb.dwFlags = TTBBF_SHOWTOOLTIP | TTBBF_VISIBLE;

    CreateServiceFunction("JABBER/*/Groupchat", g_ToolbarHandleJoinGroupchat);
    ttb.pszService = "JABBER/*/Groupchat";
    ttb.pszTooltipUp = ttb.name = LPGEN("Join conference");
    ttb.hIconHandleUp = g_GetIconHandle(IDI_GROUP);
    TopToolbar_AddButton(&ttb);

    CreateServiceFunction("JABBER/*/Bookmarks", g_ToolbarHandleBookmarks);
    ttb.pszService = "JABBER/*/Bookmarks";
    ttb.pszTooltipUp = ttb.name = LPGEN("Open bookmarks");
    ttb.hIconHandleUp = g_GetIconHandle(IDI_BOOKMARKS);
    TopToolbar_AddButton(&ttb);

    CreateServiceFunction("JABBER/*/ServiceDiscovery", g_ToolbarHandleServiceDiscovery);
    ttb.pszService = "JABBER/*/ServiceDiscovery";
    ttb.pszTooltipUp = ttb.name = LPGEN("Service discovery");
    ttb.hIconHandleUp = g_GetIconHandle(IDI_SERVICE_DISCOVERY);
    TopToolbar_AddButton(&ttb);
    return 0;
}
コード例 #3
0
ファイル: main.cpp プロジェクト: martok/miranda-ng
int SystemModulesLoaded(WPARAM, LPARAM)
{
	//Insert "Check mail (YAMN)" item to Miranda's menu
	CLISTMENUITEM mi = { sizeof(mi) };
	mi.position = 0xb0000000;
	mi.icolibItem = g_GetIconHandle(0);
	mi.pszName = LPGEN("Check &mail (All Account)");
	mi.pszPopupName = NULL;//YAMN_DBMODULE;
	mi.pszService = MS_YAMN_FORCECHECK;
	hMenuItemMain = Menu_AddMainMenuItem(&mi);

	mi.pszName = LPGEN("Check &mail (This Account)");
	mi.pszContactOwner = YAMN_DBMODULE;
	mi.pszService = MS_YAMN_CLISTCONTEXT;
	hMenuItemCont = Menu_AddContactMenuItem(&mi);

	mi.icolibItem = g_GetIconHandle(1);
	mi.pszName = LPGEN("Launch application");
	mi.pszContactOwner = YAMN_DBMODULE;
	mi.pszService = MS_YAMN_CLISTCONTEXTAPP;
	hMenuItemContApp = Menu_AddContactMenuItem(&mi);

	CheckMenuItems();

	if (hAccountFolder = FoldersRegisterCustomPathT(LPGEN("YAMN"), LPGEN("YAMN Account Folder"), UserDirectory))
		FoldersGetCustomPathT(hAccountFolder, UserDirectory, MAX_PATH, UserDirectory);

	RegisterPOP3Plugin(0, 0);
	return 0;
}
コード例 #4
0
HANDLE CJabberProto::GetIconHandle(int iconId)
{
	if (iconId == IDI_JABBER)
		return m_hProtoIcon;

	return g_GetIconHandle(iconId);
}
コード例 #5
0
void CJabberDlgGcJoin::OnInitDialog()
{
	CSuper::OnInitDialog();

	Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_GROUP));

	JabberGcRecentInfo *pInfo = NULL;
	if (m_jid)
		pInfo = new JabberGcRecentInfo(m_proto, m_jid);
	else if (OpenClipboard(m_hwnd)) {
		HANDLE hData = GetClipboardData(CF_UNICODETEXT);

		if (hData) {
			TCHAR *buf = (TCHAR *)GlobalLock(hData);
			if (buf && _tcschr(buf, _T('@')) && !_tcschr(buf, _T(' ')))
				pInfo = new JabberGcRecentInfo(m_proto, buf);
			GlobalUnlock(hData);
		}
		CloseClipboard();
	}

	if (pInfo) {
		pInfo->fillForm(m_hwnd);
		delete pInfo;
	}

	ptrT tszNick(m_proto->getTStringA("Nick"));
	if (tszNick == NULL)
		tszNick = JabberNickFromJID(m_proto->m_szJabberJID);
	SetDlgItemText(m_hwnd, IDC_NICK, tszNick);

	TEXTMETRIC tm = { 0 };
	HDC hdc = GetDC(m_hwnd);
	GetTextMetrics(hdc, &tm);
	ReleaseDC(m_hwnd, hdc);
	sttTextLineHeight = tm.tmHeight;
	SendDlgItemMessage(m_hwnd, IDC_ROOM, CB_SETITEMHEIGHT, -1, sttTextLineHeight - 1);

	LOGFONT lf = { 0 };
	HFONT hfnt = (HFONT)SendDlgItemMessage(m_hwnd, IDC_TXT_RECENT, WM_GETFONT, 0, 0);
	GetObject(hfnt, sizeof(lf), &lf);
	lf.lfWeight = FW_BOLD;
	SendDlgItemMessage(m_hwnd, IDC_TXT_RECENT, WM_SETFONT, (WPARAM)CreateFontIndirect(&lf), TRUE);

	SendDlgItemMessage(m_hwnd, IDC_BOOKMARKS, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx("bookmarks"));
	SendDlgItemMessage(m_hwnd, IDC_BOOKMARKS, BUTTONSETASFLATBTN, TRUE, 0);
	SendDlgItemMessage(m_hwnd, IDC_BOOKMARKS, BUTTONADDTOOLTIP, (WPARAM)"Bookmarks", 0);
	SendDlgItemMessage(m_hwnd, IDC_BOOKMARKS, BUTTONSETASPUSHBTN, TRUE, 0);

	m_proto->ComboLoadRecentStrings(m_hwnd, IDC_SERVER, "joinWnd_rcSvr");

	int i;
	for (i = 0; i < 5; i++) {
		TCHAR jid[JABBER_MAX_JID_LEN];
		JabberGcRecentInfo info(m_proto);
		if (!info.loadRecent(i))
			break;

		mir_sntprintf(jid, _T("%s@%s (%s)"), info.m_room, info.m_server, info.m_nick ? info.m_nick : TranslateT("<no nick>"));
		SetDlgItemText(m_hwnd, IDC_RECENT1 + i, jid);
	}
	sttJoinDlgShowRecentItems(m_hwnd, i);
}
コード例 #6
0
ファイル: jabber_menu.cpp プロジェクト: Seldom/miranda-ng
void g_MenuInit(void)
{
    hStatusMenuInit = CreateHookableEvent(ME_JABBER_MENUINIT);

    HookEvent(ME_CLIST_PREBUILDCONTACTMENU, JabberPrebuildContactMenu);

    CreateServiceFunction("Jabber/MenuChoose", JabberMenuChooseService);

    hChooserMenu = Menu_AddObject("JabberAccountChooser", LPGEN("Jabber account chooser"), 0, "Jabber/MenuChoose");
    {
        CMenuItem mi;
        mi.name.a = "Cancel";
        mi.position = 9999999;
        mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE);
        Menu_AddItem(hChooserMenu, &mi, NULL);
    }

    //////////////////////////////////////////////////////////////////////////////////////
    // Contact menu initialization

    CMenuItem mi;
    mi.flags = CMIF_UNMOVABLE;

    // "Request authorization"
    SET_UID(mi, 0x36375a1f, 0xc142, 0x4d6e, 0xa6, 0x57, 0xe4, 0x76, 0x5d, 0xbc, 0x59, 0x8e);
    mi.name.a = LPGEN("Request authorization");
    mi.position = -2000001000;
    mi.hIcolibItem = Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
    mi.pszService = "Jabber/ReqAuth";
    g_hMenuRequestAuth = Menu_AddContactMenuItem(&mi);
    CreateServiceFunction(mi.pszService, JabberMenuHandleRequestAuth);

    // "Grant authorization"
    SET_UID(mi, 0x4c90452a, 0x869a, 0x4a81, 0xaf, 0xa8, 0x28, 0x34, 0xaf, 0x2b, 0x6b, 0x30);
    mi.pszService = "Jabber/GrantAuth";
    mi.name.a = LPGEN("Grant authorization");
    mi.position = -2000001001;
    mi.hIcolibItem = Skin_GetIconHandle(SKINICON_AUTH_GRANT);
    g_hMenuGrantAuth = Menu_AddContactMenuItem(&mi);
    CreateServiceFunction(mi.pszService, JabberMenuHandleGrantAuth);

    // Revoke auth
    SET_UID(mi, 0x619efdcb, 0x99c0, 0x44a8, 0xbf, 0x28, 0xc3, 0xe0, 0x2f, 0xb3, 0x7e, 0x77);
    mi.pszService = "Jabber/RevokeAuth";
    mi.name.a = LPGEN("Revoke authorization");
    mi.position = -2000001002;
    mi.hIcolibItem = Skin_GetIconHandle(SKINICON_AUTH_REVOKE);
    g_hMenuRevokeAuth = Menu_AddContactMenuItem(&mi);
    CreateServiceFunction(mi.pszService, JabberMenuRevokeAuth);

    // "Convert Chat/Contact"
    SET_UID(mi, 0xa98894ec, 0xbaa6, 0x4e1e, 0x8d, 0x75, 0x72, 0xc, 0xae, 0x25, 0xd8, 0x87);
    mi.pszService = "Jabber/ConvertChatContact";
    mi.name.a = LPGEN("Convert");
    mi.position = -1999901004;
    mi.hIcolibItem = g_GetIconHandle(IDI_USER2ROOM);
    g_hMenuConvert = Menu_AddContactMenuItem(&mi);
    CreateServiceFunction(mi.pszService, JabberMenuConvertChatContact);

    // "Add to roster"
    SET_UID(mi, 0x3928ba10, 0x69bc, 0x4ec9, 0x96, 0x48, 0xa4, 0x1b, 0xbe, 0x58, 0x4a, 0x7e);
    mi.pszService = "Jabber/AddToRoster";
    mi.name.a = LPGEN("Add to roster");
    mi.position = -1999901005;
    mi.hIcolibItem = Skin_GetIconHandle(SKINICON_AUTH_ADD);
    g_hMenuRosterAdd = Menu_AddContactMenuItem(&mi);
    CreateServiceFunction(mi.pszService, JabberMenuRosterAdd);

    // "Add to Bookmarks"
    SET_UID(mi, 0x7d06d00b, 0x3a3e, 0x4d65, 0xac, 0xc5, 0x63, 0xe2, 0x60, 0xbe, 0xc6, 0x6);
    mi.pszService = "Jabber/AddToBookmarks";
    mi.name.a = LPGEN("Add to Bookmarks");
    mi.position = -1999901006;
    mi.hIcolibItem = g_GetIconHandle(IDI_BOOKMARKS);
    g_hMenuAddBookmark = Menu_AddContactMenuItem(&mi);
    CreateServiceFunction(mi.pszService, JabberMenuBookmarkAdd);

    // Login/logout
    SET_UID(mi, 0x7674d540, 0x2638, 0x4958, 0x99, 0xda, 0x8, 0x3f, 0xad, 0x66, 0x8f, 0xed);
    mi.pszService = "Jabber/TransportLogin";
    mi.name.a = LPGEN("Login/logout");
    mi.position = -1999901007;
    mi.hIcolibItem = g_GetIconHandle(IDI_LOGIN);
    g_hMenuLogin = Menu_AddContactMenuItem(&mi);
    CreateServiceFunction(mi.pszService, JabberMenuTransportLogin);

    // Retrieve nicks
    SET_UID(mi, 0x6adf70d9, 0x6e92, 0x4a4f, 0x90, 0x71, 0x67, 0xa7, 0xaa, 0x1a, 0x19, 0x7a);
    mi.pszService = "Jabber/TransportGetNicks";
    mi.name.a = LPGEN("Resolve nicks");
    mi.position = -1999901008;
    mi.hIcolibItem = g_GetIconHandle(IDI_REFRESH);
    g_hMenuRefresh = Menu_AddContactMenuItem(&mi);
    CreateServiceFunction(mi.pszService, JabberMenuTransportResolve);

    // Run Commands
    SET_UID(mi, 0x25546e26, 0xc82, 0x4715, 0xb8, 0xca, 0xe5, 0xf7, 0x2a, 0x58, 0x9, 0x2);
    mi.pszService = "Jabber/RunCommands";
    mi.name.a = LPGEN("Commands");
    mi.position = -1999901009;
    mi.hIcolibItem = g_GetIconHandle(IDI_COMMAND);
    g_hMenuCommands = Menu_AddContactMenuItem(&mi);
    CreateServiceFunction(mi.pszService, JabberContactMenuRunCommands);

    // Send Note
    SET_UID(mi, 0xf4b0cc51, 0xab9, 0x4cf0, 0x96, 0xaa, 0x22, 0xa0, 0x33, 0x9b, 0x56, 0xc5);
    mi.pszService = "Jabber/SendNote";
    mi.name.a = LPGEN("Send Note");
    mi.position = -1999901010;
    mi.hIcolibItem = g_GetIconHandle(IDI_SEND_NOTE);
    g_hMenuSendNote = Menu_AddContactMenuItem(&mi);
    CreateServiceFunction(mi.pszService, JabberMenuSendNote);

    // Direct Presence
    SET_UID(mi,  0x89803943, 0xa87e, 0x4ae9, 0xbf, 0x79, 0xe3, 0xf3, 0xd6, 0x86, 0xf8, 0x3d);
    mi.pszService = "Jabber/DirectPresenceDummySvc";
    mi.name.a = LPGEN("Send Presence");
    mi.position = -1999901011;
    mi.hIcolibItem = g_GetIconHandle(IDI_NOTES);
    g_hMenuDirectPresence[0] = Menu_AddContactMenuItem(&mi);

    UNSET_UID(mi);
    mi.flags |= CMIF_TCHAR;
    mi.root = g_hMenuDirectPresence[0];
    for (int i = 0; i < _countof(PresenceModeArray); i++) {
        char buf[] = "Jabber/DirectPresenceX";
        buf[_countof(buf) - 2] = '0' + i;
        mi.pszService = buf;
        mi.name.t = pcli->pfnGetStatusModeDescription(PresenceModeArray[i].mode, 0);
        mi.position = -1999901000;
        mi.hIcolibItem = Skin_LoadIcon(PresenceModeArray[i].icon);
        g_hMenuDirectPresence[i + 1] = Menu_AddContactMenuItem(&mi);
        CreateServiceFunctionParam(mi.pszService, JabberMenuHandleDirectPresence, PresenceModeArray[i].mode);
    }

    mi.flags &= ~(CMIF_TCHAR);
    mi.root = NULL;

    // Resource selector
    SET_UID(mi, 0x32a7bb9d, 0x4d9, 0x49b3, 0xac, 0x8f, 0x83, 0xb5, 0x6b, 0xff, 0x4f, 0x5);
    mi.pszService = "Jabber/ResourceSelectorDummySvc";
    mi.name.a = LPGEN("Jabber Resource");
    mi.position = -1999901011;
    mi.hIcolibItem = g_GetIconHandle(IDI_JABBER);
    g_hMenuResourcesRoot = Menu_AddContactMenuItem(&mi);

    SET_UID(mi, 0xb8059d69, 0xa927, 0x4d68, 0xb4, 0x88, 0xf7, 0x32, 0x85, 0x50, 0xde, 0x6f);
    mi.pszService = "Jabber/UseResource_last";
    mi.name.a = LPGEN("Last Active");
    mi.position = -1999901000;
    mi.root = g_hMenuResourcesRoot;
    mi.hIcolibItem = g_GetIconHandle(IDI_JABBER);
    g_hMenuResourcesActive = Menu_AddContactMenuItem(&mi);
    CreateServiceFunctionParam(mi.pszService, JabberMenuHandleResource, MENUITEM_LASTSEEN);

    SET_UID(mi,0xf44812ea, 0x4f37, 0x4a57, 0x86, 0xa8, 0x40, 0x51, 0x22, 0x9f, 0xd5, 0xa8);
    mi.pszService = "Jabber/UseResource_server";
    mi.name.a = LPGEN("Server's Choice");
    mi.position = -1999901000;
    mi.hIcolibItem = g_GetIconHandle(IDI_NODE_SERVER);
    g_hMenuResourcesServer = Menu_AddContactMenuItem(&mi);
    CreateServiceFunctionParam(mi.pszService, JabberMenuHandleResource, MENUITEM_SERVER);
}