javacommons/fileutils/inc.s60/drivechangedeventgenerator.h
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2009 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:  DriveChangedEventGenerator - S60 specific
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef DRIVECHANGEDEVENTGENERATOR_H
       
    19 #define DRIVECHANGEDEVENTGENERATOR_H
       
    20 
       
    21 #include <list>
       
    22 
       
    23 #include <e32def.h>
       
    24 #include <e32base.h>
       
    25 #include <e32cmn.h>
       
    26 #include <f32file.h>
       
    27 
       
    28 #include "javaosheaders.h"
       
    29 
       
    30 #include "driveutilities.h"
       
    31 
       
    32 class RFs;
       
    33 
       
    34 namespace java
       
    35 {
       
    36 namespace fileutils
       
    37 {
       
    38 
       
    39 OS_NONSHARABLE_CLASS(DriveChangedEventGenerator) : public DriveListenerInterface
       
    40 {
       
    41 public:
       
    42     DriveChangedEventGenerator(DriveListenerInterface* aEventDispatcher);
       
    43     virtual ~DriveChangedEventGenerator();
       
    44 
       
    45     virtual void startEvents();
       
    46     virtual void stopEvents();
       
    47 
       
    48     // DriveListenerInterface
       
    49     virtual void driveChanged(const int& aOperation, const driveInfo& aDriveInfo);
       
    50 
       
    51 private:
       
    52 
       
    53     OS_NONSHARABLE_CLASS(DriveChangedActive) : public CActive
       
    54     {
       
    55 public:
       
    56         DriveChangedActive(driveInfo aDriveInfo,
       
    57         DriveListenerInterface* aEventDispatcher,
       
    58         RFs* aFsSession);
       
    59         virtual ~DriveChangedActive();
       
    60 
       
    61 private:
       
    62         virtual void RunL();
       
    63         virtual void DoCancel();
       
    64 
       
    65         TInt                    iDrive;
       
    66         driveInfo               iDriveInfo;
       
    67         TPath                   iNotificationPath;
       
    68 
       
    69         DriveListenerInterface* iEventDispatcher;
       
    70         RFs*                    iFs;
       
    71     };
       
    72 
       
    73     RFs                             iFs;
       
    74     DriveListenerInterface*         iEventDispatcher;
       
    75     std::list<DriveChangedActive*>  iDriveObjects;
       
    76 };
       
    77 
       
    78 } // namespace fileutils
       
    79 } // namespace java
       
    80 
       
    81 #endif // DRIVECHANGEDEVENTGENERATOR_H