CApaDoor Class Reference

#include <mw/apgdoor.h>

Link against: apgrfx.lib

class CApaDoor : public CApaDoorBase, public CApaDoorBase
Public Member Functions
~CApaDoor()
IMPORT_C TUidAppUidL()
virtual TPictureCapability Capability()
TDesC *Caption()
virtual voidDetachFromStoreL(TDetach)
IMPORT_C CApaDocument *DocumentL(TBool)
virtual voidDraw(CGraphicsContext &, const TPoint &, const TRect &, MGraphicsDeviceMap *)
virtual voidGetCropInTwips(TMargins &)
virtual voidGetOriginalSizeInTwips(TSize &)
IMPORT_C CApaDoor *NewL(RFs &, CApaDocument &, const TSize &)
IMPORT_C CApaDoor *NewL(RFs &, const CStreamStore &, TStreamId, CApaProcess &)
IMPORT_C CApaDoor *NewLC(RFs &, CApaDocument &, const TSize &)
IMPORT_C voidRestoreL(const CStreamStore &, TStreamId)
virtual TInt ScaleFactorHeight()
virtual TInt ScaleFactorWidth()
virtual voidSetCropInTwips(const TMargins &)
IMPORT_C voidSetFormatToGlassL()
IMPORT_C voidSetFormatToIconL()
IMPORT_C voidSetFormatToTemporaryIconL(TBool)
virtual voidSetScaleFactor(TInt, TInt)
virtual TStreamId StoreL(CStreamStore &)
Inherited Attributes
CApaDoorBase::iFormat
CApaDoorBase::iSource
Inherited Enumerations
CApaDoorBase:TFormat
CPicture:TDetach
Inherited Functions
CApaDoorBase::CApaDoorBase()
CApaDoorBase::ExternalizeBaseStreamL(CStreamStore &,CStreamDictionary &)const
CApaDoorBase::Format()const
CApaDoorBase::InternalizeBaseStreamL(const CStreamStore &,const CStreamDictionary &)
CApaDoorBase::LineBreakPossible(TUint,TBool,TBool)const
CApaDoorBase::NativePixelSize(TSize &)
CApaDoorBase::SetSource(TUid)
CApaDoorBase::Source()const
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CPicture::AddCropInPixels(MGraphicsDeviceMap *,const TMargins &)
CPicture::CPicture()
CPicture::GetSizeInPixels(MGraphicsDeviceMap *,TSize &)const
CPicture::GetSizeInTwips(TSize &)const
CPicture::ResetToOriginal()
CPicture::SetSizeInPixels(MGraphicsDeviceMap *,const TSize &)
CPicture::SetSizeInTwips(const TSize &)
CPicture::~CPicture()

Detailed Description

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

Constructor & Destructor Documentation

~CApaDoor ( )

IMPORT_C~CApaDoor()

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.

Member Function Documentation

AppUidL ( )

IMPORT_C TUidAppUidL()const

Gets the application specific UID associated with the embedded document.

Return Value
The application specific UID.

Capability ( )

TPictureCapability Capability()const [virtual]

Reimplemented from CApaDoorBase::Capability()const

Gets the picture's capabilities.

These include whether it is scalable and croppable.

Return Value
The capabilities of the picture.

Caption ( )

TDesC *Caption()const [inline]

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

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

DetachFromStoreL ( TDetach )

voidDetachFromStoreL(TDetachaDegree = EDetachFull)[virtual]

Reimplemented from CPicture::DetachFromStoreL(TDetach)

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

See also: CApaDocument::DetachFromStoreL()

Parameters
aDegreeDegree to which picture is detached.

DocumentL ( TBool )

IMPORT_C CApaDocument *DocumentL(TBoolaCheckPassword = EFalse)

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() ensures that this wrapper has a reference to the embedded document store.

See also: TApaPictureFactory CApaDoor::StoreL() CApaDocument::ValidatePasswordL()

Parameters
aCheckPasswordIf ETrue, any password is checked before returning a pointer to the document. If EFalse, the password is not checked.
Return Value
A pointer to the embedded document.

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

voidDraw(CGraphicsContext &aGc,
const TPoint &aTopLeft,
const TRect &aClipRect,
MGraphicsDeviceMap *aMap
)const [virtual]

Reimplemented from CPicture::Draw(CGraphicsContext &,const TPoint &,const TRect &,MGraphicsDeviceMap *)const

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

Parameters
aGcThe graphics context.
aTopLeftThe 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.
aClipRectA clipping rectangle.
aMapThe device map for the graphics device.

GetCropInTwips ( TMargins & )

voidGetCropInTwips(TMargins &aMargins)const [virtual]

Reimplemented from CApaDoorBase::GetCropInTwips(TMargins &)const

Gets the cropping margins of the door in twips.

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

Parameters
aMarginsThe cropping margins, in twips.

GetOriginalSizeInTwips ( TSize & )

voidGetOriginalSizeInTwips(TSize &aSize)const [virtual]

Reimplemented from CPicture::GetOriginalSizeInTwips(TSize &)const

Get the door's original size, in twips.

Parameters
aSizeThe size, in twips.

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

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

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
aFsA file server session.
aDocThe document for which the door is to be created.
aDefaultIconSizeInTwipsThe size of the door in twips.
Return Value
The new embedded document wrapper object.

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

IMPORT_C CApaDoor *NewL(RFs &aFs,
const CStreamStore &aStore,
TStreamIdaStreamId,
CApaProcess &aProcess
)[static]

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

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

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
aFsA file server session.
aDocThe document for which the door is to be created.
aDefaultIconSizeInTwipsThe size of the door in twips.
Return Value
The new embedded document wrapper object.

RestoreL ( const CStreamStore &, TStreamId )

IMPORT_C voidRestoreL(const CStreamStore &aStore,
TStreamIdaHeadStreamId
)

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
aStoreThe store from which the embedded document is to be restored.
aHeadStreamIdThe 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.

ScaleFactorHeight ( )

TInt ScaleFactorHeight()const [virtual]

Gets the door's height scale factor.

Return Value
The height scale factor, in percent.

ScaleFactorWidth ( )

TInt ScaleFactorWidth()const [virtual]

Gets the door's width scale factor.

Return Value
The width scale factor, in percent.

SetCropInTwips ( const TMargins & )

voidSetCropInTwips(const TMargins &aMargins)[virtual]

Sets the cropping margins of a picture in twips.

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

Parameters
aMarginsThe cropping margins, in twips.

SetFormatToGlassL ( )

IMPORT_C voidSetFormatToGlassL()

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: CApaDocument::GlassPictureL()

SetFormatToIconL ( )

IMPORT_C voidSetFormatToIconL()

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.

SetFormatToTemporaryIconL ( TBool )

IMPORT_C voidSetFormatToTemporaryIconL(TBoolaEnabled = ETrue)

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

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

Parameters
aEnabledIf 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.

SetScaleFactor ( TInt, TInt )

voidSetScaleFactor(TIntaScaleFactorWidth,
TIntaScaleFactorHeight
)[virtual]

Sets the door's scale factors.

Parameters
aScaleFactorWidthThe width scale factor, in percent.
aScaleFactorHeightThe height scale factor, in percent.

StoreL ( CStreamStore & )

TStreamId StoreL(CStreamStore &aStore)const [virtual]

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
aStoreThe store into which the embedded document is to be stored.
Return Value
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.