Hi All,
I am trying to go with Symbian and Qt togethor for my telephony application.My App is simple but it detects the calls using Ctelephony API in Symbian.I am using Qt anf follows this link
http://wiki.forum.nokia.com/index.ph...nals_.26_Slots
Follwing are symbian CActive derive class which detect the call
CallsMonitor.h
CallsMonitor.cppCode:#ifndef CALLSMONITOR_H #define CALLSMONITOR_H #include <Etel3rdParty.h> class callMonitorStub; class CCallMonitor : public CActive { public: ~CCallMonitor(); static CCallMonitor* NewLC(callMonitorStub& aObserver); static CCallMonitor* NewL(callMonitorStub& aObserver); private: CCallMonitor(callMonitorStub& aCallBack); void ConstructL(); protected: void DoCancel(); void RunL(); private: void CancelOperation(void); void StartListening(); void GetCallDetails(TBool aIsInCall); private: callMonitorStub& iCallBack; TInt iState; CTelephony::TCallStatusV1 iCurrentStatus; CTelephony::TCallStatusV1Pckg iCurrentStatusPckg; CTelephony::TCallStatus iLastInformedLineStatus; CTelephony* iTelephony; }; #endif // CALLSMONITOR_H
the Qt public class corresponding to this Symbian class is followsCode:#include "CallsMonitor.h" #include "callMonitorStub.h" #include<QtCore> CCallMonitor* CCallMonitor::NewLC(callMonitorStub& aObserver) { CCallMonitor* self = new (ELeave) CCallMonitor(aObserver); CleanupStack::PushL(self); self->ConstructL(); return self; } CCallMonitor* CCallMonitor::NewL(callMonitorStub& aObserver) { CCallMonitor* self = CCallMonitor::NewLC(aObserver); CleanupStack::Pop(); // self; return self; } CCallMonitor::CCallMonitor(callMonitorStub& aCallBack) :CActive(EPriorityStandard),iCallBack(aCallBack),iCurrentStatusPckg(iCurrentStatus)/*,iPhoneIdV1Pckg(iPhoneIdV1)*/ { CActiveScheduler::Add(this); } CCallMonitor::~CCallMonitor() { Cancel(); delete iTelephony; } void CCallMonitor::ConstructL(void) { iTelephony = CTelephony::NewL(); iLastInformedLineStatus = CTelephony::EStatusUnknown; iState=0; StartListening(); } void CCallMonitor::CancelOperation(void) { Cancel(); } void CCallMonitor::DoCancel() { iTelephony->CancelAsync(CTelephony::EVoiceLineStatusChangeCancel); } void CCallMonitor::RunL() { if(iStatus == KErrNone) { switch(iCurrentStatus.iStatus) { case CTelephony::EStatusDisconnecting: if(iState==1) GetCallDetails(ETrue); else GetCallDetails(EFalse); iState=0; break; case CTelephony::EStatusDialling: iState=1; break; case CTelephony::EStatusRinging: if(iLastInformedLineStatus != CTelephony::EStatusDialling) { iState=2; } break; default: break; } iLastInformedLineStatus = iCurrentStatus.iStatus; } if(iStatus != KErrCancel) { StartListening(); } } /*if(iCurrentStatus.iStatus==CTelephony::EStatusDisconnecting) { if(iState==1) GetCallDetails(ETrue); else GetCallDetails(EFalse); iState=0; }else if(iCurrentStatus.iStatus == CTelephony::EStatusDialling ) { //Incoming Call is detected here //GetCallDetails(ETrue); if(iState==0)iState=1; }else if(iCurrentStatus.iStatus == CTelephony::EStatusRinging) { if(iLastInformedLineStatus != CTelephony::EStatusDialling) { if(iState==0)iState=2; //Outgoing call is detected here //GetCallDetails(EFalse); } }else { }*/ void CCallMonitor::StartListening() { Cancel(); iCurrentStatus.iStatus = CTelephony::EStatusUnknown; iTelephony->NotifyChange(iStatus,CTelephony::EVoiceLineStatusChange,iCurrentStatusPckg); SetActive(); } void CCallMonitor::GetCallDetails(TBool aIsInCall) { CTelephony::TCallInfoV1 callInfoV1; CTelephony::TCallInfoV1Pckg callInfoV1Pckg( callInfoV1 ); CTelephony::TCallSelectionV1 callSelectionV1; CTelephony::TCallSelectionV1Pckg callSelectionV1Pckg( callSelectionV1 ); CTelephony::TRemotePartyInfoV1 remotePartyInfoV1; CTelephony::TRemotePartyInfoV1Pckg remotePartyInfoV1Pckg( remotePartyInfoV1 ); callSelectionV1.iLine = CTelephony::EVoiceLine; callSelectionV1.iSelect = CTelephony::EInProgressCall; User::After(10); if(KErrNone==iTelephony->GetCallInfo( callSelectionV1Pckg, callInfoV1Pckg, remotePartyInfoV1Pckg )) { if( remotePartyInfoV1.iRemoteNumber.iTelNumber.Length() > 0 ) { //This is for testing QT_TRYCATCH_LEAVING(iCallBack.emitCallDetected(1,"9895042120","","");) // Incoming call number can be read from //iCallBack.CallStatusChangedL(iCurrentStatus.iStatus,iStatus.Int(),1,remotePartyInfoV1.iRemoteNumber.iTelNumber,callInfoV1.iStartTime,callInfoV1.iDuration); }else if( callInfoV1.iDialledParty.iTelNumber.Length() > 0 ) { //This is for testing QT_TRYCATCH_LEAVING(iCallBack.emitCallDetected(2,"9895042120","","");) // Outgoing call number can be read from //iCallBack.CallStatusChangedL(iCurrentStatus.iStatus,iStatus.Int(),2,callInfoV1.iDialledParty.iTelNumber,callInfoV1.iStartTime,callInfoV1.iDuration); }else { } } }
callMonitorStub.h
callMonitorStub.cppCode:#ifndef CALLMONITORSTUB_H #define CALLMONITORSTUB_H #include<QObject> #include<QtCore> class CallsMonitor; class callMonitorStub:public QObject { Q_OBJECT public: callMonitorStub(QObject *parent=0); ~callMonitorStub(); void emitCallDetected(int Type,QString number,QString dateTime,QString duration); signals: void callDetected(int Type,QString number,QString dateTime,QString duration); private: CallsMonitor *d_ptr; //private implementation private: friend class CallsMonitor; }; #endif // CALLMONITORSTUB_H
Code:#include"callMonitorStub.h" #ifdef Q_OS_SYMBIAN #include"CallsMonitor.h" #endif callMonitorStub::callMonitorStub(QObject *parent):QObject(parent) { #ifdef Q_OS_SYMBIAN QT_TRAP_THROWING(d_ptr = CallsMonitor::NewL(this)); #endif } callMonitorStub::~callMonitorStub() { } void callMonitorStub::emitCallDetected(int Type,QString number,QString dateTime,QString duration) { this->callDetected(Type,number,dateTime,duration); }
I am getting an error in the line marked red in CallMonitorStub.cpp
error: incomplete type 'CallsMonitor' used in nested name specifier
Please help me



