/*
========================================================================
 Name        : AudioPlayerContainerView.h
 Copyright   : Symbian Academy, 2007
 Description : Handles the user interface and interaction for the main view.
 ============================================================================
 */
#ifndef AUDIOPLAYERCONTAINERVIEW_H
#define AUDIOPLAYERCONTAINERVIEW_H

// [[[ begin generated region: do not modify [Generated Includes]
#include <aknview.h>
// ]]] end generated region [Generated Includes]

// Edit 23b: Add the header file required for the RFileWriteStream class.
#include <s32file.h>

#include "AudioPlayerEngine.h"

_LIT(KDataFilename, "LastTrack.txt");

// [[[ begin [Event Handler Includes]
// ]]] end [Event Handler Includes]

// [[[ begin generated region: do not modify [Generated Forward Declarations]
class CAudioPlayerContainer;
// ]]] end generated region [Generated Forward Declarations]

// [[[ begin generated region: do not modify [Generated Constants]
// ]]] end generated region [Generated Constants]

/**
 * Avkon view class for AudioPlayerContainerView. It is register with the view server
 * by the AppUi. It owns the container control.
 * @class	CAudioPlayerContainerView AudioPlayerContainerView.h
 */
class CAudioPlayerContainerView : public CAknView
	{
public:
	// constructors and destructor
	CAudioPlayerContainerView();
	static CAudioPlayerContainerView* NewL();
	static CAudioPlayerContainerView* NewLC();        
	void ConstructL();
	virtual ~CAudioPlayerContainerView();

public:
	// from base class CAknView
	TUid Id() const;
	void HandleCommandL( TInt aCommand );

protected:
	// from base class CAknView
	void DoActivateL(
		const TVwsViewId& aPrevViewId,
		TUid aCustomMessageId,
		const TDesC8& aCustomMessage );
	void DoDeactivate();
	void HandleStatusPaneSizeChange();
	
private:
	void SetupStatusPaneL();
	void CleanupStatusPane();

	void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
	// Edit 15a: Uncomment the following line to define the SaveDataFileL()
	//           method. It is a generic function and has got two parameters,
	//           the first one specifying the filename (without the path,
	//           the file will be stored in the private directory!)
	//           and the second one the data to be saved.
	//void SaveDataFileL(const TDesC& aFilename, const TDesC& aData);
	
	// Edit 29a: Uncomment the following line to define the ReadFileLC()
	//           method. It is a generic function and will read the contents
	//           of the specified file in the private directory.
	//           The data is saved in a newly allocated heap based buffer,
	//           which is returned by this method and left on the cleanup stack.
	//HBufC* ReadFileLC(const TDesC& aFilename);
	
	// [[[ begin generated region: do not modify [Generated Methods]
public: 
	// ]]] end generated region [Generated Methods]
	
	
	// [[[ begin [Overridden Methods]
protected: 
	// ]]] end [Overridden Methods]
	
	
	// [[[ begin [User Handlers]
protected: 
	TBool HandleExitMenuItemSelectedL( TInt aCommand );
	TBool HandlePlay_fileMenuItemSelectedL( TInt aCommand );
	TBool HandlePlay_last_fileMenuItemSelectedL( TInt aCommand );
	TBool HandleStopMenuItemSelectedL( TInt aCommand );
	// ]]] end [User Handlers]
	
	// [[[ begin generated region: do not modify [Generated Instance Variables]
private: 
	CAudioPlayerContainer* iAudioPlayerContainer;
	// ]]] end generated region [Generated Instance Variables]
	
	/**
	 * Audio Engine which handles interaction with Symbain OS Audio stuff.
	 * Owned by the AppUi.
	 */
	CAudioPlayerEngine* iAudioEngine;
	};

#endif // AUDIOPLAYERCONTAINERVIEW_H			
