eventsui/eventshandlerui/eventshandlerapp/inc/evtdlglauncher.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2008 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:  Events Dialog Launcher.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_EVTDLGLAUNCHER_H
       
    20 #define C_EVTDLGLAUNCHER_H
       
    21 
       
    22 // System Includes
       
    23 #include <e32base.h>
       
    24 
       
    25 #include "evtmgmtuiengine.h"
       
    26 #include "evtdefs.h"
       
    27 
       
    28 // Forward Declarations
       
    29 class CEvtEventsDlg;
       
    30 class CEvtRequest;	
       
    31 
       
    32 /**
       
    33  * Events Dialog Exit Handler.
       
    34  * 
       
    35  * @since v5.0 
       
    36  */
       
    37 class MEvtDlgObserver
       
    38     {
       
    39 public:
       
    40     /**
       
    41      * It will be used to notify observer that event editor is 
       
    42      * dismissed         
       
    43      */    
       
    44     virtual void NotifyDlgDismissedL() = 0;
       
    45     };
       
    46 
       
    47 /**
       
    48  *  Interface class to Handle the Event's Dialog launching Request.
       
    49  *  This class allows for 
       
    50  *  1. launching of an event viewer dialog.
       
    51  *  2. launching of Notepad Editor for Viewing description.
       
    52  *  3. Cancelling of any outstanding Dialogs
       
    53  *
       
    54  *  @lib 
       
    55  *  @since S60 v9.1
       
    56  */
       
    57 class CEvtDlgLauncher : public CActive,
       
    58                               public MEvtMgmtUiEngineObserver
       
    59 {
       
    60 public:
       
    61     /**
       
    62      * Constructs a new instance of Dialog Launcher.
       
    63      *
       
    64      * @return The new instance of Dialog Launcher object.
       
    65      * @leave System wide error code if the object creation fails.         
       
    66      */
       
    67     IMPORT_C static CEvtDlgLauncher* NewL( CEvtMgmtUiEngine& aEngine, MEvtDlgObserver& aObserver );
       
    68     
       
    69     /**
       
    70      * Constructs a new instance of Dialog Launcher.
       
    71      * Leaves the created instance on the cleanup stack.
       
    72      *
       
    73      * @return The new instance of Dialog Launcher object.
       
    74      * @leave System wide error code if the object creation fails.         
       
    75      */
       
    76     IMPORT_C static CEvtDlgLauncher* NewLC( CEvtMgmtUiEngine& aEngine, MEvtDlgObserver& aObserver );  
       
    77 
       
    78     /**
       
    79     * Destructor.
       
    80     */
       
    81     virtual ~CEvtDlgLauncher();
       
    82 
       
    83 public:  // Public Functions	
       
    84     /**
       
    85      * Launch the dialog for the given Event Request.
       
    86      *
       
    87      * @since S60 v9.1  
       
    88      * @param[in] aRequest Event Request
       
    89      * @leave System wide Leave error code.
       
    90      */
       
    91 	void LaunchDlgL( CEvtRequest& aRequest );
       
    92 	
       
    93     /**
       
    94      * Cancel the currently open dialog.
       
    95      *
       
    96      * @since S60 v9.1  
       
    97      * @leave System wide Leave error code.
       
    98      */
       
    99 	void CancelDlgL( TBool aIsForcedCancel );
       
   100 
       
   101     /**
       
   102      * Inherited from MEvtMgmtUiEngineObserver
       
   103      */
       
   104     void NotifyEventChangeL(TInt aErrorCode, TInt aState );
       
   105     
       
   106     /**
       
   107      * Inherited from MEvtMgmtUiEngineObserver
       
   108      */
       
   109     void NotifyModelChangeL();
       
   110     
       
   111 private: // Inherited from CActive
       
   112     virtual void RunL();
       
   113     
       
   114     virtual void DoCancel();
       
   115     
       
   116     virtual TInt RunError( TInt aError ); 
       
   117 
       
   118 private: 
       
   119 
       
   120     /**
       
   121      * Default C++ Constructor.
       
   122      */
       
   123 	CEvtDlgLauncher( CEvtMgmtUiEngine& aEngine, MEvtDlgObserver& aObserver );
       
   124 
       
   125     /**
       
   126      * Second phase of the two phase constructor.
       
   127      */
       
   128     void ConstructL();
       
   129     
       
   130 private: // data
       
   131 
       
   132     /**
       
   133      * Observer for Dialog Exit
       
   134      */ 
       
   135      MEvtDlgObserver& iObserver;
       
   136      
       
   137     /**
       
   138      * Events Engine
       
   139      */
       
   140     CEvtMgmtUiEngine& iEngine;
       
   141     
       
   142     /**
       
   143      * Event for which the Dialog has to be launched
       
   144      * Not owned
       
   145      */
       
   146     CEvtRequest* iRequest;
       
   147     
       
   148     /**
       
   149      * Dialog Launcher for Editing the Events.
       
   150      */
       
   151     CEvtEventsDlg* iDialog;
       
   152         
       
   153 };
       
   154 
       
   155 #endif C_EVTDLGLAUNCHER_H