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

📄 chvappui.cpp

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

#include <aknnotewrappers.h>
#include <avkon.hrh>

#include <stringloader.h>
#include <hview.rsg>

#include "hv.pan"
#include "CHVAppUi.h"
#include "CHVAppView.h"
#include "hv.hrh"

#include "DBG_LOGF.h"

// ConstructL is called by the application framework
void CHVAppUi::ConstructL()
{
    BaseConstructL();

	fileLoader = new (ELeave) CFileLoader();

	StatusPane()->MakeVisible(EFalse);

    CHVAppView* appView = new(ELeave) CHVAppView;
    CleanupStack::PushL(appView);
    appView->ConstructL(this);
    CleanupStack::Pop();    // appView
    AddViewL(appView);    // transfer ownership

	iAppView = appView;
	ActivateLocalViewL(appView->Id());

}

CHVAppUi::CHVAppUi()                              
{
    // add any construction that cannot leave here
}

CHVAppUi::~CHVAppUi()
{
	delete fileLoader;
}

// handle any menu commands
void CHVAppUi::HandleCommandL(TInt aCommand)
{
    switch(aCommand)
        {
		case EOpenFile:
			LOGF("opening new file\n");
			iAppView->iContainer->OpenNewFileDialog();
			break;

		case ESwitchToBinary:
			LOGF("sweetch Modezz pleashe to binary.\n");
			iAppView->iContainer->SwitchModesPlease(EViewBinary);
			break;

		case ESwitchToPlain:
			LOGF("sweetch Modezz pleashe to plain.\n");
			iAppView->iContainer->SwitchModesPlease(EViewPlain);
			break;

		case EGotoFilePos:
			LOGF("gotofile pos dialog please\n");
			iAppView->iContainer->GoToFilePositionDialog();
			break;

		/*case EHVCommand:
            {
			// load a string from the resource file and display it
			HBufC* textResource = StringLoader::LoadLC(R_NEW_STRING_RESOURCE);
            CAknInformationNote* informationNote;
			informationNote = new (ELeave) CAknInformationNote;
            informationNote->ExecuteLD(textResource->Des());
			CleanupStack::PopAndDestroy(textResource);
            }
            break;
			*/

		case EEikCmdExit:
        case EAknSoftkeyExit:
			LOGF("user exit\n");
            Exit();
            break;

        default:
            SYS_Errorf("CHVAppUi::HandleCommandL: Command unknown (%d)", aCommand);
            break;
        }
}



void CHVAppUi::ProcessMessageL(TUid aUid, const TDesC8& aParams)
{
	LOGF("messageId: %d\n", aUid.iUid);
	if(aUid.iUid == KUidApaMessageSwitchOpenFileValue)
	{
		LOGF("switch open file\n");
		LOGF("parms: '%s'\n", aParams);

	}
}


TBool CHVAppUi::ProcessCommandParametersL(TApaCommand aCommand,TFileName& aDocumentName,const TDesC8& aTail)
{
	LOGF("processCommandPrameters\n");

	docFileName.Copy(aDocumentName);

	LOGF("docName:\n");
	LOGD(&docFileName);
	LOGF_noTimeStamp("\n");



#ifdef __WINS__
	// temporary for devel process:
	_LIT(fname, "C:\\file.txt");
	docFileName.Copy(fname);
	LOGF("FAKE docName:\n");
	LOGD(&docFileName);
	LOGF_noTimeStamp("\n");
#endif

	CEikAppUi::ProcessCommandParametersL(aCommand, aDocumentName, aTail);


	return ETrue;
}

⌨️ 快捷键说明

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