|
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: MR multi calendar field impl. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CMRMULTICALENFIELD_H |
|
19 #define CMRMULTICALENFIELD_H |
|
20 |
|
21 // INCLUDES |
|
22 #include "cesmrfield.h" |
|
23 |
|
24 // FORWARD DECLARATIONS |
|
25 class CMRLabel; |
|
26 class CMRImage; |
|
27 class CESMRTextItem; |
|
28 class CESMRMultiCalenItem; |
|
29 class MESMRCalDbMgr; |
|
30 |
|
31 /** |
|
32 * This class is a custom field control that shows the calendar type of multi calendar |
|
33 */ |
|
34 NONSHARABLE_CLASS( CMRMultiCalenField ) : public CESMRField |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * Creates new CMRMultiCalenField object. Ownership |
|
39 * is transferred to caller. |
|
40 * @return Pointer to created object, |
|
41 */ |
|
42 static CMRMultiCalenField* NewL(); |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 */ |
|
47 ~CMRMultiCalenField(); |
|
48 |
|
49 public: // From CESMRField |
|
50 void InitializeL(); |
|
51 void InternalizeL( MESMRCalEntry& aEntry ); |
|
52 void SetOutlineFocusL( TBool aFocus ); |
|
53 TBool ExecuteGenericCommandL( TInt aCommand ); |
|
54 void LockL(); |
|
55 |
|
56 public: // From CCoeControl |
|
57 TInt CountComponentControls() const; |
|
58 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
59 void SizeChanged(); |
|
60 |
|
61 private: |
|
62 /** |
|
63 * Constructor. |
|
64 */ |
|
65 CMRMultiCalenField(); |
|
66 |
|
67 /** |
|
68 * Second phase constructor. |
|
69 */ |
|
70 void ConstructL(); |
|
71 |
|
72 /** |
|
73 * Updates event type text to aIndex. |
|
74 * |
|
75 * @param aIndex new event type index |
|
76 */ |
|
77 void UpdateLabelL( TInt aIndex ); |
|
78 |
|
79 /** |
|
80 * Shows query dialog for selecting |
|
81 * event type |
|
82 */ |
|
83 void ExecuteTypeQueryL(); |
|
84 |
|
85 /** |
|
86 * Sets the label text color dimmed |
|
87 */ |
|
88 void SetTextDimmed(); |
|
89 |
|
90 /** |
|
91 * Tests if calendar type change is enabled or not. |
|
92 * |
|
93 * @return Boolean, ETrue if type change is enabled, otherwise EFalse. |
|
94 */ |
|
95 TBool TypeChangeEnabledL(); |
|
96 |
|
97 private: |
|
98 /** |
|
99 * Not owned. Event type label. |
|
100 */ |
|
101 CMRLabel* iCalenName; |
|
102 |
|
103 /// Own: Icon field |
|
104 CMRImage* iIcon; |
|
105 |
|
106 /// Own: lock icon |
|
107 CMRImage* iLockIcon; |
|
108 |
|
109 /** |
|
110 * Index of selected event type. |
|
111 */ |
|
112 TInt iIndex; |
|
113 |
|
114 /** |
|
115 * ref to cur entry |
|
116 */ |
|
117 MESMRCalEntry* iEntry; |
|
118 |
|
119 /** |
|
120 * reserve multi-calendar name list |
|
121 */ |
|
122 RArray<TPtrC> iCalenNameList; |
|
123 |
|
124 /** |
|
125 * Own: Indicates if calendar type change is enabled or disabled |
|
126 */ |
|
127 TBool iTypeChangeEnabled; |
|
128 }; |
|
129 |
|
130 #endif // CMRMULTICALENFIELD_H |
|
131 |