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

📄 helloworldbasicappview.cpp

📁 这是Symbian平台下实现Base64编解码的源码.
💻 CPP
字号:
/*
* ==============================================================================
*  Name        : helloworldbasicappview.cpp
*  Part of     : Helloworldbasic
*  Interface   : 
*  Description : 
*  Version     : 
*
*  Copyright (c) 2005-2006 Nokia Corporation.
*  This material, including documentation and any related 
*  computer programs, is protected by copyright controlled by 
*  Nokia Corporation.
* ==============================================================================
*/

// INCLUDE FILES
#include <coemain.h>
#include "HelloWorldBasicAppView.h"

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

// -----------------------------------------------------------------------------
// CHelloWorldBasicAppView::NewL()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CHelloWorldBasicAppView* CHelloWorldBasicAppView::NewL( const TRect& aRect )
    {
    CHelloWorldBasicAppView* self = CHelloWorldBasicAppView::NewLC( aRect );
    CleanupStack::Pop( self );
    return self;
    }

// -----------------------------------------------------------------------------
// CHelloWorldBasicAppView::NewLC()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CHelloWorldBasicAppView* CHelloWorldBasicAppView::NewLC( const TRect& aRect )
    {
    CHelloWorldBasicAppView* self = new ( ELeave ) CHelloWorldBasicAppView;
    CleanupStack::PushL( self );
    self->ConstructL( aRect );
    return self;
    }

// -----------------------------------------------------------------------------
// CHelloWorldBasicAppView::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CHelloWorldBasicAppView::ConstructL( const TRect& aRect )
    {
    // Create a window for this application view
    CreateWindowL();

    // Set the windows size
    SetRect( aRect );

    // Activate the window, which makes it ready to be drawn
    ActivateL();
    }

// -----------------------------------------------------------------------------
// CHelloWorldBasicAppView::CHelloWorldBasicAppView()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CHelloWorldBasicAppView::CHelloWorldBasicAppView()
    {
    // No implementation required
    }


// -----------------------------------------------------------------------------
// CHelloWorldBasicAppView::~CHelloWorldBasicAppView()
// Destructor.
// -----------------------------------------------------------------------------
//
CHelloWorldBasicAppView::~CHelloWorldBasicAppView()
    {
    // No implementation required
    }


// -----------------------------------------------------------------------------
// CHelloWorldBasicAppView::Draw()
// Draws the display.
// -----------------------------------------------------------------------------
//
void CHelloWorldBasicAppView::Draw( const TRect& /*aRect*/ ) const
    {
    // Get the standard graphics context
    CWindowGc& gc = SystemGc();

    // Gets the control's extent
    TRect drawRect( Rect());

    // Clears the screen
    gc.Clear( drawRect );
    
  	}

// -----------------------------------------------------------------------------
// CHelloWorldBasicAppView::SizeChanged()
// Called by framework when the view size is changed.
// -----------------------------------------------------------------------------
//
void CHelloWorldBasicAppView::SizeChanged()
    {  
    DrawNow();
    }
// End of File


	void CHelloWorldBasicAppView::PrintNotify(const TDesC& aDes, TUint aFontStyle)
	{
		//// Display these characters in the main output window, in the specified style
		//SetFontStyle(aFontStyle);

		//for (TInt i = 0; i < aDes.Length(); i++)
		//{
		//	TRAPD(error, KeyEventL(aDes[i]));
		//	if(error != KErrNone)
		//	{
		//		User::Panic (KPanicSockets, ESocketsAppView);
		//	}
		//}   
	}

	void CHelloWorldBasicAppView::PrintNotify(const TDesC8& aDes, TUint aFontStyle)
	{
		// Display these characters in the main output window, in the specified style
		/*SetFontStyle(aFontStyle);

		for (TInt i = 0; i < aDes.Length(); i++)
		{
			TRAPD(error, KeyEventL(aDes[i]));
			if(error != KErrNone)
			{
				User::Panic (KPanicSockets, ESocketsAppView);
			}
		}*/
	}


	void CHelloWorldBasicAppView::ErrorNotify(const TDesC& aErrMessage, TInt aErrCode)
	{
		/*_LIT(KNewLine, "\n");

		TRAPD(error,

			HBufC* errorTitleCode = HBufC::NewLC(50);
		errorTitleCode->Des().Append(aErrMessage);
		errorTitleCode->Des().Append(KNewLine);
		errorTitleCode->Des().AppendNum(aErrCode);

		CAknGlobalNote* globalNote = CAknGlobalNote::NewLC();
		globalNote->ShowNoteL(EAknGlobalErrorNote, *errorTitleCode); 
		CleanupStack::PopAndDestroy(globalNote);
		CleanupStack::PopAndDestroy(errorTitleCode);
		)

			if(error != KErrNone)
			{
				User::Panic (KPanicSockets, ESocketsAppView);
			}*/
	}

	void CHelloWorldBasicAppView::SetStatus(const TDesC& aStatus)
	{
		//// Update contents of status window
		//TRAPD(error, iStatusWindow->SetTextL(aStatus));
		//if(error != KErrNone)
		//{
		//	User::Panic (KPanicSockets, ESocketsAppView);
		//}

		//iStatusWindow->DrawDeferred();
	}

⌨️ 快捷键说明

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