85
|
1 |
/*
|
|
2 |
* Copyright (c) 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: caentry.cpp
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <QSharedDataPointer>
|
|
19 |
#include <QDebug>
|
86
|
20 |
#include <HbIcon>
|
85
|
21 |
|
|
22 |
#include "caentry.h"
|
|
23 |
#include "caentry_p.h"
|
|
24 |
#include "caobjectadapter.h"
|
87
|
25 |
#include "caiconcache.h"
|
|
26 |
#include "caclienttest_global.h"
|
92
|
27 |
#include "camenuiconutility.h"
|
85
|
28 |
|
|
29 |
|
|
30 |
// ======== MEMBER FUNCTIONS ========
|
|
31 |
|
|
32 |
/*!
|
93
|
33 |
\class CaEntry
|
|
34 |
\brief This abstract class describes particular entry.
|
|
35 |
To create instance of CaEntry object, you have to use service's object's
|
|
36 |
createEntry() method.
|
|
37 |
\example
|
|
38 |
\code
|
|
39 |
QSharedPointer<CaService> service = CaService::instance();
|
|
40 |
// default you create item (ItemEntryRole)
|
|
41 |
CaEntry entry;
|
|
42 |
// to create CaEntry invoking setText() and setEntryTypeName() methods
|
|
43 |
is obligatoried
|
|
44 |
entry.setText("Text");
|
|
45 |
entry.setEntryTypeName("TypeName");
|
|
46 |
CaEntry * resultEntry = service->createEntry(entry);
|
|
47 |
...
|
|
48 |
delete resultEntry;
|
|
49 |
...
|
|
50 |
// if you want create group, you should use entry role parametr
|
|
51 |
CaEntry entryGroup(GroupEntryRole);
|
|
52 |
...
|
|
53 |
resultEntry = service->createEntry(entryGroup);
|
|
54 |
\endcode
|
85
|
55 |
*/
|
|
56 |
|
|
57 |
/*!
|
93
|
58 |
\var CaEntryPrivate::m_q
|
|
59 |
Points to the CaEntry instance that uses
|
|
60 |
this private implementation.
|
|
61 |
*/
|
|
62 |
|
|
63 |
/*!
|
|
64 |
\var CaEntryPrivate::mId
|
|
65 |
Id.
|
|
66 |
*/
|
|
67 |
|
|
68 |
/*!
|
|
69 |
Constructor.
|
|
70 |
\param entryRole entry's role.
|
85
|
71 |
*/
|
|
72 |
CaEntry::CaEntry(EntryRole entryRole) :
|
|
73 |
m_d(new CaEntryPrivate(this))
|
|
74 |
{
|
|
75 |
m_d->setRole(entryRole);
|
|
76 |
}
|
|
77 |
|
|
78 |
/*!
|
93
|
79 |
Copy constructor.
|
|
80 |
\param entry const reference to CaEntry.
|
|
81 |
\code
|
|
82 |
...
|
|
83 |
CaEntry * copyEntry( *resultEntry );
|
|
84 |
\endcode
|
85
|
85 |
*/
|
|
86 |
CaEntry::CaEntry(const CaEntry &entry) :
|
|
87 |
m_d(new CaEntryPrivate(this))
|
|
88 |
{
|
|
89 |
*m_d = *(entry.m_d);
|
|
90 |
}
|
|
91 |
|
|
92 |
/*!
|
|
93 |
Copy assignment operator.
|
|
94 |
\param entry const reference to CaEntry.
|
|
95 |
|
|
96 |
\retval reference to CaEntry.
|
|
97 |
|
|
98 |
\code
|
|
99 |
...
|
|
100 |
CaEntry * copyEntry;
|
|
101 |
copyEntry = resultEntry;
|
|
102 |
\endcode
|
|
103 |
*/
|
|
104 |
CaEntry &CaEntry::operator=(const CaEntry &entry)
|
|
105 |
{
|
|
106 |
if (this != &entry) {
|
|
107 |
m_d = entry.m_d;
|
|
108 |
}
|
|
109 |
return *this;
|
|
110 |
}
|
|
111 |
|
|
112 |
/*!
|
|
113 |
Destructor.
|
|
114 |
*/
|
|
115 |
CaEntry::~CaEntry()
|
|
116 |
{
|
|
117 |
|
|
118 |
}
|
|
119 |
|
|
120 |
/*!
|
|
121 |
Returns item id.
|
|
122 |
\retval item id.
|
|
123 |
|
|
124 |
\code
|
|
125 |
...
|
|
126 |
// after create entry, we can get entry's id
|
|
127 |
resultEntry = service->createEntry(entry);
|
|
128 |
int entryId = resultEntry->id();
|
|
129 |
...
|
|
130 |
\endcode
|
|
131 |
*/
|
|
132 |
int CaEntry::id() const
|
|
133 |
{
|
|
134 |
return m_d->id();
|
|
135 |
}
|
|
136 |
|
|
137 |
/*!
|
|
138 |
Returns item name.
|
|
139 |
\retval name of the item.
|
|
140 |
|
|
141 |
\code
|
|
142 |
...
|
|
143 |
QString entryText = resultEntry->text();
|
|
144 |
...
|
|
145 |
\endcode
|
|
146 |
*/
|
|
147 |
QString CaEntry::text() const
|
|
148 |
{
|
|
149 |
return m_d->text();
|
|
150 |
}
|
|
151 |
|
|
152 |
/*!
|
|
153 |
Sets name of the item.
|
|
154 |
\param text new name of the item.
|
|
155 |
|
|
156 |
\code
|
|
157 |
...
|
|
158 |
QString entryText( QString("EntryText") );
|
|
159 |
resultEntry->setText( entryText);
|
|
160 |
...
|
|
161 |
\endcode
|
|
162 |
*/
|
|
163 |
void CaEntry::setText(const QString &text)
|
|
164 |
{
|
|
165 |
m_d->setText(text);
|
|
166 |
}
|
|
167 |
|
|
168 |
/*!
|
|
169 |
Returns item description.
|
|
170 |
\retval description of the item.
|
|
171 |
|
|
172 |
\code
|
|
173 |
...
|
|
174 |
QString entryDescription = resultEntry->description();
|
|
175 |
...
|
|
176 |
\endcode
|
|
177 |
*/
|
|
178 |
QString CaEntry::description() const
|
|
179 |
{
|
|
180 |
return m_d->description();
|
|
181 |
}
|
|
182 |
|
|
183 |
/*!
|
|
184 |
Sets description of the item.
|
|
185 |
\param new description of the item.
|
|
186 |
|
|
187 |
\code
|
|
188 |
...
|
|
189 |
QString entryDescription( QString("EntryDescription") );
|
|
190 |
resultEntry->entryDescription(entryDescription);
|
|
191 |
...
|
|
192 |
\endcode
|
|
193 |
*/
|
|
194 |
void CaEntry::setDescription(const QString &description)
|
|
195 |
{
|
|
196 |
m_d->setDescription(description);
|
|
197 |
}
|
|
198 |
|
|
199 |
/*!
|
|
200 |
Returns copy of icon description of the entry.
|
|
201 |
\retval icon Description (CaIconDescription).
|
|
202 |
|
|
203 |
\code
|
|
204 |
...
|
|
205 |
CaIconDescription iconDesc;
|
|
206 |
iconDesc.setBitmapId(5555);
|
|
207 |
iconDesc.setFilename(QString("fileName"));
|
|
208 |
iconDesc.setMaskId(5556);
|
|
209 |
iconDesc.setSkinMajorId(5557);
|
|
210 |
iconDesc.setSkinMinorId(5558);
|
|
211 |
|
|
212 |
resultEntry->setIconDescription( iconDesc );
|
|
213 |
|
|
214 |
CaIconDescription entryIcon;
|
|
215 |
entryIcon = resultEntry->iconDescription();
|
|
216 |
...
|
|
217 |
\b Output:
|
|
218 |
iconDesc == entryIcon
|
|
219 |
|
|
220 |
\endcode
|
|
221 |
*/
|
|
222 |
CaIconDescription CaEntry::iconDescription() const
|
|
223 |
{
|
|
224 |
return m_d->iconDescription();
|
|
225 |
}
|
|
226 |
|
|
227 |
/*!
|
|
228 |
Sets icon description
|
|
229 |
\param iconDescription const reference to CaIconDescription
|
|
230 |
|
|
231 |
\code
|
|
232 |
...
|
|
233 |
CaIconDescription iconDesc;
|
|
234 |
iconDesc.setBitmapId(5555);
|
|
235 |
iconDesc.setFilename(QString("fileName"));
|
|
236 |
iconDesc.setMaskId(5556);
|
|
237 |
iconDesc.setSkinMajorId(5557);
|
|
238 |
iconDesc.setSkinMinorId(5558);
|
|
239 |
|
|
240 |
resultEntry->setIconDescription( iconDesc );
|
|
241 |
...
|
|
242 |
\b Output:
|
|
243 |
iconDesc == resultEntry->iconDescription();
|
|
244 |
|
|
245 |
\endcode
|
|
246 |
*/
|
|
247 |
void CaEntry::setIconDescription(const CaIconDescription &iconDescription)
|
|
248 |
{
|
|
249 |
m_d->setIconDescription(iconDescription);
|
|
250 |
}
|
|
251 |
|
|
252 |
/*!
|
|
253 |
Returns items flags.
|
|
254 |
\retval flags.
|
|
255 |
|
|
256 |
\code
|
|
257 |
...
|
|
258 |
TUint flags = contentarsenal::RemovableEntryFlag
|
|
259 |
|contentarsenal::VisibleEntryFlag;
|
|
260 |
resultEntry->setFlags( flags );
|
|
261 |
|
|
262 |
EntryFlags entryFlags = resultEntry->flags();
|
|
263 |
|
|
264 |
\b Output:
|
|
265 |
flags == entryFlags
|
|
266 |
|
|
267 |
\endcode
|
|
268 |
*/
|
|
269 |
EntryFlags CaEntry::flags() const
|
|
270 |
{
|
|
271 |
return m_d->flags();
|
|
272 |
}
|
|
273 |
|
|
274 |
/*!
|
|
275 |
Sets flags.
|
|
276 |
\param flags entry flags.
|
|
277 |
|
|
278 |
\code
|
|
279 |
...
|
|
280 |
TUint flags = contentarsenal::RemovableEntryFlag
|
|
281 |
|contentarsenal::VisibleEntryFlag;
|
|
282 |
resultEntry->setFlags( flags );
|
|
283 |
...
|
|
284 |
\endcode
|
|
285 |
*/
|
|
286 |
void CaEntry::setFlags(EntryFlags flags)
|
|
287 |
{
|
|
288 |
m_d->setFlags(flags);
|
|
289 |
}
|
|
290 |
|
|
291 |
/*!
|
|
292 |
Returns a name of an entry type.
|
|
293 |
\retval name of entry type.
|
|
294 |
|
|
295 |
\code
|
|
296 |
CaEntry entry;
|
|
297 |
entry.setText( "Text" );
|
|
298 |
entry.setEntryTypeName( "TypeName" );
|
|
299 |
CaEntry * resultEntry = service->createEntry( entry );
|
|
300 |
|
|
301 |
QString entryTypeName = resultEntry->entryTypeName();
|
|
302 |
\b Output:
|
|
303 |
entryTypeName == "TypeName"
|
|
304 |
|
|
305 |
\endcode
|
|
306 |
*/
|
|
307 |
QString CaEntry::entryTypeName() const
|
|
308 |
{
|
|
309 |
return m_d->entryTypeName();
|
|
310 |
}
|
|
311 |
|
|
312 |
/*!
|
|
313 |
Sets name of entry type.
|
|
314 |
\param entryTypeName name of entry type (const reference).
|
|
315 |
|
|
316 |
\code
|
|
317 |
...
|
|
318 |
resultEntry->setEntryTypeName("EntryTypeName");
|
|
319 |
|
|
320 |
\b Output:
|
|
321 |
resultEntry->entryTypeName == "EntryTypeName"
|
|
322 |
|
|
323 |
\endcode
|
|
324 |
*/
|
|
325 |
void CaEntry::setEntryTypeName(const QString &entryTypeName)
|
|
326 |
{
|
|
327 |
m_d->setEntryTypeName(entryTypeName);
|
|
328 |
}
|
|
329 |
|
|
330 |
/*!
|
|
331 |
Returns item attributes.
|
|
332 |
\retval map of attributes indexed by their names.
|
|
333 |
|
|
334 |
\code
|
|
335 |
...
|
|
336 |
QString attrName_1( "name_1" );
|
|
337 |
QString attrValue_1( "value_1" );
|
|
338 |
QString attrName_2( "name_2" );
|
|
339 |
QString attrValue_2( "value_2" );
|
|
340 |
resultEntry->setAttribute( attrName_1, attrValue_1 );
|
|
341 |
resultEntry->setAttribute( attrName_2, attrValue_2 );
|
|
342 |
...
|
|
343 |
QMap<QString, QString> attrMap = entryAttrValue = resultEntry->attributes();
|
|
344 |
|
|
345 |
\b Output:
|
|
346 |
attrMap[0] == name: name_1, value: value_1
|
|
347 |
attrMap[1] == name: name_2, value: value_2
|
|
348 |
|
|
349 |
\endcode
|
|
350 |
*/
|
|
351 |
QMap<QString, QString> CaEntry::attributes() const
|
|
352 |
{
|
|
353 |
return m_d->attributes();
|
|
354 |
}
|
|
355 |
|
|
356 |
/*!
|
|
357 |
\param name name of an attribute
|
|
358 |
\retval value of attribute
|
|
359 |
|
|
360 |
\code
|
|
361 |
...
|
|
362 |
QString attrName_1( "name_1" );
|
|
363 |
QString attrValue_1( "value_1" );
|
|
364 |
QString attrName_2( "name_2" );
|
|
365 |
QString attrValue_2( "value_2" );
|
|
366 |
resultEntry->setAttribute( attrName_1, attrValue_1 );
|
|
367 |
resultEntry->setAttribute( attrName_2, attrValue_2 );
|
|
368 |
...
|
|
369 |
QString entryAttrValue = resultEntry->attribute( attrName_1 );
|
|
370 |
|
|
371 |
\b Output:
|
|
372 |
entryAttrValue == "attrValue_1"
|
|
373 |
|
|
374 |
\endcode
|
|
375 |
*/
|
|
376 |
QString CaEntry::attribute(const QString &name) const
|
|
377 |
{
|
|
378 |
return m_d->attribute(name);
|
|
379 |
}
|
|
380 |
|
|
381 |
/*!
|
|
382 |
Sets attribute.
|
|
383 |
\param name name of an attribute.
|
|
384 |
\param value value of an attribute.
|
|
385 |
|
|
386 |
\code
|
|
387 |
...
|
|
388 |
QString attrName_1( "name_1" );
|
|
389 |
QString attrValue_1( "value_1" );
|
|
390 |
QString attrName_2( "name_2" );
|
|
391 |
QString attrValue_2( "value_2" );
|
|
392 |
resultEntry->setAttribute( attrName_1, attrValue_1 );
|
|
393 |
resultEntry->setAttribute( attrName_2, attrValue_2 );
|
|
394 |
|
|
395 |
\endcode
|
|
396 |
*/
|
|
397 |
void CaEntry::setAttribute(const QString &name, const QString &value)
|
|
398 |
{
|
|
399 |
m_d->setAttribute(name, value);
|
|
400 |
}
|
|
401 |
|
|
402 |
/*!
|
|
403 |
Creates an icon.
|
|
404 |
\param size icon size to display
|
86
|
405 |
\retval created icon (HbIcon).
|
85
|
406 |
|
|
407 |
\code
|
|
408 |
...
|
|
409 |
QSize iconSize( 50, 80 );
|
86
|
410 |
HbIcon icon = resultEntry->makeIcon( iconSize );
|
85
|
411 |
|
|
412 |
\b Output:
|
86
|
413 |
icon.width() == 50
|
|
414 |
icon.height() == 80
|
|
415 |
icon.size() == iconSize;
|
85
|
416 |
\endcode
|
|
417 |
*/
|
87
|
418 |
HbIcon CaEntry::makeIcon(const QSize &size) const
|
85
|
419 |
{
|
87
|
420 |
CACLIENTTEST_FUNC_ENTRY("CaEntry::makeIcon");
|
|
421 |
HbIcon icon;
|
|
422 |
if (CaIconCache::cache()->exist(*this,size)) {
|
|
423 |
icon = CaIconCache::cache()->icon(*this,size);
|
|
424 |
} else {
|
|
425 |
icon = m_d->makeIcon(size);
|
|
426 |
CaIconCache::cache()->insert(*this, size, icon);
|
|
427 |
}
|
|
428 |
CACLIENTTEST_FUNC_EXIT("CaEntry::makeIcon");
|
|
429 |
return icon;
|
85
|
430 |
}
|
|
431 |
|
|
432 |
/*!
|
|
433 |
Sets entry id.
|
|
434 |
\param id item id.
|
|
435 |
*/
|
|
436 |
void CaEntry::setId(int id)
|
|
437 |
{
|
|
438 |
m_d->setId(id);
|
|
439 |
}
|
|
440 |
/*!
|
|
441 |
Gets entry role.
|
|
442 |
\retval entry's role.
|
|
443 |
|
|
444 |
\code
|
|
445 |
CaEntry entry;
|
|
446 |
entry.setText("Text");
|
|
447 |
entry.setEntryTypeName("TypeName");
|
|
448 |
CaEntry * resultEntry = service->createEntry(entry);
|
|
449 |
|
|
450 |
EntryRole entryRole = resultEntry->role();
|
|
451 |
|
|
452 |
\b Output:
|
|
453 |
entryRole == ItemEntryRole
|
|
454 |
|
|
455 |
\endcode
|
|
456 |
|
|
457 |
\code
|
|
458 |
CaEntry entryGroup( GroupEntryRole );
|
|
459 |
entryGroup.setText("Text");
|
|
460 |
entryGroup.setEntryTypeName("TypeName");
|
|
461 |
CaEntry * resultGroup = service->createEntry(entryGroup);
|
|
462 |
EntryRole groupRole = resultGroup->role();
|
|
463 |
|
|
464 |
\b Output:
|
|
465 |
groupRole == GroupEntryRole
|
|
466 |
|
|
467 |
\endcode
|
|
468 |
*/
|
|
469 |
EntryRole CaEntry::role() const
|
|
470 |
{
|
|
471 |
return m_d->role();
|
|
472 |
}
|
|
473 |
|
|
474 |
|
|
475 |
/*
|
|
476 |
Constructor
|
|
477 |
\param entryPublic associated public entry
|
|
478 |
*/
|
|
479 |
CaEntryPrivate::CaEntryPrivate(CaEntry *entryPublic) :
|
87
|
480 |
m_q(entryPublic), mId(0), mText(), mDescription(), mIconDescription(),
|
85
|
481 |
mFlags(RemovableEntryFlag|VisibleEntryFlag),mEntryTypeName(),
|
92
|
482 |
mAttributes(), mEntryRole(ItemEntryRole)
|
85
|
483 |
{
|
|
484 |
}
|
|
485 |
/*!
|
|
486 |
Copy assignment operator.
|
|
487 |
\param entry const reference to CaEntryPrivate.
|
|
488 |
\retval reference to CaEntryPrivate.
|
|
489 |
*/
|
|
490 |
CaEntryPrivate &CaEntryPrivate::operator=(const CaEntryPrivate &entry)
|
|
491 |
{
|
|
492 |
mId = entry.mId;
|
|
493 |
mText = entry.mText;
|
|
494 |
mDescription = entry.mDescription;
|
|
495 |
mIconDescription = entry.mIconDescription;
|
|
496 |
mFlags = entry.mFlags;
|
|
497 |
mEntryTypeName = entry.mEntryTypeName;
|
|
498 |
mAttributes = entry.mAttributes;
|
|
499 |
mEntryRole = entry.mEntryRole;
|
|
500 |
return *this;
|
|
501 |
}
|
|
502 |
|
|
503 |
/*!
|
|
504 |
Destructor
|
|
505 |
*/
|
|
506 |
CaEntryPrivate::~CaEntryPrivate()
|
|
507 |
{
|
|
508 |
}
|
|
509 |
|
|
510 |
/*!
|
|
511 |
\retval item id
|
|
512 |
*/
|
|
513 |
int CaEntryPrivate::id() const
|
|
514 |
{
|
|
515 |
return mId;
|
|
516 |
}
|
|
517 |
|
|
518 |
/*!
|
|
519 |
\retval name of the item.
|
|
520 |
*/
|
|
521 |
QString CaEntryPrivate::text() const
|
|
522 |
{
|
|
523 |
return mText;
|
|
524 |
}
|
|
525 |
|
|
526 |
/*!
|
|
527 |
Sets name of the item.
|
|
528 |
\param text new name of the item.
|
|
529 |
*/
|
|
530 |
void CaEntryPrivate::setText(const QString &text)
|
|
531 |
{
|
|
532 |
mText = text;
|
|
533 |
}
|
|
534 |
|
|
535 |
/*!
|
|
536 |
\retval description of the item.
|
|
537 |
*/
|
|
538 |
QString CaEntryPrivate::description() const
|
|
539 |
{
|
|
540 |
return mDescription;
|
|
541 |
}
|
|
542 |
|
|
543 |
/*!
|
|
544 |
Sets description of the item.
|
|
545 |
\param text new name of the item.
|
|
546 |
*/
|
|
547 |
void CaEntryPrivate::setDescription(const QString &description)
|
|
548 |
{
|
|
549 |
mDescription = description;
|
|
550 |
}
|
|
551 |
|
|
552 |
/*!
|
|
553 |
\retval icon Description (CaIconDescription).
|
|
554 |
*/
|
|
555 |
CaIconDescription CaEntryPrivate::iconDescription() const
|
|
556 |
{
|
|
557 |
return mIconDescription;
|
|
558 |
}
|
|
559 |
|
|
560 |
/*!
|
|
561 |
Sets icon description
|
|
562 |
\param iconDescription const reference to CaIconDescription
|
|
563 |
*/
|
|
564 |
void CaEntryPrivate::setIconDescription(
|
|
565 |
const CaIconDescription &iconDescription)
|
|
566 |
{
|
|
567 |
mIconDescription = iconDescription;
|
|
568 |
}
|
|
569 |
|
|
570 |
/*!
|
|
571 |
\retval flags
|
|
572 |
*/
|
|
573 |
EntryFlags CaEntryPrivate::flags() const
|
|
574 |
{
|
|
575 |
return mFlags;
|
|
576 |
}
|
|
577 |
|
|
578 |
/*!
|
|
579 |
Sets flags.
|
|
580 |
\param flags entry flags.
|
|
581 |
*/
|
|
582 |
void CaEntryPrivate::setFlags(EntryFlags flags)
|
|
583 |
{
|
|
584 |
mFlags = flags;
|
|
585 |
}
|
|
586 |
|
|
587 |
/*!
|
|
588 |
\retval name of entry type.
|
|
589 |
*/
|
|
590 |
QString CaEntryPrivate::entryTypeName() const
|
|
591 |
{
|
|
592 |
return mEntryTypeName;
|
|
593 |
}
|
|
594 |
|
|
595 |
/*!
|
|
596 |
Sets name of entry type.
|
|
597 |
\param entryTypeName name of entry type (const reference)
|
|
598 |
*/
|
|
599 |
void CaEntryPrivate::setEntryTypeName(const QString &entryTypeName)
|
|
600 |
{
|
|
601 |
mEntryTypeName = entryTypeName;
|
|
602 |
}
|
|
603 |
|
|
604 |
/*!
|
|
605 |
\retval map of attributes indexed by their names
|
|
606 |
*/
|
|
607 |
QMap<QString, QString> CaEntryPrivate::attributes() const
|
|
608 |
{
|
|
609 |
return mAttributes;
|
|
610 |
}
|
|
611 |
|
|
612 |
/*!
|
|
613 |
\param name name of an attribute
|
|
614 |
\retval value of attribute
|
|
615 |
*/
|
|
616 |
QString CaEntryPrivate::attribute(const QString &name) const
|
|
617 |
{
|
|
618 |
return mAttributes.value(name);
|
|
619 |
}
|
|
620 |
|
|
621 |
/*!
|
|
622 |
Sets attribute.
|
|
623 |
\param name name of an attribute.
|
|
624 |
\param value value of an attribute.
|
|
625 |
*/
|
|
626 |
void CaEntryPrivate::setAttribute(const QString &name, const QString &value)
|
|
627 |
{
|
|
628 |
mAttributes.insert(name, value);
|
|
629 |
}
|
|
630 |
|
|
631 |
/*!
|
|
632 |
Creates an icon.
|
|
633 |
\param size icon size to display
|
86
|
634 |
\retval created icon (HbIcon).
|
85
|
635 |
*/
|
87
|
636 |
HbIcon CaEntryPrivate::makeIcon(const QSize &size) const
|
85
|
637 |
{
|
92
|
638 |
return CaMenuIconUtility::getEntryIcon(*m_q, size);
|
85
|
639 |
}
|
|
640 |
|
|
641 |
/*!
|
|
642 |
Sets entry id.
|
|
643 |
\param id item id.
|
|
644 |
*/
|
|
645 |
void CaEntryPrivate::setId(int id)
|
|
646 |
{
|
|
647 |
mId = id;
|
|
648 |
}
|
|
649 |
/*!
|
|
650 |
Sets entry role.
|
|
651 |
\retval entry's role.
|
|
652 |
*/
|
|
653 |
EntryRole CaEntryPrivate::role() const
|
|
654 |
{
|
|
655 |
return mEntryRole;
|
|
656 |
}
|
|
657 |
/*!
|
|
658 |
Gets entry role.
|
|
659 |
\param role entry's role.
|
|
660 |
*/
|
|
661 |
void CaEntryPrivate::setRole(const EntryRole &role)
|
|
662 |
{
|
|
663 |
mEntryRole = role;
|
|
664 |
}
|
|
665 |
|