/*
  IDL struct for mapistore mgmt interface
 */

[
 pointer_default(unique)
]

interface mapistore_mgmt
{
	typedef [enum8bit] enum {
		MAPISTORE_COMMAND_NOTIF_REGISTER_PRIO		= 26,
		MAPISTORE_COMMAND_NOTIF_UNREGISTER_PRIO		= 27,
		MAPISTORE_COMMAND_NOTIF_SOCKET_REGISTER_PRIO	= 28,
		MAPISTORE_COMMAND_NOTIF_SOCKET_UNREGISTER_PRIO	= 29,
		MAPISTORE_COMMAND_USER_REGISTER_PRIO		= 30,
		MAPISTORE_COMMAND_USER_UNREGISTER_PRIO		= 31
	} mapistore_mgmt_command_priority;

	typedef [enum16bit] enum {
		MAPISTORE_MGMT_SEND		= 0x0,
		MAPISTORE_MGMT_REGISTER		= 0x1,
		MAPISTORE_MGMT_UNREGISTER	= 0x2
	} mapistore_mgmt_status;

	typedef [public] struct {
		mapistore_mgmt_status		status;
		[string, charset(UTF16)] uint16	*backend;
		[string, charset(UTF16)] uint16	*username;
		[string, charset(UTF16)] uint16	*vuser;
	} mapistore_mgmt_user_cmd;

	typedef [public] struct {
		[string, charset(UTF16)] uint16		*username;
		uint16					cbContext;
		[size_is(cbContext)] uint8		rgbContext[*];
		uint16					cbCallbackAddress;
		[size_is(cbCallbackAddress)] uint8	rgbCallbackAddress[*];
	} mapistore_mgmt_bind_cmd;

	typedef [public,bitmap16bit] bitmap {
		mgmt_notification_type_newmail		= 0x2,
		mgmt_notification_type_objectcreated	= 0x4,	
		mgmt_notification_type_objectmodified	= 0x10,
		mgmt_notification_type_Tbit		= 0x1000,
		mgmt_notification_type_Ubit		= 0x2000,
		mgmt_notification_type_Mbit		= 0x8000
	} mapistore_mgmt_notification_type;

	typedef [public] struct {
		mapistore_mgmt_status			status;
		mapistore_mgmt_notification_type	NotificationFlags;
		[string, charset(UTF16)] uint16		*username;
		boolean8				WholeStore;
		hyper					FolderID;
		hyper					MessageID;
		[string, charset(UTF16)] uint16		*MAPIStoreURI;
		uint32					TotalNumberOfMessages;
		uint32					UnreadNumberOfMessages;
		
	} mapistore_mgmt_notification_cmd;

	typedef [enum16bit] enum {
		MAPISTORE_MGMT_USER	= 0x1,
		MAPISTORE_MGMT_BIND	= 0x2,
		MAPISTORE_MGMT_NOTIF	= 0x3
	} mapistore_mgmt_command_type;

	typedef [public,switch_type(uint16)] union {
		[case(MAPISTORE_MGMT_USER)] mapistore_mgmt_user_cmd		user;
		[case(MAPISTORE_MGMT_BIND)] mapistore_mgmt_bind_cmd		bind;
		[case(MAPISTORE_MGMT_NOTIF)] mapistore_mgmt_notification_cmd	notification;
	} mapistore_mgmt_commands;

	typedef [public] struct {
		mapistore_mgmt_command_type			type;
		[switch_is(type)] mapistore_mgmt_commands	command;
	} mapistore_mgmt_command;
}