GMimeTnefMessage

GMimeTnefMessage — Access message bodies, recipients and attachments

Functions

GMimeTnefMessage * g_mime_tnef_message_load ()
GMimeTnefMessage * g_mime_tnef_message_load_from_reader ()
int g_mime_tnef_message_get_codepage ()
guint16 g_mime_tnef_message_get_legacy_key ()
GMimeTnefPropertySet * g_mime_tnef_message_get_properties ()
const char * g_mime_tnef_message_get_subject ()
const char * g_mime_tnef_message_get_message_class ()
const char * g_mime_tnef_message_get_internet_message_id ()
guint g_mime_tnef_message_get_recipient_count ()
GMimeTnefRecipient * g_mime_tnef_message_get_recipient ()
guint g_mime_tnef_message_get_attachment_count ()
GMimeTnefAttachment * g_mime_tnef_message_get_attachment ()
GMimeTnefMessageBody * g_mime_tnef_message_get_text_body ()
GMimeTnefMessageBody * g_mime_tnef_message_get_html_body ()
GMimeTnefMessageBody * g_mime_tnef_message_get_rtf_body ()
GMimeTnefPropertySet * g_mime_tnef_recipient_get_properties ()
GMimeTnefRecipientType g_mime_tnef_recipient_get_recipient_type ()
const char * g_mime_tnef_recipient_get_display_name ()
const char * g_mime_tnef_recipient_get_email_address ()
const char * g_mime_tnef_recipient_get_address_type ()
GMimeTnefMessageBodyFormat g_mime_tnef_message_body_get_format ()
GMimeTnefPropertyTag g_mime_tnef_message_body_get_tag ()
const char * g_mime_tnef_message_body_get_charset ()
gint64 g_mime_tnef_message_body_get_length ()
GMimeStream * g_mime_tnef_message_body_open_read ()
GMimeStream * g_mime_tnef_message_body_open_decoded_read ()
char * g_mime_tnef_message_body_get_text ()
GMimeTnefPropertySet * g_mime_tnef_attachment_get_properties ()
GMimeTnefAttachMethod g_mime_tnef_attachment_get_method ()
GMimeTnefAttachFlags g_mime_tnef_attachment_get_flags ()
const char * g_mime_tnef_attachment_get_file_name ()
const char * g_mime_tnef_attachment_get_mime_type ()
const char * g_mime_tnef_attachment_get_content_id ()
gboolean g_mime_tnef_attachment_has_content ()
gboolean g_mime_tnef_attachment_is_embedded_message ()
gint64 g_mime_tnef_attachment_get_length ()
GMimeStream * g_mime_tnef_attachment_open_read ()
GMimeTnefMessage * g_mime_tnef_attachment_load_embedded_message ()

Types and Values

Description

Functions

g_mime_tnef_message_load ()

GMimeTnefMessage *
g_mime_tnef_message_load (GMimeStream *stream,
                          const GMimeTnefOptions *options,
                          GError **error);

Synchronously loads a message without seeking or closing stream .

Parameters

stream

input, positioned at the TNEF signature

 

options

materialization and reader limits, or NULL for defaults.

[nullable]

error

return location for an error

 

Returns

a loaded message, or NULL on error.

[transfer full][nullable]


g_mime_tnef_message_load_from_reader ()

GMimeTnefMessage *
g_mime_tnef_message_load_from_reader (GMimeTnefReader *reader,
                                      GError **error);

Reads all attributes, reporting recoverable damage through reader 's diagnostic callback. A bad signature or I/O error prevents loading. The model does not retain the reader or its source stream.

Parameters

reader

a TNEF reader which has not yet been advanced

 

error

return location for an error

 

Returns

a loaded message, or NULL on error.

[transfer full][nullable]


g_mime_tnef_message_get_codepage ()

int
g_mime_tnef_message_get_codepage (GMimeTnefMessage *message);

Parameters

message

a loaded message

 

Returns

the effective message codepage


g_mime_tnef_message_get_legacy_key ()

guint16
g_mime_tnef_message_get_legacy_key (GMimeTnefMessage *message);

Parameters

message

a loaded message

 

Returns

the legacy attachment key from the TNEF header


g_mime_tnef_message_get_properties ()

GMimeTnefPropertySet *
g_mime_tnef_message_get_properties (GMimeTnefMessage *message);

Parameters

message

a loaded message

 

Returns

retained message properties, excluding streamed bodies.

[transfer none]


g_mime_tnef_message_get_subject ()

const char *
g_mime_tnef_message_get_subject (GMimeTnefMessage *message);

Parameters

message

a loaded message

 

Returns

borrowed UTF-8 subject.

[nullable]


g_mime_tnef_message_get_message_class ()

const char *
g_mime_tnef_message_get_message_class (GMimeTnefMessage *message);

Parameters

message

a loaded message

 

Returns

trimmed, borrowed message class, or NULL if empty.

