CHeadsetStatus Class Reference

class CHeadsetStatus : public CBase

API for checking the headset status. This implementation is a wrapper that encapsulates internal interface for extended SDK

Usage: Include HeadsetStatus.h and link against HeadsetStatus.lib

Note: If you intend to call HeadsetConnectedL more than once it is more efficient to declare the instance from CHeadsetStatus as a member variable and create it in ConstructL and delete it in destructor.

Observing is only enbaled in Series 60 3.1 with __ACCESSORY_FW flag enabled!

        TBool connected( EFalse );
  CHeadsetStatus* wrapper = CHeadsetStatus::NewL();
  CleanupStack::PushL( wrapper );
  TInt err( wrapper->HeadsetConnectedL( connected ) );
  CleanupStack::PopAndDestroy( wrapper );
       

Inherits from

Constructor & Destructor Documentation

CHeadsetStatus()

CHeadsetStatus ( ) [private]

Default Constructor

~CHeadsetStatus()

IMPORT_C ~CHeadsetStatus ( )

Destructor

Member Functions Documentation

ConstructL()

void ConstructL ( ) [private]

Symbian OS 2nd phase constructor

HeadsetConnectedL(TBool &)

IMPORT_C TInt HeadsetConnectedL ( TBool & aState )

Used to query the headset connectivity status.

Parameters

TBool & aState

IsObserving()

IMPORT_C TBool IsObserving ( ) const

Checks whether already observing.

NewL()

IMPORT_C CHeadsetStatus * NewL ( ) [static]

Symbian two phased constructor.

SetObserver(MHeadsetStatusObserver *)

IMPORT_C void SetObserver ( MHeadsetStatusObserver * aObserver )

Sets observer through headset status notifications are received. NULL pointer will lead to panic.

Parameters

MHeadsetStatusObserver * aObserver

StartObserving()

IMPORT_C void StartObserving ( )

Starts observing headset status changes.

StopObserving()

IMPORT_C void StopObserving ( )

Stops observing headset status changes. This is not nessecary to be called in destructor. Listening will be automatically stopped when CHeadsetStatus object is deleted.

Member Data Documentation

CHeadsetStatusContainer * iContainer

CHeadsetStatusContainer * iContainer [private]