epoc32/include/apfrec.h
branchSymbian2
changeset 2 2fe1408b6811
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/apfrec.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,152 @@
     1.4 +// Copyright (c) 1997-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 +#if !defined(__APFREC_H__)
    1.20 +#define __APFREC_H__
    1.21 +
    1.22 +#if !defined(__APADEF_H__)
    1.23 +#include <apadef.h>
    1.24 +#endif
    1.25 +#if !defined(__APAFLREC_H__)
    1.26 +#include <apaflrec.h>
    1.27 +#endif
    1.28 +
    1.29 +#include <babackup.h>
    1.30 +
    1.31 +// classes defined:
    1.32 +class CApaScanningFileRecognizer;
    1.33 +
    1.34 +//
    1.35 +// classes referenced:
    1.36 +class CApaAppFinder;
    1.37 +class TApaAppEntry;
    1.38 +class TEntry;
    1.39 +class RFs;
    1.40 +class TDriveUnit;
    1.41 +//
    1.42 +
    1.43 +// dir in which app recognizers should live - this dir is scanned on all drives
    1.44 +
    1.45 +/**
    1.46 +@internalTechnology
    1.47 +*/
    1.48 +_LIT(KAppRecognizerSearchPath,"\\System\\Recogs\\");
    1.49 +
    1.50 +/**
    1.51 +@internalComponent
    1.52 +*/
    1.53 +_LIT(KAppRecognizerSearchString,"?:\\System\\Recogs\\");
    1.54 +
    1.55 +/**
    1.56 +@internalComponent
    1.57 +*/
    1.58 +_LIT(KAppRecognizerSearchAnyFile,"*");
    1.59 +
    1.60 +/**
    1.61 +@internalComponent
    1.62 +*/
    1.63 +const TUid KUidFileRecogInterfaceUid={0x101F7D86};
    1.64 +
    1.65 +class CApaRecognizerDll; // private class
    1.66 +
    1.67 +/** Constructs a recognizer type 
    1.68 +
    1.69 +@publishedPartner
    1.70 +@released
    1.71 +*/
    1.72 +typedef CApaFileRecognizerType* (*CreateCApaFileRecognizerType)();
    1.73 +
    1.74 +class CApaScanningFileRecognizer : public CApaFileRecognizer
    1.75 +/**
    1.76 +@internalComponent
    1.77 +@deprecated
    1.78 +*/
    1.79 +	{
    1.80 +public:
    1.81 +	class TRecognizer
    1.82 +		{
    1.83 +	friend class CApaRecognizerDll;
    1.84 +	friend class CT_File1Step;
    1.85 +	public:
    1.86 +		TRecognizer(HBufC* aName);
    1.87 +		inline const TDesC& Name() const;
    1.88 +	public:
    1.89 +		//lint --e{1925} suppress "public data member" 
    1.90 +		TUid iUid;
    1.91 +		TInt iDrive;
    1.92 +	private:
    1.93 +		inline TRecognizer();
    1.94 +		TRecognizer(const TRecognizer&);
    1.95 +		TRecognizer& operator=(const TRecognizer&);
    1.96 +	private:
    1.97 +		HBufC* iName;
    1.98 +		};
    1.99 +	typedef CArrayFixFlat<TRecognizer> CRecognizerArray;
   1.100 +	//
   1.101 +private:
   1.102 +	class CApaBackupOperationObserver : public CBase, public MBackupOperationObserver
   1.103 +		{
   1.104 +	public:
   1.105 +		CApaBackupOperationObserver(CApaScanningFileRecognizer& aRecognizer);
   1.106 +		~CApaBackupOperationObserver();
   1.107 +		void RegisterObserverL();
   1.108 +
   1.109 +		virtual void HandleBackupOperationEventL(const TBackupOperationAttributes& aBackupOperationAttributes);
   1.110 +		TInt UpdateCounter() const;
   1.111 +		void SetUpdateCounter( TInt aValue );
   1.112 +	private:
   1.113 +		CBaBackupSessionWrapper* iSession;
   1.114 +		CApaScanningFileRecognizer& iRecognizer;
   1.115 +		TInt iUpdateCounter;
   1.116 +		};
   1.117 +	friend class CApaScanningFileRecognizer::CApaBackupOperationObserver;
   1.118 +public:
   1.119 +	IMPORT_C static CApaScanningFileRecognizer* NewL(RFs& aFs,MApaAppStarter* aAppStarter);
   1.120 +	IMPORT_C ~CApaScanningFileRecognizer();
   1.121 +	IMPORT_C void ScanForRecognizersL();
   1.122 +	IMPORT_C TInt RecognizerCount();
   1.123 +	IMPORT_C CRecognizerArray* RecognizerListLC()const;
   1.124 +	IMPORT_C const TRecognizer& operator[](TInt aIndex)const; 
   1.125 +	IMPORT_C TInt UpdateCounter()const;
   1.126 +
   1.127 +protected:
   1.128 +	IMPORT_C CApaScanningFileRecognizer(RFs& aFs,MApaAppStarter* aAppStarter);
   1.129 +	IMPORT_C void ConstructL();
   1.130 +	//
   1.131 +private:
   1.132 +	void ScanDriveL(TInt aDriveNum);
   1.133 +	void LoadRecognizerL(const TDesC& aFullName,TUid aUid);
   1.134 +	TInt RemoveRecognizer(CApaRecognizerDll& aDll);
   1.135 +	void LoadEcomRecognizerL(TDriveUnit& aDrive,TUid aUid);
   1.136 +	void ScanForEcomRecognizersL();
   1.137 +public:
   1.138 +	IMPORT_C void SetEcomRecognizersFromListL(const CRecognizerArray& aList);
   1.139 +	IMPORT_C void SetEcomRecognizerL(const TRecognizer& aRecognizer); 
   1.140 +private:
   1.141 +	CApaRecognizerDll* iRecognizerLib;
   1.142 +	MApaAppStarter* iAppStarter;
   1.143 +	CApaBackupOperationObserver* iObserver;
   1.144 +	};
   1.145 +
   1.146 +inline const TDesC& CApaScanningFileRecognizer::TRecognizer::Name() const
   1.147 +	{
   1.148 +	return *iName;	
   1.149 +	}
   1.150 +
   1.151 +inline CApaScanningFileRecognizer::TRecognizer::TRecognizer()
   1.152 +	{
   1.153 +	}
   1.154 +
   1.155 +#endif