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

📄 symbiandllguiappui.cpp

📁 实现动态封装功能!大家好好的看看!有什么不明白的大家好好的研究一下!
💻 CPP
字号:
/*
============================================================================
 Name        : SymbiandllGui.rss
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : Main application class
============================================================================
*/

// INCLUDE FILES
#include <avkon.hrh>
#include <aknnotewrappers.h>
#include <stringloader.h>
#include <SymbiandllGui.rsg>
#include <f32file.h>
#include <s32file.h>

#include "SymbiandllGui.pan"
#include "SymbiandllGuiAppUi.h"
#include "SymbiandllGuiAppView.h"
#include "SymbiandllGui.hrh"

/*_LIT( KHelloFileName,	"z:\\system\\apps\\SymbiandllGui\\Hello.txt" );
_LIT( KHelloText, "HELLO WORLD!");*/

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


// -----------------------------------------------------------------------------
// CSymbiandllGuiAppUi::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CSymbiandllGuiAppUi::ConstructL()
    {
    // Initialise app UI with standard value.
    BaseConstructL();
    
    iEngine = CSymbiandllDll::NewL();

    // Create view object
    iAppView = CSymbiandllGuiAppView::NewL( ClientRect() );

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

// -----------------------------------------------------------------------------
// CSymbiandllGuiAppUi::~CSymbiandllGuiAppUi()
// Destructor.
// -----------------------------------------------------------------------------
//
CSymbiandllGuiAppUi::~CSymbiandllGuiAppUi()
    {
    if ( iAppView )
        {
        delete iAppView;
        iAppView = NULL;
        }
    delete iEngine;
    }

// -----------------------------------------------------------------------------
// CSymbiandllGuiAppUi::HandleCommandL()
// Takes care of command handling.
// -----------------------------------------------------------------------------
//
void CSymbiandllGuiAppUi::HandleCommandL( TInt aCommand )
    {
    switch( aCommand )
        {
        case EEikCmdExit:
        case EAknSoftkeyExit:
            Exit();
            break;
        case ESymbiandllGuiCommand1:
            {            
            // Load a string from the resource file and display it
            HBufC* textResource = StringLoader::LoadLC( R_HEWB_COMMAND1_TEXT );
            CAknInformationNote* informationNote = new ( ELeave ) CAknInformationNote;
            // Show the information Note with textResource loaded with StringLoader.
            informationNote->ExecuteLD( *textResource);
            // Pop HBuf from CleanUpStack and Destroy it.
            CleanupStack::PopAndDestroy( textResource );
            }
            break;
		case ESymbiandllGuiCommand2:
			{
            // Use the engine DLL
            TInt ch;
            for(ch = 'A'; ch <= 'O'; ch++)
                {
                iEngine->ExampleFuncAddCharL(ch);
                }
            // Show the information Note with text from the engine
            CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
            informationNote->ExecuteLD(iEngine->ExampleFuncString());
		iEngine->ExampleFuncClearBuffer();
            break;            
        default:
            Panic( ESymbiandllGuiUi );
            break;
        }
    }
}

// -----------------------------------------------------------------------------
//  Called by the framework when the application status pane
//  size is changed.  Passes the new client rectangle to the
//  AppView
// -----------------------------------------------------------------------------
//
void CSymbiandllGuiAppUi::HandleStatusPaneSizeChange()
{
	iAppView->SetRect( ClientRect() );
	
} 

// End of File

⌨️ 快捷键说明

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