imaging/imagingplugins/codecs/PNGCodec/PNGProxy.cpp
changeset 0 5752a19fdefe
equal deleted inserted replaced
-1:000000000000 0:5752a19fdefe
       
     1 // Copyright (c) 2001-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 #include <ecom/ecom.h>
       
    17 #include <ecom/implementationproxy.h>
       
    18 #include <icl/icl_uids.hrh>
       
    19 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    20 #include <icl/icl_uids_const.hrh>
       
    21 #include <icl/icl_uids_def.hrh>
       
    22 #endif
       
    23 #include "PNGCodec.h"
       
    24 #include "StreamDecoderIFace.hrh"
       
    25 #include "PngDecoderFactory.h"
       
    26 
       
    27 #include <icl/imageconstruct.h>
       
    28 
       
    29 class CPngDecodeConstruct : public CImageDecodeConstruct
       
    30 	{
       
    31 public:
       
    32 	static CPngDecodeConstruct* NewL();
       
    33 
       
    34 	// from CImageDecodeConstruct
       
    35 	CImageDecoderPlugin* NewPluginL() const;
       
    36 	};
       
    37 
       
    38 CPngDecodeConstruct* CPngDecodeConstruct::NewL()
       
    39 	{
       
    40 	CPngDecodeConstruct* self = new (ELeave) CPngDecodeConstruct;
       
    41 	CleanupStack::PushL(self);
       
    42 	self->ConstructL();
       
    43 	CleanupStack::Pop(self);
       
    44 	return self;
       
    45 	}
       
    46 
       
    47 CImageDecoderPlugin* CPngDecodeConstruct::NewPluginL() const
       
    48 	{
       
    49 	return CPngDecoder::NewL();
       
    50 	}
       
    51 
       
    52 class CPngEncodeConstruct : public CImageEncodeConstruct
       
    53 	{
       
    54 public:
       
    55 	static CPngEncodeConstruct* NewL();
       
    56 
       
    57 	// from CImageEncodeConstruct
       
    58 	CImageEncoderPlugin* NewPluginL() const;
       
    59 	};
       
    60 
       
    61 CPngEncodeConstruct* CPngEncodeConstruct::NewL()
       
    62 	{
       
    63 	CPngEncodeConstruct* self = new (ELeave) CPngEncodeConstruct;
       
    64 	CleanupStack::PushL(self);
       
    65 	self->ConstructL();
       
    66 	CleanupStack::Pop(self);
       
    67 	return self;
       
    68 	}
       
    69 
       
    70 CImageEncoderPlugin* CPngEncodeConstruct::NewPluginL() const
       
    71 	{
       
    72 	return CPngEncoder::NewL();
       
    73 	}
       
    74 
       
    75 // Exported proxy for instantiation method resolution
       
    76 
       
    77 // Define the Implementation UIDs for TIFF decoder
       
    78 const TImplementationProxy ImplementationTable[] =
       
    79 	{
       
    80 		IMPLEMENTATION_PROXY_ENTRY(KPNGDecoderImplementationUidValue, CPngDecodeConstruct::NewL),
       
    81 		IMPLEMENTATION_PROXY_ENTRY(KPNGEncoderImplementationUidValue, CPngEncodeConstruct::NewL),
       
    82 		IMPLEMENTATION_PROXY_ENTRY(KPngStreamDecoderFactoryImplUidValue, CPngImageStreamDecoderFactory::NewL)
       
    83 	};
       
    84 
       
    85 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
    86 	{
       
    87 	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
       
    88 	return ImplementationTable;
       
    89 	}