convergedconnectionhandler/cchclientapi/inc/cchuinotehandler.h
branchRCL_3
changeset 21 f742655b05bf
parent 20 65a3ef1d5bd0
child 22 d38647835c2e
equal deleted inserted replaced
20:65a3ef1d5bd0 21:f742655b05bf
     1 /*
       
     2 * Copyright (c) 2008-2009 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:  Main class for note handling.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CCHUINOTEHANDLER_H
       
    20 #define C_CCHUINOTEHANDLER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <badesca.h>
       
    24 
       
    25 #include "cchuicommon.hrh"
       
    26 
       
    27 class CCchUiGlobalQueryHandler;
       
    28 class MCchUiNoteResultObserver;
       
    29 
       
    30 /**
       
    31  * Note handler.
       
    32  * Note handling for cchui.
       
    33  *
       
    34  * @code
       
    35  *  // Example how to launch change connection query.
       
    36  *  iNoteController = CCCHUiNoteHandler::NewL( *this );
       
    37  *  TInt serviceId( KServiceId ); 
       
    38  *  MCchUiObserver::TCchUiDialogType dialog = 
       
    39  *      MCchUiObserver::ECchUiDialogTypeChangeConnection;
       
    40  *  iNoteController->LaunchNoteL( dialog, serviceId );  
       
    41  * @endcode
       
    42  *
       
    43  * @lib cchui.lib
       
    44  * @since S60 5.0
       
    45  */
       
    46 NONSHARABLE_CLASS( CCCHUiNoteHandler ): public CActive
       
    47     {
       
    48 public:
       
    49     
       
    50     /**
       
    51      * Two-phased constructor.
       
    52      *
       
    53      * @param aObserver Reference to note result observer.
       
    54      */
       
    55     static CCCHUiNoteHandler* NewL( 
       
    56         MCchUiNoteResultObserver& aObserver );
       
    57     
       
    58     /**
       
    59      * Destructor.
       
    60      */
       
    61     virtual ~CCCHUiNoteHandler();
       
    62     
       
    63     /**
       
    64      * Launch note.
       
    65      *
       
    66      * @since S60 5.0
       
    67      * @param aNote Note type.
       
    68      * @param aServiceId Service id.
       
    69      * @param aIapId iap id.
       
    70      * @param aUsername service username.
       
    71      */
       
    72     void LaunchNoteL( 
       
    73         MCchUiObserver::TCchUiDialogType aNote, 
       
    74         TUint aServiceId,
       
    75         TUint aIapId,
       
    76         RBuf& aUserName );
       
    77       
       
    78     /**
       
    79      * Check if there is active note.
       
    80      *
       
    81      * @since S60 5.0
       
    82      * @retun ETrue if there is active note
       
    83      */
       
    84     TBool ActiveDialogExists();
       
    85     
       
    86     /**
       
    87      * Cancels querys.
       
    88      *
       
    89      * @since S60 5.0
       
    90      */
       
    91     void CancelOldNotes();
       
    92     
       
    93     /**
       
    94      * Returns current note.
       
    95      *
       
    96      * @since S60 5.0
       
    97      */    
       
    98     MCchUiObserver::TCchUiDialogType CurrentNote();
       
    99         
       
   100 private:
       
   101 
       
   102     CCCHUiNoteHandler( MCchUiNoteResultObserver& aObserver );
       
   103     
       
   104     void ConstructL();
       
   105     
       
   106 // from base class CActive
       
   107     
       
   108     /**
       
   109      * From CActive.
       
   110      * Called when asynchronous event occurs.
       
   111      */
       
   112     void RunL();
       
   113        
       
   114     /**
       
   115      * From CActive.
       
   116      * Called when this active object is canceled.
       
   117      */
       
   118     void DoCancel();
       
   119        
       
   120     /**
       
   121      * From CActive.
       
   122      * Asynchronous error.
       
   123      */
       
   124     TInt RunError( TInt aError );
       
   125     
       
   126 private: // data
       
   127 
       
   128     /**
       
   129      * Global dialog handler.
       
   130      * Own.
       
   131      */
       
   132     CCchUiGlobalQueryHandler* iGlobalQueryHandler;
       
   133 
       
   134     /**
       
   135      * Note result observer.
       
   136      */
       
   137     MCchUiNoteResultObserver& iObserver;
       
   138     
       
   139     /**
       
   140      * Current active note.
       
   141      */
       
   142     MCchUiObserver::TCchUiDialogType iCurrentNote;
       
   143 
       
   144     CCHUI_UNIT_TEST( UT_CchUi )
       
   145     };
       
   146 
       
   147 #endif // C_CCHUINOTEHANDLER_H