GMimeTnefPropertyWriter

GMimeTnefPropertyWriter — Write MAPI properties, recipient rows and embedded messages

Functions

Types and Values

Description

Obtain this writer from a GMimeTnefWriter. After writing the properties, call g_mime_tnef_property_writer_close() before writing another attribute.

g_mime_tnef_property_writer_open_rtf_compressed_stream() accepts ordinary RTF bytes and writes either LZFu or an uncompressed wrapper. Its explicit close patches the RTF header and CRC before completing the surrounding value. No RTF-to-text/HTML or high-level TNEF-to-MIME conversion is performed.

Functions

g_mime_tnef_property_writer_get_row_count ()

int
g_mime_tnef_property_writer_get_row_count
                               (GMimeTnefPropertyWriter *writer);

Gets the number of recipient rows started.

Parameters

writer

a TNEF writer

 

Returns

the number of recipient rows started


g_mime_tnef_property_writer_get_property_count ()

int
g_mime_tnef_property_writer_get_property_count
                               (GMimeTnefPropertyWriter *writer);

Gets the number of properties in the list or current row.

Parameters

writer

a TNEF writer

 

Returns

the number of properties in the list or current row


g_mime_tnef_property_writer_begin_row ()

gboolean
g_mime_tnef_property_writer_begin_row (GMimeTnefPropertyWriter *writer,
                                       GError **error);

Completes the previous row and starts a new recipient row.

Parameters

writer

a recipient-table writer

 

error

return location for an error

 

Returns

whether the operation succeeded


g_mime_tnef_property_writer_write_property_tag ()

gboolean
g_mime_tnef_property_writer_write_property_tag
                               (GMimeTnefPropertyWriter *writer,
                                GMimeTnefPropertyTag tag,
                                GError **error);

Completes the preceding property and starts an ordinary property.

Parameters

writer

a property writer

 

tag

a non-named property tag

 

error

return location for an error

 

Returns

whether the operation succeeded


g_mime_tnef_property_writer_write_named_property ()

gboolean
g_mime_tnef_property_writer_write_named_property
                               (GMimeTnefPropertyWriter *writer,
                                GMimeTnefNameId *name,
                                guint16 type,
                                GError **error);

Starts a named property. The outer attribute writer assigns consistent identifiers in the range 0x8000 through 0xfffe within each TNEF stream.

Parameters

writer

a property writer

 

name

the named-property identity

 

type

the type, optionally multi-valued

 

error

return location for an error

 

Returns

whether the operation succeeded


g_mime_tnef_property_writer_write_value_boolean ()

gboolean
g_mime_tnef_property_writer_write_value_boolean
                               (GMimeTnefPropertyWriter *writer,
                                gboolean value,
                                GError **error);

Writes a Boolean value padded to four bytes.

Parameters

writer

a property writer

 

value

the value

 

error

return location for an error

 

Returns

whether the operation succeeded


g_mime_tnef_property_writer_write_value_int16 ()

gboolean
g_mime_tnef_property_writer_write_value_int16
                               (GMimeTnefPropertyWriter *writer,
                                gint16 value,
                                GError **error);

Writes an I2 value padded to four bytes.

Parameters

writer

a property writer

 

value

the value

 

error

return location for an error

 

Returns

whether the operation succeeded


g_mime_tnef_property_writer_write_value_int32 ()

gboolean
g_mime_tnef_property_writer_write_value_int32
                               (GMimeTnefPropertyWriter *writer,
                                gint32 value,
                                GError **error);

Writes a Long or Error value.

Parameters

writer

a property writer

 

value

the value

 

error

return location for an error

 

Returns

whether the operation succeeded


g_mime_tnef_property_writer_write_value_int64 ()

gboolean
g_mime_tnef_property_writer_write_value_int64
                               (GMimeTnefPropertyWriter *writer,
                                gint64 value,
                                GError **error);

Writes an I8 value.

Parameters

writer

a property writer

 

value

the value

 

error

return location for an error

 

Returns

whether the operation succeeded


g_mime_tnef_property_writer_write_value_float ()

gboolean
g_mime_tnef_property_writer_write_value_float
                               (GMimeTnefPropertyWriter *writer,
                                float value,
                                GError **error);

Writes an R4 value, preserving its IEEE-754 representation.

Parameters

writer

a property writer

 

value

the value

 

error

return location for an error

 

Returns

whether the operation succeeded


g_mime_tnef_property_writer_write_value_double ()

gboolean
g_mime_tnef_property_writer_write_value_double
                               (GMimeTnefPropertyWriter *writer,
                                double value,
                                GError **error);

Writes a Double value, preserving its IEEE-754 representation.

Parameters

writer

a property writer

 

value

the value

 

error

return location for an error

 

Returns

whether the operation succeeded


g_mime_tnef_property_writer_write_value_currency ()

gboolean
g_mime_tnef_property_writer_write_value_currency
                               (GMimeTnefPropertyWriter *writer,
                                gint64 scaled_value,
                                GError **error);

Writes an exact Currency value in units of 1/10000 of a monetary unit.

Parameters

writer

a property writer

 

scaled_value

the value in units of 1/10000

 

error

return location for an error

 

Returns

whether the operation succeeded


g_mime_tnef_property_writer_write_value_date_time ()

