Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

message.h File Reference

#include <stdio.h>
#include <libetpan.h>
#include <carray.h>
#include "folder-types.h"
#include "message-types.h"

Include dependency graph for message.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

struct  XePMessage_s

Functions

XePMessagea_Message_new (void)
XePMessagea_Message_new_from_data_noparse (char *data, size_t size)
XePMessagea_Message_new_from_file_noparse (const char *filename)
XePMessagea_Message_new_from_data (char *data, size_t len)
XePMessagea_Message_new_for_fetching (XePFolder *folder, mailmessage *msg)
XePMessagea_Message_new_to_compose (void)
XePMessagea_Message_new_to_reply (XePMessage *message)
XePMessagea_Message_new_to_forward (XePMessage *message)
XePMessagea_Message_new_to_redirect (XePMessage *message)
void a_Message_free (XePMessage *message)
void a_Message_free_cb (void *amessage, void *anargout)
XePMessagea_Message_clone (XePMessage *message)
int a_Message_file_open (XePMessage *message)
void a_Message_file_close (XePMessage *message)
void a_Message_set_folder (XePMessage *message, XePFolder *folder)
XePFoldera_Message_get_folder (XePMessage *message)
char * a_Message_message_formatted_get_header (mailmessage *msg, XePMessageHeaderType type, char *other_header, char *template, char *dest_charset)
const char * a_Message_header_get_name_from_type (XePMessageHeaderType type)
XePMessageHeaderType a_Message_header_get_type_from_name (const char *header_name)
void a_Message_header_remove_by_name (XePMessage *message, const char *header_name)
void a_Message_header_remove (XePMessage *message, XePMessageHeaderType type, const char *other_header)
void a_Message_header_add_by_name (XePMessage *message, const char *header_name, const char *header_value, const char *header_charset)
void a_Message_header_add (XePMessage *message, XePMessageHeaderType type, const char *header_name, const char *header_value, const char *header_charset)
int a_Message_header_set_from (XePMessage *message, const char *from, const char *charset)
int a_Message_header_add_to (XePMessage *message, const char *to, const char *charset)
int a_Message_header_add_cc (XePMessage *message, const char *cc, const char *charset)
int a_Message_header_add_bcc (XePMessage *message, const char *bcc, const char *charset)
int a_Message_header_add_reply_to (XePMessage *message, const char *reply_to, const char *charset)
int a_Message_header_add_other (XePMessage *message, const char *header_name, const char *header_value, const char *header_charset)
int a_Message_header_set_subject (XePMessage *message, const char *header_value, const char *header_charset)
char * a_Message_message_formatted_get_local_date (struct mailimf_single_fields *fields, char *template, char *dest_charset)
char * a_Message_message_formatted_get_orig_date (struct mailimf_single_fields *fields, char *template, char *dest_charset)
char * a_Message_message_formatted_get_from (struct mailimf_single_fields *fields, char *template, char *dest_charset)
char * a_Message_message_formatted_get_sender (struct mailimf_single_fields *fields, char *template, char *dest_charset)
char * a_Message_message_formatted_get_reply_to (struct mailimf_single_fields *fields, char *template, char *dest_charset)
char * a_Message_message_formatted_get_to (struct mailimf_single_fields *fields, char *template, char *dest_charset)
char * a_Message_message_formatted_get_cc (struct mailimf_single_fields *fields, char *template, char *dest_charset)
char * a_Message_message_formatted_get_bcc (struct mailimf_single_fields *fields, char *template, char *dest_charset)
char * a_Message_message_formatted_get_message_id (struct mailimf_single_fields *fields, char *template, char *dest_charset)
char * a_Message_message_formatted_get_in_reply_to (struct mailimf_single_fields *fields, char *template, char *dest_charset)
char * a_Message_message_formatted_get_references (struct mailimf_single_fields *fields, char *template, char *dest_charset)
char * a_Message_message_formatted_get_subject (struct mailimf_single_fields *fields, char *template, char *dest_charset)
char * a_Message_message_formatted_get_comments (struct mailimf_single_fields *fields, char *template, char *dest_charset)
char * a_Message_message_formatted_get_keywords (struct mailimf_single_fields *fields, char *template, char *dest_charset)
char * a_Message_message_formatted_get_other (struct mailimf_single_fields *fields, char *template, char *other_header, char *dest_charset)
int a_Message_message_get_subject (struct mailimf_single_fields *fields, char *dest_charset, char **subject)
int a_Message_message_get_from (struct mailimf_single_fields *fields, char *dest_charset, char **display_name, char **email_address)
int a_Message_message_get_other (struct mailimf_fields *fields, char *other_header, char *dest_charset, char **other)
void a_Message_decode_selected (XePMessage *message)
int a_Message_get_bodystructure (XePMessage *message)
int a_Message_mime_find_default (XePMessage *message)
int a_Message_fetch_part (XePMessage *message)
int a_Message_fetch (XePMessage *message)
int a_Message_flags_change (XePMessage *message)
int a_Message_array_flags_change (carray *messages)
int a_Message_mime_is_text (struct mailmime *mime)
char * a_Message_mime_get_type (struct mailmime_content *content)
mailmime * a_Message_mime_new_from_file (const char *filename, const char *mime_type, int mechanism)
mailmime * a_Message_mime_new_from_data (char *data, size_t size, const char *mime_type, int mechanism)
void a_Message_mime_set_body_text (struct mailmime *mime, char *data, size_t size)
mailmime * a_Message_mime_new_multipart (char *subtype, int mechanism)
mailmime * a_Message_mime_new_message (char *subtype, int mechanism)
mailmime * a_Message_mime_add_part_to_selected (XePMessage *message, char *data, size_t size, const char *mime_type, int mechanism)
int a_Message_mime_add_parameter (struct mailmime *mime, const char *param_name, const char *param_value)
int a_Message_mime_remove_parameter (struct mailmime *mime, const char *param_name)
int a_Message_mime_add_submime (struct mailmime *mime, struct mailmime *submime)
void a_Message_mime_set_description (struct mailmime *mime, char *description)
int a_Message_mime_remove_selected (XePMessage *message)
const char * a_Message_get_first_from_addr_spec (XePMessage *message)
mailimf_field * a_Message_get_field (XePMessage *message, XePMessageHeaderType type, const char *other_header)
int a_Message_data_save_as (XePMessage *message, const char *filename)
void a_Message_write_to_file (XePMessage *message, FILE *file)
char * a_Message_write_to_temp_file (XePMessage *message)
void a_Message_append_to_folder (XePMessage *message)
carray * a_Message_array_new_for_flags_change (XePFolder *folder, void **selection, uint32_t n, XePMessageFlagsOp flag_op, int flags)


