examples/sfexamples/Wikipedia/src/AboutContainer.cpp

00001 // 
00002 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
00003 // All rights reserved.
00004 // This component and the accompanying materials are made available
00005 // under the terms of the License "Eclipse Public License v1.0"
00006 // which accompanies this distribution, and is available
00007 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00008 // 
00009 // Initial Contributors:
00010 // Nokia Corporation - initial contribution.
00011 // 
00012 // Contributors:
00013 // 
00014 // Description:
00015 // 
00016 
00017 
00018 // INCLUDE FILES
00019 #include "AboutContainer.h"
00020 #include "AboutView.h"
00021 #include <charconv.h>
00022 
00023 #ifdef __WINS__
00024 _LIT(KAboutTextFile, "C:\\Wikipedia\\wikipedia_about.htm");
00025 #else
00026 _LIT(KAboutTextFile, "e:\\Wikipedia\\wikipedia_about.htm");
00027 #endif
00028 // ========================= MEMBER FUNCTIONS ==================================
00029 
00030 // -----------------------------------------------------------------------------
00031 // CAboutContainer::NewL()
00032 // Two-phased constructor.
00033 // -----------------------------------------------------------------------------
00034 //
00035 CAboutContainer* CAboutContainer::NewL( const TRect& aRect, CAboutView& aView )
00036     {
00037     CAboutContainer* self = CAboutContainer::NewLC( aRect, aView );
00038     CleanupStack::Pop( self );
00039     return self;
00040     }
00041 
00042 
00043 // -----------------------------------------------------------------------------
00044 // CAboutContainer::NewLC()
00045 // Two-phased constructor.
00046 // -----------------------------------------------------------------------------
00047 //
00048 CAboutContainer* CAboutContainer::NewLC( const TRect& aRect, CAboutView& aView )
00049     {
00050     CAboutContainer* self = new ( ELeave ) CAboutContainer( aView );
00051     CleanupStack::PushL( self );
00052     self->ConstructL( aRect );
00053     return self;
00054     }
00055 
00056 // -----------------------------------------------------------------------------
00057 // CAboutContainer::ConstructL()
00058 // Symbian 2nd phase constructor can leave.
00059 // -----------------------------------------------------------------------------
00060 //
00061 void CAboutContainer::ConstructL( const TRect& aRect )
00062     {    
00063     CBrowserContainer::ConstructL(aRect);
00064         
00065     // This S60 code causes a memory leak
00066     iBrowser->LoadFileL( KAboutTextFile );      
00067         
00068     ScrollBrowserToTopL();      
00069     }
00070 
00071 CAboutContainer::CAboutContainer( CAboutView& aView ):
00072         CBrowserContainer(aView)
00073         {       
00074         // No implementation
00075         }
00076 
00077 // -----------------------------------------------------------------------------
00078 // CAboutContainer::OfferKeyEventL
00079 // 
00080 // (other items were commented in a header).
00081 // -----------------------------------------------------------------------------
00082 //
00083 TKeyResponse CAboutContainer::OfferKeyEventL(
00084     const TKeyEvent& aKeyEvent, TEventCode aType )
00085     {
00086     return iBrowser->OfferKeyEventL( aKeyEvent, aType );
00087     }
00088 
00089 // End of File

Generated by  doxygen 1.6.2