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