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

📄 mdictionaryappview2.cpp

📁 用于symbian手机的词典工具.绝对有用。
💻 CPP
字号:
/*
* MDictionary - dictionary program for Symbian cellular phones
*
* Copyright (C) 2005 Egyeki Gergely
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
*/
#include <aknviewappui.h>
#include <MDictionary.rsg>
#include "MDictionary.hrh"
#include "MDictionaryAppUi.h"
#include "MDictionaryAppView2.h"
#include "MDictionaryAppView2Container.h"
#include "DBHandler.h"


CMDictionaryAppView2* CMDictionaryAppView2::NewL()
{
    CMDictionaryAppView2* self = CMDictionaryAppView2::NewLC();
    CleanupStack::Pop(self);
    return self;
}


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



CMDictionaryAppView2::CMDictionaryAppView2()
{
}

CMDictionaryAppView2::~CMDictionaryAppView2()
{
}


void CMDictionaryAppView2::ConstructL()
{
    BaseConstructL(R_MDICTIONARY_APPVIEW2);
}


TUid CMDictionaryAppView2::Id() const
{
	return TUid::Uid(EMDictionaryAppView2Id);
}


void CMDictionaryAppView2::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
                                    TUid /*aCustomMessageId*/,
                                    const TDesC8& /*aCustomMessage*/)
{
	//Setting up the actual DB filename
	GetAppUi()->InitDBL();

	if( !iContainer )
	{
		iContainer = new (ELeave) CMDictionaryAppView2Container;
		iContainer->SetMopParent(this);
		iContainer->ConstructL(ClientRect(), this);
		AppUi()->AddToStackL(*this, iContainer);
	}
}

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

void CMDictionaryAppView2::HandleCommandL(TInt aCommand)
{
	//don't panic when Edit key is used
	if( 
		(aCommand != EAknCmdEditModeT9)&&(aCommand != EAknCmdEditModeMultitap)&&
		(aCommand != EAknCmdEditModeNumber)&&(aCommand != EAknCmdEditInsertNumber)&&
		(aCommand != EAknCmdEditInsertSymbol)&&(aCommand != EAknCmdInputLanguage)&&
		(aCommand != EAknCmdEditModeAlpha)&&(aCommand != EAknCmdEditModeLatinText)&&
		(aCommand != EAknCmdEditModeArabicIndicNumber)&&(aCommand != EAknCmdT9PredictiveT9Off)&&
		(aCommand != EAknCmdMultitapPredictiveT9On)&&(aCommand != EAknCmdT9PredictiveMatches)&&
	    (aCommand != EAknCmdT9PredictiveInsertWord)&&(aCommand != EAknCmdT9PredictiveEditWord)
	)
	{
		AppUi()->HandleCommandL(aCommand);
	}
}

void CMDictionaryAppView2::HandleClientRectChange()
{
    if (iContainer)
    {
        iContainer->SetRect( ClientRect() );
    }
}


CMDictionaryAppUi* CMDictionaryAppView2::GetAppUi()
{
	return static_cast<CMDictionaryAppUi*>( AppUi() );
}


HBufC* CMDictionaryAppView2::GetWordL()
{
	return iContainer->GetWordL();
}


⌨️ 快捷键说明

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