bluetoothengine/headsetsimulator/profiles/hspprofile/inc/features/hspcalltermination.h
branchheadsetsimulator
changeset 60 90dbfc0435e3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/headsetsimulator/profiles/hspprofile/inc/features/hspcalltermination.h	Wed Sep 15 15:59:44 2010 +0200
@@ -0,0 +1,108 @@
+/* 
+ *
+ * Copyright (c) <2010> Comarch S.A. and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Original Contributors:
+ * Comarch S.A. - original contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef HSPCALLTERMINATEPROC_H_
+#define HSPCALLTERMINATEPROC_H_
+
+#include <e32base.h>
+
+#include "hspfeaturecommons.h"
+
+class CHsHSPCommand;
+class CHsHSPSettings;
+
+/**
+ * @brief Represents "Terminate a call" feature
+ */
+class CHsHSPCallTerminationProc : public CBase, public MHsHSPProcedureCommons
+{
+public:
+    /**
+     * Two-phased constructor.
+     * 
+     * @param aObserver feature observer
+     * 
+     * @return instance of class
+     */
+    static CHsHSPCallTerminationProc* NewL(
+            MHsHSPFeatureProviderObserver* aObserver );
+
+    /**
+     * Two-phased constructor.
+     * 
+     * @param aObserver feature observer
+     * 
+     * @return instance of class
+     */
+    static CHsHSPCallTerminationProc* NewLC(
+            MHsHSPFeatureProviderObserver* aObserver );
+
+    /**
+     * Destructor
+     */
+    ~CHsHSPCallTerminationProc();
+
+public:
+    //Methods inherited from MHsHSPProcedureCommons
+    TInt ProcessCommand( const CHsHSPCommand* aInputCmd,
+            CHsHSPCommand &aOutputCmd );
+
+private:
+    /**
+     * Constructor for performing 1st stage construction
+     * 
+     * @param aObserver feature observer
+     */
+    CHsHSPCallTerminationProc( MHsHSPFeatureProviderObserver* aObserver );
+
+    /**
+     * Constructor for performing 2nd stage construction
+     */
+    void ConstructL();
+
+private:
+
+    /**
+     * Checks if received command is proper +CKPD
+     * 
+     * @param aCommand AT command
+     * @return ETrue if command is AT+CKPD=200<cr><lf>, otherwise EFalse
+     */
+    TBool IsCKPD200( const CHsHSPCommand* aCommand );
+
+    /**
+     * Informs observer about procedure's completion
+     * 
+     * @param aErr error value
+     */
+    void InformObserver( TInt aErr );
+
+private:
+
+    /** Procedure's type */
+    const THSPProcedure iHSPProc = EHSPCallTerminate;
+
+    /** Pointer to observer, not owned */
+    MHsHSPFeatureProviderObserver* iObserver;
+
+    /** Denotes if the next expected command is  <cr><lf> OK <cr><lf> */
+    TBool iWaitingForOK;
+
+};
+
+#endif /* HSPCALLTERMINATEPROC_H_ */