atcommands/lccustomplugin/inc/lclistallcmd.h
branchRCL_3
changeset 13 b6f55cd40afd
equal deleted inserted replaced
11:a42ed326b458 13:b6f55cd40afd
       
     1 /*
       
     2 * Copyright (c) 2010 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:  Handles the commands "AT+CLAC=?" and "AT+CLAC"
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_LCLISTALLCMD_H
       
    19 #define C_LCLISTALLCMD_H
       
    20 
       
    21 #include "lccustomplugin.h"
       
    22 
       
    23 /**
       
    24  *  Class for handling commands "AT+CLAC=?" and "AT+CLAC"
       
    25  *
       
    26  *  @since S60 v5.0
       
    27  */
       
    28 NONSHARABLE_CLASS( CLcListAllCmd ) : public CLcCustomPluginBase
       
    29 {
       
    30 
       
    31 public:
       
    32 
       
    33     /**
       
    34      * Two-phased constructor.
       
    35      * @param aCallback Callback
       
    36      * @return Instance of self
       
    37      */
       
    38     static CLcListAllCmd* NewL( MLcCustomPlugin* aCallback );
       
    39 
       
    40     /**
       
    41     * Destructor.
       
    42     */
       
    43     virtual ~CLcListAllCmd();
       
    44 
       
    45 private:
       
    46 
       
    47     CLcListAllCmd( MLcCustomPlugin* aCallback );
       
    48 
       
    49     void ConstructL();
       
    50 
       
    51     /**
       
    52      * Checks command types
       
    53      *
       
    54      * @since TB9.2
       
    55      * @param aCmd Command to check
       
    56      * @return ETrue if command understood, EFalse otherwise
       
    57      */
       
    58     TBool CheckCommand( const TDesC8& aCmd );
       
    59 
       
    60     /**
       
    61      * Main command handler (leaving version)
       
    62      *
       
    63      * @since TB9.2
       
    64      * @return ETrue if command understood, EFalse otherwise
       
    65      */
       
    66     TBool HandleCommandL();
       
    67 
       
    68 // from base class MLcCustomPluginBase
       
    69 
       
    70     /**
       
    71      * Reports the support status of an AT command. This is a synchronous API.
       
    72      *
       
    73      * @param aCmd The AT command. Its format may vary depending on the
       
    74      *             specification. E.g. in BT HFP case, the command may contain
       
    75      *             a character carriage return (<cr>) in the end.
       
    76      * @return ETrue if the command is supported; EFalse otherwise.
       
    77      */
       
    78     TBool IsCommandSupported( const TDesC8& aCmd );
       
    79 
       
    80     /**
       
    81      * Handles an AT command. Cancelling of the pending request is done by
       
    82      * HandleCommandCancel(). The implementation in the extension plugin should
       
    83      * be asynchronous.
       
    84      *
       
    85      * The extension plugin which accepts this command is responsible to supply
       
    86      * the result codes and response and to format result codes properly, e.g.
       
    87      * in BT HFP case, the format should be <cr><lf><result code><cr><lf>
       
    88      *
       
    89      * After an extension plugin has handled or decided to reject the given AT
       
    90      * command, it must inform ATEXT by HandleCommandCompleted() with a proper
       
    91      * error code.
       
    92      *
       
    93      * @since S60 5.0
       
    94      * @param aCmd The AT command to be handled. Its format may vary depending
       
    95      *             on the specification. E.g. in BT HFP case, the command may
       
    96      *             contain a character carriage return (<cr>) in the end.
       
    97      * @param aReply When passed in, contains the built in answer filled by
       
    98      *               ATEXT if it is not empty; when command handling completes
       
    99      *               successfully, contains the result codes and responses to
       
   100      *               this command; Its ownership always belongs to ATEXT, plugin
       
   101      *               may reallocate its space when needed.
       
   102      * @param aReplyNeeded Reply needed if ETrue, no reply otherwise. If EFalse,
       
   103      *                     the aReply must not contain the reply, otherwise it
       
   104      *                     must contain verbose or numeric reply (ATV0/1) or an
       
   105      *                     empty string reply (with ATQ).
       
   106      * @return None
       
   107      */
       
   108     void HandleCommand( const TDesC8& aCmd, RBuf8& aReply, TBool aReplyNeeded );
       
   109 
       
   110     /**
       
   111      * Cancels a pending HandleCommand request.
       
   112      *
       
   113      * @since S60 5.0
       
   114      * @return None
       
   115      */
       
   116     void HandleCommandCancel();
       
   117 
       
   118     /**
       
   119      * Creates a linearized list of supported commands
       
   120      *
       
   121      * @since S60 5.0
       
   122      * @param aReply List of supported commands
       
   123      * @return ETrue if "ERROR" condition detected, EFalse otherwise
       
   124      */
       
   125     TBool CreateSupportedList( RBuf8& aReply );
       
   126 
       
   127 private:  // data
       
   128 
       
   129     /**
       
   130      * Callback to call when accessing plugin information
       
   131      */
       
   132     MLcCustomPlugin* iCallback;
       
   133 
       
   134     /**
       
   135      * Handler type for the two AT commands
       
   136      */
       
   137     TCmdHandlerType iCmdHandlerType;
       
   138 
       
   139     /**
       
   140      * Detected command
       
   141      */
       
   142     TDetectedCmd iDetectedCmd;
       
   143 
       
   144 };
       
   145 
       
   146 #endif  // C_LCLISTALLCMD_H