contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverburlistener.h
changeset 73 4bc7b118b3df
parent 66 32469d7d46ff
child 80 397d00875918
child 81 5ef31a21fdd5
equal deleted inserted replaced
66:32469d7d46ff 73:4bc7b118b3df
     1 /*
       
     2 * Copyright (c) 2007 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:  Backup and restore events listener.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CPSERVERBURLISTENER_H
       
    20 #define C_CPSERVERBURLISTENER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <e32property.h>
       
    24 
       
    25 /**
       
    26  *  Interface for observing Backup and Restore events.
       
    27  *
       
    28  *  @since S60 S60 v3.1
       
    29  */
       
    30 class MBURListenerCallback
       
    31     {
       
    32 
       
    33 public:
       
    34     /**
       
    35      * Enum defining the status of Backup and Restore.
       
    36      */
       
    37     enum TBURStatus
       
    38         {
       
    39         EBURStatusNone,
       
    40         EBURStatusBackup,
       
    41         EBURStatusRestore
       
    42         };
       
    43 
       
    44     /**
       
    45      * HandleBUREventL is called when Backup and Restore state has been changed.
       
    46      * @param aStatus Current Backup and Restore status.
       
    47      */
       
    48     virtual void HandleBUREventL( TBURStatus aStatus ) = 0;
       
    49 
       
    50     };
       
    51 
       
    52 /**
       
    53  *  Central Repository observer for Backup and Restore.
       
    54  *
       
    55  *  @since S60 S60 v3.1
       
    56  */
       
    57 NONSHARABLE_CLASS(CCPServerBURListener) : public CActive
       
    58     {
       
    59 
       
    60 public:
       
    61 
       
    62     /**
       
    63      * Creates an instance of CCPServerBURListener implementation.
       
    64      * @param aCallBack Pointer to observer interface.
       
    65      */
       
    66     static CCPServerBURListener* NewL( MBURListenerCallback* aCallback );
       
    67 
       
    68     /**
       
    69      * Destructor.
       
    70      */
       
    71     virtual ~CCPServerBURListener();
       
    72 
       
    73     /**
       
    74      * @return EFalse if the device as a whole is not engaged in a backup or restore .
       
    75      */
       
    76     TBool CheckBUR();
       
    77 
       
    78 private:
       
    79     /**
       
    80      * Constructor.
       
    81      * @param aCallBack Pointer to observer interface.
       
    82      */
       
    83     CCPServerBURListener( MBURListenerCallback* aCallback );
       
    84 
       
    85     /**
       
    86      * Symbian 2nd phase constructor.
       
    87      */
       
    88     void ConstructL();
       
    89 
       
    90     /**
       
    91      * From CActive.
       
    92      */
       
    93     void DoCancel();
       
    94 
       
    95     /**
       
    96      * From CActive.
       
    97      */
       
    98     void RunL();
       
    99 
       
   100     /**
       
   101      * From CActive.
       
   102      */
       
   103     TInt RunError( TInt aError );
       
   104 
       
   105 private:
       
   106     /**
       
   107      * User side interface to Publish & Subscribe.
       
   108      */
       
   109     RProperty iProperty;
       
   110 
       
   111     /**
       
   112      * Interface for notifying changes in Backup and Restore.
       
   113      * Not own.
       
   114      */
       
   115     MBURListenerCallback* iCallback;
       
   116 
       
   117     };
       
   118 
       
   119 #endif // C_CPSERVERBURLISTENER_H
       
   120 // End of File