64
|
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 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 CMRLabel;
|
|
25 |
class CMRImage;
|
|
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 |
void SetContainerWindowL( const CCoeControl& aContainer );
|
|
55 |
|
|
56 |
public: // From CESMRField
|
|
57 |
void InternalizeL( MESMRCalEntry& aEntry );
|
|
58 |
void ExternalizeL( MESMRCalEntry& aEntry );
|
|
59 |
void SetOutlineFocusL( TBool aFocus );
|
|
60 |
TBool 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 |
void SendFieldChangeEventL( TESMREntryFieldId aFieldId );
|
|
95 |
private:
|
|
96 |
|
|
97 |
//Not owned. Checkbox text label
|
|
98 |
CMRLabel* iLabel;
|
|
99 |
|
|
100 |
// Owned. checkbox_mark/checkbox_unmark
|
|
101 |
CMRImage* iFieldIcon;
|
|
102 |
|
|
103 |
// If checkbox is marked or unmarked.
|
|
104 |
TBool iChecked;
|
|
105 |
};
|
|
106 |
|
|
107 |
#endif // CESMRCHECKBOX_H
|
|
108 |
|