|
1 /* |
|
2 * Copyright (c) 2008 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_ALFEXSTICKER_H |
|
21 #define C_ALFEXSTICKER_H |
|
22 |
|
23 |
|
24 /* Includes */ |
|
25 |
|
26 #include <alf/alfcontrol.h> |
|
27 #include "alfexstickerscontrol.h" |
|
28 |
|
29 |
|
30 /* Forward declarations. */ |
|
31 |
|
32 |
|
33 /* Constants */ |
|
34 const TInt KStickerHeight = 300; |
|
35 const TInt KStickerWidth = 300; |
|
36 |
|
37 |
|
38 /** |
|
39 * @class CAlfExStickerLayout |
|
40 * @discussion Wrapper class for the deck layout, text visuals and some brushes. |
|
41 * Is used to create Stickers from the combination of those. |
|
42 * Handles placement, content and outlook of the sticker text visuals. |
|
43 * Should probable rename the class for clarity |
|
44 */ |
|
45 class CAlfExStickerLayout : public CAlfDeckLayout |
|
46 { |
|
47 public: |
|
48 |
|
49 /* Constructors and destructor. */ |
|
50 |
|
51 /** |
|
52 * @function NewL |
|
53 * @discussion Constructs a new CAlfExStickerLayout class instance. A static factory method. |
|
54 * @param aControl Control class for the AlfExSticker application. |
|
55 * @param aEnv UI Accelerator Toolkit environment object. |
|
56 * @result Instance of AlfExSticker |
|
57 */ |
|
58 static CAlfExStickerLayout* NewL(CAlfExStickersControl& aControl, CAlfEnv& aEnv); |
|
59 |
|
60 /** |
|
61 * @function ~CAlfExStickerLayout |
|
62 * @discussion Destructor |
|
63 */ |
|
64 virtual ~CAlfExStickerLayout(); |
|
65 |
|
66 |
|
67 /* Methods. */ |
|
68 |
|
69 /** |
|
70 * @function SetStickerPlace |
|
71 * @discussion Used to place sticker on the layout. |
|
72 * @todo Maybe make the placement more dynamic |
|
73 */ |
|
74 void SetStickerPlaceL(CAlfExStickersControl* aControl); |
|
75 |
|
76 /** |
|
77 * @function SetStickerTextContentL |
|
78 * @discussion Used to set textual content of the sticker, |
|
79 * or more specific content of the included text visual. |
|
80 * Also configures font, color and placement of the textual content |
|
81 * @todo Maybe make the content input more dynamic |
|
82 */ |
|
83 void SetStickerTextContentL(); |
|
84 |
|
85 /** |
|
86 * @function SetStickerDropShadowBrushL |
|
87 * @discussion Enables brushes for sticker and then add drop shadow brush for the sticker. |
|
88 * @todo Add drop shadow also in to other sides in lesser quanity, that way stickers are more |
|
89 * easile recognizable. |
|
90 */ |
|
91 void SetStickerDropShadowBrushL(); |
|
92 |
|
93 /** |
|
94 * @function SetStickerImageBrushL |
|
95 * @discussion Add sticker background image by using an image brush. |
|
96 * @note EnableBrushes() must be called before using any brushes, we did this already in |
|
97 * SetStickerDropShadowBrushL(). |
|
98 * @todo Sticker needs to implement changing backgrounds in the future. |
|
99 * @param aTexture Texture that is placed for image brush. |
|
100 */ |
|
101 void SetStickerImageBrushL(CAlfTexture& aTexture); |
|
102 |
|
103 /** |
|
104 * @function GetVisual |
|
105 * @discussion Returns the text visual used in sticker. |
|
106 * @result Returns text visual |
|
107 */ |
|
108 CAlfVisual* GetVisual(); |
|
109 |
|
110 /** |
|
111 * @function ChangeStickerSize |
|
112 * @discussion Scales text visual and resizes the deck layout |
|
113 * Is called when user taps on a sticker to zoom in or out. |
|
114 */ |
|
115 void ChangeStickerSizeL(); |
|
116 |
|
117 |
|
118 private: |
|
119 |
|
120 /* Constructors and destructor. */ |
|
121 |
|
122 /** |
|
123 * Constructs an instance of CAlfExStickerLayout. |
|
124 * @note Protected because this constructor only needs to be called by |
|
125 * derived classes. Use the provided static factory methods instead. |
|
126 * @see NewL() |
|
127 * @see NewLC() |
|
128 */ |
|
129 CAlfExStickerLayout(); |
|
130 |
|
131 /** |
|
132 * @function ConstructL |
|
133 * @discussion Second phase constructor |
|
134 * @param aControl Control class for the AlfExSticker application. |
|
135 * @param aEnv UI Accelerator Toolkit environment object. |
|
136 */ |
|
137 void ConstructL(CAlfExStickersControl& aControl, CAlfEnv& aEnv); |
|
138 |
|
139 |
|
140 /* Member variables */ |
|
141 |
|
142 //UI Accelerator Toolkit environment object |
|
143 CAlfEnv* iEnv; |
|
144 |
|
145 //AlfExSticker Control |
|
146 CAlfExStickersControl* iControl; |
|
147 |
|
148 //Text visual |
|
149 CAlfTextVisual* iTextVisual; |
|
150 |
|
151 //Helps to determine current size/scale |
|
152 TBool iStickerIsLarge; |
|
153 |
|
154 }; |
|
155 |
|
156 #endif // C_ALFEXSTICKER_H |