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

📄 contactfilterappui.cpp

📁 symbian 通讯录过滤程序
💻 CPP
字号:
/*
============================================================================
 Name        : ContactFilterAppUi.cpp
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : Main application UI class (controller)
============================================================================
*/

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

#include "ContactFilter.pan"
#include "ContactFilterAppUi.h"
#include "ContactFilterAppView.h"
#include "ContactFilter.hrh"

#include <rpbkviewresourcefile.h>
#include <cpbkmultipleentryfetchdlg.h>
#include <cpbkcontactengine.h>

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


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

    // Create view object
    iAppView = CContactFilterAppView::NewL( ClientRect() );
    }
// -----------------------------------------------------------------------------
// CContactFilterAppUi::CContactFilterAppUi()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CContactFilterAppUi::CContactFilterAppUi()
    {
    // No implementation required
    }

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

    }

// -----------------------------------------------------------------------------
// CContactFilterAppUi::HandleCommandL()
// Takes care of command handling.
// -----------------------------------------------------------------------------
//
void CContactFilterAppUi::HandleCommandL( TInt aCommand )
    {
    switch( aCommand )
        {
        case EEikCmdExit:
        case EAknSoftkeyExit:
            Exit();
            break;
        case EContactFilterCommand1:
            {

				RPbkViewResourceFile pbkrf(*iCoeEnv);
				pbkrf.OpenL();

				// set up the params
				CPbkMultipleEntryFetchDlg::TParams params;
				CleanupStack::PushL(params); // uses the TCleanupItem() operator of the TParams class	
				// make an instance of the contacts model
				CPbkContactEngine* pbkContactEngine = CPbkContactEngine::NewL(&iEikonEnv->FsSession());
				CleanupStack::PushL(pbkContactEngine);

				params.iContactView = &pbkContactEngine->AllContactsView();					
				// make the fetch dialog
				CPbkMultipleEntryFetchDlg* fetcher = CPbkMultipleEntryFetchDlg::NewL(params, *pbkContactEngine);
				
				if(fetcher->ExecuteLD())
				{
					// Load a string from the resource file and display it
					HBufC* textResource = StringLoader::LoadLC( R_HEWB_COMMAND1_TEXT );

					// Show the information Note with
					// textResource loaded with StringLoader.
					CAknInformationNote* informationNote = new ( ELeave ) CAknInformationNote;
					informationNote->ExecuteLD( *textResource );

					// Pop HBuf from CleanUpStack and Destroy it.
					CleanupStack::PopAndDestroy( textResource );
				}

				CleanupStack::PopAndDestroy(pbkContactEngine); 
				CleanupStack::PopAndDestroy(1);
				pbkrf.Close();
            }
            break;
        default:
            Panic( EContactFilterUi );
            break;
        }
    }
// -----------------------------------------------------------------------------
//  Called by the framework when the application status pane
//  size is changed.  Passes the new client rectangle to the
//  AppView
// -----------------------------------------------------------------------------
//
void CContactFilterAppUi::HandleStatusPaneSizeChange()
{
	iAppView->SetRect( ClientRect() );
	
} 


// End of File

⌨️ 快捷键说明

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