1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/app/MVPbkStoreContactFieldCollection.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,127 @@
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 the field collection of the store contact
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#ifndef MVPBKSTORECONTACTFIELDCOLLECTION_H
1.23 +#define MVPBKSTORECONTACTFIELDCOLLECTION_H
1.24 +
1.25 +
1.26 +// INCLUDES
1.27 +#include <e32def.h>
1.28 +#include <mvpbkbasecontactfieldcollection.h>
1.29 +
1.30 +// Includes needed for covariant return types
1.31 +#include <mvpbkstorecontactfield.h>
1.32 +
1.33 +// FORWARD DECLARATIONS
1.34 +class MVPbkStoreContact;
1.35 +class MVPbkStoreContactField;
1.36 +
1.37 +// CLASS DECLARATIONS
1.38 +
1.39 +/**
1.40 + * An interface for the field collection of the store contact
1.41 + *
1.42 + * A field collection interface can be used for looping the contact fields.
1.43 + */
1.44 +class MVPbkStoreContactFieldCollection : public MVPbkBaseContactFieldCollection
1.45 + {
1.46 + public: // Destructor
1.47 + /**
1.48 + * Destructor.
1.49 + */
1.50 + virtual ~MVPbkStoreContactFieldCollection() { }
1.51 +
1.52 + public: // From MVPbkBaseContactFieldCollection (covariant return types))
1.53 + const MVPbkStoreContactField& FieldAt(TInt aIndex) const =0;
1.54 +
1.55 + public: // New functions
1.56 + /**
1.57 + * Returns a field in this collection.
1.58 + *
1.59 + * @param aIndex A zero-based index of the field to return.
1.60 + * @return A reference to the field at aIndex. Reference is valid until
1.61 + * FieldAt is called again. If you need a permanent copy,
1.62 + * call MVPbkStoreContactField::CloneLC to the returned
1.63 + * field.
1.64 + * @see MVPbkStoreContactField::CloneLC
1.65 + * @precond aIndex >= 0 && aIndex < FieldCount()
1.66 + * VPbkError::Panic(VPbkError::EInvalidFieldIndex) is raised
1.67 + * if the precondition does not hold.
1.68 + */
1.69 + virtual MVPbkStoreContactField& FieldAt( TInt aIndex ) = 0;
1.70 +
1.71 + /**
1.72 + * Returns a copy of the field in this collection.
1.73 + *
1.74 + * Client gets the ownership of the field.
1.75 + *
1.76 + * @param aIndex A zero-based index of the field to return.
1.77 + * @return A new instance to the field at aIndex. The field is valid
1.78 + * as long as the parent contact is valid
1.79 + * @precond aIndex >= 0 && aIndex < FieldCount()
1.80 + * VPbkError::Panic(VPbkError::EInvalidFieldIndex) is raised
1.81 + * if the precondition does not hold.
1.82 + */
1.83 + virtual MVPbkStoreContactField* FieldAtLC( TInt aIndex ) const = 0;
1.84 +
1.85 + /**
1.86 + * Returns the parent contact of the field collection
1.87 + *
1.88 + * @return the parent contact of the field collection
1.89 + */
1.90 + virtual MVPbkStoreContact& ParentStoreContact() const = 0;
1.91 +
1.92 + /**
1.93 + * Returns a field in this collection identified by a contact field
1.94 + * link.
1.95 + *
1.96 + * A contact field link can be created using the MVPbkStoreContactField
1.97 + * interface. The same link works then as a contact link and
1.98 + * a field link.
1.99 + *
1.100 + * NOTE: implementations of stores are possibly using an index
1.101 + * of the field as an identifier so clients should prefer not
1.102 + * to save field links permanently. E.g modifying the contact
1.103 + * can invalidate the link in some store implementations.
1.104 + * A field link is practical in use cases where the link is
1.105 + * created and immediately given to another component.
1.106 + *
1.107 + * @param aContactLink A valid contact field link.
1.108 + * @return A field in this collection identified by aContactLink or NULL
1.109 + * if the link does not contain field information or if the
1.110 + * link does not refer to the parent contact of this field collection.
1.111 + */
1.112 + virtual MVPbkStoreContactField* RetrieveField(
1.113 + const MVPbkContactLink& aContactLink ) const = 0;
1.114 +
1.115 + /**
1.116 + * Returns an extension point for this interface or NULL.
1.117 + *
1.118 + * @param aExtensionUid no extensions defined currently.
1.119 + * @return An extension point for this interface or NULL.
1.120 + */
1.121 + virtual TAny* StoreContactFieldCollectionExtension(
1.122 + TUid /*aExtensionUid*/ ) { return NULL; }
1.123 + };
1.124 +
1.125 +
1.126 +#endif // MVPBKSTORECONTACTFIELDCOLLECTION_H
1.127 +
1.128 +//End of file
1.129 +
1.130 +