logsui/logsserviceextension/inc/clogseventinfomanager.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 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:  Used to manage TLogsEventInfo objects
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CLOGSEVENTINFOMANAGER_H
       
    20 #define C_CLOGSEVENTINFOMANAGER_H
       
    21 
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 class TLogsEventInfo;
       
    26 
       
    27 NONSHARABLE_CLASS(CLogsEventInfoManager) : public CBase 
       
    28     {
       
    29 friend class ut_clogsuicontrolextension;
       
    30 public:
       
    31         
       
    32     static CLogsEventInfoManager* NewL();
       
    33     static CLogsEventInfoManager* NewLC();
       
    34 
       
    35     /**
       
    36      * Destructor.
       
    37      */        
       
    38     ~CLogsEventInfoManager();
       
    39     
       
    40     /**
       
    41      * Creates a TLogsEventInfo entry and adds it the manager's array of
       
    42      * TLogsEventInfo entries. Before that it is checked whether the entry 
       
    43      * already exists to avoid duplicates. TLogsEventInfo entries with
       
    44      * the same service id are considered to be duplicates. 
       
    45      * Leaves with system-wide error code in case of an error.
       
    46      *
       
    47      * @since S60 v3.2
       
    48      * @param aServiceId service id
       
    49      */
       
    50     void AddEventEntryL( TUint32 aServiceId );
       
    51     
       
    52     /**
       
    53      * The brand icon index for a log event with the specified service id 
       
    54      * is retrieved and assigned to 'aIndex'.
       
    55      *
       
    56      * @since S60 v3.2
       
    57      * @param aServiceId Id of requested settings entry
       
    58      * @param aIndex the index of the brand icon of the specified service
       
    59      * @return True, if index for the specified serviceId was found and set,
       
    60      *         False otherwise
       
    61      */ 
       
    62     TBool GetBrandIconIndex( TUint32 aServiceId, TInt& aIndex ) const;
       
    63 
       
    64     /**
       
    65      * Returns the event info entry at the specified index in the
       
    66      * iEventInfoArray array.
       
    67      *
       
    68      * @since S60 v3.2
       
    69      * @param aIndex a index
       
    70      * @return pointer to a event info object or null if the index
       
    71      *         position is not valid
       
    72      */ 
       
    73     TLogsEventInfo* GetEventInfoEntryByIndex( TInt aIndex ) const;
       
    74     
       
    75     /**
       
    76      * Returns the number of event info objects.
       
    77      *
       
    78      * @since S60 v3.2
       
    79      * @return number of event info objects
       
    80      */ 
       
    81     TInt Count() const;
       
    82     
       
    83     /**
       
    84      * Check whether the branding icon index for the specified service
       
    85      * id is already available or not.
       
    86      *
       
    87      * @since S60 v3.2
       
    88      * @param aServiceId service id
       
    89      * @return True, if the branding icon index for the specified service
       
    90      *         id is available, False otherwise
       
    91      */ 
       
    92     TBool BrandIconIndexAvailable( TUint32 aServiceId ) const;
       
    93 
       
    94     /**
       
    95      * Sets the brand icon index of the event info entry with a 
       
    96      * certain service id to 'aBrandingIconIndex'. If no event
       
    97      * info entry could be found, 'KErrNotFound' is returned.
       
    98      * If setting succeeded 'KErrNone' is returned.
       
    99      *
       
   100      * @since S60 v3.2
       
   101      * @param aServiceId Id of requested settings entry
       
   102      * @param aBrandingIconIndex the brand icon index to be set
       
   103      * @return KErrNotFound, if no TLogsEventInfo object with the
       
   104      *         specified service id could be found, KErrNone otherwise
       
   105      */ 
       
   106     TInt SetBrandIndex( TUint32 aServiceId, TInt aBrandingIconIndex );    
       
   107     
       
   108     
       
   109 private:
       
   110     
       
   111     void ConstructL();
       
   112     
       
   113     /**
       
   114      * Constructor.
       
   115      */
       
   116     CLogsEventInfoManager();
       
   117 
       
   118     /**
       
   119      * Determines whether the manager contains already an entry for the 
       
   120      * specified service id.
       
   121      *
       
   122      * @since S60 v3.2
       
   123      * @param aServiceId the service id
       
   124      * @return Erue, if the manager contains already an entry with the
       
   125      *         specified service id, False otherwise
       
   126      */ 
       
   127     TBool EntryExists( TUint32 aServiceId );    
       
   128     
       
   129     /**
       
   130      * Searches the event info array for an entry with the specified service id
       
   131      * and returns the pointer to this entry or NULL if no such entry can be 
       
   132      * found.
       
   133      *
       
   134      * @since S60 v3.2
       
   135      * @param aServiceId Id of requested settings entry
       
   136      * @return Pointer to the entry with the specified service id or NULL if 
       
   137      *         no such entry can be found in the iEventInfoArray array
       
   138      */ 
       
   139     TLogsEventInfo* GetEventInfoEntry( TUint32 aServiceId ) const;
       
   140 
       
   141   
       
   142 private: // data   
       
   143     
       
   144     /**
       
   145      * The array that contains the event info entries
       
   146      * Own.
       
   147      */  
       
   148     RPointerArray<TLogsEventInfo> iEventInfoArray;
       
   149     
       
   150     };
       
   151         
       
   152 #endif // C_CLOGSEVENTINFOMANAGER_H