?? mdictionaryappview1.cpp
字號(hào):
/*
* 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 "MDictionaryAppView1.h"
#include "MDictionaryAppView1Container.h"
#include "DBHandler.h"
CMDictionaryAppView1* CMDictionaryAppView1::NewL()
{
CMDictionaryAppView1* self = CMDictionaryAppView1::NewLC();
CleanupStack::Pop(self);
return self;
}
CMDictionaryAppView1* CMDictionaryAppView1::NewLC()
{
CMDictionaryAppView1* self = new (ELeave) CMDictionaryAppView1();
CleanupStack::PushL(self);
self->ConstructL();
return self;
}
CMDictionaryAppView1::CMDictionaryAppView1()
{
}
CMDictionaryAppView1::~CMDictionaryAppView1()
{
}
void CMDictionaryAppView1::ConstructL()
{
BaseConstructL(R_MDICTIONARY_APPVIEW1);
}
TUid CMDictionaryAppView1::Id() const
{
return TUid::Uid(EMDictionaryAppView1Id);
}
void CMDictionaryAppView1::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
TUid /*aCustomMessageId*/,
const TDesC8& /*aCustomMessage*/)
{
//Setting up the actual DB filename
GetAppUi()->InitDBL();
if( !iContainer )
{
iContainer = new (ELeave) CMDictionaryAppView1Container;
iContainer->SetMopParent(this);
iContainer->ConstructL(ClientRect(), this);
AppUi()->AddToStackL(*this, iContainer);
}
}
void CMDictionaryAppView1::DoDeactivate()
{
if(iContainer)
{
AppUi()->RemoveFromStack(iContainer);
delete iContainer;
iContainer = NULL;
}
}
void CMDictionaryAppView1::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 CMDictionaryAppView1::HandleClientRectChange()
{
if (iContainer)
{
iContainer->SetRect( ClientRect() );
}
}
CMDictionaryAppUi* CMDictionaryAppView1::GetAppUi()
{
return static_cast<CMDictionaryAppUi*>( AppUi() );
}
HBufC* CMDictionaryAppView1::GetWordL()
{
return iContainer->GetWordL();
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -