Camel.MimePart

g Camel.DataWrapper Camel.DataWrapper Camel.Medium Camel.Medium Camel.DataWrapper->Camel.Medium Camel.MimePart Camel.MimePart Camel.Medium->Camel.MimePart GObject.Object GObject.Object GObject.Object->Camel.DataWrapper

Subclasses:

Camel.MimeMessage

Methods

Inherited:

Camel.Medium (8), Camel.DataWrapper (32), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

construct_content_from_parser (mp, cancellable)

construct_from_parser (parser, io_priority, cancellable, callback, *user_data)

construct_from_parser_finish (result)

construct_from_parser_sync (parser, cancellable)

generate_preview (func, *user_data)

get_content_disposition ()

get_content_id ()

get_content_languages ()

get_content_location ()

get_content_md5 ()

get_content_type ()

get_description ()

get_disposition ()

get_encoding ()

get_filename ()

set_content (data, type)

set_content_id (contentid)

set_content_languages (content_languages)

set_content_location (location)

set_content_md5 (md5sum)

set_content_type (content_type)

set_description (description)

set_disposition (disposition)

set_encoding (encoding)

set_filename (filename)

Virtual Methods

Inherited:

Camel.Medium (8), Camel.DataWrapper (11), GObject.Object (7)

do_construct_from_parser_sync (parser, cancellable)

do_generate_preview (func, *user_data)

Properties

Inherited:

Camel.Medium (1)

Name

Type

Flags

Short Description

content-id

str

r/w/en

content-md5

str

r/w/en

description

str

r/w/en

disposition

str

r/w/en

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

Camel.Medium

r

Class Details

class Camel.MimePart(**kwargs)
Bases:

Camel.Medium

Abstract:

No

Structure:

Camel.MimePartClass

classmethod new()
Returns:

a new Camel.MimePart

Return type:

Camel.MimePart

Create a new MIME Camel.part.

construct_content_from_parser(mp, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

whether succeeded

Return type:

bool

Constructs the contnet of self from the given mime parser.

New in version 2.24.

construct_from_parser(parser, io_priority, cancellable, callback, *user_data)
Parameters:

Asynchronously constructs a MIME Camel.part from a parser.

When the operation is finished, callback will be called. You can then call Camel.MimePart.construct_from_parser_finish() to get the result of the operation.

New in version 3.0.

construct_from_parser_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

True on success, False on error

Return type:

bool

Finishes the operation started with Camel.MimePart.construct_from_parser().

New in version 3.0.

construct_from_parser_sync(parser, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success, False on error

Return type:

bool

Constructs a MIME Camel.part from a parser.

New in version 3.0.

generate_preview(func, *user_data)
Parameters:
Returns:

Camel.part's preview as a new string, or None, when cannot be generated. Free with GLib.free(), when no longer needed.

Return type:

str or None

Generates preview of the self, to be used in the interface, read by the users.

The optional func can be used to override default preview generation function. If provided, it’s always called as the first try on the parts.

New in version 3.52.

get_content_disposition()
Returns:

the disposition structure

Return type:

Camel.ContentDisposition or None

Get the disposition of the MIME Camel.part as a structure. Returned pointer is owned by self.

New in version 2.30.

get_content_id()
Returns:

the content-id field of the MIME Camel.part

Return type:

str or None

Get the content-id field of a MIME Camel.part.

get_content_languages()
Returns:

a GLib.List of languages

Return type:

[str] or None

Get the Content-Languages set on the MIME Camel.part.

get_content_location()
Returns:

the content-location field of a MIME Camel.part

Return type:

str or None

Get the content-location field of a MIME Camel.part.

get_content_md5()
Returns:

the content-md5 field of the MIME Camel.part

Return type:

str or None

Get the content-md5 field of the MIME Camel.part.

get_content_type()
Returns:

the parsed Camel.ContentType of the MIME Camel.part

Return type:

Camel.ContentType or None

Get the Content-Type of a MIME Camel.part.

get_description()
Returns:

the description

Return type:

str or None

Get the description of the MIME Camel.part.

get_disposition()
Returns:

the disposition

Return type:

str or None

Get the disposition of the MIME Camel.part.

get_encoding()
Returns:

a Camel.TransferEncoding

Return type:

Camel.TransferEncoding

Get the Content-Transfer-Encoding of a MIME Camel.part.

get_filename()
Returns:

the filename of the MIME Camel.part

Return type:

str or None

Get the filename of a MIME Camel.part.

set_content(data, type)
Parameters:
  • data (bytes or None) – data to put into the Camel.part

  • type (str or None) – Content-Type of the data

Utility function used to set the content of a mime Camel.part object to be the provided data. If length is 0, this routine can be used as a way to remove old content (in which case data and type are ignored and may be None).

set_content_id(contentid)
Parameters:

contentid (str or None) – content id

Set the content-id field on a MIME Camel.part.

set_content_languages(content_languages)
Parameters:

content_languages ([str] or None) – list of languages

Set the Content-Languages field of a MIME Camel.part.

set_content_location(location)
Parameters:

location (str or None) – the content-location value of the MIME Camel.part

Set the content-location field of the MIME Camel.part.

set_content_md5(md5sum)
Parameters:

md5sum (str or None) – the md5sum of the MIME Camel.part

Set the content-md5 field of the MIME Camel.part.

set_content_type(content_type)
Parameters:

content_type (str or None) – content-type string

Set the content-type on a MIME Camel.part.

set_description(description)
Parameters:

description (str) – description of the MIME Camel.part

Set a description on the MIME Camel.part.

set_disposition(disposition)
Parameters:

disposition (str or None) – disposition of the MIME Camel.part

Set a disposition on the MIME Camel.part.

set_encoding(encoding)
Parameters:

encoding (Camel.TransferEncoding) – a Camel.TransferEncoding

Set the Content-Transfer-Encoding to use on a MIME Camel.part.

set_filename(filename)
Parameters:

filename (str or None) – filename given to the MIME Camel.part

Set the filename on a MIME Camel.part.

do_construct_from_parser_sync(parser, cancellable) virtual
Parameters:
Returns:

True on success, False on error

Return type:

bool

Constructs a MIME Camel.part from a parser.

New in version 3.0.

do_generate_preview(func, *user_data) virtual
Parameters:
Returns:

Camel.part's preview as a new string, or None, when cannot be generated. Free with GLib.free(), when no longer needed.

Return type:

str or None

Generates preview of the mime_part, to be used in the interface, read by the users.

The optional func can be used to override default preview generation function. If provided, it’s always called as the first try on the parts.

New in version 3.52.

Property Details

Camel.MimePart.props.content_id
Name:

content-id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Camel.MimePart.props.content_md5
Name:

content-md5

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Camel.MimePart.props.description
Name:

description

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Camel.MimePart.props.disposition
Name:

disposition

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY