~ubuntu-branches/ubuntu/natty/empathy/natty-updates

« back to all changes in this revision

Viewing changes to libempathy/empathy-tp-call.h

Tags: upstream-0.22.0
ImportĀ upstreamĀ versionĀ 0.22.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
1
/*
3
 
 * Copyright (C) 2007 Elliot Fairweather
4
 
 * Copyright (C) 2007 Collabora Ltd.
5
 
 *
6
 
 * This library is free software; you can redistribute it and/or
7
 
 * modify it under the terms of the GNU Lesser General Public
8
 
 * License as published by the Free Software Foundation; either
9
 
 * version 2.1 of the License, or (at your option) any later version.
10
 
 *
11
 
 * This library is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 
 * Lesser General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU Lesser General Public
17
 
 * License along with this library; if not, write to the Free Software
18
 
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 
 *
20
 
 * Authors: Elliot Fairweather <elliot.fairweather@collabora.co.uk>
21
 
 *          Xavier Claessens <xclaesse@gmail.com>
 
2
 *  Copyright (C) 2007 Elliot Fairweather
 
3
 *
 
4
 *  This library is free software; you can redistribute it and/or
 
5
 *  modify it under the terms of the GNU Lesser General Public
 
6
 *  License as published by the Free Software Foundation; either
 
7
 *  version 2.1 of the License, or (at your option) any later version.
 
8
 *
 
9
 *  This library is distributed in the hope that it will be useful,
 
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
 *  Lesser General Public License for more details.
 
13
 *
 
14
 *  You should have received a copy of the GNU Lesser General Public
 
15
 *  License along with this library; if not, write to the Free Software
 
16
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
17
 *
 
18
 *  Authors: Elliot Fairweather <elliot.fairweather@collabora.co.uk>
22
19
 */
23
20
 
24
21
#ifndef __EMPATHY_TP_CALL_H__
25
22
#define __EMPATHY_TP_CALL_H__
26
23
 
27
24
#include <libtelepathy/tp-chan.h>
28
 
#include <libtelepathy/tp-constants.h>
29
 
 
30
 
#include <libmissioncontrol/mc-account.h>
31
 
 
32
 
#include "empathy-contact.h"
 
25
#include <libtelepathy/tp-conn.h>
 
26
 
 
27
#include <libmissioncontrol/mission-control.h>
 
28
 
 
29
#include <libempathy/empathy-chandler.h>
 
30
#include <libempathy/empathy-contact.h>
 
31
#include <libempathy/empathy-tp-group.h>
33
32
 
34
33
G_BEGIN_DECLS
35
34
 
36
 
#define EMPATHY_TYPE_TP_CALL              (empathy_tp_call_get_type ())
37
 
#define EMPATHY_TP_CALL(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), EMPATHY_TYPE_TP_CALL, EmpathyTpCall))
38
 
#define EMPATHY_TP_CALL_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), EMPATHY_TYPE_TP_CALL, EmpathyTpCallClass))
39
 
#define EMPATHY_IS_TP_CALL(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), EMPATHY_TYPE_TP_CALL))
40
 
#define EMPATHY_IS_TP_CALL_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), EMPATHY_TYPE_TP_CALL))
41
 
#define EMPATHY_TP_CALL_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), EMPATHY_TYPE_TP_CALL, EmpathyTpCallClass))
 
35
#define EMPATHY_TYPE_TP_CALL (empathy_tp_call_get_type ())
 
36
#define EMPATHY_TP_CALL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), \
 
37
    EMPATHY_TYPE_TP_CALL, EmpathyTpCall))
 
38
#define EMPATHY_TP_CALL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
 
39
    EMPATHY_TYPE_TP_CALL, EmpathyTpCallClass))
 
40
#define EMPATHY_IS_TP_CALL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), \
 
41
    EMPATHY_TYPE_TP_CALL))
 
42
#define EMPATHY_IS_TP_CALL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
 
43
    EMPATHY_TYPE_TP_CALL))
 
44
#define EMPATHY_TP_CALL_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), \
 
45
    EMPATHY_TYPE_TP_CALL, EmpathyTpCallClass))
42
46
 
43
47
typedef struct _EmpathyTpCall EmpathyTpCall;
44
48
typedef struct _EmpathyTpCallClass EmpathyTpCallClass;
45
49
 
