remotecontrol/remotecontrolfw/server/inc/convertermanager.h
changeset 51 20ac952a623c
equal deleted inserted replaced
48:22de2e391156 51:20ac952a623c
       
     1 // Copyright (c) 2004-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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef CONVERTERMANAGER_H
       
    22 #define CONVERTERMANAGER_H
       
    23 
       
    24 #include <e32base.h>
       
    25 
       
    26 class CRemConConverterPlugin;
       
    27 class MRemConConverterInterface;
       
    28 
       
    29 /**
       
    30 Converter manager.
       
    31 */
       
    32 NONSHARABLE_CLASS(CConverterManager) : public CBase
       
    33 	{
       
    34 public:
       
    35 	/**
       
    36 	Converter manager construction.
       
    37 	@return Ownership of a new CConverterManager object
       
    38 	*/
       
    39 	static CConverterManager* NewL();
       
    40 
       
    41 	/** Destructor. */
       
    42 	~CConverterManager();
       
    43 
       
    44 public:
       
    45 	/** Returns the converter interface which supports the given outer-layer 
       
    46 	API and bearer UIDs, or NULL if it does not exist. */
       
    47 	MRemConConverterInterface* Converter(TUid aInterfaceUid, TUid aBearerUid) const;
       
    48 	
       
    49 	/** Returns the converter interface which supports the given outer-layer 
       
    50 	API and bearer UIDs, or NULL if it does not exist. */
       
    51 	MRemConConverterInterface* Converter(const TDesC8& aInterfaceData, TUid aBearerUid) const;
       
    52 
       
    53 private:
       
    54 	/** Constructor. */
       
    55 	CConverterManager();
       
    56 	
       
    57 	/** 2nd-phase construction. */
       
    58 	void ConstructL();
       
    59 
       
    60 private: // utility
       
    61 	/** Called during (2-phase) construction to instantiate all the converter 
       
    62 	plugins, from ROM only. */
       
    63 	void LoadAllConvertersL();
       
    64 	
       
    65 #ifdef __FLOG_ACTIVE
       
    66 	void LogConverters() const;
       
    67 #endif // __FLOG_ACTIVE
       
    68 
       
    69 private: // owned
       
    70 	RPointerArray<CRemConConverterPlugin> iConverters;
       
    71 
       
    72 	// Struct wrapping a pointer to a converter interface object with the UID 
       
    73 	// identifying that interface and the UID identifying the converter 
       
    74 	// supplying the interface.
       
    75 	// In the current implementation iIfUid will always be the same as we've 
       
    76 	// only (so far) released one version of the converter API.
       
    77 	struct TInterfaceInfo
       
    78 		{
       
    79 		MRemConConverterInterface* iIf;
       
    80 		TUid iIfUid;
       
    81 		TUid iConverterUid;
       
    82 		};
       
    83 	RArray<TInterfaceInfo> iConverterIfs;
       
    84 	};
       
    85 
       
    86 #endif // CONVERTERMANAGER_H