presencefwsimpleadpt/inc/simplepluginsession.h
changeset 26 04ca1926b01c
parent 20 76bddcd072ba
child 28 d9861ae9169c
child 32 32463a6c57b3
equal deleted inserted replaced
20:76bddcd072ba 26:04ca1926b01c
     1 /*
       
     2 * Copyright (c) 2006 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:    Simple Protocol implementation for Presence Framework
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CSIMPLEPLUGINSESSION_H
       
    22 #define CSIMPLEPLUGINSESSION_H
       
    23 
       
    24 
       
    25 #include <e32std.h>
       
    26 #include <msimpleconnectionobserver.h>
       
    27 #include "msimplepluginconnectionobs.h"
       
    28 
       
    29 class MXIMPContextClientInfo;
       
    30 class MXIMPProtocolConnection;
       
    31 class MXIMPServiceInfo;
       
    32 
       
    33 
       
    34 class MSimpleConnection;
       
    35 
       
    36 /**
       
    37  * CSimplePluginSession
       
    38  *
       
    39  * Simple Engine Connection
       
    40  *
       
    41  * @lib ?library
       
    42  * @since s60 v5.0
       
    43  */
       
    44 NONSHARABLE_CLASS( CSimplePluginSession ) : public CBase,
       
    45                              public MSimpleConnectionObserver
       
    46     {
       
    47 public:
       
    48 
       
    49     static CSimplePluginSession* NewL(
       
    50         const MXIMPServiceInfo& aService,
       
    51         MSimplePluginConnectionObs& aObs );
       
    52 
       
    53     virtual ~CSimplePluginSession();
       
    54 
       
    55     /**
       
    56      * OpenSessionL
       
    57      *
       
    58      * Opens the SIP connection (registers when needed)
       
    59      * 
       
    60      */
       
    61     void OpenSessionL();
       
    62     
       
    63     /**
       
    64      * OpenSessionL
       
    65      *
       
    66      * Opens the SIP connection (registers when needed)
       
    67      * @param aSettingsId settings id
       
    68      *
       
    69      */
       
    70     void OpenSessionL( TInt aSettingsId );    
       
    71 
       
    72     /**
       
    73      * MSimpleConnection accessor
       
    74      * @return MSImpleConnection instance
       
    75      */
       
    76     MSimpleConnection* SimpleConnection();
       
    77 
       
    78     /**
       
    79      * XDMSettings accessor
       
    80      * @return XDM Settings ID
       
    81      */
       
    82     TInt XdmSettingsId();
       
    83 
       
    84     /**
       
    85      * Current registered SIP entity
       
    86      */
       
    87     TPtrC8 CurrentSipPresentity();
       
    88 
       
    89     /**
       
    90      * Domain syntax for current settings
       
    91      */
       
    92     TPtrC16 CurrentDomain();
       
    93 
       
    94 private:
       
    95 
       
    96     CSimplePluginSession( MSimplePluginConnectionObs& aObs );
       
    97 
       
    98     void ConstructL(
       
    99         const MXIMPServiceInfo& aService );
       
   100 
       
   101 
       
   102 public:
       
   103 
       
   104 // from base class MSimpleConnectionObserver
       
   105 
       
   106     /**
       
   107      * Defined in a base class
       
   108      */
       
   109     void ConnectionStatusL( MSimpleConnection::TSimpleState aState );
       
   110 
       
   111     /**
       
   112      * Defined in a base class
       
   113      */
       
   114     void RequestCompleteL( TInt aOpId, TInt aStatus );
       
   115 
       
   116 // from base class CActive
       
   117 
       
   118 protected:
       
   119 
       
   120 
       
   121 private: // Data
       
   122 
       
   123     /**
       
   124      * PrFw Plugin connection observer
       
   125      */
       
   126     MSimplePluginConnectionObs& iObs;
       
   127 
       
   128     /**
       
   129      * Simple Engine connection.
       
   130      * Own.
       
   131      */
       
   132     MSimpleConnection* iConnection;
       
   133 
       
   134     /**
       
   135      * Current Simple Engine operation id
       
   136      */
       
   137     TInt iOpId;
       
   138 
       
   139     /**
       
   140      * IAP Id
       
   141      */
       
   142     TInt32 iIap;
       
   143 
       
   144     /**
       
   145      * XDM Settings id
       
   146      */
       
   147     TInt iXdmSetting;
       
   148 
       
   149     /**
       
   150      * Request type
       
   151      */
       
   152     MSimplePluginConnectionObs::TReqType iType;
       
   153 
       
   154     /**
       
   155      * Current User ID, User's SIP identity
       
   156      * Own.
       
   157      */
       
   158     HBufC8* iUserId8;
       
   159 
       
   160     /**
       
   161      * Domain syntax for current settings
       
   162      * Own,
       
   163      */
       
   164     HBufC16* iDomain;
       
   165     
       
   166     /**
       
   167      * Whether conncted to network
       
   168      */
       
   169     TBool iConnected;
       
   170 
       
   171     };
       
   172 
       
   173 #endif // CSIMPLEPLUGINSESSION_H