bluetoothengine/headsetsimulator/profiles/hfpprofile/inc/features/hfpremoteaudiovolumecontrol.h
branchheadsetsimulator
changeset 60 90dbfc0435e3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/headsetsimulator/profiles/hfpprofile/inc/features/hfpremoteaudiovolumecontrol.h	Wed Sep 15 15:59:44 2010 +0200
@@ -0,0 +1,117 @@
+/* 
+ *
+ * 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 HSHFPREMOTEAUDIOVOLUMECONTROL_H
+#define HSHFPREMOTEAUDIOVOLUMECONTROL_H
+
+#include <e32base.h>
+
+#include "hfpfeaturecommons.h"
+
+class CHsHFPCommand;
+class CHsHFPSettings;
+
+/**
+ * @brief Represents "Remote audio volume control" feature
+ */
+class CHsHFPRemoteAudioVolumeControl : public CBase,
+        public MHsHFPProcedureCommons
+    {
+public:
+
+    /**
+     * Two-phased constructor.
+     * 
+     * @param aObserver feature observer
+     * 
+     * @return instance of class
+     */
+    static CHsHFPRemoteAudioVolumeControl* NewL(
+            MHsHFPFeatureProviderObserver* aObserver);
+
+    /**
+     * Two-phased constructor.
+     * 
+     * @param aObserver feature observer
+     * 
+     * @return instance of class
+     */
+    static CHsHFPRemoteAudioVolumeControl* NewLC(
+            MHsHFPFeatureProviderObserver* aObserver);
+
+    /**
+     * Destructor.
+     */
+    ~CHsHFPRemoteAudioVolumeControl();
+
+public:
+
+    /**
+     * Synchronizes volume levels in AG and HF
+     * 
+     * @param aInputCmd input AT command
+     * @param aOutputCmd response
+     * 
+     * @return KErrNone if successful, otherwise one of the system-wide error
+     * codes
+     */
+    TInt VolumeLevelSynchronization(const CHsHFPCommand &aInputCmd,
+            CHsHFPCommand &aOutputCmd);
+
+    /**
+     * Resets local setting after client disconnection
+     */
+    void Reset();
+
+public:
+    //Method inherited from MHsHFPProcedureCommons
+    TInt ProcessCommand(const CHsHFPCommand &aInputCmd,
+            CHsHFPCommand &aOutputCmd);
+
+private:
+
+    /**
+     * Constructor for performing 1st stage construction
+     * 
+     * @param aObserver feature observer
+     */
+    CHsHFPRemoteAudioVolumeControl(MHsHFPFeatureProviderObserver* aObserver);
+
+    /**
+     * Constructor for performing 2nd stage construction
+     */
+    void ConstructL();
+
+private:
+    /** Pointer to observer */
+    MHsHFPFeatureProviderObserver* iObserver;
+
+    /** Denotes if volume level synchronization is finished */
+    TBool iVolumeLevelSynchronized;
+
+    /** Denotes if OK command is expected */
+    TBool iWaitingForOK;
+
+    /** Denotes if VGM command is expected */
+    TBool iWaitingForVgmOK;
+
+    /** Profile setting */
+    CHsHFPSettings* iSettings;
+    };
+
+#endif // HSHFPREMOTEAUDIOVOLUMECONTROL_H