2 * Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Virtual Phonebook base interface for contact fields.
19 #ifndef MVPBKBASECONTACTFIELD_H
20 #define MVPBKBASECONTACTFIELD_H
25 #include <mvpbkobjecthierarchy.h>
27 // FORWARD DECLARATIONS
28 class MVPbkBaseContact;
30 class MVPbkFieldTypeList;
31 class MVPbkContactFieldData;
36 * Virtual Phonebook Base contact field interface.
37 * An abstract interface Virtual Phonebook read-only contact fields.
39 class MVPbkBaseContactField
45 virtual ~MVPbkBaseContactField() { }
49 * Returns the parent contact where this field is from.
51 * @return The parent contact where this field is from.
53 virtual MVPbkBaseContact& ParentContact() const = 0;
56 * Returns this field's type or NULL if no mapping exists
57 * between the native type and virtual phonebook type.
59 * @param aMatchPriority matching priority to use.
60 * @return The field type or NULL
61 * @postcond !FieldType(list) || list.ContainsSame(*FieldType(list))
63 virtual const MVPbkFieldType* MatchFieldType(
64 TInt aMatchPriority) const =0;
67 * Returns the best matching type of the field or NULL
68 * if no mapping exists between the native type and
69 * virtual phonebook type. This is the same as looping
70 * MatchFieldType from priority 0 and getting the first
73 * @return The field type or NULL
74 * @postcond !FieldType(list) || list.ContainsSame(*FieldType(list))
76 virtual const MVPbkFieldType* BestMatchingFieldType() const = 0;
79 * Returns this field's data storage (read-only). The actual
80 * data type can be get using the static Cast functions in actual
83 * @see MVPbkContactFieldTextData
84 * @see MVPbkContactFieldBinaryData
85 * @see MVPbkContactFieldDateTimeData
86 * @return This field's data storage (read-only).
88 virtual const MVPbkContactFieldData& FieldData() const = 0;
91 * Returns true if this field is the same as another field in the
93 * Doesn't work for fields from different contact instances.
94 * Always use this method instead of direct pointer comparison.
96 * @param aOther another field inside the contact
97 * @return ETrue if contact is same
99 virtual TBool IsSame(const MVPbkBaseContactField& aOther) const = 0;
102 * Returns an extension point for this interface or NULL.
103 * @param aExtensionUid Uid of extension
104 * @return Extension point or NULL
106 virtual TAny* BaseContactFieldExtension(
107 TUid /*aExtensionUid*/) { return NULL; }
111 #endif // MVPBKBASECONTACTFIELD_H