PECengine/TransferAdapter2/Inc/MPEngAccessHandler.h
branchRCL_3
changeset 13 a941bc465d9f
parent 0 094583676ce7
equal deleted inserted replaced
12:6ca72c0fe49a 13:a941bc465d9f
       
     1 /*
       
     2 * Copyright (c) 2004 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: this class handles the access of one network session
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __MPENGACCESSHANDLER_H
       
    19 #define __MPENGACCESSHANDLER_H
       
    20 
       
    21 
       
    22 //  INCLUDES
       
    23 #include <E32Std.h>
       
    24 
       
    25 // DATA TYPES
       
    26 
       
    27 
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class MPEngSessionStatusObserver;
       
    31 class TPEngWVCspServicesTree2;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 /**
       
    35  *  Access handler of one network session
       
    36  *
       
    37  *  It is used to open/close network session
       
    38  *  and register its observers
       
    39  *
       
    40  *  @since 3.0
       
    41  */
       
    42 class MPEngAccessHandler
       
    43     {
       
    44 
       
    45     public: //
       
    46 
       
    47         /**
       
    48          *  Close reference to the Access handler
       
    49          *  Access halder is deleted if it is no more needed.
       
    50          *  If Access handler is deleted and it had active connection
       
    51          *  then connection is closed as well.
       
    52          *
       
    53          *  @since 3.0
       
    54          */
       
    55         virtual void Close() = 0;
       
    56 
       
    57 
       
    58         /**
       
    59          * Open reference to the access Handler
       
    60          *
       
    61          * @since 3.0
       
    62          */
       
    63         virtual void Open() = 0 ;
       
    64 
       
    65         /**
       
    66          *  Log in to the presence server
       
    67          *  Log in is done with the parameters passed in the
       
    68          *  aLoginBuffer.
       
    69          *
       
    70          *  @since 3.0
       
    71          *
       
    72          *  @param aStatus TRequestStatus where completion of the
       
    73          *          log in is signaled
       
    74          *  @param aLoginBuffer login buffer containing
       
    75          *          data which is used to log in to the
       
    76          *          presence server.
       
    77          */
       
    78         virtual void LogInL( TRequestStatus& aStatus,
       
    79                              HBufC8* aLoginBuffer ) = 0;
       
    80 
       
    81         /**
       
    82          *  Log out from the presence server
       
    83          *
       
    84          *  @since 3.0
       
    85          *
       
    86          *  @param aStatus TRequestStatus where completion of the
       
    87          *           log out is signaled.
       
    88          *  @return
       
    89          */
       
    90         virtual void LogOutL( TRequestStatus& aStatus ) = 0;
       
    91 
       
    92         /**
       
    93          *  Returns data which was used for log in.
       
    94          *  if Access handler is not connected to any presence
       
    95          *  server, log in buffer is empty.
       
    96          *
       
    97          *  @since 3.0
       
    98          *
       
    99          *  @return log in data buffer reference
       
   100          */
       
   101         virtual const TDesC8& LogInData( ) const = 0;
       
   102 
       
   103         /**
       
   104          *  Cancels active asynchronous operation
       
   105          *  There can be only one active asynchronous
       
   106          *  operation at the time ( LogInL, LogOutL)
       
   107          *
       
   108          *  @since 3.0
       
   109          */
       
   110         virtual void Cancel() = 0;
       
   111 
       
   112         /**
       
   113          *  Register session status observer
       
   114          *
       
   115          *  @since 3.0
       
   116          *
       
   117          *  @param aObserver session status observer
       
   118          */
       
   119         virtual void RegisterSessionObserverL(
       
   120             MPEngSessionStatusObserver& aObserver ) = 0;
       
   121 
       
   122         /**
       
   123          *  UnRegister session status observer
       
   124          *
       
   125          *  @since 3.0
       
   126          *  @param aObserver session status observer
       
   127          */
       
   128         virtual void UnregisterSessionObserver(
       
   129             MPEngSessionStatusObserver& aObserver ) = 0;
       
   130 
       
   131 
       
   132         /**
       
   133          *  Get session service capabilities
       
   134          *
       
   135          *  @since 3.0
       
   136          *
       
   137          *  @return session service capabilities
       
   138          */
       
   139         virtual TPEngWVCspServicesTree2& ServiceCapabilities() = 0;
       
   140 
       
   141 
       
   142         /**
       
   143          *  Assert log in data of opened session with the passed data
       
   144          *  Function leaves with wrong password code if password does not match
       
   145          *
       
   146          *  @since 3.0
       
   147          *
       
   148          *  @param aLogInData login data
       
   149          */
       
   150         virtual void AssertLoginDataL( TDesC8& aLogInData ) = 0;
       
   151 
       
   152 
       
   153     protected:  //Destructor
       
   154 
       
   155         /**
       
   156          *  Virtual inline destructor.
       
   157          *  Protected destructor to prohibits deletion trough interface.
       
   158          */
       
   159         virtual ~MPEngAccessHandler() {};
       
   160     };
       
   161 
       
   162 
       
   163 #endif      //  __MPEngAccessHandler_H
       
   164 
       
   165 //  End of File
       
   166 
       
   167 
       
   168