|
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: HTI Mailbox settings handler. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef HTIMAILBOXHANDLER_H_ |
|
20 #define HTIMAILBOXHANDLER_H_ |
|
21 |
|
22 // INCLUDES |
|
23 #include <cmmanager.h> |
|
24 #include <msvapi.h> |
|
25 #include <HtiServicePluginInterface.h> |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // MACROS |
|
30 |
|
31 // DATA TYPES |
|
32 |
|
33 // FUNCTION PROTOTYPES |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class TSmtpAccount; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 /** |
|
40 * HTI Mailbox settings handler. |
|
41 */ |
|
42 class CHtiMailboxHandler : public CBase, |
|
43 public MMsvSessionObserver |
|
44 { |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 */ |
|
50 static CHtiMailboxHandler* NewL(); |
|
51 |
|
52 /** |
|
53 * Called when there is a message to be processed by this service. |
|
54 * @param aMessage message body destinated to the servive |
|
55 * @param aPriority message priority |
|
56 */ |
|
57 void ProcessMessageL( const TDesC8& aMessage, |
|
58 THtiMessagePriority aPriority ); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 virtual ~CHtiMailboxHandler(); |
|
64 |
|
65 /** |
|
66 * Sets the dispatcher to send outgoing messages to. |
|
67 * @param aDispatcher pointer to dispatcher instance |
|
68 */ |
|
69 void SetDispatcher( MHtiDispatcher* aDispatcher ); |
|
70 |
|
71 private: |
|
72 |
|
73 /** |
|
74 * C++ default constructor. |
|
75 */ |
|
76 CHtiMailboxHandler(); |
|
77 |
|
78 /** |
|
79 * 2nd phase constructor. |
|
80 */ |
|
81 void ConstructL(); |
|
82 |
|
83 private: // helpers |
|
84 |
|
85 void HandleCreateMailboxL( const TDesC8& aData ); |
|
86 void HandleDeleteMailboxL( const TDesC8& aData ); |
|
87 void ParseCreateMsgL( const TDesC8& aData ); |
|
88 HBufC* ParseStringL( const TDesC8& aData, TInt aStrLenOffset, |
|
89 TInt aStrLenBytes = 1 ); |
|
90 HBufC8* ParseString8L( const TDesC8& aData, TInt aStrLenOffset, |
|
91 TInt aStrLenBytes = 1 ); |
|
92 TInt AccessPointUIDL( const TDesC& aApName ); |
|
93 TInt FindSmtpAccount( const TDesC& aAccountName, |
|
94 TSmtpAccount& aAccount ); |
|
95 void GetDeviceImeiL( TDes& aResult ); |
|
96 void ResetVariables(); |
|
97 void SendOkMsgL( const TDesC8& aData ); |
|
98 void SendErrorMessageL( TInt aError, const TDesC8& aDescription ); |
|
99 |
|
100 private: // from MMsvSessionObserver |
|
101 |
|
102 void HandleSessionEventL( TMsvSessionEvent aEvent, |
|
103 TAny* aArg1, TAny* aArg2, TAny* aArg3 ); |
|
104 |
|
105 private: // Data |
|
106 |
|
107 // Pointer to the dispatcher (referenced) |
|
108 MHtiDispatcher* iDispatcher; |
|
109 |
|
110 // Handle to connection manager |
|
111 RCmManager iCmManager; |
|
112 |
|
113 // Email account settings |
|
114 TInt iMailboxType; |
|
115 HBufC* iMailboxName; |
|
116 HBufC* iIncomingServer; |
|
117 HBufC* iIncomingApName; |
|
118 HBufC8* iIncomingUserName; |
|
119 HBufC8* iIncomingPassword; |
|
120 TInt iIncomingSecurity; |
|
121 TInt iIncomingPort; |
|
122 TBool iAPopSecureLogin; |
|
123 HBufC* iOutgoingServer; |
|
124 HBufC* iOutgoingApName; |
|
125 HBufC8* iOutgoingUserName; |
|
126 HBufC8* iOutgoingPassword; |
|
127 TInt iOutgoingSecurity; |
|
128 TInt iOutgoingPort; |
|
129 HBufC* iOwnMailAddress; |
|
130 HBufC* iOwnName; |
|
131 TInt iSendOption; // (enum TImSMTPSendMessageOption) |
|
132 TInt iSendCopyToOwnAddress; // (enum TImSMTPSendCopyToSelf) |
|
133 HBufC* iSignatureText; |
|
134 TBool iNewMailIndicators; |
|
135 TInt iRetrievedParts; |
|
136 TInt iRetrieveSizeLimitKb; |
|
137 TInt iEmailsToRetrieve; |
|
138 HBufC8* iImapFolderPath; |
|
139 TInt iAutomaticUpdate; |
|
140 TBool iSetAsDefault; |
|
141 }; |
|
142 |
|
143 #endif // HTIMAILBOXHANDLER_H_ |
|
144 |
|
145 // End of file |