|
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: Background/focus component for fields. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CMRBACKGROUND_H |
|
19 #define CMRBACKGROUND_H |
|
20 |
|
21 #include <coecntrl.h> |
|
22 #include "nmrbitmapmanager.h" |
|
23 #include "cesmrfield.h" |
|
24 |
|
25 class CESMRLayoutManager; |
|
26 |
|
27 /** |
|
28 * CESMRBorderLayer draws border around the focused control. |
|
29 * |
|
30 * @lib esmrgui.lib |
|
31 */ |
|
32 NONSHARABLE_CLASS( CMRBackground ): public CBase, public MCoeControlBackground |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Two-phased constructor. |
|
38 * |
|
39 * @param aExt Control which has border around it. |
|
40 * @param aFocusType |
|
41 * @return Pointer to created and initialized esmr borderlayer object. |
|
42 */ |
|
43 IMPORT_C static CMRBackground* NewL( CESMRLayoutManager& aLayoutManager ); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 IMPORT_C virtual ~CMRBackground(); |
|
49 |
|
50 protected: // From MCoeControlBackground |
|
51 IMPORT_C void Draw( CWindowGc &aGc, const CCoeControl &aControl, const TRect &aRect ) const; |
|
52 |
|
53 private: |
|
54 /// Type of the field's background |
|
55 enum TBgType |
|
56 { |
|
57 EEditorFieldNoFocus = 1, |
|
58 EEditorFieldWithFocus, |
|
59 EViewerFieldWithFocus |
|
60 }; |
|
61 |
|
62 CMRBackground( CESMRLayoutManager& aLayoutManager ); |
|
63 void CMRBackground::DrawFocus( |
|
64 CWindowGc& aGc, |
|
65 TRect aRect, |
|
66 const CCoeControl& aControl, |
|
67 TBgType aType ) const; |
|
68 CArrayFixFlat<NMRBitmapManager::TMRBitmapId>* IconSkinIdL( TBgType aType ) const; |
|
69 |
|
70 private: |
|
71 /// Ref: Layout manager. |
|
72 CESMRLayoutManager& iLayoutManager; |
|
73 }; |
|
74 |
|
75 #endif // CESMRBORDERLAYER_H |