Hi ,
can anyone tell how to make calls and send emails by qt code ??? I need resources please...
Thanks..
Hi ,
can anyone tell how to make calls and send emails by qt code ??? I need resources please...
Thanks..
try Qt Mobility API
http://doc.qt.nokia.com/qtmobility-1.1.0-beta2/
http://kunalmaemo.blogspot.com/
Link against: LIBS += -letel3rdparty
Follow the code to make a call in Qt (require symbian c++):
#ifndef S60MAKECALL_H
#define S60MAKECALL_H
#include <QString>
#ifdef Q_WS_S60
#include <Etel3rdParty.h>
// link to etel3rdparty.lib
#endif
#ifdef Q_WS_S60
class CCallDialer : public CActive
{
public:
static CCallDialer* NewL( const TDesC& aNumber);
static CCallDialer* NewLC( const TDesC& aNumber);
~CCallDialer();
protected:
CCallDialer();
void ConstructL(const TDesC& aNumber);
private:
void RunL();
void DoCancel();
private:
CTelephony* iTelephony;
CTelephony::TCallId iCallId;
CTelephony::TCallParamsV1 iCallParams;
CTelephony::TCallParamsV1Pckg iCallParamsPckg;
};
#endif
class S60MakeCall
{
public:
S60MakeCall();
~S60MakeCall();
void MakeCall(QString numeroTelefono);
#ifdef Q_WS_S60
CCallDialer *callDialer;
#endif
};
#endif // S60MAKECALL_H
#include "S60/s60makecall.h"
S60MakeCall::S60MakeCall()
{
#ifdef Q_WS_S60
this->callDialer = NULL
#endif
;
}
S60MakeCall::~S60MakeCall()
{
#ifdef Q_WS_S60
if (this->callDialer) delete this->callDialer;
this->callDialer = NULL;
#endif
}
void S60MakeCall::MakeCall(QString numeroTelefono)
{
#ifdef Q_WS_S60
TBuf<48> dNumeroTelefono(numeroTelefono.utf16());
this->callDialer = CCallDialer::NewL(dNumeroTelefono);
#endif
}
#ifdef Q_WS_S60
CCallDialer* CCallDialer::NewL(const TDesC& aNumber)
{
CCallDialer* self = CCallDialer::NewLC(aNumber);
CleanupStack::Pop(self);
return self;
}
CCallDialer* CCallDialer::NewLC(const TDesC& aNumber)
{
CCallDialer* self = new (ELeave) CCallDialer();
CleanupStack::PushL(self);
self->ConstructL(aNumber);
return self;
}
CCallDialer::~CCallDialer()
{
Cancel();
delete iTelephony;
}
void CCallDialer::ConstructL(const TDesC& aNumber)
{
iTelephony = CTelephony::NewL();
CTelephony::TTelNumber telNumber(aNumber);
iCallParams.iIdRestrict = CTelephony::ESendMyId;
iTelephony->DialNewCall(iStatus, iCallParamsPckg, telNumber, iCallId);
SetActive();
}
CCallDialer::CCallDialer()
: CActive(EPriorityNormal), iCallParamsPckg(iCallParams)
{
CActiveScheduler::Add(this);
}
void CCallDialer::RunL()
{
//iObserver.CallDialedL(iStatus.Int());
}
void CCallDialer:oCancel()
{
iTelephony->CancelAsync(CTelephony::EDialNewCallCancel);
}
#endif
Hi negus,
I tried this code and in my mainwindow.cpp I created an object like this:
call=new S60MakeCall();
call->MakeCall("ANY NUMBER");
the application ran without errors but it didnt make any call !!! Knowing that I run on N8 (symbian 3) device.....help please![]()
Last edited by Maysoon88; 2011-01-02 at 09:00.
Did you add NetworkServices capablity to your project. like in your pro file
symbian: {
TARGET.CAPABILITY = "NetworkServices"
}
hi thank u all its working now, it just needed me to maintain my Qt version there where some missing libraries I guess.
but I still need something for sending emails![]()
thanks negus so much
it is working fine, but i want to send a USSD also but i can't
the ussd is something like "*505*number# " please tell me if there is a way to do that
thanks
Ram