applicationmanagement/omascomoadapter/inc/nsmldmiapmatcher.h
changeset 47 d316aecb87fd
parent 0 3ce708148e4d
equal deleted inserted replaced
46:b9b00b134b0d 47:d316aecb87fd
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13  *
       
    14  * Description:  Implementation of applicationmanagement components
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __NSMLDMIAPMATCHER_H__
       
    20 #define __NSMLDMIAPMATCHER_H__
       
    21 
       
    22 // ------------------------------------------------------------------------------------------------
       
    23 // Includes
       
    24 // ------------------------------------------------------------------------------------------------
       
    25 #include <e32base.h>
       
    26 #include "nsmldmuri.h"
       
    27 
       
    28 //CLASS FORWARDS
       
    29 class MSmlDmCallback;
       
    30 
       
    31 _LIT8( KNSmlDMIAPUri, "AP" );
       
    32 _LIT8( KNSmlDMSeparator8, "/" );
       
    33 _LIT8( KNSmlDMIAPUriDotSlash, "./" );
       
    34 _LIT8( KNSmlDMConnMOIAPUri, "NAP" );
       
    35 
       
    36 const TUint8 KNSmlDMSlash = 0x2f; //forward slash
       
    37 /**
       
    38 * CNSmlDMIAPMatcher contains services for generating URI from IAPId and
       
    39 * vice versa in DM plug-in adapters. The class needs the working
       
    40 * MSmlDmCallback callback interface for operating, so ths can be used only
       
    41 * by DM plug-in adapters
       
    42 *
       
    43 *  @since
       
    44 */
       
    45 class CNSmlDMIAPMatcher : public CBase
       
    46 	{
       
    47     public:
       
    48 		/**
       
    49 		* Destructor
       
    50 		*/
       
    51 	    ~CNSmlDMIAPMatcher();
       
    52 
       
    53 		/**
       
    54 		* Two-phased constructor
       
    55 		* @param	aDmCallback			Pointer to callback interface
       
    56 		* @return						Pointer to newly created module instance
       
    57 		*/
       
    58         static CNSmlDMIAPMatcher* NewL( MSmlDmCallback* aDmCallback);
       
    59 
       
    60 		/**
       
    61 		* Two-phased constructor, pushes pointer to cleanup stack.
       
    62 		* @param	aDmCallback			Pointer to callback interface
       
    63 		* @return						Pointer to newly created module instance
       
    64 		*/
       
    65         static CNSmlDMIAPMatcher* NewLC( MSmlDmCallback* aDmCallback);
       
    66 
       
    67 		/**
       
    68 		* Gets the IAP id which corresponds to given URI
       
    69 		* @param	aURI				Accespoint URI
       
    70 		* @return						Accespoint id in AP database
       
    71 		*/
       
    72         TInt IAPIdFromURIL( const TDesC8& aURI );
       
    73 
       
    74 		/**
       
    75 		* Generates the URI which corresponds to given IAP Id
       
    76 		* @param	aIAPId				Accespoint Id
       
    77 		* @return						Accesspoint URI in DM
       
    78 		*/
       
    79         HBufC8* URIFromIAPIdL( TInt aIAPId );
       
    80 
       
    81     private:
       
    82 		/**
       
    83 		* Second phase constructor
       
    84 		* @param	aDmCallback			Pointer to callback interface
       
    85 		*/
       
    86         void ConstructL(MSmlDmCallback* aDmCallback);
       
    87 
       
    88 		/**
       
    89 		* Changes the given descriptor to Integer
       
    90 		* @param	aLuid				Luid in descriptor format
       
    91 		* @return						Luid in TInt type
       
    92 		*/
       
    93         TInt DesToInt(const TDesC8& aLuid) const;
       
    94 
       
    95 		/**
       
    96 		* Return the URI without ./ at the beginning, if those exist
       
    97 		* @param	aURI		Uri
       
    98 		* @return 		 		Uri without ./
       
    99 		*/
       
   100         TPtrC8 RemoveDotSlash(const TDesC8& aURI) const;
       
   101 
       
   102 		/**
       
   103 		* Return the last uri segment of the aURI
       
   104 		* @param	aURI		Uri
       
   105 		* @return 		 		The last uri segment
       
   106 		*/
       
   107         TPtrC8 LastURISeg(const TDesC8& aURI) const;
       
   108         
       
   109     /**
       
   110 		* Return the last uri segment of the aURI
       
   111 		* @return 		 		The AccessPoint Reference
       
   112 		*/
       
   113         const TDesC8& GetConRef() ;
       
   114 
       
   115     private:
       
   116     
       
   117  		/**
       
   118 		* Pointer to callback interface
       
   119 		*/
       
   120 		MSmlDmCallback* iCallback;
       
   121 		
       
   122 		/**
       
   123 		* Boolean to check FeatMgr Initialization
       
   124 		*/
       
   125 		TBool iFeatMgrInitialized;
       
   126 	
       
   127 	};
       
   128 
       
   129 #endif // __NSMLDMIAPMATCHER_H__