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.
Public Member Functions | |
---|---|
~CApaDoor () | |
IMPORT_C TUid | AppUidL () |
TPictureCapability | Capability () |
TDesC * | Caption () |
void | DetachFromStoreL ( TDetach ) |
IMPORT_C CApaDocument * | DocumentL ( TBool ) |
void | Draw ( CGraphicsContext &, const TPoint &, const TRect &, MGraphicsDeviceMap *) |
void | GetCropInTwips ( TMargins &) |
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 ) |
TInt | ScaleFactorHeight () |
TInt | ScaleFactorWidth () |
void | SetCropInTwips (const TMargins &) |
IMPORT_C void | SetFormatToGlassL () |
IMPORT_C void | SetFormatToIconL () |
IMPORT_C void | SetFormatToTemporaryIconL ( TBool ) |
void | SetScaleFactor ( TInt , TInt ) |
TStreamId | StoreL ( CStreamStore &) |
Private Member Functions | |
---|---|
CApaDoor ( RFs &, CApaProcess &) | |
CApaDoor ( RFs &, CApaDocument &, const TSize &) | |
TUid | AppUidFromStreamL () |
void | ConstructL () |
void | CopyStoreL (const CEmbeddedStore &, RWriteStream &) |
void | ExternalizeL ( RWriteStream &) |
void | ExternalizeStateStreamL ( CStreamStore &, CStreamDictionary &) |
TSize | GlassDoorSize () |
void | InternalizeStateStreamL (const CStreamStore &, const CStreamDictionary &, TSize ) |
CStreamDictionary * | ReadStreamDictionaryLC (const CStreamStore &, TStreamId ) |
void | RestoreDocL (const CPersistentStore &) |
void | RestoreDoorStateL (const CStreamStore &, const CStreamDictionary &) |
void | SetIconSizeInTwips ( TSize ) |
void | StoreDocL ( CPersistentStore &) |
Inherited Enumerations | |
---|---|
CApaDoorBase:TFormat | |
CPicture:TDetach |
Private Attributes | |
---|---|
CApaDocument * | iApaDoc |
CApaProcess * | iApaProcess |
HBufC * | iAppCaption |
RFs & | iFs |
TSize | iIconSizeInTwips |
CPicture * | iPicture |
CEmbeddedStore * | iStore |
CBufSeg * | iStoreHost |
Inherited Attributes | |
---|---|
CApaDoorBase::iFormat | |
CApaDoorBase::iSource |
CApaDoor | ( | RFs & | aFs, |
CApaProcess & | aProcess | ||
) | [private] |
RFs & aFs | |
CApaProcess & aProcess |
CApaDoor | ( | RFs & | aFs, |
CApaDocument & | aDoc, | ||
const TSize & | aDefaultIconSizeInTwips | ||
) | [private] |
RFs & aFs | |
CApaDocument & aDoc | |
const TSize & aDefaultIconSizeInTwips |
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] |
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 | CopyStoreL | ( | const CEmbeddedStore & | aSourceStore, |
RWriteStream & | aTargetStream | |||
) | [private, static] |
const CEmbeddedStore & aSourceStore | |
RWriteStream & aTargetStream |
void | DetachFromStoreL | ( | TDetach | aDegree = EDetachFull | ) | [virtual] |
Detaches the door from its store, restoring any unrestored elements of the picture, if necessary.
TDetach aDegree = EDetachFull | 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.
TApaPictureFactory CApaDoor::StoreL() CApaDocument::ValidatePasswordL()
TBool aCheckPassword = EFalse | 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] |
Draws the door either as glass or as an icon depending on the format.
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. |
void | ExternalizeL | ( | RWriteStream & | aStream | ) | const [private, virtual] |
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.
RWriteStream & aStream | The write stream. |
void | ExternalizeStateStreamL | ( | CStreamStore & | aStore, |
CStreamDictionary & | aStreamDict | |||
) | const [private] |
CStreamStore & aStore | |
CStreamDictionary & aStreamDict |
void | GetCropInTwips | ( | TMargins & | aMargins | ) | const [virtual] |
Gets the cropping margins of the door in twips.
These margins are relative to the original unscaled size of the picture.
TMargins & aMargins | The cropping margins, in twips. |
void | GetOriginalSizeInTwips | ( | TSize & | aSize | ) | const [virtual] |
Get the door's original size, in twips.
TSize & aSize | The size, in twips. |
TSize | GlassDoorSize | ( | ) | const [private, virtual] |
Returns the size of the glass door, in twips.
A concrete implementation of this function is provided by derived classes.
void | InternalizeStateStreamL | ( | const CStreamStore & | aStore, |
const CStreamDictionary & | aStreamDict, | |||
TSize | aDefaultIconSize | |||
) | [private] |
const CStreamStore & aStore | |
const CStreamDictionary & aStreamDict | |
TSize aDefaultIconSize |
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.
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. |
IMPORT_C CApaDoor * | NewL | ( | RFs & | aFs, |
const CStreamStore & | aStore, | |||
TStreamId | aStreamId, | |||
CApaProcess & | aProcess | |||
) | [static] |
RFs & aFs | |
const CStreamStore & aStore | |
TStreamId aStreamId | |
CApaProcess & aProcess |
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.
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. |
CStreamDictionary * | ReadStreamDictionaryLC | ( | const CStreamStore & | aStore, |
TStreamId | aStreamId | |||
) | [private, static] |
const CStreamStore & aStore | |
TStreamId aStreamId |
void | RestoreDocL | ( | const CPersistentStore & | aStore | ) | [private] |
const CPersistentStore & aStore |
void | RestoreDoorStateL | ( | const CStreamStore & | aStore, |
const CStreamDictionary & | streamDic | |||
) | [private] |
const CStreamStore & aStore | |
const CStreamDictionary & streamDic |
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.
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. |
void | SetCropInTwips | ( | const TMargins & | aMargins | ) | [virtual] |
Sets the cropping margins of a picture in twips.
These are relative to the original unscaled size of the picture.
const TMargins & 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.
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.
TBool aEnabled = ETrue | 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. |
void | SetScaleFactor | ( | TInt | aScaleFactorWidth, |
TInt | aScaleFactorHeight | |||
) | [virtual] |
Sets the door's scale factors.
void | StoreDocL | ( | CPersistentStore & | aStore | ) | const [private] |
CPersistentStore & aStore |
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.
CStreamStore & aStore | The store into which the embedded document is to be stored. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.