|
1 /* |
|
2 * Copyright (c) 2007 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: Drop shadow brush |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_ALFDROPSHADOWBRUSH_H |
|
21 #define C_ALFDROPSHADOWBRUSH_H |
|
22 |
|
23 #include <alf/alfbrush.h> |
|
24 |
|
25 class CAlfEnv; |
|
26 struct TAlfMetric; |
|
27 class TRgb; |
|
28 |
|
29 /** |
|
30 * Drop shadow brush. |
|
31 * Drop shadow brush draws a shadow to a configurable depth. |
|
32 * Usage: |
|
33 * @code |
|
34 * // Creates a drop shadow brush and adds it to a visual. |
|
35 * CAlfDropShadowBrush* dropShadowBrush = CAlfDropShadowBrush::NewL( *iEnv, TAlfMetric(5) ); |
|
36 * visualWithBorders->EnableBrushesL(); |
|
37 * visualWithBorders->Brushes()->AppendL( dropShadowBrush, EAlfHasOwnership ) |
|
38 * //Cleanup |
|
39 * dropShadowBrush = 0; // ownership transferred to the brush array |
|
40 * @endcode |
|
41 * @lib alfclient.dll |
|
42 * @since S60 v3.2 |
|
43 */ |
|
44 NONSHARABLE_CLASS( CAlfDropShadowBrush ): public CAlfBrush |
|
45 { |
|
46 |
|
47 public: |
|
48 |
|
49 /** |
|
50 * Constructor. |
|
51 * @param aEnv Environment |
|
52 * @param aDepth Shadow depth in metric units. |
|
53 */ |
|
54 IMPORT_C static CAlfDropShadowBrush* NewL( |
|
55 CAlfEnv& aEnv, |
|
56 const TAlfMetric& aDepth ); |
|
57 |
|
58 /** |
|
59 * Constructor. The new brush is left on the cleanup stack. |
|
60 * @param aEnv Environment |
|
61 * @param aDepth Shadow depth in metric units. |
|
62 */ |
|
63 IMPORT_C static CAlfDropShadowBrush* NewLC( |
|
64 CAlfEnv& aEnv, |
|
65 const TAlfMetric& aDepth ); |
|
66 |
|
67 /** |
|
68 * Constructor. |
|
69 * @deprecated |
|
70 * @param aEnv Environment |
|
71 * @param aDepth Shadow depth in pixels. |
|
72 */ |
|
73 IMPORT_C static CAlfDropShadowBrush* NewL( |
|
74 CAlfEnv& aEnv, |
|
75 TInt aDepth ); |
|
76 |
|
77 /** |
|
78 * Constructor. The new brush is left on the cleanup stack. |
|
79 * @deprecated |
|
80 * @param aEnv Environment |
|
81 * @param aDepth Shadow depth in pixels. |
|
82 */ |
|
83 IMPORT_C static CAlfDropShadowBrush* NewLC( |
|
84 CAlfEnv& aEnv, |
|
85 TInt aDepth ); |
|
86 |
|
87 /** |
|
88 * Destructor. |
|
89 */ |
|
90 virtual ~CAlfDropShadowBrush(); |
|
91 |
|
92 /** |
|
93 * Gets minimum width of soft edges. |
|
94 * @return Shadow minumum width magnitude in current metric units. |
|
95 */ |
|
96 IMPORT_C const TAlfTimedValue& Softness() const; |
|
97 |
|
98 /** |
|
99 * Sets minimum width of soft edges. |
|
100 * @param aSoftness Shadow minumum width magnitude in current metric units. |
|
101 */ |
|
102 IMPORT_C void SetSoftness( const TAlfTimedValue& aSoftness ); |
|
103 |
|
104 /** |
|
105 * Sets minimum width of soft edges. |
|
106 * @param aDepth Shadow depth in metric units. |
|
107 */ |
|
108 IMPORT_C void SetSoftness(const TAlfMetric& aSoftness); |
|
109 |
|
110 /** |
|
111 * Gets shadow depth. |
|
112 * @return Shadow depth in current metric units. |
|
113 */ |
|
114 IMPORT_C const TAlfTimedValue& Depth() const; |
|
115 |
|
116 /** |
|
117 * Sets shadow depth. |
|
118 * @param aDepth Shadow depth magnitude in current metric units. |
|
119 */ |
|
120 IMPORT_C void SetDepth( const TAlfTimedValue& aDepth ); |
|
121 |
|
122 /** |
|
123 * Sets shadow depth. |
|
124 * @param aDepth Shadow depth in metric units. |
|
125 */ |
|
126 IMPORT_C void SetDepth(const TAlfMetric& aDepth); |
|
127 |
|
128 /** |
|
129 * Sets shadow color. |
|
130 * @param aColor Shadow color. |
|
131 */ |
|
132 IMPORT_C void SetColor(const TRgb& aColor); |
|
133 |
|
134 private: |
|
135 |
|
136 |
|
137 CAlfDropShadowBrush(); |
|
138 |
|
139 void ConstructL( CAlfEnv& aEnv, TInt aDepth ); |
|
140 |
|
141 void ConstructL( CAlfEnv& aEnv, const TAlfMetric& aDepth ); |
|
142 |
|
143 private: |
|
144 |
|
145 struct TDropShadowPrivateData; |
|
146 TDropShadowPrivateData* iDropShadowData; |
|
147 |
|
148 }; |
|
149 |
|
150 |
|
151 |
|
152 #endif // C_ALFDROPSHADOWBRUSH_H |