uiservicetab/inc/mcommandmapper.h
branchRCL_3
changeset 29 9a48e301e94b
parent 0 5e5d6b214f4f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiservicetab/inc/mcommandmapper.h	Wed Sep 01 12:33:36 2010 +0100
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2008 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:  mcommandmapper.h
+ *
+*/
+
+#ifndef __MCOMMANDMAPPER_H__
+#define __MCOMMANDMAPPER_H__
+
+
+// INCLUDES
+#include <e32base.h>
+
+// CLASS DECLARATION
+
+
+/**
+ *  Abstract interface for getting mapped command IDs. Command ID mapping
+ *  means that xSP's own "Names List" command IDs ( constants that are usually 
+ *  defined in a *.hrh file ) are substituted with IDs provided by Extension
+ *  Manager. This is needed because there may be extensions using same 
+ *  "Names List" command IDs. After the substitution, the original IDs are 
+ *  not valid anymore. Still, in order to allow original "Names List"
+ *  command IDs usage inside the xSP's own code, MxSPCommandMapper provides the
+ *  mechanism for retrieving new IDs which correspond to the old original
+ *  ones and vice versa.
+ */
+class MCommandMapper
+    {
+    public:
+        /**
+         *  Gets old original "Service Tab" command ID which corresponds
+         *  to the given new one
+         *
+         *  @param aPluginId  implementation ID for identification
+         *  @param aNewCommand  New mapped command ID
+         *  @param aOldCommand  On return old/original command ID
+         *  @return KErrNone if mapping exist, otherwise KErrNotFound
+         */
+        virtual TInt GetOldCommand( TInt32 aPluginId, 
+                                   TInt aNewCommand,
+                                   TInt& aOldCommand ) const = 0;
+                            
+        /**
+         *  Gets new mapped "ServiceTab" command ID which corresponds
+         *  to the given old one
+         *
+         *  @param aPluginId  implementation ID for identification
+         *  @param aOldCommand Old/original command ID
+         *  @param aNewCommand On return new mapped command ID
+         *  @return KErrNone if mapping exist, otherwise KErrNotFound
+         */
+        virtual TInt GetNewCommand( TInt32 aPluginId, 
+                                    TInt aOldCommand,
+                                    TInt& aNewCommand ) const = 0;
+                                    
+    protected: // Protected interface
+
+        /**
+         * Destructor.
+         */
+        virtual ~MCommandMapper()
+                {};
+                                    
+    };
+
+
+#endif // __MCOMMANDMAPPER_H__