mmsharing/mmshui/src/musuisendview.cpp
changeset 0 f0cf47e981f9
child 2 b31261fd4e04
equal deleted inserted replaced
-1:000000000000 0:f0cf47e981f9
       
     1 /*
       
     2 * Copyright (c) 2005 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:  The MUS application's UI class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "musuisendview.h"
       
    20 #include "musuiappui.h"
       
    21 #include "musuisendcontroller.h"
       
    22 #include "musuisendviewcontainer.h"
       
    23 #include "musuidefinitions.h"
       
    24 #include "musuidialogutil.h"
       
    25 #include "muslogger.h" // debug logging
       
    26 
       
    27 #include <musui.rsg>
       
    28 
       
    29 #include <aknViewAppUi.h>
       
    30 
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 // EPOC two-phased constructor
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 void CMusUiSendView::ConstructL()
       
    37     {
       
    38     MUS_LOG( "mus: [MUSUI ]  -> CMusUiSendView::ConstructL" );
       
    39     CMusUiGeneralView::ConstructL();
       
    40     iSavedOrientation = MusAppUi()->AppOrientation();
       
    41     MUS_LOG( "mus: [MUSUI ]  <- CMusUiSendView::ConstructL" );
       
    42     }
       
    43 
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // Destructor
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 CMusUiSendView::~CMusUiSendView()
       
    50     {
       
    51     MUS_LOG( "mus: [MUSUI ]  -> CMusUiSendView::~CMusUiSendView" );
       
    52     MUS_LOG( "mus: [MUSUI ]  <- CMusUiSendView::~CMusUiSendView" );
       
    53     }
       
    54 
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 void CMusUiSendView::ManualAddressEntryL( const TDesC& aAddress )
       
    61     {
       
    62     MUS_LOG_TDESC( "mus: [MUSUI ]    -> CMusUiSendView::ManualAddressEntryL: ",
       
    63                             aAddress );
       
    64 
       
    65     TBuf<KMusSipAddressMaxLength> address( aAddress );
       
    66     if ( SendController() && MusUiDialogUtil::ShowTextQueryDialogL( 
       
    67                                     R_MUS_TEXT_ENTER_ADDRESS_DIALOG_PROMPT, 
       
    68                                     address ) )
       
    69         {
       
    70         SendController()->InviteL( address );
       
    71         }
       
    72     else
       
    73         {
       
    74         MusUiDialogUtil::ShowGlobalInformationDialogL( 
       
    75                             R_MUS_LIVE_SHARING_VIEW_NOTE_SHARING_ENDED );
       
    76         MusAppUi()->HandleExit();
       
    77         }
       
    78 
       
    79     SendController()->ChangeOrientationL( iSavedOrientation );
       
    80     MUS_LOG( "mus: [MUSUI ]  <- CMusUiSendView::ManualAddressEntryL" );
       
    81     }
       
    82 
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 //
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 CMusUiEventController* CMusUiSendView::EventController() const
       
    89     {
       
    90     return SendController();
       
    91     }
       
    92 
       
    93 
       
    94 // -----------------------------------------------------------------------------
       
    95 //
       
    96 // -----------------------------------------------------------------------------
       
    97 //
       
    98 CMusUiViewContainer& CMusUiSendView::SharingContainer() const
       
    99     {
       
   100     return *SendContainer();
       
   101     }
       
   102         
       
   103 
       
   104 // -----------------------------------------------------------------------------
       
   105 // From CAknView, Gets called from framework when activating this view
       
   106 // -----------------------------------------------------------------------------
       
   107 //
       
   108 void CMusUiSendView::DoActivateL( const TVwsViewId& aPrevViewId,
       
   109                                     TUid aCustomMessageId,
       
   110                                     const TDesC8& aCustomMessage )
       
   111     {
       
   112     // Base class activation first
       
   113     CMusUiGeneralView::DoActivateL( aPrevViewId,
       
   114                                     aCustomMessageId,
       
   115                                     aCustomMessage ); 
       
   116                                     
       
   117     }
       
   118 
       
   119 
       
   120 // -----------------------------------------------------------------------------
       
   121 // From AknView, Gets called from framework when deactivating this view
       
   122 // -----------------------------------------------------------------------------
       
   123 //
       
   124 void CMusUiSendView::DoDeactivate()
       
   125     {
       
   126     CMusUiGeneralView::DoDeactivate(); // Base class deactivation first
       
   127     }
       
   128     
       
   129     
       
   130 // -----------------------------------------------------------------------------
       
   131 // Called when focus event occurs.
       
   132 // -----------------------------------------------------------------------------
       
   133 //
       
   134 void CMusUiSendView::DoHandleForegroundEventL( TBool aForeground )
       
   135     {
       
   136     CMusUiGeneralView::HandleForegroundEventL( 
       
   137                                 aForeground, 
       
   138                                 iOperatorSpecificFunctionality &&
       
   139                                 EventControllerL().ConnectionEstablished() &&
       
   140                                 !EventControllerL().ExitOccured() );
       
   141     }    
       
   142 
       
   143 
       
   144 // end of file