bluetoothengine/btnotif/btnotifsrv/inc/btnotifsession.h
changeset 31 a0ea99b6fa53
parent 29 48ae3789ce00
equal deleted inserted replaced
30:df7a93ede42e 31:a0ea99b6fa53
     1 /*
     1 /*
     2 * ============================================================================
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3 *  Name        : btnotifsession.h
     3 * All rights reserved.
     4 *  Part of     : bluetoothengine / btnotif
     4 * This component and the accompanying materials are made available
     5 *  Description : Session class for handling commands from clients.
     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".
     6 *
     8 *
     7 *  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
     9 * Initial Contributors:
     8 *  All rights reserved.
    10 * Nokia Corporation - initial contribution.
     9 *  This component and the accompanying materials are made available
       
    10 *  under the terms of "Eclipse Public License v1.0"
       
    11 *  which accompanies this distribution, and is available
       
    12 *  at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    13 *
    11 *
    14 *  Initial Contributors:
    12 * Contributors:
    15 *  Nokia Corporation - initial contribution.
       
    16 *
    13 *
    17 *  Contributors:
    14 * Description: Session class for handling commands from clients.
    18 *  Nokia Corporation
    15 *
    19 * ============================================================================
       
    20 * Template version: 4.2
       
    21 */
    16 */
    22 
    17 
    23 #ifndef BTNOTIFSESSION_H
    18 #ifndef BTNOTIFSESSION_H
    24 #define BTNOTIFSESSION_H
    19 #define BTNOTIFSESSION_H
    25 
    20 
    62      *
    57      *
    63      * @since Symbian^4
    58      * @since Symbian^4
    64      */
    59      */
    65     virtual void CreateL();
    60     virtual void CreateL();
    66 
    61 
    67     /**
       
    68      * Complete a client message from a message handle.
       
    69      *
       
    70      * @since Symbian^4
       
    71      * @param aHandle The handle identifying the message.
       
    72      * @param aReason The reason code to complete the message with.
       
    73      * @param aReply Data to write back to the client.
       
    74      * @return KErrNone on success; KErrNotFound if the message is not found.
       
    75      */
       
    76     TInt CompleteMessage( TInt aHandle, TInt aReason, const TDesC8& aReply );
       
    77 
       
    78     /**
       
    79      * Find a message identified by an RMessage2 handle.
       
    80      *
       
    81      * @since Symbian^4
       
    82      * @param aHandle The handle identifying the message.
       
    83      * @return The message.
       
    84      */
       
    85     const RMessage2* FindMessageFromHandle( TInt aHandle ) const;
       
    86 
       
    87     /**
       
    88      * Find a message identified by an RNotifier notifier UID.
       
    89      *
       
    90      * @since Symbian^4
       
    91      * @param aUid The UID identifying the message.
       
    92      * @return The message.
       
    93      */
       
    94     const RMessage2* FindMessageFromUid( TInt aUid ) const;
       
    95 
       
    96 private:
    62 private:
    97 
    63 
    98     CBTNotifSession();
    64     CBTNotifSession();
    99 
    65 
   100     void ConstructL();
    66     void ConstructL();
   106      * @param Pointer to our server.
    72      * @param Pointer to our server.
   107      */
    73      */
   108     inline CBTNotifServer* Server() const
    74     inline CBTNotifServer* Server() const
   109         { return (CBTNotifServer*) CSession2::Server(); }
    75         { return (CBTNotifServer*) CSession2::Server(); }
   110 
    76 
   111     /**
       
   112      * Processes a message from a client.
       
   113      *
       
   114      * @since Symbian^4
       
   115      * @param aMessage The message containing the details of the client request.
       
   116      */
       
   117     void DispatchMessageL( const RMessage2& aMessage );
       
   118 
       
   119 private: // data
    77 private: // data
   120 
       
   121     /**
       
   122      * Array of messages currently being processed.
       
   123      */
       
   124     RArray<RMessage2> iMessageQ;
       
   125 
    78 
   126     BTUNITTESTHOOK
    79     BTUNITTESTHOOK
   127 
    80 
   128     };
    81     };
   129 
    82