os/persistentdata/loggingservices/eventlogger/LogCli/inc/LogViewWindowFetcher.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/loggingservices/eventlogger/LogCli/inc/LogViewWindowFetcher.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,113 @@
     1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __LOGVIEWWINDOWFETCHER_H__
    1.20 +#define __LOGVIEWWINDOWFETCHER_H__
    1.21 +
    1.22 +// System includes
    1.23 +#include <e32base.h>
    1.24 +
    1.25 +// User includes
    1.26 +#include <logwrap.h>
    1.27 +#include "LogCliServShared.h"
    1.28 +#include <logviewchangeobserver.h>
    1.29 +
    1.30 +// Classes referenced
    1.31 +class RLogSession;
    1.32 +
    1.33 +
    1.34 +/////////////////////////////////////////////////////////////////////////////////////////
    1.35 +// -----> MLogViewWindowFetcherObserver (header)
    1.36 +/////////////////////////////////////////////////////////////////////////////////////////
    1.37 +class MLogViewWindowFetcherObserver
    1.38 +/**
    1.39 +@internalComponent
    1.40 +*/
    1.41 +	{
    1.42 +public:
    1.43 +	virtual void HandleFetchedWindowItemL(TInt aItemIndex, CLogEvent* aEvent) = 0;
    1.44 +	};
    1.45 +
    1.46 +
    1.47 +/////////////////////////////////////////////////////////////////////////////////////////
    1.48 +// -----> CLogViewWindowFetcher (header)
    1.49 +/////////////////////////////////////////////////////////////////////////////////////////
    1.50 +NONSHARABLE_CLASS(CLogViewWindowFetcher) : public CActive
    1.51 +/**
    1.52 +@internalComponent
    1.53 +*/
    1.54 +	{
    1.55 +public:
    1.56 +	CLogViewWindowFetcher(RLogSession& aSession, TLogViewId aViewId, MLogViewWindowFetcherObserver& aObserver, TInt aPriority);
    1.57 +	~CLogViewWindowFetcher();
    1.58 +	void ConstructL();
    1.59 +
    1.60 +public:
    1.61 +
    1.62 +	/**
    1.63 +	 * Fetch the specified window.
    1.64 +	 */
    1.65 +	void PrepareToFetchWindowL(const TLogWindowAndCursor& aRequestedWindow);
    1.66 +
    1.67 +	/**
    1.68 +	 * Start the asynchronous fetch
    1.69 +	 */
    1.70 +	void Start(TRequestStatus& aObserver);
    1.71 +
    1.72 +	/**
    1.73 +	 * Cancel any fetch operation but without notifying the observer
    1.74 +	 */
    1.75 +	void SilentCancel();
    1.76 +
    1.77 +	/**
    1.78 +	 * Access the window & cursor for the requested window
    1.79 +	 */
    1.80 +	inline const TLogWindowAndCursor& RequestedWindow() const;
    1.81 +
    1.82 +private:
    1.83 +	void Fetch(const TLogWindow& aWindow);
    1.84 +	void CompleteObserver(TInt aError);
    1.85 +
    1.86 +private: // FROM CActive
    1.87 +	void RunL();
    1.88 +	void DoCancel();
    1.89 +	TInt RunError(TInt aError);
    1.90 +
    1.91 +private:
    1.92 +	RLogSession& iSession;
    1.93 +	const TLogViewId iViewId;
    1.94 +	MLogViewWindowFetcherObserver& iObserver;
    1.95 +
    1.96 +private:
    1.97 +	TLogWindowAndCursor iRequestedWindow;
    1.98 +	//
    1.99 +	TRequestStatus* iObserverRequestStatus;
   1.100 +	CBufBase* iBuffer;
   1.101 +	TPtr8 iBufferPointer;
   1.102 +	TPckgBuf<TLogTransferWindow> iFetchWindowData;
   1.103 +	TPckgBuf<TLogClientServerData> iData;
   1.104 +	TLogWindowAndCursor iWindowReq;
   1.105 +	};
   1.106 +
   1.107 +
   1.108 +/////////////////////////////////////////////////////////////////////////////////////////
   1.109 +// -----> CLogViewWindowFetcher (inline)
   1.110 +/////////////////////////////////////////////////////////////////////////////////////////
   1.111 +inline const TLogWindowAndCursor& CLogViewWindowFetcher::RequestedWindow() const
   1.112 +	{
   1.113 +	return iRequestedWindow;
   1.114 +	}
   1.115 +
   1.116 +#endif