creator/engine/src/creator_contactsetcache.cpp
changeset 35 98924d2efce9
parent 19 4b22a598b890
equal deleted inserted replaced
34:e0ec97ec3cc4 35:98924d2efce9
    30 TInt CCreatorContactSet::LinkId() const
    30 TInt CCreatorContactSet::LinkId() const
    31     {
    31     {
    32     return iLinkId;
    32     return iLinkId;
    33     }
    33     }
    34 
    34 
    35 void CCreatorContactSet::AppendL(QContactLocalId aContactLink)
    35 void CCreatorContactSet::AppendL(TUint32 aContactLink)
    36     {
    36     {
    37     iContactLinks.AppendL(aContactLink);
    37     iContactLinks.AppendL(aContactLink);
    38     }
    38     }
    39 
    39 
    40 RArray<QContactLocalId> CCreatorContactSet::ContactLinks()
    40 RArray<TUint32> CCreatorContactSet::ContactLinks()
    41     {
    41     {
    42     return iContactLinks;
    42     return iContactLinks;
    43     }
    43     }
    44 
    44 
    45 const RArray<QContactLocalId> CCreatorContactSet::ContactLinks() const
    45 const RArray<TUint32> CCreatorContactSet::ContactLinks() const
    46     {
    46     {
    47     return iContactLinks;
    47     return iContactLinks;
    48     }
    48     }
    49 
    49 
    50 
    50 
    71 public:
    71 public:
    72     static CContactLinkCacheImp* NewL();
    72     static CContactLinkCacheImp* NewL();
    73     virtual ~CContactLinkCacheImp();
    73     virtual ~CContactLinkCacheImp();
    74     virtual void AppendL(CCreatorContactSet* aContactSet); 
    74     virtual void AppendL(CCreatorContactSet* aContactSet); 
    75 
    75 
    76     virtual RArray<QContactLocalId> ContactLinks(TInt aLinkId);
    76     virtual RArray<TUint32> ContactLinks(TInt aLinkId);
    77     virtual const RArray<QContactLocalId> ContactLinks(TInt aLinkId) const;
    77     virtual const RArray<TUint32> ContactLinks(TInt aLinkId) const;
    78 
    78 
    79     virtual RPointerArray<CCreatorContactSet>& ContactSets();
    79     virtual RPointerArray<CCreatorContactSet>& ContactSets();
    80     virtual const RPointerArray<CCreatorContactSet>& ContactSets() const;
    80     virtual const RPointerArray<CCreatorContactSet>& ContactSets() const;
    81     virtual const CCreatorContactSet& ContactSet(TInt aLinkId) const;
    81     virtual const CCreatorContactSet& ContactSet(TInt aLinkId) const;
    82     virtual CCreatorContactSet& ContactSet(TInt aLinkId);
    82     virtual CCreatorContactSet& ContactSet(TInt aLinkId);
    83     
    83     
    84 private:
    84 private:
    85     void ConstructL();
    85     void ConstructL();
    86     CContactLinkCacheImp();
    86     CContactLinkCacheImp();
    87     
    87     
    88     RArray<QContactLocalId> iEmptyLinks;
    88     RArray<TUint32> iEmptyLinks;
    89 
    89 
    90     RPointerArray<CCreatorContactSet> iContactSets;
    90     RPointerArray<CCreatorContactSet> iContactSets;
    91     CCreatorContactSet* iDummyContactSet;
    91     CCreatorContactSet* iDummyContactSet;
    92 };
    92 };
    93 
    93 
   121     }
   121     }
   122 void CContactLinkCacheImp::AppendL(CCreatorContactSet* aContactSet)
   122 void CContactLinkCacheImp::AppendL(CCreatorContactSet* aContactSet)
   123     {
   123     {
   124     iContactSets.AppendL(aContactSet);
   124     iContactSets.AppendL(aContactSet);
   125     }
   125     }
   126 RArray<QContactLocalId> CContactLinkCacheImp::ContactLinks(TInt aLinkId)
   126 RArray<TUint32> CContactLinkCacheImp::ContactLinks(TInt aLinkId)
   127     {
   127     {
   128     for( TInt i = 0; i < iContactSets.Count(); ++i )
   128     for( TInt i = 0; i < iContactSets.Count(); ++i )
   129         {
   129         {
   130         if( iContactSets[i]->LinkId() == aLinkId )
   130         if( iContactSets[i]->LinkId() == aLinkId )
   131             {
   131             {
   133             }
   133             }
   134         }
   134         }
   135     return iEmptyLinks;
   135     return iEmptyLinks;
   136     }
   136     }
   137 
   137 
   138 const RArray<QContactLocalId> CContactLinkCacheImp::ContactLinks(TInt aLinkId) const
   138 const RArray<TUint32> CContactLinkCacheImp::ContactLinks(TInt aLinkId) const
   139     {
   139     {
   140     for( TInt i = 0; i < iContactSets.Count(); ++i )
   140     for( TInt i = 0; i < iContactSets.Count(); ++i )
   141         {
   141         {
   142         if( iContactSets[i]->LinkId() == aLinkId )
   142         if( iContactSets[i]->LinkId() == aLinkId )
   143             {
   143             {