|
1 /* |
|
2 * Copyright (c) 2007-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 checkbox component for es mr gui (editor) |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CESMRCHECKBOX_H |
|
20 #define CESMRCHECKBOX_H |
|
21 |
|
22 #include "cesmrfield.h" |
|
23 |
|
24 class CEikLabel; |
|
25 class CEikImage; |
|
26 class MESMRFieldValidator; |
|
27 |
|
28 /** |
|
29 * CESMRCheckBox implements the All Day Event checkbox field. |
|
30 * When the checkbox is checked, all day event time and date fields |
|
31 * are added to list. When the checkbox is unchecked, date and time |
|
32 * fields are removed from the list. |
|
33 */ |
|
34 NONSHARABLE_CLASS( CESMRCheckBox ): public CESMRField |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * Two phase constructor. |
|
39 * |
|
40 * @param aValidator validator object |
|
41 */ |
|
42 static CESMRCheckBox* NewL( MESMRFieldValidator* aValidator ); |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 */ |
|
47 ~CESMRCheckBox(); |
|
48 |
|
49 public: // From CCoeControl |
|
50 TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); |
|
51 TInt CountComponentControls() const; |
|
52 CCoeControl* ComponentControl( TInt aInd ) const; |
|
53 void SizeChanged(); |
|
54 |
|
55 public: // From CESMRField |
|
56 void InitializeL(); |
|
57 void InternalizeL( MESMRCalEntry& aEntry ); |
|
58 void ExternalizeL( MESMRCalEntry& aEntry ); |
|
59 void SetOutlineFocusL( TBool aFocus ); |
|
60 void ExecuteGenericCommandL( TInt aCommand ); |
|
61 |
|
62 private: // Implemenation |
|
63 /** |
|
64 * Set checked or unchecked icon. |
|
65 * |
|
66 * @param aChecked ETrue for checked icon |
|
67 */ |
|
68 void SetIconL( TBool aChecked ); |
|
69 |
|
70 /** |
|
71 * Handles triggering checkbox, checks/unchecks it. |
|
72 */ |
|
73 void HandleCheckEventL(); |
|
74 |
|
75 private: |
|
76 /** |
|
77 * Constructor. |
|
78 * |
|
79 * @param aValidator validator object |
|
80 */ |
|
81 CESMRCheckBox( MESMRFieldValidator* aValidator ); |
|
82 |
|
83 /** |
|
84 * Second phase constructor. |
|
85 */ |
|
86 void ConstructL(); |
|
87 |
|
88 /** |
|
89 * Changes msk label from mark to unmark |
|
90 * and other way around. |
|
91 * |
|
92 */ |
|
93 void SwitchMSKLabelL(); |
|
94 |
|
95 private: |
|
96 /** |
|
97 * Not owned. Checkbox text label |
|
98 */ |
|
99 CEikLabel* iLabel; |
|
100 |
|
101 /** |
|
102 * Owned. checkbox_mark/checkbox_unmark |
|
103 */ |
|
104 CEikImage* iIcon; |
|
105 |
|
106 // Pointer to the bitmap. iIcon is created by using this bitmap |
|
107 CFbsBitmap* iBitmap; |
|
108 |
|
109 // Pointer to the bitmap mask. iIcon is created by using this bitmap mask |
|
110 CFbsBitmap* iBitmapMask; |
|
111 |
|
112 /** |
|
113 * Not owned. Validator class for time and sanity checks. |
|
114 */ |
|
115 MESMRFieldValidator* iValidator; |
|
116 |
|
117 /** |
|
118 * If checkbox is marked or unmarked. |
|
119 */ |
|
120 TBool iChecked; |
|
121 }; |
|
122 |
|
123 #endif // CESMRCHECKBOX_H |
|
124 |