/usr/include/giomm-2.4/giomm/dbusinterfacevtable.h is in libglibmm-2.4-dev 2.42.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | // -*- c++ -*-
// Generated by gmmproc 2.42.0 -- DO NOT MODIFY!
#ifndef _GIOMM_DBUSINTERFACEVTABLE_H
#define _GIOMM_DBUSINTERFACEVTABLE_H
#include <glibmm/ustring.h>
#include <sigc++/sigc++.h>
// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
/* Copyright (C) 2010 The giomm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <giomm/dbusmethodinvocation.h>
#include <gio/gio.h>
namespace Gio
{
namespace DBus
{
/**This represents a virtual table for
* handling properties and method calls for a D-Bus interface.
*
* If you want to handle getting/setting D-Bus properties asynchronously,
* simply register an object with the org.freedesktop.DBus.Properties D-Bus
* interface using Gio::DBus::Connection::register_object().
*
* The only correct use of this class is to declare a global instance of it
* (or an instance local to the main function) and pass pointers to the
* instance to the methods that require such a parameter. The instance can be
* used for multiple registrations and the memory it uses will be freed at the
* end of execution. Any other use (like creating an instance local to a
* function and using that) may cause memory leaks or errors (if the instance
* is destroyed too early).
*
* @newin{2,28}
* @ingroup DBus
*/
class InterfaceVTable
{
public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef InterfaceVTable CppObjectType;
typedef GDBusInterfaceVTable BaseObjectType;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
private:
public:
/** The type for a slot which handles a method call for a D-Bus interface.
* for example,
* @code
* void on_interface_method_call(const Glib::RefPtr<Gio::DBus::Connection>&
* connection, const Glib::ustring& sender, const Glib::ustring&
* object_path, const Glib::ustring& interface_name, const Glib::ustring&
* method_name, const Glib::VariantContainerBase& parameters, const
* Glib::RefPtr<Gio::DBus::MethodInvocation>& invocation);
* @endcode
*/
typedef sigc::slot<
void,
const Glib::RefPtr<Connection>&,
const Glib::ustring&,
const Glib::ustring&,
const Glib::ustring&,
const Glib::ustring&,
const Glib::VariantContainerBase&,
const Glib::RefPtr<MethodInvocation>&
> SlotInterfaceMethodCall;
/** The type for a slot which handles getting a property for a D-Bus
* interface.
* for example,
* @code
* void on_interface_get_property(Glib::VariantBase& property, const
* Glib::RefPtr<Gio::DBus::Connection>& connection, const Glib::ustring&
* sender, const Glib::ustring& object_path, const Glib::ustring&
* interface_name, const Glib::ustring& property_name);
* @endcode
* @throw Glib::Error.
*/
typedef sigc::slot<
void,
Glib::VariantBase&,
const Glib::RefPtr<Connection>&,
const Glib::ustring&,
const Glib::ustring&,
const Glib::ustring&,
const Glib::ustring&
> SlotInterfaceGetProperty;
/** The type for a slot which handles setting a property for a D-Bus
* interface.
* for example,
* @code
* bool on_interface_set_property(const Glib::RefPtr<Gio::DBus::Connection>&
* connection, const Glib::ustring& sender, const Glib::ustring&
* object_path, const Glib::ustring& interface_name, const Glib::ustring&
* property_name, const Glib::VariantBase& value);
* @endcode
* @throw Glib::Error.
*/
typedef sigc::slot<
bool,
const Glib::RefPtr<Connection>&,
const Glib::ustring&,
const Glib::ustring&,
const Glib::ustring&,
const Glib::ustring&,
const Glib::VariantBase&
> SlotInterfaceSetProperty;
/** Constructs a new InterfaceVTable using the specified slots.
* @param slot_method_call The slot for handling incoming method calls.
* @param slot_get_property The slot for getting a property.
* @param slot_set_property The slot for setting a property.
*/
explicit InterfaceVTable(
const SlotInterfaceMethodCall& slot_method_call,
const SlotInterfaceGetProperty& slot_get_property = SlotInterfaceGetProperty(),
const SlotInterfaceSetProperty& slot_set_property = SlotInterfaceSetProperty()
);
/// Destructor.
virtual ~InterfaceVTable();
/// Provides access to the underlying C object.
GDBusInterfaceVTable* gobj()
{ return reinterpret_cast<GDBusInterfaceVTable*>(&gobject_); }
/// Provides access to the underlying C object.
const GDBusInterfaceVTable* gobj() const
{ return reinterpret_cast<const GDBusInterfaceVTable*>(&gobject_); }
private:
// Non-copyable.
InterfaceVTable(const InterfaceVTable& other);
InterfaceVTable& operator=(const InterfaceVTable& other);
public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// These are so the C callbacks and the
// Gio::DBus::Connection::register_object() method can have access to the
// copies of the slots used for creation when registering.
SlotInterfaceMethodCall* get_slot_method_call() const;
SlotInterfaceGetProperty* get_slot_get_property() const;
SlotInterfaceSetProperty* get_slot_set_property() const;
#endif
protected:
// The underlying C instance.
GDBusInterfaceVTable gobject_;
// Pointers to copies of the slots used to create an instance.
SlotInterfaceMethodCall* slot_method_call_;
SlotInterfaceGetProperty* slot_get_property_;
SlotInterfaceSetProperty* slot_set_property_;
};
} //namespace DBus
} // namespace Gio
#endif /* _GIOMM_DBUSINTERFACEVTABLE_H */
|