## 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);
    TpConnectionStatus  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);

## Object Hierarchy

      GObject
       +----McdMission
             +----McdOperation
                   +----McdController
                         +----McdMaster
                               +----McdService

## Properties

      "dbus-connection"          gpointer              : Read
      "default-presence"         guint                 : Read / Write
      "dispatcher"               McdDispatcher*        : Read
      "presence-frame"           McdPresenceFrame*     : Read

## 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 _McdMaster McdMaster;

### struct mcd_channel_request

    struct mcd_channel_request;

### 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 ()

    TpConnectionStatus  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 : |

## Property Details

### The `"dbus-connection"` property

      "dbus-connection"          gpointer              : Read

Connection to the D-Bus.

### The `"default-presence"` property

      "default-presence"         guint                 : Read / Write

Default presence when connecting.

Allowed values: <= 7

Default value: 0

### The `"dispatcher"` property

      "dispatcher"               McdDispatcher*        : Read

Dispatcher Object used to dispatch channels.

### The `"presence-frame"` property

      "presence-frame"           McdPresenceFrame*     : Read

Presence frame Object used by connections to update presence.