Location:
APGDOOR.H
Link against: apgrfx.lib
class CApaDoor : public CApaDoorBase;
A wrapper for an embedded document that can be displayed in a user interface as an icon or a glass door.
CBase
- Base class for all classes to be instantiated on the heap
CPicture
- Abstract base class for: drawing a picture to a graphics context, storing and restoring the picture
CApaDoorBase
- The base class for the graphic representation of an embedded document
CApaDoor
- A wrapper for an embedded document that can be displayed in a user interface as an icon or a glass door
Defined in CApaDoor
:
AppUidL()
, Capability()
, Caption()
, DetachFromStoreL()
, DocumentL()
, Draw()
, ExternalizeL()
, GetCropInTwips()
, GetOriginalSizeInTwips()
, GlassDoorSize()
, NewL()
, NewL()
, NewLC()
, RestoreL()
, ScaleFactorHeight()
, ScaleFactorWidth()
, SetCropInTwips()
, SetFormatToGlassL()
, SetFormatToIconL()
, SetFormatToTemporaryIconL()
, SetScaleFactor()
, StoreL()
, ~CApaDoor()
Inherited from CApaDoorBase
:
CApaDoorBase_Reserved1()
,
CApaDoorBase_Reserved2()
,
EGlassDoor
,
EIconic
,
ETemporarilyIconic
,
ExternalizeBaseStreamL()
,
Format()
,
InternalizeBaseStreamL()
,
LineBreakPossible()
,
NativePixelSize()
,
SetSource()
,
Source()
,
TFormat
,
iFormat
,
iSource
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
Inherited from CPicture
:
AddCropInPixels()
,
EDetachDraw
,
EDetachFull
,
GetSizeInPixels()
,
GetSizeInTwips()
,
ResetToOriginal()
,
SetSizeInPixels()
,
SetSizeInTwips()
,
TDetach
static IMPORT_C CApaDoor *NewLC(RFs &aFs, CApaDocument &aDoc, const TSize &aDefaultIconSizeInTwips);
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.
|
|
static IMPORT_C CApaDoor *NewL(RFs &aFs, CApaDocument &aDoc, const TSize &aDefaultIconSizeInTwips);
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.
|
|
static IMPORT_C CApaDoor *NewL(RFs &aFs, const CStreamStore &aStore, TStreamId aStreamId, CApaProcess &aProcess);
|
|
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 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 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.
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.
|
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.
|
|
inline TDesC *Caption() const;
Gets the name of the application with which the embedded document is associated.
|
IMPORT_C TUid AppUidL() const;
Gets the application specific UID associated with the embedded document.
|
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.
|
virtual TStreamId StoreL(CStreamStore &aStore) 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.
|
|
virtual void Draw(CGraphicsContext &aGc, const TPoint &aTopLeft, const TRect &aClipRect, MGraphicsDeviceMap *aMap) const;
Draws the door either as glass or as an icon depending on the format.
|
virtual void DetachFromStoreL(TDetach aDegree=EDetachFull);
Detaches the door from its store, restoring any unrestored elements of the picture, if necessary.
|
virtual void GetOriginalSizeInTwips(TSize &aSize) const;
Get the door's original size, in twips.
|
virtual void SetScaleFactor(TInt aScaleFactorWidth, TInt aScaleFactorHeight);
Sets the door's scale factors.
|
virtual void SetCropInTwips(const TMargins &aMargins);
Sets the cropping margins of a picture in twips.
These are relative to the original unscaled size of the picture.
|
virtual TPictureCapability Capability() const;
Gets the picture's capabilities.
These include whether it is scalable and croppable.
|
virtual void GetCropInTwips(TMargins &aMargins) const;
Gets the cropping margins of the door in twips.
These margins are relative to the original unscaled size of the picture.
|
virtual TInt ScaleFactorWidth() const;
Gets the door's width scale factor.
|
virtual TInt ScaleFactorHeight() const;
Gets the door's height scale factor.
|
private: virtual void ExternalizeL(RWriteStream &aStream) const;
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.
|
private: virtual TSize GlassDoorSize() const;
Returns the size of the glass door, in twips.
A concrete implementation of this function is provided by derived classes.
|