epoc32/include/app/CVPbkContactStoreUriArray.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) 2002-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 array for store URIs.
    15 *
    16 */
    17 
    18 
    19 #ifndef CVPBKCONTACTSTOREURIARRAY_H
    20 #define CVPBKCONTACTSTOREURIARRAY_H
    21 
    22 // INCLUDES
    23 #include <e32base.h>
    24 
    25 // FORWARD DECLARATIONS
    26 class TVPbkContactStoreUriPtr;
    27 class CVPbkContactStoreUri;
    28 
    29 // CLASS DECLARATIONS
    30 
    31 /**
    32  * Virtual Phonebook contact store URI array. Responsible for
    33  * implementing a container for contact store URI's. In addition 
    34  * to common container behaviour the class can internalize and
    35  * externalize store URI's from and to descriptors.
    36  */
    37 class CVPbkContactStoreUriArray : public CBase
    38     {
    39     public: // Construction and destruction
    40         /**
    41          * Creates a new instance of this class.
    42          * @return Newly created instance of this class.
    43          */
    44         IMPORT_C static CVPbkContactStoreUriArray* NewL();
    45         
    46         /**
    47          * Creates a new instance of this class. Leaves
    48          * the instance to the cleanup stack.
    49          * @return Newly created instance of this class.
    50          */
    51         IMPORT_C static CVPbkContactStoreUriArray* NewLC();
    52         
    53         /**
    54          * Creates a new instance of this class internalizing the
    55          * contents of the descriptor.
    56          * @param aPackedUris	Packed URIs created by using the 
    57          * 						PackLC functionality of this class.
    58          * @return Newly created instance of this class.
    59          */
    60         IMPORT_C static CVPbkContactStoreUriArray* NewLC(const TDesC8& aPackedUris);
    61         
    62         /**
    63          * Destructor.
    64          */
    65         ~CVPbkContactStoreUriArray();
    66         
    67     public: // Interface
    68 
    69         /**
    70          * Appends StoreUriPtr to this array.
    71          *
    72          * @param aStoreUri	Store URI to add array.
    73          */
    74         IMPORT_C void AppendL(const TVPbkContactStoreUriPtr& aStoreUri);
    75 
    76         /**
    77          * Appends array of StoreUriPtr to this array.
    78          *
    79          * @param aUriArray	Array of Store URIs to add array.
    80          */
    81         IMPORT_C void AppendAllL(const CVPbkContactStoreUriArray& aUriArray);
    82 
    83         /**
    84          * Removes StoreUriPtr from this array.
    85          *
    86          * @param aStoreUri Store Uri to add array.
    87          */
    88         IMPORT_C void Remove(const TVPbkContactStoreUriPtr& aStoreUri);
    89 
    90         /**
    91          * Returns the count of Store URIs in this array.
    92          *
    93          * @return Count of Store URIs in array.
    94          */
    95         IMPORT_C TInt Count() const;
    96         
    97         /**
    98          * Gets the URI pointer descriptor from this array at 
    99          * the given index.
   100          *
   101          * @param aIndex Index which URI Ptr is needed
   102          * @return URI pointer descriptor.
   103          */
   104         IMPORT_C TVPbkContactStoreUriPtr operator[](TInt aIndex) const;
   105         
   106         /**
   107          * Packs this URI array to a heap descriptor.
   108          *
   109          * @return Packed URI array in a heap descriptor.
   110          */        
   111         IMPORT_C HBufC8* PackLC() const;
   112         
   113         /**
   114          * Checks whether the given URI is already in this array.
   115          *
   116          * @param aStoreUri Store URI to check.
   117          * @return ETrue if Store URI is in this array, EFalse if not.
   118          */        
   119         IMPORT_C TBool IsIncluded(const TVPbkContactStoreUriPtr& aStoreUri) const;
   120         
   121     private: // Implementation
   122         CVPbkContactStoreUriArray();
   123         void ConstructL();
   124         void ConstructL(const TDesC8& aPackedUris);
   125         TInt CalculateExternalizedSize() const;
   126         
   127     private:
   128         ///Own: Array of contact store URI's
   129         RPointerArray<CVPbkContactStoreUri> iUris;
   130     };
   131     
   132 #endif // CVPBKCONTACTSTOREURIARRAY_H
   133 
   134 // End of File