bluetoothengine/btaudioman/expinc/BTAccPlugin.h
changeset 0 f63038272f30
equal deleted inserted replaced
-1:000000000000 0:f63038272f30
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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: 
       
    15 *                 This is the interface declaration and implementation which is 
       
    16 *                used by plugins. Contains also virtual methods which are implemented
       
    17 *                by plugins, and hence used by server to call plugins. 
       
    18 *  Version     : %version:  1.1.3.2.4 %
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 #ifndef BTACC_PLUGIN_H
       
    24 #define BTACC_PLUGIN_H
       
    25 
       
    26 // FORWARD DECLARATION
       
    27 
       
    28 #include <btaccObserver.h>
       
    29 #include <e32base.h>
       
    30 #include <btaccParams.h>
       
    31 
       
    32 
       
    33 class CBTAccPlugin : public CBase
       
    34     {
       
    35 public: // used by 'Plugin Mananger' to create and destroy plugin instances
       
    36 
       
    37     /** 
       
    38     Constructor.
       
    39     @param aParams Parameters from BT Acc Server, used to initialise the 
       
    40     implementation.
       
    41     @return Ownership of a new plugin.
       
    42     */
       
    43     static CBTAccPlugin* NewL(TPluginParams& aParams);
       
    44 
       
    45     /** Destructor. */
       
    46      virtual ~CBTAccPlugin();
       
    47 
       
    48 public:
       
    49     /** 
       
    50     * Called by BT Acc Sever to connect to mono or stereo accessory
       
    51     @param aAddr Bluetooth Device address of the remote device
       
    52     @return result of operation
       
    53     */
       
    54     virtual void ConnectToAccessory(const TBTDevAddr& aAddr, TRequestStatus& aStatus);
       
    55 
       
    56     /** 
       
    57     * Called by BT Acc Sever to cancel connect to mono or stereo accessory
       
    58     @param aAddr Bluetooth Device address of the remote device
       
    59     @return result of operation
       
    60     */
       
    61     virtual void CancelConnectToAccessory(const TBTDevAddr& aAddr);
       
    62 
       
    63     /** 
       
    64     * Called by BT Acc Sever to disconnect from mono, stereo 
       
    65     * or remote control profile accessory
       
    66     @param aAddr Bluetooth Device address of the remote device
       
    67     @return result of operation
       
    68     */
       
    69     virtual void DisconnectAccessory(const TBTDevAddr& aAddr,TRequestStatus& aStatus) = 0;
       
    70 
       
    71     /** 
       
    72     * Called by BT Acc Sever to open audio link
       
    73     @param aAddr Bluetooth Device address of the remote device
       
    74     @return result of operation
       
    75     */
       
    76     virtual void OpenAudioLink(const TBTDevAddr& aAddr, TRequestStatus& aStatus);
       
    77     
       
    78     /** 
       
    79     * Called by BT Acc Sever to cancel opening of audio link
       
    80     @param aAddr Bluetooth Device address of the remote device
       
    81     @return result of operation
       
    82     */
       
    83     virtual void CancelOpenAudioLink(const TBTDevAddr& aAddr );
       
    84 
       
    85     /** 
       
    86     * Called by BT Acc Sever to close audio link
       
    87     @param aAddr Bluetooth Device address of the remote device
       
    88     @return result of operation
       
    89     */
       
    90     virtual void CloseAudioLink(const TBTDevAddr& aAddr, TRequestStatus& aStatus);
       
    91 
       
    92     /** 
       
    93     * Called by BT Acc Sever to cancel closing of audio link
       
    94     @param aAddr Bluetooth Device address of the remote device
       
    95     @return result of operation
       
    96     */
       
    97     virtual void CancelCloseAudioLink(const TBTDevAddr& aAddr );
       
    98     
       
    99     /** 
       
   100     * Called by BT Acc Sever to inform plugin that accessory is in use (attached to acc fw). 
       
   101     @param  None.
       
   102     @return None.
       
   103     */
       
   104     virtual void AccInUse() = 0;
       
   105     
       
   106     /** 
       
   107     * Called by BT Acc Sever to inform plugin that accessory is out of use (detached from acc fw). 
       
   108     @param  None.
       
   109     @return None.
       
   110     */
       
   111     virtual void AccOutOfUse();
       
   112     
       
   113     
       
   114     /** 
       
   115     * BTAccServer informs 'BTSAC plugin' that it can start streaming
       
   116     @param  None.
       
   117     @return None.
       
   118     */
       
   119     virtual void StartRecording();
       
   120 
       
   121     /** 
       
   122     * Check whether plugin supports mono audio
       
   123     @param     None.
       
   124     @return ETrue if plugin supports mono audio, TFalse otherwise.
       
   125     */
       
   126     virtual TProfiles PluginType() = 0;
       
   127     
       
   128     virtual void ActivateRemoteVolumeControl();
       
   129 
       
   130     virtual void DeActivateRemoteVolumeControl();
       
   131 
       
   132     virtual TInt GetRemoteSupportedFeature();
       
   133 
       
   134     virtual TInt AudioLinkLatency();
       
   135     /**
       
   136     * Called by BT Acc Server to query the plugin's implementation UID.
       
   137     @return The plugin's implementation UID.
       
   138     */
       
   139     TUid Uid() const;
       
   140 
       
   141 
       
   142 protected: // called by concrete bearer plugins
       
   143     /** 
       
   144     * Constructor
       
   145     @param aParams Parameters from plugin manager, used to initialise the 
       
   146     implementation.
       
   147     */
       
   148     CBTAccPlugin(TPluginParams& aParams);
       
   149 
       
   150     /**
       
   151     Accessor for the observer.
       
   152     @return The observer.
       
   153     */
       
   154     MBTAccObserver& Observer();
       
   155 
       
   156 private: // unowned
       
   157     MBTAccObserver& iObserver;
       
   158 
       
   159 private: // owned
       
   160     /**
       
   161     UID set by ECOM when the instance is created. Used when the instance is 
       
   162     destroyed.
       
   163     */
       
   164     TUid iInstanceId;
       
   165 
       
   166     /**
       
   167     Implementation UID of concrete instance.
       
   168     */
       
   169     const TUid iImplementationUid;
       
   170     };
       
   171     
       
   172 #include "btaccPlugin.inl"
       
   173 
       
   174 
       
   175 #endif // BTACC_PLUGIN_H