## mcd-dispatcher-context mcd-dispatcher-context |

## Synopsis

    #define             MCD_PLUGIN_INIT_FUNC
    #define             MCD_FILTER_IN
    #define             MCD_FILTER_OUT
                        McdDispatcherContext;
    void                (*McdFilterFunc)                    (McdDispatcherContext *ctx,
                                                             gpointer user_data);
    #define             MCD_FILTER_PRIORITY_CRITICAL
    #define             MCD_FILTER_PRIORITY_SYSTEM
    #define             MCD_FILTER_PRIORITY_USER
    #define             MCD_FILTER_PRIORITY_NOTICE
    #define             MCD_FILTER_PRIORITY_LOW
                        McdFilter;
    void                mcd_dispatcher_register_filter      (McdDispatcher *dispatcher,
                                                             McdFilterFunc filter,
                                                             GQuark channel_type_quark,
                                                             guint filter_flags,
                                                             guint priority,
                                                             gpointer user_data);
    void                mcd_dispatcher_unregister_filter    (McdDispatcher *dispatcher,
                                                             McdFilterFunc filter,
                                                             GQuark channel_type_quark,
                                                             guint filter_flags);
    void                mcd_dispatcher_register_filters     (McdDispatcher *dispatcher,
                                                             McdFilter *filters,
                                                             GQuark channel_type_quark,
                                                             guint filter_flags);
    McdDispatcher*      mcd_dispatcher_context_get_dispatcher
                                                            (McdDispatcherContext *ctx);
    TpChannel*          mcd_dispatcher_context_get_channel_object
                                                            (McdDispatcherContext *ctx);
    TpConnection*       mcd_dispatcher_context_get_connection_object
                                                            (McdDispatcherContext *ctx);
    McdChannel*         mcd_dispatcher_context_get_channel  (McdDispatcherContext *ctx);
    McdConnection*      mcd_dispatcher_context_get_connection
                                                            (McdDispatcherContext *ctx);
    McdChannelHandler*  mcd_dispatcher_context_get_chan_handler
                                                            (McdDispatcherContext *ctx);
    GPtrArray*          mcd_dispatcher_context_get_members  (McdDispatcherContext *ctx);
    void                mcd_dispatcher_context_process      (McdDispatcherContext *ctx,
                                                             gboolean result);

## Description

## Details

### MCD_PLUGIN_INIT_FUNC

    #define MCD_PLUGIN_INIT_FUNC  "mcd_filters_init"

### MCD_FILTER_IN

    #define MCD_FILTER_IN  1<<0

### MCD_FILTER_OUT

    #define MCD_FILTER_OUT 1<<1

### McdDispatcherContext

    typedef struct _McdDispatcherContext McdDispatcherContext;

### McdFilterFunc ()

    void                (*McdFilterFunc)                    (McdDispatcherContext *ctx,
                                                             gpointer user_data);

`ctx` : |
`user_data` : |

### MCD_FILTER_PRIORITY_CRITICAL

    #define MCD_FILTER_PRIORITY_CRITICAL 10000

### MCD_FILTER_PRIORITY_SYSTEM

    #define MCD_FILTER_PRIORITY_SYSTEM   20000

### MCD_FILTER_PRIORITY_USER

    #define MCD_FILTER_PRIORITY_USER     30000

### MCD_FILTER_PRIORITY_NOTICE

    #define MCD_FILTER_PRIORITY_NOTICE   40000

### MCD_FILTER_PRIORITY_LOW

    #define MCD_FILTER_PRIORITY_LOW	     50000

### McdFilter

    typedef struct {
        McdFilterFunc func;
        guint priority;
        gpointer user_data;
    } McdFilter;

### mcd_dispatcher_register_filter ()

    void                mcd_dispatcher_register_filter      (McdDispatcher *dispatcher,
                                                             McdFilterFunc filter,
                                                             GQuark channel_type_quark,
                                                             guint filter_flags,
                                                             guint priority,
                                                             gpointer user_data);

Indicates to Mission Control that we want to register a filter for a unique combination of channel type/filter flags.

`dispatcher` : | The McdDispatcher.
`filter` : | the filter function to be registered.
`channel_type_quark` : | Quark indicating the channel type.
`filter_flags` : | The flags for the filter, such as incoming/outgoing.
`priority` : | The priority of the filter.
`user_data` : |

### mcd_dispatcher_unregister_filter ()

    void                mcd_dispatcher_unregister_filter    (McdDispatcher *dispatcher,
                                                             McdFilterFunc filter,
                                                             GQuark channel_type_quark,
                                                             guint filter_flags);

Indicates to Mission Control that we will not want to have a filter for particular unique channel type/filter flags combination anymore.

`dispatcher` : | The McdDispatcher.
`filter` : | the filter function to be registered.
`channel_type_quark` : | Quark indicating the channel type.
`filter_flags` : | The flags for the filter, such as incoming/outgoing.

### mcd_dispatcher_register_filters ()

    void                mcd_dispatcher_register_filters     (McdDispatcher *dispatcher,
                                                             McdFilter *filters,
                                                             GQuark channel_type_quark,
                                                             guint filter_flags);

Convenience function to register a batch of filters at once.

`dispatcher` : | The McdDispatcher.
`filters` : | a zero-terminated array of McdFilter elements.
`channel_type_quark` : | Quark indicating the channel type.
`filter_flags` : | The flags for the filter, such as incoming/outgoing.

### mcd_dispatcher_context_get_dispatcher ()

    McdDispatcher*      mcd_dispatcher_context_get_dispatcher
                                                            (McdDispatcherContext *ctx);

`ctx` : |
Returns : |

### mcd_dispatcher_context_get_channel_object ()

    TpChannel*          mcd_dispatcher_context_get_channel_object
                                                            (McdDispatcherContext *ctx);

`ctx` : |
Returns : |

### mcd_dispatcher_context_get_connection_object ()

    TpConnection*       mcd_dispatcher_context_get_connection_object
                                                            (McdDispatcherContext *ctx);

`ctx` : |
Returns : |

### mcd_dispatcher_context_get_channel ()

    McdChannel*         mcd_dispatcher_context_get_channel  (McdDispatcherContext *ctx);

`ctx` : |
Returns : |

### mcd_dispatcher_context_get_connection ()

    McdConnection*      mcd_dispatcher_context_get_connection
                                                            (McdDispatcherContext *ctx);

`ctx` : |
Returns : |

### mcd_dispatcher_context_get_chan_handler ()

    McdChannelHandler*  mcd_dispatcher_context_get_chan_handler
                                                            (McdDispatcherContext *ctx);

`ctx` : |
Returns : |

### mcd_dispatcher_context_get_members ()

    GPtrArray*          mcd_dispatcher_context_get_members  (McdDispatcherContext *ctx);

`ctx` : |
Returns : |

### mcd_dispatcher_context_process ()

    void                mcd_dispatcher_context_process      (McdDispatcherContext *ctx,
                                                             gboolean result);

`ctx` : |
`result` : |