?? alarmorganisersecondview.cpp
字號:
/**
*
* @brief Definition of CAlarmOrganiserSecondView
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/
// INCLUDES
// Class include
#include "AlarmOrganiserSecondView.h"
// System includes
#include <aknviewappui.h> // CAknViewAppUi
#include <AlarmOrganiser.rsg> // R_ALARMORGANISER_SECOND_VIEW
#include <eikmenup.h> // CEikMenuPane
// User includes
#include "AlarmOrganiser.hrh" // TAlarmOrganiserViewNumber
#include "AlarmOrganiserSecondContainer.h" // CAlarmOrganiserSecondContainer
#include "AlarmOrganiserSecondEngine.h" // CAlarmOrganiserSecondEngine
// ================ = MEMBER FUNCTIONS ====================== =
/**
* Destructor. Frees up memory.
*/
CAlarmOrganiserSecondView::~CAlarmOrganiserSecondView()
{
delete iContainer;
}
/**
* Symbian OS 2 phase constructor.
* Constructs the CAlarmOrganiserSecondView using the NewLC method, popping
* the constructed object from the CleanupStack before returning it.
*
* @return The newly constructed CAlarmOrganiserSecondView
*/
CAlarmOrganiserSecondView* CAlarmOrganiserSecondView::NewL()
{
CAlarmOrganiserSecondView* self = CAlarmOrganiserSecondView::NewLC();
CleanupStack::Pop(self);
return self;
}
/**
* Symbian OS 2 phase constructor.
* Constructs the CAlarmOrganiserSecondView using the constructor and ConstructL
* method, leaving the constructed object on the CleanupStack before returning it.
*
* @return The newly constructed CAlarmOrganiserSecondView
*/
CAlarmOrganiserSecondView* CAlarmOrganiserSecondView::NewLC()
{
CAlarmOrganiserSecondView* self = new (ELeave) CAlarmOrganiserSecondView();
CleanupStack::PushL(self);
self->ConstructL();
return self;
}
/**
* Symbian OS 2nd phase constructor.
* Uses the superclass constructor to construct the view using the
* R_ALARMORGANISER_SECOND_VIEW resource.
*/
void CAlarmOrganiserSecondView::ConstructL()
{
BaseConstructL(R_ALARMORGANISER_SECOND_VIEW);
}
/**
* Called by the framework
* @return The Uid for this view
*/
TUid CAlarmOrganiserSecondView::Id() const
{
return TUid::Uid(EAlarmOrganiserSecondViewId);
}
/**
* Called by the framework when the view is activated. Constructs the
* container if necessary, setting this view as its MOP parent, and
* adding it to the control stack.
*/
void CAlarmOrganiserSecondView::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
TUid /*aCustomMessageId*/,
const TDesC8& /*aCustomMessage*/)
{
if (!iContainer)
{
iContainer = CAlarmOrganiserSecondContainer::NewL(ClientRect());
iContainer->SetMopParent(this);
AppUi()->AddToStackL(*this, iContainer);
}
}
/**
* Called by the framework when the view is deactivated.
* Removes the container from the control stack and deletes it.
*/
void CAlarmOrganiserSecondView::DoDeactivate()
{
if (iContainer)
{
AppUi()->RemoveFromStack(iContainer);
delete iContainer;
iContainer = NULL;
}
}
/**
* From CEikAppUi, takes care of command handling for this view.
*
* @param aCommand command to be handled
*/
void CAlarmOrganiserSecondView::HandleCommandL(TInt aCommand)
{
switch (aCommand)
{
case EAknSoftkeyExit:
{
AppUi()->HandleCommandL(EEikCmdExit);
break;
}
case EAlarmOrganiserAddAlarm:
{
iContainer->AddAlarmL();
}
default:
{
AppUi()->HandleCommandL(aCommand);
}
}
}
/**
* Updates menu items, dims menu option if there are no entries. Called by the framework
* DynInitMenuPaneL.
*
* @param aResourceId resource id of the menu pane
* @param aMenuPane menu pane
*/
void CAlarmOrganiserSecondView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
{
if (iContainer->ListBoxEmpty())
{
if (aResourceId == R_ALARMORGANISER_SECOND_MENU_PANE)
{
aMenuPane->SetItemDimmed(EAlarmOrganiserAddAlarm, ETrue);
}
}
}
// End of File
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -