creator/inc/creator_contactsetcache.h
changeset 0 d6fe6244b863
equal deleted inserted replaced
-1:000000000000 0:d6fe6244b863
       
     1 /*
       
     2 * Copyright (c) 2008 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CREATORCONTACTSETCACHE_H_
       
    21 #define CREATORCONTACTSETCACHE_H_
       
    22 
       
    23 #include <e32base.h>
       
    24 #if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
       
    25 #include <MVPbkContactLink.h>
       
    26 #endif
       
    27 
       
    28 // Forward declarations
       
    29 class CContactLinkCacheImp;
       
    30 
       
    31 class CCreatorContactSet : public CBase
       
    32 {
       
    33 public:
       
    34     static CCreatorContactSet* NewL(TInt aLinkId, TInt aNumOfExistingContacts);
       
    35     virtual ~CCreatorContactSet();
       
    36 #if(!defined __SERIES60_30__ && !defined __SERIES60_31__)    
       
    37     void AppendL(MVPbkContactLink*);
       
    38     TInt NumberOfExistingContacts() const;
       
    39     RPointerArray<MVPbkContactLink>& ContactLinks();
       
    40     const RPointerArray<MVPbkContactLink>& ContactLinks() const;
       
    41 #endif
       
    42     TInt LinkId() const;
       
    43 
       
    44 private:
       
    45     CCreatorContactSet(TInt aLinkId, TInt aNumOfExistingContacts);    
       
    46     //void ConstructL();
       
    47     TInt iLinkId;
       
    48     TInt iNumOfExistingContacts;
       
    49 #if(!defined __SERIES60_30__ && !defined __SERIES60_31__)    
       
    50     RPointerArray<MVPbkContactLink> iContactLinks;
       
    51 #endif
       
    52 };
       
    53 
       
    54 class MContactLinkCache
       
    55 {
       
    56 public:
       
    57     virtual void AppendL(CCreatorContactSet* aContactSet) = 0;
       
    58 #if(!defined __SERIES60_30__ && !defined __SERIES60_31__)    
       
    59     virtual RPointerArray<MVPbkContactLink>& ContactLinks(TInt aLinkId) = 0;
       
    60     virtual const RPointerArray<MVPbkContactLink>& ContactLinks(TInt aLinkId) const = 0;    
       
    61 #endif    
       
    62     virtual RPointerArray<CCreatorContactSet>& ContactSets() = 0;
       
    63     virtual const RPointerArray<CCreatorContactSet>& ContactSets() const = 0;
       
    64     virtual const CCreatorContactSet& ContactSet(TInt aLinkId) const = 0;
       
    65     virtual CCreatorContactSet& ContactSet(TInt aLinkId) = 0;
       
    66 };
       
    67 
       
    68 class ContactLinkCache
       
    69 {
       
    70 public:
       
    71     static void InitializeL();
       
    72     static void DestroyL();
       
    73     
       
    74     static MContactLinkCache* Instance();
       
    75     
       
    76 private:
       
    77     ContactLinkCache(){};
       
    78     static CContactLinkCacheImp* iImp;
       
    79 };
       
    80 
       
    81 #endif /*CREATORCONTACTSETCACHE_H_*/