|
1 /* |
|
2 * Copyright (c) 2009 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: Main test class declaration for UnieditorSMSPlugin |
|
15 */ |
|
16 |
|
17 #ifndef TEST_UNIEDITORSMS_PLUGIN_H |
|
18 #define TEST_UNIEDITORSMS_PLUGIN_H |
|
19 |
|
20 #ifdef BUILD_TESTUNIEDITORSMSPLUGIN_DLL |
|
21 #define TEST_EXPORT Q_DECL_EXPORT |
|
22 #else |
|
23 #define TEST_EXPORT Q_DECL_IMPORT |
|
24 #endif |
|
25 |
|
26 #include <QObject> |
|
27 #include <e32const.h> |
|
28 #include <e32svr.h> |
|
29 #include <SMSCLNT.H> |
|
30 #include <csmsaccount.h> |
|
31 #include <mtclreg.h> |
|
32 #include <mtclbase.h> |
|
33 #include <txtrich.h> // CRichText |
|
34 #include <msvids.h> // for Message type IDs |
|
35 #include <mmsclient.h> // for CMmsClientMtm |
|
36 #include <CMsvMimeHeaders.h> //Attachemt mimeheader |
|
37 #include <MMsvAttachmentManager.h> //Attachment manager |
|
38 #include <MMsvAttachmentManagerSync.h> |
|
39 |
|
40 class CMsvSession; |
|
41 class CClientMtmRegistry; |
|
42 class CSmsClientMtm; |
|
43 class UniEditorSmsPlugin; |
|
44 class ConvergedMessage; |
|
45 |
|
46 //Main Tets Class Declaration |
|
47 class TEST_EXPORT TestUnieditorSMSPlugin: public QObject, public MMsvSessionObserver |
|
48 { |
|
49 Q_OBJECT |
|
50 |
|
51 public: //MMsvSessionObserver |
|
52 /** |
|
53 * Handles the various events while sending SMS |
|
54 **/ |
|
55 virtual void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); |
|
56 |
|
57 private slots: |
|
58 /** |
|
59 * Initialises the whole Test |
|
60 **/ |
|
61 void initTestCase();//called before the first testfunction is executed. |
|
62 |
|
63 /** |
|
64 * Initialises each Test Case |
|
65 **/ |
|
66 void init();//called before each testfunction is executed. |
|
67 |
|
68 /** |
|
69 * Create a SMS |
|
70 **/ |
|
71 void CreateSMS(); |
|
72 |
|
73 /** |
|
74 * Send and Test the created SMS |
|
75 **/ |
|
76 void SendAndTestSMS(); |
|
77 |
|
78 /** |
|
79 * Create a SMS with Text Attachment |
|
80 **/ |
|
81 void CreateSMSWithTextAttachment(); |
|
82 |
|
83 /** |
|
84 * Test the SMS with Text Attachment |
|
85 **/ |
|
86 void TestSMSWithTextAttachment(); |
|
87 |
|
88 /** |
|
89 * Create a SMS with VCard Attachment |
|
90 **/ |
|
91 void CreateSMSWithVCardAttachment(); |
|
92 |
|
93 /** |
|
94 * Test the SMS with VCard Attachment |
|
95 **/ |
|
96 void TestSMSWithVCardAttachment(); |
|
97 |
|
98 /** |
|
99 * Create a SMS with VCal Attachment |
|
100 **/ |
|
101 void CreateSMSWithVCalAttachment(); |
|
102 |
|
103 /** |
|
104 * Test the SMS with VCal Attachment |
|
105 **/ |
|
106 void TestSMSWithVCalAttachment(); |
|
107 |
|
108 /** |
|
109 * Create an Email SMS |
|
110 **/ |
|
111 void CreateEmailSMS(); |
|
112 |
|
113 /** |
|
114 * Test the Email SMS |
|
115 **/ |
|
116 void TestEmailSMS(); |
|
117 |
|
118 /** |
|
119 * Create a SMS |
|
120 **/ |
|
121 void CreateSMSForExtraOptions(); |
|
122 |
|
123 /** |
|
124 * Test the SMS |
|
125 **/ |
|
126 void TestSMSForExtraOptions(); |
|
127 |
|
128 /** |
|
129 * Cleans up each Test Case |
|
130 **/ |
|
131 void cleanup();//called after every testfunction. |
|
132 |
|
133 /** |
|
134 * Cleans up the whole Test Case |
|
135 **/ |
|
136 void cleanupTestCase();//called after the last testfunction was executed. |
|
137 |
|
138 private: |
|
139 /** |
|
140 * Creates the Service Center Settings |
|
141 **/ |
|
142 void createSCSettingsL(); |
|
143 |
|
144 /** |
|
145 * Initialise the SMS MTM |
|
146 **/ |
|
147 void initL(); |
|
148 |
|
149 /** |
|
150 * Create the SMS Service |
|
151 **/ |
|
152 TMsvId CreateSmsServiceL(); |
|
153 |
|
154 /** |
|
155 * Returns SMS Service Id |
|
156 **/ |
|
157 TMsvId ServiceIdL(); |
|
158 |
|
159 /** |
|
160 * Creates default SIMTSY Settings |
|
161 **/ |
|
162 void CreateDefaultSettingsL(TMsvId aServiceId); |
|
163 |
|
164 /** |
|
165 * Reads the default SIMTSY Settings |
|
166 **/ |
|
167 void ReadDefaultSettingsFromSharedDataL(CSmsSettings* aServiceSettings); |
|
168 |
|
169 private: |
|
170 /** |
|
171 * iCenRepSession |
|
172 **/ |
|
173 CRepository* iCenRepSession; |
|
174 |
|
175 /** |
|
176 * iSession - SMS MTM Session |
|
177 **/ |
|
178 CMsvSession* iSession; |
|
179 |
|
180 /** |
|
181 * iMtmRegistry - SMS MTM Registry |
|
182 **/ |
|
183 CClientMtmRegistry* iMtmRegistry; |
|
184 |
|
185 /** |
|
186 * iSmsClientMtm - SMS MTM |
|
187 **/ |
|
188 CSmsClientMtm* iSmsClientMtm; |
|
189 |
|
190 /** |
|
191 * msgPlugin - SMS Unieditor Plugin |
|
192 **/ |
|
193 UniEditorSmsPlugin* msgPlugin; |
|
194 |
|
195 /** |
|
196 * smsId - Id of the SMS |
|
197 **/ |
|
198 TMsvId smsId; |
|
199 }; |
|
200 #endif //TEST_UNIEDITORSMS_PLUGIN_H |