|
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 // The definition of the accessor class for the CResolver tests. |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __RESOLVERSTATEACCESSOR_H__ |
|
19 #define __RESOLVERSTATEACCESSOR_H__ |
|
20 |
|
21 #include <s32file.h> |
|
22 |
|
23 // ______________________________________________________________________________ |
|
24 // |
|
25 /** |
|
26 @internalComponent |
|
27 |
|
28 Comments : State accessor for the CDefaultResolver object under test. |
|
29 */ |
|
30 class TDefaultResolver_StateAccessor : public MStateAccessor |
|
31 { |
|
32 public: |
|
33 /** |
|
34 @fn InvariantTest(TAny* aTestObject) |
|
35 Intended Usage : Checks if CDefaultResolver has violated its invariants. |
|
36 @since 7.0 |
|
37 @param TAny* A pointer to the object under test. |
|
38 @return TInt KErrNone if the invariants were valid, error code otherwise. |
|
39 @pre TDefaultResolver_StateAccessor is fully constructed. |
|
40 @post The class under test is set to the state specified. |
|
41 */ |
|
42 inline TInt InvariantTest(TAny* aTestObject); |
|
43 |
|
44 /** |
|
45 @fn Internalize(TAny* aTestObject) |
|
46 Intended Usage : Implemented by the developer to set the state of the object under test. |
|
47 @since 7.0 |
|
48 @param aTestObject The object to be tested |
|
49 @return KErrNone if the internalize was successful. |
|
50 @return One of the EPOC standard error codes indicating the reason |
|
51 for the failure to load the object state. |
|
52 @pre TDefaultResolver_StateAccessor is fully constructed, and |
|
53 valid test object must be passed in. |
|
54 @post The class under test is set to the state specified |
|
55 */ |
|
56 inline virtual TInt Internalize(TAny* aTestObject); |
|
57 |
|
58 /** |
|
59 @fn Externalize(TAny* aTestObject) |
|
60 Intended Usage : Implemented by the developer to persist the state of the object under test. |
|
61 @since 7.0 |
|
62 @param aTestObject The object to be tested |
|
63 @return KErrNone if the internalize was successful. |
|
64 @return One of the EPOC standard error codes indicating the reason |
|
65 for the failure to externalize the object. |
|
66 @pre TDefaultResolver_StateAccessor is fully constructed, and |
|
67 valid test object must be passed in. |
|
68 @post Returns an error code dependant on the result of the test |
|
69 */ |
|
70 inline virtual TInt Externalize(TAny* aTestObject); |
|
71 |
|
72 /** |
|
73 @fn InternalizeL(RFileReadStream& aStream, CDefaultResolver* aDefaultResolver) |
|
74 Intended Usage : Implemented by the developer to set the state of the object under test. |
|
75 Error Condition : Leaves with an error code. |
|
76 @since 7.0 |
|
77 @param aStream The filestream to read from . |
|
78 @param aDefaultResolver A pointer to the CDefaultResolver object under test. |
|
79 @return None. |
|
80 @pre TDefaultResolver_StateAccessor is fully constructed. |
|
81 @post The class under test is set to the state specified. |
|
82 */ |
|
83 inline void InternalizeL(RFileReadStream& aStream, CDefaultResolver* aDefaultResolver); |
|
84 |
|
85 /** |
|
86 @fn ExternalizeL(RFileWriteStream& aStream, CDefaultResolver* aDefaultResolver) |
|
87 Intended Usage : Implemented by the developer to persist the state of the object under test. |
|
88 Error Condition : Leaves with an error code. |
|
89 @since 7.0 |
|
90 @param aStream The filestream to persist into. |
|
91 @param aDefaultResolver A pointer to the CDefaultResolver object under test. |
|
92 @return None. |
|
93 @pre TDefaultResolver_StateAccessor is fully constructed. |
|
94 @post No change to the class under test, its internal state. |
|
95 is persisted. |
|
96 */ |
|
97 inline void ExternalizeL(RFileWriteStream& aStream, CDefaultResolver* aDefaultResolver); |
|
98 |
|
99 /** |
|
100 @fn TBool CDefaultResolver::Match(const TDesC8& aImplementationType, |
|
101 const TDesC8& aMatchType, |
|
102 TBool aUseWildcards) const |
|
103 Intended Usage : |
|
104 Error Condition : |
|
105 @since 7.0 |
|
106 @param aImplementationType " " |
|
107 @param aMatchType " " |
|
108 @param aUseWildcards " " |
|
109 @return TBool ETrue if a match has been found |
|
110 @pre The object is fully constructed |
|
111 */ |
|
112 TBool Match(CDefaultResolver& aResolver, |
|
113 const TDesC8& aImplementationType, |
|
114 const TDesC8& aMatchType, |
|
115 TBool aUseWildcards) const; |
|
116 |
|
117 /** |
|
118 @fn Resolve(CDefaultResolver& aResolver, |
|
119 RImplInfoArray& aImplementationData, |
|
120 const TEComResolverParams& aAdditionalParameters) const |
|
121 Intended Usage : |
|
122 Error Condition : |
|
123 @since 7.0 |
|
124 @param aResolver " " |
|
125 @param aImplementationData " " |
|
126 @param aAdditionalParameters " " |
|
127 @return The Uid of a suitable implementation |
|
128 @pre The object is fully constructed |
|
129 */ |
|
130 TUid Resolve(CDefaultResolver& aResolver, |
|
131 RImplInfoArray& aImplementationData, |
|
132 const TEComResolverParams& aAdditionalParameters) const; |
|
133 |
|
134 private: |
|
135 /** |
|
136 @fn InternalizeL(CDefaultResolver* aDefaultResolver) |
|
137 Intended Usage : Implemented by the developer to set the state of the object under test. |
|
138 Error Condition : Leaves with an error code. |
|
139 @since 7.0 |
|
140 @param TAny* A pointer to the object under test. |
|
141 @return None. |
|
142 @pre TDefaultResolver_StateAccessor is fully constructed. |
|
143 @post The class under test is set to the state specified. |
|
144 */ |
|
145 inline void InternalizeL(CDefaultResolver* aDefaultResolver); |
|
146 |
|
147 /** |
|
148 @fn ExternalizeL(CDefaultResolver* aDefaultResolver) |
|
149 Intended Usage : Implemented by the developer to persist the state of the object under test. |
|
150 Error Condition : Leaves with an error code. |
|
151 @since 7.0 |
|
152 @param TAny* A pointer to the object under test. |
|
153 @return None. |
|
154 @pre TDefaultResolver_StateAccessor is fully constructed. |
|
155 @post No change to the class under test, its internal state. |
|
156 is persisted. |
|
157 */ |
|
158 inline void ExternalizeL(CDefaultResolver* aDefaultResolver); |
|
159 }; // TDefaultResolver_StateAccessor |
|
160 |
|
161 #include "ResolverStateAccessor.inl" |
|
162 |
|
163 #endif // __RESOLVERSTATEACCESSOR_H__ |