contentstorage/cautils/src/cainnerentry.cpp
author hgs
Fri, 28 May 2010 16:17:03 +0300
changeset 96 5d243a69bdda
parent 92 782e3408c2ab
child 98 d2f833ab7940
permissions -rw-r--r--
201021
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) 2008 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:  ?Description
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 <s32mem.h>
7feec50967db 201003_02
hgs
parents:
diff changeset
    19
#include "cainnerentry.h"
7feec50967db 201003_02
hgs
parents:
diff changeset
    20
7feec50967db 201003_02
hgs
parents:
diff changeset
    21
// ======== MEMBER FUNCTIONS ========
7feec50967db 201003_02
hgs
parents:
diff changeset
    22
7feec50967db 201003_02
hgs
parents:
diff changeset
    23
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    24
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    25
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    26
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    27
CCaInnerEntry::~CCaInnerEntry()
7feec50967db 201003_02
hgs
parents:
diff changeset
    28
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
    29
    iText.Close();
7feec50967db 201003_02
hgs
parents:
diff changeset
    30
    iDescription.Close();
7feec50967db 201003_02
hgs
parents:
diff changeset
    31
    iEntryTypeName.Close();
7feec50967db 201003_02
hgs
parents:
diff changeset
    32
    iAttributes.ResetAndDestroy();
92
hgs
parents: 88
diff changeset
    33
    delete iIcon;
85
7feec50967db 201003_02
hgs
parents:
diff changeset
    34
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
    35
7feec50967db 201003_02
hgs
parents:
diff changeset
    36
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    37
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    38
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    39
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    40
EXPORT_C CCaInnerEntry* CCaInnerEntry::NewL()
7feec50967db 201003_02
hgs
parents:
diff changeset
    41
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
    42
    CCaInnerEntry* entry = CCaInnerEntry::NewLC();
7feec50967db 201003_02
hgs
parents:
diff changeset
    43
    CleanupStack::Pop( entry );
7feec50967db 201003_02
hgs
parents:
diff changeset
    44
    return entry;
7feec50967db 201003_02
hgs
parents:
diff changeset
    45
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
    46
7feec50967db 201003_02
hgs
parents:
diff changeset
    47
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    48
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    49
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    50
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    51
EXPORT_C CCaInnerEntry* CCaInnerEntry::NewLC()
7feec50967db 201003_02
hgs
parents:
diff changeset
    52
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
    53
    CCaInnerEntry* self = new ( ELeave ) CCaInnerEntry();
7feec50967db 201003_02
hgs
parents:
diff changeset
    54
    CleanupStack::PushL( self );
7feec50967db 201003_02
hgs
parents:
diff changeset
    55
    self->ConstructL();
7feec50967db 201003_02
hgs
parents:
diff changeset
    56
    return self;
7feec50967db 201003_02
hgs
parents:
diff changeset
    57
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
    58
7feec50967db 201003_02
hgs
parents:
diff changeset
    59
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    60
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    61
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    62
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    63
EXPORT_C void CCaInnerEntry::ExternalizeL( RWriteStream& aStream ) const
7feec50967db 201003_02
hgs
parents:
diff changeset
    64
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
    65
    aStream.WriteInt32L( iId );
7feec50967db 201003_02
hgs
parents:
diff changeset
    66
    aStream.WriteInt32L( iUid );
7feec50967db 201003_02
hgs
parents:
diff changeset
    67
    aStream.WriteUint32L( iFlags );
7feec50967db 201003_02
hgs
parents:
diff changeset
    68
    aStream.WriteUint32L( iRole );
7feec50967db 201003_02
hgs
parents:
diff changeset
    69
    aStream.WriteUint32L( iText.Length() );
7feec50967db 201003_02
hgs
parents:
diff changeset
    70
    aStream.WriteL( iText, iText.Length() );
7feec50967db 201003_02
hgs
parents:
diff changeset
    71
    aStream.WriteUint32L( iDescription.Length() );
7feec50967db 201003_02
hgs
parents:
diff changeset
    72
    aStream.WriteL( iDescription, iDescription.Length() );
7feec50967db 201003_02
hgs
parents:
diff changeset
    73
    aStream.WriteUint32L( iEntryTypeName.Length() );
7feec50967db 201003_02
hgs
parents:
diff changeset
    74
    aStream.WriteL( iEntryTypeName, iEntryTypeName.Length() );
7feec50967db 201003_02
hgs
parents:
diff changeset
    75
    iAttributes.ExternalizeL( aStream );
92
hgs
parents: 88
diff changeset
    76
    iIcon->ExternalizeL( aStream );
85
7feec50967db 201003_02
hgs
parents:
diff changeset
    77
    aStream.CommitL();
7feec50967db 201003_02
hgs
parents:
diff changeset
    78
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
    79
