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

📄 chsgnewtextview.cpp

📁 Symbian工程 九宫格界面
💻 CPP
字号:
/* Copyright (c) 2007, Nokia. All rights reserved */
#include "CJGProjectappui.h"
#include "CHsgNewTextView.h"
#include "CHsgNewTextContainer.h"
//#include "LxdMessageManagement.h"
#include "CJGProject.hrh"
#include "CJGProject.rsg"
CHsgNewTextView* CHsgNewTextView::NewL()
{
	CHsgNewTextView* self = NewLC();
    CleanupStack::Pop(self);
    return self;
}

CHsgNewTextView* CHsgNewTextView::NewLC()
{
    CHsgNewTextView* self = new (ELeave) CHsgNewTextView();
    CleanupStack::PushL(self);
    self->ConstructL();
    return self;
}

void CHsgNewTextView::ConstructL()
{
	BaseConstructL();
}

CHsgNewTextView::CHsgNewTextView()
{
	iContainer = NULL;
}


CHsgNewTextView::~CHsgNewTextView()
{
}

TUid CHsgNewTextView::Id() const
{
	return TUid::Uid(3);
}

void CHsgNewTextView::HandleCommandL(TInt aCommand)
{
	switch (aCommand)
	{
	case 0:
		{
			CCJGProjectAppUi* pAppUi = (CCJGProjectAppUi*)CCoeEnv::Static()->AppUi();
			CLxdMessageManagement* ilxdNewMessage=pAppUi->LxdGetMessage();
			TInt mlxdmessagenumber;
			ilxdNewMessage->LxdGetMesNum(mlxdmessagenumber);
			ilxdNewMessage->LxdSetId(mlxdmessagenumber);
			TBuf<50> mTitle;
			TBuf<100> mContent;
			iContainer->HsgGetNewTitle(mTitle);
			iContainer->HsgGetNewContent(mContent);
			if (mTitle.Length()&&mContent.Length())
			{
				TBuf<32> mTime;
				TTime tTime;
				tTime.HomeTime();
				_LIT(KTimeFormat,"%Y%M%D%1-%2-%3");
				tTime.FormatL(mTime,KTimeFormat);
				ilxdNewMessage->LxdSetMessage(mTime,mTitle,mContent);
				AppUi()->ActivateLocalViewL(TUid::Uid(2));
			}
			else
				return ;
		}
		break;
	case 1:
		{
             AppUi()->ActivateLocalViewL(TUid::Uid(2));
		}
		break;
	default:
    AppUi()->HandleCommandL(aCommand);
	break;
	}
}

void CHsgNewTextView::HandleClientRectChange()
{

}

void CHsgNewTextView::DoActivateL(const TVwsViewId&, TUid, const TDesC8&)
{
	iContainer = new( ELeave ) CHsgNewTextContainer();
	iContainer->SetMopParent(this);
	iContainer->ConstructL( ClientRect() );	
	AppUi()->AddToStackL( *this, iContainer );
}

void CHsgNewTextView::DoDeactivate()
{
	if(iContainer)
	{
		AppUi()->RemoveFromStack( iContainer );
		delete iContainer;
		iContainer = NULL;
	}
}

⌨️ 快捷键说明

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