53
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
#ifndef NOTIFYCHANGE_H_
|
|
22 |
#define NOTIFYCHANGE_H_
|
|
23 |
|
|
24 |
//System Includes
|
|
25 |
#include <e32base.h>
|
|
26 |
#include <f32file.h>
|
|
27 |
#include <opensystemtrace.h>
|
|
28 |
|
|
29 |
/*
|
|
30 |
* This Class raise a NotifyRequest for a particular path
|
|
31 |
* & startes monitor file system with RFs::NotifyChange.
|
|
32 |
* It receives notifications when a change occurs,
|
|
33 |
* it will try to list all the files from that path in ESortByDate order.
|
|
34 |
*
|
|
35 |
*/
|
|
36 |
|
|
37 |
class CNotifyChange : public CActive
|
|
38 |
{
|
|
39 |
|
|
40 |
public:
|
|
41 |
// Wrapper function to invoke the constructor
|
|
42 |
static CNotifyChange* NewL(const TChar aDriveLetter);
|
|
43 |
|
|
44 |
/*
|
|
45 |
* wil issue a Notify Change request to FileSystem for particular path
|
|
46 |
*/
|
|
47 |
|
|
48 |
void StartFilesystemMonitor();
|
|
49 |
// Destructor;
|
|
50 |
~CNotifyChange();
|
|
51 |
|
|
52 |
protected:
|
|
53 |
// Constructor
|
|
54 |
CNotifyChange();
|
|
55 |
// 2-Phase Constructor
|
|
56 |
void ConstructL(const TChar aDriveLetter);
|
|
57 |
/*
|
|
58 |
*will List the registration resources from a specified path.
|
|
59 |
*/
|
|
60 |
void GetFilesFromDirL();
|
|
61 |
/*
|
|
62 |
* will register the resource with APPARC using SWI API's
|
|
63 |
*/
|
|
64 |
void RegisterwithApparc(TDesC& aFileName);
|
|
65 |
|
|
66 |
// Inherited from CActive.
|
|
67 |
virtual void RunL();
|
|
68 |
virtual void DoCancel();
|
|
69 |
virtual TInt RunError(TInt aError);
|
|
70 |
|
|
71 |
private:
|
|
72 |
RFs iFs;
|
|
73 |
HBufC* iPath;
|
|
74 |
};
|
|
75 |
#endif /* NOTIFYCHANGE_H_ */
|