gboolean
g_mime_tnef_property_writer_write_value_date_time
                               (GMimeTnefPropertyWriter *writer,
                                GDateTime *value,
                                GError **error);

Writes SysTime as UTC FILETIME or AppTime as an OLE Automation date using the supplied wall-clock fields.

Parameters

writer

a property writer

 

value

a date and time

 

error

return location for an error

 

Returns

whether the operation succeeded


g_mime_tnef_property_writer_write_value_guid ()

gboolean
g_mime_tnef_property_writer_write_value_guid
                               (GMimeTnefPropertyWriter *writer,
                                const char *value,
                                GError **error);

Writes a ClassId value using the MAPI GUID byte order.

Parameters

writer

a property writer

 

value

a canonical GUID string

 

error

return location for an error

 

Returns

whether the operation succeeded


g_mime_tnef_property_writer_write_value_string ()

gboolean
g_mime_tnef_property_writer_write_value_string
                               (GMimeTnefPropertyWriter *writer,
                                const char *value,
                                GError **error);

Writes a nul-terminated String8 or Unicode value, with its count, length and padding. String8 uses the writer's codepage; Unicode uses UTF-16LE.

Parameters

writer

a property writer

 

value

a UTF-8 string

 

error

return location for an error

 

Returns

whether the operation succeeded


g_mime_tnef_property_writer_write_value_bytes ()

gboolean
g_mime_tnef_property_writer_write_value_bytes
                               (GMimeTnefPropertyWriter *writer,
                                const guint8 *buffer,
                                gsize length,
                                GError **error);

Writes a Binary or Object value with its length and padding.

Parameters

writer

a property writer

 

buffer

the raw value.

[array length=length][nullable]

length

byte count

 

error

return location for an error

 

Returns

whether the operation succeeded


g_mime_tnef_property_writer_write_value ()

gboolean
g_mime_tnef_property_writer_write_value
                               (GMimeTnefPropertyWriter *writer,
                                const GValue *value,
                                GError **error);

Writes a native GLib value. Currency is an exact signed 64-bit integer in units of 1/10000. GUIDs are strings. Null properties have no value and do not require this operation.

Parameters

writer

a property writer

 

value

a value in the representation returned by the property reader

 

error

return location for an error

 

Returns

whether the operation succeeded


g_mime_tnef_property_writer_write_property ()

gboolean
g_mime_tnef_property_writer_write_property
                               (GMimeTnefPropertyWriter *writer,
                                const GMimeTnefProperty *property,
                                GError **error);

Writes a property and its values. Named identities are assigned fresh stream-local identifiers. Strings use the destination's codepage. Incomplete snapshots are rejected before writing a property tag.

Parameters

writer

a property writer

 

property

an immutable property snapshot

 

error

return location for an error

 

Returns

whether the operation succeeded


g_mime_tnef_property_writer_open_value_stream ()

GMimeStream *
g_mime_tnef_property_writer_open_value_stream
                               (GMimeTnefPropertyWriter *writer,
                                GError **error);

Opens a write-only Binary or Object value stream. Close it explicitly to patch its length and add padding before writing another value.

Parameters

writer

a property writer

 

error

return location for an error

 

Returns

the stream, or NULL on error.

[transfer full][nullable]


g_mime_tnef_property_writer_open_rtf_compressed_stream ()

GMimeStream *
g_mime_tnef_property_writer_open_rtf_compressed_stream
                               (GMimeTnefPropertyWriter *writer,
                                gboolean compress,
                                GError **error);

Opens a write-only stream for RTF bytes in an RtfCompressed Binary property. Explicit close writes the compressed-RTF header and CRC, then completes the property value. Flushing does not finalize the compression stream.

Parameters

writer

a property writer

 

compress

whether to use LZFu compression rather than the uncompressed wrapper

 

error

return location for an error

 

Returns

the stream, or NULL on error.

[transfer full][nullable]


g_mime_tnef_property_writer_open_embedded_message ()

GMimeTnefWriter *
g_mime_tnef_property_writer_open_embedded_message
                               (GMimeTnefPropertyWriter *writer,
                                int codepage,
                                GError **error);

Opens an embedded TNEF writer for an Object property, prefixing its IMessage IID. The temporary-stream factory is inherited. Close the embedded writer explicitly before continuing the property list.

Parameters

writer

a property writer

 

codepage

the embedded message's codepage, or zero to inherit

 

error

return location for an error

 

Returns

the embedded writer, or NULL on error.

[transfer full][nullable]


g_mime_tnef_property_writer_close ()

gboolean
g_mime_tnef_property_writer_close (GMimeTnefPropertyWriter *writer,
                                   GError **error);

Completes the current property and row, patches counts, and queues the attribute. An incomplete property discards the attribute and latches an error in its parent. Close active value streams before calling this.

Parameters

writer

a property writer

 

error

return location for an error

 

Returns

whether the attribute completed successfully

Types and Values

GMimeTnefPropertyWriter

typedef struct _GMimeTnefPropertyWriter GMimeTnefPropertyWriter;

A MAPI property-list or recipient-table writer. Start each property with its tag or name, then write its values. Recipient tables require g_mime_tnef_property_writer_begin_row(). Explicit close patches counts and completes the attribute.