author | Tom Sutcliffe <thomas.sutcliffe@accenture.com> |
Thu, 09 Sep 2010 15:47:34 +0100 | |
changeset 57 | 683f4b1f08ce |
parent 0 | 7f656887cf89 |
permissions | -rw-r--r-- |
0
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
1 |
// fcontacts.cpp |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
2 |
// |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
3 |
// Copyright (c) 2008 - 2010 Accenture. All rights reserved. |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
4 |
// This component and the accompanying materials are made available |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
5 |
// under the terms of the "Eclipse Public License v1.0" |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
6 |
// which accompanies this distribution, and is available |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
7 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
8 |
// |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
9 |
// Initial Contributors: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
10 |
// Accenture - Initial contribution |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
11 |
// |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
12 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
13 |
#include <fshell/ioutils.h> |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
14 |
#include <CNTDB.H> |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
15 |
#include <CNTITEM.H> |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
16 |
#include <CNTFLDST.H> |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
17 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
18 |
// Some things that v9.1 doesn't have |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
19 |
#include "fcontacts_support.h" |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
20 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
21 |
using namespace IoUtils; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
22 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
23 |
class CCmdContacts : public CCommandBase |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
24 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
25 |
public: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
26 |
static CCommandBase* NewLC(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
27 |
~CCmdContacts(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
28 |
private: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
29 |
CCmdContacts(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
30 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
31 |
TInt CheckDuplicateAndUpdate(CContactItemFieldSet &aFieldSet, CContactItemField &aField); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
32 |
void FillContactFieldSetL(CContactItemFieldSet &aFieldSet, TUid aType); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
33 |
void PrintContact(CContactItem* aContact); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
34 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
35 |
void PrintGroupContentsL(CContactItem* aContactGroup, TInt aVerboseLevel); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
36 |
void PrintGroupsJoined(CContactItem* aContact, TInt aVerboseLevel); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
37 |
void PrintTime(const TTime& aTime, TBool aNewline=EFalse); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
38 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
39 |
void PrintAcceptedOptions(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
40 |
static const TDesC* UidName(TUid aUid); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
41 |
private: // From CCommandBase. |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
42 |
virtual const TDesC& Name() const; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
43 |
virtual void DoRunL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
44 |
virtual void ArgumentsL(RCommandArgumentList& aArguments); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
45 |
virtual void OptionsL(RCommandOptionList& aOptions); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
46 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
47 |
void DoListL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
48 |
void DoAddL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
49 |
void DoDeleteL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
50 |
void DoChangeL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
51 |
void DoDeleteAllL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
52 |
void DoCreateGroupL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
53 |
void DoAddToGroupL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
54 |
void DoCompactL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
55 |
private: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
56 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
57 |
CContactDatabase* iDb; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
58 |
RArray<TBool> iVerbose; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
59 |
TInt iOptContactId; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
60 |
TInt iOptDestGrpId; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
61 |
HBufC* iMatch; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
62 |
TBool iShowFirstPhoneOnly; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
63 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
64 |
HBufC* iOptFirstName; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
65 |
HBufC* iOptLastName; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
66 |
HBufC* iOptTelephone; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
67 |
HBufC* iOptMobile; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
68 |
TFileName2 iOptPhotoFileName; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
69 |
HBufC* iOptGroupName; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
70 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
71 |
HBufC* iOptStr; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
72 |
enum |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
73 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
74 |
EList, EAdd, EDelete, EChange, EDeleteAll, ECreateGroup, EAddToGroup, ECompact |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
75 |
} iCommand; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
76 |
}; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
77 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
78 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
79 |
CCommandBase* CCmdContacts::NewLC() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
80 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
81 |
CCmdContacts* self = new(ELeave) CCmdContacts(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
82 |
CleanupStack::PushL(self); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
83 |
self->BaseConstructL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
84 |
return self; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
85 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
86 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
87 |
CCmdContacts::~CCmdContacts() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
88 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
89 |
delete iOptFirstName; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
90 |
delete iOptLastName; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
91 |
delete iOptTelephone; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
92 |
delete iOptMobile; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
93 |
delete iOptGroupName; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
94 |
delete iOptStr; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
95 |
delete iMatch; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
96 |
delete iDb; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
97 |
iVerbose.Close(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
98 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
99 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
100 |
CCmdContacts::CCmdContacts() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
101 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
102 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
103 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
104 |
const TDesC& CCmdContacts::Name() const |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
105 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
106 |
_LIT(KName, "fcontacts"); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
107 |
return KName; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
108 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
109 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
110 |
void CCmdContacts::ArgumentsL(RCommandArgumentList& aArguments) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
111 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
112 |
aArguments.AppendEnumL((TInt&)iCommand, _L("command")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
113 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
114 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
115 |
void CCmdContacts::OptionsL(RCommandOptionList& aOptions) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
116 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
117 |
aOptions.AppendBoolL(iVerbose, _L("verbose")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
118 |
aOptions.AppendUintL((TUint&)iOptContactId, _L("contact-id")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
119 |
aOptions.AppendUintL((TUint&)iOptDestGrpId, _L("group-id")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
120 |
aOptions.AppendStringL(iMatch, _L("match")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
121 |
aOptions.AppendBoolL(iShowFirstPhoneOnly, _L("first-phone-only")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
122 |
aOptions.AppendStringL(iOptFirstName, _L("first-name")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
123 |
aOptions.AppendStringL(iOptLastName, _L("last-name")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
124 |
aOptions.AppendStringL(iOptTelephone, _L("telephone")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
125 |
aOptions.AppendStringL(iOptMobile, _L("mobile")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
126 |
aOptions.AppendFileNameL(iOptPhotoFileName, _L("photo")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
127 |
aOptions.AppendStringL(iOptGroupName, _L("group")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
128 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
129 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
130 |
void CCmdContacts::DoRunL() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
131 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
132 |
TRAPD(err, iDb = CContactDatabase::OpenL()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
133 |
LeaveIfErr(err, _L("Couldn't open contacts database")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
134 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
135 |
switch (iCommand) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
136 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
137 |
case EList: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
138 |
DoListL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
139 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
140 |
case EAdd: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
141 |
DoAddL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
142 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
143 |
case EDelete: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
144 |
DoDeleteL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
145 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
146 |
case EChange: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
147 |
DoChangeL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
148 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
149 |
case EDeleteAll: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
150 |
DoDeleteAllL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
151 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
152 |
case ECreateGroup: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
153 |
DoCreateGroupL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
154 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
155 |
case EAddToGroup: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
156 |
DoAddToGroupL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
157 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
158 |
case ECompact: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
159 |
DoCompactL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
160 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
161 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
162 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
163 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
164 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
165 |
void CCmdContacts::DoListL() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
166 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
167 |
if (iOptContactId) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
168 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
169 |
CContactItem* contact = NULL; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
170 |
TRAPD(err, contact = iDb->ReadContactL(iOptContactId)); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
171 |
LeaveIfErr(err, _L("Couldn't read contact %d"), iOptContactId); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
172 |
PrintContact(contact); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
173 |
delete contact; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
174 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
175 |
else |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
176 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
177 |
// List all |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
178 |
TContactIter iter(*iDb); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
179 |
TContactItemId id; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
180 |
TBool foundMatch = EFalse; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
181 |
while ((id = iter.NextL()) != KNullContactId) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
182 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
183 |
CContactItem* contact = iDb->ReadContactLC(id); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
184 |
TBool show = ETrue; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
185 |
if (iMatch) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
186 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
187 |
show = EFalse; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
188 |
CContactItemFieldSet& fields = contact->CardFields(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
189 |
TInt num = fields.Count(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
190 |
for (TInt i = 0; i < num; i++) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
191 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
192 |
CContactItemField& field = fields[i]; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
193 |
switch (field.StorageType()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
194 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
195 |
case KStorageTypeText: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
196 |
if (field.TextStorage()->Text().MatchF(*iMatch) != KErrNotFound) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
197 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
198 |
show = ETrue; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
199 |
foundMatch = ETrue; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
200 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
201 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
202 |
default: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
203 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
204 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
205 |
if (show) break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
206 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
207 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
208 |
if (show) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
209 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
210 |
PrintContact(contact); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
211 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
212 |
CleanupStack::PopAndDestroy(contact); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
213 |
if (show && iShowFirstPhoneOnly) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
214 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
215 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
216 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
217 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
218 |
if (iMatch && !foundMatch) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
219 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
220 |
User::Leave(KErrNotFound); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
221 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
222 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
223 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
224 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
225 |
void CCmdContacts::DoAddL() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
226 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
227 |
TContactItemId newId = 0; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
228 |
//create a "contact card" contact item |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
229 |
CContactItem* contact = CContactCard::NewLC(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
230 |
CContactItemFieldSet& fieldSet = contact->CardFields(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
231 |
FillContactFieldSetL(fieldSet, KUidContactCard); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
232 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
233 |
TRAPD(err, newId = iDb->AddNewContactL(*contact)); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
234 |
LeaveIfErr(err, _L("Could not add this contact")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
235 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
236 |
Printf(_L("Contact Added\r\nContact ID:%d\r\n"), newId); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
237 |
CleanupStack::PopAndDestroy(contact); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
238 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
239 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
240 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
241 |
void CCmdContacts::DoDeleteL() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
242 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
243 |
if (iOptContactId) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
244 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
245 |
TRAPD(err, iDb->DeleteContactL(iOptContactId)); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
246 |
if (err == KErrNone) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
247 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
248 |
Printf(_L("Contact %d deleted\r\n"), iOptContactId); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
249 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
250 |
else |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
251 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
252 |
LeaveIfErr(err, _L("Could not detelet contact item %d"), iOptContactId); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
253 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
254 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
255 |
else |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
256 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
257 |
LeaveIfErr(KErrArgument, _L("No contact id specified. Use -i to specify a contact ID")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
258 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
259 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
260 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
261 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
262 |
void CCmdContacts::DoChangeL() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
263 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
264 |
if (iOptContactId) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
265 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
266 |
PrintAcceptedOptions(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
267 |
CContactItem* contact = NULL; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
268 |
TRAPD(err, contact = iDb->OpenContactL(iOptContactId)); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
269 |
LeaveIfErr(err, _L("could not open contact item %d"), iOptContactId); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
270 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
271 |
CleanupStack::PushL(contact); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
272 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
273 |
CContactItemFieldSet& FieldSet = contact->CardFields(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
274 |
FillContactFieldSetL(FieldSet, KUidContactCard); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
275 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
276 |
TRAP(err, iDb->CommitContactL(*contact)); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
277 |
LeaveIfErr(err, _L("Could not commit the change for item %d"), iOptContactId); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
278 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
279 |
CleanupStack::PopAndDestroy(contact); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
280 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
281 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
282 |
else |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
283 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
284 |
LeaveIfErr(KErrArgument, _L("No contact id specified. Use -i to specify a contact ID")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
285 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
286 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
287 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
288 |
void CCmdContacts::DoDeleteAllL() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
289 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
290 |
TInt TotalErrors = 0; //how many items are not deleted due to error |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
291 |
TInt ContactItemCnt = iDb->CountL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
292 |
Printf(_L("Database contains %d items \r\n"), ContactItemCnt); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
293 |
// List all |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
294 |
TContactIter iter(*iDb); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
295 |
TContactItemId id; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
296 |
while ((id = iter.NextL()) != KNullContactId) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
297 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
298 |
Printf(_L("Deleting contact item %d ..."), id); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
299 |
TRAPD(err, iDb->DeleteContactL(id)); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
300 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
301 |
if (err==KErrNone) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
302 |
Printf(_L("done \r\n"), id); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
303 |
else |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
304 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
305 |
TotalErrors++; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
306 |
Printf(_L("fail, error code=%d \r\n"), err); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
307 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
308 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
309 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
310 |
if (TotalErrors > 0) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
311 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
312 |
LeaveIfErr(KErrGeneral, _L("%d items are not deleted due to error"), TotalErrors); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
313 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
314 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
315 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
316 |
void CCmdContacts::DoCreateGroupL() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
317 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
318 |
Printf(_L("Creating a new group... \r\n")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
319 |
CContactItem* contact = NULL; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
320 |
TRAPD(err, contact = iDb->CreateContactGroupL()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
321 |
LeaveIfErr(err, _L("Could not create contact group")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
322 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
323 |
CleanupStack::PushL(contact); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
324 |
TContactItemId GroupId = contact->Id(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
325 |
CleanupStack::PopAndDestroy(contact); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
326 |
contact = NULL; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
327 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
328 |
/////////////////////////////////////////////////// |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
329 |
TRAP(err, contact = iDb->OpenContactL(GroupId)); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
330 |
LeaveIfErr(err, _L("Could not open contact group for editing")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
331 |
CleanupStack::PushL(contact); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
332 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
333 |
Printf(_L("Changing group name for contact item %d... \r\n"), GroupId); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
334 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
335 |
CContactItemFieldSet& FieldSet = contact->CardFields(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
336 |
FillContactFieldSetL(FieldSet, KUidContactGroup); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
337 |
TRAP(err, iDb->CommitContactL(*contact)); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
338 |
LeaveIfErr(err, _L("Could not sumbit the change")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
339 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
340 |
CleanupStack::PopAndDestroy(contact); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
341 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
342 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
343 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
344 |
void CCmdContacts::DoCompactL() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
345 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
346 |
TRAPD(err, iDb->CompactL()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
347 |
LeaveIfErr(err, _L("Could not compact the database")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
348 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
349 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
350 |
void CCmdContacts::DoAddToGroupL() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
351 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
352 |
if (iOptContactId && iOptDestGrpId) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
353 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
354 |
Printf(_L("Adding contact item %d to destination group item %d \r\n"), |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
355 |
iOptContactId, iOptDestGrpId); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
356 |
TRAPD(err, iDb->AddContactToGroupL( (TContactItemId)iOptContactId, (TContactItemId)iOptDestGrpId) ) ; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
357 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
358 |
//this is most common mistake, need to point out especially to remind the user. |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
359 |
if (err==KErrNotSupported) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
360 |
PrintError(KErrNotSupported, _L("Destination is not a group")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
361 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
362 |
User::LeaveIfError(err); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
363 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
364 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
365 |
else |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
366 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
367 |
LeaveIfErr(KErrArgument, _L("No contact id specified. Use -i to specify a contact ID")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
368 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
369 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
370 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
371 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
372 |
// FOR TEST PURPOSE |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
373 |
//to check if a field of the same type has already existed in a FieldSet. |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
374 |
//if yes, delete that field first and then add it |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
375 |
TInt CCmdContacts::CheckDuplicateAndUpdate(CContactItemFieldSet &aFieldSet, CContactItemField &aField) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
376 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
377 |
const CContentType &newContentType=aField.ContentType(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
378 |
TInt fieldPos=0; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
379 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
380 |
TInt FieldCnt = aFieldSet.Count(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
381 |
for(; fieldPos<FieldCnt ; fieldPos++ ) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
382 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
383 |
CContactItemField& TestedField = aFieldSet[fieldPos]; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
384 |
if (newContentType == TestedField.ContentType()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
385 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
386 |
aFieldSet.Remove(fieldPos); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
387 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
388 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
389 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
390 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
391 |
if (aField.Storage()->IsFull()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
392 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
393 |
CContactItemField* field=CContactItemField::NewLC(aField); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
394 |
aFieldSet.InsertL(fieldPos,*field); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
395 |
CleanupStack::Pop(); // field |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
396 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
397 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
398 |
return 0; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
399 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
400 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
401 |
//this function will retrieve infomation from command line arguments and fill them into |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
402 |
//a field set, FieldSet doesn't have to be empty |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
403 |
//aType: either KUidContactCard or KUidContactGroup |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
404 |
void CCmdContacts::FillContactFieldSetL(CContactItemFieldSet &aFieldSet, TUid aType) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
405 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
406 |
if (aType == KUidContactGroup) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
407 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
408 |
//group name |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
409 |
if (iOptGroupName && iOptGroupName->Length()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
410 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
411 |
CContactItemField* field = NULL; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
412 |
field = CContactItemField::NewLC(KStorageTypeText); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
413 |
field->SetLabelL(_L("Group Label")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
414 |
field->SetMapping(KUidContactFieldNone); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
415 |
field->AddFieldTypeL(KUidContactFieldTemplateLabel); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
416 |
CContactTextField* pFieldText = field->TextStorage(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
417 |
pFieldText->SetTextL(*iOptGroupName); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
418 |
aFieldSet.UpdateFieldL(*field, 1); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
419 |
CleanupStack::PopAndDestroy(field); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
420 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
421 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
422 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
423 |
//Synchronization, for both Group and normal contacts |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
424 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
425 |
CContactItemField* field = NULL; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
426 |
field = CContactItemField::NewLC(KStorageTypeText); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
427 |
field->SetLabelL(_L("Synchronization")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
428 |
field->SetMapping(KUidContactFieldVCardMapClass); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
429 |
field->AddFieldTypeL(KUidContactFieldClass); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
430 |
CContactTextField* pFieldText = field->TextStorage(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
431 |
pFieldText->SetTextL(_L("private")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
432 |
aFieldSet.UpdateFieldL(*field, 1); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
433 |
CleanupStack::PopAndDestroy(field); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
434 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
435 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
436 |
if (aType == KUidContactCard) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
437 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
438 |
//last name |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
439 |
if (iOptLastName && iOptLastName->Length()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
440 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
441 |
CContactItemField* field = NULL; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
442 |
field = CContactItemField::NewLC(KStorageTypeText); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
443 |
field->SetLabelL(_L("Last name")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
444 |
field->SetMapping(KUidContactFieldVCardMapUnusedN); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
445 |
field->AddFieldTypeL(KUidContactFieldFamilyName); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
446 |
CContactTextField* pFieldText = field->TextStorage(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
447 |
pFieldText->SetTextL(*iOptLastName); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
448 |
aFieldSet.UpdateFieldL(*field, 1); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
449 |
CleanupStack::PopAndDestroy(field); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
450 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
451 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
452 |
//first name |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
453 |
if (iOptFirstName && iOptFirstName->Length()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
454 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
455 |
CContactItemField* field = NULL; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
456 |
field = CContactItemField::NewLC(KStorageTypeText); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
457 |
field->SetLabelL(_L("First name")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
458 |
field->SetMapping(KUidContactFieldVCardMapUnusedN); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
459 |
field->AddFieldTypeL(KUidContactFieldGivenName); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
460 |
CContactTextField* pFieldText = field->TextStorage(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
461 |
pFieldText->SetTextL(*iOptFirstName); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
462 |
aFieldSet.UpdateFieldL(*field, 1); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
463 |
CleanupStack::PopAndDestroy(field); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
464 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
465 |
//general telephone |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
466 |
if (iOptTelephone && iOptTelephone->Length()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
467 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
468 |
CContactItemField* field = NULL; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
469 |
field = CContactItemField::NewLC(KStorageTypeText); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
470 |
field->SetLabelL(_L("Telephone")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
471 |
field->SetMapping(KUidContactFieldVCardMapTEL); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
472 |
field->AddFieldTypeL(KUidContactFieldPhoneNumber); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
473 |
field->AddFieldTypeL(KUidContactFieldVCardMapVOICE); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
474 |
CContactTextField* pFieldText = field->TextStorage(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
475 |
pFieldText->SetTextL(*iOptTelephone); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
476 |
aFieldSet.UpdateFieldL(*field, 1); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
477 |
CleanupStack::PopAndDestroy(field); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
478 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
479 |
//mobile phone |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
480 |
if (iOptMobile && iOptMobile->Length()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
481 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
482 |
CContactItemField* field = NULL; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
483 |
field = CContactItemField::NewLC(KStorageTypeText); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
484 |
field->SetLabelL(_L("Mobile")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
485 |
field->SetMapping(KUidContactFieldVCardMapTEL); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
486 |
field->AddFieldTypeL(KUidContactFieldPhoneNumber); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
487 |
field->AddFieldTypeL(KUidContactFieldVCardMapCELL); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
488 |
CContactTextField* pFieldText = field->TextStorage(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
489 |
pFieldText->SetTextL(*iOptMobile); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
490 |
aFieldSet.UpdateFieldL(*field, 1); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
491 |
CleanupStack::PopAndDestroy(field); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
492 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
493 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
494 |
//photo |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
495 |
if (iOptPhotoFileName.Length()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
496 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
497 |
RFile file; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
498 |
LeaveIfErr(file.Open(FsL(), iOptPhotoFileName, EFileRead), _L("Couldn't open file \"%S\""), &iOptPhotoFileName); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
499 |
TInt fileSize; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
500 |
LeaveIfErr(file.Size(fileSize), _L("Couldn't read the size of file \"%S\""), &iOptPhotoFileName); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
501 |
RBuf8 buf; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
502 |
buf.Create(fileSize); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
503 |
buf.CleanupClosePushL(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
504 |
LeaveIfErr(file.Read(buf), _L("Couldn't read the contents of file \"%S\""), &iOptPhotoFileName); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
505 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
506 |
CContactItemField* field = CContactItemField::NewLC(KStorageTypeStore); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
507 |
field->SetLabelL(_L("Photo")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
508 |
field->SetMapping(KUidContactFieldVCardMapPHOTO); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
509 |
field->AddFieldTypeL(KUidContactFieldPicture); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
510 |
CContactStoreField* storeField = field->StoreStorage(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
511 |
storeField->SetThingL(buf); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
512 |
aFieldSet.UpdateFieldL(*field, 1); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
513 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
514 |
CleanupStack::PopAndDestroy(2, &buf); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
515 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
516 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
517 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
518 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
519 |
void CCmdContacts::PrintContact(CContactItem* aContact) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
520 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
521 |
TContactItemId ContactId = aContact->Id(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
522 |
TUid ContactType = aContact->Type(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
523 |
CContactItemFieldSet& fields = aContact->CardFields(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
524 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
525 |
TBool verbose = (iVerbose.Count() > 0); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
526 |
TBool veryverbose = (iVerbose.Count() > 1); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
527 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
528 |
if (verbose) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
529 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
530 |
Printf(_L("Contact item id %d:\r\n"), aContact->Id()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
531 |
Printf(_L("\tLast modified: ")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
532 |
PrintTime(aContact->LastModified(), ETrue); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
533 |
if (veryverbose) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
534 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
535 |
Printf(_L("\tHidden=%d System=%d AccessCount=%d Deleted=%d\r\n"), aContact->IsHidden(), aContact->IsSystem(), aContact->AccessCount(), aContact->IsDeleted()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
536 |
TPtrC uid = aContact->UidStringL(iDb->MachineId()); // Don't understand the syntax of this function |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
537 |
Printf(_L("\tUid: %S\r\n"), &uid); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
538 |
TUint32 type = aContact->Type().iUid; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
539 |
Printf(_L("\tType: 0x%08x "), type); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
540 |
switch (type) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
541 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
542 |
case KUidContactCardValue: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
543 |
Printf(_L("(KUidContactCard)\r\n")); break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
544 |
case KUidContactGroupValue: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
545 |
Printf(_L("(KUidContactGroup)\r\n")); break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
546 |
case KUidContactOwnCardValue: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
547 |
Printf(_L("(KUidContactOwnCard)\r\n")); break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
548 |
case KUidContactICCEntryValue: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
549 |
Printf(_L("(KUidContactICCEntry)\r\n")); break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
550 |
case KUidContactTemplateValue: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
551 |
Printf(_L("(KUidContactTemplate)\r\n")); break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
552 |
case KUidContactCardTemplateValue: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
553 |
Printf(_L("(KUidContactCardTemplate)\r\n")); break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
554 |
default: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
555 |
Printf(_L("(Unknown)\r\n")); break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
556 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
557 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
558 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
559 |
PrintGroupContentsL(aContact, iVerbose.Count()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
560 |
PrintGroupsJoined(aContact, iVerbose.Count()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
561 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
562 |
TInt num = fields.Count(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
563 |
for (TInt i = 0; i < num; i++) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
564 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
565 |
CContactItemField& field = fields[i]; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
566 |
TPtrC label = field.Label(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
567 |
Printf(_L("\t%d [%S]: "), field.Id(), &label); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
568 |
switch (field.StorageType()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
569 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
570 |
case KStorageTypeText: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
571 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
572 |
TPtrC fieldText = field.TextStorage()->Text(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
573 |
Printf(_L("KStorageTypeText: %S\r\n"), &fieldText); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
574 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
575 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
576 |
case KStorageTypeDateTime: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
577 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
578 |
TTime time = field.DateTimeStorage()->Time(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
579 |
PrintTime(time, ETrue); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
580 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
581 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
582 |
case KStorageTypeStore: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
583 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
584 |
HBufC8* thing = field.StoreStorage()->Thing(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
585 |
if (thing) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
586 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
587 |
Printf(_L("<Binary data of length %d>\r\n"), thing->Size()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
588 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
589 |
else |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
590 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
591 |
Printf(_L("<Null binary data>\r\n")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
592 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
593 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
594 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
595 |
case KStorageTypeContactItemId: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
596 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
597 |
Printf(_L("<Contact item id %d>\r\n"), field.AgentStorage()->Value()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
598 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
599 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
600 |
default: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
601 |
Printf(_L("<Unknown storage type>")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
602 |
break; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
603 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
604 |
if (veryverbose) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
605 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
606 |
Printf(_L("\t\tDeleted=%d Disabled=%d Hidden=%d Private=%d Readonly=%d SpeedDial=%d\r\n"), field.IsDeleted(), field.IsDisabled(), field.IsHidden(), field.IsPrivate(), field.IsReadOnly(), field.IsSpeedDial()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
607 |
Printf(_L("\t\tUser flags: 0x%08x\r\n"), field.UserFlags()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
608 |
const CContentType& contentType = field.ContentType(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
609 |
Printf(_L("\t\tVCard mapping: 0x%08x (%S)\r\n"), contentType.Mapping(), UidName(contentType.Mapping())); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
610 |
TInt fieldTypeCount = contentType.FieldTypeCount(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
611 |
for (TInt i = 0; i < fieldTypeCount; i++) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
612 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
613 |
TUid fieldType = contentType.FieldType(i); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
614 |
Printf(_L("\t\tField type %d: 0x%08x (%S)\r\n"), i, fieldType, UidName(fieldType)); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
615 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
616 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
617 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
618 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
619 |
else |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
620 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
621 |
TInt found; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
622 |
if (ContactType == KUidContactGroup) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
623 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
624 |
TPtrC GroupName; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
625 |
found = fields.Find(KUidContactFieldTemplateLabel, KUidContactFieldNone); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
626 |
if (found != KErrNotFound) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
627 |
GroupName.Set( fields[found].TextStorage()->Text() ); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
628 |
else |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
629 |
GroupName.Set(_L("[Unnamed]")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
630 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
631 |
Printf(_L("%d. [Group] %S "), ContactId, &GroupName); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
632 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
633 |
//list containing items... |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
634 |
PrintGroupContentsL(aContact, 0); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
635 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
636 |
else |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
637 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
638 |
if (iShowFirstPhoneOnly) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
639 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
640 |
found = fields.Find(KUidContactFieldPhoneNumber); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
641 |
if (found != KErrNotFound) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
642 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
643 |
TPtrC phone = TPtrC(fields[found].TextStorage()->Text()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
644 |
Printf(_L("%S"), &phone); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
645 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
646 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
647 |
else |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
648 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
649 |
TPtrC first; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
650 |
found = fields.Find(KUidContactFieldGivenName); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
651 |
if (found != KErrNotFound) first.Set(fields[found].TextStorage()->Text()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
652 |
TPtrC last; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
653 |
found = fields.Find(KUidContactFieldFamilyName); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
654 |
if (found != KErrNotFound) last.Set(fields[found].TextStorage()->Text()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
655 |
TPtrC phone; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
656 |
found = fields.Find(KUidContactFieldPhoneNumber); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
657 |
if (found != KErrNotFound) phone.Set(fields[found].TextStorage()->Text()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
658 |
Printf(_L("%d. %S %S %S\r\n"), ContactId, &first, &last, &phone); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
659 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
660 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
661 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
662 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
663 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
664 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
665 |
//This function will not LEAVE for the moment |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
666 |
//aVerboseLevel: possible values: 0 1 2 |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
667 |
// |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
668 |
void CCmdContacts::PrintGroupContentsL(CContactItem* aContactGroup, TInt /*aVerboseLevel*/) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
669 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
670 |
if (aContactGroup->Type() == KUidContactGroup) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
671 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
672 |
CContactGroup* pContactGroup = (CContactGroup*)aContactGroup; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
673 |
const CContactIdArray* pContactIdAry = pContactGroup->ItemsContained(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
674 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
675 |
// |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
676 |
TInt ElementCount = pContactIdAry->Count(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
677 |
Printf(_L("\tThis Group contains %d items."), ElementCount); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
678 |
if (ElementCount) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
679 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
680 |
Printf(_L(" Member contact ID list: ")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
681 |
TInt i; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
682 |
for (i=0; i<ElementCount; i++) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
683 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
684 |
TContactItemId ID = (*pContactIdAry) [i]; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
685 |
Printf(_L("%d "), ID); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
686 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
687 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
688 |
Printf(_L("\r\n")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
689 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
690 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
691 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
692 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
693 |
void CCmdContacts::PrintGroupsJoined(CContactItem* aContact, TInt aVerboseLevel) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
694 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
695 |
if (aVerboseLevel < 1) return; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
696 |
TUid ContactType = aContact->Type(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
697 |
if (ContactType == KUidContactGroup || ContactType == KUidContactCard) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
698 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
699 |
CContactItemPlusGroup * pContact = (CContactItemPlusGroup *)aContact; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
700 |
const CContactIdArray* pContactIdAry = pContact->GroupsJoined(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
701 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
702 |
if (!pContactIdAry) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
703 |
return; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
704 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
705 |
TInt ElementCount = pContactIdAry->Count(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
706 |
Printf(_L("\tThis item belongs to %d groups."), ElementCount); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
707 |
if (ElementCount) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
708 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
709 |
Printf(_L(" Group contact ID list: ")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
710 |
TInt i; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
711 |
for (i=0; i<ElementCount; i++) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
712 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
713 |
TContactItemId ID = (*pContactIdAry) [i]; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
714 |
Printf(_L("%d "), ID); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
715 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
716 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
717 |
Printf(_L("\r\n")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
718 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
719 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
720 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
721 |
void CCmdContacts::PrintTime(const TTime& aTime, TBool aNewline) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
722 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
723 |
_LIT8(KDateTimeFormat, "%d-%02d-%02d %02d:%02d:%02d"); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
724 |
TDateTime dt = aTime.DateTime(); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
725 |
Printf(KDateTimeFormat, dt.Year(), dt.Month()+1, dt.Day()+1, dt.Hour(), dt.Minute(), dt.Second()); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
726 |
if (aNewline) Printf(_L("\r\n")); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
727 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
728 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
729 |
//print the accepted options from the command line |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
730 |
void CCmdContacts::PrintAcceptedOptions() |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
731 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
732 |
//surname |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
733 |
if (iOptLastName && iOptLastName->Length()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
734 |
Printf(_L("surname: %S \r\n"), iOptLastName ); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
735 |
//first name |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
736 |
if (iOptFirstName && iOptFirstName->Length()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
737 |
Printf(_L("first name: %S \r\n"), iOptFirstName ); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
738 |
//general telephone |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
739 |
if (iOptTelephone && iOptTelephone->Length()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
740 |
Printf(_L("general telephone: %S \r\n"), iOptTelephone ); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
741 |
//mobile phone |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
742 |
if (iOptMobile && iOptMobile->Length()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
743 |
Printf(_L("mobile: %S \r\n"), iOptMobile ); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
744 |
//photo |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
745 |
if (iOptPhotoFileName.Length()) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
746 |
Printf(_L("photo: %S \r\n"), &iOptPhotoFileName ); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
747 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
748 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
749 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
750 |
#define CASE_LIT(x) case x: { _LIT(KName, #x); return &KName; } |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
751 |
const TDesC* CCmdContacts::UidName(TUid aUid) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
752 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
753 |
switch (aUid.iUid) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
754 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
755 |
CASE_LIT(KUidContactFieldAddressValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
756 |
CASE_LIT(KUidContactFieldPostOfficeValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
757 |
CASE_LIT(KUidContactFieldExtendedAddressValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
758 |
CASE_LIT(KUidContactFieldLocalityValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
759 |
CASE_LIT(KUidContactFieldRegionValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
760 |
CASE_LIT(KUidContactFieldPostCodeValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
761 |
CASE_LIT(KUidContactFieldCountryValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
762 |
CASE_LIT(KUidContactFieldCompanyNameValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
763 |
CASE_LIT(KUidContactFieldCompanyNamePronunciationValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
764 |
CASE_LIT(KUidContactFieldPhoneNumberValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
765 |
CASE_LIT(KUidContactFieldGivenNameValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
766 |
CASE_LIT(KUidContactFieldFamilyNameValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
767 |
CASE_LIT(KUidContactFieldGivenNamePronunciationValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
768 |
CASE_LIT(KUidContactFieldFamilyNamePronunciationValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
769 |
CASE_LIT(KUidContactFieldAdditionalNameValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
770 |
CASE_LIT(KUidContactFieldSuffixNameValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
771 |
CASE_LIT(KUidContactFieldPrefixNameValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
772 |
CASE_LIT(KUidContactFieldHiddenValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
773 |
CASE_LIT(KUidContactFieldEMailValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
774 |
CASE_LIT(KUidContactFieldMsgValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
775 |
CASE_LIT(KUidContactFieldSmsValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
776 |
CASE_LIT(KUidContactFieldFaxValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
777 |
CASE_LIT(KUidContactFieldDefinedTextValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
778 |
CASE_LIT(KUidContactFieldNoteValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
779 |
CASE_LIT(KUidContactFieldBirthdayValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
780 |
CASE_LIT(KUidContactFieldUrlValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
781 |
CASE_LIT(KUidContactFieldStorageInlineValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
782 |
CASE_LIT(KUidContactFieldTemplateLabelValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
783 |
CASE_LIT(KUidContactFieldPictureValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
784 |
CASE_LIT(KUidContactFieldRingToneValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
785 |
CASE_LIT(KUidContactFieldDTMFValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
786 |
CASE_LIT(KUidContactsVoiceDialFieldValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
787 |
CASE_LIT(KUidContactFieldNoneValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
788 |
CASE_LIT(KUidContactFieldJobTitleValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
789 |
CASE_LIT(KUidContactFieldICCSlotValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
790 |
CASE_LIT(KUidContactFieldICCPhonebookValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
791 |
CASE_LIT(KUidContactFieldICCGroupValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
792 |
CASE_LIT(KUidContactFieldIMAddressValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
793 |
CASE_LIT(KUidContactFieldSecondNameValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
794 |
CASE_LIT(KUidContactFieldSIPIDValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
795 |
CASE_LIT(KUidContactFieldAssistantValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
796 |
CASE_LIT(KUidContactFieldAnniversaryValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
797 |
CASE_LIT(KUidContactFieldSpouseValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
798 |
CASE_LIT(KUidContactFieldChildrenValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
799 |
CASE_LIT(KUidContactFieldClassValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
800 |
CASE_LIT(KUidContactFieldDepartmentNameValue) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
801 |
CASE_LIT(KIntContactFieldVCardMapWORK) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
802 |
CASE_LIT(KIntContactFieldVCardMapHOME) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
803 |
CASE_LIT(KIntContactFieldVCardMapMSG) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
804 |
CASE_LIT(KIntContactFieldVCardMapVOICE) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
805 |
CASE_LIT(KIntContactFieldVCardMapFAX) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
806 |
CASE_LIT(KIntContactFieldVCardMapPREF) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
807 |
CASE_LIT(KIntContactFieldVCardMapCELL) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
808 |
CASE_LIT(KIntContactFieldVCardMapPAGER) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
809 |
CASE_LIT(KIntContactFieldVCardMapBBS) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
810 |
CASE_LIT(KIntContactFieldVCardMapMODEM) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
811 |
CASE_LIT(KIntContactFieldVCardMapCAR) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
812 |
CASE_LIT(KIntContactFieldVCardMapISDN) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
813 |
CASE_LIT(KIntContactFieldVCardMapVIDEO) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
814 |
CASE_LIT(KIntContactFieldVCardMapDOM) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
815 |
CASE_LIT(KIntContactFieldVCardMapADR) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
816 |
CASE_LIT(KIntContactFieldVCardMapPOSTOFFICE) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
817 |
CASE_LIT(KIntContactFieldVCardMapEXTENDEDADR) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
818 |
CASE_LIT(KIntContactFieldVCardMapLOCALITY) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
819 |
CASE_LIT(KIntContactFieldVCardMapREGION) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
820 |
CASE_LIT(KIntContactFieldVCardMapPOSTCODE) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
821 |
CASE_LIT(KIntContactFieldVCardMapCOUNTRY) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
822 |
CASE_LIT(KIntContactFieldVCardMapAGENT) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
823 |
CASE_LIT(KIntContactFieldVCardMapBDAY) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
824 |
CASE_LIT(KIntContactFieldVCardMapEMAILINTERNET) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
825 |
CASE_LIT(KIntContactFieldVCardMapGEO) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
826 |
CASE_LIT(KIntContactFieldVCardMapLABEL) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
827 |
CASE_LIT(KIntContactFieldVCardMapLOGO) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
828 |
CASE_LIT(KIntContactFieldVCardMapMAILER) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
829 |
CASE_LIT(KIntContactFieldVCardMapNOTE) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
830 |
CASE_LIT(KIntContactFieldVCardMapORG) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
831 |
CASE_LIT(KIntContactFieldVCardMapORGPronunciation) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
832 |
CASE_LIT(KIntContactFieldVCardMapPHOTO) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
833 |
CASE_LIT(KIntContactFieldVCardMapROLE) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
834 |
CASE_LIT(KIntContactFieldVCardMapSOUND) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
835 |
CASE_LIT(KIntContactFieldVCardMapTEL) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
836 |
CASE_LIT(KIntContactFieldVCardMapTELFAX) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
837 |
CASE_LIT(KIntContactFieldVCardMapTITLE) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
838 |
CASE_LIT(KIntContactFieldVCardMapURL) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
839 |
CASE_LIT(KIntContactFieldVCardMapUnusedN) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
840 |
CASE_LIT(KIntContactFieldVCardMapUnusedFN) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
841 |
CASE_LIT(KIntContactFieldVCardMapNotRequired) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
842 |
CASE_LIT(KIntContactFieldVCardMapUnknownXDash) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
843 |
CASE_LIT(KIntContactFieldVCardMapUnknown) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
844 |
CASE_LIT(KIntContactFieldVCardMapUID) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
845 |
CASE_LIT(KIntContactFieldVCardMapINTL) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
846 |
CASE_LIT(KIntContactFieldVCardMapPOSTAL) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
847 |
CASE_LIT(KIntContactFieldVCardMapPARCEL) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
848 |
CASE_LIT(KIntContactFieldVCardMapGIF) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
849 |
CASE_LIT(KIntContactFieldVCardMapCGM) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
850 |
CASE_LIT(KIntContactFieldVCardMapWMF) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
851 |
CASE_LIT(KIntContactFieldVCardMapBMP) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
852 |
CASE_LIT(KIntContactFieldVCardMapMET) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
853 |
CASE_LIT(KIntContactFieldVCardMapPMB) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
854 |
CASE_LIT(KIntContactFieldVCardMapDIB) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
855 |
CASE_LIT(KIntContactFieldVCardMapPICT) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
856 |
CASE_LIT(KIntContactFieldVCardMapTIFF) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
857 |
CASE_LIT(KIntContactFieldVCardMapPDF) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
858 |
CASE_LIT(KIntContactFieldVCardMapPS) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
859 |
CASE_LIT(KIntContactFieldVCardMapJPEG) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
860 |
CASE_LIT(KIntContactFieldVCardMapMPEG) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
861 |
CASE_LIT(KIntContactFieldVCardMapMPEG2) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
862 |
CASE_LIT(KIntContactFieldVCardMapAVI) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
863 |
CASE_LIT(KIntContactFieldVCardMapQTIME) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
864 |
CASE_LIT(KIntContactFieldVCardMapTZ) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
865 |
CASE_LIT(KIntContactFieldVCardMapKEY) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
866 |
CASE_LIT(KIntContactFieldVCardMapX509) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
867 |
CASE_LIT(KIntContactFieldVCardMapPGP) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
868 |
CASE_LIT(KIntContactFieldVCardMapSMIME) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
869 |
CASE_LIT(KIntContactFieldVCardMapWV) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
870 |
CASE_LIT(KIntContactFieldVCardMapSECONDNAME) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
871 |
CASE_LIT(KIntContactFieldVCardMapSIPID) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
872 |
CASE_LIT(KIntContactFieldVCardMapPOC) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
873 |
CASE_LIT(KIntContactFieldVCardMapSWIS) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
874 |
CASE_LIT(KIntContactFieldVCardMapVOIP) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
875 |
CASE_LIT(KIntContactFieldVCardMapAssistant) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
876 |
CASE_LIT(KIntContactFieldVCardMapAssistantTel) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
877 |
CASE_LIT(KIntContactFieldVCardMapAnniversary) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
878 |
CASE_LIT(KIntContactFieldVCardMapSpouse) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
879 |
CASE_LIT(KIntContactFieldVCardMapChildren) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
880 |
CASE_LIT(KIntContactFieldVCardMapClass) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
881 |
CASE_LIT(KIntContactFieldVCardMapDepartment) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
882 |
default: |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
883 |
{ |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
884 |
_LIT(KUnknown, "Unknown"); |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
885 |
return &KUnknown; |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
886 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
887 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
888 |
} |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
889 |
|
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
890 |
EXE_BOILER_PLATE(CCmdContacts) |
7f656887cf89
First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff
changeset
|
891 |