phoneclientserver/phoneserver/Inc/Messenger/CPhSrvSubSessionMessenger.h
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     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:  Subsession for Messenger.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPHSRVSUBSESSIONMESSENGER_H
       
    19 #define CPHSRVSUBSESSIONMESSENGER_H
       
    20 
       
    21 
       
    22 // INCLUDES
       
    23 #include "CPhSrvSubSessionBase.h"
       
    24 #include <CPhCltMessenger.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MPhSrvMessengerNegotiator;
       
    28 
       
    29 
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 *  Messenger Subsession.
       
    35 *
       
    36 *  @since 2.6
       
    37 */
       
    38 class CPhSrvSubSessionMessenger
       
    39 :   public CPhSrvSubSessionBase
       
    40     {
       
    41     public:  // Constructors and destructor
       
    42 
       
    43         /**
       
    44         * Two-phased constructor.
       
    45         * 
       
    46         * @param aSession The pre-opened Phone Server session.
       
    47         * @return CPhSrvSubSessionMessenger subsession.
       
    48         */
       
    49         static CPhSrvSubSessionBase* NewL(
       
    50             CPhSrvSession& aSession );
       
    51 
       
    52         /**
       
    53         * Destructor.
       
    54         *
       
    55         */
       
    56         ~CPhSrvSubSessionMessenger();
       
    57 
       
    58 
       
    59     private: // Functions from base classes   
       
    60 
       
    61         /**
       
    62         * @see MPhSrvMessageDecoder
       
    63         */
       
    64         TBool PhSrvMessageDecoderCanProcessMessage( TInt aFunction );
       
    65 
       
    66         /**
       
    67         * @see MPhSrvMessageProcessor
       
    68         */
       
    69         void PhSrvMessageProcessorHandleMessageL( const RMessage2& aMessage );
       
    70 
       
    71 
       
    72     private: // SubSession function handlers
       
    73 
       
    74         /**
       
    75         * Handle the close command.
       
    76         * 
       
    77         * @param aMessage The received message.
       
    78         */
       
    79         void CmdSubSessionClose( const RMessage2& aMessage );
       
    80 
       
    81         /**
       
    82         * Handle the construct command.
       
    83 
       
    84         */
       
    85         void CmdSubSessionMessengerConstructL( const RMessage2& aMessage );
       
    86 
       
    87         /**
       
    88         * Handle the receive command.
       
    89         */
       
    90         void CmdSubSessionMessengerReceive( const RMessage2& aMessage );
       
    91 
       
    92         /**
       
    93         * Handle the send command.
       
    94         * 
       
    95         * @param aMessage The received message.
       
    96         */
       
    97         void CmdSubSessionMessengerSend( const RMessage2& aMessage );
       
    98 
       
    99         /**
       
   100         * Handle the skip command.
       
   101         * 
       
   102         * @param aMessage The received message.
       
   103         */
       
   104         void CmdSubSessionMessengerSkip( const RMessage2& aMessage );
       
   105 
       
   106         /**
       
   107         * Handle the cancel command.
       
   108         * 
       
   109         * @param aMessage The received message.
       
   110         */
       
   111         void CmdSubSessionMessengerCancel( const RMessage2& aMessage );
       
   112 
       
   113 
       
   114     private: // Helper functions.
       
   115 
       
   116         /**
       
   117         * Returns the Messenger negotiator.
       
   118         * 
       
   119         * @return Messenger negotiator.
       
   120         */
       
   121         MPhSrvMessengerNegotiator& GetMessengerNegotiator();
       
   122 
       
   123         /**
       
   124         * Forwards the request to messenger negotiator.
       
   125         * 
       
   126         * @param aSubSession Subsession for messenger.
       
   127         * @param aParameters The request parameters.
       
   128         * @param aMessage The received message.
       
   129         */
       
   130         void ForwardRequest(
       
   131             CPhSrvSubSessionBase& aSubSession,
       
   132             const TPhCltMessengerParameters& aParameters,
       
   133             const RMessage2& aMessage );
       
   134 
       
   135         /**
       
   136         * Cleans the negotiator side.
       
   137         */
       
   138         void Clean();
       
   139 
       
   140 
       
   141     private: 
       
   142 
       
   143         /**
       
   144         * Constructor.
       
   145         *
       
   146         * @param aSession The session where this subsession belongs.
       
   147         */
       
   148         CPhSrvSubSessionMessenger( CPhSrvSession& aSession );
       
   149 
       
   150     };
       
   151 
       
   152 #endif // CPHSRVSUBSESSIONMESSENGER_H
       
   153 
       
   154 
       
   155 // End of File