os/persistentdata/loggingservices/eventlogger/LogCli/inc/LogViewWindowFetcher.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2002-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 __LOGVIEWWINDOWFETCHER_H__
    17 #define __LOGVIEWWINDOWFETCHER_H__
    18 
    19 // System includes
    20 #include <e32base.h>
    21 
    22 // User includes
    23 #include <logwrap.h>
    24 #include "LogCliServShared.h"
    25 #include <logviewchangeobserver.h>
    26 
    27 // Classes referenced
    28 class RLogSession;
    29 
    30 
    31 /////////////////////////////////////////////////////////////////////////////////////////
    32 // -----> MLogViewWindowFetcherObserver (header)
    33 /////////////////////////////////////////////////////////////////////////////////////////
    34 class MLogViewWindowFetcherObserver
    35 /**
    36 @internalComponent
    37 */
    38 	{
    39 public:
    40 	virtual void HandleFetchedWindowItemL(TInt aItemIndex, CLogEvent* aEvent) = 0;
    41 	};
    42 
    43 
    44 /////////////////////////////////////////////////////////////////////////////////////////
    45 // -----> CLogViewWindowFetcher (header)
    46 /////////////////////////////////////////////////////////////////////////////////////////
    47 NONSHARABLE_CLASS(CLogViewWindowFetcher) : public CActive
    48 /**
    49 @internalComponent
    50 */
    51 	{
    52 public:
    53 	CLogViewWindowFetcher(RLogSession& aSession, TLogViewId aViewId, MLogViewWindowFetcherObserver& aObserver, TInt aPriority);
    54 	~CLogViewWindowFetcher();
    55 	void ConstructL();
    56 
    57 public:
    58 
    59 	/**
    60 	 * Fetch the specified window.
    61 	 */
    62 	void PrepareToFetchWindowL(const TLogWindowAndCursor& aRequestedWindow);
    63 
    64 	/**
    65 	 * Start the asynchronous fetch
    66 	 */
    67 	void Start(TRequestStatus& aObserver);
    68 
    69 	/**
    70 	 * Cancel any fetch operation but without notifying the observer
    71 	 */
    72 	void SilentCancel();
    73 
    74 	/**
    75 	 * Access the window & cursor for the requested window
    76 	 */
    77 	inline const TLogWindowAndCursor& RequestedWindow() const;
    78 
    79 private:
    80 	void Fetch(const TLogWindow& aWindow);
    81 	void CompleteObserver(TInt aError);
    82 
    83 private: // FROM CActive
    84 	void RunL();
    85 	void DoCancel();
    86 	TInt RunError(TInt aError);
    87 
    88 private:
    89 	RLogSession& iSession;
    90 	const TLogViewId iViewId;
    91 	MLogViewWindowFetcherObserver& iObserver;
    92 
    93 private:
    94 	TLogWindowAndCursor iRequestedWindow;
    95 	//
    96 	TRequestStatus* iObserverRequestStatus;
    97 	CBufBase* iBuffer;
    98 	TPtr8 iBufferPointer;
    99 	TPckgBuf<TLogTransferWindow> iFetchWindowData;
   100 	TPckgBuf<TLogClientServerData> iData;
   101 	TLogWindowAndCursor iWindowReq;
   102 	};
   103 
   104 
   105 /////////////////////////////////////////////////////////////////////////////////////////
   106 // -----> CLogViewWindowFetcher (inline)
   107 /////////////////////////////////////////////////////////////////////////////////////////
   108 inline const TLogWindowAndCursor& CLogViewWindowFetcher::RequestedWindow() const
   109 	{
   110 	return iRequestedWindow;
   111 	}
   112 
   113 #endif