cbsref/telephonyrefplugins/atltsy/atcommand/generic/inc/atcommandcontrolbase.h
branchRCL_3
changeset 20 07a122eea281
parent 19 630d2f34d719
child 21 4814c5a49428
equal deleted inserted replaced
19:630d2f34d719 20:07a122eea281
     1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This contains CATCommandControlBase which is composite class of a number classes
       
    15 // 
       
    16 
       
    17 #ifndef ATCOMMANDCONTROLBASE_H_
       
    18 #define ATCOMMANDCONTROLBASE_H_
       
    19 
       
    20 //system include
       
    21 #include <e32base.h>
       
    22 
       
    23 //user include 
       
    24 #include "atcommandtype.h"
       
    25 #include "atcommandexecuteobserver.h"
       
    26 #include "requestbase.h"
       
    27 #include <ctsy/ltsy/cctsydispatchercallback.h>
       
    28 
       
    29 
       
    30 //forward class
       
    31 class CAtCommandBase;
       
    32 class CRequestBase;
       
    33 
       
    34 /**
       
    35  * This class is a composite class which is composed of a number of AT commands
       
    36  * 
       
    37  */
       
    38 class CATCommandControlBase : public CRequestBase, public MAtCommandExecuteObserver
       
    39 	{
       
    40 public:
       
    41     /**
       
    42      * Destructor
       
    43      */
       
    44 	virtual ~CATCommandControlBase();
       
    45 public:
       
    46     /**
       
    47      * Add an AT command
       
    48      * 
       
    49      * @param aAtCommand The AT command which is to be added in
       
    50      */
       
    51 	TInt AddAtCommand(const CAtCommandBase* aAtCommand);
       
    52 	
       
    53 	/**
       
    54 	 * Remove the AT command
       
    55 	 */
       
    56 	void RemoveAtCommand(const CAtCommandBase* aAtCommand);
       
    57 	
       
    58 	/**
       
    59 	 * Remove the AT command by its AT type
       
    60 	 */
       
    61 	void RemoveAtCommandByAtType(TLtsyATCommandType aType);
       
    62 	
       
    63 	/**
       
    64 	 * Get the AT command by its AT type
       
    65 	 * 
       
    66 	 * @param aType @see TLtsyATCommandType
       
    67 	 */
       
    68 	CAtCommandBase& GetAtCommandByAtTypeL(TLtsyATCommandType aType);
       
    69 	
       
    70 	/**
       
    71 	 * Remove all the AT commands
       
    72 	 */
       
    73 	void CleanAllAtCommands();
       
    74 	
       
    75 	/**
       
    76 	 * Remove all the AT commands and destroy them also
       
    77 	 */
       
    78 	void CleanAndDeleteAllAtCommands();	
       
    79 public:
       
    80     /**
       
    81      * Define the type to delete the AT command
       
    82      */
       
    83 	enum TAutoDeleteAtCommand
       
    84 		{
       
    85 		/**
       
    86 		 * Delete all at command instance contained in the RPointArray when destructor
       
    87 		 */
       
    88 		EAutoDelete,
       
    89 		/**
       
    90 		 * Only close RPointArray, not delete at command instance contained in the RPonintArray
       
    91 		 */
       
    92 		ENoDelete
       
    93 		};
       
    94 	/**
       
    95 	 * Set the type of auto delete type
       
    96 	 */
       
    97 	void SetIsAutoDelete(TAutoDeleteAtCommand aIsDel);
       
    98 	
       
    99 	/**
       
   100 	 * Get the auto delete type
       
   101 	 */
       
   102 	TAutoDeleteAtCommand GetIsAutoDelete();
       
   103 protected:
       
   104     /**
       
   105      * Constructor
       
   106      */
       
   107 	CATCommandControlBase(CGlobalPhonemanager& aGloblePhone, 
       
   108 		                  CCtsyDispatcherCallback& aCtsyDispatcherCallback);
       
   109 	
       
   110 protected:
       
   111     /**
       
   112      * The dispatcher call back
       
   113      */
       
   114 	CCtsyDispatcherCallback& iCtsyDispatcherCallback;
       
   115 private:
       
   116     /**
       
   117      * Auto delete type
       
   118      */
       
   119     TAutoDeleteAtCommand iIsDel;
       
   120     
       
   121     /**
       
   122      * AT commands store
       
   123      */
       
   124     RPointerArray<CAtCommandBase> iArray;	
       
   125 	};
       
   126 
       
   127 #endif /*ATCOMMANDCONTROLBASE_H_*/