bluetoothengine/btaudioman/inc/basrvaccstateattached.h
changeset 0 f63038272f30
child 22 613943a21004
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:  The Connected state declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_BTASRVACCSTATECONNECTED_H
       
    20 #define C_BTASRVACCSTATECONNECTED_H
       
    21 
       
    22 #include "basrvaccstate.h"
       
    23 #include "btengprivatepskeys.h"
       
    24 
       
    25 class CBasrvAccStateAttached : public CBasrvAccState
       
    26     {
       
    27 public:
       
    28 
       
    29     static CBasrvAccStateAttached* NewL(CBasrvAcc& aParent, TBool aShowNote = EFalse);
       
    30 
       
    31     virtual ~CBasrvAccStateAttached();
       
    32     
       
    33     /**
       
    34      * Entry of this state.
       
    35      *
       
    36      * @since S60 v3.1
       
    37      */
       
    38     void EnterL();
       
    39     
       
    40     /**
       
    41      * Returns the next state if EnterL leaves.
       
    42      *
       
    43      * @since S60 v3.1
       
    44      * @return the next state
       
    45      */
       
    46     CBasrvAccState* ErrorOnEntry(TInt aReason);
       
    47 
       
    48     TBTEngConnectionStatus ConnectionStatus() const;
       
    49 
       
    50     void ConnectL(const TBTDevAddr& aAddr);
       
    51         
       
    52     /**
       
    53     * Disconnect accessory.
       
    54     */
       
    55     void DisconnectL();
       
    56 
       
    57     /**
       
    58     * 
       
    59     * @return an error. Default implementation returns KErrNotFound
       
    60     */
       
    61     void AccessoryConnected(TProfiles aProfile);
       
    62     
       
    63     /**
       
    64     * 
       
    65     * @return an error. Default implementation returns KErrNotFound
       
    66     */
       
    67     void AccOpenedAudio(TProfiles aProfile);
       
    68     
       
    69     /**
       
    70     * 
       
    71     * @return an error. Default implementation returns KErrNotFound
       
    72     */
       
    73     void AccClosedAudio(TProfiles aProfile);
       
    74     
       
    75     /**
       
    76     * Called when the connection is disconnected from remote side.
       
    77     * @param aErr the error code of event
       
    78     */
       
    79     void AccessoryDisconnectedL(TProfiles aProfile);
       
    80     
       
    81     /**
       
    82     * Called when an audio open request comes from Acc FW.
       
    83     */
       
    84     void OpenAudioL(TAccAudioType aType);
       
    85 
       
    86     /**
       
    87     * Called when an audio close request comes from Acc FW.
       
    88     */
       
    89     void CloseAudioL(TAccAudioType aType);
       
    90     
       
    91 protected:
       
    92     // From MBasrvActiveObserver
       
    93     
       
    94     /**
       
    95      * Handles the request completion event.
       
    96      *
       
    97      * @since S60 v3.1
       
    98      * @param aActive the Active Object to which the request is assigned to.
       
    99      */
       
   100     virtual void RequestCompletedL(CBasrvActive& aActive);
       
   101     
       
   102     /**
       
   103      * Handles the cancellation of an outstanding request.
       
   104      *
       
   105      * @since S60 v3.1
       
   106      * @param aActive the Active Object to which the request is assigned to.
       
   107      */
       
   108     virtual void CancelRequest(CBasrvActive& aActive);
       
   109 
       
   110 protected:
       
   111 
       
   112     /**
       
   113     * Default constructor
       
   114     */
       
   115     CBasrvAccStateAttached(CBasrvAcc& aParent, TBool aShowNote);
       
   116     
       
   117     void HandleAccOpenedAudio(TProfiles aProfile);
       
   118  
       
   119     void DoCloseAudioL(TAccAudioType aType);
       
   120     
       
   121     void DoConnectRemConCtIfNeededL();
       
   122     
       
   123 private:
       
   124 
       
   125 	void UpdateAudioState(TBTAudioLinkState aState, TAccAudioType aType);
       
   126 
       
   127     RPointerArray<CBasrvActive> iActives;
       
   128     CBasrvActive* iAudioOpener;
       
   129     CBasrvActive* iAudioCloser;
       
   130     
       
   131     RTimer iTimer;
       
   132     CBasrvActive* iTimerActive;
       
   133     TProfiles iCloseAudioProfile;
       
   134     
       
   135     TBool iShowNote;
       
   136     
       
   137     CBasrvActive* iRemConTGConnector;
       
   138     };
       
   139 
       
   140 #endif      // C_BTASRVACCSTATECONNECTED_H
       
   141 
       
   142 // End of File