|
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: Color manager for MRGUI usage. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef NMRCOLORMANAGER_H |
|
19 #define NMRCOLORMANAGER_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <aknsitemid.h> |
|
23 #include <gdi.h> // TRgb |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CCoeControl; |
|
27 class CEikTTimeEditor; |
|
28 class CEikDateEditor; |
|
29 |
|
30 namespace NMRColorManager |
|
31 { |
|
32 enum TMRColorId |
|
33 { |
|
34 EMRColorNotSet = 0x00, |
|
35 EMRMainAreaTextColor = 0x01, |
|
36 EMRCutCopyPasteHighlightColor, |
|
37 EMRCopiedTextColor, |
|
38 EMRNaviPaneText, |
|
39 EMRPredictiveSearchPopUpBgColor, |
|
40 EMRMainAreaTextColorDimmed, |
|
41 EMRLastColorItemId = 0x200 // Always last item in the list |
|
42 }; |
|
43 |
|
44 class TMRColorStruct |
|
45 { |
|
46 public: |
|
47 TMRColorStruct() : |
|
48 iColorIndex( 0 ) |
|
49 { iColorGroup.iMajor = 0; iColorGroup.iMinor = 0; } |
|
50 |
|
51 public: // Data |
|
52 TAknsItemID iColorGroup; |
|
53 TInt iColorIndex; |
|
54 }; |
|
55 |
|
56 /** |
|
57 * Converts logical TMRColorId to internal TMRColorStruct |
|
58 * which contains the correct color group and color id |
|
59 * |
|
60 * @param aColorId Logical color id. |
|
61 * @return TMRColorStruct Contains color group and color id. |
|
62 */ |
|
63 IMPORT_C TMRColorStruct GetColorStruct( TMRColorId aColorId ); |
|
64 |
|
65 /** |
|
66 * Returns correct Rgb color based on the given color enumeration |
|
67 * |
|
68 * @param aColorId Logical color id. |
|
69 * @return TRgb The Rgb color based on the logical color id |
|
70 */ |
|
71 IMPORT_C TRgb Color( TMRColorId aColorId ); |
|
72 |
|
73 /** |
|
74 * Sets font color based on the given color id for the given coecontrol |
|
75 * |
|
76 * @param aControl The control for which the color is set to. |
|
77 * @param aColorId Logical color id. |
|
78 */ |
|
79 IMPORT_C void SetColor( CCoeControl& aControl, TMRColorId aColorId ); |
|
80 |
|
81 /** |
|
82 * Sets font color based on the given color id for the given CEikTTimeEditor |
|
83 * |
|
84 * @param aEditor The control for which the color is set to. |
|
85 * @param aColorId Logical color id. |
|
86 */ |
|
87 IMPORT_C void SetColor( CEikTTimeEditor& aEditor, TMRColorId aColorId ); |
|
88 } |
|
89 |
|
90 #endif // NMRCOLORMANAGER_H |