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