Function Documentation

void a_Message_append_to_folder XePMessage message  ) 
 

Append a message to a folder This function is called by the manager upon XEP_MANAGER_APPEND request.

Parameters:
message the XePMessage to append. Its folder member points to the target XePFolder, its filename member references the file containing the data, or its msg_data member must point to in-memory message.

Here is the call graph for this function:

int a_Message_array_flags_change carray *  messages  ) 
 

Here is the call graph for this function:

carray* a_Message_array_new_for_flags_change XePFolder folder,
void **  selection,
uint32_t  n,
XePMessageFlagsOp  flag_op,
int  flags
 

Here is the call graph for this function:

XePMessage* a_Message_clone XePMessage message  ) 
 

Here is the call graph for this function:

int a_Message_data_save_as XePMessage message,
const char *  filename
 

Here is the call graph for this function:

void a_Message_decode_selected XePMessage message  ) 
 

Here is the call graph for this function:

int a_Message_fetch XePMessage message  ) 
 

int a_Message_fetch_part XePMessage message  ) 
 

Fetch a message part

Parameters:
message the structure containing references to the message and message part to select (message.msg and message.selected_mime) If the message part is to be decoded, message.dest_charset must be set. On success, message.data and message.len are filled with the part. The data should be freed by mmap_string_unref. On error, message.data and message.len are set to NULL and 0
Returns:
0 on success

