profilesservices/FileList/Src/CFLDBrowserLauncher.cpp
branchRCL_3
changeset 24 8ee96d21d9bf
parent 23 8bda91a87a00
child 25 7e0eff37aedb
equal deleted inserted replaced
23:8bda91a87a00 24:8ee96d21d9bf
     1 /*
       
     2 * Copyright (c) 2002 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:  Implementation for Download tones feature
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // CLASS HEADER
       
    21 #include    "CFLDBrowserLauncher.h"
       
    22 
       
    23 // INTERNAL INCLUDES
       
    24 #include    "CFLDCommandAbsorbingControl.h"
       
    25 
       
    26 // EXTERNAL INCLUDES
       
    27 #include    <browserlauncher.h>
       
    28 #include    <DocumentHandler.h>
       
    29 #include    <eikenv.h>
       
    30 #include    <apmstd.h>
       
    31 #include	<AiwCommon.h>
       
    32 #include    <browseroverriddensettings.h>
       
    33 #include    <favouriteslimits.h> // Context Id:s
       
    34 
       
    35 
       
    36 // ============================ MEMBER FUNCTIONS ===============================
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // CFLDBrowserLauncher::CFLDBrowserLauncher
       
    40 // C++ default constructor can NOT contain any code, that
       
    41 // might leave.
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 CFLDBrowserLauncher::CFLDBrowserLauncher()
       
    45     {
       
    46     }
       
    47 
       
    48 // -----------------------------------------------------------------------------
       
    49 // CFLDBrowserLauncher::ConstructL
       
    50 // Symbian 2nd phase constructor can leave.
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 void CFLDBrowserLauncher::ConstructL()
       
    54     {
       
    55     iBrowserLauncher = CBrowserLauncher::NewL();
       
    56     iDocumentHandler = CDocumentHandler::NewL( CEikonEnv::Static()->Process() );
       
    57     }
       
    58 
       
    59 // -----------------------------------------------------------------------------
       
    60 // CFLDBrowserLauncher::NewLC
       
    61 // Two-phased constructor.
       
    62 // -----------------------------------------------------------------------------
       
    63 //
       
    64 CFLDBrowserLauncher* CFLDBrowserLauncher::NewLC()
       
    65     {
       
    66     CFLDBrowserLauncher* self = new( ELeave ) CFLDBrowserLauncher();
       
    67     CleanupStack::PushL( self );
       
    68     self->ConstructL();
       
    69     return self;
       
    70     }
       
    71 
       
    72 // Destructor
       
    73 CFLDBrowserLauncher::~CFLDBrowserLauncher()
       
    74     {
       
    75     delete iDocumentHandler;
       
    76     delete iBrowserLauncher;
       
    77     }
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // CFLDBrowserLauncher::HandleContentL
       
    81 // (other items were commented in a header).
       
    82 // -----------------------------------------------------------------------------
       
    83 //
       
    84 TBool CFLDBrowserLauncher::HandleContentL(
       
    85 		 const TDesC& aFileName,
       
    86 	  		const CAiwGenericParamList& aParamList, TBool& aContinue )
       
    87 	{
       
    88 	TBool isSaved( EFalse );
       
    89 
       
    90     if( aParamList.Count() > 0 )
       
    91    		{
       
    92         TInt index( 0 );
       
    93         aParamList.FindFirst( index, EGenericParamFileSaved );
       
    94 
       
    95         if( index != KErrNotFound )
       
    96         	{
       
    97 	        isSaved = ( aParamList[ index ].Value().AsTInt32() );
       
    98        		}
       
    99 
       
   100          }
       
   101 
       
   102 	// Tone is NOT yet saved by a browser, save it by using DocHandler
       
   103 	if(!isSaved)
       
   104 		{
       
   105 		//Let documenthandler to find out the datatype
       
   106 		TDataType nullType;
       
   107 		iDocumentHandler->CopyL( aFileName, KNullDesC, nullType, NULL );
       
   108 		}
       
   109 	
       
   110 	aContinue = ETrue;
       
   111 	return ETrue;
       
   112 	}
       
   113 
       
   114 // -----------------------------------------------------------------------------
       
   115 // CFLDBrowserLauncher::HandleContentL
       
   116 // (other items were commented in a header).
       
   117 // -----------------------------------------------------------------------------
       
   118 //
       
   119 TAny* CFLDBrowserLauncher::DownloadedContentHandlerReserved1( TAny* /*aAnyParam*/ )
       
   120 	{
       
   121 	return NULL;
       
   122 	}
       
   123 
       
   124 // -----------------------------------------------------------------------------
       
   125 // CFLDBrowserLauncher::LaunchBrowserL
       
   126 // (other items were commented in a header).
       
   127 // -----------------------------------------------------------------------------
       
   128 //
       
   129 void CFLDBrowserLauncher::LaunchBrowserL()
       
   130     {
       
   131 	 // Absorb all key events and commands until browsing is finished
       
   132     CFLDCommandAbsorbingControl::NewLC(); // Discard pointer, it's in stack.
       
   133 
       
   134 	iBrowserLauncher->LaunchBrowserSyncEmbeddedL(
       
   135 	 KFavouritesAudioContextId );
       
   136 
       
   137     CleanupStack::PopAndDestroy(); // Browsing finished, remove command absorber.
       
   138 
       
   139     }
       
   140 
       
   141 //  End of File