chxavplayviewwindow.h
Upload User: zhongxx05
Upload Date: 2007-06-06
Package Size: 33641k
Code Size: 3k
Category:

Symbian

Development Platform:

C/C++

  1. /************************************************************************
  2.  * chxavplayviewwindow.h
  3.  * ---------------------
  4.  *
  5.  * Synopsis:
  6.  * Contains the declaration of the CHXAvPlayViewWindow class.  This class
  7.  * handles the play/pause/stop buttons.
  8.  *
  9.  * Target:
  10.  * Symbian OS
  11.  *
  12.  *
  13.  * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
  14.  *
  15.  ************************************************************************/
  16. #ifndef _chxavplayviewwindow_h
  17. #define _chxavplayviewwindow_h
  18. // Symbian includes...
  19. #include <coecntrl.h>
  20. // Helix includes...
  21. // Includes from this project...
  22. #include "chxbody.h"
  23. #include "chxavplayer.h"
  24. #include "chxsmartptr.h"
  25. #include "ihxsymplayerstateobserver.h"
  26. // Forward declarations...
  27. class CHXAvViewBase;
  28. class CHXAvPlayerUI;
  29. class CHXAvPlayView;
  30. // CHXAvPresentationWindow declaration...
  31. class CHXAvPresentationWindow :
  32.     public CCoeControl,
  33.     public IHXSymPlayerStateObserver,
  34.     public CHXBody
  35. {
  36. public:
  37.     friend class CHXAvPlayViewWindow;
  38. public:
  39.     CHXAvPresentationWindow();
  40.     virtual ~CHXAvPresentationWindow();
  41.     void ConstructL(CCoeControl *parent, CHXAvPlayerUI *playerUI, const TRect& rc);
  42.     // CCoeControl overrides
  43.     CCoeControl* ComponentControl( TInt aIndex ) const { return NULL; }
  44.     TInt CountComponentControls() const { return 0; }
  45.     void Draw(const TRect& aRect) const;
  46.     TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
  47. private:
  48.      // IHXSymPlayerStateObserver
  49.     void OnPlayInitiate(const char* url);
  50.     void OnLoadSession(IHXRequest* request); 
  51.     void OnStop();
  52.     // Helpers
  53.     void LoadLogoItems();
  54.     void SetBackgroundItems(const TDesC& fileName, TInt idxLogo, TInt idxAudioIcon);
  55.     CCoeControl *m_parent;
  56.     CHXAvPlayerUI *m_playerUI;
  57.     CFbsBitmap m_logo;
  58.     CFbsBitmap m_audioIcon;
  59.     bool m_bLastClipPlayedHadVideo;
  60.     bool m_bShowLogo;
  61.     bool m_bShowAudioIcon;
  62. };
  63. typedef CHXSmartPtr<CHXAvPresentationWindow> CHXAvPresentationWindowPtr;
  64. // CHXAvFileViewWindow declaration...
  65. class CHXAvPlayViewWindow : 
  66.     public CCoeControl,
  67.     public IHXSymPlayerStateObserver,
  68.     public CHXBody
  69. {
  70. public:
  71.     CHXAvPlayViewWindow();
  72.     virtual ~CHXAvPlayViewWindow();
  73.     void ConstructL(CHXAvPlayerUI *playerUI, CHXAvPlayView *parentView, const TRect& rc);
  74.     // CCoeControl overrides...
  75.     CCoeControl* ComponentControl( TInt aIndex ) const;
  76.     TInt CountComponentControls() const;
  77.     //void FocusChanged(TDrawNow aDrawNow);
  78.     //void GetHelpContext(TCoeHelpContext& aContext) const {}
  79.     void Draw(const TRect& aRect) const;
  80.     TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
  81.     TKeyResponse HandleEventKeyEventL(const TKeyEvent& event);
  82.     TKeyResponse HandleKeyUpEventL(const TKeyEvent& event);
  83.     TKeyResponse HandleKeyDownEventL(const TKeyEvent& event);
  84.     void HandleSeekKeyEvent(const TKeyEvent& event);
  85.    
  86.     CHXAvPresentationWindow *GetPresentationWindow() { return m_spPresentationWindow.raw_ptr(); }
  87.     
  88. private:
  89.     CHXAvPlayView *m_playView;
  90.     CHXAvPlayerUI *m_playerUI;
  91.     comptr<CHXAvPlayer> m_spPlayer;
  92.     BOOL m_bInSeekMode;
  93.     // This is the main presentation (rendering) window...
  94.     CHXAvPresentationWindowPtr m_spPresentationWindow;
  95.     
  96. };
  97. typedef CHXSmartPtr<CHXAvPlayViewWindow> CHXAvPlayViewWindowPtr;
  98. #endif // _chxavplayviewwindow_h