void a_Message_file_close XePMessage message  ) 
 

Close the file related to the message

Parameters:
message the XePMessage. Its fd member should contain the file descriptor of the opened file. This one is set by a_Message_file_open(). If it was a valid descriptor, the file is closed and the descriptor is set to an invalid one (-1).

int a_Message_file_open XePMessage message  ) 
 

Open the file related to the message This file is set when XePMessage is created using a_Message_new_from_file_noparse().

Parameters:
message the XePMessage. Its filename member must point to an existing file.
Returns:
0 on success and sets message's fd member to the file descriptor of the opened file. -1 on failure (no filename, or open error).

int a_Message_flags_change XePMessage message  ) 
 

Here is the call graph for this function:

void a_Message_free XePMessage message  ) 
 

void a_Message_free_cb void *  amessage,
void *  anargout
 

Here is the call graph for this function:

int a_Message_get_bodystructure XePMessage message  ) 
 

Here is the call graph for this function:

struct mailimf_field* a_Message_get_field XePMessage message,
XePMessageHeaderType  type,
const char *  other_header
 

Get a specific header field

Parameters:
message the XePMessage in which the field is to be searched
type the XePMessageHeaderType of the header field
other_header if type is XEP_MAIL_HEADER_OTHER, this argument contains the header looked for
Returns:
a pointer to the corresponding struct mailimf_field on success or NULL on failure

Here is the call graph for this function:

const char* a_Message_get_first_from_addr_spec XePMessage message  ) 
 

Get the first address specification of a From: field

Parameters:
message the concerned XePMessage
Returns:
a pointer to the string containing the address specification in the the From: field (e.g.: joe@foo.bar). The string must not be freed.

Here is the call graph for this function:

XePFolder* a_Message_get_folder XePMessage message  ) 
 

void a_Message_header_add XePMessage message,
XePMessageHeaderType  type,
const char *  header_name,
const char *  header_value,
const char *  header_charset
 

Add a header to the message This function will call the specific a_Message_header_set/add_* function to set/add a header along with its value to the message

Parameters:
message the message to which the header is added
type the XePMessageHeaderType of the header
header_name the header name in the case where the type is XEP_MAIL_HEADER_OTHER
header_value the value of the header
header_charset the character set in which the header value is encoded

Here is the call graph for this function:

int a_Message_header_add_bcc XePMessage message,
const char *  bcc,
const char *  charset
 

void a_Message_header_add_by_name XePMessage message,
const char *  header_name,
const char *  header_value,
const char *  header_charset
 

Add a header specified by its name to the message This function amounts to get the XePMessageHeaderType of the header then calling its sister function a_Message_header_add().

Parameters:
message the message to which the header is added
header_name the header name
header_value the value of the header
header_charset the character set in which the header value is encoded

Here is the call graph for this function:

int a_Message_header_add_cc XePMessage message,
const char *  cc,
const char *  charset
 

int a_Message_header_add_other XePMessage message,
const char *  header_name,
const char *  header_value,
const char *  header_charset
 

int a_Message_header_add_reply_to XePMessage message,
const char *  reply_to,
const char *  charset
 

int a_Message_header_add_to XePMessage message,
const char *  to,
const char *  charset
 

const char* a_Message_header_get_name_from_type XePMessageHeaderType  type  ) 
 

XePMessageHeaderType a_Message_header_get_type_from_name const char *  header_name  ) 
 

void a_Message_header_remove XePMessage message,
XePMessageHeaderType  type,
const char *  other_header
 

Remove all headers of some type This function iterates through the set of headers of a message and removes any occurence of header matching the provided header type/name

