Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <APGDOOR.H>
Link against: apgrfx.lib

Class CApaDoor

class CApaDoor : public CApaDoorBase;

Description

A wrapper for an embedded document that can be displayed in a user interface as an icon or a glass door.

Derivation

Members

Defined in CApaDoor:

Inherited from CApaDoorBase:

Inherited from CBase:

Inherited from CPicture:


Construction and destruction


NewLC(RFs &,CApaDocument &,const TSize &)

IMPORT_C static CApaDoor* NewLC(RFs &aFs, CApaDocument &aDoc, const TSize &aDefaultIconSizeInTwips);

Description

Creates a new wrapper for the specified embedded document and places a pointer to it onto the cleanup stack.

The door is of the specified size. The wrapper takes ownership of the document; if creation of the wrapper fails, the document object is destroyed.

Parameters

RFs &aFs

A file server session.

CApaDocument &aDoc

The document for which the door is to be created.

const TSize &aDefaultIconSizeInTwips

The size of the door in twips.

Return value

CApaDoor *

The new embedded document wrapper object.


NewL(RFs &,CApaDocument &,const TSize &)

IMPORT_C static CApaDoor* NewL(RFs &aFs, CApaDocument &aDoc, const TSize &aDefaultIconSizeInTwips);

Description

Creates a new wrapper for the specified embedded document.

The door is of the specified size. The wrapper takes ownership of the document; if creation of the wrapper fails, the document object is destroyed.

Parameters

RFs &aFs

A file server session.

CApaDocument &aDoc

The document for which the door is to be created.

const TSize &aDefaultIconSizeInTwips

The size of the door in twips.

Return value

CApaDoor *

The new embedded document wrapper object.


NewL(RFs &,const CStreamStore &,TStreamId,CApaProcess &)

IMPORT_C static CApaDoor* NewL(RFs &aFs, const CStreamStore &aStore, TStreamId aStreamId, CApaProcess &aProcess);

Description

Parameters

RFs &aFs

const CStreamStore &aStore

TStreamId aStreamId

CApaProcess &aProcess

Return value

CApaDoor *


~CApaDoor()

IMPORT_C ~CApaDoor();

Description

Destructor.

Frees all resources owned by the object, prior to its destruction. In particular, it destroys the document, removing all references to it from the application process.

[Top]


Member functions


SetFormatToIconL()

IMPORT_C void SetFormatToIconL();

Description

Sets the format of the door to iconic.

The application's icon is used, or, if this cannot be found, the default icon is used instead. The function leaves only if construction of the default icon object fails.


SetFormatToGlassL()

IMPORT_C void SetFormatToGlassL();

Description

Sets the format of the door to glass.

The function asks the document to create a fresh copy of the door and destroys any existing copy. If the process of creating the door completes without leaving, but returns a zero pointer, then the function raises an APGRFX 17 panic.

The function leaves with:

KErrNotSupported, if the document does not support being represented by a glass door.

KErrNotFound, if the application DLL cannot be found.

If the function leaves, the format remains unchanged.

See also:


SetFormatToTemporaryIconL(TBool)

IMPORT_C void SetFormatToTemporaryIconL(TBool aEnabled=ETrue);

Description

Switches the format of the door between temporarily iconic and glass.

If the door is iconic, then the function does nothing.

Parameters

TBool aEnabled

If ETrue and the format is currently glass, then the format switches to temporarily iconic; this is the default. If EFalse and the format is currently temporarily iconic, then the format switches to glass.


DocumentL(TBool)

IMPORT_C CApaDocument* DocumentL(TBool aCheckPassword=EFalse);

Description

Returns a pointer to the embedded document represented by this wrapper.

If necessary, the document is restored from its embedded store.

Note that if the wrapper does not have a reference to the embedded document store, then the function raises a APGRFX 13 panic. Constructing this wrapper through a TApaPictureFactory or storing the embedded document through CApaDoor::StoreL(CStreamStore &)const ensures that this wrapper has a reference to the embedded document store.

Parameters

TBool aCheckPassword

If ETrue, any password is checked before returning a pointer to the document. If EFalse, the password is not checked.

Return value

CApaDocument *

A pointer to the embedded document.

See also:


Caption()const

inline TDesC* Caption() const;

Description

Gets the name of the application with which the embedded document is associated.

Return value

