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

📄 videonavidecoratortime.cpp

📁 NOKIA S60手机3gp视频播放器源代码.
💻 CPP
字号:
/*
* ==============================================================================
*  Name        : CVideoNaviDecoratorTime from VideoNaviDecoratorTime.h
*  Part of     : Video
*  Created     : 10/14/2003 by Forum Nokia
*  Interface   : 
*  Description : Declares Navi decorator for time
*  Version     : 
*  Copyright   : Nokia Corporation, 2003
* ==============================================================================
*/

#include <aknsutils.h>

#include "VideoNaviDecoratorTime.h"
#include <video.rsg>

/*
-----------------------------------------------------------------------------

	CVideoNaviDecoratorTime::CVideoNaviDecoratorTime()

	Description: C++ default constructor can NOT contain any code, that
				 might leave.
	Comments   :

    Return values: N/A

-----------------------------------------------------------------------------
*/
CVideoNaviDecoratorTime::CVideoNaviDecoratorTime()
    {
    }

/*
-----------------------------------------------------------------------------

	void CVideoNaviDecoratorTime::ConstructL()

	Description: Symbian 2nd phase constructor can leave.
	Comments   :

    Return values: N/A

-----------------------------------------------------------------------------
*/
void CVideoNaviDecoratorTime::ConstructL()
    {
    iLabel = HBufC16::NewL(0);
    }

/*
-----------------------------------------------------------------------------

	CVideoNaviDecoratorTime* CVideoNaviDecoratorTime::NewL()

	Description: Two-phased construtor
	Comments   :

    Return values: CVideoNaviDecoratorTime object pointer

-----------------------------------------------------------------------------
*/
CVideoNaviDecoratorTime* CVideoNaviDecoratorTime::NewL()
    {
    CVideoNaviDecoratorTime* self = new( ELeave ) CVideoNaviDecoratorTime();
    CleanupStack::PushL( self );
    self->ConstructL();
    CleanupStack::Pop();
    return self;
    }


/*
-----------------------------------------------------------------------------

	CVideoNaviDecoratorTime::~CVideoNaviDecoratorTime()

	Description: Destructor, frees allocated resources
	Comments   :

    Return values: N/A

-----------------------------------------------------------------------------
*/
CVideoNaviDecoratorTime::~CVideoNaviDecoratorTime()
    {
    delete iLabel;
    }

/*
-----------------------------------------------------------------------------

	void CVideoNaviDecoratorTime::SetLabelL(const TDesC& aLabel)

	Description: Set the label the navi pane
	Comments   :

    Return values: N/A

-----------------------------------------------------------------------------
*/
void CVideoNaviDecoratorTime::SetLabelL(const TDesC& aLabel)
    {
    HBufC* newLabel = aLabel.AllocL();
    delete iLabel; // after the AllocL succeeds
    iLabel = newLabel;
    ReportEventL(MCoeControlObserver::EEventStateChanged);  
    }


/*
-----------------------------------------------------------------------------

	void CVideoNaviDecoratorTime::SizeChanged()

	Description: Called by the framework when size is changed.
	Comments   :

    Return values: N/A

-----------------------------------------------------------------------------
*/
void CVideoNaviDecoratorTime::SizeChanged()
    {
    // Values from LAF
    TRect parentRect(0,0,120,16);
    iTextLayout.LayoutText(parentRect,R_VIDEO_TIME_TEXT_LAYOUT);
    }

/*
-----------------------------------------------------------------------------

	void CVideoNaviDecoratorTime::Draw(const TRect& aRect) const

	Description: Draws screen
	Comments   :

    Return values: N/A

-----------------------------------------------------------------------------
*/
void CVideoNaviDecoratorTime::Draw(const TRect& /*aRect*/) const
    {
    CWindowGc& gc=SystemGc();

    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
	
    // draw time indicator
    TRgb color = iTextLayout.Color();
    // Color is not updated if it not found from the skin
    AknsUtils::GetCachedColor(skin,color,KAknsIIDQsnComponentColors,EAknsCIQsnComponentColorsCG2);
    gc.SetPenColor(color);
    gc.UseFont(iTextLayout.Font()); 
    gc.DrawText(*iLabel,iTextLayout.TextRect(),iTextLayout.Font()->AscentInPixels(),iTextLayout.Align());
    }

⌨️ 快捷键说明

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