/* Machine-made version of this file copyright (c) 2005 Somusar */ /* Derived from samples that are Copyright (c) 2004, Nokia. All rights reserved */ // INCLUDE FILES #include #include #include #include #include #include #include #include "TwoForms.hrh" #include "TwoFormsAppView.h" #include "TwoFormsContainer.h" // ================= MEMBER FUNCTIONS ========================================= // ---------------------------------------------------------------------------- // CTwoFormsView::CTwoFormsView() // Default constructor. // ---------------------------------------------------------------------------- // CTwoFormsView::CTwoFormsView() : iContainer( NULL ), iCurrentOutline( ETwoFormsCmdEmptyOutline ) { } // ---------------------------------------------------------------------------- // void CTwoFormsView::ConstructL() // Symbian constructor. // ---------------------------------------------------------------------------- // void CTwoFormsView::ConstructL() { BaseConstructL( R_TWOFORMS_VIEW ); } // ---------------------------------------------------------------------------- // CTwoFormsView::~CTwoFormsView() // Destructor. // ---------------------------------------------------------------------------- // CTwoFormsView::~CTwoFormsView() { // Deletes the container class object. if ( iContainer ) { // Removes container from view control stack. AppUi()->RemoveFromStack( iContainer ); } delete iContainer; } // ---------------------------------------------------------------------------- // void CTwoFormsView::DisplayNextOutlineL() // // ---------------------------------------------------------------------------- // void CTwoFormsView::DisplayNextOutlineL() { switch ( iCurrentOutline ) { default: HandleCommandL( ETwoFormsCmdEmptyOutline ); break; } } // ---------------------------------------------------------------------------- // CTwoFormsView::Id() // Returns ID of view. // ---------------------------------------------------------------------------- // TUid CTwoFormsView::Id() const { return KViewId; } // ---------------------------------------------------------------------------- // CTwoFormsView::HandleCommandL() // Handles the commands. // ---------------------------------------------------------------------------- // void CTwoFormsView::HandleCommandL( TInt aCommand ) { switch ( aCommand ) { /* case EAknSoftkeyBack and EAknCmdExit are handled by the AppUi class.*/ case ETwoFormsCmdFirstFormCommand: iCurrentOutline = aCommand; IndicateTitlePaneTextL( aCommand ); iContainer->SetTextToLabelL( R_TWOFORMS_FIRST_FORM_OPERATION ); iContainer->DisplayFormL( R_TWOFORMS_FIRST_FORM_DIALOG ); break; case ETwoFormsCmdSecondFormCommand: iCurrentOutline = aCommand; IndicateTitlePaneTextL( aCommand ); iContainer->SetTextToLabelL( R_TWOFORMS_SECOND_FORM_OPERATION ); iContainer->DisplayFormL( R_TWOFORMS_SECOND_FORM_DIALOG ); break; default: break; } } // ---------------------------------------------------------------------------- // CTwoFormsView::IndicateTitlePaneTextL() // Set title text to status-pane // ---------------------------------------------------------------------------- // void CTwoFormsView::IndicateTitlePaneTextL( TInt aCommand ) { TBool useDefaultText( EFalse ); TInt resourceId( KTwoFormsResourceIdInitialize ); switch ( aCommand ) { case ETwoFormsCmdEmptyOutline: useDefaultText = ETrue; break; case ETwoFormsCmdFirstFormCommand: resourceId = R_TWOFORMS_TEXT_STATUS_PANE_TITLE_FIRST_FORM; break; case ETwoFormsCmdSecondFormCommand: resourceId = R_TWOFORMS_TEXT_STATUS_PANE_TITLE_SECOND_FORM; break; default: useDefaultText = ETrue; break; } CAknTitlePane* titlePane = static_cast ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); if ( useDefaultText ) { titlePane->SetTextToDefaultL(); } else { TBuf titleText( NULL ); iEikonEnv->ReadResource( titleText, resourceId ); titlePane->SetTextL( titleText ); } } // ---------------------------------------------------------------------------- // CTwoFormsView::DoActivateL() // Creates container class object. // ---------------------------------------------------------------------------- // void CTwoFormsView::DoActivateL( const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/ ) { // Creates container object. if ( !iContainer ) { iContainer = new( ELeave ) CTwoFormsContainer( this ); iContainer->SetMopParent( this ); iContainer->ConstructL( ClientRect()); // Adds container to view control stack. AppUi()->AddToStackL( *this, iContainer ); } } // ---------------------------------------------------------------------------- // void CTwoFormsView::DoDeactivate() // Deletes container class object. // ---------------------------------------------------------------------------- // void CTwoFormsView::DoDeactivate() { // Deletes the container class object. if ( iContainer ) { // Removes container from view control stack. AppUi()->RemoveFromStack( iContainer ); delete iContainer; iContainer = NULL; } } // ---------------------------------------------------------------------------- // CTwoFormsAdd::CTwoFormsAdd() // C++ default constructor can NOT contain any code, that // might leave. // ---------------------------------------------------------------------------- // CTwoFormsAdd::CTwoFormsAdd() { } // ---------------------------------------------------------------------------- // CTwoFormsAdd::~CTwoFormsAdd() // Destructor // ---------------------------------------------------------------------------- // CTwoFormsAdd::~CTwoFormsAdd() { } // ---------------------------------------------------------------------------- // void CTwoFormsAdd::AddItemL() // Add item for testing uses customised dialog. // ---------------------------------------------------------------------------- // void CTwoFormsAdd::AddItemL() { } // End of File