McdMaster

## McdMaster McdMaster — Server master class |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <mcd-master.h>

                        McdMaster;
    struct              mcd_channel_request;
    McdMaster*          mcd_master_new                      (void);
    void                mcd_master_request_presence         (McdMaster *master,
                                                             McPresence presence,
                                                             const gchar *presence_message);
    McPresence          mcd_master_get_actual_presence      (McdMaster *master);
    McPresence          mcd_master_get_requested_presence   (McdMaster *master);
    gboolean            mcd_master_set_default_presence     (McdMaster *master,
                                                             const gchar *client_id);
    void                mcd_master_set_default_presence_setting
                                                            (McdMaster *master,
                                                             McPresence presence);
    TelepathyConnectionStatus mcd_master_get_account_status (McdMaster *master,
                                                             gchar *account_name);
    gboolean            mcd_master_get_online_connection_names
                                                            (McdMaster *master,
                                                             gchar ***connected_names);
    gboolean            mcd_master_get_account_connection_details
                                                            (McdMaster *master,
                                                             const gchar *account_name,
                                                             gchar **servname,
                                                             gchar **objpath);
    gboolean            mcd_master_cancel_last_presence_request
                                                            (McdMaster *master);
    gboolean            mcd_master_request_channel          (McdMaster *master,
                                                             const struct mcd_channel_request *req,
                                                             GError **error);
    gboolean            mcd_master_cancel_channel_request   (McdMaster *master,
                                                             guint operation_id,
                                                             const gchar *requestor_client_id,
                                                             GError **error);
    gboolean            mcd_master_get_used_channels_count  (McdMaster *master,
                                                             guint chan_type,
                                                             guint *ret,
                                                             GError **error);
    McdConnection*      mcd_master_get_connection           (McdMaster *master,
                                                             const gchar *object_path,
                                                             GError **error);
    gboolean            mcd_master_get_account_for_connection
                                                            (McdMaster *master,
                                                             const gchar *object_path,
                                                             gchar **ret_unique_name,
                                                             GError **error);

## Description

This class implements actual mission-control. It keeps track of individual account presence and connection states in a McdPresenceFrame member object, which is available as a property.

The McdPresenceFrame object could be easily utilized for any presence releated events and actions, either within this class or any other class subclassing it or using it.

It is basically a container for all McdManager objects and takes care of their management. It also takes care of sleep and awake cycles (e.g. translates to auto away somewhere down the hierarchy).

McdMaster is a subclass of McdConroller, which essentially means it is subject to all device control.

## Details

### McdMaster

    typedef struct {
        McdController parent;
    } McdMaster;

### struct mcd_channel_request

    struct mcd_channel_request {
        const gchar *account_name;
        const gchar *channel_type;
        guint channel_handle;
        const gchar *channel_handle_string;
        gint channel_handle_type;
        guint requestor_serial;
        const gchar *requestor_client_id;
    };

### mcd_master_new ()

    McdMaster*          mcd_master_new                      (void);

Returns : |

### mcd_master_request_presence ()

    void                mcd_master_request_presence         (McdMaster *master,
                                                             McPresence presence,
                                                             const gchar *presence_message);

`master` : |
`presence` : |
`presence_message` : |

### mcd_master_get_actual_presence ()

    McPresence          mcd_master_get_actual_presence      (McdMaster *master);

`master` : |
Returns : |

### mcd_master_get_requested_presence ()

    McPresence          mcd_master_get_requested_presence   (McdMaster *master);

`master` : |
Returns : |

### mcd_master_set_default_presence ()

    gboolean            mcd_master_set_default_presence     (McdMaster *master,
                                                             const gchar *client_id);

`master` : |
`client_id` : |
Returns : |

### mcd_master_set_default_presence_setting ()

    void                mcd_master_set_default_presence_setting
                                                            (McdMaster *master,
                                                             McPresence presence);

`master` : |
`presence` : |

### mcd_master_get_account_status ()

    TelepathyConnectionStatus mcd_master_get_account_status (McdMaster *master,
                                                             gchar *account_name);

`master` : |
`account_name` : |
Returns : |

### mcd_master_get_online_connection_names ()

    gboolean            mcd_master_get_online_connection_names
                                                            (McdMaster *master,
                                                             gchar ***connected_names);

`master` : |
`connected_names` : |
Returns : |

### mcd_master_get_account_connection_details ()

    gboolean            mcd_master_get_account_connection_details
                                                            (McdMaster *master,
                                                             const gchar *account_name,
                                                             gchar **servname,
                                                             gchar **objpath);

`master` : |
`account_name` : |
`servname` : |
`objpath` : |
Returns : |

### mcd_master_cancel_last_presence_request ()

    gboolean            mcd_master_cancel_last_presence_request
                                                            (McdMaster *master);

`master` : |
Returns : |

### mcd_master_request_channel ()

    gboolean            mcd_master_request_channel          (McdMaster *master,
                                                             const struct mcd_channel_request *req,
                                                             GError **error);

`master` : |
`req` : |
`error` : |
Returns : |

### mcd_master_cancel_channel_request ()

    gboolean            mcd_master_cancel_channel_request   (McdMaster *master,
                                                             guint operation_id,
                                                             const gchar *requestor_client_id,
                                                             GError **error);

`master` : |
`operation_id` : |
`requestor_client_id` : |
`error` : |
Returns : |

### mcd_master_get_used_channels_count ()

    gboolean            mcd_master_get_used_channels_count  (McdMaster *master,
                                                             guint chan_type,
                                                             guint *ret,
                                                             GError **error);

`master` : |
`chan_type` : |
`ret` : |
`error` : |
Returns : |

### mcd_master_get_connection ()

    McdConnection*      mcd_master_get_connection           (McdMaster *master,
                                                             const gchar *object_path,
                                                             GError **error);

`master` : |
`object_path` : |
`error` : |
Returns : |

### mcd_master_get_account_for_connection ()

    gboolean            mcd_master_get_account_for_connection
                                                            (McdMaster *master,
                                                             const gchar *object_path,
                                                             gchar **ret_unique_name,
                                                             GError **error);

`master` : |
`object_path` : |
`ret_unique_name` : |
`error` : |
Returns : |