|
1 /* |
|
2 * Copyright (c) 2005 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: DM Tree module |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __NSMLDMIAPMATCHER_H__ |
|
20 #define __NSMLDMIAPMATCHER_H__ |
|
21 |
|
22 // ------------------------------------------------------------------------------------------------ |
|
23 // Includes |
|
24 // ------------------------------------------------------------------------------------------------ |
|
25 #include <e32base.h> |
|
26 |
|
27 //CLASS FORWARDS |
|
28 class MSmlDmCallback; |
|
29 |
|
30 _LIT8( KNSmlDMIAPUri, "AP" ); |
|
31 _LIT8( KNSmlDMSeparator8, "/" ); |
|
32 _LIT8( KNSmlDMIAPUriDotSlash, "./" ); |
|
33 _LIT8( KNSmlDMConnMOIAPUri, "NAP" ); |
|
34 |
|
35 const TUint8 KNSmlDMSlash = 0x2f; //forward slash |
|
36 /** |
|
37 * CNSmlDMIAPMatcher contains services for generating URI from IAPId and |
|
38 * vice versa in DM plug-in adapters. The class needs the working |
|
39 * MSmlDmCallback callback interface for operating, so ths can be used only |
|
40 * by DM plug-in adapters |
|
41 * |
|
42 * @since |
|
43 */ |
|
44 class CNSmlDMIAPMatcher : public CBase |
|
45 { |
|
46 public: |
|
47 /** |
|
48 * Destructor |
|
49 */ |
|
50 ~CNSmlDMIAPMatcher(); |
|
51 |
|
52 /** |
|
53 * Two-phased constructor |
|
54 * @param aDmCallback Pointer to callback interface |
|
55 * @return Pointer to newly created module instance |
|
56 */ |
|
57 IMPORT_C static CNSmlDMIAPMatcher* NewL( MSmlDmCallback* aDmCallback); |
|
58 |
|
59 /** |
|
60 * Two-phased constructor, pushes pointer to cleanup stack. |
|
61 * @param aDmCallback Pointer to callback interface |
|
62 * @return Pointer to newly created module instance |
|
63 */ |
|
64 IMPORT_C static CNSmlDMIAPMatcher* NewLC( MSmlDmCallback* aDmCallback); |
|
65 |
|
66 /** |
|
67 * Gets the IAP id which corresponds to given URI |
|
68 * @param aURI Accespoint URI |
|
69 * @return Accespoint id in AP database |
|
70 */ |
|
71 IMPORT_C TInt IAPIdFromURIL( const TDesC8& aURI ); |
|
72 |
|
73 /** |
|
74 * Generates the URI which corresponds to given IAP Id |
|
75 * @param aIAPId Accespoint Id |
|
76 * @return Accesspoint URI in DM |
|
77 */ |
|
78 IMPORT_C HBufC8* URIFromIAPIdL( TInt aIAPId ); |
|
79 |
|
80 private: |
|
81 /** |
|
82 * Second phase constructor |
|
83 * @param aDmCallback Pointer to callback interface |
|
84 */ |
|
85 void ConstructL(MSmlDmCallback* aDmCallback); |
|
86 |
|
87 /** |
|
88 * Changes the given descriptor to Integer |
|
89 * @param aLuid Luid in descriptor format |
|
90 * @return Luid in TInt type |
|
91 */ |
|
92 TInt DesToInt(const TDesC8& aLuid); |
|
93 |
|
94 /** |
|
95 * Return the URI without ./ at the beginning, if those exist |
|
96 * @param aURI Uri |
|
97 * @return Uri without ./ |
|
98 */ |
|
99 TPtrC8 RemoveDotSlash(const TDesC8& aURI) const; |
|
100 |
|
101 /** |
|
102 * Return the URI without . or / at the end or beginng, if exist |
|
103 * @param aURI Uri |
|
104 * @return Uri without . or/ at the begining or at the end |
|
105 */ |
|
106 TPtrC8 RemoveExtraChar(const TDesC8& aURI) const; |
|
107 |
|
108 |
|
109 /** |
|
110 * Return the last uri segment of the aURI |
|
111 * @param aURI Uri |
|
112 * @return The last uri segment |
|
113 */ |
|
114 TPtrC8 LastURISeg(const TDesC8& aURI) const; |
|
115 |
|
116 /** |
|
117 * Return the last uri segment of the aURI |
|
118 * @return The AccessPoint Reference |
|
119 */ |
|
120 const TDesC8& GetConRef() ; |
|
121 |
|
122 private: |
|
123 |
|
124 /** |
|
125 * Pointer to callback interface |
|
126 */ |
|
127 MSmlDmCallback* iCallback; |
|
128 |
|
129 /** |
|
130 * Boolean to check FeatMgr Initialization |
|
131 */ |
|
132 TBool iFeatMgrInitialized; |
|
133 |
|
134 }; |
|
135 |
|
136 #endif // __NSMLDMIAPMATCHER_H__ |