#include <mw/apgdoor.h>
Link against: apgrfx.lib
class CApaDoor : public CApaDoorBase, public CApaDoorBase |
Public Member Functions | |
---|---|
~CApaDoor() | |
IMPORT_C TUid | AppUidL() |
virtual TPictureCapability | Capability() |
TDesC * | Caption() |
virtual void | DetachFromStoreL(TDetach) |
IMPORT_C CApaDocument * | DocumentL(TBool) |
virtual void | Draw(CGraphicsContext &, const TPoint &, const TRect &, MGraphicsDeviceMap *) |
virtual void | GetCropInTwips(TMargins &) |
virtual void | GetOriginalSizeInTwips(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 void | RestoreL(const CStreamStore &, TStreamId) |
virtual TInt | ScaleFactorHeight() |
virtual TInt | ScaleFactorWidth() |
virtual void | SetCropInTwips(const TMargins &) |
IMPORT_C void | SetFormatToGlassL() |
IMPORT_C void | SetFormatToIconL() |
IMPORT_C void | SetFormatToTemporaryIconL(TBool) |
virtual void | SetScaleFactor(TInt, TInt) |
virtual TStreamId | StoreL(CStreamStore &) |
Inherited Attributes | |
---|---|
CApaDoorBase::iFormat | |
CApaDoorBase::iSource |
Inherited Enumerations | |
---|---|
CApaDoorBase:TFormat | |
CPicture:TDetach |
A wrapper for an embedded document that can be displayed in a user interface as an icon or a glass door.
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.
IMPORT_C TUid | AppUidL | ( | ) | const |
Gets the application specific UID associated with the embedded document.
TPictureCapability | Capability | ( | ) | const [virtual] |
Reimplemented from CApaDoorBase::Capability()const
Gets the picture's capabilities.
These include whether it is scalable and croppable.
TDesC * | Caption | ( | ) | const [inline] |
Gets the name of the application with which the embedded document is associated.
void | DetachFromStoreL | ( | TDetach | aDegree = 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 | |
---|---|
aDegree | Degree to which picture is detached. |
IMPORT_C CApaDocument * | DocumentL | ( | TBool | aCheckPassword = 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 | |
---|---|
aCheckPassword | If ETrue, any password is checked before returning a pointer to the document. If EFalse, the password is not checked. |
void | Draw | ( | 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 | |
---|---|
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. |
aMap | The device map for the graphics device. |
void | GetCropInTwips | ( | 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 | |
---|---|
aMargins | The cropping margins, in twips. |
void | GetOriginalSizeInTwips | ( | TSize & | aSize | ) | const [virtual] |
Reimplemented from CPicture::GetOriginalSizeInTwips(TSize &)const
Get the door's original size, in twips.
Parameters | |
---|---|
aSize | The size, in twips. |
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 | |
---|---|
aFs | A file server session. |
aDoc | The document for which the door is to be created. |
aDefaultIconSizeInTwips | The size of the door in twips. |
IMPORT_C CApaDoor * | NewL | ( | RFs & | aFs, |
const CStreamStore & | aStore, | |||
TStreamId | aStreamId, | |||
CApaProcess & | aProcess | |||
) | [static] |
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 | |
---|---|
aFs | A file server session. |
aDoc | The document for which the door is to be created. |
aDefaultIconSizeInTwips | The size of the door in twips. |
IMPORT_C void | RestoreL | ( | const CStreamStore & | aStore, |
TStreamId | aHeadStreamId | |||
) |
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 | |
---|---|
aStore | The store from which the embedded document is to be restored. |
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. |
TInt | ScaleFactorHeight | ( | ) | const [virtual] |
Reimplemented from CApaDoorBase::ScaleFactorHeight()const
Gets the door's height scale factor.
TInt | ScaleFactorWidth | ( | ) | const [virtual] |
Reimplemented from CApaDoorBase::ScaleFactorWidth()const
Gets the door's width scale factor.
void | SetCropInTwips | ( | const TMargins & | aMargins | ) | [virtual] |
Reimplemented from CApaDoorBase::SetCropInTwips(const TMargins &)
Sets the cropping margins of a picture in twips.
These are relative to the original unscaled size of the picture.
Parameters | |
---|---|
aMargins | The cropping margins, in twips. |
IMPORT_C void | SetFormatToGlassL | ( | ) |
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()
IMPORT_C void | SetFormatToIconL | ( | ) |
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.
IMPORT_C void | SetFormatToTemporaryIconL | ( | TBool | aEnabled = ETrue | ) |
Switches the format of the door between temporarily iconic and glass.
If the door is iconic, then the function does nothing.
Parameters | |
---|---|
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. |
Reimplemented from CApaDoorBase::SetScaleFactor(TInt,TInt)
Sets the door's scale factors.
Parameters | |
---|---|
aScaleFactorWidth | The width scale factor, in percent. |
aScaleFactorHeight | The height scale factor, in percent. |
TStreamId | StoreL | ( | CStreamStore & | aStore | ) | const [virtual] |
Reimplemented from CApaDoorBase::StoreL(CStreamStore &)const
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 | |
---|---|
aStore | The store into which the embedded document is to be stored. |