wvuing/IMPSConnectionUI/UISrc/CCnUiQueryContainer.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Query container implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CCNUIQUERYCONTAINER_H
       
    19 #define __CCNUIQUERYCONTAINER_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Base.h>
       
    23 #include <AknQueryDialog.h>
       
    24 #include "MCnUiUiFacade.h"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MCnUiConnQueryObserver;
       
    28 
       
    29 
       
    30 /**
       
    31  * Supported query types.
       
    32  *
       
    33  * @since 2.1
       
    34  */
       
    35 enum TNonBlockingQueryType
       
    36     {
       
    37     ENBConfirmationQuery = 1,
       
    38     ENBConfirmedErrorNote
       
    39     };
       
    40 
       
    41 
       
    42 // CLASS DECLARATION
       
    43 /**
       
    44  * Query container implementation.
       
    45  *
       
    46  * @since 2.1
       
    47  */
       
    48 NONSHARABLE_CLASS( CCnUiQueryContainer ) : public CBase,
       
    49         public MCnUiConnQuery
       
    50     {
       
    51     /**
       
    52      * Helper derivation from CAknDialog.
       
    53      * Offers non waiting dialog features.
       
    54      * Reports events to observer and self pointer
       
    55      * NULLing. (Self pointer NULLing needed to ease
       
    56      * MCnUiConnQuery client usage.)
       
    57      *
       
    58      * @since 2.1
       
    59      */
       
    60     NONSHARABLE_CLASS( CCnUiNonWaitingQueryDialog ) : public CAknQueryDialog
       
    61         {
       
    62 public:  // Two-phased constructors and destructor
       
    63 
       
    64         /**
       
    65          * Two-phased constructor.
       
    66          *
       
    67          * @since 2.1
       
    68          * @param aType The query type.
       
    69          * @param aLabelText The label text to show in UI.
       
    70          * @param aObserver The observer to notify from dialog selections.
       
    71          * @param aSelfPtr Self pointer. Nulled when dialog is destroyed.
       
    72          */
       
    73         static CCnUiNonWaitingQueryDialog* NewL( TNonBlockingQueryType aType,
       
    74         const TDesC& aLabelText,
       
    75         MCnUiConnQueryObserver& aObserver,
       
    76         CCnUiNonWaitingQueryDialog** aSelfPtr );
       
    77 
       
    78         /**
       
    79          * Destructor.
       
    80          */
       
    81         virtual ~CCnUiNonWaitingQueryDialog();
       
    82 
       
    83 private:
       
    84         /**
       
    85          * C++ constructor.
       
    86          */
       
    87         CCnUiNonWaitingQueryDialog( MCnUiConnQueryObserver& aObserver,
       
    88                                     CCnUiNonWaitingQueryDialog** aSelfPtr );
       
    89 
       
    90         /**
       
    91          * Symbian OS constructor.
       
    92          */
       
    93         void LaunchQueryLD( TNonBlockingQueryType aType, const TDesC& aLabelText );
       
    94 
       
    95 
       
    96 private: //From CEikDialog.
       
    97 
       
    98         /**
       
    99          * From CEikDialog.
       
   100          * Overridden to report the selection to observer.
       
   101          * @since 2.1
       
   102          */
       
   103         TBool OkToExitL( TInt aButtonId );
       
   104 
       
   105 
       
   106 private: // data
       
   107 
       
   108         ///<The observer, not owned.
       
   109         MCnUiConnQueryObserver&             iObserver;
       
   110 
       
   111         ///< Self pointer reference.
       
   112         ///< Used to NULL self pointer in deletion. Not owned.
       
   113         CCnUiNonWaitingQueryDialog**        iSelfPtr;
       
   114         };
       
   115 
       
   116 
       
   117 
       
   118 public:  // Two-phased constructors and destructor
       
   119 
       
   120     /**
       
   121      * Two-phased constructor.
       
   122      *
       
   123      * @since 2.1
       
   124      * @param aType query type
       
   125      * @param aLabelText The label text to show in UI.
       
   126      * @param aObserver The observer to notify.
       
   127      */
       
   128     static CCnUiQueryContainer* NewL( TNonBlockingQueryType aType,
       
   129                                       const TDesC& aLabelText,
       
   130                                       MCnUiConnQueryObserver& aObserver );
       
   131 
       
   132     /**
       
   133      * Destructor.
       
   134      */
       
   135     virtual ~CCnUiQueryContainer();
       
   136 
       
   137 private:
       
   138 
       
   139     /**
       
   140      * C++ constructor.
       
   141      */
       
   142     CCnUiQueryContainer();
       
   143 
       
   144 
       
   145 private: // data
       
   146 
       
   147     ///<Used query dialog. Owned.
       
   148     CCnUiNonWaitingQueryDialog*      iDlg;
       
   149     };
       
   150 
       
   151 #endif      //  __CCNUIQUERYCONTAINER_H
       
   152 
       
   153 //  End of File
       
   154