[nullable]


g_mime_tnef_message_get_internet_message_id ()

const char *
g_mime_tnef_message_get_internet_message_id
                               (GMimeTnefMessage *message);

Parameters

message

a loaded message

 

Returns

borrowed Internet message identifier.

[nullable]


g_mime_tnef_message_get_recipient_count ()

guint
g_mime_tnef_message_get_recipient_count
                               (GMimeTnefMessage *message);

Parameters

message

a loaded message

 

Returns

number of recipient rows


g_mime_tnef_message_get_recipient ()

GMimeTnefRecipient *
g_mime_tnef_message_get_recipient (GMimeTnefMessage *message,
                                   guint index);

Parameters

message

a loaded message

 

index

zero-based recipient index

 

Returns

recipient at index , or NULL if out of range.

[transfer none][nullable]


g_mime_tnef_message_get_attachment_count ()

guint
g_mime_tnef_message_get_attachment_count
                               (GMimeTnefMessage *message);

Parameters

message

a loaded message

 

Returns

number of materialized attachments


g_mime_tnef_message_get_attachment ()

GMimeTnefAttachment *
g_mime_tnef_message_get_attachment (GMimeTnefMessage *message,
                                    guint index);

Parameters

message

a loaded message

 

index

zero-based attachment index

 

Returns

attachment at index , or NULL if out of range.

[transfer none][nullable]


g_mime_tnef_message_get_text_body ()

GMimeTnefMessageBody *
g_mime_tnef_message_get_text_body (GMimeTnefMessage *message);

Parameters

message

a loaded message

 

Returns

plain text representation.

[transfer none][nullable]


g_mime_tnef_message_get_html_body ()

GMimeTnefMessageBody *
g_mime_tnef_message_get_html_body (GMimeTnefMessage *message);

Parameters

message

a loaded message

 

Returns

HTML representation.

[transfer none][nullable]


g_mime_tnef_message_get_rtf_body ()

GMimeTnefMessageBody *
g_mime_tnef_message_get_rtf_body (GMimeTnefMessage *message);

Parameters

message

a loaded message

 

Returns

compressed RTF representation.

[transfer none][nullable]


g_mime_tnef_recipient_get_properties ()

GMimeTnefPropertySet *
g_mime_tnef_recipient_get_properties (GMimeTnefRecipient *recipient);

Parameters

recipient

a recipient row

 

Returns

the complete recipient property set.

[transfer none]


g_mime_tnef_recipient_get_recipient_type ()

GMimeTnefRecipientType
g_mime_tnef_recipient_get_recipient_type
                               (GMimeTnefRecipient *recipient);

Parameters

recipient

a recipient row

 

Returns

recipient type, defaulting to To


g_mime_tnef_recipient_get_display_name ()

const char *
g_mime_tnef_recipient_get_display_name
                               (GMimeTnefRecipient *recipient);

Parameters

recipient

a recipient row

 

Returns

borrowed recipient name, falling back to transmittable and display name.

[nullable]


g_mime_tnef_recipient_get_email_address ()

const char *
g_mime_tnef_recipient_get_email_address
                               (GMimeTnefRecipient *recipient);

Parameters

recipient

a recipient row

 

Returns

borrowed SMTP address or, if absent, the native email address.

[nullable]


g_mime_tnef_recipient_get_address_type ()

const char *
g_mime_tnef_recipient_get_address_type
                               (GMimeTnefRecipient *recipient);

Parameters

recipient

a recipient row

 

Returns

borrowed native address type.

[nullable]


g_mime_tnef_message_body_get_format ()

GMimeTnefMessageBodyFormat
g_mime_tnef_message_body_get_format (GMimeTnefMessageBody *body);

Parameters

body

a message body

 

Returns

the representation of body


g_mime_tnef_message_body_get_tag ()

GMimeTnefPropertyTag
g_mime_tnef_message_body_get_tag (GMimeTnefMessageBody *body);

Parameters

body

a message body

 

Returns

originating MAPI property tag (BodyA for a legacy body)


g_mime_tnef_message_body_get_charset ()

const char *
g_mime_tnef_message_body_get_charset (GMimeTnefMessageBody *body);

Parameters

body

a message body

 

Returns

borrowed character-set name, or NULL for undeclared binary content.

[nullable]


g_mime_tnef_message_body_get_length ()

gint64
g_mime_tnef_message_body_get_length (GMimeTnefMessageBody *body);

Parameters

body

a message body

 

Returns

the byte length before decompression, excluding string terminators


g_mime_tnef_message_body_open_read ()

GMimeStream *
g_mime_tnef_message_body_open_read (GMimeTnefMessageBody *body);

Parameters

body

a message body

 

Returns

an independent stream over the retained bytes.

[transfer full]


g_mime_tnef_message_body_open_decoded_read ()

GMimeStream *
g_mime_tnef_message_body_open_decoded_read
                               (GMimeTnefMessageBody *body);

