author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
parent 2 | 2fe1408b6811 |
permissions | -rw-r--r-- |
williamr@2 | 1 |
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 2 |
// All rights reserved. |
williamr@2 | 3 |
// This component and the accompanying materials are made available |
williamr@4 | 4 |
// under the terms of "Eclipse Public License v1.0" |
williamr@2 | 5 |
// which accompanies this distribution, and is available |
williamr@4 | 6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@2 | 7 |
// |
williamr@2 | 8 |
// Initial Contributors: |
williamr@2 | 9 |
// Nokia Corporation - initial contribution. |
williamr@2 | 10 |
// |
williamr@2 | 11 |
// Contributors: |
williamr@2 | 12 |
// |
williamr@2 | 13 |
// Description: |
williamr@2 | 14 |
// This is the plugin API for the Image Transform framework |
williamr@2 | 15 |
// |
williamr@2 | 16 |
// |
williamr@4 | 17 |
|
williamr@2 | 18 |
/** |
williamr@2 | 19 |
@file |
williamr@2 | 20 |
@publishedAll |
williamr@2 | 21 |
@released |
williamr@2 | 22 |
*/ |
williamr@2 | 23 |
|
williamr@2 | 24 |
#ifndef __IMAGETRANSFORMPLUGIN_H__ |
williamr@2 | 25 |
#define __IMAGETRANSFORMPLUGIN_H__ |
williamr@2 | 26 |
|
williamr@2 | 27 |
#include <e32base.h> |
williamr@2 | 28 |
#include <imagetransform.h> |
williamr@2 | 29 |
|
williamr@2 | 30 |
// fwd ref |
williamr@2 | 31 |
class CImageTransformFramework; |
williamr@2 | 32 |
class CImageTransformPluginExtension; |
williamr@2 | 33 |
|
williamr@2 | 34 |
/** |
williamr@2 | 35 |
This is the plugin API for the Image Transform framework |
williamr@2 | 36 |
Intended for use by plugin writers only. |
williamr@2 | 37 |
|
williamr@2 | 38 |
@publishedAll |
williamr@2 | 39 |
@released |
williamr@2 | 40 |
*/ |
williamr@2 | 41 |
class CImageTransformPlugin : public CBase |
williamr@2 | 42 |
{ |
williamr@2 | 43 |
friend class CImageTransformFramework; |
williamr@2 | 44 |
|
williamr@2 | 45 |
public: |
williamr@2 | 46 |
IMPORT_C ~CImageTransformPlugin(); |
williamr@2 | 47 |
|
williamr@2 | 48 |
protected: |
williamr@2 | 49 |
/** |
williamr@2 | 50 |
Initialise the plugin and check the image transform settings. |
williamr@2 | 51 |
|
williamr@2 | 52 |
This is called by the ImageTransform framework when the client app calls |
williamr@2 | 53 |
CImageTransform::SetupL(). |
williamr@2 | 54 |
|
williamr@2 | 55 |
The plugin should check the validity of the source image and all other settings |
williamr@2 | 56 |
set by the client API. If any of these is unsupported then it should leave with |
williamr@2 | 57 |
KErrNotSupported. |
williamr@2 | 58 |
|
williamr@2 | 59 |
A plugin implementing CImageTransformPluginExtension to allow extension of the |
williamr@2 | 60 |
client API should initialise it here. |
williamr@2 | 61 |
|
williamr@2 | 62 |
This is a virtual function that each individual plugin must implement. |
williamr@2 | 63 |
|
williamr@2 | 64 |
@leave KErrUnsupported |
williamr@2 | 65 |
The plugin decoder doesn not support the request transformation |
williamr@2 | 66 |
*/ |
williamr@2 | 67 |
virtual void OpenL() = 0; |
williamr@2 | 68 |
|
williamr@2 | 69 |
/** |
williamr@2 | 70 |
Initiate the image transform operation |
williamr@2 | 71 |
|
williamr@2 | 72 |
This is a virtual function that each individual plugin must implement. |
williamr@2 | 73 |
|
williamr@2 | 74 |
@param aStatus |
williamr@2 | 75 |
The client's request status. |
williamr@2 | 76 |
On completion contains an error code. |
williamr@2 | 77 |
KErrNone if image was transformed successfully, |
williamr@2 | 78 |
*/ |
williamr@2 | 79 |
virtual void Transform(TRequestStatus& aStatus) = 0; |
williamr@2 | 80 |
|
williamr@2 | 81 |
/** |
williamr@2 | 82 |
Cancel the image transform operation |
williamr@2 | 83 |
May be called by the framework even when there is no outstanding request. |
williamr@2 | 84 |
|
williamr@2 | 85 |
This is a virtual function that each individual plugin must implement. |
williamr@2 | 86 |
*/ |
williamr@2 | 87 |
virtual void CancelTransform() = 0; |
williamr@2 | 88 |
|
williamr@2 | 89 |
IMPORT_C CImageTransformPlugin(); |
williamr@2 | 90 |
|
williamr@2 | 91 |
// getters |
williamr@2 | 92 |
IMPORT_C TBool SourceIsFilename() const; |
williamr@2 | 93 |
IMPORT_C TBool SourceIsData() const; |
williamr@2 | 94 |
IMPORT_C const TDesC& SourceFilename() const; |
williamr@2 | 95 |
IMPORT_C const TDesC8& SourceData() const; |
williamr@2 | 96 |
IMPORT_C const TDesC8& SourceMimeType() const; |
williamr@2 | 97 |
IMPORT_C const TUid SourceImageType() const; |
williamr@2 | 98 |
IMPORT_C const TUid SourceImageSubType() const; |
williamr@2 | 99 |
IMPORT_C TBool SourceRect(TRect& aRect) const; |
williamr@2 | 100 |
IMPORT_C TBool DestIsFilename() const; |
williamr@2 | 101 |
IMPORT_C TBool DestIsData() const; |
williamr@2 | 102 |
IMPORT_C const TDesC& DestFilename() const; |
williamr@2 | 103 |
IMPORT_C HBufC8*& DestData() const; |
williamr@2 | 104 |
IMPORT_C const TSize& DestinationSizeInPixels() const; |
williamr@2 | 105 |
IMPORT_C TUint Options() const; |
williamr@2 | 106 |
IMPORT_C TBool MaintainAspectRatio() const; |
williamr@2 | 107 |
IMPORT_C TBool PreserveImageData() const; |
williamr@2 | 108 |
IMPORT_C virtual CImageTransformPluginExtension* Extension() const; |
williamr@2 | 109 |
|
williamr@2 | 110 |
private: |
williamr@2 | 111 |
IMPORT_C static CImageTransformPlugin* NewL( |
williamr@2 | 112 |
TUid aImplementationUid, CImageTransformFramework& aFramework); |
williamr@2 | 113 |
|
williamr@2 | 114 |
// Future proofing |
williamr@2 | 115 |
IMPORT_C virtual void ReservedVirtual1(); |
williamr@2 | 116 |
IMPORT_C virtual void ReservedVirtual2(); |
williamr@2 | 117 |
IMPORT_C virtual void ReservedVirtual3(); |
williamr@4 | 118 |
public: |
williamr@4 | 119 |
IMPORT_C virtual CImageTransformPluginExtension* Extension(TUid aExtensionUid, TInt& aError) const; |
williamr@2 | 120 |
|
williamr@2 | 121 |
private: |
williamr@2 | 122 |
CImageTransformFramework* iFramework; |
williamr@2 | 123 |
}; |
williamr@2 | 124 |
|
williamr@2 | 125 |
#endif // __IMAGETRANSFORMPLUGIN_H__ |
williamr@4 | 126 |