fontsandtexteffectsview.cpp

来自「最新官方例子,图形,描述副,基本控件,通讯协议,等等,」· C++ 代码 · 共 146 行

CPP
146
字号
/**
 * 
 * @brief Definition of CFontsAndTextEffectsView
 *
 * Copyright (c) EMCC Software Ltd 2003
 * @version 1.0
 */

// INCLUDE FILES

// Class includes
#include "FontsAndTextEffectsView.h"

// System includes
#include <aknviewappui.h>	// CAknViewAppUi
#include <FontsAndText.rsg>	// R_FONTSANDTEXT_EFFECTSVIEW

// User Includes
#include "FontsAndTextEffectsContainer.h"	// CFontsAndTextEffectsContainer

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

/** 
 * Destructor.  Frees up memory for the iContainer.
 * Also removes the Control from the control stack
 */
CFontsAndTextEffectsView::~CFontsAndTextEffectsView()
	{
	if (iContainer)
		{
		AppUi()->RemoveFromViewStack(*this, iContainer);
		}

	delete iContainer;
	}

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

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

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

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

/**
 * From CEikAppUi, takes care of command handling for this view.
 *
 * @param aCommand command to be handled
 */
void CFontsAndTextEffectsView::HandleCommandL(TInt aCommand)
	{   
	switch (aCommand)
		{
		case EAknSoftkeyBack:
			{
			AppUi()->HandleCommandL(EEikCmdExit);
			break;
			}
		default:
			{
			AppUi()->HandleCommandL(aCommand);
			break;
			}
		}
	}

/**
 * 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.
 *
 * @param aPrevViewId not used
 * @param aCustomMessageId not used
 * @param aCustomMessage not used
 */
void CFontsAndTextEffectsView::DoActivateL(
   const TVwsViewId& /*aPrevViewId*/,
   TUid /*aCustomMessageId*/,
   const TDesC8& /*aCustomMessage*/)
	{
	if (!iContainer)
		{
		iContainer = CFontsAndTextEffectsContainer::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 CFontsAndTextEffectsView::DoDeactivate()
	{
	if (iContainer)
		{
		AppUi()->RemoveFromViewStack(*this, iContainer);
		}

	delete iContainer;
	iContainer = NULL;
	}

// End of File

⌨️ 快捷键说明

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