⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s60internetradioview.h

📁 symbian平台
💻 H
字号:
/*
* ==============================================================================
*  Name        : S60InternetRadioView.h
*  Part of     : S60 Internet Radio Application
*  Interface   :
*  Description : Defines the S60 Internet Radio application view class
*  Version     : 1
*
*  Copyright (c) 2006, Nokia Corporation All rights reserved. Redistribution
*  and use in source and binary forms, with or without modification, are
*  permitted provided that the following conditions are met: Redistributions
*  of source code must retain the above copyright notice, this list of
*  conditions and the following disclaimer. Redistributions in binary form
*  must reproduce the above copyright notice, this list of conditions and the
*  following disclaimer in the documentation and/or other materials provided
*  with the distribution. Neither the name of the Nokia Corporation nor the
*  names of its contributors may be used to endorse or promote products
*  derived from this software without specific prior written permission. THIS
*  SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
*  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
*  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
*  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
*  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
*  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
*  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
*  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
*  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
*  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
*  POSSIBILITY OF SUCH DAMAGE.
* ==============================================================================
*/
#ifndef __S60INTERNETRADIOVIEW_H__
#define __S60INTERNETRADIOVIEW_H__

// INCLUDE FILES
#include <coecntrl.h>
#include <coeccntx.h>
#include <Aknvolumecontrol.h>

// FORWARD DECLARATIONS
class CEikLabel;
class CS60InternetRadioAppUi;
class CAknNavigationControlContainer;
class CAknNavigationDecorator;

// CLASS DECLARATION

/**
*  Application view class.
*  This class represents the application view presenting the application's
*  data. The application only has one view.
*/

class CS60InternetRadioView : public CCoeControl
    {
	public: // contructors

        /**
        * Factory method to create a CS60InternetRadioView object
  		* @param aMessage the text to use for the label
	  	* @return a pointer to the created instance of CS60InternetRadioView
		*/
		static CS60InternetRadioView* NewL(const TRect& aRect, const TDesC& aMessage, const TBool supportMetadata);

        /**
        * Factory method to create a CS60InternetRadioView object on the cleanup stack
  		* @param aMessage the text to use for the label
	  	* @return a pointer to the created instance of CS60InternetRadioView
		*/
		static CS60InternetRadioView* NewLC(const TRect& aRect, const TDesC& aMessage, const TBool supportMetadata);

        /**
        * Destructor
        */
		~CS60InternetRadioView();

	public: // new functions

        /**
        * Display a string identifying the current audio adapter
  		* @param aMessage the string to be displayed
  		* @param aMetadataSupported Indicates whether metadata is supported
		*/
		void NotifyStatus(const TDesC& aMessage, const TInt aMetadataSupported);

       /**
        * Update the specified metadata label
  		* @param aIndex the index of the metadata that changed.
  		* @param aValue the metadata contents (value)
  		* @param aCommit indicates whether the metadata changes should be updated in the view.
  		*/
		void UpdateMetadataLabel(TInt aMetadataIndex, const TDesC& aMessage, TBool aCommit);

       	/**
        * Sets the application UI instance
  		* @param aAppUi the application UI instance
  		*/
		inline void SetAppUi(CS60InternetRadioAppUi *aAppUi){iAppUi=aAppUi;};

	public:  // from CCoeControl

       	/**
        * Draw the CS60InternetRadioView to the screen
  		* @param aRect the rectangle of this view that needs updating
  		*/
		void Draw(const TRect& aRect) const;

	protected: // From CCoeControl

       	/**
        * Count the number of component controls that the application view owns
  		* @return the number of controls
  		*/
		TInt CountComponentControls() const;

       	/**
        * Return a pointer to the specified component control
  		* @param aIndex the index of the control
	  	* @return a pointer to the component control
  		*/
		CCoeControl* ComponentControl(TInt aIndex) const;


       	/**
        * Handle focus change
  		*/
		virtual void FocusChanged(TDrawNow aDrawNow);

       	/**
        * Handles key events
  		* @param aKeyEvent The key event
  		* @param aType The type of key event: EEventKey, EEventKeyUp or EEventKeyDown
  		*/
		virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);

       	/**
        * Respond to size changed
  		*/
  		void SizeChanged();

	private:

        /**
        * Perform the first phase of two phase construction
		*/
		CS60InternetRadioView();

        /**
        * Perform the second phase construction of a CS60InternetRadioView object
        * @param aRect the rectangle this view will be drawn to
        * @param aMessage the text to use for the label
		*/
		void ConstructL(const TRect& aRect, const TDesC& aMessage, const TBool supportMetadata);

        /**
        * Reset all labels
        * @param aMessage the text to use for the label
        * @param aSupportMetadata indicates whether metadata is supported
		*/
		void ResetLabelsL(const TDesC& aMessage, const TBool aSupportMetadata);

        /**
        * Move the specified label object
        * @param aLabel the label
		*/
		static TInt MoveLabel(TAny* aLabel);

	private:

		// pointer to the app UI
		CS60InternetRadioAppUi* iAppUi;

		// pointer of metadata labels
		RPointerArray<CEikLabel> iMetadataLabels;

		CPeriodic *iAlarm;
		TBuf<266> iLabelText; //256+2*4+1*2 (4 white spaces plus an additional character)
		TCallBack iCallback;

		// the brush style
		CWindowGc::TBrushStyle iBrushStyle;

		// the brush color
		TRgb iBrushColor;

		CAknNavigationControlContainer* iNaviPane;
		CAknNavigationDecorator* iVolumeNavi;
		TInt iVolume;
		TBool iMute;
    };

#endif // __S60INTERNETRADIOVIEW_H__

// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -