diff -r 0ff24a8f6ca2 -r 98307c651589 piprofiler/engine/inc/SamplerController.h --- a/piprofiler/engine/inc/SamplerController.h Fri Aug 27 11:37:29 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __SAMPLERCONTROLLER_H__ -#define __SAMPLERCONTROLLER_H__ - -// system includes -#include -#include - - -// The user-interface to the sampling device driver sued by the profiling engine -// user includes -#include -#include -#include - -#include "SamplerPluginLoader.h" - -/* - * Forward declarations - */ -class TBapBuf; -class CProfilerSampleStream; -class CSamplerPluginLoader; -class CSamplerPluginInterface; -class MSamplerControllerObserver; -/** - * The sampler controller for handling the actual sampler plugins. - */ - -class CSamplerController : public CBase, MSamplerPluginLoadObserver - { - -public: - static CSamplerController* NewL(CProfilerSampleStream& aStream); - void ConstructL(); - - CSamplerController(CProfilerSampleStream& aStream); - ~CSamplerController(); - - /** - * - * Methods for user mode sampling - * - **/ - - /** Initialise the user mode samplers **/ - void InitialiseSamplerListL(); - - /* Overrider of MSamplerPluginLoaderObserver class **/ - void HandlePluginLoaded( KSamplerPluginLoaderStatus aStatus ); - - /* returns the name matching plugin Uid */ - TUid GetPluginUID(TDesC8& name); - - /** Start enabled samplers **/ - void StartSamplerPluginsL(); - - /** Stop enabled samplers **/ - TInt StopSamplerPlugins(); - -public: - - CSamplerPluginInterface* GetPlugin(TUid aUid); - - TInt GetPluginList(TDes* aList); - - TInt SetSamplerSettingsL(TInt aUid, TSamplerAttributes aAttributes); - - void GetSamplerAttributesL(CArrayFixFlat* aAttributes); - - TInt UpdateSavedSamplerAttributesL(CDesC8ArrayFlat* aSavedLineArray, CArrayFixFlat* aAttributes); - - /* - * Compose all sampler (sampler or sub-sampler) attributes as text array for saving to settings file, - * called by CSamplerController (and Profiler Engine) - * - * @param aFile settings file where to write the settings - */ - void ComposeAttributesToSettingsFileFormat(RFile& aFile, CArrayFixFlat* aAttributes); - - /* - * Compose all sampler (sampler or sub-sampler) attributes as text array for saving to settings file, - * called by CSamplerController (and Profiler Engine) - * - * @param aFile settings file where to write the settings - * @param aAttrArray is container for saving the text to - */ - void ComposeSettingsText(RFile& aFile, CArrayFixFlat* aAttrArray); - - void SetObserver(MSamplerControllerObserver* aObserver); - - void Str2Bool(const TDesC8& aBuf, TBool& aValue); - - void Str2Int(const TDesC8& aBuf, TInt& aValue); - - void Str2Int(const TDesC8& aBuf, TUint32& aValue); - - TBuf8<16> Bool2Str(const TBool& aValue); - - TBuf8<16> Int2Str(const TInt& aValue); -public: - - CArrayPtrFlat* iPluginArray; - - // Asynchronous loader for the sampler plug-ins. - CSamplerPluginLoader* iPluginLoader; - - // UID of the selected plugin in the container's lbx. - TUid iSelectedPluginUid; - - // shared sample stream for all plugin samplers - CProfilerSampleStream& iStream; - -private: - MSamplerControllerObserver* iObserver; -}; - -/** -* Interface for SamplerPluginLoader observer. MSamplerPluginLoadObserver gets -* notifications when plugins are loaded. -* -* @lib ProfilerEngine.exe/.lib -* @since Series60_30.1 -*/ - -class MSamplerControllerObserver - { - public: // New - - //CSamplerController calls this function when each plug-in is loaded or - //loading is finished.. - - virtual void HandleSamplerControllerReadyL() = 0; - virtual void HandleError(TInt aError) = 0; - }; - -#endif // __SAMPLERCONTROLLER_H__