author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
permissions | -rw-r--r-- |
williamr@4 | 1 |
/* |
williamr@4 | 2 |
* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). |
williamr@4 | 3 |
* All rights reserved. |
williamr@4 | 4 |
* This component and the accompanying materials are made available |
williamr@4 | 5 |
* under the terms of "Eclipse Public License v1.0" |
williamr@4 | 6 |
* which accompanies this distribution, and is available |
williamr@4 | 7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@4 | 8 |
* |
williamr@4 | 9 |
* Initial Contributors: |
williamr@4 | 10 |
* Nokia Corporation - initial contribution. |
williamr@4 | 11 |
* |
williamr@4 | 12 |
* Contributors: |
williamr@4 | 13 |
* |
williamr@4 | 14 |
* Description: An array for store URIs. |
williamr@4 | 15 |
* |
williamr@4 | 16 |
*/ |
williamr@4 | 17 |
|
williamr@4 | 18 |
|
williamr@4 | 19 |
#ifndef CVPBKCONTACTSTOREURIARRAY_H |
williamr@4 | 20 |
#define CVPBKCONTACTSTOREURIARRAY_H |
williamr@4 | 21 |
|
williamr@4 | 22 |
// INCLUDES |
williamr@4 | 23 |
#include <e32base.h> |
williamr@4 | 24 |
|
williamr@4 | 25 |
// FORWARD DECLARATIONS |
williamr@4 | 26 |
class TVPbkContactStoreUriPtr; |
williamr@4 | 27 |
class CVPbkContactStoreUri; |
williamr@4 | 28 |
|
williamr@4 | 29 |
// CLASS DECLARATIONS |
williamr@4 | 30 |
|
williamr@4 | 31 |
/** |
williamr@4 | 32 |
* Virtual Phonebook contact store URI array. Responsible for |
williamr@4 | 33 |
* implementing a container for contact store URI's. In addition |
williamr@4 | 34 |
* to common container behaviour the class can internalize and |
williamr@4 | 35 |
* externalize store URI's from and to descriptors. |
williamr@4 | 36 |
*/ |
williamr@4 | 37 |
class CVPbkContactStoreUriArray : public CBase |
williamr@4 | 38 |
{ |
williamr@4 | 39 |
public: // Construction and destruction |
williamr@4 | 40 |
/** |
williamr@4 | 41 |
* Creates a new instance of this class. |
williamr@4 | 42 |
* @return Newly created instance of this class. |
williamr@4 | 43 |
*/ |
williamr@4 | 44 |
IMPORT_C static CVPbkContactStoreUriArray* NewL(); |
williamr@4 | 45 |
|
williamr@4 | 46 |
/** |
williamr@4 | 47 |
* Creates a new instance of this class. Leaves |
williamr@4 | 48 |
* the instance to the cleanup stack. |
williamr@4 | 49 |
* @return Newly created instance of this class. |
williamr@4 | 50 |
*/ |
williamr@4 | 51 |
IMPORT_C static CVPbkContactStoreUriArray* NewLC(); |
williamr@4 | 52 |
|
williamr@4 | 53 |
/** |
williamr@4 | 54 |
* Creates a new instance of this class internalizing the |
williamr@4 | 55 |
* contents of the descriptor. |
williamr@4 | 56 |
* @param aPackedUris Packed URIs created by using the |
williamr@4 | 57 |
* PackLC functionality of this class. |
williamr@4 | 58 |
* @return Newly created instance of this class. |
williamr@4 | 59 |
*/ |
williamr@4 | 60 |
IMPORT_C static CVPbkContactStoreUriArray* NewLC(const TDesC8& aPackedUris); |
williamr@4 | 61 |
|
williamr@4 | 62 |
/** |
williamr@4 | 63 |
* Destructor. |
williamr@4 | 64 |
*/ |
williamr@4 | 65 |
~CVPbkContactStoreUriArray(); |
williamr@4 | 66 |
|
williamr@4 | 67 |
public: // Interface |
williamr@4 | 68 |
|
williamr@4 | 69 |
/** |
williamr@4 | 70 |
* Appends StoreUriPtr to this array. |
williamr@4 | 71 |
* |
williamr@4 | 72 |
* @param aStoreUri Store URI to add array. |
williamr@4 | 73 |
*/ |
williamr@4 | 74 |
IMPORT_C void AppendL(const TVPbkContactStoreUriPtr& aStoreUri); |
williamr@4 | 75 |
|
williamr@4 | 76 |
/** |
williamr@4 | 77 |
* Appends array of StoreUriPtr to this array. |
williamr@4 | 78 |
* |
williamr@4 | 79 |
* @param aUriArray Array of Store URIs to add array. |
williamr@4 | 80 |
*/ |
williamr@4 | 81 |
IMPORT_C void AppendAllL(const CVPbkContactStoreUriArray& aUriArray); |
williamr@4 | 82 |
|
williamr@4 | 83 |
/** |
williamr@4 | 84 |
* Removes StoreUriPtr from this array. |
williamr@4 | 85 |
* |
williamr@4 | 86 |
* @param aStoreUri Store Uri to add array. |
williamr@4 | 87 |
*/ |
williamr@4 | 88 |
IMPORT_C void Remove(const TVPbkContactStoreUriPtr& aStoreUri); |
williamr@4 | 89 |
|
williamr@4 | 90 |
/** |
williamr@4 | 91 |
* Returns the count of Store URIs in this array. |
williamr@4 | 92 |
* |
williamr@4 | 93 |
* @return Count of Store URIs in array. |
williamr@4 | 94 |
*/ |
williamr@4 | 95 |
IMPORT_C TInt Count() const; |
williamr@4 | 96 |
|
williamr@4 | 97 |
/** |
williamr@4 | 98 |
* Gets the URI pointer descriptor from this array at |
williamr@4 | 99 |
* the given index. |
williamr@4 | 100 |
* |
williamr@4 | 101 |
* @param aIndex Index which URI Ptr is needed |
williamr@4 | 102 |
* @return URI pointer descriptor. |
williamr@4 | 103 |
*/ |
williamr@4 | 104 |
IMPORT_C TVPbkContactStoreUriPtr operator[](TInt aIndex) const; |
williamr@4 | 105 |
|
williamr@4 | 106 |
/** |
williamr@4 | 107 |
* Packs this URI array to a heap descriptor. |
williamr@4 | 108 |
* |
williamr@4 | 109 |
* @return Packed URI array in a heap descriptor. |
williamr@4 | 110 |
*/ |
williamr@4 | 111 |
IMPORT_C HBufC8* PackLC() const; |
williamr@4 | 112 |
|
williamr@4 | 113 |
/** |
williamr@4 | 114 |
* Checks whether the given URI is already in this array. |
williamr@4 | 115 |
* |
williamr@4 | 116 |
* @param aStoreUri Store URI to check. |
williamr@4 | 117 |
* @return ETrue if Store URI is in this array, EFalse if not. |
williamr@4 | 118 |
*/ |
williamr@4 | 119 |
IMPORT_C TBool IsIncluded(const TVPbkContactStoreUriPtr& aStoreUri) const; |
williamr@4 | 120 |
|
williamr@4 | 121 |
private: // Implementation |
williamr@4 | 122 |
CVPbkContactStoreUriArray(); |
williamr@4 | 123 |
void ConstructL(); |
williamr@4 | 124 |
void ConstructL(const TDesC8& aPackedUris); |
williamr@4 | 125 |
TInt CalculateExternalizedSize() const; |
williamr@4 | 126 |
|
williamr@4 | 127 |
private: |
williamr@4 | 128 |
///Own: Array of contact store URI's |
williamr@4 | 129 |
RPointerArray<CVPbkContactStoreUri> iUris; |
williamr@4 | 130 |
}; |
williamr@4 | 131 |
|
williamr@4 | 132 |
#endif // CVPBKCONTACTSTOREURIARRAY_H |
williamr@4 | 133 |
|
williamr@4 | 134 |
// End of File |