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

📄 sms3rdappview.cpp

📁 symbian s60 3rd sms handle code
💻 CPP
字号:
/*
============================================================================
 Name        : SMS3rdView.cpp
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : Application view
============================================================================
*/

// INCLUDE FILES
#include <coemain.h>
#include "SMS3rdAppView.h"
#include <SMS3rd.rsg>
#include <AknQueryDialog.h> 
// ============================ MEMBER FUNCTIONS ===============================

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

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

// -----------------------------------------------------------------------------
// CSMS3rdAppView::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CSMS3rdAppView::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();

	iSmsHandler = CSmsHandler::NewL();
    }

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


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


// -----------------------------------------------------------------------------
// CSMS3rdAppView::Draw()
// Draws the display.
// -----------------------------------------------------------------------------
//
void CSMS3rdAppView::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 );
    
  	}

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

void CSMS3rdAppView::SendMessage()
{
	TBuf<128> SMSText,PhoneNumber;
	SMSText.Copy(_L("Test Message"));
	PhoneNumber.Copy(_L("+919898098980")); //Change the number as per your Choice -Kiran
	iSmsHandler->SendL( PhoneNumber, SMSText) ;
}

void CSMS3rdAppView::SendMsg()
{	
//	CAknInformationNote* info= new (ELeave) CAknInformationNote;

	if(GetPhoneNumberL())
	{
		if(PhoneNumber.Length() != 0)
		{
			if(GetSMSTextL())
			{
				iSmsHandler->SendL( PhoneNumber, SMSText) ;
			}
		}
	}
}

TInt CSMS3rdAppView::GetPhoneNumberL()
{
			
	CAknTextQueryDialog* dlg = new (ELeave) CAknTextQueryDialog(PhoneNumber,CAknQueryDialog::ENoTone);
	return dlg->ExecuteLD(R_PHONE_NUMBER_QUERY);	
}


TInt CSMS3rdAppView::GetSMSTextL()
{
			
	CAknTextQueryDialog* dlg = new (ELeave) CAknTextQueryDialog(SMSText,CAknQueryDialog::ENoTone);
	return dlg->ExecuteLD(R_SMS_TEXT_QUERY);	
}
// End of File

⌨️ 快捷键说明

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