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