PECengine/PresenceManager2/SrcAttribute/CPEngTrackedPresenceIDCollection.h
branchRCL_3
changeset 13 a941bc465d9f
parent 0 094583676ce7
equal deleted inserted replaced
12:6ca72c0fe49a 13:a941bc465d9f
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Tracked Presence ID collection.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CPENGTRACKEDPRESENCEIDCOLLECTION_H
       
    19 #define __CPENGTRACKEDPRESENCEIDCOLLECTION_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Base.h>
       
    23 #include <BaDesCa.h>
       
    24 
       
    25 //FORWARD DECLARATIONS
       
    26 class CPEngTrackedPresenceID2;
       
    27 class CPEngTrackedPresenceIDs2;
       
    28 class CPEngTrackedPresenceIDEntry;
       
    29 class CPEngTrackedPresenceIDEntryLookUp;
       
    30 class TPEngTrackedPresenceEntryFilter;
       
    31 
       
    32 
       
    33 
       
    34 /**
       
    35  * Tracked Presence ID collection.
       
    36  *
       
    37  * @lib
       
    38  * @since 3.0
       
    39  */
       
    40 NONSHARABLE_CLASS( CPEngTrackedPresenceIDCollection ) : public CBase
       
    41     {
       
    42 private: /* Enumerations */
       
    43 
       
    44     /**
       
    45      * Flags for list filtering
       
    46      *
       
    47      * @since 3.0
       
    48      */
       
    49     enum TFilterFlags
       
    50         {
       
    51         ENotIncludedToList = 0,
       
    52         EIncludedToList = 1
       
    53         };
       
    54 
       
    55 
       
    56     //-----------------------------------------------------------------------
       
    57 public: /* Construction */
       
    58 
       
    59     /**
       
    60      * Instantiates CPEngTrackedPresenceIDCollection object.
       
    61      *
       
    62      * @return New CPEngTrackedPresenceIDCollection instance.
       
    63      */
       
    64     static CPEngTrackedPresenceIDCollection* NewL();
       
    65 
       
    66 
       
    67     /**
       
    68      * Destructor.
       
    69      * Virtual by CBase.
       
    70      */
       
    71     ~CPEngTrackedPresenceIDCollection();
       
    72 
       
    73 
       
    74 
       
    75 private:  // Constructor
       
    76 
       
    77     /**
       
    78      * C++ default constructor.
       
    79      */
       
    80     CPEngTrackedPresenceIDCollection();
       
    81 
       
    82 
       
    83     /**
       
    84      * Symbian OS constructor.
       
    85      */
       
    86     void ConstructL();
       
    87 
       
    88 
       
    89 
       
    90     //-----------------------------------------------------------------------
       
    91 public: /* Interface */
       
    92 
       
    93 
       
    94     /**
       
    95      * Interface getter.
       
    96      *
       
    97      * @since 3.0
       
    98      * @return Reference to interface.
       
    99      */
       
   100     CPEngTrackedPresenceIDs2& Interface();
       
   101 
       
   102 
       
   103 
       
   104 
       
   105     //-----------------------------------------------------------------------
       
   106 public: /* Tracked presence IDs */
       
   107 
       
   108     /**
       
   109      * Count of tracked presence IDs.
       
   110      *
       
   111      * @since 3.0
       
   112      * @return Count of tracked presence IDs.
       
   113      */
       
   114     TInt TrackedPresenceIDsCount() const;
       
   115 
       
   116 
       
   117 
       
   118     /**
       
   119      * Locates a tracked Presence ID entry by
       
   120      * Presence ID.
       
   121      *
       
   122      * @since 3.0
       
   123      * @param aPresenceID Presence ID for which to
       
   124      * locate tracked entry.
       
   125      * @return Presence ID entry.
       
   126      * Returns NULL if matching entry isn't found.
       
   127      */
       
   128     const CPEngTrackedPresenceIDEntry* FindTrackedPresenceID( const TDesC& aPresenceID ) const;
       
   129 
       
   130 
       
   131     /**
       
   132      * Gets tracked Presence ID entry by index.
       
   133      *
       
   134      * @since 3.0
       
   135      * @param aIndex The index.
       
   136      * @return Presence ID entry.
       
   137      */
       
   138     const CPEngTrackedPresenceIDEntry& TrackedPresenceID( TInt aIndex ) const;
       
   139 
       
   140 
       
   141     /**
       
   142      * Iterates to next tracked Presence ID and returns it
       
   143      * (returns the interface).
       
   144      *
       
   145      * If no more Presence IDs, returns NULL..
       
   146      *
       
   147      * @since 3.0
       
   148      * @Param Iteration start index.
       
   149      * Updates the index during iteration.
       
   150      * @return Iterated tracked Presence ID.
       
   151      */
       
   152     CPEngTrackedPresenceID2* NextTrackedPresenceID( TInt& aIterIx );
       
   153 
       
   154 
       
   155     /**
       
   156      * Adds (or updates) the given presence IDs to
       
   157      * have given tracked attributes.
       
   158      *
       
   159      * @since 3.0
       
   160      * @Param aPresenceIDs The Presence IDs to add or update.
       
   161      * @param aTypes Attributes to add or update.
       
   162      */
       
   163     void AddTrackedIdsL( const MDesCArray& aPresenceIDs,
       
   164                          const TArray<TUint32>& aTypes );
       
   165 
       
   166     /**
       
   167      * Removes the given presence IDs from the
       
   168      * list of tracked presence IDs.
       
   169      *
       
   170      * @since 3.0
       
   171      * @Param aPresenceIDs The Presence IDs to remove.
       
   172      */
       
   173     void RemoveTrackedIds( const MDesCArray& aPresenceIDs );
       
   174 
       
   175 
       
   176     /**
       
   177      * Removes the given attributes from the tracked presence
       
   178      * IDs. If Presence ID doesn't have after this anymore
       
   179      * tracked attributes, Presence ID is automaticly
       
   180      * removed from the list of tracked presence IDs.
       
   181      *
       
   182      * @since 3.0
       
   183      * @Param aTypes The attributes to remove.
       
   184      */
       
   185     void RemoveTrackedIds( const TArray<TUint32>& aTypes );
       
   186 
       
   187 
       
   188     /**
       
   189      * Removes the given attributes from the given presence
       
   190      * IDs. If Presence ID doesn't have after this anymore
       
   191      * tracked attributes, Presence ID is automaticly
       
   192      * removed from the list of tracked presence IDs.
       
   193      *
       
   194      * @since 3.0
       
   195      * @Param aPresenceIDs The presence IDs from which to remove.
       
   196      * @Param aTypes The attributes to remove.
       
   197      */
       
   198     void RemoveTrackedIds( const MDesCArray& aPresenceIDs,
       
   199                            const TArray<TUint32>& aTypes );
       
   200 
       
   201     /**
       
   202      * Removes all tracked Presence IDs.
       
   203      *
       
   204      * @since 3.0
       
   205      */
       
   206     void RemoveAllTrackedIds();
       
   207 
       
   208 
       
   209 
       
   210     //-----------------------------------------------------------------------
       
   211 public: /* List of changed presences */
       
   212 
       
   213 
       
   214     /**
       
   215      * Removes change marks from
       
   216      * tracked Presence IDs.
       
   217      *
       
   218      * @since 3.0
       
   219      */
       
   220     void ResetPresenceChangeMarks();
       
   221 
       
   222 
       
   223     /**
       
   224      * Marks given Presence ID's given
       
   225      * attribute as changed.
       
   226      *
       
   227      * @since 3.0
       
   228      * @param aPresenceID The presence ID which to mark.
       
   229      */
       
   230     void MarkPresenceChange( const TDesC& aPresenceID );
       
   231 
       
   232 
       
   233     /**
       
   234      * Iterates to next changed Presence ID and returns it
       
   235      * (returns the interface).
       
   236      *
       
   237      * If no more Presence IDs, returns NULL..
       
   238      *
       
   239      * @since 3.0
       
   240      * @Param Iteration start index.
       
   241      * Updates the index during iteration.
       
   242      * @return Iterated tracked Presence ID.
       
   243      */
       
   244     CPEngTrackedPresenceID2* NextChangeMarkedPresenceID( TInt& aIterIx );
       
   245 
       
   246 
       
   247     //-----------------------------------------------------------------------
       
   248 public: /* Filtered list */
       
   249 
       
   250     /**
       
   251      * Resets the filtered list.
       
   252      *
       
   253      * @since 3.0
       
   254      */
       
   255     void ResetFilteredList();
       
   256 
       
   257 
       
   258     /**
       
   259      * Adds CPEngTrackedPresenceIDEntry from
       
   260      * given index to filtered list.
       
   261      *
       
   262      * @since 3.0
       
   263      * @param aIndex The index to add.
       
   264      */
       
   265     void IncludeToFilteredList( TInt aIndex );
       
   266 
       
   267 
       
   268     /**
       
   269      * Gets a MDesCArray presenting the filtered
       
   270      * lists Presence IDs.
       
   271      *
       
   272      * @since 3.0
       
   273      * @return Filtered MDesCArray.
       
   274      */
       
   275     const MDesCArray& FilteredList() const;
       
   276 
       
   277 
       
   278 
       
   279     //-----------------------------------------------------------------------
       
   280 public: /* Filtered list */
       
   281 
       
   282 
       
   283     /**
       
   284      * Resets all holded tracked Presence IDs
       
   285      * attribute track and change iterators.
       
   286      *
       
   287      * @since 3.0
       
   288      */
       
   289     void ResetTrackedEntriesIterators();
       
   290 
       
   291 
       
   292 
       
   293     //-----------------------------------------------------------------------
       
   294 private: /* Data */
       
   295 
       
   296     //OWN: Exported class interface
       
   297     CPEngTrackedPresenceIDs2*    iInterface;
       
   298 
       
   299     //OWN: Attributes tracked for Presence ID
       
   300     RPointerArray< CPEngTrackedPresenceIDEntry >  iTrackedIDs;
       
   301 
       
   302     //OWN: Lookup key for Presence Id entry search
       
   303     CPEngTrackedPresenceIDEntryLookUp* iPresenceIdLookup;
       
   304 
       
   305     //OWN: Entry list filter
       
   306     TPEngTrackedPresenceEntryFilter* iEntryListFilter;
       
   307 
       
   308     };
       
   309 
       
   310 #endif      //__CPENGTRACKEDPRESENCEIDCOLLECTION_H
       
   311 
       
   312 
       
   313 // End of file
       
   314