#include <mw/EPos_CPosLandmarkEncoder.h>
class CPosLandmarkEncoder : public CBase |
Public Member Functions | |
---|---|
virtual | ~CPosLandmarkEncoder() |
pure virtual void | AddCategoryForLatestLandmarkL(const CPosLandmarkCategory &) |
pure virtual void | AddCollectionDataL(TPosLmCollectionDataId, const TDesC &) |
pure virtual void | AddLandmarkL(const CPosLandmark &) |
pure virtual CPosLmOperation * | FinalizeEncodingL() |
IMPORT_C CPosLandmarkEncoder * | NewL(const TDesC8 &) |
pure virtual void | SetOutputFileL(const TDesC &) |
pure virtual CBufBase * | SetUseOutputBufferL() |
Protected Member Functions | |
---|---|
CPosLandmarkEncoder() |
Class used for encoding landmark content.
When creating an instance of this class, the type (e.g. the mime type) of the landmark content must be specified. The client will then receive an encoder implementation which understands the requested landmark content.
Output is written either to a buffer or to a file.
define where to write the output to by calling SetUseOutputBufferL or SetOutputFileL ,
optionally add collection data using AddCollectionDataL ,
add landmark data to encode by using functions in CPosLandmarkEncoder and/or CPosLandmarkDatabase::ExportLandmarksL
finalize the encoding by calling FinalizeEncodingL .
If this protocol is not followed the client is panicked with error code EPosLmProtocolBreak. Encoding can be performed multiple times using the same encoder object.
If CPosLandmarkEncoder is used, the client must call the global function ReleaseLandmarkResources before terminating, in order to release all used landmark resources, otherwise the client may receive an ALLOC panic.
void | AddCategoryForLatestLandmarkL | ( | const CPosLandmarkCategory & | aCategory | ) | [pure virtual] |
Add a landmark category for the most recently added landmark.
The client can either call this function directly or pass this encoder object to CPosLandmarkDatabase::ExportLandmarksL .
Output buffer or file not specified.
No landmarks have been added yet.
Parameter | Description |
---|---|
aCategory | The landmark category to add. |
void | AddCollectionDataL | ( | TPosLmCollectionDataId | aDataId, |
const TDesC & | aCollectionData | |||
) | [pure virtual] |
Add landmark collection data to be encoded.
Collection data must be added before any landmarks are added. Each collection ID can only be specified once.
If the collection data is not a part of the chosen landmark encoding format, it will be silently ignored.
Output buffer or file not specified.
Collection data is added after some landmarks are added.
Parameter | Description |
---|---|
aDataId | Identifies which collection data to add. |
aCollectionData | The collection data which should be added. |
void | AddLandmarkL | ( | const CPosLandmark & | aLandmark | ) | [pure virtual] |
Add a landmark to be encoded.
The client can either call this function directly or pass this encoder object to CPosLandmarkDatabase::ExportLandmarksL .
Parameter | Description |
---|---|
aLandmark | The landmark to add. |
CPosLmOperation * | FinalizeEncodingL | ( | ) | [pure virtual] |
Finalize the encode process.
Writes any buffered data to the output buffer/file. If an output buffer is used it is compressed so that unused memory is freed. If an output file is used, it is closed.
After finalizing, further encoding to the specified output is not possible. To start a new encoding, SetUseOutputBufferL or SetOutputFileL must be called.
The function returns an operation object which can be run in incremental mode. If it is run incrementally the client can supervise the progress of the operation.
The client takes ownership of the returned operation object.
If the CPosLmOperation object is deleted before the operation is complete, finalize is cancelled. Further encoding will not be possible.
Returns: A handle to the operation.
IMPORT_C CPosLandmarkEncoder * | NewL | ( | const TDesC8 & | aContentMimeType | ) | [static] |
Two-phased constructor.
The client must specify the type (e.g. the MIME type) of the content format which should be used for encoding.
Returns: A new instance of this class.
void | SetOutputFileL | ( | const TDesC & | aOutputFile | ) | [pure virtual] |
Encode to a file.
The client specifies an output file for the encoder. The encoder will then write all encoded data to this file.
The file will be opened in exclusive mode which means that the file cannot be accessed until the file is closed. The file is closed when FinalizeEncodingL has been executed. The file is also closed if a new encoding is initialized by a call to SetUseOutputBufferL or SetOutputFileL . After this, further encoding to the old file is not possible.
Parameter | Description |
---|---|
aOutputFile | The file name to write the encoded data to. |
CBufBase * | SetUseOutputBufferL | ( | ) | [pure virtual] |
Encode to a buffer.
This function returns a dynamic buffer which will be filled with encoded landmark content. The client takes ownership of the buffer.
The client must not delete the buffer until encoding is finalized.
Returns: The output buffer.