syncmlfw/syncmlnotifier/inc/syncmlmmcwatcher.h
changeset 0 b497e44ab2fc
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     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:  Synchronisation server alert notifier.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef SYNCMLMMCWATCHER_H_
       
    19 #define SYNCMLMMCWATCHER_H_
       
    20 #include <e32base.h>
       
    21 #include <e32property.h>
       
    22 #include <UikonInternalPSKeys.h>
       
    23 #include <f32file.h> 
       
    24 #include <disknotifyhandler.h> //if RD_MULTIPLE_DRIVE
       
    25 #include "SyncMLNotifDebug.h"
       
    26 
       
    27 /**
       
    28 *  MMC event observer class for SyncML notifier queries.
       
    29 *  @lib SyncMLNotifier
       
    30 *  @since Series 60 5.2
       
    31 */
       
    32 NONSHARABLE_CLASS ( MSyncMLQueryMmcObserver )
       
    33     {
       
    34     public: // New functions
       
    35         /**
       
    36         * Is called when the mmc removes.
       
    37         * @since Series 60 5.2
       
    38         * @param None
       
    39         * @return None
       
    40         */
       
    41         virtual void MmcRemoved() = 0;
       
    42     };
       
    43 
       
    44 /**
       
    45 *  MMC event watcher class for SyncML notifier queries.
       
    46 *  @lib SyncMLNotifier
       
    47 *  @since Series 60 5.2
       
    48 */
       
    49 class CSyncmlmmcwatcher :  public CBase, public MDiskNotifyHandlerCallback /*public CActive,*/
       
    50     {                
       
    51 public:  // Constructors and destructor
       
    52 
       
    53     /**
       
    54      * Two-phased constructor.
       
    55      */
       
    56     static CSyncmlmmcwatcher* NewL( MSyncMLQueryMmcObserver* aObserver );
       
    57 
       
    58     /**
       
    59      * Destructor.
       
    60      */     
       
    61     virtual ~CSyncmlmmcwatcher();
       
    62 private:   
       
    63     /**
       
    64      * Constructor.
       
    65      */
       
    66     inline CSyncmlmmcwatcher( MSyncMLQueryMmcObserver* aObserver);       
       
    67 
       
    68 public:
       
    69     /**
       
    70      * Logs a request to notify the disk events
       
    71      * @since Series 60 5.2
       
    72      * @param None
       
    73      * @return None
       
    74      */
       
    75     void StartL();
       
    76     
       
    77     /**
       
    78      * Callback method to notify disk events
       
    79      * @since Series 60 5.2
       
    80      * @param aError,System wide error code from file server
       
    81      * @param aEvent,The disk event data data specified by TDiskEvent
       
    82      * @return None
       
    83      */
       
    84     void HandleNotifyDisk( TInt aError, const TDiskEvent& aEvent );
       
    85     
       
    86     /**
       
    87      * Cancels the disk notification
       
    88      * @since Series 60 5.2
       
    89      * @param None     
       
    90      * @return None
       
    91      */
       
    92     void CancelMmcwatch();
       
    93 
       
    94 private:
       
    95 
       
    96     /**
       
    97      * Symbian 2nd phase constructor.
       
    98      */
       
    99     void ConstructL();            
       
   100 
       
   101 private:            
       
   102     //Instance to RFs
       
   103     RFs iMemoryCard;
       
   104     
       
   105     // Pointer to disk notify handler. Own.
       
   106     CDiskNotifyHandler* iDiskNotifyHandler;
       
   107     
       
   108     // Pointer to MMC observer
       
   109     MSyncMLQueryMmcObserver* immcobserver;
       
   110     }; 
       
   111 
       
   112 #endif /* SYNCMLMMCWATCHER_H_ */
       
   113