Parameters:
message the message from which some headers are to be removed
type the XePMessageHeaderType of the headers to be removed
header_name the name of the header to remove from the message in the case where the type is XEP_MAIL_HEADER_OTHER

void a_Message_header_remove_by_name XePMessage message,
const char *  header_name
 

Remove all headers of some type This function iterates through the set of headers of a message and removes any occurence of header matching the provided header name

Parameters:
message the message from which some headers are to be removed
header_name the name of the header to remove from the message

Here is the call graph for this function:

int a_Message_header_set_from XePMessage message,
const char *  from,
const char *  charset
 

Here is the call graph for this function:

int a_Message_header_set_subject XePMessage message,
const char *  header_value,
const char *  header_charset
 

Here is the call graph for this function:

char* a_Message_message_formatted_get_bcc struct mailimf_single_fields *  fields,
char *  template,
char *  dest_charset
 

char* a_Message_message_formatted_get_cc struct mailimf_single_fields *  fields,
char *  template,
char *  dest_charset
 

char* a_Message_message_formatted_get_comments struct mailimf_single_fields *  fields,
char *  template,
char *  dest_charset
 

char* a_Message_message_formatted_get_from struct mailimf_single_fields *  fields,
char *  template,
char *  dest_charset
 

Here is the call graph for this function:

char* a_Message_message_formatted_get_header mailmessage *  msg,
XePMessageHeaderType  type,
char *  other_header,
char *  template,
char *  dest_charset
 

Here is the call graph for this function:

char* a_Message_message_formatted_get_in_reply_to struct mailimf_single_fields *  fields,
char *  template,
char *  dest_charset
 

char* a_Message_message_formatted_get_keywords struct mailimf_single_fields *  fields,
char *  template,
char *  dest_charset
 

char* a_Message_message_formatted_get_local_date struct mailimf_single_fields *  fields,
char *  template,
char *  dest_charset
 

Here is the call graph for this function:

char* a_Message_message_formatted_get_message_id struct mailimf_single_fields *  fields,
char *  template,
char *  dest_charset
 

char* a_Message_message_formatted_get_orig_date struct mailimf_single_fields *  fields,
char *  template,
char *  dest_charset
 

char* a_Message_message_formatted_get_other struct mailimf_single_fields *  fields,
char *  template,
char *  other_header,
char *  dest_charset
 

char* a_Message_message_formatted_get_references struct mailimf_single_fields *  fields,
char *  template,
char *  dest_charset
 

char* a_Message_message_formatted_get_reply_to struct mailimf_single_fields *  fields,
char *  template,
char *  dest_charset
 

char* a_Message_message_formatted_get_sender struct mailimf_single_fields *  fields,
char *  template,
char *  dest_charset
 

char* a_Message_message_formatted_get_subject struct mailimf_single_fields *  fields,
char *  template,
char *  dest_charset
 

char* a_Message_message_formatted_get_to struct mailimf_single_fields *  fields,
char *  template,
char *  dest_charset
 

int a_Message_message_get_from struct mailimf_single_fields *  fields,
char *  dest_charset,
char **  display_name,
char **  email_address
 

int a_Message_message_get_other struct mailimf_fields *  fields,
char *  other_header,
char *  dest_charset,
char **  other
 

int a_Message_message_get_subject struct mailimf_single_fields *  fields,
char *  dest_charset,
char **  subject
 

Here is the call graph for this function:

int a_Message_mime_add_parameter struct mailmime *  mime,
const char *  param_name,
const char *  param_value
 

struct mailmime* a_Message_mime_add_part_to_selected XePMessage message,
char *  data,
size_t  size,
const char *  mime_type,
int  mechanism
 

Here is the call graph for this function:

int a_Message_mime_add_submime struct mailmime *  mime,
struct mailmime *  submime
 

Add a child MIME part to a MIME part If the parent MIME part is not a multipart MIME type, then the new MIME part will be added to a parent that is not of single type.

Parameters:
mime the parent MIME part (or the older sibling)
submime the MIME part to add
Returns:
0 on success and 1 on failure