Parameters

body

a message body

 

Returns

a new read stream, decompressing RTF on demand. No character-set conversion is performed.

[transfer full]


g_mime_tnef_message_body_get_text ()

char *
g_mime_tnef_message_body_get_text (GMimeTnefMessageBody *body,
                                   GError **error);

Parameters

body

a message body

 

error

return location for an error

 

Returns

newly allocated UTF-8 text. RTF is decompressed, not rendered. Uses the message charset if none is declared.

[transfer full][nullable]


g_mime_tnef_attachment_get_properties ()

GMimeTnefPropertySet *
g_mime_tnef_attachment_get_properties (GMimeTnefAttachment *attachment);

Parameters

attachment

a message attachment

 

Returns

attachment properties other than the streamed data.

[transfer none]


g_mime_tnef_attachment_get_method ()

GMimeTnefAttachMethod
g_mime_tnef_attachment_get_method (GMimeTnefAttachment *attachment);

Parameters

attachment

a message attachment

 

Returns

attachment method, inferred from the object IID if unspecified


g_mime_tnef_attachment_get_flags ()

GMimeTnefAttachFlags
g_mime_tnef_attachment_get_flags (GMimeTnefAttachment *attachment);

Parameters

attachment

a message attachment

 

Returns

MAPI attachment display flags


g_mime_tnef_attachment_get_file_name ()

const char *
g_mime_tnef_attachment_get_file_name (GMimeTnefAttachment *attachment);

Parameters

attachment

a message attachment

 

Returns

borrowed long filename, falling back to the short filename.

[nullable]


g_mime_tnef_attachment_get_mime_type ()

const char *
g_mime_tnef_attachment_get_mime_type (GMimeTnefAttachment *attachment);

Parameters

attachment

a message attachment

 

Returns

borrowed MIME type supplied by the sender.

[nullable]


g_mime_tnef_attachment_get_content_id ()

const char *
g_mime_tnef_attachment_get_content_id (GMimeTnefAttachment *attachment);

Parameters

attachment

a message attachment

 

Returns

borrowed Content-ID.

[nullable]


g_mime_tnef_attachment_has_content ()

gboolean
g_mime_tnef_attachment_has_content (GMimeTnefAttachment *attachment);

Parameters

attachment

a message attachment

 

Returns

whether a payload was retained (which may be empty)


g_mime_tnef_attachment_is_embedded_message ()

gboolean
g_mime_tnef_attachment_is_embedded_message
                               (GMimeTnefAttachment *attachment);

Parameters

attachment

a message attachment

 

Returns

whether this attachment can be replayed as a TNEF message


g_mime_tnef_attachment_get_length ()

gint64
g_mime_tnef_attachment_get_length (GMimeTnefAttachment *attachment);

Parameters

attachment

a message attachment

 

Returns

payload length excluding the object's interface prefix


g_mime_tnef_attachment_open_read ()

GMimeStream *
g_mime_tnef_attachment_open_read (GMimeTnefAttachment *attachment);

Parameters

attachment

an attachment

 

Returns

an independent read-only stream (empty if no content was materialized). Object interface prefixes are excluded.

[transfer full]


g_mime_tnef_attachment_load_embedded_message ()

GMimeTnefMessage *
g_mime_tnef_attachment_load_embedded_message
                               (GMimeTnefAttachment *attachment,
                                GError **error);

Parses the retained content afresh, sharing the enclosing reader's limits and diagnostic callback. The enclosing stream need no longer exist.

Parameters

attachment

an embedded-message attachment

 

error

return location for an error

 

Returns

the message, or NULL on error.

[transfer full][nullable]

Types and Values

GMimeTnefMessage

typedef struct _GMimeTnefMessage GMimeTnefMessage;

A snapshot of message properties, recipient rows, alternative bodies and attachments. Member getters borrow from the message; take a reference to retain a member independently.


GMimeTnefRecipient

typedef struct _GMimeTnefRecipient GMimeTnefRecipient;

An immutable recipient row with UTF-8 views of its address metadata.


GMimeTnefAttachment

typedef struct _GMimeTnefAttachment GMimeTnefAttachment;

Attachment properties and optional payload. Embedded messages are parsed only when requested, not while the enclosing message is loaded.


GMimeTnefMessageBody

typedef struct _GMimeTnefMessageBody GMimeTnefMessageBody;

A retained body representation. Raw and decoded streams have independent lifetimes and do not seek the original input.


enum GMimeTnefMessageBodyFormat

The body representations kept separately by a GMimeTnefMessage.

Members

GMIME_TNEF_MESSAGE_BODY_FORMAT_TEXT

Plain text.

 

GMIME_TNEF_MESSAGE_BODY_FORMAT_HTML

HTML markup.

 

GMIME_TNEF_MESSAGE_BODY_FORMAT_COMPRESSED_RTF

MS-OXRTFCP encoded RTF.