|
1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef COLORSELECTIONGRID_H |
|
21 #define COLORSELECTIONGRID_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <akngrid.h> |
|
25 |
|
26 |
|
27 /* CLASS: CColorSelectionGrid |
|
28 * |
|
29 * CColorSelectionGrid represents a color selection grid control in |
|
30 * Nokia Still Image Editor. |
|
31 */ |
|
32 class CColorSelectionGrid : public CAknGrid |
|
33 { |
|
34 |
|
35 public: |
|
36 |
|
37 /** @name Methods:*/ |
|
38 //@{ |
|
39 |
|
40 /** Default constructor |
|
41 * |
|
42 * @param aParent - parent control |
|
43 * @param aFlags - grid flags |
|
44 * @return - |
|
45 */ |
|
46 IMPORT_C CColorSelectionGrid (); |
|
47 |
|
48 /** Destructor |
|
49 * |
|
50 * @param - |
|
51 * @return - |
|
52 */ |
|
53 IMPORT_C virtual ~CColorSelectionGrid (); |
|
54 |
|
55 /** Second phase constructor |
|
56 * |
|
57 * @param aParent - parent control |
|
58 * @param aFlags - grid flags |
|
59 * @return - |
|
60 */ |
|
61 IMPORT_C virtual void ConstructL ( |
|
62 const CCoeControl * aParent, |
|
63 TInt aFlags |
|
64 ); |
|
65 |
|
66 |
|
67 //@} |
|
68 |
|
69 protected: |
|
70 |
|
71 /** @name Methods:*/ |
|
72 //@{ |
|
73 |
|
74 /* SizeChanged |
|
75 * |
|
76 * @see CImageEditorControlBase |
|
77 */ |
|
78 IMPORT_C virtual void SizeChanged(); |
|
79 |
|
80 //@} |
|
81 |
|
82 /** @name Members:*/ |
|
83 //@{ |
|
84 |
|
85 //@} |
|
86 |
|
87 private: |
|
88 |
|
89 /** @name Methods:*/ |
|
90 //@{ |
|
91 |
|
92 /* SetupGridIconsL |
|
93 * |
|
94 * Sets up grid icons. |
|
95 * |
|
96 * @param - |
|
97 * @return - |
|
98 */ |
|
99 void SetupGridIconsL (); |
|
100 |
|
101 /* SetupGrid |
|
102 * |
|
103 * Sets up grid every time the grid size changes. |
|
104 * |
|
105 * @param - |
|
106 * @return - |
|
107 */ |
|
108 void SetupGrid(); |
|
109 |
|
110 /* HSLtoRGB |
|
111 * |
|
112 * HSL to RGB color conversion |
|
113 * |
|
114 * @param aH - hue [0.0 - 360.0] |
|
115 * @param aS - saturation [0.0 - 1.0] |
|
116 * @param aL - luminance [0.0 - 1.0] |
|
117 * @return TRgb |
|
118 */ |
|
119 TRgb HSLtoRGB ( |
|
120 const TReal aH, |
|
121 const TReal aS, |
|
122 const TReal aL |
|
123 ) const; |
|
124 |
|
125 /* ToRGB |
|
126 * |
|
127 * Helper function in color conversion. |
|
128 * |
|
129 * @param aRM1 - helper variable |
|
130 * @param aRM2 - helper variable |
|
131 * @param aRH - helper variable |
|
132 * @return TInt |
|
133 */ |
|
134 TInt ToRGB ( |
|
135 TReal aRM1, |
|
136 TReal aRM2, |
|
137 TReal aRH |
|
138 ) const; |
|
139 |
|
140 /** Copy constructor, disabled |
|
141 */ |
|
142 CColorSelectionGrid (const CColorSelectionGrid & rhs); |
|
143 |
|
144 /** Assignment operator, disabled |
|
145 */ |
|
146 CColorSelectionGrid & operator= (const CColorSelectionGrid & rhs); |
|
147 |
|
148 //@} |
|
149 |
|
150 private: |
|
151 |
|
152 /** @name Members:*/ |
|
153 //@{ |
|
154 TSize iGridSize; |
|
155 TSize iIconSize; |
|
156 //@} |
|
157 |
|
158 }; |
|
159 |
|
160 |
|
161 #endif // EOF ColorSelectionGrid.h |