46
50
struct _EmpathyTpCall {
47
 
        GObject parent;
 
51
    GObject parent;
48
52
};
49
53
 
50
54
struct _EmpathyTpCallClass {
51
 
        GObjectClass parent_class;
 
55
    GObjectClass parent_class;
52
56
};
53
57
 
54
 
typedef enum {
55
 
        EMPATHY_TP_CALL_STATUS_PREPARING,
56
 
        EMPATHY_TP_CALL_STATUS_RINGING,
57
 
        EMPATHY_TP_CALL_STATUS_RUNNING
 
58
typedef enum
 
59
{
 
60
  EMPATHY_TP_CALL_STATUS_READYING,
 
61
  EMPATHY_TP_CALL_STATUS_PENDING,
 
62
  EMPATHY_TP_CALL_STATUS_ACCEPTED,
 
63
  EMPATHY_TP_CALL_STATUS_CLOSED
58
64
} EmpathyTpCallStatus;
59
65
 
60
 
GType               empathy_tp_call_get_type              (void) G_GNUC_CONST;
61
 
EmpathyTpCall *     empathy_tp_call_new                   (McAccount      *account,
62
 
                                                           TpChan         *tp_chan);
63
 
gboolean            empathy_tp_call_is_incoming           (EmpathyTpCall  *call);
64
 
EmpathyTpCallStatus empathy_tp_call_get_status            (EmpathyTpCall  *call);
65
 
EmpathyContact *    empathy_tp_call_get_contact           (EmpathyTpCall  *call);
66
 
void                empathy_tp_call_accept                (EmpathyTpCall  *call);
67
 
void                empathy_tp_call_invite                (EmpathyTpCall  *call,
68
 
                                                           EmpathyContact *contact);
69
 
void                empathy_tp_call_request_streams       (EmpathyTpCall  *call,
70
 
                                                           gboolean        audio,
71
 
                                                           gboolean        video);
72
 
void                empathy_tp_call_send_video            (EmpathyTpCall  *call,
73
 
                                                           gboolean        send);
74
 
void                empathy_tp_call_add_preview_window    (EmpathyTpCall  *call,
75
 
                                                           guint           socket_id);
76
 
void                empathy_tp_call_remove_preview_window (EmpathyTpCall  *call,
77
 
                                                           guint           socket_id);
78
 
void                empathy_tp_call_set_output_window     (EmpathyTpCall  *call,
79
 
                                                           guint           socket_id);
80
 
void                empathy_tp_call_set_output_volume     (EmpathyTpCall  *call,
81
 
                                                           guint           volume);
82
 
void                empathy_tp_call_mute_output           (EmpathyTpCall  *call,
83
 
                                                           gboolean        is_muted);
84
 
void                empathy_tp_call_mute_input            (EmpathyTpCall  *call,
85
 
                                                           gboolean        is_muted);
 
66
typedef struct
 
67
{
 
68
  gboolean exists;
 
69
  guint id;
 
70
  guint state;
 
71
  guint direction;
 
72
} EmpathyTpCallStream;
 
73
 
 
74
GType empathy_tp_call_get_type (void) G_GNUC_CONST;
 
75
EmpathyTpCall *empathy_tp_call_new (TpConn *connection, TpChan *channel);
 
76
 
 
77
void empathy_tp_call_accept_incoming_call (EmpathyTpCall *call);
 
78
void empathy_tp_call_close_channel (EmpathyTpCall *call);
 
79
void empathy_tp_call_request_video_stream_direction (EmpathyTpCall *call,
 
80
    gboolean is_sending);
 
81
void empathy_tp_call_add_preview_video (EmpathyTpCall *call,
 
82
    guint preview_video_socket_id);
 
83
void empathy_tp_call_remove_preview_video (EmpathyTpCall *call,
 
84
    guint preview_video_socket_id);
 
85
void empathy_tp_call_add_output_video (EmpathyTpCall *call,
 
86
    guint output_video_socket_id);
 
87
void empathy_tp_call_set_output_volume (EmpathyTpCall *call, guint volume);
 
88
void empathy_tp_call_mute_output (EmpathyTpCall *call, gboolean is_muted);
 
89
void empathy_tp_call_mute_input (EmpathyTpCall *call, gboolean is_muted);
86
90
 
87
91
G_END_DECLS
88
92