TDesC16 *

A pointer to a descriptor containing the name of the application.


AppUidL()const

IMPORT_C TUid AppUidL() const;

Description

Gets the application specific UID associated with the embedded document.

Return value

TUid

The application specific UID.


RestoreL(const CStreamStore &,TStreamId)

IMPORT_C void RestoreL(const CStreamStore &aStore, TStreamId aHeadStreamId);

Description

Restores the embedded document from the specified store.

The format of the door is set to iconic if the embedded document is password protected.

Parameters

const CStreamStore &aStore

The store from which the embedded document is to be restored.

TStreamId aHeadStreamId

The stream ID of the head stream for the embedded document. This stream contains the stream dictionary through which the embedded document and its door can be restored.


StoreL(CStreamStore &)const

virtual TStreamId StoreL(CStreamStore &aStore) const;

Description

Stores the embedded document in the specified store as an embedded store.

This function saves the format of the door. It also stores the document, if the document exists in memory, otherwise, it simply copies the stream containing the embedded document into the specified store.

Parameters

CStreamStore &aStore

The store into which the embedded document is to be stored.

Return value

TStreamId

The stream ID of the head stream for the embedded document. This stream contains the stream dictionary through which the embedded document and its door can be restored.


Draw(CGraphicsContext &,const TPoint &,const TRect &,MGraphicsDeviceMap *)const

virtual void Draw(CGraphicsContext &aGc, const TPoint &aTopLeft, const TRect &aClipRect, MGraphicsDeviceMap *aMap) const;

Description

Draws the door either as glass or as an icon depending on the format.

Parameters

CGraphicsContext &aGc

The graphics context.

const TPoint &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.

const TRect &aClipRect

A clipping rectangle.

MGraphicsDeviceMap *aMap

The device map for the graphics device.


DetachFromStoreL(TDetach)

virtual void DetachFromStoreL(TDetach aDegree=EDetachFull);

Description

Detaches the door from its store, restoring any unrestored elements of the picture, if necessary.

Parameters

CPicture::TDetach aDegree

Degree to which picture is detached.

See also:


GetOriginalSizeInTwips(TSize &)const

virtual void GetOriginalSizeInTwips(TSize &aSize) const;

Description

Get the door's original size, in twips.

Parameters

TSize &aSize

The size, in twips.


SetScaleFactor(TInt,TInt)

virtual void SetScaleFactor(TInt aScaleFactorWidth, TInt aScaleFactorHeight);

Description

Sets the door's scale factors.

Parameters

TInt aScaleFactorWidth

The width scale factor, in percent.

TInt aScaleFactorHeight

The height scale factor, in percent.


SetCropInTwips(const TMargins &)

virtual void SetCropInTwips(const TMargins &aMargins);

Description

Sets the cropping margins of a picture in twips.

These are relative to the original unscaled size of the picture.

Parameters

const TMargins &aMargins

The cropping margins, in twips.


Capability()const

virtual TPictureCapability Capability() const;

Description

Gets the picture's capabilities.

These include whether it is scalable and croppable.

Return value

TPictureCapability

The capabilities of the picture.


GetCropInTwips(TMargins &)const

virtual void GetCropInTwips(TMargins &aMargins) const;

Description

Gets the cropping margins of the door in twips.

These margins are relative to the original unscaled size of the picture.

Parameters

TMargins &aMargins

The cropping margins, in twips.


ScaleFactorWidth()const

virtual TInt ScaleFactorWidth() const;

Description

Gets the door's width scale factor.

Return value

TInt

The width scale factor, in percent.


ScaleFactorHeight()const

virtual TInt ScaleFactorHeight() const;

Description

Gets the door's height scale factor.

Return value

TInt

The height scale factor, in percent.


ExternalizeL(RWriteStream &)const

private: virtual void ExternalizeL(RWriteStream &aStream) const;

Description

Externalises the picture to a stream.

The presence of this function means that the standard templated stream operator<<(RWriteStream &,const T &) is available to externalise objects of this class.

A derived class must supply an implementation of this function.

Parameters

RWriteStream &aStream

The write stream.


GlassDoorSize()const

private: virtual TSize GlassDoorSize() const;

Description

Returns the size of the glass door, in twips.

A concrete implementation of this function is provided by derived classes.

Return value

TSize

The size of the glass door, in twips.