GtrMsg

## GtrMsg GtrMsg |

## Synopsis

    struct              GtrMsg;
    struct              GtrMsgClass;
    enum                GtrMsgStatus;
    GType               gtr_msg_register_type               (GTypeModule *module);
    GtrMsg *            gtr_msg_new                         (po_message_iterator_t iter,
                                                             po_message_t message);
    po_message_iterator_t gtr_msg_get_iterator              (GtrMsg *msg);
    void                gtr_msg_set_iterator                (GtrMsg *msg,
                                                             po_message_iterator_t iter);
    po_message_t        gtr_msg_get_message                 (GtrMsg *msg);
    void                gtr_msg_set_message                 (GtrMsg *msg,
                                                             po_message_t message);
    GtkTreeRowReference * gtr_msg_get_row_reference         (GtrMsg *msg);
    void                gtr_msg_set_row_reference           (GtrMsg *msg,
                                                             GtkTreeRowReference *row_reference);
    gboolean            gtr_msg_is_translated               (GtrMsg *msg);
    gboolean            gtr_msg_is_fuzzy                    (GtrMsg *msg);
    void                gtr_msg_set_fuzzy                   (GtrMsg *msg,
                                                             gboolean fuzzy);
    void                gtr_msg_set_status                  (GtrMsg *msg,
                                                             GtrMsgStatus status);
    GtrMsgStatus        gtr_msg_get_status                  (GtrMsg *msg);
    const gchar *       gtr_msg_get_msgid                   (GtrMsg *msg);
    const gchar *       gtr_msg_get_msgid_plural            (GtrMsg *msg);
    const gchar *       gtr_msg_get_msgstr                  (GtrMsg *msg);
    void                gtr_msg_set_msgstr                  (GtrMsg *msg,
                                                             const gchar *msgstr);
    const gchar *       gtr_msg_get_msgstr_plural           (GtrMsg *msg,
                                                             gint index);
    void                gtr_msg_set_msgstr_plural           (GtrMsg *msg,
                                                             gint index,
                                                             const gchar *msgstr);
    const gchar *       gtr_msg_get_comment                 (GtrMsg *msg);
    void                gtr_msg_set_comment                 (GtrMsg *msg,
                                                             const gchar *comment);
    gint                gtr_msg_get_po_position             (GtrMsg *msg);
    void                gtr_msg_set_po_position             (GtrMsg *msg,
                                                             gint po_position);
    const gchar *       gtr_msg_get_extracted_comments      (GtrMsg *msg);
    const gchar *       gtr_msg_get_filename                (GtrMsg *msg,
                                                             gint i);
    gint *              gtr_msg_get_file_line               (GtrMsg *msg,
                                                             gint i);
    const gchar *       gtr_msg_get_msgctxt                 (GtrMsg *msg);
    const gchar *       gtr_msg_get_format                  (GtrMsg *msg);
    gchar *             gtr_msg_check                       (GtrMsg *msg);
                        GtrMsgPrivate;

## Description

## Details

### struct GtrMsg

    struct GtrMsg {
      GObject parent_instance;
    };

### struct GtrMsgClass

    struct GtrMsgClass {
      GObjectClass parent_class;
    };

### enum GtrMsgStatus

    typedef enum {
      GTR_MSG_STATUS_UNTRANSLATED,
      GTR_MSG_STATUS_FUZZY,
      GTR_MSG_STATUS_TRANSLATED
    } GtrMsgStatus;

### gtr_msg_register_type ()

    GType               gtr_msg_register_type               (GTypeModule *module);

### gtr_msg_new ()

    GtrMsg *            gtr_msg_new                         (po_message_iterator_t iter,
                                                             po_message_t message);

Creates a new GtrMsg.

`iter` : | the po_message_iterator_t to set into the `msg`
`message` : | the
Returns : | a new GtrMsg object. [transfer full]

