os/ossrv/lowlevellibsandfws/pluginfw/Framework/frame/DiscovererObserver.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // The interface definition for the MDiscovererObserver class
    15 // 
    16 //
    17 
    18 #ifndef __DISCOVEREROBSERVER_H__
    19 #define __DISCOVEREROBSERVER_H__
    20 
    21 #include <e32base.h>
    22 #include <f32file.h>
    23 
    24 class CPluginBase;
    25 
    26 /**
    27 @internalComponent
    28 Type for distinguishing between the processing stages of plugins
    29 */
    30 enum TPluginProcessingTypeIdentifier
    31 	{
    32 	EPluginProcessingTypeNonCriticalOnly, //plugins discovered non-critical stage of start-up
    33 	EPluginProcessingTypeCriticalOnly,	  //plugins discovered at critical stage of start-up
    34 	EPluginProcessingTypeAll,			  //all plugins
    35 	};
    36 
    37 /**
    38 	@internalComponent
    39 	@since 7.0
    40 	Responsible for managing the registry (adding and removing 
    41 	entries).
    42  */
    43 
    44 class MDiscovererObserver
    45 	{
    46 public:
    47 /**
    48 	@fn				DiscoveriesBegin()
    49 	Intended Usage	: Pure virtual method used by the CDiscoverer class
    50 					to signal that a discovery session is starting.
    51 	Error Condition	: None.
    52 	@since			7.0
    53 	@return			None.
    54 	@pre 			The MDiscovererObserver must be fully constructed, and
    55 					capable of accepting discoveries for registration.
    56 	@post			Discovery start is noted, and any appropriate action
    57 					for the observer is completed. 
    58  */
    59 	
    60 	virtual void DiscoveriesBegin() = 0;
    61 
    62 /**
    63 	@fn				RegisterDiscoveryL(const TDriveName& aDrive,CPluginBase*& aDirEntry, TBool aAnyDllDiscovered)
    64 	Intended Usage	: Pure virtual method used by the CDiscoverer class
    65 					to register a discovery.
    66 	Error Condition	: Depends upon the implementation class.
    67 	@leave  		Implementation class dependent. @see CRegistrar.
    68 	@since			9.1
    69 	@param			aDrive the drive containing this entry
    70 	@param			aDirEntry A reference to the Discovered directory entry.
    71 	@param 			aAnyDllDiscovered A flag to tell if any Dll is discovered in the drive.
    72 	@return			None.
    73 	@pre 			The MDiscovererObserver must be fully constructed, and
    74 					capable of accepting discoveries for registration.
    75 	@post			Discovery is registered.
    76  */
    77 	
    78 	virtual void RegisterDiscoveryL(const TDriveName& aDrive,CPluginBase*& aDirEntry, TBool aAnyDllDiscovered) = 0;
    79 	
    80 /**
    81 	@fn				DiscoveriesComplete(TBool aSuccessful,TPluginProcessingTypeIdentifier aProcessingType)
    82 	Intended Usage	: Pure virtual method used by the CDiscoverer class
    83 					to signal that a discovery session is complete.
    84 	Error Condition	: None.
    85 	@since			7.0
    86 	@param			aSuccessful ETrue indicates the scan completed successfully,
    87 					EFalse, that the scan was only partial.
    88 	@param			aProcessingType indicates the type of processing for plugins
    89 					for ensuring that plugins are not processed multiple times
    90 					during start-up phase
    91 	@return			None.
    92 	@pre 			The MDiscovererObserver must be fully constructed, and
    93 					capable of accepting discoveries for registration.
    94 	@post			Discovery completion is noted, and any appropriate action
    95 					for the observer is completed. 
    96  */
    97 	
    98 	virtual void DiscoveriesComplete(TBool aSuccessful, TPluginProcessingTypeIdentifier aProcessingType) = 0;
    99 
   100 /**
   101 	@fn				DriveRemovedL(TDriveUnit aDrive)
   102 	Intended Usage	:Pure virtual method used by the CDiscoverer class
   103 					to notify the observer that a drive letter
   104 					is no longer available for use.
   105 	Error Condition	: Leaves with an error code.
   106 	@leave  		Depends on implementation
   107 	@since			7.0	:
   108 	@param			aDrive	The drive identifier.
   109 	@pre 			The MDiscovererObserver must be fully constructed, and
   110 					capable of accepting discoveries for registration.
   111 	@post			Drive removal is noted, and any appropriate action
   112 					for the observer is completed. 
   113 					E.g. The registered Interface Implementation Collectionss
   114 					stored upon the specified drive are no 
   115 					longer available for use.
   116  */
   117 	
   118 	virtual void DriveRemovedL(TDriveUnit aDrive) = 0;
   119 
   120 /**
   121 	@fn				DriveReinstatedL(TDriveUnit aDrive)
   122 	Intended Usage	:Pure virtual method used by the CDiscoverer class
   123 					to notify the observer that a drive letter
   124 					has become available for use.
   125 	Error Condition	: None.	
   126 	@since			7.0	:
   127 	@param			aDrive	The drive identifier.
   128 	@pre 			The MDiscovererObserver must be fully constructed, and
   129 					capable of accepting discoveries for registration.
   130 	@post			Drive removal is noted, and any appropriate action
   131 					for the observer is completed. 
   132 					E.g. The registered Interface Implementation Collections
   133 					stored upon the specified drive are again 
   134 					made available for use.
   135  */
   136 	
   137 	virtual void DriveReinstatedL(TDriveUnit aDrive) = 0;
   138 
   139 /**
   140 	@fn				NotifiedWithErrorCode(TInt aError)
   141 	Intended Usage	:Pure virtual method used by the CDiscoverer class
   142 					to notify the observer that the notifier has been activated
   143 					with an error status code. The observer should instruct
   144 					the notification object how to proceed.
   145 	Error Condition	: None.	
   146 	@since			7.0	:
   147 	@param			aError	The error value recieved by the notifier.
   148 	@return			ETrue for ignore error, EFalse otherwise. 
   149 	@pre 			The MDiscovererObserver must be fully constructed, and
   150 					capable of accepting discoveries for registration.
   151 	@post			The status code should be used by the observer to instruct 
   152 					the notifier to cease recieving notifications or not.
   153  */
   154 	
   155 	virtual TBool NotifiedWithErrorCode(TInt aError) = 0;
   156 	
   157 /**
   158 	@fn 			IsAnyDllRegisteredWithDriveL(const TDriveUnit aDrive)
   159 	Intended Usage	:Pure virtual method used by the CDiscoverer class
   160 					to notify the observer to find if any Dll is registered
   161 					in the drive.
   162 	@param 			aDrive The identifier of the drive for any Dll registered info.
   163 	@return 		return if any Dll is registered in the drive.
   164 	@pre 			The MDiscovererObserver must be fully constructed, and
   165 					capable of accepting discoveries for registration.
   166 	@post			If any Dll registered will be returned.				 
   167 */
   168 	virtual TBool IsAnyDllRegisteredWithDriveL(const TDriveUnit aDrive) const = 0;
   169 
   170 /**
   171 	@fn 			SetDiscoveryFlagL(const TDriveUnit aDrive)
   172 	Intended Usage	:Pure virtual method used by the CDiscoverer class
   173 					to notify the observer to find the drive has changed.
   174 	@param 			aDrive The identifier of the drive changed.
   175 	@pre 			The MDiscovererObserver must be fully constructed, and
   176 					capable of accepting discoveries for registration.
   177 	@post			The flag is set.				 
   178 */	
   179 	virtual void SetDiscoveryFlagL(const TDriveUnit &aDrive) = 0;
   180 	
   181 /**
   182 	@fn				LanguageChangedL(TBool& aLanguageChanged)
   183 	Intended Usage	:Pure virtual method used by the CDiscoverer class
   184 					to notify the observer that the language switch notifier has been activated.
   185 					The observer should instruct the notification object how to proceed.
   186 	Error Condition	: Leaves with an error code.
   187 	@leave  		Depends on implementation
   188 	@since			9.3	:
   189 	@param			aLanguageChanged the flag returned to indicate whether language downgrade path is changed.
   190 	@pre 			The MDiscovererObserver must be fully constructed, and
   191 					capable of accepting discoveries for registration.
   192 	@post			The CRegistryData will have its iLanguageChanged 
   193 					flag set to True when language switch happens.
   194  */	
   195 	virtual void LanguageChangedL(TBool& aLanguageChanged) = 0;	
   196 	 	
   197 	};
   198 
   199 #endif // __DISCOVEREROBSERVER_H__