DirectPrint/inc/directprintuiplugin.h
branchRCL_3
changeset 12 613a5ff70823
child 15 2275db202402
equal deleted inserted replaced
8:3f1fec088555 12:613a5ff70823
       
     1 /*
       
     2 * Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
       
     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 * Kanrikogaku Kenkyusho, Ltd. - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * {Description of the file}
       
    16 *
       
    17 */
       
    18 
       
    19 // Protection against nested includes
       
    20 #ifndef _DIRECTPRINTUIPLUGIN_H_
       
    21 #define _DIRECTPRINTUIPLUGIN_H_
       
    22 
       
    23 // System includes
       
    24 #include <e32base.h>
       
    25 #include <coecntrl.h>
       
    26 #include <ecom.h>
       
    27 
       
    28 // User includes
       
    29 #include "directprintpropertydata.h"
       
    30 
       
    31 // Forward declarations
       
    32 class CAknSettingItemArray;
       
    33 class RReadStream;
       
    34 class RWriteStream;
       
    35 
       
    36 //Constants
       
    37 /**  Interface UID */
       
    38 const TUid KUidDirectPrintUiPluginInterface = { 0x2002BB33 };
       
    39 
       
    40 // Class declaration
       
    41 /**
       
    42  *  Ui plugin class
       
    43  *  more_complete_description
       
    44  */
       
    45 class CDirectPrintUiPlugin : public CBase
       
    46 	{
       
    47 public:
       
    48 	inline static CDirectPrintUiPlugin* NewL(TUid aUid);
       
    49 	inline static CDirectPrintUiPlugin* NewL(const TDesC8& aKey);
       
    50 	virtual ~CDirectPrintUiPlugin();
       
    51 
       
    52 public:
       
    53 	inline static void GetPluginListL(RImplInfoPtrArray& aArray);
       
    54 
       
    55 public:
       
    56 	virtual void InternalizePropertiesL(RReadStream& aStream) = 0;
       
    57 	virtual void ExternalizePropertiesL(RWriteStream& aStream) = 0;
       
    58 
       
    59 	virtual void LoadExtendItemsL(CAknSettingItemArray& aArray, TInt aId) = 0;
       
    60 	virtual void ReadDataL(TDirectPrintPropertyData& aData) = 0;
       
    61 	virtual void WriteDataL(RDPPropertyDataArray& aArray) = 0;
       
    62 	virtual void NewDataL() = 0;
       
    63 
       
    64 protected:
       
    65 	inline CDirectPrintUiPlugin();
       
    66 
       
    67 private:
       
    68 	TUid iDtor_ID_Key;
       
    69 	};
       
    70 
       
    71 
       
    72 // Inline codepart
       
    73 inline CDirectPrintUiPlugin::CDirectPrintUiPlugin()
       
    74 	{
       
    75 	}
       
    76 
       
    77 inline CDirectPrintUiPlugin* CDirectPrintUiPlugin::NewL(TUid aUid)
       
    78 	{
       
    79 	TAny* any = REComSession::CreateImplementationL(aUid, _FOFF(CDirectPrintUiPlugin, iDtor_ID_Key));
       
    80 	CDirectPrintUiPlugin* plugin = reinterpret_cast<CDirectPrintUiPlugin*>(any);
       
    81 	return plugin;
       
    82 	}
       
    83 
       
    84 inline CDirectPrintUiPlugin* CDirectPrintUiPlugin::NewL(const TDesC8& aKey)
       
    85 	{
       
    86 	TEComResolverParams params;
       
    87 	params.SetDataType(aKey);
       
    88 	params.SetWildcardMatch(ETrue);
       
    89 
       
    90 	TAny* any = REComSession::CreateImplementationL(KUidDirectPrintUiPluginInterface, _FOFF(CDirectPrintUiPlugin, iDtor_ID_Key), NULL, params);
       
    91 	CDirectPrintUiPlugin* plugin = reinterpret_cast<CDirectPrintUiPlugin*>(any);
       
    92 	return plugin;
       
    93 	}
       
    94 
       
    95 inline CDirectPrintUiPlugin::~CDirectPrintUiPlugin()
       
    96 	{
       
    97 	REComSession::DestroyedImplementation(iDtor_ID_Key);
       
    98 	}
       
    99 
       
   100 inline void CDirectPrintUiPlugin::GetPluginListL(RImplInfoPtrArray& aArray)
       
   101 	{
       
   102 	REComSession::ListImplementationsL(KUidDirectPrintUiPluginInterface, aArray);
       
   103 	}
       
   104 
       
   105 #endif // _DIRECTPRINTUIPLUGIN_H_