epoc32/include/app/MVPbkStoreContactFieldCollection.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  An interface for the field collection of the store contact
    15 *
    16 */
    17 
    18 
    19 #ifndef MVPBKSTORECONTACTFIELDCOLLECTION_H
    20 #define MVPBKSTORECONTACTFIELDCOLLECTION_H
    21 
    22 
    23 // INCLUDES
    24 #include <e32def.h>
    25 #include <mvpbkbasecontactfieldcollection.h>
    26 
    27 // Includes needed for covariant return types
    28 #include <mvpbkstorecontactfield.h>
    29 
    30 // FORWARD DECLARATIONS
    31 class MVPbkStoreContact;
    32 class MVPbkStoreContactField;
    33 
    34 // CLASS DECLARATIONS
    35 
    36 /**
    37  * An interface for the field collection of the store contact
    38  *
    39  * A field collection interface can be used for looping the contact fields.
    40  */
    41 class MVPbkStoreContactFieldCollection : public MVPbkBaseContactFieldCollection
    42     {
    43     public:  // Destructor
    44         /**
    45          * Destructor.
    46          */
    47         virtual ~MVPbkStoreContactFieldCollection() { }
    48 
    49     public: // From MVPbkBaseContactFieldCollection (covariant return types))
    50          const MVPbkStoreContactField& FieldAt(TInt aIndex) const =0;
    51 
    52     public:  // New functions
    53         /**
    54          * Returns a field in this collection.
    55          *
    56          * @param aIndex A zero-based index of the field to return.
    57          * @return A reference to the field at aIndex. Reference is valid until 
    58          *         FieldAt is called again. If you need a permanent copy,
    59          *         call MVPbkStoreContactField::CloneLC to the returned
    60          *         field.
    61          * @see MVPbkStoreContactField::CloneLC
    62          * @precond aIndex >= 0 && aIndex < FieldCount()
    63          *          VPbkError::Panic(VPbkError::EInvalidFieldIndex) is raised
    64          *          if the precondition does not hold.
    65          */
    66         virtual MVPbkStoreContactField& FieldAt( TInt aIndex ) = 0;
    67 
    68         /**
    69          * Returns a copy of the field in this collection.
    70          *
    71          * Client gets the ownership of the field.
    72          *
    73          * @param aIndex A zero-based index of the field to return.
    74          * @return  A new instance to the field at aIndex. The field is valid
    75          *          as long as the parent contact is valid
    76          * @precond aIndex >= 0 && aIndex < FieldCount()
    77          *          VPbkError::Panic(VPbkError::EInvalidFieldIndex) is raised
    78          *          if the precondition does not hold.
    79          */
    80         virtual MVPbkStoreContactField* FieldAtLC( TInt aIndex ) const = 0;
    81 
    82         /**
    83          * Returns the parent contact of the field collection
    84          *
    85          * @return the parent contact of the field collection
    86          */
    87         virtual MVPbkStoreContact& ParentStoreContact() const = 0;
    88         
    89         /**
    90          * Returns a field in this collection identified by a contact field 
    91          * link.
    92          *
    93          * A contact field link can be created using the MVPbkStoreContactField
    94          * interface. The same link works then as a contact link and 
    95          * a field link.
    96          *
    97          * NOTE: implementations of stores are possibly using an index
    98          *       of the field as an identifier so clients should prefer not
    99          *       to save field links permanently. E.g modifying the contact
   100          *       can invalidate the link in some store implementations.
   101          *       A field link is practical in use cases where the link is
   102          *       created and immediately given to another component.
   103          *
   104          * @param aContactLink A valid contact field link.
   105          * @return A field in this collection identified by aContactLink or NULL
   106          *          if the link does not contain field information or if the 
   107          *          link does not refer to the parent contact of this field collection.
   108          */
   109         virtual MVPbkStoreContactField* RetrieveField(
   110             const MVPbkContactLink& aContactLink ) const = 0;
   111 
   112         /**
   113          * Returns an extension point for this interface or NULL.
   114          *
   115          * @param aExtensionUid no extensions defined currently.
   116          * @return An extension point for this interface or NULL.
   117          */
   118         virtual TAny* StoreContactFieldCollectionExtension( 
   119                 TUid /*aExtensionUid*/ ) { return NULL; }
   120     };
   121 
   122 
   123 #endif  // MVPBKSTORECONTACTFIELDCOLLECTION_H
   124 
   125 //End of file
   126 
   127