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

📄 alarmorganiserdefaultview.cpp

📁 series60 应用程序开发的源代码 series60 应用程序开发的源代码
💻 CPP
字号:
/**
* 
* @brief Definition of CAlarmOrganiserDefaultView
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/

// INCLUDES

//  Class include
#include "AlarmOrganiserDefaultView.h"

// System includes
#include <aknviewappui.h>                    // CAknViewAppUi
#include <AlarmOrganiser.rsg>                // R_ALARMORGANISER_DEFAULT_VIEW
#include <eikmenup.h>                        // CEikMenuPane

// User includes
#include "AlarmOrganiser.hrh"                // TAlarmOrganiserViewNumber
#include "AlarmOrganiserDefaultContainer.h"    // CAlarmOrganiserDefaultContainer

// ================ =  MEMBER FUNCTIONS ====================== = 

/** 
* Destructor.
*/
CAlarmOrganiserDefaultView::~CAlarmOrganiserDefaultView()
{
    delete iContainer;
}

/**
* Symbian OS 2 phase constructor.
* Constructs the CAlarmOrganiserDefaultView using the NewLC method, popping
* the constructed object from the CleanupStack before returning it.
* 
* @return The newly constructed CAlarmOrganiserDefaultView
*/
CAlarmOrganiserDefaultView* CAlarmOrganiserDefaultView::NewL()
{
    CAlarmOrganiserDefaultView* self = CAlarmOrganiserDefaultView::NewLC();
    CleanupStack::Pop(self);
    return self;
}

/**
* Symbian OS 2 phase constructor.
* Constructs the CAlarmOrganiserDefaultView using the constructor and ConstructL 
* method, leaving the constructed object on the CleanupStack before returning it.
* 
* @return The newly constructed CAlarmOrganiserDefaultView
*/
CAlarmOrganiserDefaultView* CAlarmOrganiserDefaultView::NewLC()
{
    CAlarmOrganiserDefaultView* self = new (ELeave) CAlarmOrganiserDefaultView();
    CleanupStack::PushL(self);
    self->ConstructL();
    return self;
}

/**
* Symbian OS 2nd phase constructor.  
* Uses the superclass constructor to construct the view using the 
* R_ALARMORGANISER_DEFAULT_VIEW resource.
*/ 
void CAlarmOrganiserDefaultView::ConstructL()
{
    BaseConstructL(R_ALARMORGANISER_DEFAULT_VIEW);
}

/**
* Called by the framework
* @return The Uid for this view
*/
TUid CAlarmOrganiserDefaultView::Id() const
{
    return TUid::Uid(EAlarmOrganiserDefaultViewId);
}

/**
* 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 CAlarmOrganiserDefaultView::DoActivateL(const TVwsViewId& /*aPrevViewId*/, 
                                             TUid /*aCustomMessageId*/, 
                                             const TDesC8& /*aCustomMessage*/)
{
    if (!iContainer)
    {
        iContainer = CAlarmOrganiserDefaultContainer::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 CAlarmOrganiserDefaultView::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 CAlarmOrganiserDefaultView::HandleCommandL(TInt aCommand)
{
    
    switch (aCommand)
    {
        case EAknSoftkeyExit:
        {
            AppUi()->HandleCommandL(EEikCmdExit);
            break;
        }
        case EAlarmOrganiserRemoveAlarm:
        {
            iContainer->RemoveAlarmL();
        }
        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 CAlarmOrganiserDefaultView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
{
    if (iContainer->ListBoxEmpty())
    {
        if (aResourceId == R_ALARMORGANISER_DEFAULT_MENU_PANE)
        {
            aMenuPane->SetItemDimmed(EAlarmOrganiserRemoveAlarm, ETrue);
        }
    }
}


// End of File

⌨️ 快捷键说明

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