19
|
1 |
/*
|
|
2 |
* Copyright (c) 2006-2007 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 the License "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: Provides utility functions
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef SINGLECONTACT_H
|
|
20 |
#define SINGLECONTACT_H
|
|
21 |
|
|
22 |
#include <e32base.h>
|
|
23 |
#include <MVPbkStoreContact.h>
|
|
24 |
#include "contactservice.h"
|
|
25 |
|
|
26 |
//User includes
|
|
27 |
#include "searchfields.h"
|
|
28 |
#include "singlecontactfield.h"
|
|
29 |
|
|
30 |
//Class declarations
|
|
31 |
class CContactService;
|
|
32 |
class CSearchFields;
|
|
33 |
class CSingleContactField;
|
|
34 |
|
|
35 |
//Wrapper class around a single contact item of type MVPbkStoreContact
|
|
36 |
class CSingleContact:public CBase
|
|
37 |
{
|
|
38 |
public:
|
|
39 |
|
|
40 |
/**
|
|
41 |
* NewL() Method for CSingleContact class
|
|
42 |
* @return CSingleContact*
|
|
43 |
*/
|
|
44 |
static CSingleContact* NewL(MVPbkStoreContact* aSingleContact,
|
|
45 |
Ttype aIndicator);
|
|
46 |
|
|
47 |
IMPORT_C
|
|
48 |
static CSingleContact* NewL();
|
|
49 |
/*
|
|
50 |
* Constructor
|
|
51 |
*/
|
|
52 |
CSingleContact();
|
|
53 |
void ConstructL(MVPbkStoreContact* aSingleContact,
|
|
54 |
Ttype aIndicator);
|
|
55 |
void ConvertContactToFieldListL(MVPbkStoreContact* aSingleContact);
|
|
56 |
|
|
57 |
public:
|
|
58 |
/*
|
|
59 |
* Remove a field from the Contact.
|
|
60 |
*/
|
|
61 |
IMPORT_C TInt RemoveField( TInt aIndex );
|
|
62 |
|
|
63 |
/*
|
|
64 |
* Remove all fields from a Contact.
|
|
65 |
*/
|
|
66 |
IMPORT_C void RemoveAllFields();
|
|
67 |
|
|
68 |
/*
|
|
69 |
* Sets the contact id for a contact
|
|
70 |
*/
|
|
71 |
IMPORT_C void SetContactIdL(const TDesC8& aContactId);
|
|
72 |
|
|
73 |
/*
|
|
74 |
* Gets the contact id of a contact
|
|
75 |
*/
|
|
76 |
IMPORT_C TDesC8& GetContactId();
|
|
77 |
|
|
78 |
|
|
79 |
/*
|
|
80 |
* Creates a field with the specified fields and adds it to the contact.
|
|
81 |
*/
|
|
82 |
IMPORT_C void AddFieldToContactL(const CSingleContactField* aField );
|
|
83 |
|
|
84 |
|
|
85 |
/*
|
|
86 |
*General Functions - Exported
|
|
87 |
*/
|
|
88 |
CSingleContactField* NextFieldL(MVPbkStoreContact* aSingleContact,
|
|
89 |
TInt aIndex);
|
|
90 |
|
|
91 |
/*
|
|
92 |
*Get the number of fields in the contact
|
|
93 |
*/
|
|
94 |
IMPORT_C TInt FieldCount();
|
|
95 |
/*
|
|
96 |
*Get the field at the index;
|
|
97 |
*/
|
|
98 |
IMPORT_C CSingleContactField* FieldAt(TInt aIndex);
|
|
99 |
|
|
100 |
/**
|
|
101 |
* Destructor
|
|
102 |
*/
|
|
103 |
~CSingleContact();
|
|
104 |
|
|
105 |
private: //Data members
|
|
106 |
//No.of Fields
|
|
107 |
TInt iFieldCount;
|
|
108 |
//Index
|
|
109 |
TInt iFieldIndex;
|
|
110 |
|
|
111 |
Ttype iIndicator;
|
|
112 |
/*
|
|
113 |
* Pointer to a contact id
|
|
114 |
*/
|
|
115 |
HBufC8* iContactId;
|
|
116 |
|
|
117 |
RPointerArray<CSingleContactField> iFields;
|
|
118 |
};
|
|
119 |
|
|
120 |
#endif //SINGLECONTACT_H |