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 contacts.
19 #ifndef MVPBKBASECONTACT_H
20 #define MVPBKBASECONTACT_H
26 // FORWARD DECLARATIONS
27 class MVPbkContactObserver;
28 class MVPbkBaseContactFieldCollection;
29 class MVPbkContactLink;
30 class MVPbkContactBookmark;
31 class MVPbkViewContact;
32 class MVPbkStoreContact;
37 * Virtual Phonebook read-only base contact interface.
38 * This class is used as a high-level interface for contacts in the
41 class MVPbkBaseContact
43 protected: // Destructor
47 virtual ~MVPbkBaseContact() { }
51 * Returns this contact's fields (read only).
52 * @return This contact's fields in read only mode.
54 virtual const MVPbkBaseContactFieldCollection& Fields() const =0;
57 * Returns true if this a representation of the same contact.
59 * @param aOtherContact a contact this contact is compared against.
60 * @return ETrue if this and aOtherContact represent the same contact.
62 virtual TBool IsSame(const MVPbkBaseContact& aOtherContact) const =0;
65 * Returns true if this a representation of the same contact.
67 * @param aOtherContact a contact this contact is compared against.
68 * @return ETrue if this and aOtherContact represent the same contact.
70 virtual TBool IsSame(const MVPbkStoreContact& aOtherContact) const =0;
73 * Returns true if this a representation of the same contact.
75 * @param aOtherContact a contact this contact is compared against.
76 * @return ETrue if this and aOtherContact represent the same contact.
78 virtual TBool IsSame(const MVPbkViewContact& aOtherContact) const =0;
81 * Creates link representing this contact.
83 * @return A link or NULL if the contact doesn't exist in the store,
84 * e.g. a folding contact in the view could be that kind or
85 * a new contact that hasn't been committed to the store.
86 * NULL is not put into the CleanupStack.
88 virtual MVPbkContactLink* CreateLinkLC() const =0;
91 * Deletes this contact from store asynchronously.
93 * @param aObserver The observer to call back when this operation
94 * completes. The observer will not be called
95 * if this function leaves.
96 * @exception KErrInUse If another asynchronous operation is already
98 * @exception KErrAccessDenied if the contact can not be modified.
100 virtual void DeleteL(MVPbkContactObserver& aObserver) const =0;
103 * Returns ETrue if this view contact is from given store
105 * @param aContactStoreUri the URI of the store to compare
106 * @return ETrue if the view contact was from the given store
108 virtual TBool MatchContactStore(
109 const TDesC& aContactStoreUri) const =0;
112 * Returns ETrue if this contact is from the same store
113 * domain as the given one.
115 * @param aContactStoreDomain the the store domain
116 * @return ETrue if the contact was from the same store domain.
118 virtual TBool MatchContactStoreDomain(
119 const TDesC& aContactStoreDomain) const =0;
122 * Creates and returns a bookmark that points to the contact.
123 * Bookmark can be used to retrieve an index of the contact in
126 * @return A new bookmark to the contact
128 virtual MVPbkContactBookmark* CreateBookmarkLC() const =0;
131 * Returns an extension point for this interface or NULL.
132 * @param aExtensionUid Extension identifier.
134 virtual TAny* BaseContactExtension(TUid /*aExtensionUid*/)
138 //Use this UID to access base contact extension 2.
139 // Used as a parameter to BaseContactExtension() method.
140 const TUid KVPbkBaseContactExtension2Uid = { 2 };
143 * This class is an extension to MVPbkBaseContact.
144 * See documentation of MVPbkBaseContact from header MVPbkBaseContact.h
146 * @see MVPbkBaseContact
149 class MVPbkBaseContact2
151 protected: // Destructor
152 virtual ~MVPbkBaseContact2() { }
157 * Function returns true if contact is the store's current own contact.
159 * @param aError KErrNotSupported If store does not support own contact
161 virtual TBool IsOwnContact( TInt& aError ) const =0;
166 #endif // MVPBKBASECONTACT_H