|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Monitors File system for Format events |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CTMFORMATOBSERVER_H |
|
20 #define CTMFORMATOBSERVER_H |
|
21 |
|
22 #include <babackup.h> |
|
23 #include "f32file.h" |
|
24 |
|
25 |
|
26 /** |
|
27 * Observer interface |
|
28 */ |
|
29 class MTMFormatObserver |
|
30 { |
|
31 public: |
|
32 |
|
33 virtual void FormatNotification( TBool aFormat ) = 0; |
|
34 }; |
|
35 |
|
36 /** |
|
37 * File System monitor class to monitor for format events |
|
38 * |
|
39 * @lib thumbnailsserver.exe |
|
40 * @since S60 3.0 |
|
41 */ |
|
42 class CTMFormatObserver: public CBase, |
|
43 public MBackupOperationObserver |
|
44 { |
|
45 |
|
46 public: |
|
47 |
|
48 /** |
|
49 * Two-phase constructor |
|
50 * @param aObserver observer to the monitor |
|
51 */ |
|
52 static CTMFormatObserver* NewL( MTMFormatObserver& aObserver ); |
|
53 |
|
54 /** |
|
55 * Two-phase constructor |
|
56 * @param aObserver observer to the monitor |
|
57 */ |
|
58 static CTMFormatObserver* NewLC( MTMFormatObserver& aObserver ); |
|
59 |
|
60 /** |
|
61 * Destructor |
|
62 */ |
|
63 virtual ~CTMFormatObserver(); |
|
64 |
|
65 public: // New functions |
|
66 |
|
67 /** |
|
68 * Polls for the current monitor status |
|
69 * If an event is happening, it will callback the observer of the event |
|
70 */ |
|
71 void PollStatus(); |
|
72 |
|
73 protected: // Base Class |
|
74 |
|
75 /* |
|
76 * From MBackupOperationObserver |
|
77 * Notifies this class of the backup event. |
|
78 * MMC App will signal a start / end. |
|
79 */ |
|
80 void HandleBackupOperationEventL(const TBackupOperationAttributes& aBackupOperationAttributes); |
|
81 |
|
82 private: |
|
83 |
|
84 /** |
|
85 * C++ constructor |
|
86 * aObserver observer to this event |
|
87 */ |
|
88 CTMFormatObserver ( MTMFormatObserver& aObserver ); |
|
89 |
|
90 /* |
|
91 * Second phased constructor |
|
92 */ |
|
93 void ConstructL(); |
|
94 |
|
95 private: // data |
|
96 |
|
97 // not own |
|
98 MTMFormatObserver& iObserver; |
|
99 |
|
100 CBaBackupSessionWrapper* iBackupSession; |
|
101 |
|
102 }; |
|
103 |
|
104 #endif // CTMFORMATOBSERVER_H |