|
1 // Copyright (c) 1997-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #if !defined(__APFREC_H__) |
|
17 #define __APFREC_H__ |
|
18 |
|
19 #if !defined(__APADEF_H__) |
|
20 #include <apadef.h> |
|
21 #endif |
|
22 #if !defined(__APAFLREC_H__) |
|
23 #include <apaflrec.h> |
|
24 #endif |
|
25 |
|
26 #include <babackup.h> |
|
27 |
|
28 // classes defined: |
|
29 class CApaScanningFileRecognizer; |
|
30 |
|
31 // |
|
32 // classes referenced: |
|
33 class CApaAppFinder; |
|
34 class TApaAppEntry; |
|
35 class TEntry; |
|
36 class RFs; |
|
37 class TDriveUnit; |
|
38 // |
|
39 |
|
40 // dir in which app recognizers should live - this dir is scanned on all drives |
|
41 |
|
42 /** |
|
43 @internalTechnology |
|
44 */ |
|
45 _LIT(KAppRecognizerSearchPath,"\\System\\Recogs\\"); |
|
46 |
|
47 /** |
|
48 @internalComponent |
|
49 */ |
|
50 _LIT(KAppRecognizerSearchString,"?:\\System\\Recogs\\"); |
|
51 |
|
52 /** |
|
53 @internalComponent |
|
54 */ |
|
55 _LIT(KAppRecognizerSearchAnyFile,"*"); |
|
56 |
|
57 /** |
|
58 @internalComponent |
|
59 */ |
|
60 const TUid KUidFileRecogInterfaceUid={0x101F7D86}; |
|
61 |
|
62 class CApaRecognizerDll; // private class |
|
63 |
|
64 /** Constructs a recognizer type |
|
65 |
|
66 @publishedPartner |
|
67 @released |
|
68 */ |
|
69 typedef CApaFileRecognizerType* (*CreateCApaFileRecognizerType)(); |
|
70 |
|
71 class CApaScanningFileRecognizer : public CApaFileRecognizer |
|
72 /** |
|
73 @internalComponent |
|
74 @deprecated |
|
75 */ |
|
76 { |
|
77 public: |
|
78 class TRecognizer |
|
79 { |
|
80 friend class CApaRecognizerDll; |
|
81 friend class CT_File1Step; |
|
82 public: |
|
83 TRecognizer(HBufC* aName); |
|
84 inline const TDesC& Name() const; |
|
85 public: |
|
86 //lint --e{1925} suppress "public data member" |
|
87 TUid iUid; |
|
88 TInt iDrive; |
|
89 private: |
|
90 inline TRecognizer(); |
|
91 TRecognizer(const TRecognizer&); |
|
92 TRecognizer& operator=(const TRecognizer&); |
|
93 private: |
|
94 HBufC* iName; |
|
95 }; |
|
96 typedef CArrayFixFlat<TRecognizer> CRecognizerArray; |
|
97 // |
|
98 private: |
|
99 class CApaBackupOperationObserver : public CBase, public MBackupOperationObserver |
|
100 { |
|
101 public: |
|
102 CApaBackupOperationObserver(CApaScanningFileRecognizer& aRecognizer); |
|
103 ~CApaBackupOperationObserver(); |
|
104 void RegisterObserverL(); |
|
105 |
|
106 virtual void HandleBackupOperationEventL(const TBackupOperationAttributes& aBackupOperationAttributes); |
|
107 TInt UpdateCounter() const; |
|
108 void SetUpdateCounter( TInt aValue ); |
|
109 private: |
|
110 CBaBackupSessionWrapper* iSession; |
|
111 CApaScanningFileRecognizer& iRecognizer; |
|
112 TInt iUpdateCounter; |
|
113 }; |
|
114 friend class CApaScanningFileRecognizer::CApaBackupOperationObserver; |
|
115 public: |
|
116 IMPORT_C static CApaScanningFileRecognizer* NewL(RFs& aFs,MApaAppStarter* aAppStarter); |
|
117 IMPORT_C ~CApaScanningFileRecognizer(); |
|
118 IMPORT_C void ScanForRecognizersL(); |
|
119 IMPORT_C TInt RecognizerCount(); |
|
120 IMPORT_C CRecognizerArray* RecognizerListLC()const; |
|
121 IMPORT_C const TRecognizer& operator[](TInt aIndex)const; |
|
122 IMPORT_C TInt UpdateCounter()const; |
|
123 |
|
124 protected: |
|
125 IMPORT_C CApaScanningFileRecognizer(RFs& aFs,MApaAppStarter* aAppStarter); |
|
126 IMPORT_C void ConstructL(); |
|
127 // |
|
128 private: |
|
129 void ScanDriveL(TInt aDriveNum); |
|
130 void LoadRecognizerL(const TDesC& aFullName,TUid aUid); |
|
131 TInt RemoveRecognizer(CApaRecognizerDll& aDll); |
|
132 void LoadEcomRecognizerL(TDriveUnit& aDrive,TUid aUid); |
|
133 void ScanForEcomRecognizersL(); |
|
134 public: |
|
135 IMPORT_C void SetEcomRecognizersFromListL(const CRecognizerArray& aList); |
|
136 IMPORT_C void SetEcomRecognizerL(const TRecognizer& aRecognizer); |
|
137 private: |
|
138 CApaRecognizerDll* iRecognizerLib; |
|
139 MApaAppStarter* iAppStarter; |
|
140 CApaBackupOperationObserver* iObserver; |
|
141 }; |
|
142 |
|
143 inline const TDesC& CApaScanningFileRecognizer::TRecognizer::Name() const |
|
144 { |
|
145 return *iName; |
|
146 } |
|
147 |
|
148 inline CApaScanningFileRecognizer::TRecognizer::TRecognizer() |
|
149 { |
|
150 } |
|
151 |
|
152 #endif |