Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived:Retrieving incoming and outgoing call numbers for a videocall using CLogEvent

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.



Article Metadata
Tested with
Devices(s): Tested on Nokia N95, Nokia N96
Compatibility
Platform(s): S60 3rd Edition, FP1
S60 3rd Edition, FP2
S60 3rd Edition FP2
S60 3rd Edition FP1
Article
Keywords: MLogViewChangeObserver, CLogEvent
Created: User:Kbwiki (08 Oct 2009)
Last edited: hamishwillee (15 Jun 2012)

Description

Retrieving incoming and outgoing call numbers for a video call can be done using the MLogViewChangeObserver interface and the CLogEvent class.

Solution

The following sample code shows how to retrieve the incoming and outgoing call numbers for a video call. Note that the code can be adapted to retrieve log information for voice calls as well.

Link against: logcli.lib, logwrap.lib, efsrv.lib, PbkEng.lib gdi.lib

LogOutgoingAppUi.h

  #include <logcli.h> 
#include <logwrap.h>
#include <logviewchangeobserver.h>
#include <logclientchangeobserver.h>
#include <logview.h>
#include <f32file.h>
 
 
class CLogOutgoingAppUi : public CAknAppUi,
public CActive,
public MLogViewChangeObserver,
public MLogClientChangeObserver
{
public: // constructors & destructors
 
void ConstructL();
CLogOutgoingAppUi();
~CLogOutgoingAppUi();
 
public: // from CAknAppUi
 
void HandleCommandL( TInt aCommand );
 
private: // from CActive
 
void RunL();
void DoCancel();
 
private: // from MLogViewChangeObserver
 
void HandleLogViewChangeEventAddedL( TLogId aId, TInt aViewIndex,
TInt aChangeIndex, TInt aTotalChangeCount );
 
void HandleLogViewChangeEventChangedL( TLogId aId, TInt aViewIndex,
TInt aChangeIndex, TInt aTotalChangeCount );
 
void HandleLogViewChangeEventDeletedL( TLogId aId, TInt aViewIndex,
TInt aChangeIndex, TInt aTotalChangeCount );
 
private: // from MLogClientChangeObserver
 
void HandleLogClientChangeEventL( TUid aChangeType, TInt aChangeParam1,
TInt aChangeParam2, TInt aChangeParam3 );
 
private: // data
 
CLogOutgoingAppView* iAppView;
CLogClient* iClient;
CLogEvent* iEvent;
CLogEvent* iLogEvent;
TBool iFlag;
CLogViewEvent* iLogViewEvent;
CLogFilter* iLogFilter;
RFs iFs;
};

LogOutgoingAppUi.cpp

  #include <avkon.hrh>
#include <aknnotewrappers.h>
#include "logoutgoing.pan"
#include "logoutgoingappui.h"
#include "logoutgoingappview.h"
#include "logoutgoing.hrh"
 
 
void CLogOutgoingAppUi::ConstructL()
{
BaseConstructL();
iAppView = CLogOutgoingAppView::NewL( ClientRect() );
iFlag = EFalse;
iFs.Connect();
iClient = CLogClient::NewL( iFs, CActive::EPriorityHigh );
iLogEvent = CLogEvent::NewL();
iLogViewEvent = CLogViewEvent::NewL( *iClient, *this );
iLogFilter = CLogFilter::NewL();
iLogFilter->SetEventType( KLogCallEventTypeUid );
iLogViewEvent->SetFilterL( *iLogFilter, iStatus );
SetActive();
AddToStackL( iAppView );
}
 
 
CLogOutgoingAppUi::CLogOutgoingAppUi()
: CActive( EPriorityStandard )
{
CActiveScheduler::Add( this );
}
 
 
CLogOutgoingAppUi::~CLogOutgoingAppUi()
{
if ( iAppView )
{
RemoveFromStack( iAppView );
delete iAppView;
}
}
 
 
// Menu command handling
void CLogOutgoingAppUi::HandleCommandL( TInt aCommand )
{
switch ( aCommand )
{
case EEikCmdExit:
case EAknSoftkeyExit:
Exit();
break;
case ELogOutgoingCommand1:
{
_LIT( message, "Hello!" );
CAknInformationNote* informationNote = new ( ELeave ) CAknInformationNote;
informationNote->ExecuteLD( message );
}
break;
default:
Panic( ELogOutgoingBasicUi );
break;
}
}
 
 
// CActive::RunL implementation
void CLogOutgoingAppUi::RunL()
{
if ( iStatus == KErrNone )
{
if ( iFlag )
{
iFlag = EFalse;
TBuf<128> callNameBuf = iLogEvent->Number();
CEikonEnv::InfoWinL( callNameBuf, _L( "Number" ) );
callNameBuf.Copy( iLogEvent->RemoteParty() );
CEikonEnv::InfoWinL( callNameBuf, _L( "Remote party" ) );
callNameBuf.Copy( iLogEvent->Description() );
CEikonEnv::InfoWinL( callNameBuf, _L( "Description" ) );
callNameBuf.Copy( iLogEvent->Data() );
CEikonEnv::InfoWinL( callNameBuf, _L( "Data" ) );
}
else
{
iStatus = KRequestPending;
}
}
else
{
// Handle errors
}
}
 
void CLogOutgoingAppUi::DoCancel()
{
}
 
void CLogOutgoingAppUi::HandleLogViewChangeEventAddedL(TLogId aId,
TInt /*aViewIndex*/, TInt /*aChangeIndex*/, TInt /*aTotalChangeCount*/)
{
iLogEvent->SetId(aId);
iFlag=ETrue;
iClient->GetEvent(*iLogEvent,iStatus);
SetActive();
}
 
void CLogOutgoingAppUi::HandleLogViewChangeEventChangedL(TLogId /*aId*/,
TInt /*aViewIndex*/, TInt /*aChangeIndex*/, TInt /*aTotalChangeCount*/)
{
}
 
void CLogOutgoingAppUi::HandleLogViewChangeEventDeletedL(TLogId /*aId*/,
TInt /*aViewIndex*/, TInt /*aChangeIndex*/, TInt /*aTotalChangeCount*/)
{
}
 
void CLogOutgoingAppUi::HandleLogClientChangeEventL(TUid /*aChangeType*/,
TInt /*aChangeParam1*/, TInt /*aChangeParam2*/, TInt /*aChangeParam3*/)
{
}

This page was last modified on 15 June 2012, at 00:50.
29 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×