epoc32/include/app/MVPbkBaseContact.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/app/MVPbkBaseContact.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,168 @@
     1.4 +/*
     1.5 +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:  Virtual Phonebook base interface for contacts.
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef MVPBKBASECONTACT_H
    1.23 +#define MVPBKBASECONTACT_H
    1.24 +
    1.25 +// INCLUDES
    1.26 +#include <e32cmn.h>
    1.27 +#include <e32def.h>
    1.28 +
    1.29 +// FORWARD DECLARATIONS
    1.30 +class MVPbkContactObserver;
    1.31 +class MVPbkBaseContactFieldCollection;
    1.32 +class MVPbkContactLink;
    1.33 +class MVPbkContactBookmark;
    1.34 +class MVPbkViewContact;
    1.35 +class MVPbkStoreContact;
    1.36 +
    1.37 +// CLASS DECLARATIONS
    1.38 +
    1.39 +/**
    1.40 + * Virtual Phonebook read-only base contact interface.
    1.41 + * This class is used as a high-level interface for contacts in the
    1.42 + * Virtual Phonebook.
    1.43 + */
    1.44 +class MVPbkBaseContact
    1.45 +    {
    1.46 +    protected:  // Destructor
    1.47 +        /**
    1.48 +         * Destructor.
    1.49 +         */
    1.50 +        virtual ~MVPbkBaseContact() { }
    1.51 +
    1.52 +    public:  // Interface
    1.53 +        /**
    1.54 +         * Returns this contact's fields (read only).
    1.55 +         * @return This contact's fields in read only mode.
    1.56 +         */
    1.57 +        virtual const MVPbkBaseContactFieldCollection& Fields() const =0;
    1.58 +
    1.59 +        /**
    1.60 +         * Returns true if this a representation of the same contact.
    1.61 +         *
    1.62 +         * @param aOtherContact a contact this contact is compared against.
    1.63 +         * @return ETrue if this and aOtherContact represent the same contact.
    1.64 +         */
    1.65 +        virtual TBool IsSame(const MVPbkBaseContact& aOtherContact) const =0;
    1.66 +
    1.67 +        /**
    1.68 +         * Returns true if this a representation of the same contact.
    1.69 +         *
    1.70 +         * @param aOtherContact a contact this contact is compared against.
    1.71 +         * @return ETrue if this and aOtherContact represent the same contact.
    1.72 +         */
    1.73 +        virtual TBool IsSame(const MVPbkStoreContact& aOtherContact) const =0;
    1.74 +
    1.75 +        /**
    1.76 +         * Returns true if this a representation of the same contact.
    1.77 +         *
    1.78 +         * @param aOtherContact a contact this contact is compared against.
    1.79 +         * @return ETrue if this and aOtherContact represent the same contact.
    1.80 +         */
    1.81 +        virtual TBool IsSame(const MVPbkViewContact& aOtherContact) const =0;
    1.82 +
    1.83 +        /**
    1.84 +         * Creates link representing this contact.
    1.85 +         *
    1.86 +         * @return A link or NULL if the contact doesn't exist in the store,
    1.87 +         *         e.g. a folding contact in the view could be that kind or
    1.88 +         *         a new contact that hasn't been committed to the store.
    1.89 +         *         NULL is not put into the CleanupStack.
    1.90 +         */
    1.91 +        virtual MVPbkContactLink* CreateLinkLC() const =0;
    1.92 +
    1.93 +        /**
    1.94 +         * Deletes this contact from store asynchronously.
    1.95 +         *
    1.96 +         * @param aObserver The observer to call back when this operation
    1.97 +         *                  completes. The observer will not be called
    1.98 +         *                  if this function leaves.
    1.99 +         * @exception KErrInUse If another asynchronous operation is already
   1.100 +         *                      in progress.
   1.101 +         * @exception KErrAccessDenied if the contact can not be modified.
   1.102 +         */
   1.103 +        virtual void DeleteL(MVPbkContactObserver& aObserver) const =0;
   1.104 +
   1.105 +        /**
   1.106 +         * Returns ETrue if this view contact is from given store
   1.107 +         *
   1.108 +         * @param aContactStoreUri the URI of the store to compare
   1.109 +         * @return ETrue if the view contact was from the given store
   1.110 +         */
   1.111 +        virtual TBool MatchContactStore(
   1.112 +                const TDesC& aContactStoreUri) const =0;
   1.113 +
   1.114 +        /**
   1.115 +         * Returns ETrue if this contact is from the same store
   1.116 +         * domain as the given one.
   1.117 +         *
   1.118 +         * @param aContactStoreDomain the the store domain
   1.119 +         * @return ETrue if the contact was from the same store domain.
   1.120 +         */
   1.121 +        virtual TBool MatchContactStoreDomain(
   1.122 +                const TDesC& aContactStoreDomain) const =0;
   1.123 +
   1.124 +        /**
   1.125 +         * Creates and returns a bookmark that points to the contact.
   1.126 +         * Bookmark can be used to retrieve an index of the contact in
   1.127 +         * the view.
   1.128 +         *
   1.129 +         * @return A new bookmark to the contact
   1.130 +         */
   1.131 +        virtual MVPbkContactBookmark* CreateBookmarkLC() const =0;
   1.132 +
   1.133 +        /**
   1.134 +         * Returns an extension point for this interface or NULL.
   1.135 +         * @param aExtensionUid Extension identifier.
   1.136 +         */
   1.137 +        virtual TAny* BaseContactExtension(TUid /*aExtensionUid*/)
   1.138 +                { return NULL; }
   1.139 +    };
   1.140 +
   1.141 +//Use this UID to access base contact extension 2.
   1.142 +// Used as a parameter to BaseContactExtension() method.
   1.143 +const TUid KVPbkBaseContactExtension2Uid = { 2 };
   1.144 +
   1.145 +/**
   1.146 + * This class is an extension to MVPbkBaseContact.
   1.147 + * See documentation of MVPbkBaseContact from header MVPbkBaseContact.h
   1.148 + *
   1.149 + * @see MVPbkBaseContact
   1.150 + *
   1.151 + */
   1.152 +class MVPbkBaseContact2
   1.153 +    {
   1.154 +    protected:  // Destructor
   1.155 +        virtual ~MVPbkBaseContact2() { }
   1.156 +
   1.157 +    public:
   1.158 +
   1.159 +        /**
   1.160 +         * Function returns true if contact is the store's current own contact.
   1.161 +         *
   1.162 +         * @param aError KErrNotSupported If store does not support own contact
   1.163 +         */
   1.164 +        virtual TBool IsOwnContact( TInt& aError ) const =0;
   1.165 +
   1.166 +    };
   1.167 +
   1.168 +
   1.169 +#endif  // MVPBKBASECONTACT_H
   1.170 +
   1.171 +// End of file