1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/app/MVPbkViewContact.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,154 @@
1.4 +/*
1.5 +* Copyright (c) 2004-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: An interface for a view contact
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#ifndef MVPBKVIEWCONTACT_H
1.23 +#define MVPBKVIEWCONTACT_H
1.24 +
1.25 +
1.26 +// INCLUDES
1.27 +#include <e32def.h>
1.28 +#include <mvpbkbasecontact.h>
1.29 +
1.30 +
1.31 +// FORWARD DECLARATIONS
1.32 +class MVPbkContactViewBase;
1.33 +class MVPbkContactStore;
1.34 +class MVPbkExpandable;
1.35 +
1.36 +// CLASS DECLARATIONS
1.37 +
1.38 +/**
1.39 + * An interface for a view contact.
1.40 + *
1.41 + * As the name already says the view contact is a contact in a view.
1.42 + * It contains the fields that were defined in the sort order of the view.
1.43 + * However, a store implementation possibly have limitations of field types
1.44 + * that can be used in the sort order. If the store doesn't support the given
1.45 + * field type in a view contact it sets the data of those fields to zero length.
1.46 + * The order of the fields are same as in a sort order.
1.47 + *
1.48 + * @see MVPbkContactViewBase
1.49 + */
1.50 +class MVPbkViewContact : public MVPbkBaseContact
1.51 + {
1.52 + protected: // destructor
1.53 + /**
1.54 + * Destructor.
1.55 + */
1.56 + virtual ~MVPbkViewContact() { }
1.57 +
1.58 + public: // New functions
1.59 + /**
1.60 + * Returns the parent view of the contact.
1.61 + *
1.62 + * @return The parent view of the contact.
1.63 + */
1.64 + virtual MVPbkContactViewBase& ParentView() const = 0;
1.65 +
1.66 + /**
1.67 + * Reads the whole contact from the store asynchronously.
1.68 + *
1.69 + * A client can use this if it has a reference of the view contact but
1.70 + * it needs all the data fields instead of only those that are included
1.71 + * in the view contact.
1.72 + *
1.73 + * The contact is returned in a call back.
1.74 + *
1.75 + * @param aObserver An observer to call back when this operation
1.76 + * completes. The observer will not be called if this
1.77 + * function leaves.
1.78 + * @exception KErrInUse If another asynchronous operation is already
1.79 + * in progress.
1.80 + */
1.81 + virtual void ReadL( MVPbkContactObserver& aObserver ) const = 0;
1.82 +
1.83 + /**
1.84 + * Reads the whole contact and locks it for modification
1.85 + * asynchronously.
1.86 + *
1.87 + * A client can use this if it has a reference of the view contact and
1.88 + * it needs to modify the contact.
1.89 + *
1.90 + * The contact is returned in a call back.
1.91 + *
1.92 + * @param aObserver An observer to call back when this operation
1.93 + * completes. The observer will not be called if this
1.94 + * function leaves.
1.95 + * @exception KErrInUse If another asynchronous operation is already
1.96 + * in progress.
1.97 + * @exception KErrAccessDenied if contact is read-only
1.98 + */
1.99 + virtual void ReadAndLockL( MVPbkContactObserver& aObserver ) const = 0;
1.100 +
1.101 + /**
1.102 + * Returns expandable interface for this object or NULL if expanding is
1.103 + * not supported.
1.104 + *
1.105 + * Examples are a contact group that can be expanded to its members view
1.106 + * or a folding view that can be extended to its internals. Client can
1.107 + * get the type of the view from MVPbkContactViewBase::Type which is useful
1.108 + * for knowing the type of expansion.
1.109 + *
1.110 + * @return An expansion or NULL.
1.111 + */
1.112 + virtual MVPbkExpandable* Expandable() const = 0;
1.113 +
1.114 + /**
1.115 + * Returns ETrue if two contacts are same.
1.116 + *
1.117 + * @param aOtherContact A contact to be compared.
1.118 + * @param aContactStore The store of the aOtherContact.
1.119 + * @return ETrue if two contacts are same.
1.120 + */
1.121 + virtual TBool IsSame( const MVPbkViewContact& aOtherContact,
1.122 + const MVPbkContactStore* aContactStore ) const = 0;
1.123 +
1.124 + /**
1.125 + * Returns ETrue if two contacts are same.
1.126 + *
1.127 + * @param aOtherContact A contact to be compared.
1.128 + * @param aContactStore The store of the aOtherContact.
1.129 + * @return ETrue if two contacts are same.
1.130 + */
1.131 + virtual TBool IsSame( const MVPbkStoreContact& aOtherContact,
1.132 + const MVPbkContactStore* aContactStore ) const = 0;
1.133 +
1.134 + /**
1.135 + * Returns an extension point for this interface or NULL.
1.136 + *
1.137 + * @param aExtensionUid no extensions defined currently.
1.138 + * @return An extension point for this interface or NULL.
1.139 + */
1.140 + virtual TAny* ViewContactExtension( TUid /*aExtensionUid*/ )
1.141 + { return NULL; }
1.142 +
1.143 + public: // from MVPbkBaseContact
1.144 + /// Do not override
1.145 + virtual TBool IsSame( const MVPbkBaseContact& aOtherContact ) const
1.146 + {
1.147 + return aOtherContact.IsSame(*this);
1.148 + }
1.149 +
1.150 + };
1.151 +
1.152 +
1.153 +#endif // MVPBKVIEWCONTACT_H
1.154 +
1.155 +//End of file
1.156 +
1.157 +