bluetoothengine/headsetsimulator/core/inc/RemoteControl/hsremotecontroldatahandler.h
branchheadsetsimulator
changeset 60 90dbfc0435e3
equal deleted inserted replaced
59:02103bf20ee5 60:90dbfc0435e3
       
     1 /*
       
     2  * Component Name: Headset Simulator
       
     3  * Author: Comarch S.A.
       
     4  * Version: 1.0
       
     5  * Copyright (c) 2010 Comarch S.A.
       
     6  *  
       
     7  * This Software is submitted by Comarch S.A. to Symbian Foundation Limited on 
       
     8  * the basis of the Member Contribution Agreement entered between Comarch S.A. 
       
     9  * and Symbian Foundation Limited on 5th June 2009 (“Agreement”) and may be 
       
    10  * used only in accordance with the terms and conditions of the Agreement. 
       
    11  * Any other usage, duplication or redistribution of this Software is not 
       
    12  * allowed without written permission of Comarch S.A.
       
    13  * 
       
    14  */
       
    15 
       
    16 #ifndef HSREMOTECONTROLDATAHANDLER_H
       
    17 #define HSREMOTECONTROLDATAHANDLER_H
       
    18 
       
    19 #include <e32base.h>
       
    20 
       
    21 class THsRemoteControlCommand;
       
    22 class CHsRemoteControlParser;
       
    23 
       
    24 /**
       
    25  * @brief Manages remote requests
       
    26  */
       
    27 class CHsRemoteControlDataHandler : public CBase
       
    28 {
       
    29 
       
    30 public:
       
    31     /**
       
    32      * Two-phased constructor.
       
    33      * 
       
    34      * @return class instance
       
    35      */
       
    36     static CHsRemoteControlDataHandler* NewL();
       
    37 
       
    38     /**
       
    39      * Two-phased constructor.
       
    40      * 
       
    41      * @return class instance
       
    42      */
       
    43     static CHsRemoteControlDataHandler* NewLC();
       
    44 
       
    45     /**
       
    46      * Destructor
       
    47      */
       
    48     ~CHsRemoteControlDataHandler();
       
    49 
       
    50 public:
       
    51 
       
    52     /**
       
    53      * Transforms remote requests into THsRemoteControlCommand objects
       
    54      * 
       
    55      * @param aDataIn remote request read from socket
       
    56      * @param aCmd THsRemoteControlCommand object
       
    57      * 
       
    58      * @return error code.
       
    59      *      KErrNone if OK
       
    60      *      KErrArgument if command not valid or not supported
       
    61      *      KErrGeneral, KErrOverflow if error in parsing
       
    62      */
       
    63     TInt RecognizeCommand( const TDesC8& aDataIn, 
       
    64             THsRemoteControlCommand& aCmd );
       
    65 
       
    66 private:
       
    67 
       
    68     /**
       
    69      * Constructor for performing 1st stage construction
       
    70      */
       
    71     CHsRemoteControlDataHandler();
       
    72 
       
    73     /**
       
    74      * Constructor for performing 2nd stage construction
       
    75      */
       
    76     void ConstructL();
       
    77 
       
    78 private:
       
    79 
       
    80     /**
       
    81      * Checks if command is supported
       
    82      * 
       
    83      * @param aCmd command to be checked
       
    84      * @return ETrue if OK, otherwise EFalse
       
    85      */
       
    86     TBool IsCommandValid( THsRemoteControlCommand& aCmd );
       
    87 
       
    88 private:
       
    89 
       
    90     /** Pointer to parser. Owned */
       
    91     CHsRemoteControlParser* iParser;
       
    92 
       
    93 };
       
    94 #endif // HSREMOTECONTROLDATAHANDLER_H