|
1 /* |
|
2 * Copyright (c) 2002 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 the License "Symbian Foundation License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Testing functions present in "notepad_library_api" |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef TESTNPDAPI_H |
|
21 #define TESTNPDAPI_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <StifLogger.h> |
|
25 #include <TestScripterInternal.h> |
|
26 #include <StifTestModule.h> |
|
27 #include <NpdApi.h> |
|
28 #include <NpdLib.rsg> |
|
29 #include <flogger.h> |
|
30 |
|
31 // CONSTANTS |
|
32 //const ?type ?constant_var = ?constant; |
|
33 |
|
34 // MACROS |
|
35 //#define ?macro ?macro_def |
|
36 #define TEST_CLASS_VERSION_MAJOR 0 |
|
37 #define TEST_CLASS_VERSION_MINOR 0 |
|
38 #define TEST_CLASS_VERSION_BUILD 0 |
|
39 |
|
40 // Logging path |
|
41 _LIT( KTestNpdApiLogPath, "\\logs\\testframework\\TestNpdApi\\" ); |
|
42 // Log file |
|
43 _LIT( KTestNpdApiLogFile, "TestNpdApi.txt" ); |
|
44 _LIT( KTestNpdApiLogFileWithTitle, "TestNpdApi_[%S].txt" ); |
|
45 |
|
46 _LIT( KExampleFilePath, "c:\\testing\\data\\TestNpdApi.txt" ); |
|
47 _LIT( KCcpFilePath, "c:\\data\\TestNpdApi.txt"); |
|
48 |
|
49 // FUNCTION PROTOTYPES |
|
50 //?type ?function_name(?arg_list); |
|
51 |
|
52 // FORWARD DECLARATIONS |
|
53 //class ?FORWARD_CLASSNAME; |
|
54 class CTestNpdApi; |
|
55 |
|
56 // DATA TYPES |
|
57 //enum ?declaration |
|
58 //typedef ?declaration |
|
59 //extern ?data_type; |
|
60 |
|
61 // CLASS DECLARATION |
|
62 |
|
63 /** |
|
64 * CTestNpdApi test class for STIF Test Framework TestScripter. |
|
65 * ?other_description_lines |
|
66 * |
|
67 * @lib ?library |
|
68 * @since ?Series60_version |
|
69 */ |
|
70 NONSHARABLE_CLASS(CTestNpdApi) : public CScriptBase |
|
71 { |
|
72 public: // Constructors and destructor |
|
73 |
|
74 /** |
|
75 * Two-phased constructor. |
|
76 */ |
|
77 static CTestNpdApi* NewL( CTestModuleIf& aTestModuleIf ); |
|
78 |
|
79 /** |
|
80 * Destructor. |
|
81 */ |
|
82 virtual ~CTestNpdApi(); |
|
83 |
|
84 public: // New functions |
|
85 |
|
86 /** |
|
87 * ?member_description. |
|
88 * @since ?Series60_version |
|
89 * @param ?arg1 ?description |
|
90 * @return ?description |
|
91 */ |
|
92 //?type ?member_function( ?type ?arg1 ); |
|
93 |
|
94 public: // Functions from base classes |
|
95 |
|
96 /** |
|
97 * From CScriptBase Runs a script line. |
|
98 * @since ?Series60_version |
|
99 * @param aItem Script line containing method name and parameters |
|
100 * @return Symbian OS error code |
|
101 */ |
|
102 virtual TInt RunMethodL( CStifItemParser& aItem ); |
|
103 |
|
104 protected: // New functions |
|
105 |
|
106 /** |
|
107 * ?member_description. |
|
108 * @since ?Series60_version |
|
109 * @param ?arg1 ?description |
|
110 * @return ?description |
|
111 */ |
|
112 //?type ?member_function( ?type ?arg1 ); |
|
113 |
|
114 protected: // Functions from base classes |
|
115 |
|
116 /** |
|
117 * From ?base_class ?member_description |
|
118 */ |
|
119 //?type ?member_function(); |
|
120 |
|
121 private: |
|
122 |
|
123 /** |
|
124 * C++ default constructor. |
|
125 */ |
|
126 CTestNpdApi( CTestModuleIf& aTestModuleIf ); |
|
127 |
|
128 /** |
|
129 * By default Symbian 2nd phase constructor is private. |
|
130 */ |
|
131 void ConstructL(); |
|
132 |
|
133 // Prohibit copy constructor if not deriving from CBase. |
|
134 // ?classname( const ?classname& ); |
|
135 // Prohibit assigment operator if not deriving from CBase. |
|
136 // ?classname& operator=( const ?classname& ); |
|
137 |
|
138 /** |
|
139 * Frees all resources allocated from test methods. |
|
140 * @since ?Series60_version |
|
141 */ |
|
142 void Delete(); |
|
143 |
|
144 /** |
|
145 * Test methods are listed below, explanation is given in cpp file. |
|
146 */ |
|
147 virtual TInt FetchTemplate( CStifItemParser& aItem ); |
|
148 virtual TInt FetchMemo( CStifItemParser& aItem ); |
|
149 virtual TInt NoOfTemplates( CStifItemParser& aItem ); |
|
150 virtual TInt SaveFileAsMemoUsingFileName( CStifItemParser& aItem ); |
|
151 virtual TInt SaveFileAsMemoUsingHandle( CStifItemParser& aItem ); |
|
152 virtual TInt AddContent( CStifItemParser& aItem ); |
|
153 virtual TInt Model( CStifItemParser& aItem ); |
|
154 virtual TInt Dialog( CStifItemParser& aItem ); |
|
155 virtual TInt ExistsMemoL( CStifItemParser& aItem ); |
|
156 virtual TInt NumberOfTemplates( CStifItemParser& aItem ); |
|
157 virtual TInt CreateModelL( CStifItemParser& aItem ); |
|
158 virtual TInt NewL( CStifItemParser& aItem ); |
|
159 virtual TInt ProbeMemoL( CStifItemParser& aItem ); |
|
160 virtual TInt CTestNpdApi::NewLC( CStifItemParser& aItem ); |
|
161 virtual TInt CTestNpdApi::CNotepadApiDestruction(CStifItemParser& aItem); |
|
162 virtual TInt CTestNpdApi::CreateListDialogL(CStifItemParser& aItem); |
|
163 virtual TInt CTestNpdApi::CreateViewerDialogL(CStifItemParser& aItem); |
|
164 virtual TInt CTestNpdApi::ExecTemplatesL( CStifItemParser& aItem ); |
|
165 |
|
166 virtual TInt CTestNpdApi::CreateViewer(CStifItemParser& aItem); |
|
167 virtual TInt CTestNpdApi::ExecFileViewerUsingFilename( CStifItemParser& aItem ); |
|
168 virtual TInt CTestNpdApi::ExecFileViewerUsingHandle( CStifItemParser& aItem ); |
|
169 virtual TInt CTestNpdApi::ExecTextViewerL(CStifItemParser& aItem ); |
|
170 virtual TInt CTestNpdApi::ExecTextEditorL (CStifItemParser& aItem ); |
|
171 virtual TInt CTestNpdApi::ExecReadOnlyTextViewerL(CStifItemParser& aItem ); |
|
172 /** |
|
173 * Method used to log version of test class |
|
174 */ |
|
175 void SendTestClassVersion(); |
|
176 |
|
177 //ADD NEW METHOD DEC HERE |
|
178 //[TestMethods] - Do not remove |
|
179 |
|
180 public: // Data |
|
181 // ?one_line_short_description_of_data |
|
182 //?data_declaration; |
|
183 |
|
184 protected: // Data |
|
185 // ?one_line_short_description_of_data |
|
186 //?data_declaration; |
|
187 |
|
188 private: // Data |
|
189 |
|
190 // ?one_line_short_description_of_data |
|
191 //?data_declaration; |
|
192 CNotepadApi *iptrToNpd; |
|
193 |
|
194 // Reserved pointer for future extension |
|
195 //TAny* iReserved; |
|
196 |
|
197 public: // Friend classes |
|
198 //?friend_class_declaration; |
|
199 protected: // Friend classes |
|
200 //?friend_class_declaration; |
|
201 private: // Friend classes |
|
202 //?friend_class_declaration; |
|
203 |
|
204 }; |
|
205 |
|
206 #endif // TESTNPDAPI_H |
|
207 |
|
208 // End of File |