logsui/logsserviceextension/inc/clogspresenceindextableentry.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:  Triplet that contains the service id, presence status and the
       
    15 *                index of the presence status icon in the listbox's icon array
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef C_CLOGSPRESENCEINDEXTABLEENTRY_H
       
    22 #define C_CLOGSPRESENCEINDEXTABLEENTRY_H
       
    23 
       
    24 
       
    25 #include <e32base.h>
       
    26 
       
    27 
       
    28 /**
       
    29  *  Encapsulates service id, presence status and the index of the presence 
       
    30  *  status icon in the listbox's icon array.
       
    31  *
       
    32  *  @since S60 v3.2
       
    33  */
       
    34 NONSHARABLE_CLASS(CLogsPresenceIndexTableEntry) : public CBase
       
    35     {
       
    36 
       
    37 public:
       
    38     
       
    39     
       
    40     /**
       
    41      * Two-phased constructor.
       
    42      * @param aServiceId a service id
       
    43      * @param aPresenceStatusString a presence status string e.g."open"
       
    44      * @param aPresenceIconIndex a icon index
       
    45      */
       
    46      static CLogsPresenceIndexTableEntry* NewL( 
       
    47         const TUint32 aServiceId, 
       
    48         const TDesC& aPresenceStatusString,
       
    49         TInt aPresenceIconIndex = KErrNotFound );
       
    50         
       
    51     /**
       
    52      * Two-phased constructor.
       
    53      * @param aServiceId a service id
       
    54      * @param aPresenceStatusString a presence status string e.g."open"
       
    55      * @param aPresenceIconIndex a icon index
       
    56      */
       
    57     static CLogsPresenceIndexTableEntry* NewLC( 
       
    58         const TUint32 aServiceId, 
       
    59         const TDesC& aPresenceStatusString,
       
    60         TInt aPresenceIconIndex = KErrNotFound );
       
    61     
       
    62     /**
       
    63      * Destructor
       
    64      */
       
    65     ~CLogsPresenceIndexTableEntry();
       
    66 
       
    67 
       
    68     /**
       
    69      * Returns the service id of this index table entry.
       
    70      *
       
    71      * @since S60 v3.2
       
    72      * @return service id
       
    73      */
       
    74     TUint32 ServiceId() const;
       
    75     
       
    76     /**
       
    77      * Returns the presence status string of this index table entry.
       
    78      *
       
    79      * @since S60 v3.2
       
    80      * @return presence status string, e.g."busy"
       
    81      */
       
    82     TDesC& PresenceStatusString() const;    
       
    83     
       
    84     /**
       
    85      * Returns the presence icon index of this index table entry.
       
    86      *
       
    87      * @since S60 v3.2
       
    88      * @return KErrNone, if the index is different from KErrNotFound (which
       
    89      * is the initial value); KErrNotFound otherwise 
       
    90      */    
       
    91     TInt PresenceIconIndex() const;
       
    92 
       
    93     /**
       
    94      * Sets the presence icon index of this index table entry 
       
    95      *
       
    96      * @since S60 v3.2
       
    97      * @param aPresenceIconIndex the presence status icon index
       
    98      * @return KErrNone, if setting the index was successful
       
    99      *         KErrArgument, if the aPresenceIconIndex is negative
       
   100      */ 
       
   101     TInt SetPresenceIconIndex( TInt aPresenceIconIndex );
       
   102     
       
   103     
       
   104 private:
       
   105        
       
   106     /**
       
   107      * Constructor
       
   108      *
       
   109      * @since S60 v3.2
       
   110      */
       
   111     CLogsPresenceIndexTableEntry( const TUint32 aServiceId );
       
   112 
       
   113 
       
   114     /**
       
   115      * Symbian Second Phase Constructor.
       
   116      *
       
   117      * @since S60 v3.2
       
   118      */
       
   119     void ConstructL( const TDesC& aPresenceStatusString,
       
   120                      const TInt aPresenceIconIndex );
       
   121 
       
   122 
       
   123     /**
       
   124      * Returns the presence status of this index table entry.
       
   125      *
       
   126      * @since S60 v3.2
       
   127      * @return presence status
       
   128      */
       
   129     TInt PresenceStatus() const;
       
   130     
       
   131 
       
   132 private: // data
       
   133 
       
   134     /**
       
   135      * Service Id.
       
   136      */
       
   137     TUint32 iServiceId;
       
   138 
       
   139     /**
       
   140      * The Presence status in a string representation.
       
   141      */
       
   142     HBufC* iPresenceStatusString; 
       
   143     
       
   144     /**
       
   145      * Index of the icon of the presence status 'iPresenceStatus' 
       
   146      * of service with 'iServiceId' in the listbox's icon array.
       
   147      */
       
   148     TInt iPresenceIconIndex;
       
   149     
       
   150     };
       
   151 
       
   152 
       
   153 #endif // C_CLOGSPRESENCEINDEXTABLEENTRY_H