- /************************************************************************
- * chxavnavipanecontrol.h
- * ----------------------
- *
- * Synopsis:
- * Contains the declaration of the navi pane control. This control
- * diplays all the bells and whistles of the play view.
- *
- * Target:
- * Symbian OS
- *
- *
- * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
- *
- ************************************************************************/
- #ifndef _chxavnavipanecontrol_h_
- #define _chxavnavipanecontrol_h_
- #include "chxavrefptr.h"
- #include "chxavtextcontrol.h"
- #include "chxavplayer.h"
- #include "chxavcallback.h"
- #include "comptr.h"
- // class CHXAvNaviPaneControl...
- class CHXAvNaviPaneControl
- : public CCoeControl
- , public IHXSymPlayerStateObserver
- {
- public:
- CHXAvNaviPaneControl();
- virtual ~CHXAvNaviPaneControl();
- public:
- static CHXAvNaviPaneControl* NewL(CHXAvPlayer* pPlayer, const CCoeControl& parent);
- void ConstructL(CHXAvPlayer* pPlayer, const CCoeControl& parent);
- void SetRefreshCommandL(const CHXAvCommand& cmd);
- // IHXSymPlayerStateObserver
- void OnPlayInitiate(const char* url);
- void OnNetConnect();
- void OnLoadSession(IHXRequest* request);
- void OnResume();
- void OnStop();
- void OnPause();
- void OnBeginBuffering(bool bIsBegin);
- void OnBuffering(UINT16 percent);
- void OnBeginSeek();
- void OnMute(bool bMute);
- void OnNewPos (ULONG32 msNewTime);
- void OnAdvancePlaylist();
- void UpdateEverythingL();
- private:
- virtual void Draw(const TRect& rect) const;
- virtual TInt CountComponentControls() const;
- virtual CCoeControl* ComponentControl(TInt aIndex) const;
- virtual void SizeChanged();
- void GetTimerTextL(TUint msNow, TDes& timerTextOut) const;
- void ToggleStatusBlinkAndDraw();
- void ShowPauseIndication(bool bShow);
- void UpdateTimerTextL();
- void UpdateTimerTextVisibility();
- void UpdateStatusAreaL();
- void DoStaticLayout();
- void GetTimerTextMaxArea(TRect& rc);
- void SizeAndSetTimerAreaText(refptr<CHXAvTextControl>& pControl, const TDesC& text);
- void UpdateLiveStateIndicator();
- void DoTimerTextUpdateAndDraw();
- void DoUpdateEverythingAndDraw();
- void UpdateVisibilityHelper(CCoeControl* pControl, bool bShow);
- void UpdateTextHelper(CHXAvTextControl* pControl, const TDesC& text);
- void UpdateRectHelper(CCoeControl* pControl, const TRect& rc);
- void OnAnimateEllipseTick();
- void ToggleEllipseAnimation(bool bOn);
- private:
- // controls
- refptr<CHXAvTextControl> m_spTimerText;
- refptr<CHXAvTextControl> m_spStatusText;
- refptr<CHXAvTextControl> m_spEllipseText;
- refptr<CEikImage> m_spPlayStateImage;
- refptr<CEikImage> m_spVolStateImage;
- refptr<CEikImage> m_spLiveStateOnImage;
- refptr<CEikImage> m_spLiveStateOffImage;
- CHXAvCommandPtr m_spRefreshCmd;
- bool m_bBlinkIsVisible;
- CHXAvCallback m_cbBlink;
- CHXAvCallback m_cbAnimateEllipse;
- bool m_bNeedRefresh;
- comptr<CHXAvPlayer> m_spPlayer;
- TRect m_rcMaxTextArea;
- bool m_bHideTimerForStatusText;
- TRect m_rcParent;
- TUint m_ellipseCount;
- };
- inline
- void CHXAvNaviPaneControl::SetRefreshCommandL(const CHXAvCommand& cmd)
- {
- m_spRefreshCmd = cmd.CloneL();
- }
- #endif // _chxavnavipanecontrol_h_