85
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: ?Description
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <s32strm.h>
|
86
|
19 |
#include <badesca.h>
|
85
|
20 |
#include "cainnernotifierfilter.h"
|
|
21 |
|
|
22 |
// ======== MEMBER FUNCTIONS ========
|
|
23 |
|
|
24 |
// ---------------------------------------------------------------------------
|
|
25 |
//
|
|
26 |
// ---------------------------------------------------------------------------
|
|
27 |
//
|
|
28 |
CCaInnerNotifierFilter::CCaInnerNotifierFilter(
|
|
29 |
TNotifierType aInnerNotifierType ) :
|
|
30 |
iParentId( 0 ),
|
|
31 |
iEntryRole( EItemEntryRole ),
|
|
32 |
iTypeNames( NULL ),
|
|
33 |
iNotifierType( aInnerNotifierType )
|
|
34 |
{
|
|
35 |
}
|
|
36 |
// ---------------------------------------------------------------------------
|
|
37 |
//
|
|
38 |
// ---------------------------------------------------------------------------
|
|
39 |
//
|
|
40 |
CCaInnerNotifierFilter::~CCaInnerNotifierFilter()
|
|
41 |
{
|
|
42 |
delete iTypeNames;
|
|
43 |
iIds.Close();
|
|
44 |
}
|
|
45 |
// ---------------------------------------------------------------------------
|
|
46 |
//
|
|
47 |
// ---------------------------------------------------------------------------
|
|
48 |
//
|
|
49 |
void CCaInnerNotifierFilter::ConstructL()
|
|
50 |
{
|
|
51 |
iTypeNames = new ( ELeave ) CDesC16ArrayFlat( KDefaultGranularity );
|
|
52 |
}
|
|
53 |
// ---------------------------------------------------------------------------
|
|
54 |
//
|
|
55 |
// ---------------------------------------------------------------------------
|
|
56 |
//
|
|
57 |
EXPORT_C CCaInnerNotifierFilter* CCaInnerNotifierFilter::NewL(
|
|
58 |
TNotifierType aInnerNotifierType )
|
|
59 |
{
|
|
60 |
CCaInnerNotifierFilter* filter =
|
|
61 |
CCaInnerNotifierFilter::NewLC( aInnerNotifierType );
|
|
62 |
CleanupStack::Pop( filter );
|
|
63 |
return filter;
|
|
64 |
}
|
|
65 |
// ---------------------------------------------------------------------------
|
|
66 |
//
|
|
67 |
// ---------------------------------------------------------------------------
|
|
68 |
//
|
|
69 |
EXPORT_C CCaInnerNotifierFilter* CCaInnerNotifierFilter::NewLC(
|
|
70 |
TNotifierType aInnerNotifierType )
|
|
71 |
{
|
|
72 |
CCaInnerNotifierFilter* self = new (ELeave) CCaInnerNotifierFilter(
|
|
73 |
aInnerNotifierType );
|
|
74 |
CleanupStack::PushL( self );
|
|
75 |
self->ConstructL();
|
|
76 |
return self;
|
|
77 |
}
|
|
78 |
// ---------------------------------------------------------------------------
|
|
79 |
//
|
|
80 |
// ---------------------------------------------------------------------------
|
|
81 |
//
|
|
82 |
EXPORT_C TInt CCaInnerNotifierFilter::GetParentId() const
|
|
83 |
{
|
|
84 |
return iParentId;
|
|
85 |
}
|
|
86 |
// ---------------------------------------------------------------------------
|
|
87 |
//
|
|
88 |
EXPORT_C void CCaInnerNotifierFilter::SetParentId( TInt aParentId )
|
|
89 |
{
|
|
90 |
iParentId = aParentId;
|
|
91 |
}
|
|
92 |
// ---------------------------------------------------------------------------
|
|
93 |
//
|
|
94 |
// ---------------------------------------------------------------------------
|
|
95 |
//
|
|
96 |
EXPORT_C RArray<TInt> CCaInnerNotifierFilter::GetIds() const
|
|
97 |
{
|
|
98 |
return iIds;
|
|
99 |
}
|
|
100 |
// ---------------------------------------------------------------------------
|
|
101 |
//
|
|
102 |
EXPORT_C void CCaInnerNotifierFilter::SetIdsL( const RArray<TInt>& aIds )
|
|
103 |
{
|
|
104 |
for( TInt i( 0 ); i < aIds.Count(); ++i )
|
|
105 |
{
|
|
106 |
iIds.AppendL( aIds[i] );
|
|
107 |
}
|
|
108 |
}
|
|
109 |
// ---------------------------------------------------------------------------
|
|
110 |
//
|
|
111 |
// ---------------------------------------------------------------------------
|
|
112 |
//
|
|
113 |
EXPORT_C TEntryRole CCaInnerNotifierFilter::GetEntryRole() const
|
|
114 |
{
|
|
115 |
return iEntryRole;
|
|
116 |
}
|
|
117 |
// ---------------------------------------------------------------------------
|
|
118 |
//
|
|
119 |
EXPORT_C void CCaInnerNotifierFilter::SetEntryRole( TEntryRole aEntryRole )
|
|
120 |
{
|
|
121 |
iEntryRole = aEntryRole;
|
|
122 |
}
|
|
123 |
// ---------------------------------------------------------------------------
|
|
124 |
//
|
|
125 |
// ---------------------------------------------------------------------------
|
|
126 |
//
|
|
127 |
EXPORT_C CDesC16ArrayFlat* CCaInnerNotifierFilter::GetTypeNames() const
|
|
128 |
{
|
|
129 |
return iTypeNames;
|
|
130 |
}
|
|
131 |
// ---------------------------------------------------------------------------
|
|
132 |
//
|
|
133 |
EXPORT_C void CCaInnerNotifierFilter::SetTypeNames(
|
|
134 |
CDesC16ArrayFlat * aTypeNames )
|
|
135 |
{
|
|
136 |
ASSERT( aTypeNames );
|
|
137 |
delete iTypeNames;
|
|
138 |
iTypeNames = aTypeNames;
|
|
139 |
}
|
|
140 |
// ---------------------------------------------------------------------------
|
|
141 |
//
|
|
142 |
// ---------------------------------------------------------------------------
|
|
143 |
//
|
|
144 |
EXPORT_C CCaInnerNotifierFilter::TNotifierType CCaInnerNotifierFilter::GetNotifierType() const
|
|
145 |
{
|
|
146 |
return iNotifierType;
|
|
147 |
}
|
|
148 |
|
|
149 |
// ---------------------------------------------------------------------------
|
|
150 |
//
|
|
151 |
// ---------------------------------------------------------------------------
|
|
152 |
//
|
|
153 |
EXPORT_C void CCaInnerNotifierFilter::ExternalizeL( RWriteStream& aStream ) const
|
|
154 |
{
|
|
155 |
aStream.WriteUint32L( static_cast<TUint> ( iEntryRole ) );
|
|
156 |
aStream.WriteUint32L( static_cast<TUint> ( iNotifierType ) );
|
|
157 |
aStream.WriteInt32L( iParentId );
|
|
158 |
aStream.WriteInt32L( iIds.Count() );
|
|
159 |
for( TInt i = 0; i < iIds.Count(); i++ )
|
|
160 |
{
|
|
161 |
aStream.WriteInt32L( iIds[i] );
|
|
162 |
}
|
|
163 |
aStream.WriteInt32L( iTypeNames->MdcaCount() );
|
|
164 |
for( TInt i = 0; i < iTypeNames->MdcaCount(); i++ )
|
|
165 |
{
|
|
166 |
aStream.WriteInt32L( iTypeNames->MdcaPoint( i ).Length() );
|
|
167 |
aStream.WriteL( iTypeNames->MdcaPoint( i ) );
|
|
168 |
}
|
|
169 |
aStream.CommitL();
|
|
170 |
}
|
|
171 |
|
|
172 |
// ---------------------------------------------------------------------------
|
|
173 |
//
|
|
174 |
// ---------------------------------------------------------------------------
|
|
175 |
//
|
|
176 |
EXPORT_C void CCaInnerNotifierFilter::InternalizeL( RReadStream& aStream )
|
|
177 |
{
|
|
178 |
TUint entryRole = aStream.ReadUint32L();
|
|
179 |
TUint notifierType = aStream.ReadUint32L();
|
|
180 |
iEntryRole = static_cast<TEntryRole> ( entryRole );
|
|
181 |
iNotifierType = static_cast<TNotifierType> ( notifierType );
|
|
182 |
TInt count( 0 );
|
|
183 |
iParentId = aStream.ReadInt32L();
|
|
184 |
count = aStream.ReadInt32L();
|
|
185 |
for( TInt i = 0; i < count; i++ )
|
|
186 |
{
|
|
187 |
iIds.AppendL( aStream.ReadInt32L() );
|
|
188 |
}
|
|
189 |
count = aStream.ReadInt32L();
|
|
190 |
iTypeNames->Reset();
|
|
191 |
for( TInt i = 0; i < count; i++ )
|
|
192 |
{
|
|
193 |
RBuf16 buf;
|
|
194 |
CleanupClosePushL( buf );
|
|
195 |
TInt length = aStream.ReadInt32L();
|
|
196 |
buf.CreateL( length );
|
|
197 |
aStream.ReadL( buf, length );
|
|
198 |
iTypeNames->AppendL( buf );
|
|
199 |
CleanupStack::PopAndDestroy( &buf );
|
|
200 |
}
|
|
201 |
}
|
|
202 |
|
|
203 |
// End of file
|