7feec50967db 201003_02
hgs
parents:
diff changeset
    80
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    81
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    82
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    83
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    84
EXPORT_C void CCaInnerEntry::InternalizeL( RReadStream& aStream )
7feec50967db 201003_02
hgs
parents:
diff changeset
    85
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
    86
    iId = aStream.ReadInt32L();
7feec50967db 201003_02
hgs
parents:
diff changeset
    87
    iUid = aStream.ReadInt32L();
7feec50967db 201003_02
hgs
parents:
diff changeset
    88
    iFlags = aStream.ReadUint32L();
7feec50967db 201003_02
hgs
parents:
diff changeset
    89
    iRole = aStream.ReadUint32L();
92
hgs
parents: 88
diff changeset
    90
    TUint length = aStream.ReadUint32L();
85
7feec50967db 201003_02
hgs
parents:
diff changeset
    91
    iText.Close();
7feec50967db 201003_02
hgs
parents:
diff changeset
    92
    iText.CreateL( length );
7feec50967db 201003_02
hgs
parents:
diff changeset
    93
    aStream.ReadL( iText, length );
7feec50967db 201003_02
hgs
parents:
diff changeset
    94
    length = aStream.ReadUint32L();
7feec50967db 201003_02
hgs
parents:
diff changeset
    95
    iDescription.Close( );
7feec50967db 201003_02
hgs
parents:
diff changeset
    96
    iDescription.CreateL( length );
7feec50967db 201003_02
hgs
parents:
diff changeset
    97
    aStream.ReadL( iDescription, length);
7feec50967db 201003_02
hgs
parents:
diff changeset
    98
    length = aStream.ReadUint32L( );
7feec50967db 201003_02
hgs
parents:
diff changeset
    99
    iEntryTypeName.Close();
7feec50967db 201003_02
hgs
parents:
diff changeset
   100
    iEntryTypeName.CreateL( length );
7feec50967db 201003_02
hgs
parents:
diff changeset
   101
    aStream.ReadL( iEntryTypeName, length );
7feec50967db 201003_02
hgs
parents:
diff changeset
   102
    iAttributes.InternalizeL( aStream );
92
hgs
parents: 88
diff changeset
   103
    iIcon->InternalizeL( aStream );
