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

📄 drawing.h

📁 《SymbianOSC手机应用开发》源码
💻 H
字号:
// drawing.h
// ------------
//
// Copyright (c) 2002 Symbian Ltd.  All rights reserved.
//

////////////////////////////////////////////////////////////////////
// drawing 
// ----------
//
//
// The class definitions for the example application
// containing a single view with the text "Hello World !" drawn in 2
// separate boxes.
//
// The class definitions are:
//
// CExampleApplication 
// CExampleAppUi
// CExampleAppView
// CExampleDocument
//
//
////////////////////////////////////////////////////////////////////
#ifndef __DRAWING_H
#define __DRAWING_H

#include <coeccntx.h>

#include <eikenv.h>
#include <eikappui.h>
#include <eikapp.h>
#include <eikdoc.h>
#include <eikmenup.h>

#include <eikon.hrh>

#include <drawing.rsg>
#include "drawing.hrh"



////////////////////////////////////////////////////////////////////////
//
// CExampleApplication
//
////////////////////////////////////////////////////////////////////////

class CExampleApplication : public CEikApplication
	{
private: 
	           // Inherited from class CApaApplication
	CApaDocument* CreateDocumentL();
	TUid AppDllUid() const;
	};

////////////////////////////////////////////////////////////////////////
//
// CExampleAppView
//
////////////////////////////////////////////////////////////////////////
class CExampleHelloView : public CBase
	{
public:
	// construct/destruct
	static CExampleHelloView* NewL();
	~CExampleHelloView();
	// settings
	void SetTextL(const TDesC& aText);
	void SetFullRedraw(TBool aFullRedraw);
	// draw
	void DrawInRect(const MGraphicsDeviceMap& aMap, CGraphicsContext& aGc, const TRect& aDeviceRect, CFont* aFont) const;
private:
	void ConstructL();
private:
	HBufC* iText;
	TBool iFullRedraw;
	};

class CExampleHelloControl : public CCoeControl
	{
public:
	// construct/destruct
	static CExampleHelloControl* NewL(const CCoeControl& aContainer, const TRect& aRect);
	~CExampleHelloControl();
	// settings
	void SetZoomAndDeviceDependentFontL(TInt aZoomFactor);
	TInt GetZoom() const;
	void SetZoomInL();
	void SetZoomOutL();
	void SetFullRedraw(TBool aFullRedraw);
private:
	void ConstructL(const CCoeControl& aContainer, const TRect& aRect);
private: // from CCoeControl
	void Draw(const TRect&) const;
private:
	HBufC* iText;
	TZoomFactor iZoomFactor;
	CExampleHelloView* iView;
	CFont* iFont;
	};

// EIKON application classes

class CExampleAppView : public CCoeControl
	{
public:
	~CExampleAppView();
	void ConstructL(const TRect& aRect);
	// zooming
	void ZoomInL();
	void ZoomOutL();
private: // from CCoeControl
	TInt CountComponentControls() const;
	CCoeControl* ComponentControl(TInt aIndex) const;
private:
	CExampleHelloControl* iControl0;
	CExampleHelloControl* iControl1;
//	CExampleHelloControl* iControl2;
//	CExampleHelloControl* iControl3;
	};


////////////////////////////////////////////////////////////////////////
//
// CExampleAppUi
//
////////////////////////////////////////////////////////////////////////
class CExampleAppUi : public CEikAppUi
    {
public:
    void ConstructL();
	~CExampleAppUi();

private:
              // Inherited from class CEikAppUi
	void HandleCommandL(TInt aCommand);

private:
	CExampleAppView* iAppView;
	};


////////////////////////////////////////////////////////////////////////
//
// CExampleDocument
//
////////////////////////////////////////////////////////////////////////
class CExampleDocument : public CEikDocument
	{
public:
	static CExampleDocument* NewL(CEikApplication& aApp);
	CExampleDocument(CEikApplication& aApp);
	void ConstructL();
private: 
	           // Inherited from CEikDocument
	CEikAppUi* CreateAppUiL();
	};


#endif

⌨️ 快捷键说明

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