|
1 /* |
|
2 * Copyright (c) 2007 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 CFSMailOutOfMemoryHandler. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __FSMAIL_OUTOFMEMORY_HANDLER_H__ |
|
20 #define __FSMAIL_OUTOFMEMORY_HANDLER_H__ |
|
21 |
|
22 #include "fsnotificationhandlerbase.h" |
|
23 #include "fsnotificationhandlertimerobserver.h" |
|
24 #include "fsnotificationhandlernotifierinitiator.h" |
|
25 #include "fsnotificationhandlernotifierinitiatorobserver.h" |
|
26 |
|
27 class CFSNotificationHandlerTimer; |
|
28 |
|
29 /** |
|
30 * Class to handle showing of out of memory in case the error |
|
31 * occurs while synchronizing a mail box. |
|
32 * |
|
33 * @code |
|
34 * ?good_class_usage_example(s) |
|
35 * @endcode |
|
36 * |
|
37 * @lib ?library |
|
38 * @since S60 ?S60_version *** for example, S60 v3.0 |
|
39 */ |
|
40 class CFSMailOutOfMemoryHandler : |
|
41 public CFSNotificationHandlerBase, |
|
42 public MFSNotificationHandlerTimerObserver, |
|
43 public MFSNotificationHandlerNotifierInitiatorObserver |
|
44 { |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 * @param aOwner Owner and manager of this handler. |
|
50 */ |
|
51 static CFSMailOutOfMemoryHandler* NewL( |
|
52 MFSNotificationHandlerMgr& aOwner ); |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CFSMailOutOfMemoryHandler(); |
|
57 |
|
58 /** |
|
59 * Informs instance of this class that notification |
|
60 * showing has completed and that the initiator |
|
61 * can be removed. |
|
62 * |
|
63 * @since S60 ?S60_version |
|
64 * @param aInitiator Pointer to the initiator that has completed. |
|
65 */ |
|
66 void NotifierInitiatorDoneL( |
|
67 CFSNotificationHandlerNotifierInitiator* aInitiator ); |
|
68 |
|
69 // From base class MFSNotificationHandlerTimerObserver |
|
70 virtual void TimerCallBackL( TInt aError ); |
|
71 |
|
72 protected: |
|
73 |
|
74 |
|
75 // from base class CFSNotificationHandlerBase |
|
76 |
|
77 /** |
|
78 * From CFSNotificationHandlerBase. |
|
79 * Implementation of CapabilitiesToContinueL. |
|
80 * |
|
81 * @see CFSNotificationHandlerBase::CapabilitiesToContinueL |
|
82 * |
|
83 * @since S60 ?S60_version |
|
84 */ |
|
85 virtual TBool CapabilitiesToContinueL( |
|
86 TFSMailEvent aEvent, |
|
87 TFSMailMsgId aMailbox, |
|
88 TAny* aParam1, |
|
89 TAny* aParam2, |
|
90 TAny* aParam3 ) const; |
|
91 |
|
92 /** |
|
93 * Function that does the actual event handling. |
|
94 * |
|
95 * @see CFSNotificationHandlerBase::EventL |
|
96 * |
|
97 * @since S60 ?S60_version |
|
98 */ |
|
99 virtual void HandleEventL( |
|
100 TFSMailEvent aEvent, |
|
101 TFSMailMsgId aMailbox, |
|
102 TAny* aParam1, |
|
103 TAny* aParam2, |
|
104 TAny* aParam3 ); |
|
105 |
|
106 private: |
|
107 |
|
108 /** |
|
109 * Constructor. |
|
110 * |
|
111 * @since S60 ?S60_version |
|
112 * @param aOwner Owner and manager of this handler. |
|
113 */ |
|
114 CFSMailOutOfMemoryHandler( MFSNotificationHandlerMgr& aOwner ); |
|
115 void ConstructL(); |
|
116 |
|
117 /** |
|
118 * Shows an error note stating that out of memory error |
|
119 * occurred while synchronizing the mailbox whose name was |
|
120 * given as a parameter. |
|
121 * |
|
122 * @since S60 ?S60_version |
|
123 * @param aMailboxName The name of the mailbox. |
|
124 */ |
|
125 void ShowOutOfMemoryNoteL( TFSMailMsgId aMailboxId ); |
|
126 |
|
127 // from base class CFSNotificationHandlerBase |
|
128 virtual void TurnNotificationOn(); |
|
129 virtual void TurnNotificationOff(); |
|
130 |
|
131 private: // data |
|
132 |
|
133 |
|
134 /** |
|
135 * Timer service. |
|
136 * Own. |
|
137 */ |
|
138 CFSNotificationHandlerTimer* iTimer; |
|
139 |
|
140 /** |
|
141 * Active object handling asynchronous calls to FreestyleEmailNotifier. |
|
142 * Own. |
|
143 */ |
|
144 CFSNotificationHandlerNotifierInitiator* iNotifierInitiator; |
|
145 |
|
146 }; |
|
147 |
|
148 |
|
149 #endif //__FSMAIL_OUTOFMEMORY_HANDLER_H__ |