calendarui/controller/inc/calendialogshutter.h
branchRCL_3
changeset 20 9c5b1510919f
equal deleted inserted replaced
18:d68a4b5d5885 20:9c5b1510919f
       
     1 /*
       
     2 * Copyright (c) 2002-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:   For dialog shutter.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CALENDIALOGSHUTTER_H
       
    20 #define CALENDIALOGSHUTTER_H
       
    21 
       
    22 #include <e32base.h>	// For CActive, link against: euser.lib
       
    23 #include <e32std.h>		// For RTimer, link against: euser.lib
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CEikonEnv;
       
    27 
       
    28 // CLASS DEFINITIONS
       
    29 /**
       
    30  * The CCalenDialogShutter closes all open dialogs when calendar is opened from widget  
       
    31  */
       
    32 NONSHARABLE_CLASS( CCalenDialogShutter ): public CActive
       
    33     {
       
    34 public:    
       
    35 
       
    36     /**
       
    37     * 1st phase constructor
       
    38     * @param aEikEnv CEikonEnv pointer
       
    39     */
       
    40     static CCalenDialogShutter* NewL( CEikonEnv* aEikEnv );
       
    41 
       
    42     /**
       
    43     * 2nd phase constructor
       
    44     * @param aEikEnv CEikonEnv pointer
       
    45     */
       
    46     static CCalenDialogShutter* NewLC( CEikonEnv* aEikEnv );
       
    47     
       
    48     /**
       
    49     * Destructor    
       
    50     */
       
    51     ~CCalenDialogShutter();
       
    52 
       
    53 public:
       
    54     // New functions    
       
    55     /**
       
    56     * Function for making the initial request  
       
    57     */
       
    58     void ShutDialogsL( /*CActiveSchedulerWait* aWait*/ );
       
    59 
       
    60 private:   
       
    61     /**
       
    62     * C++ constructor
       
    63     * @param aEikEnv CEikonEnv pointer
       
    64     */
       
    65     CCalenDialogShutter( CEikonEnv* aEikEnv );
       
    66    
       
    67     /**
       
    68     * Second-phase constructor
       
    69     */
       
    70     void ConstructL();
       
    71 
       
    72 private:
       
    73     // From CActive    
       
    74     /**
       
    75     * Handle completion
       
    76     */
       
    77     void RunL();
       
    78   
       
    79     /**
       
    80     * Cancel method to handle the user selection
       
    81     */
       
    82     void DoCancel();
       
    83     
       
    84     /**
       
    85     * Override to handle leaves from RunL(). Default implementation causes the active scheduler to panic.
       
    86     */
       
    87     TInt RunError(TInt aError);
       
    88     
       
    89 private:
       
    90     
       
    91     /**
       
    92     * Function to queue the async requests 
       
    93     */
       
    94     void Queue();
       
    95     
       
    96     /**
       
    97     * Function to get the startlevel of the opened dialogs
       
    98     */
       
    99     TInt StartLevel();
       
   100    
       
   101     
       
   102 private:
       
   103     // Ref: environment
       
   104     CEikonEnv* iEikon; 
       
   105     
       
   106     TInt iStartLevel;
       
   107     
       
   108     TInt iCount;
       
   109 
       
   110     };
       
   111 
       
   112 class CKludgeScheduler : public CBaActiveScheduler
       
   113     {
       
   114 public:
       
   115     inline TInt PublicLevel() const { return Level(); }
       
   116     };
       
   117 
       
   118 #endif // CALENDIALOGSHUTTER_H