### gtr_msg_get_iterator ()

    po_message_iterator_t gtr_msg_get_iterator              (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the message iterator in gettext format

### gtr_msg_set_iterator ()

    void                gtr_msg_set_iterator                (GtrMsg *msg,
                                                             po_message_iterator_t iter);

Sets the iterator into the GtrMsg class.

`msg` : | a GtrMsg
`iter` : | the po_message_iterator_t to set into the `msg`

### gtr_msg_get_message ()

    po_message_t        gtr_msg_get_message                 (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the message in gettext format

### gtr_msg_set_message ()

    void                gtr_msg_set_message                 (GtrMsg *msg,
                                                             po_message_t message);

Sets the message into the GtrMsg class.

`msg` : | a GtrMsg
`message` : | the po_message_t to set into the `msg`

### gtr_msg_get_row_reference ()

    GtkTreeRowReference * gtr_msg_get_row_reference         (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the GtkTreeRowReference corresponding to the message's place in the message table

### gtr_msg_set_row_reference ()

    void                gtr_msg_set_row_reference           (GtrMsg *msg,
                                                             GtkTreeRowReference *row_reference);

Sets the GtkTreeRowReference from the messages table for the given message

`msg` : | a GtrMsg
`row_reference` : | the GtkTreeRowReference corresponding to position in the message table

### gtr_msg_is_translated ()

    gboolean            gtr_msg_is_translated               (GtrMsg *msg);

### gtr_msg_is_fuzzy ()

    gboolean            gtr_msg_is_fuzzy                    (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | TRUE if the message is fuzzy

### gtr_msg_set_fuzzy ()

    void                gtr_msg_set_fuzzy                   (GtrMsg *msg,
                                                             gboolean fuzzy);

Change the fuzzy mark of a message.

`msg` : | a GtrMsg
`fuzzy` : | the fuzzy value to set to the message

### gtr_msg_set_status ()

    void                gtr_msg_set_status                  (GtrMsg *msg,
                                                             GtrMsgStatus status);

Sets the status for a message.

`msg` : | a GtrMsg
`status` : | a GtrMsgStatus

### gtr_msg_get_status ()

    GtrMsgStatus        gtr_msg_get_status                  (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the message's status.

### gtr_msg_get_msgid ()

    const gchar *       gtr_msg_get_msgid                   (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the msgid (untranslated English string) of a message.

### gtr_msg_get_msgid_plural ()

    const gchar *       gtr_msg_get_msgid_plural            (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the msgid_plural (untranslated English plural string) of a message, or NULL for a message without plural. [transfer none]

### gtr_msg_get_msgstr ()

    const gchar *       gtr_msg_get_msgstr                  (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the msgstr (translation) of a message. Return the empty string for an untranslated message. [transfer none]

### gtr_msg_set_msgstr ()

    void                gtr_msg_set_msgstr                  (GtrMsg *msg,
                                                             const gchar *msgstr);

Change the msgstr (translation) of a message. Use an empty string to denote an untranslated message.

`msg` : | a GtrMsg
`msgstr` : | the string to set in the `msg`

### gtr_msg_get_msgstr_plural ()

    const gchar *       gtr_msg_get_msgstr_plural           (GtrMsg *msg,
                                                             gint index);

`msg` : | a GtrMsg
`index` : | the index of the plural array
Returns : | the msgstr[index] for a message with plural handling, or NULL when the index is out of range or for a message without plural. [transfer none]

### gtr_msg_set_msgstr_plural ()

    void                gtr_msg_set_msgstr_plural           (GtrMsg *msg,
                                                             gint index,
                                                             const gchar *msgstr);

Change the msgstr[index] for a message with plural handling. Use a NULL value at the end to reduce the number of plural forms.

`msg` : | a GtrMsg
`index` : | the index where to set the msgstr
`msgstr` : | the message to set in the msg

### gtr_msg_get_comment ()

    const gchar *       gtr_msg_get_comment                 (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | (transfer none) the comments for a message.

### gtr_msg_set_comment ()

    void                gtr_msg_set_comment                 (GtrMsg *msg,
                                                             const gchar *comment);

Change the comments for a message. comments should be a multiline string, ending in a newline, or empty.

`msg` : | a GtrMsg
`comment` : | the comment to set for a message

### gtr_msg_get_po_position ()

    gint                gtr_msg_get_po_position             (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the position of the message. Gets the position of this message in the PO file in relation to the other messages.

### gtr_msg_set_po_position ()

    void                gtr_msg_set_po_position             (GtrMsg *msg,
                                                             gint po_position);

Sets the numerical position of this message in relation to other messages.

`msg` : | a GtrMsg
`po_position` : | the numerical position of the message.

### gtr_msg_get_extracted_comments ()

    const gchar *       gtr_msg_get_extracted_comments      (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the extracted comments for a message. [transfer none]

### gtr_msg_get_filename ()

    const gchar *       gtr_msg_get_filename                (GtrMsg *msg,
                                                             gint i);

`msg` : | a GtrMsg
`i` : | the i-th file for a message.
Returns : | the i-th filename for a message, or NULL if `i` is out of range. [transfer none]

### gtr_msg_get_file_line ()

    gint *              gtr_msg_get_file_line               (GtrMsg *msg,
                                                             gint i);

`msg` : | a GtrMsg
`i` : | the i-th file for a message.
Returns : | the i-th file line for a message, or NULL if `i` is out of range. [transfer none]

### gtr_msg_get_msgctxt ()

    const gchar *       gtr_msg_get_msgctxt                 (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the context of a message, or NULL for a message not restricted to a context. [transfer none]

### gtr_msg_get_format ()

    const gchar *       gtr_msg_get_format                  (GtrMsg *msg);

Return the pretty name associated with a format type. For example, for "csharp-format", return "C#". Return NULL if the are no format type in the message.

`msg` : | a GtrMsg
Returns : | the pretty name associated with a format type or NULL if the message hasn't any format type. [transfer none]

### gtr_msg_check ()

    gchar *             gtr_msg_check                       (GtrMsg *msg);

Test whether the message translation is a valid format string if the message is marked as being a format string.

`msg` : | a GtrMsg
Returns : | the message error or NULL if there is not any error. Must be freed with g_free. [transfer full]

### GtrMsgPrivate

    typedef struct _GtrMsgPrivate GtrMsgPrivate;