applicationmanagement/omascomoadapter/inc/nsmldmiapmatcher.h
changeset 0 3ce708148e4d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/applicationmanagement/omascomoadapter/inc/nsmldmiapmatcher.h	Thu Dec 17 08:40:12 2009 +0200
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2009 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:  Implementation of applicationmanagement components
+ *
+*/
+
+
+#ifndef __NSMLDMIAPMATCHER_H__
+#define __NSMLDMIAPMATCHER_H__
+
+// ------------------------------------------------------------------------------------------------
+// Includes
+// ------------------------------------------------------------------------------------------------
+#include <e32base.h>
+#include "nsmldmuri.h"
+
+//CLASS FORWARDS
+class MSmlDmCallback;
+
+_LIT8( KNSmlDMIAPUri, "AP" );
+_LIT8( KNSmlDMSeparator8, "/" );
+_LIT8( KNSmlDMIAPUriDotSlash, "./" );
+_LIT8( KNSmlDMConnMOIAPUri, "NAP" );
+
+const TUint8 KNSmlDMSlash = 0x2f; //forward slash
+/**
+* CNSmlDMIAPMatcher contains services for generating URI from IAPId and
+* vice versa in DM plug-in adapters. The class needs the working
+* MSmlDmCallback callback interface for operating, so ths can be used only
+* by DM plug-in adapters
+*
+*  @since
+*/
+class CNSmlDMIAPMatcher : public CBase
+	{
+    public:
+		/**
+		* Destructor
+		*/
+	    ~CNSmlDMIAPMatcher();
+
+		/**
+		* Two-phased constructor
+		* @param	aDmCallback			Pointer to callback interface
+		* @return						Pointer to newly created module instance
+		*/
+        static CNSmlDMIAPMatcher* NewL( MSmlDmCallback* aDmCallback);
+
+		/**
+		* Two-phased constructor, pushes pointer to cleanup stack.
+		* @param	aDmCallback			Pointer to callback interface
+		* @return						Pointer to newly created module instance
+		*/
+        static CNSmlDMIAPMatcher* NewLC( MSmlDmCallback* aDmCallback);
+
+		/**
+		* Gets the IAP id which corresponds to given URI
+		* @param	aURI				Accespoint URI
+		* @return						Accespoint id in AP database
+		*/
+        TInt IAPIdFromURIL( const TDesC8& aURI );
+
+		/**
+		* Generates the URI which corresponds to given IAP Id
+		* @param	aIAPId				Accespoint Id
+		* @return						Accesspoint URI in DM
+		*/
+        HBufC8* URIFromIAPIdL( TInt aIAPId );
+
+    private:
+		/**
+		* Second phase constructor
+		* @param	aDmCallback			Pointer to callback interface
+		*/
+        void ConstructL(MSmlDmCallback* aDmCallback);
+
+		/**
+		* Changes the given descriptor to Integer
+		* @param	aLuid				Luid in descriptor format
+		* @return						Luid in TInt type
+		*/
+        TInt DesToInt(const TDesC8& aLuid) const;
+
+		/**
+		* Return the URI without ./ at the beginning, if those exist
+		* @param	aURI		Uri
+		* @return 		 		Uri without ./
+		*/
+        TPtrC8 RemoveDotSlash(const TDesC8& aURI) const;
+
+		/**
+		* Return the last uri segment of the aURI
+		* @param	aURI		Uri
+		* @return 		 		The last uri segment
+		*/
+        TPtrC8 LastURISeg(const TDesC8& aURI) const;
+        
+    /**
+		* Return the last uri segment of the aURI
+		* @return 		 		The AccessPoint Reference
+		*/
+        const TDesC8& GetConRef() ;
+
+    private:
+    
+ 		/**
+		* Pointer to callback interface
+		*/
+		MSmlDmCallback* iCallback;
+		
+		/**
+		* Boolean to check FeatMgr Initialization
+		*/
+		TBool iFeatMgrInitialized;
+	
+	};
+
+#endif // __NSMLDMIAPMATCHER_H__