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 service policy |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CESMRBORDERLAYER_H |
|
19 #define CESMRBORDERLAYER_H |
|
20 |
|
21 #include <coecntrl.h> |
|
22 #include "cesmrlayoutmgr.h" |
|
23 |
|
24 #include "cesmrfield.h" |
|
25 |
|
26 /** |
|
27 * CESMRBorderLayer draws border around the focused control. |
|
28 * |
|
29 * @lib esmrgui.lib |
|
30 */ |
|
31 NONSHARABLE_CLASS( CESMRBorderLayer ): public CCoeControl, |
|
32 public MCoeControlBackground |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * Two-phased constructor. |
|
37 * |
|
38 * @param aExt Control which has border around it. |
|
39 * @param aFocusType |
|
40 * @return Pointer to created and initialized esmr borderlayer object. |
|
41 */ |
|
42 IMPORT_C static CESMRBorderLayer* NewL( |
|
43 CCoeControl* aExt, |
|
44 TESMRFieldFocusType aFocusType = EESMRBorderFocus ); |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 IMPORT_C ~CESMRBorderLayer(); |
|
50 |
|
51 /** |
|
52 * Set outline focus (rectangle) around the fields control. |
|
53 * @param aFocus |
|
54 */ |
|
55 IMPORT_C void SetOutlineFocusL( TBool aFocus ); |
|
56 |
|
57 /** |
|
58 * Test if this border layer has focus. |
|
59 * @return TBool |
|
60 */ |
|
61 IMPORT_C TBool HasFocus() const; |
|
62 |
|
63 /** |
|
64 * Gives pointer to layoutmanager for this class |
|
65 * @param aLayout |
|
66 */ |
|
67 IMPORT_C void SetLayoutManager( CESMRLayoutManager* aLayout ); |
|
68 |
|
69 private: |
|
70 CESMRBorderLayer( CCoeControl* aExtControl, |
|
71 TESMRFieldFocusType aFocusType ); |
|
72 void ConstructL(); |
|
73 |
|
74 public: // From MCoeControlBackground |
|
75 IMPORT_C void Draw( CWindowGc &aGc, const |
|
76 CCoeControl &aControl, |
|
77 const TRect &aRect) const; |
|
78 IMPORT_C void GetTextDrawer( |
|
79 CCoeTextDrawerBase *&aTextDrawer, |
|
80 const CCoeControl *aDrawingControl) const; |
|
81 |
|
82 public: // From CCoeControl |
|
83 IMPORT_C TKeyResponse OfferKeyEventL( |
|
84 const TKeyEvent& aEvent, |
|
85 TEventCode aType ); |
|
86 IMPORT_C void SetContainerWindowL(const CCoeControl& aContainer); |
|
87 IMPORT_C TInt CountComponentControls() const; |
|
88 IMPORT_C CCoeControl* ComponentControl( TInt aInd ) const; |
|
89 IMPORT_C void SizeChanged(); |
|
90 |
|
91 protected: |
|
92 /// Own: control which is surrounded by border |
|
93 CCoeControl* iExtControl; |
|
94 /// Ref: Wheater this layer has focus or not |
|
95 TBool iFocus; |
|
96 /// Own: Inofmation about focus type, needed when border/highlight is drawn |
|
97 TESMRFieldFocusType iFocusType; |
|
98 /// Ref: Pointer to layputmanager |
|
99 CESMRLayoutManager* iLayout; |
|
100 }; |
|
101 |
|
102 #endif // CESMRBORDERLAYER_H |
|