logsui/logsserviceextension/inc/clogsextpresentitydata.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:  Holdes data of a presentity.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CLOGSEXTPRESENTITYDATA_H
       
    20 #define C_CLOGSEXTPRESENTITYDATA_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "ximpcontextobserver.h"
       
    25 #include "mlogsextservicehandlerobserver.h"
       
    26 
       
    27 
       
    28 class MXIMPBase;
       
    29 class TXIMPRequestId;
       
    30 class CLogsExtServiceHandler;
       
    31 
       
    32 
       
    33 /**
       
    34  * Presentity data holder.
       
    35  *
       
    36  * @since S60 v3.2
       
    37  */ 
       
    38 NONSHARABLE_CLASS(CLogsExtPresentityData) : 
       
    39         public CBase     
       
    40     {
       
    41 public: 
       
    42     
       
    43     enum TPresentityDataState 
       
    44             {        
       
    45             ESubscriptionOngoing = 0,
       
    46             ESubscribed,
       
    47             EUnsubscriptionOngoing,
       
    48             EUnsubscribed
       
    49             };
       
    50     
       
    51 public:          
       
    52             
       
    53     /**
       
    54      * Creates a new CLogsExtPresentityData.
       
    55      *
       
    56      * @since S60 v3.2
       
    57      * @param aPresentityId a presentity id
       
    58      * @param aServiceHandler the service handler
       
    59      * @return a new CLogsExtPresentityData instance
       
    60      */
       
    61     static CLogsExtPresentityData* NewL(         
       
    62         const TDesC& aPresentityId,
       
    63         CLogsExtServiceHandler& aServiceHandler );
       
    64         
       
    65     /**
       
    66      * Creates a new CLogsExtPresentityData.
       
    67      *
       
    68      * @since S60 v3.2
       
    69      * @param aPresentityId a presentity id     
       
    70      * @param aServiceHandler the service handler
       
    71      * @return a new CLogsExtPresentityData instance
       
    72      */    
       
    73     static CLogsExtPresentityData* NewLC(         
       
    74         const TDesC& aPresentityId,
       
    75         CLogsExtServiceHandler& aServiceHandler );
       
    76         
       
    77     /**
       
    78      * Destructor.
       
    79      */
       
    80     ~CLogsExtPresentityData();
       
    81 
       
    82 public: 
       
    83 
       
    84     /**
       
    85      * Returns the presentity id.
       
    86      *
       
    87      * @since S60 v3.2
       
    88      * @return the presentity id
       
    89      */ 
       
    90     const TDesC& PresentityId();   
       
    91     
       
    92     /**
       
    93      * Returns current subscription state.
       
    94      *
       
    95      * @since S60 v3.2
       
    96      * @return the subscription state.
       
    97      */
       
    98     TInt Status();
       
    99 
       
   100     /**
       
   101      * Sets subscription state.
       
   102      *
       
   103      * @since S60 v3.2
       
   104      * @param the subscription state.
       
   105      */    
       
   106     void SetStatus( TPresentityDataState aStatus );
       
   107 
       
   108     /**
       
   109      * Returns subscription request id.
       
   110      *
       
   111      * @since S60 v3.2
       
   112      * @return the subscription request id.
       
   113      */    
       
   114     TXIMPRequestId PresentitySubscriptionRequestId();
       
   115 
       
   116     /**
       
   117      * Sets subscription request id.
       
   118      *
       
   119      * @since S60 v3.2
       
   120      * @param the subscription state.
       
   121      */
       
   122     void SetPresentitySubscriptionRequestId( TXIMPRequestId aRequestId );
       
   123     
       
   124 private:
       
   125     
       
   126     /**
       
   127      * Symbian second-phase constructor.
       
   128      */                    
       
   129     void ConstructL( const TDesC& aPresentityId );
       
   130 
       
   131     /**
       
   132      * Constructor.
       
   133      */
       
   134     CLogsExtPresentityData( CLogsExtServiceHandler& aServiceHandler ); 
       
   135 
       
   136     
       
   137 private: // data
       
   138         
       
   139     /**
       
   140      * The request id of the subscription request.
       
   141      */
       
   142     TXIMPRequestId iPresentitySubscriptionRequestId;
       
   143 
       
   144     /**
       
   145      * Current subscription state.     
       
   146      */
       
   147     TPresentityDataState iState;
       
   148         
       
   149     /**
       
   150      * The presentity id
       
   151      * Own.
       
   152      */
       
   153     HBufC* iPresentityId;
       
   154         
       
   155     /**
       
   156      * Service handler     
       
   157      */
       
   158     CLogsExtServiceHandler& iServiceHandler;
       
   159         
       
   160     };
       
   161 
       
   162 #endif  //  C_CLOGSEXTPRESENTITYDATA_H