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

📄 chvcontainer.h

📁 一个Symbain 文本编辑器
💻 H
字号:
/*
 * HView [c]2004 Marcin Skoczylas, All rights reserved
 *
 * This file is under GPL license, see gpl.txt file
 *
 */

#ifndef __HV_CONTAINER__
#define __HV_CONTAINER__

class CHVAppUi;
#include <aknview.h>
#include "CViewPlain.h"
#include "CViewBinary.h"
#include "gdi.h"

enum TViewStates
{
	EViewPlain = 0, EViewBinary
};


class CHVContainer : public CCoeControl, MCoeControlObserver
{
public: 

	CHVContainer();
	virtual ~CHVContainer();

	// frame rectangle for container.
    void ConstructL(const TRect& aRect, CHVAppUi *appUi);


private: // Functions from base classes

	// From CoeControl,SizeChanged.
    void SizeChanged();

	//From CoeControl,CountComponentControls.
	//TInt CountComponentControls() const;

	//aIndex of control
        CCoeControl* ComponentControl(TInt aIndex) const;
	//	aRect Frame rectangle for container.
	void Draw(const TRect& aRect) const;

	//         * @return Indicates whether or not the key event was
	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);

private:
	//	Handles an event of type aEventType
	void HandleControlEventL(CCoeControl* /*aControl*/, TCoeEvent /*aEventType*/);

	CViewBinary *viewBinary;
	CViewPlain *viewPlain;

public:
	// allezz 4 allesh
	CHVAppUi *appUi;

	void ForceDraw();

	TRect screenRect;
	CFbsBitmap *fontBitmap;
	CFbsBitmap *backBuffer;
	CFbsBitGc *backBufferGc;
	CFbsBitmapDevice* backBufferDevice;
	CFbsBitmap *backBuffer2;
	CFbsBitGc *backBufferGc2;
	CFbsBitmapDevice* backBufferDevice2;

	char **charsArray;	// stores char screen table
	TInt numCharsX;		// x-size
	TInt numCharsY;		// y-size

	bool fileOpened;

	TBool OpenNewFile(TFileName fileName);
	void GoToFilePositionDialog();

	TFileName lastOpenedFile;

	TBool DrawWholeBackBuffer();

	TBool SetupArrays(TInt filePos);
	TBool ScrollDown();
	TBool ScrollUp();
	void ScrollPageUp();
	void ScrollPageDown();
	void ScrollRight();
	void ScrollLeft();

	TInt GetFilePos();

	TRect GetFontRectByChar(unsigned int c);
	//void binaryDrawLine(int line);

	void OpenNewFileDialog();

	TInt viewMode;
	void SwitchModesPlease(TInt newMode);

};

#endif //__HV_CONTAINER__

⌨️ 快捷键说明

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