javamanager/javaregistry/legacy/server/inc/javaregdirectoryobserver.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2005-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:  javaregdirectoryobserver definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef JAVAREGDIRECTORYOBSERVER_H
       
    20 #define JAVAREGDIRECTORYOBSERVER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <f32file.h>
       
    25 #include "mjavaregcacheupdater.h"
       
    26 
       
    27 namespace Java
       
    28 {
       
    29 namespace Manager
       
    30 {
       
    31 namespace Registry
       
    32 {
       
    33 
       
    34 
       
    35 /**
       
    36  * This class monitors the changes in the directory given as parameter,
       
    37  * and notifies the store to update it's cache accordingly.
       
    38  *
       
    39  * @since S60 v3.2
       
    40  */
       
    41 // CLASS DECLARATION
       
    42 NONSHARABLE_CLASS(CJavaRegDirectoryObserver) :
       
    43         public CActive
       
    44 {
       
    45 
       
    46 public:
       
    47 
       
    48     /**
       
    49      * Creates an object of this class.
       
    50      *
       
    51      * @since S60 v3.2
       
    52      * @param aCacheUpdater The object to notify about the changes.
       
    53      * @param aFs File server session, to subscribe to changes.
       
    54      * @param aDrive The drive, wich the path in the registry represents.
       
    55      * @param aPath The path to monitor.
       
    56      */
       
    57     static CJavaRegDirectoryObserver* NewL(
       
    58         MJavaRegCacheUpdater& aCacheUpdater,
       
    59         RFs& aFs,
       
    60         TInt aDrive,
       
    61         const TDesC& aPath);
       
    62 
       
    63     /**
       
    64      * Creates an object of this class.
       
    65      *
       
    66      * @since S60 v3.2
       
    67      * @param aCacheUpdater The object to notify about the changes.
       
    68      * @param aFs File server session, to subscribe to changes.
       
    69      * @param aDrive The drive, wich the path in the registry represents.
       
    70      * @param aPath The path to monitor.
       
    71      */
       
    72     static CJavaRegDirectoryObserver* NewLC(
       
    73         MJavaRegCacheUpdater& aCacheUpdater,
       
    74         RFs& aFs,
       
    75         TInt aDrive,
       
    76         const TDesC& aPath);
       
    77 
       
    78     /**
       
    79      * Destructor
       
    80      * @since S60 v3.2
       
    81      */
       
    82     ~CJavaRegDirectoryObserver();
       
    83 
       
    84     /**
       
    85      * Refreshes the iEntryList member.
       
    86      *
       
    87      * @since S60 v3.2
       
    88      */
       
    89     void RefreshEntryListL();
       
    90 
       
    91     /**
       
    92      * Returns the iPath member.
       
    93      *
       
    94      * @since S60 v3.2
       
    95      * @return The iPath member.
       
    96      */
       
    97     const TDesC& Path() const;
       
    98 
       
    99     /**
       
   100      * Sets the iPath member to the given parameter value.
       
   101      *
       
   102      * @since S60 v3.2
       
   103      * @param aPath The path to monitor.
       
   104      */
       
   105     void SetPathL(const TDesC& aPath);
       
   106 
       
   107     /**
       
   108      * Returns the iDrive member.
       
   109      *
       
   110      * @since S60 v3.2
       
   111      * @return The iDrive member..
       
   112      */
       
   113     TInt Drive() const;
       
   114 
       
   115 public:     // from CActive
       
   116 
       
   117     /**
       
   118      * RunL
       
   119      */
       
   120     void RunL();
       
   121 
       
   122     /**
       
   123      * DoCancel
       
   124      */
       
   125     void DoCancel();
       
   126 
       
   127     /**
       
   128      * RunError
       
   129      */
       
   130     TInt RunError(TInt aError);
       
   131 
       
   132 private:
       
   133 
       
   134     /**
       
   135      * Constructor
       
   136      *
       
   137      * @since S60 v3.2
       
   138      * @param aCacheUpdater The object to notify about the changes.
       
   139      * @param aFs File server session, to subscribe to changes.
       
   140      * @param aDrive The drive, wich the path in the registry represents.
       
   141      */
       
   142     CJavaRegDirectoryObserver(
       
   143         MJavaRegCacheUpdater& aCacheUpdater,
       
   144         RFs& aFs,
       
   145         TInt aDrive);
       
   146 
       
   147     /**
       
   148      * 2nd phase constructor.
       
   149      *
       
   150      * @since S60 v3.2
       
   151      * @param aPath The path to monitor.
       
   152      */
       
   153     void ConstructL(const TDesC& aPath);
       
   154 
       
   155 private:
       
   156 
       
   157     // The object to notify about the changes.
       
   158     MJavaRegCacheUpdater& iCacheUpdater;
       
   159 
       
   160     // File server session, to subscribe to changes.
       
   161     RFs& iFs;
       
   162 
       
   163     // The drive, wich the path in the registry represents.
       
   164     TInt iDrive;
       
   165 
       
   166     // The path to monitor.
       
   167     TPath iPath;
       
   168 
       
   169     // The file-entrylist of the iPath directory.
       
   170     CDir* iEntryList;
       
   171 
       
   172 };
       
   173 
       
   174 }//namespace Registry
       
   175 }//namespace Manager
       
   176 }//namespace Java
       
   177 
       
   178 #endif // JAVAREGDIRECTORYOBSERVER_H
       
   179 
       
   180 // End of File