|
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 "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 // AppArc recognizer and application scanning |
|
15 // |
|
16 // |
|
17 |
|
18 #if !defined(__APSSCAN_H__) |
|
19 #define __APSSCAN_H__ |
|
20 |
|
21 #if !defined(__F32FILE_H__) |
|
22 #include <f32file.h> |
|
23 #endif |
|
24 |
|
25 //This class is not moved as part of PREQ2478,as the derived class is a published Partner. |
|
26 //Also this class doesn't expose any specific functionality.. |
|
27 |
|
28 class MApaFsChangeObserver |
|
29 /** An interface for notifying a file system observer when |
|
30 a change has been made to the file system. |
|
31 This interface is intended for use only by CApaFsMonitor. |
|
32 |
|
33 @internalComponent |
|
34 */ |
|
35 { |
|
36 public: |
|
37 virtual void FsChanged()=0; |
|
38 }; |
|
39 |
|
40 class CApaFsMonitor : public CBase, MApaFsChangeObserver |
|
41 /** Monitors changes in the file system. |
|
42 |
|
43 If a change is detected, the callback function supplied by the user of the class |
|
44 is called after a 0.25 second delay. If there are further changes, the callback |
|
45 is not called again until 3 seconds have elapsed. It uses RFs::NotifyChange() |
|
46 to request notifications. |
|
47 |
|
48 @see RFs::NotifyChange() |
|
49 |
|
50 @publishedPartner |
|
51 @released */ |
|
52 { |
|
53 public: |
|
54 IMPORT_C ~CApaFsMonitor(); |
|
55 IMPORT_C static CApaFsMonitor* NewL(RFs& aFs, const TDesC& aLocation, TCallBack aCallBack); |
|
56 IMPORT_C void SetBlocked(TBool aIsBlocked); |
|
57 IMPORT_C void Start(TNotifyType aNotifyType); |
|
58 IMPORT_C TNotifyType NotifyType() const; |
|
59 IMPORT_C void AddLocationL(const TDesC& aLocation); |
|
60 IMPORT_C void Cancel(); |
|
61 TBool AnyNotificationImpending() const; |
|
62 private: |
|
63 |
|
64 CApaFsMonitor(RFs& aFs, TCallBack aCallBack); |
|
65 static TInt TimerCallBack(TAny* aObject); |
|
66 void DoStart(); |
|
67 |
|
68 // from MApaFsChangeObserver |
|
69 void FsChanged(); |
|
70 class CApaFsNotifier; |
|
71 private: |
|
72 RFs& iFs; |
|
73 TNotifyType iNotifyType; |
|
74 TCallBack iCallBack; |
|
75 CPeriodic* iFsTimer; |
|
76 TBool iFsHasChanged; |
|
77 TBool iIsBlocked; |
|
78 RPointerArray<CApaFsNotifier> iNotifiers; |
|
79 }; |
|
80 |
|
81 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
82 #if !defined(__WINC__) |
|
83 class REComSession; |
|
84 /** |
|
85 CApaEComMonitor |
|
86 |
|
87 A low priority (EPriorityIdle) active object which monitors changes |
|
88 in the Ecom plugin. |
|
89 |
|
90 @see REComSession::NotifyOnChange() |
|
91 |
|
92 @internalAll |
|
93 */ |
|
94 |
|
95 class CApaEComMonitor : public CActive |
|
96 { |
|
97 public: |
|
98 ~CApaEComMonitor(); |
|
99 static CApaEComMonitor* NewL(TCallBack aCallBack); |
|
100 void Start(); |
|
101 private: |
|
102 CApaEComMonitor(TCallBack aCallBack); |
|
103 void ConstructL (); |
|
104 static TInt TimerCallBack(TAny* aObject); |
|
105 void DoStart(); |
|
106 void DoCancel(); |
|
107 void RunL(); |
|
108 private: |
|
109 TCallBack iCallBack; |
|
110 CPeriodic* iEComTimer; |
|
111 REComSession* iEComSession; |
|
112 TBool iEComHasChanged; |
|
113 }; |
|
114 |
|
115 #endif |
|
116 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS |
|
117 |
|
118 #endif |