int a_Message_mime_find_default XePMessage message  ) 
 

Select the default mime part to be displayed

Parameters:
message the structure containing the references to the message and message's body structure (message.msg and message.mime) On success, message.selected_mime points to the default mime part On error, message.selected_mime is set to NULL
Returns:
0 on success

char* a_Message_mime_get_type struct mailmime_content *  content  ) 
 

Return mime type of the content as an allocated string. The string must be freeed by the user.

int a_Message_mime_is_text struct mailmime *  mime  ) 
 

struct mailmime* a_Message_mime_new_from_data char *  data,
size_t  size,
const char *  mime_type,
int  mechanism
 

Create a new MIME part from in-memory data

Parameters:
data pointer to in-memory data. The struct mailmime will own the data.
size the size of the in-memory data
mime_type the MIME type of the data. NULL to automagically guess the type from its content.
mechanism the mechanism used for encoding.
Returns:
the newly created MIME part on success, and NULL on failure

Here is the call graph for this function:

struct mailmime* a_Message_mime_new_from_file const char *  filename,
const char *  mime_type,
int  mechanism
 

Here is the call graph for this function:

struct mailmime* a_Message_mime_new_message char *  subtype,
int  mechanism
 

Here is the call graph for this function:

struct mailmime* a_Message_mime_new_multipart char *  subtype,
int  mechanism
 

Here is the call graph for this function:

int a_Message_mime_remove_parameter struct mailmime *  mime,
const char *  param_name
 

Remove all instances of a parameter in a MIME part

Parameters:
mime the MIME part from which the parameter is to be removed
param_mime the parameter to remove. If NULL, all parameters are removed
Returns:
0 on success, or -1 if mime is NULL.

int a_Message_mime_remove_selected XePMessage message  ) 
 

Remove the selected MIME part

Parameters:
message the XePMessage. Its selected_part member must point to the MIME part to be removed
Returns:
0 on success, -1 on failure.

void a_Message_mime_set_body_text struct mailmime *  mime,
char *  data,
size_t  size
 

void a_Message_mime_set_description struct mailmime *  mime,
char *  description
 

Add a description to a given MIME part

Parameters:
mime the MIME part to describe
description the description

XePMessage* a_Message_new void   ) 
 

Must be called from the main thread

XePMessage* a_Message_new_for_fetching XePFolder folder,
mailmessage *  msg
 

Here is the call graph for this function:

XePMessage* a_Message_new_from_data char *  data,
size_t  len
 

Here is the call graph for this function:

XePMessage* a_Message_new_from_data_noparse char *  data,
size_t  size
 

Create a new XePMessage that will own an in-memory RFC2822/822 message

Parameters:
data pointer to the in-memory message
size the size of the message
Returns:
a new XePMessage owning the in-memory data

Here is the call graph for this function:

XePMessage* a_Message_new_from_file_noparse const char *  filename  ) 
 

Create a new XePMessage that is contained in a file. The file is not opened.

Parameters:
filename name of the RFC2822/822 file
Returns:
a new XePMessage referencing the file

Here is the call graph for this function:

XePMessage* a_Message_new_to_compose void   ) 
 

Create a XePMessage for a message to be composed The message is a message/rfc822 MIME message and the user agent header is set.

Here is the call graph for this function:

XePMessage* a_Message_new_to_forward XePMessage message  ) 
 

Here is the call graph for this function:

XePMessage* a_Message_new_to_redirect XePMessage message  ) 
 

Here is the call graph for this function:

XePMessage* a_Message_new_to_reply XePMessage message  ) 
 

Here is the call graph for this function:

void a_Message_set_folder XePMessage message,
XePFolder folder
 

void a_Message_write_to_file XePMessage message,
FILE *  file
 

char* a_Message_write_to_temp_file XePMessage message  ) 
 

Here is the call graph for this function:


Generated on Wed Oct 22 15:54:52 2003 for XetPan by doxygen 1.3.2