85
7feec50967db 201003_02
hgs
parents:
diff changeset
   104
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   105
7feec50967db 201003_02
hgs
parents:
diff changeset
   106
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   107
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   108
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   109
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   110
void CCaInnerEntry::ConstructL()
7feec50967db 201003_02
hgs
parents:
diff changeset
   111
    {
92
hgs
parents: 88
diff changeset
   112
    iIcon = CCaInnerIconDescription::NewL();
85
7feec50967db 201003_02
hgs
parents:
diff changeset
   113
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   114
7feec50967db 201003_02
hgs
parents:
diff changeset
   115
// ---------------------------------------------------------------------------
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
CCaInnerEntry::CCaInnerEntry()
7feec50967db 201003_02
hgs
parents:
diff changeset
   120
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   121
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   122
7feec50967db 201003_02
hgs
parents:
diff changeset
   123
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   124
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   125
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   126
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   127
EXPORT_C TInt CCaInnerEntry::GetId() const
7feec50967db 201003_02
hgs
parents:
diff changeset
   128
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   129
    return iId;
7feec50967db 201003_02
hgs
parents:
diff changeset
   130
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   131
7feec50967db 201003_02
hgs
parents:
diff changeset
   132
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   133
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   134
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   135
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   136
EXPORT_C const RBuf& CCaInnerEntry::GetText() const
7feec50967db 201003_02
hgs
parents:
diff changeset
   137
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   138
    return iText;
7feec50967db 201003_02
hgs
parents:
diff changeset
   139
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   140
7feec50967db 201003_02
hgs
parents:
diff changeset
   141
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   142
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   143
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   144
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   145
EXPORT_C const RBuf& CCaInnerEntry::GetDescription() const
7feec50967db 201003_02
hgs
parents:
diff changeset
   146
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   147
    return iDescription;
7feec50967db 201003_02
hgs
parents:
diff changeset
   148
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   149
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
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   154
EXPORT_C const RBuf& CCaInnerEntry::GetEntryTypeName() const
7feec50967db 201003_02
hgs
parents:
diff changeset
   155
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   156
    return iEntryTypeName;
7feec50967db 201003_02
hgs
parents:
diff changeset
   157
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   158
7feec50967db 201003_02
hgs
parents:
diff changeset
   159
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   160
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   161
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   162
//
92
hgs
parents: 88
diff changeset
   163
EXPORT_C const CCaInnerIconDescription* CCaInnerEntry::Icon() const
85
7feec50967db 201003_02
hgs
parents:
diff changeset
   164
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   165
    return iIcon;
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
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   170
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   171
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   172
EXPORT_C TUint CCaInnerEntry::GetFlags() const
7feec50967db 201003_02
hgs
parents:
diff changeset
   173
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   174
    return iFlags;
7feec50967db 201003_02
hgs
parents:
diff changeset
   175
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   176
7feec50967db 201003_02
hgs
parents:
diff changeset
   177
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   178
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   179
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   180
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   181
EXPORT_C const RCaEntryAttrArray& CCaInnerEntry::GetAttributes() const
7feec50967db 201003_02
hgs
parents:
diff changeset
   182
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   183
    return iAttributes;
7feec50967db 201003_02
hgs
parents:
diff changeset
   184
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   185
7feec50967db 201003_02
hgs
parents:
diff changeset
   186
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   187
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   188
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   189
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   190
EXPORT_C TUint CCaInnerEntry::GetRole() const
7feec50967db 201003_02
hgs
parents:
diff changeset
   191
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   192
    return iRole;
7feec50967db 201003_02
hgs
parents:
diff changeset
   193
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   194
7feec50967db 201003_02
hgs
parents:
diff changeset
   195
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   196
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   197
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   198
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   199
EXPORT_C TInt32 CCaInnerEntry::GetUid() const
7feec50967db 201003_02
hgs
parents:
diff changeset
   200
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   201
    return iUid;
7feec50967db 201003_02
hgs
parents:
diff changeset
   202
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   203
7feec50967db 201003_02
hgs
parents:
diff changeset
   204
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   205
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   206
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   207
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   208
EXPORT_C TInt CCaInnerEntry::GetIconId() const
7feec50967db 201003_02
hgs
parents:
diff changeset
   209
    {
92
hgs
parents: 88
diff changeset
   210
    return iIcon->Id();
85
7feec50967db 201003_02
hgs
parents:
diff changeset
   211
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   212
//    SETTERS
7feec50967db 201003_02
hgs
parents:
diff changeset
   213
7feec50967db 201003_02
hgs
parents:
diff changeset
   214
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   215
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   216
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   217
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   218
EXPORT_C void CCaInnerEntry::SetId( TUint aId )
7feec50967db 201003_02
hgs
parents:
diff changeset
   219
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   220
    iId = aId;
7feec50967db 201003_02
hgs
parents:
diff changeset
   221
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   222
7feec50967db 201003_02
hgs
parents:
diff changeset
   223
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   224
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   225
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   226
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   227
EXPORT_C void CCaInnerEntry::SetTextL( const TDesC& aText )
7feec50967db 201003_02
hgs
parents:
diff changeset
   228
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   229
    iText.Close();
7feec50967db 201003_02
hgs
parents:
diff changeset
   230
    iText.CreateL( aText );
7feec50967db 201003_02
hgs
parents:
diff changeset
   231
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   232
7feec50967db 201003_02
hgs
parents:
diff changeset
   233
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   234
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   235
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   236
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   237
EXPORT_C void CCaInnerEntry::SetDescriptionL( const TDesC& aText )
7feec50967db 201003_02
hgs
parents:
diff changeset
   238
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   239
    iDescription.Close();
7feec50967db 201003_02
hgs
parents:
diff changeset
   240
    iDescription.CreateL( aText );
7feec50967db 201003_02
hgs
parents:
diff changeset
   241
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   242
7feec50967db 201003_02
hgs
parents:
diff changeset
   243
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   244
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   245
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   246
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   247
EXPORT_C void CCaInnerEntry::SetEntryTypeNameL( const TDesC& aTypeName )
7feec50967db 201003_02
hgs
parents:
diff changeset
   248
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   249
    iEntryTypeName.Close();
7feec50967db 201003_02
hgs
parents:
diff changeset
   250
    iEntryTypeName.CreateL( aTypeName );
7feec50967db 201003_02
hgs
parents:
diff changeset
   251
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   252
7feec50967db 201003_02
hgs
parents:
diff changeset
   253
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   254
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   255
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   256
//
88
hgs
parents: 85
diff changeset
   257
EXPORT_C void CCaInnerEntry::SetIconDataL(
hgs
parents: 85
diff changeset
   258
        const TDesC& aFilename, const TDesC& aSkinId, const TDesC& aApplicationId )
85
7feec50967db 201003_02
hgs
parents:
diff changeset
   259
    {
92
hgs
parents: 88
diff changeset
   260
    iIcon->SetFileNameL( aFilename );
hgs
parents: 88
diff changeset
   261
    iIcon->SetSkinIdL( aSkinId );
hgs
parents: 88
diff changeset
   262
    iIcon->SetApplicationIdL( aApplicationId );
85
7feec50967db 201003_02
hgs
parents:
diff changeset
   263
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   264
7feec50967db 201003_02
hgs
parents:
diff changeset
   265
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   266
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   267
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   268
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   269
EXPORT_C void CCaInnerEntry::AddAttributeL( const TDesC& aKey,
7feec50967db 201003_02
hgs
parents:
diff changeset
   270
        const TDesC& aValue )
7feec50967db 201003_02
hgs
parents:
diff changeset
   271
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   272
    // to avoid duplicated attribute
7feec50967db 201003_02
hgs
parents:
diff changeset
   273
    if( iAttributes.Exist( aKey ) )
7feec50967db 201003_02
hgs
parents:
diff changeset
   274
        {
7feec50967db 201003_02
hgs
parents:
diff changeset
   275
        iAttributes.RemoveAttribute( aKey );
7feec50967db 201003_02
hgs
parents:
diff changeset
   276
        }
7feec50967db 201003_02
hgs
parents:
diff changeset
   277
    CCaEntryAttribute* attr = CCaEntryAttribute::NewLC( aKey );
7feec50967db 201003_02
hgs
parents:
diff changeset
   278
    attr->SetValueL( aValue );
7feec50967db 201003_02
hgs
parents:
diff changeset
   279
    iAttributes.AppendL( attr );
7feec50967db 201003_02
hgs
parents:
diff changeset
   280
    CleanupStack::Pop( attr );
7feec50967db 201003_02
hgs
parents:
diff changeset
   281
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   282
7feec50967db 201003_02
hgs
parents:
diff changeset
   283
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   284
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   285
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   286
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   287
EXPORT_C void CCaInnerEntry::SetFlags( TUint aFlags )
7feec50967db 201003_02
hgs
parents:
diff changeset
   288
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   289
    iFlags = aFlags;
7feec50967db 201003_02
hgs
parents:
diff changeset
   290
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   291
7feec50967db 201003_02
hgs
parents:
diff changeset
   292
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   293
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   294
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   295
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   296
EXPORT_C void CCaInnerEntry::SetRole( TUint aRole )
7feec50967db 201003_02
hgs
parents:
diff changeset
   297
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   298
    iRole = aRole;
7feec50967db 201003_02
hgs
parents:
diff changeset
   299
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   300
7feec50967db 201003_02
hgs
parents:
diff changeset
   301
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   302
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   303
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   304
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   305
EXPORT_C void CCaInnerEntry::RemoveAttributeL( const TDesC& aKey )
7feec50967db 201003_02
hgs
parents:
diff changeset
   306
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   307
    iAttributes.RemoveAttribute( aKey );
7feec50967db 201003_02
hgs
parents:
diff changeset
   308
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   309
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
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   314
EXPORT_C TBool CCaInnerEntry::FindAttribute( const TDesC& aKey,
7feec50967db 201003_02
hgs
parents:
diff changeset
   315
        TDes& aAttrVal )
7feec50967db 201003_02
hgs
parents:
diff changeset
   316
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   317
    return iAttributes.Find( aKey, aAttrVal );
7feec50967db 201003_02
hgs
parents:
diff changeset
   318
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   319
7feec50967db 201003_02
hgs
parents:
diff changeset
   320
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   321
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   322
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   323
//
92
hgs
parents: 88
diff changeset
   324
EXPORT_C TBool CCaInnerEntry::FindAttribute( const TDesC& aKey,
hgs
parents: 88
diff changeset
   325
        TPtrC& aAttrVal )
hgs
parents: 88
diff changeset
   326
    {
hgs
parents: 88
diff changeset
   327
    return iAttributes.Find( aKey, aAttrVal );
hgs
parents: 88
diff changeset
   328
    }
hgs
parents: 88
diff changeset
   329
hgs
parents: 88
diff changeset
   330
// ---------------------------------------------------------------------------
hgs
parents: 88
diff changeset
   331
//
hgs
parents: 88
diff changeset
   332
// ---------------------------------------------------------------------------
hgs
parents: 88
diff changeset
   333
//
85
7feec50967db 201003_02
hgs
parents:
diff changeset
   334
EXPORT_C void CCaInnerEntry::SetUid( TInt32 aUid )
7feec50967db 201003_02
hgs
parents:
diff changeset
   335
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
   336
    iUid = aUid;
7feec50967db 201003_02
hgs
parents:
diff changeset
   337
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
   338
7feec50967db 201003_02
hgs
parents:
diff changeset
   339
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   340
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   341
// ---------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
   342
//
7feec50967db 201003_02
hgs
parents:
diff changeset
   343
EXPORT_C void CCaInnerEntry::SetIconId( TInt aIconId )
7feec50967db 201003_02
hgs
parents:
diff changeset
   344
    {
92
hgs
parents: 88
diff changeset
   345
    iIcon->SetId( aIconId );
85
7feec50967db 201003_02
hgs
parents:
diff changeset
   346
    }