installationservices/swi/inc/swidaemonplugin.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2005-2009 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 the License "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 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 /**
       
    22  @file
       
    23  @publishedPartner
       
    24  @released
       
    25 */
       
    26 
       
    27 #ifndef SWI_DAEMON_PLUGIN_H
       
    28 #define SWI_DAEMON_PLUGIN_H
       
    29 #include <ecom/ecom.h>
       
    30 
       
    31 class CSwiDaemonPlugin : public CBase
       
    32 	{
       
    33 public:
       
    34 	static CSwiDaemonPlugin *NewL();
       
    35 
       
    36 	/**
       
    37 	 * Media has been inserted with one, or more, valid (ie. correct
       
    38 	 * header), uninstalled, stub-SIS files on it. This will be
       
    39 	 * followed by one or more calls to RequestInstall for each SIS
       
    40 	 * file on this media.
       
    41 	 *
       
    42 	 * @param aDrive Drive being processed
       
    43 	 */
       
    44 	virtual void MediaProcessingStart( TInt aDrive ) = 0;
       
    45 
       
    46 	/**
       
    47 	 * @param aFile - RFile handle, valid until this function returns.
       
    48 	 *
       
    49 	 * The FS associated with the RHandle is marked for sharing (so
       
    50 	 * the RHandle can be passed to a server using
       
    51 	 * RFile::TransferToServer).
       
    52 	 * 
       
    53 	 * Note that immediately after this call, the RFile handle will be
       
    54 	 * closed. This means that the plugin must either duplicate it, or
       
    55 	 * synchronously send it to a server which adopts it before this
       
    56 	 * function returns.
       
    57 	 */
       
    58 	virtual void RequestInstall( RFile& aFile ) = 0;
       
    59 
       
    60 	/**
       
    61 	 * Normally a sequence of RequestInstall calls for each SIS file
       
    62 	 * on a media will be followed by a call to this function.
       
    63 	 *
       
    64 	 * Alternatively MediaRemoved might be called to abort the sequence.
       
    65 	 */
       
    66 	virtual void MediaProcessingComplete() = 0; 
       
    67 
       
    68 
       
    69 	/**
       
    70 	 * Media has been removed from drive.
       
    71 	 *
       
    72 	 * @param aDrive Drive number
       
    73 	 *
       
    74 	 * If the media in the drive specified by the last call to
       
    75 	 * MediaProcessingStart is removed, then this function will be
       
    76 	 * called, regardless of whether or not MediaProcessingComplete
       
    77 	 * has been called.
       
    78 	 *
       
    79 	 * This function may also be called when media is removed from any
       
    80 	 * drive.
       
    81 	 */
       
    82 	virtual void MediaRemoved( TInt aDrive ) = 0;
       
    83 
       
    84 	virtual ~CSwiDaemonPlugin();
       
    85 
       
    86 private:
       
    87 	TUid iDtor_ID_Key;
       
    88 	};
       
    89 
       
    90 _LIT8(KX,"X");
       
    91 inline CSwiDaemonPlugin *CSwiDaemonPlugin::NewL()
       
    92 	{
       
    93 	const TUid KSwiDriveWatcherPlugin = { 0x10274D07 };
       
    94 	TEComResolverParams resolverParams;
       
    95 	resolverParams.SetDataType(KX());
       
    96 	TAny *ptr = REComSession::CreateImplementationL(KSwiDriveWatcherPlugin,
       
    97 													_FOFF(CSwiDaemonPlugin, iDtor_ID_Key),
       
    98 													resolverParams,
       
    99 													KRomOnlyResolverUid);
       
   100 	return (CSwiDaemonPlugin *)ptr;
       
   101 	}
       
   102 
       
   103 
       
   104 inline CSwiDaemonPlugin::~CSwiDaemonPlugin()
       
   105 	{
       
   106 	REComSession::DestroyedImplementation(iDtor_ID_Key);
       
   107 	}
       
   108 
       
   109 
       
   110 #endif // SWI_DRIVEWATCHER_PLUGIN_H