|
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 upon the CSmsSchemeHandler |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @SYMCreationDate Created : 01/06/01 14:07:23 |
|
21 */ |
|
22 |
|
23 #ifndef __SMSSCHEMEHANDLERSTATEACCESSOR_H__ |
|
24 #define __SMSSCHEMEHANDLERSTATEACCESSOR_H__ |
|
25 |
|
26 #include <e32base.h> |
|
27 #include <f32file.h> |
|
28 #include <s32stor.h> |
|
29 #include <s32file.h> |
|
30 |
|
31 #include <ecom/test_bed/testutilities.h> |
|
32 #include <ecom/test_bed/testbeddefinitions.h> |
|
33 #include <ecom/test_bed/stateaccessor.h> |
|
34 #include "SMSSCH.H" |
|
35 |
|
36 // ______________________________________________________________________________ |
|
37 // |
|
38 /** |
|
39 @internalTechnology |
|
40 @class |
|
41 Comments : State accessor for the CSmsSchemeHandler object under test. |
|
42 */ |
|
43 class TSmsSchemeHandler_StateAccessor : public MStateAccessor |
|
44 { |
|
45 public: |
|
46 /** |
|
47 @fn InvariantTest(TAny* aTestObject) |
|
48 Intended Usage : |
|
49 @since 6.0 |
|
50 @param TAny* A pointer to the object under test. |
|
51 @return TInt KErrNone if the invariants were valid, error code otherwise. |
|
52 @pre TSmsSchemeHandler_StateAccessor is fully constructed. |
|
53 @post The class under test is set to the state specified. |
|
54 */ |
|
55 inline TInt InvariantTest(TAny* aTestObject); |
|
56 |
|
57 /** |
|
58 @fn Internalize(TAny* aTestObject) |
|
59 Intended Usage : Implemented by the developer to set the state of the object under test. |
|
60 @since 6.0 |
|
61 @param aTestObject The object to be tested |
|
62 @return KErrNone if the internalize was successful. |
|
63 @return One of the EPOC standard error codes indicating the reason |
|
64 for the failure to load the object state. |
|
65 @pre TSmsSchemeHandler_StateAccessor is fully constructed, and |
|
66 valid test object must be passed in. |
|
67 @post The class under test is set to the state specified |
|
68 */ |
|
69 inline virtual TInt Internalize(TAny* aTestObject); |
|
70 |
|
71 /** |
|
72 @fn Externalize(TAny* aTestObject) |
|
73 Intended Usage : Implemented by the developer to persist the state of the object under test. |
|
74 @since 6.0 |
|
75 @param aTestObject The object to be tested |
|
76 @return KErrNone if the internalize was successful. |
|
77 @return One of the EPOC standard error codes indicating the reason |
|
78 for the failure to externalize the object. |
|
79 @pre TSmsSchemeHandler_StateAccessor is fully constructed, and |
|
80 valid test object must be passed in. |
|
81 @post Returns an error code dependant on the result of the test |
|
82 */ |
|
83 inline virtual TInt Externalize(TAny* aTestObject); |
|
84 |
|
85 /** |
|
86 @fn InternalizeL(RFileReadStream& aStream, CSmsSchemeHandler* aSmsSchemeHandler) |
|
87 Intended Usage : Implemented by the developer to set the state of the object under test. |
|
88 Error Condition : Leaves with an error code. |
|
89 @since 6.0 |
|
90 @param aStream The filestream to read from . |
|
91 @param aSmsSchemeHandler A pointer to the CSmsSchemeHandler object under test. |
|
92 @return None. |
|
93 @pre TSmsSchemeHandler_StateAccessor is fully constructed. |
|
94 @post The class under test is set to the state specified. |
|
95 */ |
|
96 inline void InternalizeL(RFileReadStream& aStream, CSmsSchemeHandler* aSmsSchemeHandler); |
|
97 |
|
98 /** |
|
99 @fn ExternalizeL(RFileWriteStream& aStream, CSmsSchemeHandler* aSmsSchemeHandler) |
|
100 Intended Usage : Implemented by the developer to persist the state of the object under test. |
|
101 Error Condition : Leaves with an error code. |
|
102 @since 6.0 |
|
103 @param aStream The filestream to persist into. |
|
104 @param aSmsSchemeHandler A pointer to the CSmsSchemeHandler object under test. |
|
105 @return None. |
|
106 @pre TSmsSchemeHandler_StateAccessor is fully constructed. |
|
107 @post No change to the class under test, its internal state. |
|
108 is persisted. |
|
109 */ |
|
110 inline void ExternalizeL(RFileWriteStream& aStream, CSmsSchemeHandler* aSmsSchemeHandler); |
|
111 |
|
112 inline void ParseUrlL(CSmsSchemeHandler& aSms, const TDesC& aUrl); |
|
113 |
|
114 inline RArray<SSmsNumber>& GetSmsArray(CSmsSchemeHandler& aSms); |
|
115 |
|
116 private: |
|
117 /** |
|
118 @fn InternalizeL(CSmsSchemeHandler* aSmsSchemeHandler) |
|
119 Intended Usage : Implemented by the developer to set the state of the object under test. |
|
120 Error Condition : Leaves with an error code. |
|
121 @since 6.0 |
|
122 @param TAny* A pointer to the object under test. |
|
123 @return None. |
|
124 @pre TSmsSchemeHandler_StateAccessor is fully constructed. |
|
125 @post The class under test is set to the state specified. |
|
126 */ |
|
127 inline void InternalizeL(CSmsSchemeHandler* aSmsSchemeHandler); |
|
128 |
|
129 /** |
|
130 @fn ExternalizeL(CSmsSchemeHandler* aSmsSchemeHandler) |
|
131 Intended Usage : Implemented by the developer to persist the state of the object under test. |
|
132 Error Condition : Leaves with an error code. |
|
133 @since 6.0 |
|
134 @param TAny* A pointer to the object under test. |
|
135 @return None. |
|
136 @pre TSmsSchemeHandler_StateAccessor is fully constructed. |
|
137 @post No change to the class under test, its internal state. |
|
138 is persisted. |
|
139 */ |
|
140 inline void ExternalizeL(CSmsSchemeHandler* aSmsSchemeHandler); |
|
141 }; // TSmsSchemeHandler_StateAccessor |
|
142 |
|
143 #include "SmsSchemeHandlerStateAccessor.inl" |
|
144 |
|
145 #endif // __SMSSCHEMEHANDLERSTATEACCESSOR_H__ |
|
146 |