|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 #if defined (_MSC_VER) && (_MSC_VER >= 1000) |
|
18 #pragma once |
|
19 #endif |
|
20 #ifndef _INC_RESOLVER_3A1D097B0305_INCLUDED |
|
21 #define _INC_RESOLVER_3A1D097B0305_INCLUDED |
|
22 |
|
23 #include <ecom/resolver.h> |
|
24 #include "RegistryData.h" |
|
25 |
|
26 class TEComResolverParams; |
|
27 |
|
28 /** |
|
29 @internalComponent |
|
30 @since 7.0 |
|
31 Controls the identification, (resolution), of which implementation |
|
32 will be used to satisfy an interface implementation instantiation. |
|
33 */ |
|
34 |
|
35 class CDefaultResolver : public CResolver |
|
36 { |
|
37 public: |
|
38 /** |
|
39 @fn NewL(CRegistryData& aRegistry) |
|
40 Intended Usage : Standardized safe construction which leaves nothing |
|
41 on the cleanup stack. |
|
42 Error Condition : Cannot fully construct because of memory limitations. |
|
43 @leave KErrNoMemory |
|
44 @since 7.0 |
|
45 @return A pointer to the new class |
|
46 @post CDefaultResolver is fully constructed, |
|
47 and initialized. |
|
48 */ |
|
49 |
|
50 static CDefaultResolver* NewL(MPublicRegistry& aRegistry); |
|
51 |
|
52 /** |
|
53 @fn ~CDefaultResolver() |
|
54 Intended Usage : Standard default d'tor |
|
55 Error Condition : None |
|
56 @since 7.0 |
|
57 */ |
|
58 |
|
59 ~CDefaultResolver(); |
|
60 |
|
61 /** |
|
62 @fn IdentifyImplementationL(TUid aInterfaceUid, |
|
63 const TEComResolverParams& aAdditionalParameters) const |
|
64 Intended Usage : Request that the resolver identify the most appropriate |
|
65 interface implementation. |
|
66 Error Condition : |
|
67 @since 7.0 |
|
68 @param aInterfaceUid The interface for which implementations are requested |
|
69 @param aAdditionalParameters Data to be used to refine the search further |
|
70 @return The Uid of the best fit interface implementation - KNullUid if no match is found |
|
71 @pre Object is fully constructed and initialized |
|
72 @post Registry contents are not modified but registry keys may be updated |
|
73 */ |
|
74 |
|
75 TUid IdentifyImplementationL(TUid aInterfaceUid, const TEComResolverParams& aAdditionalParameters)const ; |
|
76 |
|
77 /** |
|
78 @fn ListAllL(TUid aInterfaceUid, const TEComResolverParams& aAdditionalParameters) const |
|
79 Intended Usage : List all the implementations which satisfy the specified interface. |
|
80 Error Condition : |
|
81 @since 7.0 |
|
82 @param aInterfaceUid The interface for which implementations are requested |
|
83 @param aAdditionalParameters Data to be used to refine the search further |
|
84 @return Pointer to an array of suitable implementations. Ownership of this array |
|
85 is passed to the calling function. |
|
86 @pre Object is fully constructed and initialized |
|
87 @post Registry contents are not modified but registry keys may be updated |
|
88 */ |
|
89 |
|
90 RImplInfoArray* ListAllL(TUid aInterfaceUid, |
|
91 const TEComResolverParams& aAdditionalParameters)const; |
|
92 |
|
93 protected: |
|
94 /** |
|
95 @internalComponent |
|
96 @fn CDefaultResolver(CRegistryData& aRegistry) |
|
97 Intended Usage : Standardized default c'tor |
|
98 Error Condition : None |
|
99 @since 7.0 |
|
100 @post CDefaultResolver is fully constructed |
|
101 */ |
|
102 |
|
103 explicit CDefaultResolver(MPublicRegistry& aRegistry); |
|
104 |
|
105 /** |
|
106 @fn Resolve(const RImplInfoArray& aImplementationsInfo, |
|
107 const TEComResolverParams& aAdditionalParameters) const |
|
108 Intended Usage : Called by IdentifyImplementationL to select an appropriate |
|
109 implementation from a list of possibles |
|
110 @since 7.0 |
|
111 @param aImplementationsInfo Information on the potential implementations |
|
112 @param aAdditionalParameters The data to match against to detemine the |
|
113 implementation |
|
114 @return The Uid of the selected implementation - KNullUid if no match is found |
|
115 @pre This object is fully constructed |
|
116 */ |
|
117 |
|
118 TUid Resolve(const RImplInfoArray& aImplementationsInfo, |
|
119 const TEComResolverParams& aAdditionalParameters) const; |
|
120 |
|
121 private: |
|
122 /** |
|
123 @fn Match(const TDesC8& aImplementationType, |
|
124 const TDesC8& aMatchType, |
|
125 TBool aUseWildcards) const |
|
126 Intended Usage : Searches for a match of a data type on an implementation type. |
|
127 Match returns ETrue if aMatchType is found within aImplementationType according to |
|
128 the following rules: |
|
129 1) aImplementationType is treated as a series of descriptors separated by double |
|
130 bars (||). ETrue is returned if aMatchType matches exactly any of the short |
|
131 descriptors. If no double bar is present then aImplementationType is treated as a |
|
132 single descriptor. |
|
133 2) If aUseWildcards == ETrue then a '?' in aMatchType will be matched to any single |
|
134 character and '*' will be matched to any series of characters. |
|
135 @leave KErrNoMemory |
|
136 @since 7.0 |
|
137 @param aImplementationType The implementation data type to search for a match |
|
138 @param aMatchType The data to search for |
|
139 @param aUseWildcards ETrue if wildcard matching should be allowed |
|
140 @return ETrue if a match was found, EFalse otherwise |
|
141 @pre This object is fully constructed |
|
142 */ |
|
143 |
|
144 TBool Match(const TDesC8& aImplementationType, |
|
145 const TDesC8& aMatchType, |
|
146 TBool aUseWildcards) const; |
|
147 |
|
148 protected: |
|
149 |
|
150 |
|
151 |
|
152 /** Required for test code to have access to internal state */ |
|
153 friend class TDefaultResolver_StateAccessor; |
|
154 }; |
|
155 |
|
156 #endif /* _INC_RESOLVER_3A1D097B0305_INCLUDED */ |
|
157 |