|
1 /* |
|
2 * Copyright (c) 2008 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: This file defines class CFSMailMessageQueryHandler. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __FSMAIL_MESSAGEQUERY_HANDLER_H__ |
|
20 #define __FSMAIL_MESSAGEQUERY_HANDLER_H__ |
|
21 |
|
22 #include "fsnotificationhandlerbase.h" |
|
23 #include "fsnotificationhandlernotifierinitiator.h" |
|
24 #include "fsnotificationhandlernotifierinitiatorobserver.h" |
|
25 |
|
26 |
|
27 /** |
|
28 * Class to handle showing of authentication query in case |
|
29 * needed. |
|
30 * |
|
31 * @code |
|
32 * ?good_class_usage_example(s) |
|
33 * @endcode |
|
34 * |
|
35 * @lib ?library |
|
36 * @since S60 ?S60_version *** for example, S60 v3.0 |
|
37 */ |
|
38 class CFSMailMessageQueryHandler : |
|
39 public CFSNotificationHandlerBase, |
|
40 public MFSNotificationHandlerNotifierInitiatorObserver |
|
41 { |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 * @param aOwner Owner and manager of this handler. |
|
47 */ |
|
48 static CFSMailMessageQueryHandler* NewL( |
|
49 MFSNotificationHandlerMgr& aOwner ); |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 virtual ~CFSMailMessageQueryHandler(); |
|
54 |
|
55 public: // From base class MFSNotificationHandlerNotifieriInitiatorObserver |
|
56 |
|
57 void NotifierInitiatorDoneL( |
|
58 CFSNotificationHandlerNotifierInitiator* aInitiator ); |
|
59 |
|
60 protected: |
|
61 |
|
62 |
|
63 // from base class CFSNotificationHandlerBase |
|
64 |
|
65 /** |
|
66 * From CFSNotificationHandlerBase. |
|
67 * Implementation of CapabilitiesToContinueL. |
|
68 * |
|
69 * @see CFSNotificationHandlerBase::CapabilitiesToContinueL |
|
70 * |
|
71 * @since S60 ?S60_version |
|
72 */ |
|
73 virtual TBool CapabilitiesToContinueL( |
|
74 TFSMailEvent aEvent, |
|
75 TFSMailMsgId aMailbox, |
|
76 TAny* aParam1, |
|
77 TAny* aParam2, |
|
78 TAny* aParam3 ) const; |
|
79 |
|
80 /** |
|
81 * Function that does the actual event handling. |
|
82 * |
|
83 * @see CFSNotificationHandlerBase::EventL |
|
84 * |
|
85 * @since S60 ?S60_version |
|
86 */ |
|
87 virtual void HandleEventL( |
|
88 TFSMailEvent aEvent, |
|
89 TFSMailMsgId aMailbox, |
|
90 TAny* aParam1, |
|
91 TAny* aParam2, |
|
92 TAny* aParam3 ); |
|
93 |
|
94 private: |
|
95 |
|
96 /** |
|
97 * Constructor. |
|
98 * |
|
99 * @since S60 ?S60_version |
|
100 * @param aOwner Owner and manager of this handler. |
|
101 */ |
|
102 CFSMailMessageQueryHandler( MFSNotificationHandlerMgr& aOwner ); |
|
103 void ConstructL(); |
|
104 |
|
105 /** |
|
106 * Shows an message query dialog. |
|
107 * |
|
108 * @since S60 ?S60_version |
|
109 * @param aMailboxName The name of the mailbox. |
|
110 */ |
|
111 void ShowMessageQueryL( TFSMailMsgId aMailbox, |
|
112 TFsEmailNotifierSystemMessageType aMessageType, |
|
113 const TDesC& aCustomMessageText, |
|
114 MFSMailExceptionEventCallback* aCallback ); |
|
115 |
|
116 |
|
117 /** |
|
118 * Searches for a initiator among initiators that |
|
119 * has the same pointer as given parameter. |
|
120 * |
|
121 * @since S60 ?S60_version |
|
122 * @param aInitiator Pointer to searched initiator. |
|
123 * @return Index for found initiator in initiators list. |
|
124 * KErrNotFound if not found. |
|
125 */ |
|
126 TInt FindInitiator( |
|
127 CFSNotificationHandlerNotifierInitiator* aInitiator ) const; |
|
128 |
|
129 /** |
|
130 * Searches for a initiator among initiators that |
|
131 * is related to the same mailbox as given as a parameter. |
|
132 * |
|
133 * @since S60 ?S60_version |
|
134 * @param aMailBoxId Mailbox id that the searched initiator |
|
135 * is related to. |
|
136 * @return Index for found initiator in initiators list. |
|
137 * KErrNotFound if not found. |
|
138 */ |
|
139 TInt FindInitiator( TFSMailMsgId aMailBoxId, |
|
140 TFsEmailNotifierSystemMessageType aMessageType ) const; |
|
141 |
|
142 |
|
143 // from base class CFSNotificationHandlerBase |
|
144 virtual void TurnNotificationOn(); |
|
145 virtual void TurnNotificationOff(); |
|
146 |
|
147 private: // data |
|
148 |
|
149 /** |
|
150 * Active objects handling asynchronous calls to FreestyleEmailNotifier. |
|
151 * Own. |
|
152 */ |
|
153 RPointerArray<CFSNotificationHandlerNotifierInitiator> |
|
154 iNotifierInitiators; |
|
155 |
|
156 }; |
|
157 |
|
158 |
|
159 #endif //__FSMAIL_MESSAGEQUERY_HANDLER_H__ |