|
Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
|
Abstract base class for: drawing a picture to a graphics context, storing and restoring the picture. More...
#include <gdi.h>
Public Types | |
| enum | TDetach { EDetachFull , EDetachDraw } |
| Options for detaching pictures from stores. More... | |
Public Member Functions | |
| virtual IMPORT_C | ~CPicture () |
| Frees all resources owned by the object prior to its destruction. | |
| virtual void | Draw (CGraphicsContext &aGc, const TPoint &aTopLeft, const TRect &aClipRect, MGraphicsDeviceMap *aMap) const =0 |
| Draws a picture. | |
| virtual IMPORT_C TStreamId | StoreL (CStreamStore &aStore) const |
| Stores the picture to the specified store. | |
| virtual void | DetachFromStoreL (TDetach=EDetachFull) |
| virtual void | ExternalizeL (RWriteStream &aStream) const =0 |
| Externalises the picture to a stream. | |
| virtual void | GetOriginalSizeInTwips (TSize &aSize) const =0 |
| Gets the pictur's original size, in twips. | |
| virtual IMPORT_C void | SetScaleFactor (TInt aScaleFactorWidth, TInt aScaleFactorHeight) |
| Sets the picture's scale factors. | |
| virtual IMPORT_C void | SetCropInTwips (const TMargins &aMargins) |
| Sets the cropping margins of a picture in twips. | |
| virtual IMPORT_C TPictureCapability | Capability () const |
| Gets the picture's capabilities. | |
| virtual IMPORT_C void | GetCropInTwips (TMargins &aMargins) const |
| Gets the cropping margins of a picture in twips. | |
| virtual IMPORT_C TInt | ScaleFactorWidth () const |
| Gets the picture's width scale factor. | |
| virtual IMPORT_C TInt | ScaleFactorHeight () const |
| Gets the pictures height scale factor. | |
| virtual IMPORT_C TBool | LineBreakPossible (TUint aClass, TBool aBeforePicture, TBool aHaveSpaces) const |
| States whether a line break is possible, either before or after a picture. | |
| virtual IMPORT_C TBool | NativePixelSize (TSize &aPixelSize) |
| Derived classes might be implemented as bitmaps, in that case it might be interesting to now the native pixel size of the bitmap. | |
| IMPORT_C void | GetSizeInPixels (MGraphicsDeviceMap *aMap, TSize &aSize) const |
| Gets the picture's size in pixels. | |
| IMPORT_C void | SetSizeInPixels (MGraphicsDeviceMap *aMap, const TSize &aSize) |
| Sets the picture's size in pixels. | |
| IMPORT_C void | AddCropInPixels (MGraphicsDeviceMap *aMap, const TMargins &aMargins) |
| Adds pixel cropping margins to the picture. | |
| IMPORT_C void | GetSizeInTwips (TSize &aSize) const |
| Gets the picture's size, in twips. | |
| IMPORT_C void | SetSizeInTwips (const TSize &aSize) |
| Sets the picture's size, in twips. | |
| IMPORT_C void | ResetToOriginal () |
| Resets the picture's scaling and cropping attributes to their original values. | |
Public Member Functions inherited from CBase | |
| CBase () | |
| Default constructor. | |
| virtual IMPORT_C | ~CBase () |
| Virtual destructor. | |
| TAny * | operator new (TUint aSize, TAny *aBase) __NO_THROW |
| Initialises the object to binary zeroes. | |
| TAny * | operator new (TUint aSize) __NO_THROW |
| Allocates the object from the heap and then initialises its contents to binary zeroes. | |
| TAny * | operator new (TUint aSize, TLeave) |
| Allocates the object from the heap and then initialises its contents to binary zeroes. | |
| TAny * | operator new (TUint aSize, TUint aExtraSize) __NO_THROW |
| Allocates the object from the heap and then initialises its contents to binary zeroes. | |
| TAny * | operator new (TUint aSize, TLeave, TUint aExtraSize) |
| Allocates the object from the heap and then initialises its contents to binary zeroes. | |
Protected Member Functions | |
| IMPORT_C | CPicture () |
Protected Member Functions inherited from CBase | |
| virtual IMPORT_C TInt | Extension_ (TUint aExtensionId, TAny *&a0, TAny *a1) |
| Extension function. | |
Additional Inherited Members | |
Static Public Member Functions inherited from CBase | |
| static IMPORT_C void | Delete (CBase *aPtr) |
| Deletes the specified object. | |
Abstract base class for: drawing a picture to a graphics context, storing and restoring the picture.
The class defines the protocol for a number of concrete picture classes. Its main role is to support glass doors used in object embedding.
The class provides a protocol for the provision of scaling and cropping functions by derived classes, together with default implementations.
Its main function is Draw(), which draws the picture onto the graphics context at a particular point. It also has two important pure virtual functions: ExternalizeL() and GetOriginalSizeInTwips().
A picture has both an original representation and an on-screen representation. The original representation has a size in twips, and can somehow be drawn. The on-screen representation is assumed to be drawn under the control of an application which may wish to re-size or scale the original in some way, to crop it at the edges, and/or to ensure it fits within a particular defined area on the screen.
The class provides several functions that allow an application to set scaling and cropping before invoking the Draw() function to draw the picture on-screen. It is up to the internal workings of the function to determine the order of application cropping and scaling.
| enum CPicture::TDetach |
Options for detaching pictures from stores.
Used by DetachFromStoreL().
|
virtual |
Frees all resources owned by the object prior to its destruction.
(generated from Symbian Developer Library)
|
protected |
| IMPORT_C void CPicture::AddCropInPixels | ( | MGraphicsDeviceMap * | aMap, |
| const TMargins & | aMargins | ||
| ) |
Adds pixel cropping margins to the picture.
| aMap | The pixels to twips mapping interface of the graphics device |
| aMargins | The additional pixel cropping margins for the picture, in pixels. |
(generated from Symbian Developer Library)
|
virtual |
Gets the picture's capabilities.
These include whether it is scalable and croppable.
(generated from Symbian Developer Library)
|
inlinevirtual |
|
pure virtual |
Draws a picture.
| aGc | The graphics context. |
| aTopLeft | The co-ordinates where the top left corner pixel of the picture should be placed. Note that whether this is actually drawn depends on the clipping area defined. |
| aClipRect | A clipping rectangle that defines the area to which the function should draw. An implementation should never draw outside this rectangle. Note that the graphics context may also have a clipping rectangle set on it. |
| aMap | The device map for the graphics device. The implementation should use this to find the scaling to apply to the picture. |
|
pure virtual |
Externalises the picture to a stream.
The presence of this function means that the standard templated stream operator<<() is available to externalise objects of this class.
A derived class must supply an implementation of this function.
| aStream | The write stream. |
|
virtual |
Gets the cropping margins of a picture in twips.
These margins are relative to the original unscaled size of the picture.
| aMargins | The cropping margins of the picture, in twips |
(generated from Symbian Developer Library)
|
pure virtual |
Gets the pictur's original size, in twips.
| aSize | The size of the picture, in twips |
| IMPORT_C void CPicture::GetSizeInPixels | ( | MGraphicsDeviceMap * | aMap, |
| TSize & | aSize | ||
| ) | const |
Gets the picture's size in pixels.
This is calculated from the original size of the picture, taking cropping and scaling into account.
| aMap | The pixels to twips mapping interface of the graphics device |
| aSize | The size of the picture, in pixels. |
(generated from Symbian Developer Library)
| IMPORT_C void CPicture::GetSizeInTwips | ( | TSize & | aSize | ) | const |
Gets the picture's size, in twips.
This size is calculated from the original size of the picture, taking cropping and scaling into account.
| aSize | The size of the picture, in twips. |
(generated from Symbian Developer Library)
|
virtual |
States whether a line break is possible, either before or after a picture.
The default implementation returns ETrue, implying that there is a break opportunity both before and after the picture, whether or not a space is present.
This may be overridden for special types of pictures.
| aClass | The line breaking class of the adjacent character. Line breaking classes are defined in the header file, tagma.h |
| aBeforePicture | ETrue, if the adjacent character is before the picture; EFalse, if the adjacent character is afterwards. |
| aHaveSpaces | ETrue, if spaces occur between the adjacent character and the picture; EFalse, otherwise. |
(generated from Symbian Developer Library)
|
virtual |
Derived classes might be implemented as bitmaps, in that case it might be interesting to now the native pixel size of the bitmap.
(generated from Symbian Developer Library)
| IMPORT_C void CPicture::ResetToOriginal | ( | ) |
Resets the picture's scaling and cropping attributes to their original values.
(generated from Symbian Developer Library)
|
virtual |
Gets the pictures height scale factor.
(generated from Symbian Developer Library)
|
virtual |
Gets the picture's width scale factor.
(generated from Symbian Developer Library)
|
virtual |
Sets the cropping margins of a picture in twips.
These are relative to the original unscaled size of the picture.
| aMargins | The cropping margins of the picture, in twips. |
(generated from Symbian Developer Library)
|
virtual |
Sets the picture's scale factors.
| aScaleFactorWidth | The width scale factor, in percent. |
| aScaleFactorHeight | The height scale factor, in percent. |
(generated from Symbian Developer Library)
| IMPORT_C void CPicture::SetSizeInPixels | ( | MGraphicsDeviceMap * | aMap, |
| const TSize & | aSize | ||
| ) |
Sets the picture's size in pixels.
| aMap | The pixels to twips mapping interface of the graphics device. |
| aSize | The size of the picture, in pixels. |
(generated from Symbian Developer Library)
| IMPORT_C void CPicture::SetSizeInTwips | ( | const TSize & | aSize | ) |
Sets the picture's size, in twips.
| aSize | The size of the picture, in twips. |
(generated from Symbian Developer Library)
|
virtual |
Stores the picture to the specified store.
The default implementation assumes that the content of the picture is externalized to a single stream. The implementation may need to be changed for those derived classes that have components.
| aStore | The store. |
(generated from Symbian Developer Library)