You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
297 lines
10 KiB
297 lines
10 KiB
//+---------------------------------------------------------------------------
|
|
//
|
|
// Copyright 1997 Microsoft Corporation. All Rights Reserved.
|
|
//
|
|
// Contents: IBasicIM and related interfaces
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#ifdef __MKTYPLIB__
|
|
#define VARIANT_BOOL boolean
|
|
#else // __MKTYPLIB__
|
|
cpp_quote("//+-------------------------------------------------------------------------")
|
|
cpp_quote("//")
|
|
cpp_quote("// Microsoft Windows")
|
|
cpp_quote("// Copyright 1997 Microsoft Corporation. All Rights Reserved.")
|
|
cpp_quote("//")
|
|
cpp_quote("// File: basicim.h")
|
|
cpp_quote("//")
|
|
cpp_quote("//--------------------------------------------------------------------------")
|
|
|
|
|
|
import "objidl.idl";
|
|
import "oleidl.idl";
|
|
import "oaidl.idl";
|
|
#endif // __MKTYPLIB__
|
|
#include "mdispid.h"
|
|
|
|
#define BASICIM_S(e) (0x01000300 + (e))
|
|
#define BASICIM_E(e) (0x81000300 + (e))
|
|
#define E_FAIL 0x80004005
|
|
#define S_OK 0
|
|
|
|
//--------------------------------------------------------------------------
|
|
// Type Library
|
|
[
|
|
uuid(566ACF67-6124-4812-9362-E6D0C431D6F5), // LIBID_BasicIM
|
|
version(1.0),
|
|
helpstring("Messenger Basic IM Type Library")
|
|
]
|
|
library BasicIM
|
|
{
|
|
importlib("stdole32.tlb");
|
|
interface IBasicIMOld;
|
|
interface IBasicIM;
|
|
interface IBasicIMUser;
|
|
interface IBasicIMUsers;
|
|
|
|
#define DISPID_VALUE 0
|
|
#define DISPID_NEWENUM -4
|
|
|
|
typedef enum
|
|
{
|
|
BIMSTATE_UNKNOWN = 0x0000,
|
|
|
|
BIMSTATE_OFFLINE = 0x0001,
|
|
BIMSTATE_ONLINE = 0x0002,
|
|
BIMSTATE_INVISIBLE = 0x0006,
|
|
BIMSTATE_BUSY = 0x000A,
|
|
BIMSTATE_BE_RIGHT_BACK = 0x000E,
|
|
BIMSTATE_IDLE = 0x0012,
|
|
BIMSTATE_AWAY = 0x0022,
|
|
BIMSTATE_ON_THE_PHONE = 0x0032,
|
|
BIMSTATE_OUT_TO_LUNCH = 0x0042,
|
|
|
|
BIMSTATE_LOCAL_FINDING_SERVER = 0x0100,
|
|
BIMSTATE_LOCAL_CONNECTING_TO_SERVER = 0x0200,
|
|
BIMSTATE_LOCAL_SYNCHRONIZING_WITH_SERVER = 0x0300,
|
|
BIMSTATE_LOCAL_DISCONNECTING_FROM_SERVER = 0x0400,
|
|
}
|
|
BIMSTATE;
|
|
|
|
|
|
typedef enum
|
|
{
|
|
BASICIM_E_CONNECT = BASICIM_E(0x0001),
|
|
BASICIM_E_INVALID_SERVER_NAME = BASICIM_E(0x0002),
|
|
BASICIM_E_INVALID_PASSWORD = BASICIM_E(0x0003),
|
|
BASICIM_E_ALREADY_LOGGED_ON = BASICIM_E(0x0004),
|
|
BASICIM_E_SERVER_VERSION = BASICIM_E(0x0005),
|
|
BASICIM_E_LOGON_TIMEOUT = BASICIM_E(0x0006),
|
|
BASICIM_E_LIST_FULL = BASICIM_E(0x0007),
|
|
BASICIM_E_AI_REJECT = BASICIM_E(0x0008),
|
|
BASICIM_E_AI_REJECT_NOT_INST = BASICIM_E(0x0009),
|
|
BASICIM_E_USER_NOT_FOUND = BASICIM_E(0x000A),
|
|
BASICIM_E_ALREADY_IN_LIST = BASICIM_E(0x000B),
|
|
BASICIM_E_DISCONNECTED = BASICIM_E(0x000C),
|
|
BASICIM_E_UNEXPECTED = BASICIM_E(0x000D),
|
|
BASICIM_E_SERVER_TOO_BUSY = BASICIM_E(0x000E),
|
|
BASICIM_E_INVALID_AUTH_PACKAGES = BASICIM_E(0x000F),
|
|
BASICIM_E_NEWER_CLIENT_AVAILABLE = BASICIM_E(0x0010),
|
|
BASICIM_E_AI_TIMEOUT = BASICIM_E(0x0011),
|
|
BASICIM_E_CANCEL = BASICIM_E(0x0012),
|
|
BASICIM_E_TOO_MANY_MATCHES = BASICIM_E(0x0013),
|
|
BASICIM_E_SERVER_UNAVAILABLE = BASICIM_E(0x0014),
|
|
BASICIM_E_LOGON_UI_ACTIVE = BASICIM_E(0x0015),
|
|
BASICIM_E_OPTION_UI_ACTIVE = BASICIM_E(0x0016),
|
|
BASICIM_E_CONTACT_UI_ACTIVE = BASICIM_E(0x0017),
|
|
|
|
BASICIM_S_ASYNCRESULT = BASICIM_S(0x0000),
|
|
|
|
BASICIM_E_FAIL = E_FAIL,
|
|
BASICIM_S_OK = S_OK,
|
|
}
|
|
BASICIM_Constants;
|
|
|
|
typedef enum
|
|
{
|
|
BIMUSERPROP_INVALID_PROPERTY = -1,
|
|
BIMUSERPROP_HOME_PHONE_NUMBER = 0,
|
|
BIMUSERPROP_WORK_PHONE_NUMBER = 1,
|
|
BIMUSERPROP_MOBILE_PHONE_NUMBER = 2,
|
|
BIMUSERPROP_NUMBER_OF_PROPERTIES,
|
|
}
|
|
BIMUSERPROPERTY;
|
|
|
|
//--------------------------------------------------------------------------
|
|
// IBasicIM Interface
|
|
[
|
|
uuid(59EC0340-7506-11d2-B05F-00C04F7F89FE), // IID_IBasicIMOld
|
|
helpstring("Messenger Basic IM Object Interface - old version"),
|
|
hidden,
|
|
oleautomation
|
|
]
|
|
interface IBasicIMOld : IUnknown
|
|
{
|
|
[id(100), helpstring("Creates a Basic IM user object.")]
|
|
HRESULT CreateUser([in] BSTR bstrLogonName,
|
|
[out, retval] IBasicIMUser** ppBIMUser);
|
|
|
|
[id(105), helpstring("Initiates a logoff.")]
|
|
HRESULT Logoff();
|
|
|
|
[propget, helpstring("Returns the Contact list.")]
|
|
HRESULT ContactList([out, retval] IBasicIMUsers** ppBIMUsers);
|
|
|
|
[propget, helpstring("Logon name.")]
|
|
HRESULT LocalLogonName([out, retval] BSTR* pbstrName);
|
|
|
|
[propput, helpstring("Local state.")]
|
|
HRESULT LocalState([in] BIMSTATE bimState);
|
|
|
|
[propget]
|
|
HRESULT LocalState([out, retval] BIMSTATE* pbimState);
|
|
|
|
[id(222), helpstring("Initiates a Logon without UI if connected to the network and user saved the password.")]
|
|
HRESULT AutoLogon();
|
|
|
|
[id(200), helpstring("Initiates Logon dialog.")]
|
|
HRESULT LaunchLogonUI();
|
|
|
|
[id(201), helpstring("Initiates Options dialog.")]
|
|
HRESULT LaunchOptionsUI();
|
|
|
|
[id(202), helpstring("Initiates Add Contact dialog.")]
|
|
HRESULT LaunchAddContactUI([in] BSTR bstrEMail);
|
|
|
|
[id(210), helpstring("Initiates IM Window.")]
|
|
HRESULT LaunchIMUI([in] VARIANT vUser);
|
|
|
|
[id(501), helpstring("Establishes a connection between the IBasicIM object and the client's sink")]
|
|
HRESULT AdviseOE([in] IUnknown *pUnk, //Pointer to the client's DMsgrObjectOEEvents sink
|
|
[out, retval] long *plCookie); //Pointer to the connection point identifier used
|
|
// by Unadvise
|
|
[id(502), helpstring("Terminates a connection between the IBasicIM object and the client's sink")]
|
|
HRESULT UnadviseOE([in] long lCookie); //Connection token
|
|
}
|
|
|
|
//--------------------------------------------------------------------------
|
|
// IBasicIM Interface
|
|
[
|
|
uuid(936B70F8-75A1-455d-8F37-E211302D3B69), // IID_IBasicIM
|
|
helpstring("Messenger Basic IM Object Interface"),
|
|
hidden,
|
|
oleautomation
|
|
]
|
|
interface IBasicIM : IBasicIMOld
|
|
{
|
|
[id(503), helpstring("Initiates the messenger phone dialer UI.")]
|
|
HRESULT LaunchPhoneUI([in] BSTR bstrNumber);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------
|
|
// DBasicIMEvents Interface
|
|
[
|
|
uuid(59EC0341-7506-11d2-B05F-00C04F7F89FE), // DIID_DBasicIMEvents
|
|
helpstring("Messenger Events for OE Private Interface"),
|
|
hidden
|
|
]
|
|
dispinterface DBasicIMEvents
|
|
{
|
|
properties:
|
|
methods:
|
|
[id(DISPID_ONLOGONRESULT), helpstring("Logon attempt complete.")]
|
|
void OnLogonResult([in] long hr);
|
|
|
|
[id(DISPID_ONLOGOFF), helpstring("Logoff complete.")]
|
|
void OnLogoff();
|
|
|
|
[id(DISPID_ONLISTADDRESULT), helpstring("Result from list add request.")]
|
|
void OnContactListAddResult([in] long hr,
|
|
[in] IBasicIMUser* pBIMUser);
|
|
|
|
[id(DISPID_ONLISTREMOVERESULT), helpstring("Result from list remove request.")]
|
|
void OnContactListRemoveResult([in] long hr,
|
|
[in] IBasicIMUser* pBIMUser);
|
|
|
|
[id(DISPID_ONUSERFRIENDLYNAMECHANGERESULT), helpstring("Result from name change request.")]
|
|
void OnUserFriendlyNameChangeResult([in] long hr,
|
|
[in] IBasicIMUser* pBIMUser,
|
|
[in] BSTR bstrPrevFriendlyName);
|
|
|
|
[id(DISPID_ONUSERSTATECHANGED), helpstring("User state changed.")]
|
|
void OnUserStateChanged([in] IBasicIMUser* pBIMUser,
|
|
[in] BIMSTATE mPrevStateOE);
|
|
|
|
[id(DISPID_ONLOCALSTATECHANGERESULT), helpstring("Result from local state request.")]
|
|
void OnLocalStateChangeResult([in] long hr,
|
|
[in] BIMSTATE mLocalStateOE);
|
|
|
|
[id(DISPID_ONAPPSHUTDOWN), helpstring("Messenger is shutting down."), helpcontext(0x0000)]
|
|
void OnAppShutdown();
|
|
}
|
|
|
|
//--------------------------------------------------------------------------
|
|
// IBasicIMUser Interface
|
|
[
|
|
uuid(59EC0342-7506-11d2-B05F-00C04F7F89FE), // IID_IBasicIMUser
|
|
helpstring("Messenger User for OE Private Interface"),
|
|
hidden,
|
|
oleautomation
|
|
]
|
|
interface IBasicIMUser : IUnknown
|
|
{
|
|
[propget]
|
|
HRESULT FriendlyName([out, retval] BSTR* pbstrFriendlyName);
|
|
|
|
[propget, helpstring("State of the user.")]
|
|
HRESULT State([out, retval] BIMSTATE* pbimState);
|
|
|
|
[propget, helpstring("Logon Name of the user.")]
|
|
HRESULT LogonName([out, retval] BSTR* pbstrLogonName);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------
|
|
// IBasicIMUser2 Interface
|
|
[
|
|
uuid(306C16F6-ECB9-4d60-9E48-84A01A25604F), // IID_IBasicIMUser2
|
|
helpstring("Messenger User for IBasicIM Interface"),
|
|
hidden,
|
|
oleautomation
|
|
]
|
|
interface IBasicIMUser2 : IBasicIMUser
|
|
{
|
|
[propget]
|
|
HRESULT Property(
|
|
[in] BIMUSERPROPERTY ePropType,
|
|
[out, retval] VARIANT *pvPropVal);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------
|
|
// IBasicIMUsers Interface
|
|
[
|
|
uuid(59EC0343-7506-11d2-B05F-00C04F7F89FE), // IID_IBasicIMUsers
|
|
helpstring("Messenger Users Collection for IBasicIM"),
|
|
hidden,
|
|
oleautomation
|
|
]
|
|
interface IBasicIMUsers : IUnknown
|
|
{
|
|
[propget, helpstring("Number of users.")]
|
|
HRESULT Count([out, retval] long* pcUsers);
|
|
|
|
[id(DISPID_VALUE), helpstring("Retrieves a specific user by index.")]
|
|
HRESULT Item([in] long Index,
|
|
[out, retval] IBasicIMUser** ppBIMUser);
|
|
|
|
[id(100), helpstring("Adds a user object to the collection.")]
|
|
HRESULT Add([in] IBasicIMUser* pBIMUser);
|
|
|
|
[id(101), helpstring("Removes a user object from the collection.")]
|
|
HRESULT Remove([in] IBasicIMUser* pBIMUser);
|
|
|
|
[propget, restricted, id(DISPID_NEWENUM), helpstring("Enumerates the users.")]
|
|
HRESULT _NewEnum([out, retval] IUnknown **ppUnknown);
|
|
}
|
|
//--------------------------------------------------------------------------
|
|
// Messenger BasicIM object class definition
|
|
[
|
|
uuid(E0B8F398-BB08-4298-87F0-34502693902E), // CLSID_BasicIMObject
|
|
helpstring("Messenger Basic IM Object")
|
|
]
|
|
coclass BasicIMObject
|
|
{
|
|
[default] interface IBasicIM;
|
|
[source] dispinterface DBasicIMEvents;
|
|
};
|
|
};
|