diff -r 000000000000 -r 4e1aa6a622a0 mediator/inc/Common/MediatorCommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mediator/inc/Common/MediatorCommon.h Tue Feb 02 00:53:00 2010 +0200 @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Common constant definitions for client-server functionality +* +*/ + + +#ifndef MEDIATORCOMMON_H +#define MEDIATORCOMMON_H + +#include +#include "MediatorServiceDefs.h" + +_LIT(KMediatorServerProcessName, "MediatorServer"); +_LIT(KMediatorServerName,"!MediatorServer"); // name of a protected server begins with exclamation mark +_LIT(KMediatorServerExe,"MEDIATORSERVER.EXE"); + +const TUint KMediatorServerMajor=1; +const TUint KMediatorServerMinor=0; +const TUint KMediatorServerBuild=0; + +enum TMediatorServerOpCodes + { + ERegisterEventList = 0, + ERegisterCommandList = 1, + EUnregisterEventList = 2, + EUnregisterCommandList = 3, + ERaiseEvent = 4, + // From this point up need SWEvent capability (0-4) + ESubscribeEventList = 5, + EUnsubscribeEventList = 6, + EIssueCommand = 7, + ECancelCommand = 8, + EIssueResponse = 9, + EWaitForEvent = 10, + EWaitForCommand = 11, + EWaitForCommandResponse = 12, + EWaitForNotifications = 13, + ECancelNotifications = 14, + EGetDomains = 15, + EGetCategories = 16, + EGetEvents = 17, + EGetCommands = 18, + EFetchParameterData = 19, + ECancelAll = 20, + EFetchNotificationEventList = 21, + EFetchNotificationCommandList = 22 + }; + +_LIT(KMediatorServerPanic, "MediatorServerPanic"); + +/// Panic enums +enum TMediatorClientPanics + { + EMediatorClientNoSessionActive, + EMediatorClientBadRequest + }; + +/// Panic enums +enum TMediatorServerPanics + { + EMediatorServerNoEventHandler, + EMediatorServerNoCommandHandler, + EMediatorServerNoObjectHandler, + EMediatorServerNoPluginHandler, + EMediatorServerIllegalParameter + }; + +// enum for command/event notification message +enum TMediatorNotificationType + { + EMediatorEventsRegistered, + EMediatorCommandsRegistered, + EMediatorEventsUnregistered, + EMediatorCommandsUnregistered, + EMediatorCategoryUnregistered + }; + +// structure for item type +enum TItemType + { + EItemEvent, + EItemCommand + }; + +// command status enumeration +enum TCommandStatus + { + ECommandPending, // command is waiting for completion + ECommandCanceled // command has been cancelled + }; + +// Structure for commands +class TMediatorCategory + { +public: + TUid iDomain; + TUid iCategory; + }; + +// Package buffers for client-server -communication +typedef TPckgBuf TMediatorCategoryBuffer; +typedef TPckgBuf TDomainListBuffer; +typedef TPckgBuf TEventListBuffer; +typedef TPckgBuf TCommandListBuffer; +typedef TPckgBuf TEventBuffer; +typedef TPckgBuf TCommandBuffer; + +// Return data buffers +typedef TPckg TDomainListRetBuffer; +typedef TPckg TCategoryListRetBuffer; +typedef TPckg TEventListRetBuffer; +typedef TPckg TCommandListRetBuffer; +typedef TPckg TMediatorCategoryRetBuffer; +typedef TPckg TEventRetBuffer; +typedef TPckg TCommandRetBuffer; +typedef TPckg TNotificationTypeRetBuffer; + +// For Client/Server message sizes +const TInt KMediatorMaxDomainCount = 50; +const TInt KMediatorMaxCategoryCount = 50; +const TInt KMediatorMaxCommandCount = 500; +const TInt KMediatorMaxEventCount = 500; + +// For data buffers +const TInt KMaxEventData = 64; +const TInt KMaxCommandData = 64; + + +#endif // MEDIATORCOMMON_H + +// End of File