pimprotocols/pbap/inc/pbaplogeng.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef PBAPLOGENG_H
       
    17 #define PBAPLOGENG_H
       
    18 
       
    19 #include <logwrap.h>
       
    20 #include <logview.h>
       
    21 
       
    22 #include <logviewchangeobserver.h>
       
    23 #include <logclientchangeobserver.h>
       
    24 
       
    25 #include "pbaplogengviewobserver.h"
       
    26 
       
    27 /** 
       
    28  The PBAP Log Client wrapper.
       
    29 
       
    30  This class allows localisation of call logging for benefit of different UI variants.
       
    31  */
       
    32 NONSHARABLE_CLASS (CPbapLogWrapper) : public CBase, public MLogClientChangeObserver
       
    33 	{
       
    34 	// to allow access to LogClient() and Global LogEng events.
       
    35 	friend class CPbapLogViewEvent;
       
    36 	
       
    37 public:
       
    38 	IMPORT_C static CPbapLogWrapper* NewL(RFs& aFs);
       
    39 	IMPORT_C ~CPbapLogWrapper();
       
    40 
       
    41 	// From CLogWrapper
       
    42 	IMPORT_C TBool ClientAvailable() const;
       
    43 	
       
    44 	// From CLogClient
       
    45 	IMPORT_C TInt GetString(TDes &aString, TInt aId) const;	
       
    46 	
       
    47 protected:	
       
    48 	// Only for creation of CLogViewEvent
       
    49 	CLogClient& LogClient();
       
    50 	
       
    51 	// Register PBAP observer for MLogClientChangeObserver events
       
    52 	TInt AddPbapObserver(MPbapLogEngViewObserver& aObserver);
       
    53 	void RemovePbapObserver(MPbapLogEngViewObserver& aObserver);
       
    54 	
       
    55 private:
       
    56 	CPbapLogWrapper();
       
    57 	void ConstructL(RFs& aFs);
       
    58 
       
    59 	// from MLogClientChangeObserver
       
    60 	virtual void HandleLogClientChangeEventL(TUid aChangeType, TInt aParam1, TInt aParam2, TInt aParam3);
       
    61 
       
    62 private:
       
    63 	CLogWrapper*	iLogWrapper;
       
    64 	CLogClient*		iLogClient; //not owned
       
    65 	
       
    66 	RPointerArray<MPbapLogEngViewObserver> iPbapObservers;
       
    67 	};
       
    68 
       
    69 
       
    70 /** 
       
    71  The PBAP Log Event View wrapper.
       
    72 
       
    73  This class allows localisation of call logging for benefit of different UI variants.
       
    74  */
       
    75 NONSHARABLE_CLASS (CPbapLogViewEvent) : public CBase, public MLogViewChangeObserver
       
    76 	{
       
    77 public:
       
    78 	IMPORT_C static CPbapLogViewEvent* NewL(CPbapLogWrapper& aLogWrap);
       
    79 	IMPORT_C static CPbapLogViewEvent* NewL(CPbapLogWrapper& aLogWrap, MPbapLogEngViewObserver& aObserver);
       
    80 	IMPORT_C ~CPbapLogViewEvent();
       
    81 	
       
    82 public:
       
    83 	// from CLogViewEvent
       
    84 	IMPORT_C TBool SetFilterL(const CLogFilterList& aFilterList, TRequestStatus& aStatus);
       
    85 	IMPORT_C TBool SetFilterL(const CLogFilter& aFilter, TRequestStatus& aStatus);
       
    86 	
       
    87 	IMPORT_C const CLogEvent& Event() const;
       
    88 	IMPORT_C TBool FirstL(TRequestStatus& aStatus);
       
    89 	IMPORT_C TBool NextL(TRequestStatus& aStatus);
       
    90 	IMPORT_C TInt CountL();
       
    91 
       
    92 	IMPORT_C void Cancel();
       
    93 
       
    94 private:
       
    95 	CPbapLogViewEvent(CPbapLogWrapper& aClient);
       
    96 	void ConstructL(MPbapLogEngViewObserver* aObserver = NULL);
       
    97 
       
    98 	// from MLogViewChangeObserver
       
    99 	virtual void HandleLogViewChangeEventAddedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount);
       
   100 	virtual void HandleLogViewChangeEventChangedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount);
       
   101 	virtual void HandleLogViewChangeEventDeletedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount);
       
   102 
       
   103 private:
       
   104 	CPbapLogWrapper& 	iWrapper;
       
   105 	CLogViewEvent*		iViewEvent;		
       
   106 
       
   107 	MPbapLogEngViewObserver* iPbapObserver;
       
   108 	};
       
   109 
       
   110 #endif // PBAPLOGENG_H