|
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: Model interface with utilities for slider widget. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef I_MULSLIDERMODEL_H |
|
20 #define I_MULSLIDERMODEL_H |
|
21 |
|
22 |
|
23 //WidgetModel Includes |
|
24 #include <alf/ialfmodel.h> |
|
25 #include <mul/mulvisualitem.h> |
|
26 //#include <mul/imulsliderwidget.h> |
|
27 |
|
28 using namespace osncore; |
|
29 |
|
30 namespace Alf |
|
31 { |
|
32 |
|
33 enum sliderTemplate |
|
34 { |
|
35 ESliderTemplate1, |
|
36 ESliderTemplate2, |
|
37 ESliderTemplate3, |
|
38 ESliderTemplate4, |
|
39 ESliderTemplate5, |
|
40 ESliderTemplate6, |
|
41 ESliderTemplate7, |
|
42 ESliderTemplate8, |
|
43 ESliderTemplate9, |
|
44 ESliderTemplateNone |
|
45 }; |
|
46 namespace mulslidermodel |
|
47 { |
|
48 static const IfId ident = |
|
49 { |
|
50 0, "mulslidermodel" |
|
51 }; |
|
52 } |
|
53 |
|
54 /** |
|
55 * An interface of the slider model. |
|
56 */ |
|
57 class IMulSliderModel : public IAlfModel |
|
58 { |
|
59 |
|
60 public: |
|
61 |
|
62 /** |
|
63 * Getter for the type identifier of this interface. |
|
64 * |
|
65 * @return A descriptor to identify the type of this interface. |
|
66 */ |
|
67 static inline const IfId& type() |
|
68 { |
|
69 return mulslidermodel::ident; |
|
70 } |
|
71 |
|
72 /** |
|
73 * Change slider related attributes within the model. |
|
74 * |
|
75 * @param aSliderItem Slider data to be changed. |
|
76 * |
|
77 */ |
|
78 virtual void SetData(const MulVisualItem& aSliderItem) = 0; |
|
79 |
|
80 /** |
|
81 * Return a collection of all the slider attributes. |
|
82 * |
|
83 * @return A visual item containing the slider attributes. |
|
84 */ |
|
85 virtual const MulVisualItem& Data() const = 0; |
|
86 |
|
87 /** |
|
88 * Set the value of the primary thumb. |
|
89 * |
|
90 * @param aValue Position of the primary thumb. |
|
91 * |
|
92 */ |
|
93 virtual void SetPrimaryValue(int aValue) = 0; |
|
94 |
|
95 /** |
|
96 * Return the value of the primary thumb of the slider. |
|
97 * |
|
98 * @return Value of the primary thumb. |
|
99 * |
|
100 */ |
|
101 virtual int PrimaryValue() const = 0; |
|
102 |
|
103 /** |
|
104 * Set the value of the secondary thumb. |
|
105 * |
|
106 * @param aValue Position of the secondary thumb. |
|
107 * |
|
108 */ |
|
109 virtual void SetSecondaryValue(int aValue) = 0; |
|
110 |
|
111 /** |
|
112 * Return the value of the secondary thumb of the slider. |
|
113 * |
|
114 * @return Value of the secondary thumb. |
|
115 * |
|
116 */ |
|
117 virtual int SecondaryValue() const = 0; |
|
118 |
|
119 /** |
|
120 * Return the total number of ticks. |
|
121 * |
|
122 * @return Number of ticks (int) |
|
123 * |
|
124 */ |
|
125 virtual int TotalTicks() const = 0; |
|
126 |
|
127 |
|
128 /** |
|
129 * Set Template that will be used to represent data. |
|
130 * |
|
131 * @param aTemplateId Template associated with the widget. |
|
132 * |
|
133 */ |
|
134 |
|
135 virtual void SetTemplate( sliderTemplate aTemplateId) = 0; |
|
136 /** |
|
137 * Get Template that will be used to represent data. |
|
138 * |
|
139 * @param aTemplateId Template associated with the widget. |
|
140 * |
|
141 */ |
|
142 virtual sliderTemplate GetTemplate() = 0; |
|
143 /** |
|
144 * API to set text on the right side of Slider. |
|
145 * |
|
146 * @param aRightText - Text that has to be Displayed. |
|
147 * |
|
148 */ |
|
149 |
|
150 virtual void SetRightText(char* aRightText) = 0; |
|
151 /** |
|
152 * API to Get text on the right side of Slider. |
|
153 * |
|
154 */ |
|
155 |
|
156 virtual const char* GetRightText() = 0; |
|
157 /** |
|
158 * API to set text on the Left side of Slider. |
|
159 * |
|
160 * @param aLeftText - Text that has to be Displayed. |
|
161 * |
|
162 */ |
|
163 |
|
164 virtual void SetLeftText(char* aLeftText) = 0; |
|
165 /** |
|
166 * API to Get text on the Left side of Slider. |
|
167 * |
|
168 */ |
|
169 virtual const char* GetLeftText() = 0; |
|
170 /** |
|
171 * API to set the Percentage of Slider movement on Track. |
|
172 * |
|
173 * @param aPercText - Text that has to be Displayed. |
|
174 * |
|
175 */ |
|
176 virtual void SetPercentText(char* aPercText) = 0; |
|
177 /** |
|
178 * API to indicate the percentage movement of Thumb on Track. |
|
179 * |
|
180 */ |
|
181 virtual const char* GetPercentText() = 0; |
|
182 /** |
|
183 * API to set the Minimum value of Track. |
|
184 * |
|
185 * @param aMinRange - Minimum value for the start of the track. |
|
186 * |
|
187 */ |
|
188 virtual void SetMinRange(int aMinRange) = 0; |
|
189 /** |
|
190 * API to retrieve the Minimum value of Track. |
|
191 * |
|
192 */ |
|
193 virtual int MinRange()const = 0; |
|
194 /** |
|
195 * API to set the Maximum value of Track. |
|
196 * |
|
197 * @param aMaxRange - Maximum value for the start of the track. |
|
198 * |
|
199 */ |
|
200 virtual void SetMaxRange(int aMaxRange) = 0; |
|
201 /** |
|
202 * API to retrieve the Maximum value of Track. |
|
203 * |
|
204 */ |
|
205 |
|
206 virtual int MaxRange()const = 0; |
|
207 /** |
|
208 * API to set Tick value for Slider. |
|
209 * |
|
210 * @param aTick - Interger value for representing the tick. |
|
211 * |
|
212 */ |
|
213 virtual void SetTick(int aTick) = 0; |
|
214 /** |
|
215 * API to retrieve the tick value. |
|
216 * |
|
217 */ |
|
218 virtual int Tick()const = 0; |
|
219 }; |
|
220 |
|
221 } // namespace Alf |
|
222 |
|
223 #endif // I_MULSLIDERMODEL_H |
|
224 //End Of File |