46
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
#ifndef __CREATORPHONEBOOK_H__
|
|
22 |
#define __CREATORPHONEBOOK_H__
|
|
23 |
|
|
24 |
#include "creator_model.h"
|
|
25 |
#include "creator_phonebookbase.h"
|
|
26 |
|
|
27 |
|
|
28 |
#include <e32base.h>
|
|
29 |
#include <cntdef.h>
|
|
30 |
#include <cntdb.h>
|
|
31 |
#include <cntitem.h>
|
|
32 |
#include <cntfldst.h>
|
|
33 |
#include <cntview.h>
|
|
34 |
#include <CPbkContactEngine.h>
|
|
35 |
#include <CPbkContactItem.h>
|
|
36 |
#include <CPbkFieldInfo.h>
|
|
37 |
#include <CPbkFieldsInfo.h>
|
|
38 |
#include <PbkFields.hrh>
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
class CCreatorEngine;
|
|
43 |
class CCreatorModuleBaseParameters;
|
|
44 |
class CPhonebookParameters;
|
|
45 |
|
|
46 |
|
|
47 |
class CCreatorPhonebook : public CCreatorPhonebookBase
|
|
48 |
{
|
|
49 |
public:
|
|
50 |
static CCreatorPhonebook* NewL(CCreatorEngine* aEngine);
|
|
51 |
static CCreatorPhonebook* NewLC(CCreatorEngine* aEngine);
|
|
52 |
~CCreatorPhonebook();
|
|
53 |
|
|
54 |
private:
|
|
55 |
CCreatorPhonebook();
|
|
56 |
void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
|
|
57 |
|
|
58 |
public:
|
|
59 |
|
|
60 |
TInt CreateContactEntryL(CCreatorModuleBaseParameters *aParameters);
|
|
61 |
TInt CreateGroupEntryL(CCreatorModuleBaseParameters *aParameters);
|
|
62 |
TInt CreateSubscribedContactEntryL(CCreatorModuleBaseParameters *aParameters);
|
|
63 |
TBool IsActive(){ return EFalse; };
|
|
64 |
void CancelOperation() {};
|
|
65 |
void DeleteAllL();
|
|
66 |
void DeleteAllCreatedByCreatorL();
|
|
67 |
void DeleteAllGroupsL();
|
|
68 |
void DeleteAllGroupsCreatedByCreatorL();
|
|
69 |
|
|
70 |
|
|
71 |
private:
|
|
72 |
void CompactPbkDatabase(TBool aCompressImmediately=EFalse);
|
|
73 |
void AddFieldToContactItemL(CPbkContactItem& aItem, TPbkFieldId aFieldId, const TDesC& aFieldText);
|
|
74 |
void DeleteAllItemsL( TUid aStoreUid );
|
|
75 |
void DeleteItemsCreatedWithCreatorL( TUid aStoreUid );
|
|
76 |
|
|
77 |
|
|
78 |
private:
|
|
79 |
CPbkContactEngine* iContactDBEngine;
|
|
80 |
TInt iOpCounter;
|
|
81 |
CPhonebookParameters* iParameters;
|
|
82 |
RArray<TInt> iContactIds;
|
|
83 |
RArray<TInt> iGroupIds; // TContactItemId ( = TInt32 ) CContactItem::Id()
|
|
84 |
RArray<TInt> iEntriesToDelete; // TContactItemId ( = TInt32 ) CContactItem::Id()
|
|
85 |
|
|
86 |
public:
|
|
87 |
};
|
|
88 |
|
|
89 |
|
|
90 |
class CPhonebookParameters : public CCreatorModuleBaseParameters
|
|
91 |
{
|
|
92 |
public:
|
|
93 |
void ParseL(CCommandParser* parser, TParseParams /*aCase = 0*/);
|
|
94 |
HBufC* iContactFirstName;
|
|
95 |
HBufC* iContactLastName;
|
|
96 |
HBufC* iContactCompanyName;
|
|
97 |
HBufC* iContactJobTitle;
|
|
98 |
HBufC* iContactPostalAddress;
|
|
99 |
HBufC* iWvUserId;
|
|
100 |
HBufC* iRingingtone;
|
|
101 |
HBufC* iThumbnailImage;
|
|
102 |
HBufC* iContactPhoneNumberGeneral; TInt iNumberOfPhoneNumberFields;
|
|
103 |
HBufC* iContactURL; TInt iNumberOfURLFields;
|
|
104 |
HBufC* iContactEmailAddress; TInt iNumberOfEmailAddressFields;
|
|
105 |
|
|
106 |
HBufC* iGroupName;
|
|
107 |
TInt iContactsInGroup;
|
|
108 |
|
|
109 |
|
|
110 |
public:
|
|
111 |
CPhonebookParameters();
|
|
112 |
~CPhonebookParameters();
|
|
113 |
};
|
|
114 |
|
|
115 |
|
|
116 |
|
|
117 |
#endif // __CREATORPHONEBOOK_H__
|