connectionutilities/ConnectionDialogs/DisconnectDlg/inc/ConnectionModel.h
changeset 0 5a93021fdf25
child 24 c45d4fe2ff0a
equal deleted inserted replaced
-1:000000000000 0:5a93021fdf25
       
     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: 
       
    15 *     The model of RConnectionMobitor.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef DDLG_CONNECTIONMODEL_H
       
    21 #define DDLG_CONNECTIONMODEL_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <rconnmon.h>
       
    26 #include <cdblen.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CConnectionInfo;
       
    30 class CConnectionCArray;
       
    31 class CDisconnectDialogUi;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 /**
       
    35 * Contains business logic of DisconnectDlg
       
    36 */
       
    37 NONSHARABLE_CLASS( CConnectionModel ) : public CBase, 
       
    38                                         public MConnectionMonitorObserver
       
    39                                         
       
    40     {
       
    41     public:
       
    42 
       
    43         /**
       
    44         * @param CDisconnectDialogUi* notifier will be completed if 
       
    45         * @param TDisconnectConnectionPrefs& preferences of the 1st connection
       
    46         * connection is closed
       
    47         */
       
    48         static CConnectionModel* NewL(
       
    49                                     CDisconnectDialogUi* aDisconnectDialogUi,
       
    50                                     CConnectionInfo* aConnectionInfo );
       
    51 
       
    52         /**
       
    53         * Destructor.
       
    54         */
       
    55         virtual ~CConnectionModel();
       
    56 
       
    57     private:
       
    58 
       
    59         /**
       
    60         * Constructor.
       
    61         * @param CDisconnectDialogUi* notifier will be completed if 
       
    62         * connection is closed
       
    63         */
       
    64         CConnectionModel( CDisconnectDialogUi* aDisconnectDialogUi );
       
    65 
       
    66         /**
       
    67         * Constructor.
       
    68         * @param CConnectionInfo preferences of the first connection 
       
    69         */
       
    70         void ConstructL( CConnectionInfo* aConnectionInfo );
       
    71     
       
    72     protected:
       
    73         /**
       
    74         * Fills up connection array
       
    75         */
       
    76         void InitConnectionArrayL();
       
    77 
       
    78         /**
       
    79         * It is called when RConnectionMonitor has sent its event after ending
       
    80         * connection
       
    81         * @return -
       
    82         */
       
    83         void SelectedConnectionClosedL();
       
    84 
       
    85 
       
    86     public:
       
    87 
       
    88         /**
       
    89         * Display information note
       
    90         * @param aPromptResourceId - resuorce id to the text
       
    91         * @param aPrompt additional text
       
    92         */
       
    93         void InfoNoteL( const TInt aPromptResourceId, 
       
    94                         const TDesC* aPrompt = NULL );
       
    95 
       
    96 
       
    97         /**
       
    98         * Starts syncronous request to end the given connection.
       
    99         * @param aConnId connection index
       
   100         * @return the result of the request
       
   101         */
       
   102         TInt EndConnection( TUint aConnIndex );
       
   103 
       
   104         // Getter functions
       
   105 
       
   106         /**
       
   107         * Get the connection array.
       
   108         * @param -
       
   109         * @return pointer to the connection array
       
   110         */
       
   111         CConnectionCArray* GetConnArray() const;
       
   112 
       
   113 
       
   114         /**
       
   115         * Cancels Notification
       
   116         */
       
   117         void CancelNotification();
       
   118         
       
   119 
       
   120     public: // from MConnectionMonitorObserver
       
   121 
       
   122         /**
       
   123         * Event method is called every time an event occures.
       
   124         * @since 
       
   125         * @param aConnMonEvent The event information.
       
   126         * @return void
       
   127         */
       
   128         void EventL( const CConnMonEventBase &aConnMonEvent );
       
   129 
       
   130     private:
       
   131         /**
       
   132         * For get connection informations
       
   133         */
       
   134         RConnectionMonitor iMonitor;
       
   135 
       
   136         /**
       
   137         * Contains connection info instances
       
   138         */
       
   139         CConnectionCArray* iConnArray;   ///< Owned.
       
   140 
       
   141         TUint iClosingConnectionIndex;  ///< index of connection to be closed
       
   142 
       
   143         CDisconnectDialogUi* iDisconnectDialogUi;// Not Owned
       
   144 
       
   145         TBool iDeleting;
       
   146     };
       
   147 
       
   148 
       
   149 #endif /* DDLG_CONNECTIONMODEL_H */
       
   150 
       
   151 // End of File