contacts_plat/phonebook_2_common_ui_api/inc/MPbk2StartupMonitor.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Phonebook 2 start-up monitor interface.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MPBK2STARTUPMONITOR_H
       
    20 #define MPBK2STARTUPMONITOR_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32def.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class MPbk2StartupObserver;
       
    27 class MVPbkContactViewBase;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32  * Phonebook 2 start-up monitor interface.
       
    33  * Offers a possibility to get a start-up complete event.
       
    34  */
       
    35 class MPbk2StartupMonitor
       
    36     {
       
    37     public: // Interface
       
    38 
       
    39         /**
       
    40          * Extensions that are loaded in start-up must call this
       
    41          * after their own start-up routines have been done.
       
    42          */
       
    43         virtual void HandleStartupComplete() = 0;
       
    44 
       
    45         /**
       
    46          * Called if there is an error during the start-up.
       
    47          *
       
    48          * @param aError    Error code.
       
    49          */
       
    50         virtual void HandleStartupFailed(
       
    51                 TInt aError ) = 0;
       
    52 
       
    53         /**
       
    54          * Adds a new observer for the start-up process.
       
    55          * Duplicate observers are not added.
       
    56          *
       
    57          * @param aObserver     New observer for the start-up process.
       
    58          */
       
    59         virtual void RegisterEventsL(
       
    60                 MPbk2StartupObserver& aObserver ) = 0;
       
    61 
       
    62         /**
       
    63          * Removes an observer from the monitor.
       
    64          * Does nothing the if observer does not exist.
       
    65          *
       
    66          * @param aObserver     An observer to be removed.
       
    67          */
       
    68         virtual void DeregisterEvents(
       
    69                 MPbk2StartupObserver& aObserver ) = 0;
       
    70 
       
    71         /**
       
    72          * Notify the startup monitor of an application view launch.
       
    73          * The monitor will be activated only for the first application
       
    74          * view but the client doesn't need to worry about that.
       
    75          *
       
    76          * Must be called from the application view's DoActivateL if
       
    77          * the view can be directly launched from other process
       
    78          * (e.g. using CPbkViewState or CPbk2ViewState).
       
    79          *
       
    80          * Uses AllContactsViewL for waiting. If you have some
       
    81          * other view then use the specialised version.
       
    82          *
       
    83          * @param aViewId       Id of the launched view.
       
    84          */
       
    85         virtual void NotifyViewActivationL(
       
    86                 TUid aViewId ) = 0;
       
    87 
       
    88         /**
       
    89          * Notify the startup monitor of an application view launch.
       
    90          * The monitor will be activated only for the first application
       
    91          * view but the client doesn't need to worry about that.
       
    92          *
       
    93          * Must be called from the application view's DoActivateL if
       
    94          * the view can be directly launched from other process
       
    95          * (e.g. using CPbkViewState or CPbk2ViewState).
       
    96          *
       
    97          * Uses given contact view for waiting.
       
    98          *
       
    99          * @param aViewId       Id of the launched view.
       
   100          * @param aContactView  The view that will be waited by the monitor.
       
   101          *                      The monitor saves the reference of
       
   102          *                      aContactView until it gets it's job done.
       
   103          *                      The application view must call
       
   104          *                      NotifyViewDeActivation in DoDeactivate
       
   105          *                      to reset the aContactView reference.
       
   106          */
       
   107         virtual void NotifyViewActivationL(
       
   108                 TUid aViewId,
       
   109                 MVPbkContactViewBase& aContactView ) = 0;
       
   110 
       
   111         /**
       
   112          * Returns an extension point for this interface or NULL.
       
   113          *
       
   114          * @param aExtensionUid     Extension UID.
       
   115          * @return  Extension point.
       
   116          */
       
   117         virtual TAny* StartupMonitorExtension( TUid /*aExtensionUid*/ )
       
   118             {
       
   119             return NULL;
       
   120             }
       
   121 
       
   122     protected: // Disabled functions
       
   123         virtual ~MPbk2StartupMonitor()
       
   124                 {}
       
   125     };
       
   126 
       
   127 /// Use this UID to access startup monitor extension 2.
       
   128 //  Used as a parameter to StartupMonitorExtension() method.
       
   129 const TUid KPbk2StartupMonitorExtensionUid = { 1 };
       
   130 
       
   131 /**
       
   132  * This class is an extension to MPbk2StartupMonitor.
       
   133  *
       
   134  * @see MPbk2StartupMonitor
       
   135  *
       
   136  */
       
   137 class MPbk2StartupMonitorExtension
       
   138     {
       
   139     protected:  // Destructor
       
   140         virtual ~MPbk2StartupMonitorExtension() { }
       
   141 
       
   142     public:
       
   143 
       
   144         /**
       
   145          * Disable monitoring.
       
   146          */
       
   147         virtual void DisableMonitoring() = 0;
       
   148     };
       
   149 
       
   150 #endif // MPBK2STARTUPMONITOR_H
       
   151 
       
   152 // End of File