|
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: ESMR field storage definition |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CESMRFIELDSTORAGE_H |
|
19 #define CESMRFIELDSTORAGE_H |
|
20 |
|
21 #include <e32base.h> |
|
22 //<cmail> |
|
23 #include "esmrdef.h" |
|
24 //</cmail> |
|
25 #include "mesmrfieldstorage.h" |
|
26 #include "cesmrfieldbuilderinterface.h" |
|
27 |
|
28 class CESMRField; |
|
29 class MESMRCalEntry; |
|
30 class MESMRFieldEventObserver; |
|
31 class CESMRFieldEventQueue; |
|
32 class CESMRPolicy; |
|
33 class CMRSystemNotifier; |
|
34 |
|
35 /** |
|
36 * CESMRFieldStorage is a base class for different storage classes. |
|
37 * Storage class owns the fields needed to draw UI. This class also has methods |
|
38 * to add new fields into field array. |
|
39 * |
|
40 * fields for the ui are created are created in a separate ecom plugin |
|
41 * loaded here |
|
42 */ |
|
43 NONSHARABLE_CLASS( CESMRFieldStorage ): public CBase, |
|
44 public MESMRFieldStorage |
|
45 { |
|
46 public: |
|
47 // Destructor |
|
48 virtual ~CESMRFieldStorage(); |
|
49 |
|
50 public: |
|
51 /** |
|
52 * Adds new field into field array. |
|
53 * |
|
54 * @param aField - field to be added |
|
55 */ |
|
56 void AddFieldL( CESMRField* aField ); |
|
57 |
|
58 /** |
|
59 * Adds new field into field array. |
|
60 * |
|
61 * @param aField - field to be added |
|
62 * @param aVisible - is this field visible by default ot not. |
|
63 */ |
|
64 void AddFieldL( CESMRField* aField, TBool aVisible ); |
|
65 |
|
66 /** |
|
67 * Creates editor field. |
|
68 * |
|
69 * @param aValidator - time validator |
|
70 * @param aField - field to be created |
|
71 */ |
|
72 CESMRField* CreateEditorFieldL( |
|
73 MESMRFieldValidator* aValidator, |
|
74 TESMREntryField aField ); |
|
75 |
|
76 /** |
|
77 * Creates viewer field. |
|
78 * |
|
79 * @param aResponseObserver - observer to be called when e.g. |
|
80 * answer is ready to be sent. |
|
81 * @param aField - field to be created |
|
82 * @param aResponseReady - NOT IN USE |
|
83 */ |
|
84 CESMRField* CreateViewerFieldL( |
|
85 MESMRResponseObserver* aResponseObserver, |
|
86 TESMREntryField aField, |
|
87 TBool aResponseReady ); |
|
88 |
|
89 public: // From MESMRFieldStorage |
|
90 TInt Count() const; |
|
91 CESMRField* Field( TInt aInd ) const; |
|
92 CESMRField* FieldById( TESMREntryFieldId aId ) const; |
|
93 void InternalizeL( MESMRCalEntry& aEntry ); |
|
94 void ExternalizeL( MESMRCalEntry& aEntry ); |
|
95 TInt Validate( TESMREntryFieldId& aId, TBool aForceValidate ); |
|
96 void ChangePolicyL( const CESMRPolicy& aNewPolicy, |
|
97 MESMRCalEntry& aEntry ); |
|
98 |
|
99 protected: |
|
100 // C++ constructor |
|
101 CESMRFieldStorage( |
|
102 MESMRFieldEventObserver& aEventObserver ); |
|
103 |
|
104 void BaseConstructL(); |
|
105 |
|
106 CESMRFieldEventQueue& EventQueueL(); |
|
107 |
|
108 void RemoveField( TInt aInd ); |
|
109 |
|
110 void InsertFieldL( CESMRField* aField, TInt aIndex ); |
|
111 |
|
112 void ReserveL( TInt aCount ); |
|
113 |
|
114 void Reset(); |
|
115 |
|
116 private: |
|
117 /** |
|
118 * loads fieldbuilder ecom plugin |
|
119 * delayed until the first time the plugin is needed |
|
120 */ |
|
121 void LoadPluginL(); |
|
122 |
|
123 MESMRFieldBuilder* FieldBuilderL(); |
|
124 |
|
125 private: |
|
126 /// Own: Array that owns all the fields |
|
127 RPointerArray< CESMRField > iArray; |
|
128 /// Own: ecom field builder interface |
|
129 CESMRFieldBuilderInterface* iPlugin; |
|
130 /// Ref: composite class of field builder interface |
|
131 MESMRFieldBuilder* iFieldBuilder; |
|
132 /// Ref: Event observer |
|
133 MESMRFieldEventObserver& iEventObserver; |
|
134 /// Own: Event Queue |
|
135 CESMRFieldEventQueue* iEventQueue; |
|
136 /// Own: System notifier |
|
137 CMRSystemNotifier* iSystemNotifier; |
|
138 }; |
|
139 |
|
140 #endif // CESMRFIELDSTORAGE_H |
|
141 |
|
142 // EOF |
|
143 |