~ubuntu-branches/ubuntu/vivid/ekiga/vivid-proposed

« back to all changes in this revision

Viewing changes to lib/engine/components/hal-dbus/hal-manager-dbus.h

  • Committer: Bazaar Package Importer
  • Author(s): Kilian Krause
  • Date: 2011-07-17 00:24:50 UTC
  • mfrom: (5.1.5 upstream) (7.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110717002450-ytg3wsrc1ptd3153
Tags: 3.3.1-1
* New upstream release.
 - Required libpt-dev 2.10 and libopal-dev 3.10
* Fix debian/watch to catch new version
* Remove libnotify0.7.patch - included upstream
* Add libboost-dev and libboost-signals-dev to Build-Depends
* debian/rules: Don't install *.la files for new internal shared libs
* Fix Vcs URIs to point to correct desktop/experimental/ekiga tree

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*
 
3
 * Ekiga -- A VoIP and Video-Conferencing application
 
4
 * Copyright (C) 2000-2009 Damien Sandras <dsandras@seconix.com>
 
5
 
 
6
 * This program is free software; you can  redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or (at
 
9
 * your option) any later version. This program is distributed in the hope
 
10
 * that it will be useful, but WITHOUT ANY WARRANTY; without even the
 
11
 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
12
 * See the GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License along
 
15
 * with this program; if not, write to the Free Software Foundation, Inc.,
 
16
 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
17
 *
 
18
 * Ekiga is licensed under the GPL license and as a special exception, you
 
19
 * have permission to link or otherwise combine this program with the
 
20
 * programs OPAL, OpenH323 and PWLIB, and distribute the combination, without
 
21
 * applying the requirements of the GNU GPL to the OPAL, OpenH323 and PWLIB
 
22
 * programs, as long as you do follow the requirements of the GNU GPL for all
 
23
 * the rest of the software thus combined.
 
24
 */
 
25
 
 
26
 
 
27
/*
 
28
 *                         hal-manager-mlogo.h  -  description
 
29
 *                         ------------------------------------------
 
30
 *   begin                : written in 2008 by Matthias Schneider
 
31
 *   copyright            : (c) 2008 by Matthias Schneider
 
32
 *   description          : Declaration of the interface of a hal core.
 
33
 *                          A hal core manages HalManagers.
 
34
 *
 
35
 */
 
36
 
 
37
 
 
38
#ifndef __HAL_MANAGER_DBUS_H__
 
39
#define __HAL_MANAGER_DBUS_H__
 
40
 
 
41
#include "hal-core.h"
 
42
#include "hal-manager.h"
 
43
#include "runtime.h"
 
44
 
 
45
extern "C" {
 
46
#include <dbus/dbus.h>
 
47
#include <dbus/dbus-glib.h>
 
48
#include <glib-object.h>
 
49
}
 
50
 
 
51
#include <vector>
 
52
 
 
53
/**
 
54
 * @addtogroup hal
 
55
 * @{
 
56
 */
 
57
  typedef struct HalDevice {
 
58
    std::string key;
 
59
    std::string category;
 
60
    std::string name;
 
61
    std::string type;
 
62
    unsigned video_capabilities;
 
63
  } HalDevice;
 
64
 
 
65
  typedef struct NmInterface {
 
66
    std::string key;
 
67
    std::string name;
 
68
    std::string ip4_address;
 
69
    bool active;
 
70
  } NmInterface;
 
71
 
 
72
  class HalManager_dbus
 
73
   : public Ekiga::HalManager
 
74
    {
 
75
  public:
 
76
 
 
77
      /* The constructor
 
78
       */
 
79
      HalManager_dbus (Ekiga::ServiceCore & core);
 
80
      /* The destructor
 
81
       */
 
82
      ~HalManager_dbus ();
 
83
 
 
84
 
 
85
      /*                 
 
86
       * DISPLAY MANAGEMENT 
 
87
       */               
 
88
 
 
89
      /** Create a call based on the remote uri given as parameter
 
90
       * @param uri  an uri
 
91
       * @return     true if a Ekiga::Call could be created
 
92
       */
 
93
      static void device_added_cb_proxy (DBusGProxy *object, const char *device, gpointer user_data);
 
94
      static void device_removed_cb_proxy (DBusGProxy *object, const char *device, gpointer user_data);
 
95
 
 
96
      static void interface_no_longer_active_cb_proxy (DBusGProxy *object, const char *interface, gpointer user_data);
 
97
      static void interface_now_active_cb_proxy (DBusGProxy *object, const char *interface, gpointer user_data);
 
98
      static void interface_ip4_address_change_cb_proxy (DBusGProxy *object, const char *interface, gpointer user_data);
 
99
 
 
100
      void device_added_cb (const char *device);
 
101
      void device_removed_cb (const char *device);
 
102
 
 
103
      void interface_now_active_cb (const char *interface);
 
104
      void interface_no_longer_active_cb (const char *interface);
 
105
      void interface_ip4_address_change_cb (const char *interface);
 
106
 
 
107
  protected:  
 
108
      void populate_devices_list();
 
109
      void populate_interfaces_list ();
 
110
 
 
111
      bool get_device_type_name (const char * device, HalDevice & hal_device);
 
112
      void get_interface_name_ip (const char * interface, NmInterface & nm_interface);
 
113
 
 
114
      void get_string_property (DBusGProxy *proxy, const char * property, std::string & value);
 
115
 
 
116
      Ekiga::ServiceCore & core;
 
117
 
 
118
      DBusGConnection * bus;
 
119
      DBusGProxy * hal_proxy;
 
120
      DBusGProxy * nm_proxy;
 
121
 
 
122
      std::vector <HalDevice> hal_devices;
 
123
      std::vector <NmInterface> nm_interfaces;
 
124
 
 
125
  };
 
126
/**
 
127
 * @}
 
128
 */
 
129
 
 
130
 
 
131
#endif