author | hgs |
Mon, 23 Aug 2010 15:50:54 +0300 | |
changeset 44 | 5db69f4c3d06 |
parent 31 | e7a04a6385be |
child 48 | da3ec8478e66 |
permissions | -rw-r--r-- |
17
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#include "creator_contactelement.h" |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#include "creator_traces.h" |
27 | 22 |
#include "creator_phonebook.h" |
17
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
#include "creator_factory.h" |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#include "creator_contactsetcache.h" |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
#include <xml/documentparameters.h> |
27 | 26 |
#include <qtcontacts.h> |
17
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
using namespace Xml; |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
using namespace creatorcontact; |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
/** |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
* Contact field element mappings: |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
*/ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
enum TContactFieldDataType |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
{ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
EDataTypeText, |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
EDataTypeBinary, |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
EDataTypeDateTime |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
}; |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
class FieldMapping |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
{ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
public: |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
TPtrC iElementName; |
31 | 45 |
TInt iFieldCode; |
17
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
TContactFieldDataType iDataType; |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
}; |
27 | 48 |
FieldMapping fieldMappingTbl[] = { |
31 | 49 |
{TPtrC(KFirstname), CCreatorPhonebookWrapper::EFirstName, EDataTypeText}, |
50 |
{TPtrC(KLastname), CCreatorPhonebookWrapper::ELastName, EDataTypeText}, |
|
51 |
{TPtrC(KFirstnameReading), CCreatorPhonebookWrapper::EFirstNameReading, EDataTypeText}, |
|
52 |
{TPtrC(KLastnameReading), CCreatorPhonebookWrapper::ELastNameReading, EDataTypeText}, |
|
53 |
{TPtrC(KPrefix), CCreatorPhonebookWrapper::EPrefix, EDataTypeText}, |
|
54 |
{TPtrC(KSuffix), CCreatorPhonebookWrapper::ESuffix, EDataTypeText}, |
|
55 |
{TPtrC(KSecondname), CCreatorPhonebookWrapper::ESecondName, EDataTypeText}, |
|
56 |
{TPtrC(KLandphoneHome), CCreatorPhonebookWrapper::ELandPhoneHome, EDataTypeText}, |
|
27 | 57 |
|
31 | 58 |
{TPtrC(KMobilephoneHome), CCreatorPhonebookWrapper::EMobilePhoneHome, EDataTypeText}, |
59 |
{TPtrC(KVideonumberHome), CCreatorPhonebookWrapper::EVideoNumberHome, EDataTypeText}, |
|
60 |
{TPtrC(KFaxnumberHome), CCreatorPhonebookWrapper::EFaxNumberHome, EDataTypeText}, |
|
61 |
{TPtrC(KVoipHome), CCreatorPhonebookWrapper::EVoipHome, EDataTypeText}, |
|
62 |
{TPtrC(KEmailHome), CCreatorPhonebookWrapper::EEmailHome, EDataTypeText}, |
|
63 |
{TPtrC(KUrlHome), CCreatorPhonebookWrapper::EUrlHome, EDataTypeText}, |
|
64 |
{TPtrC(KAddrlabelHome), CCreatorPhonebookWrapper::EAddrLabelHome, EDataTypeText}, |
|
65 |
{TPtrC(KAddrpoHome), CCreatorPhonebookWrapper::EAddrPoHome, EDataTypeText}, |
|
27 | 66 |
|
31 | 67 |
{TPtrC(KAddrextHome), CCreatorPhonebookWrapper::EAddrExtHome, EDataTypeText}, |
68 |
{TPtrC(KAddrstreetHome), CCreatorPhonebookWrapper::EAddrStreetHome, EDataTypeText}, |
|
69 |
{TPtrC(KAddrlocalHome), CCreatorPhonebookWrapper::EAddrLocalHome, EDataTypeText}, |
|
70 |
{TPtrC(KAddrregionHome), CCreatorPhonebookWrapper::EAddrRegionHome, EDataTypeText}, |
|
71 |
{TPtrC(KAddrpostcodeHome), CCreatorPhonebookWrapper::EAddrPostCodeHome, EDataTypeText}, |
|
72 |
{TPtrC(KAddrcountryHome), CCreatorPhonebookWrapper::EAddrCountryHome, EDataTypeText}, |
|
73 |
{TPtrC(KJobtitle), CCreatorPhonebookWrapper::EJobTitle, EDataTypeText}, |
|
74 |
{TPtrC(KCompanyname), CCreatorPhonebookWrapper::ECompanyName, EDataTypeText}, |
|
27 | 75 |
|
31 | 76 |
{TPtrC(KLandphoneWork), CCreatorPhonebookWrapper::ELandPhoneWork, EDataTypeText}, |
77 |
{TPtrC(KMobilephoneWork), CCreatorPhonebookWrapper::EMobilePhoneWork, EDataTypeText}, |
|
78 |
{TPtrC(KVideonumberWork), CCreatorPhonebookWrapper::EVideoNumberWork, EDataTypeText}, |
|
79 |
{TPtrC(KFaxnumberWork), CCreatorPhonebookWrapper::EFaxNumberWork, EDataTypeText}, |
|
80 |
{TPtrC(KVoipWork), CCreatorPhonebookWrapper::EVoipWork, EDataTypeText}, |
|
81 |
{TPtrC(KEmailWork), CCreatorPhonebookWrapper::EEmailWork, EDataTypeText}, |
|
82 |
{TPtrC(KUrlWork), CCreatorPhonebookWrapper::EUrlWork, EDataTypeText}, |
|
83 |
{TPtrC(KAddrlabelWork), CCreatorPhonebookWrapper::EAddrLabelWork, EDataTypeText}, |
|
27 | 84 |
|
31 | 85 |
{TPtrC(KAddrpoWork), CCreatorPhonebookWrapper::EAddrPoWork, EDataTypeText}, |
86 |
{TPtrC(KAddrextWork), CCreatorPhonebookWrapper::EAddrExtWork, EDataTypeText}, |
|
87 |
{TPtrC(KAddrstreetWork), CCreatorPhonebookWrapper::EAddrStreetWork, EDataTypeText}, |
|
88 |
{TPtrC(KAddrlocalWork), CCreatorPhonebookWrapper::EAddrLocalWork, EDataTypeText}, |
|
89 |
{TPtrC(KAddrregionWork), CCreatorPhonebookWrapper::EAddrRegionWork, EDataTypeText}, |
|
90 |
{TPtrC(KAddrpostcodeWork), CCreatorPhonebookWrapper::EAddrPostCodeWork, EDataTypeText}, |
|
91 |
{TPtrC(KAddrcountryWork), CCreatorPhonebookWrapper::EAddrCountryWork, EDataTypeText}, |
|
92 |
{TPtrC(KLandphoneGen), CCreatorPhonebookWrapper::ELandPhoneGen, EDataTypeText}, |
|
27 | 93 |
|
31 | 94 |
{TPtrC(KMobilephoneGen), CCreatorPhonebookWrapper::EMobilePhoneGen, EDataTypeText}, |
95 |
{TPtrC(KVideonumberGen), CCreatorPhonebookWrapper::EVideoNumberGen, EDataTypeText}, |
|
96 |
{TPtrC(KFaxnumberGen), CCreatorPhonebookWrapper::EFaxNumberGen, EDataTypeText}, |
|
97 |
{TPtrC(KVoipGen), CCreatorPhonebookWrapper::EVoipGen, EDataTypeText}, |
|
98 |
{TPtrC(KPoc), CCreatorPhonebookWrapper::EPoc, EDataTypeText}, |
|
99 |
{TPtrC(KSwis), CCreatorPhonebookWrapper::ESwis, EDataTypeText}, |
|
100 |
{TPtrC(KSip), CCreatorPhonebookWrapper::ESip, EDataTypeText}, |
|
101 |
{TPtrC(KEmailGen), CCreatorPhonebookWrapper::EEmailGen, EDataTypeText}, |
|
27 | 102 |
|
31 | 103 |
{TPtrC(KUrlGen), CCreatorPhonebookWrapper::EUrlGen, EDataTypeText}, |
104 |
{TPtrC(KAddrlabelGen), CCreatorPhonebookWrapper::EAddrLabelGen, EDataTypeText}, |
|
105 |
{TPtrC(KAddrpoGen), CCreatorPhonebookWrapper::EAddrPoGen, EDataTypeText}, |
|
106 |
{TPtrC(KAddrextGen), CCreatorPhonebookWrapper::EAddrExtGen, EDataTypeText}, |
|
107 |
{TPtrC(KAddrstreetGen), CCreatorPhonebookWrapper::EAddrStreetGen, EDataTypeText}, |
|
108 |
{TPtrC(KAddrlocalGen), CCreatorPhonebookWrapper::EAddrLocalGen, EDataTypeText}, |
|
109 |
{TPtrC(KAddrregionGen), CCreatorPhonebookWrapper::EAddrRegionGen, EDataTypeText}, |
|
110 |
{TPtrC(KAddrpostcodeGen), CCreatorPhonebookWrapper::EAddrPostCodeGen, EDataTypeText}, |
|
27 | 111 |
|
31 | 112 |
{TPtrC(KAddrcountryGen), CCreatorPhonebookWrapper::EAddrCountryGen, EDataTypeText}, |
113 |
{TPtrC(KPagerNumber), CCreatorPhonebookWrapper::EPagerNumber, EDataTypeText}, |
|
114 |
{TPtrC(KDtmfString), CCreatorPhonebookWrapper::EDtmfString, EDataTypeText}, |
|
115 |
{TPtrC(KWvAddress), CCreatorPhonebookWrapper::EWVAddress, EDataTypeText}, |
|
116 |
{TPtrC(KDate), CCreatorPhonebookWrapper::EDate, EDataTypeDateTime}, |
|
117 |
{TPtrC(KNote), CCreatorPhonebookWrapper::ENote, EDataTypeText}, |
|
118 |
{TPtrC(KThumbnailPath), CCreatorPhonebookWrapper::EThumbnailPic, EDataTypeText}, |
|
119 |
{TPtrC(KThumbnailId), CCreatorPhonebookWrapper::EThumbnailPic, EDataTypeText}, |
|
120 |
{TPtrC(KRingTone), CCreatorPhonebookWrapper::ERingTone, EDataTypeText}, |
|
121 |
{TPtrC(KRingToneId), CCreatorPhonebookWrapper::ERingTone, EDataTypeText}, |
|
27 | 122 |
|
31 | 123 |
{TPtrC(KCallerobjImg), CCreatorPhonebookWrapper::ECallerObjImg, EDataTypeText}, |
124 |
{TPtrC(KCallerobjText), CCreatorPhonebookWrapper::ECallerObjText, EDataTypeText}, |
|
125 |
{TPtrC(KMiddlename), CCreatorPhonebookWrapper::EMiddleName, EDataTypeText}, |
|
126 |
{TPtrC(KDepartment), CCreatorPhonebookWrapper::EDepartment, EDataTypeText}, |
|
127 |
{TPtrC(KAsstname), CCreatorPhonebookWrapper::EAsstName, EDataTypeText}, |
|
128 |
{TPtrC(KSpouse), CCreatorPhonebookWrapper::ESpouse, EDataTypeText}, |
|
129 |
{TPtrC(KChildren), CCreatorPhonebookWrapper::EChildren, EDataTypeText}, |
|
130 |
{TPtrC(KAsstphone), CCreatorPhonebookWrapper::EAsstPhone, EDataTypeText}, |
|
131 |
||
132 |
{TPtrC(KCarphone), CCreatorPhonebookWrapper::ECarPhone, EDataTypeText}, |
|
133 |
{TPtrC(KAnniversary), CCreatorPhonebookWrapper::EAnniversary, EDataTypeDateTime}, |
|
134 |
{TPtrC(KSyncclass), CCreatorPhonebookWrapper::ESyncClass, EDataTypeText}, |
|
135 |
{TPtrC(KLocPrivacy), CCreatorPhonebookWrapper::ELocPrivacy, EDataTypeText}, |
|
136 |
{TPtrC(KGenlabel), CCreatorPhonebookWrapper::EGenLabel, EDataTypeText} |
|
27 | 137 |
}; |
138 |
||
139 |
//********************************************************************************* |
|
17
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
140 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
141 |
CCreatorContactElementBase* CCreatorContactElementBase::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
142 |
{ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
143 |
LOGSTRING("Creator: CCreatorContactElementBase::NewL"); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
144 |
CCreatorContactElementBase* self = new (ELeave) CCreatorContactElementBase(aEngine); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
145 |
CleanupStack::PushL(self); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
146 |
self->ConstructL(aName, aContext); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
147 |
CleanupStack::Pop(); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
148 |
return self; |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
149 |
} |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
150 |
CCreatorContactElementBase::CCreatorContactElementBase(CCreatorEngine* aEngine) : CCreatorScriptElement(aEngine) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
151 |
{ } |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
152 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
153 |
CCreatorContactElement* CCreatorContactElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
154 |
{ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
155 |
LOGSTRING("Creator: CCreatorContactElement::NewL"); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
156 |
CCreatorContactElement* self = new (ELeave) CCreatorContactElement(aEngine); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
157 |
CleanupStack::PushL(self); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
158 |
self->ConstructL(aName, aContext); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
159 |
CleanupStack::Pop(); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
160 |
return self; |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
161 |
} |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
162 |
CCreatorContactElement::CCreatorContactElement(CCreatorEngine* aEngine) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
163 |
: |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
CCreatorContactElementBase(aEngine) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |
{ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
166 |
iIsCommandElement = ETrue; |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
167 |
} |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
168 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
169 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
170 |
void CCreatorContactElement::ExecuteCommandL() |
27 | 171 |
{ |
172 |
LOGSTRING("Creator: CCreatorContactElement::ExecuteCommandL"); |
|
173 |
// Find out how many contacts should we create: |
|
174 |
const CCreatorScriptAttribute* contactAmountAttr = this->FindAttributeByName(KAmount); |
|
175 |
TInt contactAmount = 1; |
|
176 |
if( contactAmountAttr ) |
|
177 |
{ |
|
178 |
contactAmount = ConvertStrToIntL(contactAmountAttr->Value()); |
|
179 |
} |
|
180 |
CCreatorScriptElement* fieldsElement = FindSubElement(KFields); |
|
181 |
TInt fieldMappingTblSize = sizeof(fieldMappingTbl)/sizeof(FieldMapping); |
|
182 |
for( TInt cI = 0; cI < contactAmount; ++cI ) |
|
183 |
{ |
|
184 |
CPhonebookParameters* param = (CPhonebookParameters*) TCreatorFactory::CreatePhoneBookParametersL(); |
|
185 |
CleanupStack::PushL(param); |
|
186 |
// Loop all the field elements |
|
187 |
if( fieldsElement && fieldsElement->SubElements().Count() > 0 ) |
|
188 |
{ |
|
189 |
||
190 |
const RPointerArray<CCreatorScriptElement>& fieldList = fieldsElement->SubElements(); |
|
191 |
||
192 |
if( fieldList.Count() == 0 ) |
|
193 |
{ |
|
194 |
||
195 |
} |
|
196 |
for( TInt i = 0; i < fieldList.Count(); ++i ) |
|
197 |
{ |
|
198 |
TPtrC fieldName = fieldList[i]->Name(); |
|
199 |
CCreatorContactField* field = 0; |
|
200 |
field = CCreatorContactField::NewL(); |
|
201 |
||
202 |
const CCreatorScriptAttribute* amountAttr = fieldList[i]->FindAttributeByName(KAmount); |
|
203 |
const CCreatorScriptAttribute* rndLenAttr = fieldList[i]->FindAttributeByName(KRandomLength); |
|
204 |
const CCreatorScriptAttribute* increaseAttr = fieldList[i]->FindAttributeByName(KIncrease); |
|
205 |
TBool increase( EFalse ); |
|
206 |
if ( increaseAttr ) |
|
207 |
{ |
|
208 |
increase = ConvertStrToBooleanL( increaseAttr->Value() ); |
|
209 |
} |
|
210 |
for( TInt j = 0; j < fieldMappingTblSize; ++j ) |
|
211 |
{ |
|
212 |
const FieldMapping& mapping = fieldMappingTbl[j]; |
|
213 |
if( fieldName == mapping.iElementName ) |
|
214 |
{ |
|
215 |
TInt rndLen = 0; |
|
216 |
TPtrC content = fieldList[i]->Content(); |
|
217 |
||
218 |
// MCreatorRandomDataField::TRandomLengthType randomLenType = MCreatorRandomDataField::ERandomLengthUndefined; |
|
219 |
||
220 |
if( content == TPtrC(KEmpty) || content == TPtrC(KNullDesC) ) |
|
221 |
{ |
|
31 | 222 |
CCreatorContactField* field = CCreatorContactField::NewL(); |
223 |
CleanupStack::PushL(field); |
|
224 |
field->AddFieldToParamL( iEngine,param, mapping.iFieldCode, KErrNotFound ); |
|
225 |
CleanupStack::Pop(field); |
|
27 | 226 |
} |
227 |
else |
|
31 | 228 |
{ |
229 |
CCreatorContactField* field = CCreatorContactField::NewL(); |
|
230 |
CleanupStack::PushL(field); |
|
231 |
field->AddFieldToParamL( param, mapping.iFieldCode, content ); |
|
232 |
CleanupStack::Pop(field); |
|
233 |
} |
|
234 |
||
27 | 235 |
|
236 |
break; |
|
237 |
||
238 |
} |
|
239 |
} |
|
240 |
||
241 |
} |
|
242 |
} |
|
243 |
else |
|
244 |
{ |
|
245 |
// No fields specified, so add all fields with random content: |
|
246 |
for( TInt i = 0; i < fieldMappingTblSize; ++i ) |
|
247 |
{ |
|
248 |
if( fieldMappingTbl[i].iElementName == KThumbnailId || |
|
249 |
fieldMappingTbl[i].iElementName == KRingToneId ) |
|
250 |
{ |
|
251 |
// Skip thumbnail and ringtone IDs, since they are duplicates with thumbnailpath and ringtonepath |
|
252 |
continue; |
|
253 |
} |
|
31 | 254 |
CCreatorContactField* field = CCreatorContactField::NewL(); |
255 |
CleanupStack::PushL(field); |
|
256 |
field->AddFieldToParamL( iEngine,param, fieldMappingTbl[i].iFieldCode, KErrNotFound ); |
|
257 |
CleanupStack::Pop(field); |
|
258 |
} |
|
27 | 259 |
|
260 |
} |
|
261 |
iEngine->AppendToCommandArrayL(ECmdCreatePhoneBookEntryContacts, param); |
|
262 |
iParameters.AppendL(param); // Save the pointer to the parametes. |
|
263 |
CleanupStack::Pop(param); |
|
264 |
} |
|
265 |
} |
|
266 |
||
267 |
||
268 |
/* |
|
269 |
void CCreatorContactElement::ExecuteCommandL() |
|
17
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
270 |
{} |
27 | 271 |
*/ |
17
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
272 |
CCreatorContactSetElement* CCreatorContactSetElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
273 |
{ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
274 |
LOGSTRING("Creator: CCreatorContactSetElement::NewL"); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
275 |
CCreatorContactSetElement* self = new (ELeave) CCreatorContactSetElement(aEngine); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
276 |
CleanupStack::PushL(self); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
277 |
self->ConstructL(aName, aContext); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
278 |
CleanupStack::Pop(); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
279 |
return self; |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
280 |
} |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
281 |
CCreatorContactSetElement::CCreatorContactSetElement(CCreatorEngine* aEngine) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
282 |
: |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
283 |
CCreatorContactElementBase(aEngine) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
284 |
{ } |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
285 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
286 |
void CCreatorContactSetElement::ExecuteCommandL() |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
287 |
{ } |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
288 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
289 |
void CCreatorContactSetElement::AddToCacheL() |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
290 |
{ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
291 |
LOGSTRING("Creator: CCreatorContactSetElement::AddToCacheL"); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
292 |
const CCreatorScriptAttribute* linkIdAttr = this->FindAttributeByName(KId); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
293 |
const CCreatorScriptAttribute* existingElemsAttr = this->FindAttributeByName(KExistingContacts); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
294 |
TInt numOfExistingContacts = 0; |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
295 |
if( existingElemsAttr ) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
296 |
{ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
297 |
numOfExistingContacts = ConvertStrToIntL(existingElemsAttr->Value()); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
298 |
} |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
299 |
if( linkIdAttr ) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
300 |
{ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
301 |
TInt linkId = ConvertStrToIntL(linkIdAttr->Value()); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
302 |
if( linkId > 0 ) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
303 |
{ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
304 |
CCreatorContactSet* newSet = CCreatorContactSet::NewL(linkId, numOfExistingContacts); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
305 |
CleanupStack::PushL(newSet); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
306 |
ContactLinkCache::Instance()->AppendL(newSet); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
307 |
CleanupStack::Pop(newSet); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
308 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
309 |
// Mark sub-elements (i.e. contacts) to this contact-set: |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
310 |
for( TInt i = 0; i < iSubElements.Count(); ++i ) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
311 |
{ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
312 |
for( TInt j = 0; j < iSubElements[i]->CommandParameters().Count(); ++j) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
313 |
{ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
314 |
CCreatorModuleBaseParameters* params = iSubElements[i]->CommandParameters()[j]; |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
315 |
if( params ) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
316 |
{ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
317 |
params->SetScriptLinkId(linkId); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
318 |
} |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
319 |
} |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
320 |
} |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
321 |
} |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
322 |
} |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
323 |
} |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
324 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
325 |
CCreatorContactGroupElement* CCreatorContactGroupElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
326 |
{ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
327 |
LOGSTRING("Creator: CCreatorContactGroupElement::NewL"); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
328 |
CCreatorContactGroupElement* self = new (ELeave) CCreatorContactGroupElement(aEngine); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
329 |
CleanupStack::PushL(self); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
330 |
self->ConstructL(aName, aContext); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
331 |
CleanupStack::Pop(); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
332 |
return self; |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
333 |
} |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
334 |
CCreatorContactGroupElement::CCreatorContactGroupElement(CCreatorEngine* aEngine) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
335 |
: |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
336 |
CCreatorContactElementBase(aEngine) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
337 |
{ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
338 |
iIsCommandElement = ETrue; |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
339 |
} |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
340 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
341 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
342 |
void CCreatorContactGroupElement::ExecuteCommandL() |
27 | 343 |
{ |
344 |
LOGSTRING("Creator: CCreatorContactGroupElement::ExecuteCommandL"); |
|
345 |
// Get attributes (amount and name) |
|
346 |
const CCreatorScriptAttribute* groupAmountAttr = this->FindAttributeByName(KAmount); |
|
347 |
const CCreatorScriptAttribute* groupNameAttr = this->FindAttributeByName(KName); |
|
348 |
// How many groups to create: |
|
349 |
TInt groupAmount = 1; |
|
350 |
if( groupAmountAttr ) |
|
351 |
{ |
|
352 |
groupAmount = ConvertStrToIntL(groupAmountAttr->Value()); |
|
353 |
} |
|
354 |
||
355 |
for( TInt i = 0; i < groupAmount; ++i ) |
|
356 |
{ |
|
357 |
CCreatorScriptElement* membersElement = FindSubElement(KMembers); |
|
358 |
||
359 |
if( membersElement ) |
|
360 |
{ |
|
361 |
CPhonebookParameters* param = (CPhonebookParameters*) TCreatorFactory::CreatePhoneBookParametersL(); |
|
362 |
CleanupStack::PushL(param); |
|
363 |
||
364 |
// Links to contact-sets: |
|
365 |
const RPointerArray<CCreatorScriptElement>& linkList = membersElement->SubElements(); |
|
366 |
if( linkList.Count() > 0 ) |
|
367 |
{ |
|
368 |
for( TInt i = 0; i < linkList.Count(); ++i ) |
|
369 |
{ |
|
370 |
AppendContactSetReferenceL(*linkList[i], param->iLinkIds); |
|
371 |
} |
|
372 |
} |
|
373 |
||
374 |
if( groupNameAttr ) |
|
375 |
{ |
|
31 | 376 |
param->iGroupName->Des().Copy( groupNameAttr->Value() ); |
27 | 377 |
} |
378 |
else |
|
31 | 379 |
{ |
380 |
param->iGroupName->Des().Copy( iEngine->RandomString(CCreatorEngine::EGroupName) ); |
|
27 | 381 |
} |
382 |
iEngine->AppendToCommandArrayL(ECmdCreatePhoneBookEntryGroups, param); |
|
383 |
CleanupStack::Pop(param); |
|
384 |
} |
|
385 |
} |
|
386 |
} |
|
387 |
||
388 |
/* |
|
389 |
void CCreatorContactGroupElement::ExecuteCommandL() |
|
17
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
390 |
{} |
27 | 391 |
*/ |
17
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
392 |
CCreatorContactFieldElement* CCreatorContactFieldElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
393 |
{ |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
394 |
LOGSTRING("Creator: CCreatorContactFieldElement::NewL"); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
395 |
CCreatorContactFieldElement* self = new (ELeave) CCreatorContactFieldElement(aEngine); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
396 |
CleanupStack::PushL(self); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
397 |
self->ConstructL(aName, aContext); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
398 |
CleanupStack::Pop(); |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
399 |
return self; |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
400 |
} |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
401 |
|
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
402 |
CCreatorContactFieldElement::CCreatorContactFieldElement(CCreatorEngine* aEngine) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
403 |
: |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
404 |
CCreatorScriptElement(aEngine) |
4f2773374eff
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
405 |
{ } |