|
1 /* |
|
2 * ============================================================================ |
|
3 * Name : CTestAppAppUi from TestAppAppUi.h |
|
4 * ============================================================================ |
|
5 */ |
|
6 |
|
7 #ifndef TESTAPPAPPUI_H |
|
8 #define TESTAPPAPPUI_H |
|
9 |
|
10 // INCLUDES |
|
11 #include <aknappui.h> |
|
12 #include <msvapi.h> |
|
13 #include <Imumdasettingskeys.h> |
|
14 |
|
15 // FORWARD DECLARATIONS |
|
16 class CTestAppContainer; |
|
17 |
|
18 const TInt TTestAppUiIpsBufLength = 200; |
|
19 |
|
20 // CLASS DECLARATION |
|
21 |
|
22 // Name of the ini KIpsSosTestIni |
|
23 //_LIT( KIpsSosTestFilePath, "c:\\data\\ipssostestcases\\" ); |
|
24 _LIT( KIpsSosTestFilePath, "c:\\" ); |
|
25 _LIT( KIpsSosTestFileName, "ipssostest" ); |
|
26 _LIT( KIpsSosTestFileExtension, ".ini" ); |
|
27 |
|
28 // Literals used in ini |
|
29 _LIT8( KIpsSosTestProtocol, "Protocol" ); |
|
30 _LIT8( KIpsSosTestIMAP, "IMAP4" ); |
|
31 _LIT8( KIpsSosTestPOP, "POP3" ); |
|
32 _LIT8( KIpsSosTestMailboxName, "MailboxName" ); |
|
33 _LIT8( KIpsSosTestEmailAddress, "EmailAddress" ); |
|
34 _LIT8( KIpsSosTestUserName, "UserName" ); |
|
35 _LIT8( KIpsSosTestPassword, "Password" ); |
|
36 _LIT8( KIpsSosTestUserAlias, "UserAlias" ); |
|
37 _LIT8( KIpsSosTestSignature, "Signature" ); |
|
38 _LIT8( KIpsSosTestFolderPath, "FolderPath" ); |
|
39 _LIT8( KIpsSosTestAccessPoint, "AccessPoint" ); |
|
40 _LIT8( KIpsSosTestIncomingServerAddress, "IncomingServerAddress" ); |
|
41 _LIT8( KIpsSosTestIncomingPort, "IncomingPort" ); |
|
42 _LIT8( KIpsSosTestIncomingSecurity, "IncomingSecurity" ); |
|
43 _LIT8( KIpsSosTestOutgoingServerAddress, "OutgoingServerAddress" ); |
|
44 _LIT8( KIpsSosTestOutgoingPort, "OutgoingPort" ); |
|
45 _LIT8( KIpsSosTestOutgoingSecurity, "OutgoingSecurity" ); |
|
46 _LIT8( KIpsSosTestPortValueDefault, "Default" ); |
|
47 _LIT8( KIpsSosTestPortValueUserDefined, "UserDefined" ); |
|
48 _LIT8( KIpsSosTestAPAlwaysAsk, "AlwaysAsk" ); |
|
49 _LIT8( KIpsSosTestSecurityTls, "Tls" ); |
|
50 _LIT8( KIpsSosTestSecuritySsl, "Ssl" ); |
|
51 |
|
52 |
|
53 // Ini-file commentline identifier |
|
54 _LIT8( KIpsSosTestIniCommentLine, "//"); |
|
55 // Ini-file key value separator |
|
56 _LIT8( KIpsSosTestIniSeparator, "="); |
|
57 // Ini-file hex value identifier |
|
58 _LIT8( KIpsSosTestIniHexMark, "0x"); |
|
59 |
|
60 // Used with panic if error occurs |
|
61 _LIT( KIpsSosTestPanicText, "KIpsSosTestPanic" ); |
|
62 |
|
63 // Notes |
|
64 _LIT( KIpsSosTestRecentNotFound, "Recent view not found" ); |
|
65 _LIT( KIpsSosTestErrorLaunching, "Error in plugin launching" ); |
|
66 _LIT( KIpsSosTestErrorInWriting, "Error in settins writing" ); |
|
67 _LIT( KIpsSosTestSettingsCreated, "Settings created" ); |
|
68 _LIT( KIpsSosTestFileNotFound, "File not found" ); |
|
69 _LIT( KIpsSosTestErrorInReading, "Error in settings reading" ); |
|
70 _LIT( KIpsSosTestUnknownValue, "Unknown settings key value"); |
|
71 |
|
72 // Used as delimeter in ini-file |
|
73 const TInt KIpsSosTestLineFeed = 0x000D; |
|
74 |
|
75 // Used for removing delimeter |
|
76 const TInt KIpsSosTestDelimeterSize = 1; |
|
77 |
|
78 // Max length of line in ini-file |
|
79 const TInt KIpsSosTestMaxLineLength = 128; |
|
80 |
|
81 // Buf lenght for format |
|
82 const TInt KIpsSosTestFormatBufLength = 50; |
|
83 |
|
84 const TInt KIpsSosTestDefaultFile = 0; |
|
85 |
|
86 const TInt KIpsSosTestPortDefault = 0; |
|
87 |
|
88 const TInt KIpsSosTestAlwaysAskAp = 0; |
|
89 |
|
90 // P&S KEY and categories |
|
91 enum TIpsSosTestPropertyKeys |
|
92 { |
|
93 EIpsSosTestRecentMsvId = 1 |
|
94 }; |
|
95 |
|
96 const TUid KIpsSosTestPropertyCat = {0x10012349}; |
|
97 |
|
98 /** |
|
99 * Application UI class. |
|
100 * |
|
101 */ |
|
102 class CTestAppAppUi : public CAknAppUi, public MMsvSessionObserver |
|
103 { |
|
104 public: // // Constructors and destructor |
|
105 |
|
106 /** |
|
107 * Default constructor. |
|
108 */ |
|
109 void ConstructL(); |
|
110 |
|
111 /** |
|
112 * Destructor. |
|
113 */ |
|
114 ~CTestAppAppUi(); |
|
115 |
|
116 public: //from MIdleFindObserver |
|
117 void IdleFindCallback(); |
|
118 |
|
119 public: // from MMsvSessionObserver |
|
120 |
|
121 void HandleSessionEventL( |
|
122 TMsvSessionEvent aEvent, |
|
123 TAny* aArg1, |
|
124 TAny* aArg2, |
|
125 TAny* aArg3 ); |
|
126 |
|
127 private: // New functions |
|
128 //Put 3 pointer in CleanupStack |
|
129 void DebugL( TRefByValue<const TDesC> aText, ...); |
|
130 void TimeDebugL( TTime aStartTime, TTime aEndTime ); |
|
131 private: |
|
132 // From MEikMenuObserver |
|
133 void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); |
|
134 |
|
135 private: |
|
136 |
|
137 void LaunchPluginL(); |
|
138 void WriteSettingsViaODSUtilityL(); |
|
139 void WriteSettingsToWizardCenRepL(); |
|
140 void WriteSettingsViaImumL(); |
|
141 void ReadSettingsL( TInt aFileId ); |
|
142 void DeleteAllSettingsL(); |
|
143 void SetRecentMsvIdL( TMsvId aMsvId ); |
|
144 TMsvId RecentMsvId(); |
|
145 void ShowNoteL( const TDesC& aMessage ); |
|
146 |
|
147 |
|
148 /** |
|
149 * From CEikAppUi, takes care of command handling. |
|
150 * @param aCommand command to be handled |
|
151 */ |
|
152 void HandleCommandL(TInt aCommand); |
|
153 |
|
154 /** |
|
155 * From CEikAppUi, handles key events. |
|
156 * @param aKeyEvent Event to handled. |
|
157 * @param aType Type of the key event. |
|
158 * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed). |
|
159 */ |
|
160 virtual TKeyResponse HandleKeyEventL( |
|
161 const TKeyEvent& aKeyEvent,TEventCode aType); |
|
162 |
|
163 private: // Data |
|
164 // Own: |
|
165 CTestAppContainer* iAppContainer; |
|
166 |
|
167 TMsvId iMailboxId; |
|
168 TInt32 iProtocol; |
|
169 TBuf<TTestAppUiIpsBufLength> iMailboxName; |
|
170 TBuf<TTestAppUiIpsBufLength> iEmailAddress; |
|
171 TBuf<TTestAppUiIpsBufLength> iIncomingServerAddress; |
|
172 TBuf<TTestAppUiIpsBufLength> iUserName; |
|
173 TBuf<TTestAppUiIpsBufLength> iPassword; |
|
174 TBuf<TTestAppUiIpsBufLength> iUserAlias; |
|
175 TBuf<TTestAppUiIpsBufLength> iSignature; |
|
176 TBuf<TTestAppUiIpsBufLength> iFolderPath; |
|
177 TInt iIncomingPort; |
|
178 TBuf<TTestAppUiIpsBufLength> iAccessPoint; |
|
179 TInt iIncomingSecurity; |
|
180 TInt iOutProtocol; |
|
181 TBuf<TTestAppUiIpsBufLength> iOutgoingServerAddress; |
|
182 TInt iOutgoingPort; |
|
183 TInt iOutgoingSecurity; |
|
184 |
|
185 }; |
|
186 |
|
187 #endif // TESTAPPAPPUI_H |
|
188 |
|
189 // End of File |