|
1 // Copyright (c) 1999-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 // |
|
15 |
|
16 #if !defined(__DISKCHANGE_H__) |
|
17 #define __DISKCHANGE_H__ |
|
18 |
|
19 #if !defined(__F32FILE_H__) |
|
20 #include <f32file.h> |
|
21 #endif |
|
22 |
|
23 #if !defined (__MENTACT_H__) |
|
24 #include <mentact.h> |
|
25 #endif |
|
26 |
|
27 //********************************** |
|
28 // MMsvDiskChangeObserver |
|
29 //********************************** |
|
30 |
|
31 class MMsvDiskChangeObserver |
|
32 /** |
|
33 @internalComponent |
|
34 @released |
|
35 */ |
|
36 { |
|
37 public: |
|
38 virtual TBool DiskRemoved(const TDriveUnit& aDrive)=0; |
|
39 virtual TBool DiskInserted(const TDriveUnit& aDrive)=0; |
|
40 virtual TBool DiskChanged(const TDriveUnit& aDrive, TUint aUniqueId)=0; |
|
41 }; |
|
42 |
|
43 //********************************** |
|
44 // CMsvNotifyDiskChange |
|
45 //********************************** |
|
46 |
|
47 class CMsvNotifyDiskChange : public CMsgActive |
|
48 /** |
|
49 @internalComponent |
|
50 @released |
|
51 */ |
|
52 { |
|
53 public: |
|
54 CMsvNotifyDiskChange(RFs& aFs, MMsvDiskChangeObserver& aObserver); |
|
55 ~CMsvNotifyDiskChange(); |
|
56 // |
|
57 TInt Start(const TDriveUnit& aDrive, TUint aUniqueId); |
|
58 // |
|
59 inline void SetDiskMissing(TBool aMissing); |
|
60 inline void SetWrongId(TBool aWrongId); |
|
61 // |
|
62 private: |
|
63 void DoCancel(); |
|
64 void DoRunL(); |
|
65 // |
|
66 private: |
|
67 RFs& iFs; |
|
68 TDriveUnit iDrive; |
|
69 TUint iUniqueId; |
|
70 MMsvDiskChangeObserver& iObserver; |
|
71 TBool iDiskRemoved; |
|
72 // |
|
73 TBool iDiskMissing; |
|
74 TBool iWrongId; |
|
75 }; |
|
76 |
|
77 inline void CMsvNotifyDiskChange::SetDiskMissing(TBool aMissing) |
|
78 { |
|
79 iDiskMissing = aMissing; |
|
80 } |
|
81 |
|
82 inline void CMsvNotifyDiskChange::SetWrongId(TBool aWrongId) |
|
83 { |
|
84 iWrongId = aWrongId; |
|
85 } |
|
86 |
|
87 #endif |