logsui/logsserviceextension/inc/clogspresencestatustableentry.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, presentity id and the
       
    15 *                presence status.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef C_CLOGSPRESENCESTATUSTABLEENTRY_H
       
    22 #define C_CLOGSPRESENCESTATUSTABLEENTRY_H
       
    23 
       
    24 #include <e32base.h>
       
    25 
       
    26 /**
       
    27  *  Encapsulates the service id, presentity id and the presence status.
       
    28  *
       
    29  *  @since S60 v3.2
       
    30  */
       
    31 NONSHARABLE_CLASS(CLogsPresenceStatusTableEntry) : public CBase
       
    32     {
       
    33 
       
    34 public:    
       
    35 
       
    36     /**
       
    37      * Two-phased constructor.
       
    38      *
       
    39      * @since S60 v3.2     
       
    40      * @param aServiceId a service id
       
    41      * @param aPresentityId a presentity id
       
    42      * @param aDisplayStatus status display flag
       
    43      * @param aPresenceStatusString a presence status string e.g."open"
       
    44      */
       
    45     static CLogsPresenceStatusTableEntry* NewL(
       
    46         const TUint32 aServiceId, 
       
    47         const TDesC& aPresentityId,
       
    48         TBool aDisplayStatus,
       
    49         TDesC* aPresenceStatusString = NULL );
       
    50         
       
    51     /**
       
    52      * Two-phased constructor.
       
    53      *
       
    54      * @since S60 v3.2     
       
    55      * @param aServiceId a service id
       
    56      * @param aPresentityId a presentity id
       
    57      * @param aDisplayStatus status display flag
       
    58      * @param aPresenceStatusString a presence status string e.g."open"
       
    59      */
       
    60     static CLogsPresenceStatusTableEntry* NewLC(
       
    61         const TUint32 aServiceId, 
       
    62         const TDesC& aPresentityId, 
       
    63         TBool aDisplayStatus,
       
    64         TDesC* aPresenceStatusString = NULL );
       
    65 
       
    66     /**
       
    67      * Destructor
       
    68      *
       
    69      * @since S60 v3.2     
       
    70      */    
       
    71     ~CLogsPresenceStatusTableEntry();
       
    72     
       
    73         
       
    74     /**
       
    75      * Returns the service id of this status table entry.
       
    76      *
       
    77      * @since S60 v3.2
       
    78      * @return service id
       
    79      */
       
    80     TUint32 ServiceId() const;        
       
    81     
       
    82     /**
       
    83      * Returns the presence display status of this status table entry.
       
    84      *
       
    85      * @since S60 v3.2
       
    86      * @return ETrue, if the presence status should be displayed in UI, 
       
    87      *         EFalse otherwise.
       
    88      */
       
    89     TBool DisplayPresence();
       
    90     
       
    91     /**
       
    92      * Sets the presence display status flag of this status table entry.
       
    93      *
       
    94      * @since S60 v3.2     
       
    95      * @param aDisplayStatus status flag
       
    96      */
       
    97     void SetDisplayPresence( TBool aDisplayStatus );
       
    98     
       
    99     /**
       
   100      * Returns the presentity id of this status table entry.
       
   101      *
       
   102      * @since S60 v3.2
       
   103      * @return presentity id
       
   104      */
       
   105     const TDesC& PresentityId();
       
   106     
       
   107     /**
       
   108      * Returns the presence status of this status table entry.
       
   109      * Ownership is not transferred. 
       
   110      *
       
   111      * @since S60 v3.2
       
   112      * @return The presence status of this status table entry or NULL
       
   113      *         if the value was not set.Owbership is not transferred.
       
   114      */    
       
   115     TDesC* PresenceStatusString();
       
   116     
       
   117     /**
       
   118      * Sets the presence status string of this status table entry.
       
   119      *
       
   120      * @since S60 v3.2
       
   121      * @param aPresenceStatusString the new presence status string
       
   122      * @return KErrNone, if setting was successful and KErrNoMemory
       
   123      *         in case an error occurred.
       
   124      */  
       
   125     TInt SetPresenceStatusString( const TDesC& aPresenceStatusString );
       
   126     
       
   127     /**
       
   128      * Resets the presence status string of this status table entry.
       
   129      */
       
   130     void ResetPresenceStatusString();
       
   131     
       
   132 private:
       
   133 
       
   134     /**
       
   135      * Constructor
       
   136      *
       
   137      * @since S60 v3.2
       
   138      * @param aServiceId a service id
       
   139      * @param aDisplayStatus status display flag
       
   140      */
       
   141     CLogsPresenceStatusTableEntry( const TUint32 aServiceId, 
       
   142                                    TBool aDisplayStatus );
       
   143 
       
   144     /**
       
   145      * Symbian Second Phase Constructor.
       
   146      *
       
   147      * @since S60 v3.2     
       
   148      * @param aPresentityId a presentity id     
       
   149      * @param aPresenceStatus a presence status e.g."open"     
       
   150      */       
       
   151     void ConstructL( const TDesC& aPresentityId,
       
   152                      TDesC* aPresenceStatus );
       
   153 
       
   154 
       
   155 private: // data
       
   156 
       
   157     /**
       
   158      * Service Id
       
   159      */
       
   160     TUint32 iServiceId;
       
   161 
       
   162     /**
       
   163      * The PresentityId
       
   164      * Own.
       
   165      */
       
   166     HBufC* iPresentityId;
       
   167 
       
   168     /**
       
   169      * The Presence status in an integer representation.
       
   170      * Own.
       
   171      */    
       
   172     HBufC* iPresenceStatusString;
       
   173     
       
   174     /**
       
   175      * The Presence status shown in UI or not.
       
   176      * Own.
       
   177      */    
       
   178     TBool iDisplayStatus;
       
   179 
       
   180     };
       
   181 
       
   182 
       
   183 #endif // C_CLOGSPRESENCESTATUSTABLEENTRY_H