imstutils/imconversationview/imcvuiapp/inc/cimcvappwaitnote.h
branchRCL_3
changeset 29 9a48e301e94b
parent 0 5e5d6b214f4f
equal deleted inserted replaced
28:3104fc151679 29:9a48e301e94b
       
     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:  Helper class for wait notes
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CIMCVAPPWAITNOTE_H
       
    21 #define CIMCVAPPWAITNOTE_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <AknWaitDialog.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 
       
    31 // Observer class to notice dismissing note by cancel.
       
    32 class MIMCVWaitNoteObserver
       
    33     {
       
    34     public: // Interface methods
       
    35     
       
    36         /**
       
    37          * Wait note is canceled.
       
    38          */
       
    39         virtual void NoteCanceled( TInt aButtonId ) = 0;    
       
    40     };
       
    41 
       
    42 /**
       
    43  *  Helper class for wait notes
       
    44  *
       
    45  *  @lib imcvuiapp.exe
       
    46  *  @since 
       
    47  */
       
    48 class CIMCVAppWaitNote : public CBase, public MProgressDialogCallback
       
    49     {
       
    50     public:  // Constructors and destructor
       
    51 
       
    52         /**
       
    53          * Shows waitnote
       
    54          *
       
    55          * @param aText 				Text to be shown in note.
       
    56          * @param aShowImmediately 		If ETrue waitnote is shown immediately
       
    57          *								(not after 1 sec delay)
       
    58          * @param aCanBeCanceledByUser  Do we show wait note with cancel soft key or not
       
    59          */
       
    60         static CIMCVAppWaitNote* ShowWaitNoteL( const TDesC& aText,
       
    61         									TBool aShowImmediately = EFalse,
       
    62         									TBool aCanBeCanceledByUser = EFalse, 
       
    63         									MIMCVWaitNoteObserver* aObserver = NULL );
       
    64 
       
    65 		/**
       
    66          * Shows waitnote and pushes the item to cleanupstack
       
    67          *
       
    68          * @param aTextResource 		Resource id of text to be shown in note.
       
    69          * @param aShowImmediately 		If ETrue waitnote is shown immediately
       
    70 		 *								(not after 1 sec delay)
       
    71          * @param aCanBeCanceledByUser  Do we show wait note with cancel soft key or not
       
    72          */
       
    73         static CIMCVAppWaitNote* ShowWaitNoteLC( TInt aTextResource,
       
    74         									TBool aShowImmediately = EFalse,
       
    75         								    TBool aCanBeCanceledByUser = EFalse, 
       
    76         								    MIMCVWaitNoteObserver* aObserver = NULL );
       
    77 		
       
    78 		/**
       
    79          * Shows waitnote, does not leave anything to cleanupstack.
       
    80          *
       
    81          * @param aTextResource 		Resource id of text to be shown in note.
       
    82          * @param aShowImmediately 		If ETrue waitnote is shown immediately
       
    83 		 *								(not after 1 sec delay)
       
    84          * @param aCanBeCanceledByUser  Do we show wait note with cancel soft key or not
       
    85          */
       
    86         static CIMCVAppWaitNote* ShowWaitNoteL( TInt aTextResource,
       
    87         								   TBool aShowImmediately = EFalse,
       
    88         								   TBool aCanBeCanceledByUser = EFalse, 
       
    89         								   MIMCVWaitNoteObserver* aObserver = NULL );
       
    90 		/**
       
    91 		 * Destructor.
       
    92 		 */
       
    93 		virtual ~CIMCVAppWaitNote();
       
    94 
       
    95     protected: // From MProgressDialogCallback
       
    96 
       
    97         /**
       
    98          * From MProgressDialogCallback Get's called when a dialog is dismissed
       
    99          * @param aButtonId Button that was used to dismiss the dialog
       
   100          */
       
   101         void DialogDismissedL( TInt aButtonId );
       
   102 
       
   103 
       
   104 	public: // New functions
       
   105 
       
   106 		/**
       
   107          * Dismisses this waitnote
       
   108 		 */
       
   109 		void DismissDialog();
       
   110 
       
   111 
       
   112     private:
       
   113 
       
   114         /**
       
   115          * C++ default constructor.
       
   116          */
       
   117         CIMCVAppWaitNote();
       
   118 
       
   119         /**
       
   120          * By default Symbian 2nd phase constructor is private.
       
   121          */
       
   122         void ConstructL( const TDesC& aText,
       
   123         		  		 TBool aShowImmediately,
       
   124         				 TBool aCanBeCanceledByUser,
       
   125         				 MIMCVWaitNoteObserver* aObserver );
       
   126 
       
   127     public: // New methods
       
   128    
       
   129         /**
       
   130          * Set wait note observer. NULL will unset this one.
       
   131          */
       
   132         void SetObserver( MIMCVWaitNoteObserver* aObserver );
       
   133 
       
   134     private: // Data
       
   135 
       
   136     	// Doesn't own (destroys itself)
       
   137 		CAknWaitDialog* iWaitDialog;
       
   138        
       
   139         /// Wait note observer. This will be notified when wait note is dismissed.
       
   140         MIMCVWaitNoteObserver* iObserver;
       
   141     };
       
   142 
       
   143 #endif      // CIMCVAPPWAITNOTE_H
       
   144 
       
   145 // End of File