## CallsMessageSource

CallsMessageSource — A source of messages for the user.

## Functions

#define | CALLS_EMIT_MESSAGE()
#define | CALLS_ERROR()
void | calls_message_source_emit_message ()

## Signals

void | message | Run Last

## Types and Values

#define | CALLS_TYPE_MESSAGE_SOURCE
struct | CallsMessageSourceInterface
| CallsMessageSource

## Object Hierarchy

        GInterface
        ╰── CallsMessageSource

## Prerequisites

CallsMessageSource requires GObject.

## Known Derived Interfaces

CallsMessageSource is required by CallsAccount and CallsOrigin.

## Known Implementations

CallsMessageSource is implemented by CallsManager.

## Description

All three of the main interfaces, CallsProvider, CallsOrigin and CallsCall require CallsMessageSource. They use this interface's message signal to emit messages intended for display to the user.

## Functions

### CALLS_EMIT_MESSAGE()

    #define             CALLS_EMIT_MESSAGE(obj,text,type)

Emit a message signal with the specified information. This is a convenience macro for objects implementing interfaces that require CallsMessageSource.

#### Parameters

obj | an object which can be cast to a CallsMessageSource |
text | the message text as a string |
type | the type of the message |

### CALLS_ERROR()

    #define             CALLS_ERROR(obj,error)

Emit a message signal with an error type, the text of which is contained as the message in a GError. This is a convenience macro for objects implementing interfaces that require CallsMessageSource.

#### Parameters

obj | an object which can be cast to a CallsMessageSource |
error | a pointer to a GError containing the error message |

### calls_message_source_emit_message ()

    void
    calls_message_source_emit_message (CallsMessageSource *self,
                                       const char *message,
                                       GtkMessageType message_type);

Emits a message which should be shown to the user in the user interface. Messages should be translated into the users locale

#### Parameters

self | A CallsMessageSource |
message | The message to emit |
message_type | The type of the message: Error, warning, etc |

## Types and Values

### CALLS_TYPE_MESSAGE_SOURCE

    #define CALLS_TYPE_MESSAGE_SOURCE (calls_message_source_get_type ())

### struct CallsMessageSourceInterface

    struct CallsMessageSourceInterface {
      GTypeInterface parent_iface;
    };

### CallsMessageSource

    typedef struct _CallsMessageSource CallsMessageSource;

## Signal Details

### The `“message”` signal

    void
    user_function (CallsMessageSource *self,
                   char               *text,
                   GtkMessageType      type,
                   gpointer            user_data)

This signal is emitted when an implementing-object needs to emit a message to the user. The message should be suitable for presentation to the user as-is. This means it should be translated to the users locale.

#### Parameters

self | The CallsMessageSource instance. |
text | The message text. |
type | The type of the message; error, warning, etc. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last