Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: apamdr.h
Link against: apparc.lib

Class CApaModelDoor

CApaModelDoor

Support

Supported from 5.0

Description

A persistent representation of a door that also acts as a wrapper around an application's model.

The class allows embedded data to be manipulated without requiring the whole associated application.

Derivation

CApaDoorBaseThe base class for the graphic representation of an embedded document
CApaModelDoorA persistent representation of a door that also acts as a wrapper around an application's model
CBaseBase class for all classes to be instantiated on the heap
CPictureAbstract base class for: drawing a picture to a graphics context, storing and restoring the picture

Defined in CApaModelDoor:
DetachFromStoreL(), Draw(), ExternalizeL(), GetOriginalSizeInTwips(), ModelHeader(), NewL(), NewLC(), RestoreL(), ScaleFactorHeight(), ScaleFactorWidth(), SetFormat(), SetScaleFactor(), StoreL(), ~CApaModelDoor()

Inherited from CApaDoorBase:
EGlassDoor, EIconic, ETemporarilyIconic, ExternalizeBaseStreamL(), Format(), GlassDoorSize(), InternalizeBaseStreamL(), SetSource(), Source(), TFormat

Inherited from CBase:
operator new()

Inherited from CPicture:
AddCropInPixels(), Capability(), EDetachDraw, EDetachFull, GetCropInTwips(), GetSizeInPixels(), GetSizeInTwips(), LineBreakPossible(), ResetToOriginal(), SetCropInTwips(), SetSizeInPixels(), SetSizeInTwips(), TDetach


Construction and destruction


NewL()

static CApaModelDoor* NewL(const CStreamStore& aStore,TStreamId aHeadStreamId,const MApaModelHeaderFactory* aFactory);

Description

Creates a model door object and restores it from an embedded store within the specified store.

Parameters

const CStreamStore& aStore

The store from which the model door is to be restored.

TStreamId aHeadStreamId

The head stream ID. This is the ID of the stream containing the stream dictionary which is restored as part of the process of creating this model door object. The stream dictionary contains the ID of the stream hosting the embedded store.

const MApaModelHeaderFactory* aFactory

A pointer to a factory object for constructing the application model wrapper object, also known as the application model header, a CApaModelHeader type.

Return value

CApaModelDoor*

A pointer to the new model door object.

See also:


NewL()

static CApaModelDoor* NewL(CApaModelHeader* aHeader);

Description

Creates a model door object.

Parameters

CApaModelHeader* aHeader

A pointer to an existing concrete application model wrapper object.

Return value

CApaModelDoor*

A pointer to the new model door object.


NewLC()

static CApaModelDoor* NewLC(CApaModelHeader* aHeader);

Description

Creates a model door object, and puts a pointer to it onto the cleanup stack.

Parameters

CApaModelHeader* aHeader

A pointer to an existing concrete application model wrapper object.

Return value

CApaModelDoor*

A pointer to the new model door object.


~CApaModelDoor()

~CApaModelDoor();

Description

Destructor.

Frees all resources owned by the object, prior to its destruction.

[Top]


Format changing


SetFormat()

void SetFormat(TFormat aFormat);

Description

Sets the format of the door.

Parameters

TFormat aFormat

The format for the graphical representation of the embedded document.

See also:

[Top]


Persistence


StoreL()

TStreamId StoreL(CStreamStore& aStore) const;

Description

Stores the model data in the specified store as an embedded store.

The function stores the model data, if the model exists in memory, otherwise, it simply copies the stream containing the embedded document into the specified store.

Parameters

CStreamStore& aStore

The store in which the model data is to be stored.

Return value

TStreamId

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


RestoreL()

void RestoreL(const CStreamStore& aStore,TStreamId aHeadStreamId,const MApaModelHeaderFactory* aFactory);

Description

Restores the embedded model data from the specified store.

Parameters

const CStreamStore& aStore

The store from which the embedded model data is to be restored.

TStreamId aHeadStreamId

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

const MApaModelHeaderFactory* aFactory

A pointer to a factory object for constructing the application model wrapper object, also known as the application model header, a CApaModelHeader type. The application model wrapper is provided by the application model (not the application UI), and supplies the knowledge for internalizing the application model data from an embedded store. The pointer must not be null, otherwise the function raises an APPARC 22 panic.

[Top]


Accessors


ModelHeader()

CApaModelHeader* ModelHeader();

Description

Gets the application model wrapper object.

Return value

CApaModelHeader*

A pointer to the application model wrapper object.


GetOriginalSizeInTwips()

void GetOriginalSizeInTwips(TSize& aSize) const;

Description

Gets the door's original size, in twips.

Parameters

TSize& aSize

This size, in twips.


DetachFromStoreL()

void DetachFromStoreL(TDetach=EDetachFull);

Description

Restores the model to the specified degree.

Parameters

TDetach

The degree to which restoration is needed.

[Top]


Picture scaling


SetScaleFactor()

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.


ScaleFactorWidth()

TInt ScaleFactorWidth() const;

Description

Gets the door's width scale factor.

Return value

TInt

The width scale factor, in percent.


ScaleFactorHeight()

TInt ScaleFactorHeight() const;

Description

Gets the door's height scale factor.

Return value

TInt

The height scale factor, in percent.

[Top]


Public unsupported functions


Draw()

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

Description

Not supported; if called, raises an APPARC 17 panic.


ExternalizeL()

void ExternalizeL(RWriteStream& aStream)const;

Description

Not supported; if called, raises an APPARC 17 panic.