/usr/include/giomm-2.4/giomm/dbusconnection.h is in libglibmm-2.4-dev 2.56.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 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 | // Generated by gmmproc 2.54.1 -- DO NOT MODIFY!
#ifndef _GIOMM_DBUSCONNECTION_H
#define _GIOMM_DBUSCONNECTION_H
#include <glibmm/ustring.h>
#include <sigc++/sigc++.h>
/* 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, see <http://www.gnu.org/licenses/>.
*/
#include <glibmm/object.h>
#include <giomm/initable.h>
#include <giomm/asyncinitable.h>
#include <giomm/dbusauthobserver.h>
#include <giomm/dbusmethodinvocation.h>
#include <giomm/dbusintrospection.h>
#include <giomm/iostream.h>
#include <giomm/asyncresult.h>
#include <giomm/credentials.h>
#include <giomm/dbusmessage.h>
#include <giomm/dbussubtreevtable.h>
#include <gio/gio.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
using GDBusConnection = struct _GDBusConnection;
using GDBusConnectionClass = struct _GDBusConnectionClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Gio
{
namespace DBus
{ class Connection_Class; } // namespace DBus
} // namespace Gio
#endif //DOXYGEN_SHOULD_SKIP_THIS
namespace Gio
{
class ActionGroup;
class MenuModel;
class UnixFDList;
namespace DBus
{
/** @addtogroup giommEnums giomm Enums and Flags */
/**
* @var BusType BUS_TYPE_STARTER
* An alias for the message bus that activated the process, if any.
*
* @var BusType BUS_TYPE_NONE
* Not a message bus.
*
* @var BusType BUS_TYPE_SYSTEM
* The system-wide message bus.
*
* @var BusType BUS_TYPE_SESSION
* The login session message bus.
*
* @enum BusType
*
* An enumeration for well-known message buses.
*
* @newin{2,26}
*
* @ingroup giommEnums
*/
enum BusType
{
BUS_TYPE_STARTER = -1,
BUS_TYPE_NONE,
BUS_TYPE_SYSTEM,
BUS_TYPE_SESSION
};
} // namespace DBus
} // namespace Gio
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{
template <>
class Value<Gio::DBus::BusType> : public Glib::Value_Enum<Gio::DBus::BusType>
{
public:
static GType value_type() G_GNUC_CONST;
};
} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gio
{
namespace DBus
{
/**
* @var CallFlags CALL_FLAGS_NONE
* No flags set.
*
* @var CallFlags CALL_FLAGS_NO_AUTO_START
* The bus must not launch
* an owner for the destination name in response to this method
* invocation.
*
* @var CallFlags CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION
* The caller is prepared to
* wait for interactive authorization. @newin{2,46}
*
* @enum CallFlags
*
* Flags used in g_dbus_connection_call() and similar APIs.
*
* @newin{2,26}
*
* @ingroup giommEnums
* @par Bitwise operators:
* <tt>%CallFlags operator|(CallFlags, CallFlags)</tt><br>
* <tt>%CallFlags operator&(CallFlags, CallFlags)</tt><br>
* <tt>%CallFlags operator^(CallFlags, CallFlags)</tt><br>
* <tt>%CallFlags operator~(CallFlags)</tt><br>
* <tt>%CallFlags& operator|=(CallFlags&, CallFlags)</tt><br>
* <tt>%CallFlags& operator&=(CallFlags&, CallFlags)</tt><br>
* <tt>%CallFlags& operator^=(CallFlags&, CallFlags)</tt><br>
*/
enum CallFlags
{
CALL_FLAGS_NONE = 0x0,
CALL_FLAGS_NO_AUTO_START = (1<<0),
CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION = (1<<1)
};
/** @ingroup giommEnums */
inline CallFlags operator|(CallFlags lhs, CallFlags rhs)
{ return static_cast<CallFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline CallFlags operator&(CallFlags lhs, CallFlags rhs)
{ return static_cast<CallFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline CallFlags operator^(CallFlags lhs, CallFlags rhs)
{ return static_cast<CallFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline CallFlags operator~(CallFlags flags)
{ return static_cast<CallFlags>(~static_cast<unsigned>(flags)); }
/** @ingroup giommEnums */
inline CallFlags& operator|=(CallFlags& lhs, CallFlags rhs)
{ return (lhs = static_cast<CallFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
/** @ingroup giommEnums */
inline CallFlags& operator&=(CallFlags& lhs, CallFlags rhs)
{ return (lhs = static_cast<CallFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
/** @ingroup giommEnums */
inline CallFlags& operator^=(CallFlags& lhs, CallFlags rhs)
{ return (lhs = static_cast<CallFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
/**
* @var ConnectionFlags CONNECTION_FLAGS_NONE
* No flags set.
*
* @var ConnectionFlags CONNECTION_FLAGS_AUTHENTICATION_CLIENT
* Perform authentication against server.
*
* @var ConnectionFlags CONNECTION_FLAGS_AUTHENTICATION_SERVER
* Perform authentication against client.
*
* @var ConnectionFlags CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS
* When
* authenticating as a server, allow the anonymous authentication
* method.
*
* @var ConnectionFlags CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION
* Pass this flag if connecting to a peer that is a
* message bus. This means that the Hello() method will be invoked as part of the connection setup.
*
* @var ConnectionFlags CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING
* If set, processing of D-Bus messages is
* delayed until g_dbus_connection_start_message_processing() is called.
*
* @enum ConnectionFlags
*
* Flags used when creating a new DBusConnection.
*
* @newin{2,26}
*
* @ingroup giommEnums
* @par Bitwise operators:
* <tt>%ConnectionFlags operator|(ConnectionFlags, ConnectionFlags)</tt><br>
* <tt>%ConnectionFlags operator&(ConnectionFlags, ConnectionFlags)</tt><br>
* <tt>%ConnectionFlags operator^(ConnectionFlags, ConnectionFlags)</tt><br>
* <tt>%ConnectionFlags operator~(ConnectionFlags)</tt><br>
* <tt>%ConnectionFlags& operator|=(ConnectionFlags&, ConnectionFlags)</tt><br>
* <tt>%ConnectionFlags& operator&=(ConnectionFlags&, ConnectionFlags)</tt><br>
* <tt>%ConnectionFlags& operator^=(ConnectionFlags&, ConnectionFlags)</tt><br>
*/
enum ConnectionFlags
{
CONNECTION_FLAGS_NONE = 0x0,
CONNECTION_FLAGS_AUTHENTICATION_CLIENT = (1<<0),
CONNECTION_FLAGS_AUTHENTICATION_SERVER = (1<<1),
CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS = (1<<2),
CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION = (1<<3),
CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING = (1<<4)
};
/** @ingroup giommEnums */
inline ConnectionFlags operator|(ConnectionFlags lhs, ConnectionFlags rhs)
{ return static_cast<ConnectionFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline ConnectionFlags operator&(ConnectionFlags lhs, ConnectionFlags rhs)
{ return static_cast<ConnectionFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline ConnectionFlags operator^(ConnectionFlags lhs, ConnectionFlags rhs)
{ return static_cast<ConnectionFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline ConnectionFlags operator~(ConnectionFlags flags)
{ return static_cast<ConnectionFlags>(~static_cast<unsigned>(flags)); }
/** @ingroup giommEnums */
inline ConnectionFlags& operator|=(ConnectionFlags& lhs, ConnectionFlags rhs)
{ return (lhs = static_cast<ConnectionFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
/** @ingroup giommEnums */
inline ConnectionFlags& operator&=(ConnectionFlags& lhs, ConnectionFlags rhs)
{ return (lhs = static_cast<ConnectionFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
/** @ingroup giommEnums */
inline ConnectionFlags& operator^=(ConnectionFlags& lhs, ConnectionFlags rhs)
{ return (lhs = static_cast<ConnectionFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
/**
* @var SendMessageFlags SEND_MESSAGE_FLAGS_NONE
* No flags set.
*
* @var SendMessageFlags SEND_MESSAGE_FLAGS_PRESERVE_SERIAL
* Do not automatically
* assign a serial number from the DBusConnection object when
* sending a message.
*
* @enum SendMessageFlags
*
* Flags used when sending DBusMessages on a DBusConnection.
*
* @newin{2,26}
*
* @ingroup giommEnums
* @par Bitwise operators:
* <tt>%SendMessageFlags operator|(SendMessageFlags, SendMessageFlags)</tt><br>
* <tt>%SendMessageFlags operator&(SendMessageFlags, SendMessageFlags)</tt><br>
* <tt>%SendMessageFlags operator^(SendMessageFlags, SendMessageFlags)</tt><br>
* <tt>%SendMessageFlags operator~(SendMessageFlags)</tt><br>
* <tt>%SendMessageFlags& operator|=(SendMessageFlags&, SendMessageFlags)</tt><br>
* <tt>%SendMessageFlags& operator&=(SendMessageFlags&, SendMessageFlags)</tt><br>
* <tt>%SendMessageFlags& operator^=(SendMessageFlags&, SendMessageFlags)</tt><br>
*/
enum SendMessageFlags
{
SEND_MESSAGE_FLAGS_NONE = 0x0,
SEND_MESSAGE_FLAGS_PRESERVE_SERIAL = (1<<0)
};
/** @ingroup giommEnums */
inline SendMessageFlags operator|(SendMessageFlags lhs, SendMessageFlags rhs)
{ return static_cast<SendMessageFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline SendMessageFlags operator&(SendMessageFlags lhs, SendMessageFlags rhs)
{ return static_cast<SendMessageFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline SendMessageFlags operator^(SendMessageFlags lhs, SendMessageFlags rhs)
{ return static_cast<SendMessageFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline SendMessageFlags operator~(SendMessageFlags flags)
{ return static_cast<SendMessageFlags>(~static_cast<unsigned>(flags)); }
/** @ingroup giommEnums */
inline SendMessageFlags& operator|=(SendMessageFlags& lhs, SendMessageFlags rhs)
{ return (lhs = static_cast<SendMessageFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
/** @ingroup giommEnums */
inline SendMessageFlags& operator&=(SendMessageFlags& lhs, SendMessageFlags rhs)
{ return (lhs = static_cast<SendMessageFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
/** @ingroup giommEnums */
inline SendMessageFlags& operator^=(SendMessageFlags& lhs, SendMessageFlags rhs)
{ return (lhs = static_cast<SendMessageFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
/**
* @var SignalFlags SIGNAL_FLAGS_NONE
* No flags set.
*
* @var SignalFlags SIGNAL_FLAGS_NO_MATCH_RULE
* Don't actually send the AddMatch
* D-Bus call for this signal subscription. This gives you more control
* over which match rules you add (but you must add them manually).
*
* @var SignalFlags SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE
* Match first arguments that
* contain a bus or interface name with the given namespace.
*
* @var SignalFlags SIGNAL_FLAGS_MATCH_ARG0_PATH
* Match first arguments that
* contain an object path that is either equivalent to the given path,
* or one of the paths is a subpath of the other.
*
* @enum SignalFlags
*
* Flags used when subscribing to signals via g_dbus_connection_signal_subscribe().
*
* @newin{2,26}
*
* @ingroup giommEnums
* @par Bitwise operators:
* <tt>%SignalFlags operator|(SignalFlags, SignalFlags)</tt><br>
* <tt>%SignalFlags operator&(SignalFlags, SignalFlags)</tt><br>
* <tt>%SignalFlags operator^(SignalFlags, SignalFlags)</tt><br>
* <tt>%SignalFlags operator~(SignalFlags)</tt><br>
* <tt>%SignalFlags& operator|=(SignalFlags&, SignalFlags)</tt><br>
* <tt>%SignalFlags& operator&=(SignalFlags&, SignalFlags)</tt><br>
* <tt>%SignalFlags& operator^=(SignalFlags&, SignalFlags)</tt><br>
*/
enum SignalFlags
{
SIGNAL_FLAGS_NONE = 0x0,
SIGNAL_FLAGS_NO_MATCH_RULE = (1<<0),
SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE = (1<<1),
SIGNAL_FLAGS_MATCH_ARG0_PATH = (1<<2)
};
/** @ingroup giommEnums */
inline SignalFlags operator|(SignalFlags lhs, SignalFlags rhs)
{ return static_cast<SignalFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline SignalFlags operator&(SignalFlags lhs, SignalFlags rhs)
{ return static_cast<SignalFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline SignalFlags operator^(SignalFlags lhs, SignalFlags rhs)
{ return static_cast<SignalFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline SignalFlags operator~(SignalFlags flags)
{ return static_cast<SignalFlags>(~static_cast<unsigned>(flags)); }
/** @ingroup giommEnums */
inline SignalFlags& operator|=(SignalFlags& lhs, SignalFlags rhs)
{ return (lhs = static_cast<SignalFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
/** @ingroup giommEnums */
inline SignalFlags& operator&=(SignalFlags& lhs, SignalFlags rhs)
{ return (lhs = static_cast<SignalFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
/** @ingroup giommEnums */
inline SignalFlags& operator^=(SignalFlags& lhs, SignalFlags rhs)
{ return (lhs = static_cast<SignalFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
/**
* @var SubtreeFlags SUBTREE_FLAGS_NONE
* No flags set.
*
* @var SubtreeFlags SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES
* Method calls to objects not in the enumerated range
* will still be dispatched. This is useful if you want
* to dynamically spawn objects in the subtree.
*
* @enum SubtreeFlags
*
* Flags passed to g_dbus_connection_register_subtree().
*
* @newin{2,26}
*
* @ingroup giommEnums
* @par Bitwise operators:
* <tt>%SubtreeFlags operator|(SubtreeFlags, SubtreeFlags)</tt><br>
* <tt>%SubtreeFlags operator&(SubtreeFlags, SubtreeFlags)</tt><br>
* <tt>%SubtreeFlags operator^(SubtreeFlags, SubtreeFlags)</tt><br>
* <tt>%SubtreeFlags operator~(SubtreeFlags)</tt><br>
* <tt>%SubtreeFlags& operator|=(SubtreeFlags&, SubtreeFlags)</tt><br>
* <tt>%SubtreeFlags& operator&=(SubtreeFlags&, SubtreeFlags)</tt><br>
* <tt>%SubtreeFlags& operator^=(SubtreeFlags&, SubtreeFlags)</tt><br>
*/
enum SubtreeFlags
{
SUBTREE_FLAGS_NONE = 0x0,
SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES = (1<<0)
};
/** @ingroup giommEnums */
inline SubtreeFlags operator|(SubtreeFlags lhs, SubtreeFlags rhs)
{ return static_cast<SubtreeFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline SubtreeFlags operator&(SubtreeFlags lhs, SubtreeFlags rhs)
{ return static_cast<SubtreeFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline SubtreeFlags operator^(SubtreeFlags lhs, SubtreeFlags rhs)
{ return static_cast<SubtreeFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
/** @ingroup giommEnums */
inline SubtreeFlags operator~(SubtreeFlags flags)
{ return static_cast<SubtreeFlags>(~static_cast<unsigned>(flags)); }
/** @ingroup giommEnums */
inline SubtreeFlags& operator|=(SubtreeFlags& lhs, SubtreeFlags rhs)
{ return (lhs = static_cast<SubtreeFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
/** @ingroup giommEnums */
inline SubtreeFlags& operator&=(SubtreeFlags& lhs, SubtreeFlags rhs)
{ return (lhs = static_cast<SubtreeFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
/** @ingroup giommEnums */
inline SubtreeFlags& operator^=(SubtreeFlags& lhs, SubtreeFlags rhs)
{ return (lhs = static_cast<SubtreeFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
/** @defgroup DBus D-Bus API
*
* API to use D-Bus services as a client or to implement a D-Bus service.
* To write client code, see Gio::DBus::Proxy.
* To export objects on the bus for other clients, see Gio::DBus::own_name(), for instance.
*/
//TODO: Add example from C API in class docs.
/** A D-Bus Connection.
* The Connection type is used for D-Bus connections to remote peers such
* as a message buses. It is a low-level API that offers a lot of flexibility.
* For instance, it lets you establish a connection over any transport that
* can by represented as an IOStream.
*
* This class is rarely used directly in D-Bus clients. If you are writing a
* D-Bus client, it is often easier to use the Gio::DBus::own_name(),
* Gio::DBus::watch_name() or Gio::DBus::Proxy::create_for_bus() APIs.
*
* @newin{2,28}
* @ingroup DBus
*/
class Connection
: public Glib::Object, public Initable, public AsyncInitable
{
protected:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
public:
using CppObjectType = Connection;
using CppClassType = Connection_Class;
using BaseObjectType = GDBusConnection;
using BaseClassType = GDBusConnectionClass;
// noncopyable
Connection(const Connection&) = delete;
Connection& operator=(const Connection&) = delete;
private: friend class Connection_Class;
static CppClassType connection_class_;
protected:
explicit Connection(const Glib::ConstructParams& construct_params);
explicit Connection(GDBusConnection* castitem);
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
public:
Connection(Connection&& src) noexcept;
Connection& operator=(Connection&& src) noexcept;
~Connection() noexcept override;
/** Get the GType for this class, for use with the underlying GObject type system.
*/
static GType get_type() G_GNUC_CONST;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
static GType get_base_type() G_GNUC_CONST;
#endif
///Provides access to the underlying C GObject.
GDBusConnection* gobj() { return reinterpret_cast<GDBusConnection*>(gobject_); }
///Provides access to the underlying C GObject.
const GDBusConnection* gobj() const { return reinterpret_cast<GDBusConnection*>(gobject_); }
///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
GDBusConnection* gobj_copy();
private:
protected:
Connection(const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags);
Connection(const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags);
Connection(const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer,
const SlotAsyncReady& slot,
ConnectionFlags flags);
Connection(const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const SlotAsyncReady& slot,
ConnectionFlags flags);
Connection(const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer,
const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags);
Connection(const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags);
Connection(const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer,
ConnectionFlags flags);
Connection(const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
ConnectionFlags flags);
Connection(const std::string& address,
const Glib::RefPtr<AuthObserver>& observer,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags);
Connection(const std::string& address,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags);
Connection(const std::string& address,
const Glib::RefPtr<AuthObserver>& observer,
const SlotAsyncReady& slot,
ConnectionFlags flags);
Connection(const std::string& address,
const SlotAsyncReady& slot,
ConnectionFlags flags);
Connection(const std::string& address,
const Glib::RefPtr<AuthObserver>& observer,
const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags);
Connection(const std::string& address,
const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags);
Connection(const std::string& address,
const Glib::RefPtr<AuthObserver>& observer,
ConnectionFlags flags);
Connection(const std::string& address,
ConnectionFlags flags);
public:
/** Signature for slot used in signal_subscribe().
* For example,
* @code
* void on_signal(const Glib::RefPtr<Connection>& connection, const
* Glib::ustring& sender_name, const Glib::ustring& object_path, const
* Glib::ustring& object_path, const Glib::ustring& interface_name, const
* Glib::ustring& signal_name, const Glib::VariantContainerBase& parameters);.
* @endcode
*/
using SlotSignal = sigc::slot<void, const Glib::RefPtr<Connection>&,
const Glib::ustring&, const Glib::ustring&, const Glib::ustring&,
const Glib::ustring&, const Glib::VariantContainerBase&>;
/** Signature for slot used in add_filter().
* For example,
* @code
* Glib::RefPtr<Message> on_message_filter(const
* Glib::RefPtr<Connection> connection, const Glib::RefPtr<Message>&
* message, bool incoming);.
* @endcode
*
* A filter function is passed a Message and expected to return a
* Message too. Passive filter functions that don't modify the message
* can simply return the message object. Filter functions that wants to
* drop a message can simply return <tt>0</tt>. And filter function may
* modify a message by copying it and return the copy.
*/
using SlotMessageFilter = sigc::slot<Glib::RefPtr<Message>,
const Glib::RefPtr<Connection>&,
const Glib::RefPtr<Message>&, bool>;
/** Asynchronously connects to the message bus specified by @a bus_type.
*
* When the operation is finished, @a slot will be invoked. You can then
* call get_finish() to get the result of the operation.
*
* This is a asynchronous failable function. See get_sync() for the
* synchronous version.
*
* @param bus_type A BusType.
* @param slot A SlotAsyncReady to call when the request is satisfied.
* @param cancellable A Cancellable.
*
* @newin{2,28}
*/
static void get(BusType bus_type, const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable);
/** Non-cancellable version of get().
*/
static void get(BusType bus_type, const SlotAsyncReady& slot);
/** Finishes an operation started with g_bus_get().
*
* The returned object is a singleton, that is, shared with other
* callers of g_bus_get() and g_bus_get_sync() for @a bus_type. In the
* event that you need a private message bus connection, use
* g_dbus_address_get_for_bus_sync() and
* g_dbus_connection_new_for_address().
*
* Note that the returned DBusConnection object will (usually) have
* the DBusConnection::property_exit_on_close() property set to <tt>true</tt>.
*
* @newin{2,26}
*
* @param res A AsyncResult obtained from the SlotAsyncReady passed
* to g_bus_get().
* @return A DBusConnection or <tt>nullptr</tt> if @a error is set.
* Free with Glib::object_unref().
*
* @throws Glib::Error
*/
/** @throw Glib::Error.
*/
static Glib::RefPtr<Connection> get_finish(const Glib::RefPtr<AsyncResult>& res);
/** Synchronously connects to the message bus specified by @a bus_type.
* Note that the returned object may shared with other callers,
* e.g. if two separate parts of a process calls this function with
* the same @a bus_type, they will share the same object.
*
* This is a synchronous failable function. See g_bus_get() and
* g_bus_get_finish() for the asynchronous version.
*
* The returned object is a singleton, that is, shared with other
* callers of g_bus_get() and g_bus_get_sync() for @a bus_type. In the
* event that you need a private message bus connection, use
* g_dbus_address_get_for_bus_sync() and
* g_dbus_connection_new_for_address().
*
* Note that the returned DBusConnection object will (usually) have
* the DBusConnection::property_exit_on_close() property set to <tt>true</tt>.
*
* @newin{2,26}
*
* @param bus_type A BusType.
* @param cancellable A Cancellable or <tt>nullptr</tt>.
* @return A DBusConnection or <tt>nullptr</tt> if @a error is set.
* Free with Glib::object_unref().
*
* @throws Glib::Error
*/
static Glib::RefPtr<Connection> get_sync(BusType bus_type, const Glib::RefPtr<Cancellable>& cancellable);
/// A get_sync() convenience overload.
static Glib::RefPtr<Connection> get_sync(BusType bus_type);
/** Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
* with the end represented by @a stream.
*
* If @a stream is a SocketConnection, then the corresponding Socket
* will be put into non-blocking mode.
*
* The D-Bus connection will interact with @a stream from a worker thread.
* As a result, the caller should not interact with @a stream after this
* method has been called, except by calling Glib::object_unref() on it.
*
* If @a observer is not <tt>nullptr</tt> it may be used to control the
* authentication process.
*
* When the operation is finished, @a slot will be invoked. You can
* then call g_dbus_connection_new_finish() to get the result of the
* operation.
*
* This is a asynchronous failable constructor. See
* g_dbus_connection_new_sync() for the synchronous
* version.
*
* @newin{2,26}
*
* @param stream A IOStream.
* @param guid The GUID to use if a authenticating as a server or <tt>nullptr</tt>.
* @param flags Flags describing how to make the connection.
* @param observer A DBusAuthObserver or <tt>nullptr</tt>.
* @param cancellable A Cancellable or <tt>nullptr</tt>.
* @param slot A SlotAsyncReady to call when the request is satisfied.
* @param user_data The data to pass to @a slot.
*/
static void create(const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
/** Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
* with the end represented by @a stream.
*
* If @a stream is a SocketConnection, then the corresponding Socket
* will be put into non-blocking mode.
*
* The D-Bus connection will interact with @a stream from a worker thread.
* As a result, the caller should not interact with @a stream after this
* method has been called, except by calling Glib::object_unref() on it.
*
* If @a observer is not <tt>nullptr</tt> it may be used to control the
* authentication process.
*
* When the operation is finished, @a slot will be invoked. You can
* then call g_dbus_connection_new_finish() to get the result of the
* operation.
*
* This is a asynchronous failable constructor. See
* g_dbus_connection_new_sync() for the synchronous
* version.
*
* @newin{2,26}
*
* @param stream A IOStream.
* @param guid The GUID to use if a authenticating as a server or <tt>nullptr</tt>.
* @param flags Flags describing how to make the connection.
* @param observer A DBusAuthObserver or <tt>nullptr</tt>.
* @param cancellable A Cancellable or <tt>nullptr</tt>.
* @param slot A SlotAsyncReady to call when the request is satisfied.
* @param user_data The data to pass to @a slot.
*/
static void create(const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
/// Non-cancellable version of create().
static void create(const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer,
const SlotAsyncReady& slot,
ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
/// Non-cancellable version of create().
static void create(const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const SlotAsyncReady& slot,
ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
/** Finishes an operation started with g_dbus_connection_new().
*
* @newin{2,26}
*
* @param res A AsyncResult obtained from the SlotAsyncReady
* passed to g_dbus_connection_new().
* @return A DBusConnection or <tt>nullptr</tt> if @a error is set. Free
* with Glib::object_unref().
*/
/** @throw Glib::Error.
*/
static Glib::RefPtr<Connection> create_finish(const Glib::RefPtr<AsyncResult>& res);
/** Asynchronously connects and sets up a D-Bus client connection for
* exchanging D-Bus messages with an endpoint specified by @a address
* which must be in the
* [D-Bus address format](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses).
*
* This constructor can only be used to initiate client-side
* connections - use g_dbus_connection_new() if you need to act as the
* server. In particular, @a flags cannot contain the
* DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
* DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
*
* When the operation is finished, @a slot will be invoked. You can
* then call g_dbus_connection_new_finish() to get the result of the
* operation.
*
* If @a observer is not <tt>nullptr</tt> it may be used to control the
* authentication process.
*
* This is a asynchronous failable constructor. See
* g_dbus_connection_new_for_address_sync() for the synchronous
* version.
*
* @newin{2,26}
*
* @param address A D-Bus address.
* @param flags Flags describing how to make the connection.
* @param observer A DBusAuthObserver or <tt>nullptr</tt>.
* @param cancellable A Cancellable or <tt>nullptr</tt>.
* @param slot A SlotAsyncReady to call when the request is satisfied.
* @param user_data The data to pass to @a slot.
*/
static void create_for_address(const std::string& address,
const Glib::RefPtr<AuthObserver>& observer,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
/** Asynchronously connects and sets up a D-Bus client connection for
* exchanging D-Bus messages with an endpoint specified by @a address
* which must be in the
* [D-Bus address format](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses).
*
* This constructor can only be used to initiate client-side
* connections - use g_dbus_connection_new() if you need to act as the
* server. In particular, @a flags cannot contain the
* DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
* DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
*
* When the operation is finished, @a slot will be invoked. You can
* then call g_dbus_connection_new_finish() to get the result of the
* operation.
*
* If @a observer is not <tt>nullptr</tt> it may be used to control the
* authentication process.
*
* This is a asynchronous failable constructor. See
* g_dbus_connection_new_for_address_sync() for the synchronous
* version.
*
* @newin{2,26}
*
* @param address A D-Bus address.
* @param flags Flags describing how to make the connection.
* @param observer A DBusAuthObserver or <tt>nullptr</tt>.
* @param cancellable A Cancellable or <tt>nullptr</tt>.
* @param slot A SlotAsyncReady to call when the request is satisfied.
* @param user_data The data to pass to @a slot.
*/
static void create_for_address(const std::string& address,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
/// Non-cancellable version of create_for_address().
static void create_for_address(const std::string& address,
const Glib::RefPtr<AuthObserver>& observer,
const SlotAsyncReady& slot,
ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
/// Non-cancellable version of create_for_address().
static void create_for_address(const std::string& address,
const SlotAsyncReady& slot,
ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
/** Finishes an operation started with g_dbus_connection_new_for_address().
*
* @newin{2,26}
*
* @param res A AsyncResult obtained from the SlotAsyncReady passed
* to g_dbus_connection_new().
* @return A DBusConnection or <tt>nullptr</tt> if @a error is set. Free with
* Glib::object_unref().
*/
/** @throw Glib::Error.
*/
static Glib::RefPtr<Connection> create_for_address_finish(const Glib::RefPtr<AsyncResult>& res);
/** Synchronously sets up a D-Bus connection for exchanging D-Bus messages
* with the end represented by @a stream.
*
* If @a stream is a SocketConnection, then the corresponding Socket
* will be put into non-blocking mode.
*
* The D-Bus connection will interact with @a stream from a worker thread.
* As a result, the caller should not interact with @a stream after this
* method has been called, except by calling Glib::object_unref() on it.
*
* If @a observer is not <tt>nullptr</tt> it may be used to control the
* authentication process.
*
* This is a synchronous failable constructor. See
* g_dbus_connection_new() for the asynchronous version.
*
* @newin{2,26}
*
* @param stream A IOStream.
* @param guid The GUID to use if a authenticating as a server or <tt>nullptr</tt>.
* @param flags Flags describing how to make the connection.
* @param observer A DBusAuthObserver or <tt>nullptr</tt>.
* @param cancellable A Cancellable or <tt>nullptr</tt>.
* @return A DBusConnection or <tt>nullptr</tt> if @a error is set. Free with Glib::object_unref().
*/
/// @throw Glib::Error.
static Glib::RefPtr<Connection> create_sync(
const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer,
const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
/** Synchronously sets up a D-Bus connection for exchanging D-Bus messages
* with the end represented by @a stream.
*
* If @a stream is a SocketConnection, then the corresponding Socket
* will be put into non-blocking mode.
*
* The D-Bus connection will interact with @a stream from a worker thread.
* As a result, the caller should not interact with @a stream after this
* method has been called, except by calling Glib::object_unref() on it.
*
* If @a observer is not <tt>nullptr</tt> it may be used to control the
* authentication process.
*
* This is a synchronous failable constructor. See
* g_dbus_connection_new() for the asynchronous version.
*
* @newin{2,26}
*
* @param stream A IOStream.
* @param guid The GUID to use if a authenticating as a server or <tt>nullptr</tt>.
* @param flags Flags describing how to make the connection.
* @param observer A DBusAuthObserver or <tt>nullptr</tt>.
* @param cancellable A Cancellable or <tt>nullptr</tt>.
* @return A DBusConnection or <tt>nullptr</tt> if @a error is set. Free with Glib::object_unref().
*/
/// @throw Glib::Error.
static Glib::RefPtr<Connection> create_sync(
const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
/// Non-cancellable version of create_sync().
static Glib::RefPtr<Connection> create_sync(
const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer,
ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
/// Non-cancellable version of create_sync().
static Glib::RefPtr<Connection> create_sync(
const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
/** Synchronously connects and sets up a D-Bus client connection for
* exchanging D-Bus messages with an endpoint specified by @a address
* which must be in the
* [D-Bus address format](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses).
*
* This constructor can only be used to initiate client-side
* connections - use g_dbus_connection_new_sync() if you need to act
* as the server. In particular, @a flags cannot contain the
* DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
* DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
*
* This is a synchronous failable constructor. See
* g_dbus_connection_new_for_address() for the asynchronous version.
*
* If @a observer is not <tt>nullptr</tt> it may be used to control the
* authentication process.
*
* @newin{2,26}
*
* @param address A D-Bus address.
* @param flags Flags describing how to make the connection.
* @param observer A DBusAuthObserver or <tt>nullptr</tt>.
* @param cancellable A Cancellable or <tt>nullptr</tt>.
* @return A DBusConnection or <tt>nullptr</tt> if @a error is set. Free with
* Glib::object_unref().
*/
/// @throw Glib::Error.
static Glib::RefPtr<Connection> create_for_address_sync(
const std::string& address,
const Glib::RefPtr<AuthObserver>& observer,
const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
/** Synchronously connects and sets up a D-Bus client connection for
* exchanging D-Bus messages with an endpoint specified by @a address
* which must be in the
* [D-Bus address format](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses).
*
* This constructor can only be used to initiate client-side
* connections - use g_dbus_connection_new_sync() if you need to act
* as the server. In particular, @a flags cannot contain the
* DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
* DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
*
* This is a synchronous failable constructor. See
* g_dbus_connection_new_for_address() for the asynchronous version.
*
* If @a observer is not <tt>nullptr</tt> it may be used to control the
* authentication process.
*
* @newin{2,26}
*
* @param address A D-Bus address.
* @param flags Flags describing how to make the connection.
* @param observer A DBusAuthObserver or <tt>nullptr</tt>.
* @param cancellable A Cancellable or <tt>nullptr</tt>.
* @return A DBusConnection or <tt>nullptr</tt> if @a error is set. Free with
* Glib::object_unref().
*/
/// @throw Glib::Error.
static Glib::RefPtr<Connection> create_for_address_sync(
const std::string& address,
const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
/// Non-cancellable version of create_for_address_sync().
static Glib::RefPtr<Connection> create_for_address_sync(
const std::string& address,
const Glib::RefPtr<AuthObserver>& observer,
ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
/// Non-cancellable version of create_for_address_sync().
static Glib::RefPtr<Connection> create_for_address_sync(
const std::string& address,
ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
/** Closes the connection. Note that this never causes the process to exit
* (this might only happen if the other end of a shared message bus
* connection disconnects, see property_exit_on_close()).
*
* Once the connection is closed, operations such as sending a message will
* return with the error Gio::IO_ERROR_CLOSED. Closing a connection will not
* automatically flush the connection so queued messages may be lost. Use
* flush() if you need such guarantees.
*
* If the connection is already closed, this method fails with
* Gio::IO_ERROR_CLOSED.
*
* When the connection has been closed, the "closed" signal is emitted in
* the thread-default main loop of the thread that connection was
* constructed in.
*
* This is an asynchronous method. See close_sync() for the synchronous
* version.
*
* @newin{2,28}
*/
void close();
/** Closes the connection. Note that this never causes the process to exit
* (this might only happen if the other end of a shared message bus
* connection disconnects, see property_exit_on_close()).
*
* Once the connection is closed, operations such as sending a message will
* return with the error Gio::IO_ERROR_CLOSED. Closing a connection will not
* automatically flush the connection so queued messages may be lost. Use
* flush() if you need such guarantees.
*
* If the connection is already closed, this method fails with
* Gio::IO_ERROR_CLOSED.
*
* When the connection has been closed, the "closed" signal is emitted in
* the thread-default main loop of the thread that connection was
* constructed in.
*
* This is an asynchronous method. When the operation is finished, @a slot
* will be invoked in the thread-default main loop of the thread you are
* calling this method from. You can then call close_finish() to get the
* result of the operation. See close_sync() for the synchronous version.
*
* @param slot A SlotAsyncReady to call when the request is satisfied.
* @param cancellable A Cancellable.
*
* @newin{2,28}
*/
void close(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable);
/** Closes the connection. Note that this never causes the process to exit
* (this might only happen if the other end of a shared message bus
* connection disconnects, see property_exit_on_close()).
*
* Once the connection is closed, operations such as sending a message will
* return with the error Gio::IO_ERROR_CLOSED. Closing a connection will not
* automatically flush the connection so queued messages may be lost. Use
* flush() if you need such guarantees.
*
* If the connection is already closed, this method fails with
* Gio::IO_ERROR_CLOSED.
*
* When the connection has been closed, the "closed" signal is emitted in
* the thread-default main loop of the thread that connection was
* constructed in.
*
* This is an asynchronous method. When the operation is finished, @a slot
* will be invoked in the thread-default main loop of the thread you are
* calling this method from. You can then call close_finish() to get the
* result of the operation. See close_sync() for the synchronous version.
*
* @param slot A SlotAsyncReady to call when the request is satisfied.
*
* @newin{2,28}
*/
void close(const SlotAsyncReady& slot);
/** Finishes an operation started with g_dbus_connection_close().
*
* @newin{2,26}
*
* @param res A AsyncResult obtained from the SlotAsyncReady passed
* to g_dbus_connection_close().
* @return <tt>true</tt> if the operation succeeded, <tt>false</tt> if @a error is set.
*
* @throws Glib::Error
*/
bool close_finish(const Glib::RefPtr<AsyncResult>& res);
/** Synchronously closees @a connection. The calling thread is blocked
* until this is done. See g_dbus_connection_close() for the
* asynchronous version of this method and more details about what it
* does.
*
* @newin{2,26}
*
* @param cancellable A Cancellable or <tt>nullptr</tt>.
*
* @throws Glib::Error
*/
void close_sync(const Glib::RefPtr<Cancellable>& cancellable);
/// A close_sync() convenience overload.
void close_sync();
/** Asynchronously flushes the connection, that is, writes all queued
* outgoing message to the transport and then flushes the transport (using
* Gio::OutputStream::flush_async()). This is useful in programs that wants
* to emit a D-Bus signal and then exit immediately. Without flushing the
* connection, there is no guarantee that the message has been sent to the
* networking buffers in the OS kernel.
*
* This is an asynchronous method. See flush_sync() for the synchronous
* version.
*
* @newin{2,28}
*/
void flush();
/** Asynchronously flushes the connection, that is, writes all queued
* outgoing message to the transport and then flushes the transport (using
* Gio::OutputStream::flush_async()). This is useful in programs that wants
* to emit a D-Bus signal and then exit immediately. Without flushing the
* connection, there is no guarantee that the message has been sent to the
* networking buffers in the OS kernel.
*
* This is an asynchronous method. When the operation is finished, @a slot
* will be invoked in the thread-default main loop of the thread you are
* calling this method from. You can then call flush_finish() to get the
* result of the operation. See flush_sync() for the synchronous version.
*
* @param slot A SlotAsyncReady to call when the request is satisfied.
* @param cancellable A Cancellable.
*
* @newin{2,28}
*/
void flush(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable);
/** Asynchronously flushes the connection, that is, writes all queued
* outgoing message to the transport and then flushes the transport (using
* Gio::OutputStream::flush_async()). This is useful in programs that wants
* to emit a D-Bus signal and then exit immediately. Without flushing the
* connection, there is no guarantee that the message has been sent to the
* networking buffers in the OS kernel.
*
* This is an asynchronous method. When the operation is finished, @a slot
* will be invoked in the thread-default main loop of the thread you are
* calling this method from. You can then call flush_finish() to get the
* result of the operation. See flush_sync() for the synchronous version.
*
* @param slot A SlotAsyncReady to call when the request is satisfied.
*
* @newin{2,28}
*/
void flush(const SlotAsyncReady& slot);
/** Finishes an operation started with g_dbus_connection_flush().
*
* @newin{2,26}
*
* @param res A AsyncResult obtained from the SlotAsyncReady passed
* to g_dbus_connection_flush().
* @return <tt>true</tt> if the operation succeeded, <tt>false</tt> if @a error is set.
*
* @throws Glib::Error
*/
bool flush_finish(const Glib::RefPtr<AsyncResult>& res);
/** Synchronously flushes @a connection. The calling thread is blocked
* until this is done. See g_dbus_connection_flush() for the
* asynchronous version of this method and more details about what it
* does.
*
* @newin{2,26}
*
* @param cancellable A Cancellable or <tt>nullptr</tt>.
*
* @throws Glib::Error
*/
void flush_sync(const Glib::RefPtr<Cancellable>& cancellable);
/// A flush_sync() convenience overload.
void flush_sync();
/** Gets whether the process is terminated when @a connection is
* closed by the remote peer. See
* DBusConnection::property_exit_on_close() for more details.
*
* @newin{2,26}
*
* @return Whether the process is terminated when @a connection is
* closed by the remote peer.
*/
bool get_exit_on_close() const;
/** Sets whether the process should be terminated when @a connection is
* closed by the remote peer. See DBusConnection::property_exit_on_close() for
* more details.
*
* Note that this function should be used with care. Most modern UNIX
* desktops tie the notion of a user session the session bus, and expect
* all of a users applications to quit when their bus connection goes away.
* If you are setting @a exit_on_close to <tt>false</tt> for the shared session
* bus connection, you should make sure that your application exits
* when the user session ends.
*
* @newin{2,26}
*
* @param exit_on_close Whether the process should be terminated
* when @a connection is closed by the remote peer.
*/
void set_exit_on_close(bool exit_on_close = true);
//TODO: In the C API, out_serial is volatile, but gmmproc can't parse that.
/** Asynchronously sends @a message to the peer represented by @a connection.
*
* Unless @a flags contain the
* DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
* will be assigned by @a connection and set on @a message via
* g_dbus_message_set_serial(). If @a out_serial is not <tt>nullptr</tt>, then the
* serial number used will be written to this location prior to
* submitting the message to the underlying transport.
*
* If @a connection is closed then the operation will fail with
* IO_ERROR_CLOSED. If @a message is not well-formed,
* the operation fails with IO_ERROR_INVALID_ARGUMENT.
*
* See this [server][gdbus-server] and [client][gdbus-unix-fd-client]
* for an example of how to use this low-level API to send and receive
* UNIX file descriptors.
*
* Note that @a message must be unlocked, unless @a flags contain the
* DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
*
* @newin{2,26}
*
* @param message A DBusMessage.
* @param flags Flags affecting how the message is sent.
* @param out_serial Return location for serial number assigned
* to @a message when sending it or <tt>nullptr</tt>.
* @return <tt>true</tt> if the message was well-formed and queued for
* transmission, <tt>false</tt> if @a error is set.
*
* @throws Glib::Error
*/
bool send_message(const Glib::RefPtr<Message>& message, SendMessageFlags flags, guint32& out_serial);
/// A send_message() without an "out_serial" parameter.
bool send_message(const Glib::RefPtr<Message>& message,
SendMessageFlags flags = Gio::DBus::SEND_MESSAGE_FLAGS_NONE);
/** Asynchronously sends message to the peer represented by the connection.
*
* Unless flags contain the Gio::DBus::SEND_MESSAGE_FLAGS_PRESERVE_SERIAL
* flag, the serial number will be assigned by the connection and set on
* message via Gio::DBus::Message::set_serial().
*
* If the connection is closed then the operation will fail with
* Gio::IO_ERROR_CLOSED. If @a cancellable is canceled, the operation will
* fail with Gio::IO_ERROR_CANCELLED. If @a message is not well-formed, the
* operation fails with Gio::IO_ERROR_INVALID_ARGUMENT.
*
* This is an asynchronous method. When the operation is finished, @a slot
* will be invoked in the thread-default main loop of the thread you are
* calling this method from. You can then call
* send_message_with_reply_finish() to get the result of the operation. See
* send_message_with_reply_sync() for the synchronous version.
*
* Note that message must be unlocked, unless flags contain the
* Gio::DBus::SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
*
* See the C API docs for examples.
*
* @param message A Message.
* @param timeout_msec The timeout in milliseconds or -1 to use the default
* timeout.
* @param slot A SlotAsyncReady to call when the request is satisfied.
* @param cancellable A Cancellable.
*
* @newin{2,28}
*/
void send_message_with_reply(const Glib::RefPtr<Message>& message,
int timeout_msec,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable);
/** Non-cancellable version of send_message_with_reply().
*/
void send_message_with_reply(const Glib::RefPtr<Message>& message,
int timeout_msec,
const SlotAsyncReady& slot);
/** Finishes an operation started with g_dbus_connection_send_message_with_reply().
*
* Note that @a error is only set if a local in-process error
* occurred. That is to say that the returned DBusMessage object may
* be of type DBUS_MESSAGE_TYPE_ERROR. Use
* g_dbus_message_to_gerror() to transcode this to a Error.
*
* See this [server][gdbus-server] and [client][gdbus-unix-fd-client]
* for an example of how to use this low-level API to send and receive
* UNIX file descriptors.
*
* @newin{2,26}
*
* @param res A AsyncResult obtained from the SlotAsyncReady passed to
* g_dbus_connection_send_message_with_reply().
* @return A locked DBusMessage or <tt>nullptr</tt> if @a error is set.
*/
/** @throw Glib::Error.
*/
Glib::RefPtr<Message> send_message_with_reply_finish(const Glib::RefPtr<AsyncResult>& res);
/** Synchronously sends @a message to the peer represented by the connection
* and blocks the calling thread until a reply is received or the timeout is
* reached. See send_message_with_reply() for the asynchronous version of
* this method.
*
* Unless flags contain the Gio::DBus::SEND_MESSAGE_FLAGS_PRESERVE_SERIAL
* flag, the serial number will be assigned by the connection and set on
* message via Gio::DBus::Message::set_serial().
*
* If the connection is closed then the operation will fail with
* Gio::IO_ERROR_CLOSED. If @a cancellable is canceled, the operation will
* fail with Gio::IO_ERROR_CANCELLED. If @a message is not well-formed, the
* operation fails with Gio::IO_ERROR_INVALID_ARGUMENT.
*
* Note that a Glib::Error is thrown if a local in-process error occured.
* That is to say that the returned Message object may be of type
* G_DBUS_MESSAGE_TYPE_ERROR. Use Gio::DBus::Message::to_exception() to
* transcode this to a Glib::Error.
*
* See the C API docs for examples.
*
* Note that message must be unlocked, unless flags contain the
* Gio::DBus::SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
*
* @param message A Message.
* @param cancellable A Cancellable.
* @param timeout_msec The timeout in milliseconds or -1 to use the default
* timeout.
* @return A locked Message that is the reply to @a message or
* <tt>0</tt> if a Glib::Error is thrown.
* @throw Glib::Error.
* @newin{2,28}
*/
Glib::RefPtr<Message> send_message_with_reply_sync(
const Glib::RefPtr<Message>& message,
const Glib::RefPtr<Cancellable>& cancellable,
gint timeout_msec);
/// A non-cancellable version of send_message_with_reply_sync().
Glib::RefPtr<Message> send_message_with_reply_sync(
const Glib::RefPtr<Message>& message,
gint timeout_msec);
/** If @a connection was created with
* DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
* starts processing messages. Does nothing on if @a connection wasn't
* created with this flag or if the method has already been called.
*
* @newin{2,26}
*/
void start_message_processing();
/** Gets whether @a connection is closed.
*
* @newin{2,26}
*
* @return <tt>true</tt> if the connection is closed, <tt>false</tt> otherwise.
*/
bool is_closed() const;
/** Gets the underlying stream used for IO.
*
* While the DBusConnection is active, it will interact with this
* stream from a worker thread, so it is not safe to interact with
* the stream directly.
*
* @newin{2,26}
*
* @return The stream used for IO.
*/
Glib::RefPtr<IOStream> get_stream();
/** Gets the underlying stream used for IO.
*
* While the DBusConnection is active, it will interact with this
* stream from a worker thread, so it is not safe to interact with
* the stream directly.
*
* @newin{2,26}
*
* @return The stream used for IO.
*/
Glib::RefPtr<const IOStream> get_stream() const;
/** The GUID of the peer performing the role of server when
* authenticating. See DBusConnection::property_guid() for more details.
*
* @newin{2,26}
*
* @return The GUID. Do not free this string, it is owned by
* @a connection.
*/
std::string get_guid() const;
/** Gets the unique name of @a connection as assigned by the message
* bus. This can also be used to figure out if @a connection is a
* message bus connection.
*
* @newin{2,26}
*
* @return The unique name or <tt>nullptr</tt> if @a connection is not a message
* bus connection. Do not free this string, it is owned by
* @a connection.
*/
Glib::ustring get_unique_name() const;
/** Gets the capabilities negotiated with the remote peer
*
* @newin{2,26}
*
* @return Zero or more flags from the DBusCapabilityFlags enumeration.
*/
CapabilityFlags get_capabilities() const;
/** Gets the credentials of the authenticated peer. This will always
* return <tt>nullptr</tt> unless @a connection acted as a server
* (e.g. DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
* when set up and the client passed credentials as part of the
* authentication process.
*
* In a message bus setup, the message bus is always the server and
* each application is a client. So this method will always return
* <tt>nullptr</tt> for message bus clients.
*
* @newin{2,26}
*
* @return A Credentials or <tt>nullptr</tt> if not
* available. Do not free this object, it is owned by @a connection.
*/
Glib::RefPtr<Credentials> get_peer_credentials();
/** Gets the credentials of the authenticated peer. This will always
* return <tt>nullptr</tt> unless @a connection acted as a server
* (e.g. DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
* when set up and the client passed credentials as part of the
* authentication process.
*
* In a message bus setup, the message bus is always the server and
* each application is a client. So this method will always return
* <tt>nullptr</tt> for message bus clients.
*
* @newin{2,26}
*
* @return A Credentials or <tt>nullptr</tt> if not
* available. Do not free this object, it is owned by @a connection.
*/
Glib::RefPtr<const Credentials> get_peer_credentials() const;
/** Retrieves the last serial number assigned to a DBusMessage on
* the current thread. This includes messages sent via both low-level
* API such as g_dbus_connection_send_message() as well as
* high-level API such as g_dbus_connection_emit_signal(),
* g_dbus_connection_call() or g_dbus_proxy_call().
*
* @newin{2,34}
*
* @return The last used serial or zero when no message has been sent
* within the current thread.
*/
guint32 get_last_serial() const;
/** Asynchronously invokes the @a method_name method on the @a
* interface_name D-Bus interface on the remote object at @a object_path
* owned by @a bus_name.
*
* If the connection is closed then the operation will fail with
* Gio::IO_ERROR_CLOSED. If @a cancellable is cancelled, the operation will
* fail with Gio::IO_ERROR_CANCELLED. If @a parameters contains a value not
* compatible with the D-Bus protocol, the operation fails with
* Gio::IO_ERROR_INVALID_ARGUMENT.
*
* If @a reply_type is non-<tt>0</tt> then the reply will be checked for
* having this type and an error will be raised if it does not match. Said
* another way, if you give a @a reply_type then any non-<tt>0</tt> return
* value will be of this type.
*
* This is an asynchronous method. When the operation is finished, callback
* will be invoked in the thread-default main loop of the thread you are
* calling this method from. You can then call call_finish() to get the
* result of the operation. See call_sync() for the synchronous version of
* this function.
*
* @param object_path Path of remote object.
* @param interface_name D-Bus interface to invoke method on.
* @param method_name The name of the method to invoke.
* @param parameters A Glib::VariantContainerBase tuple with parameters for the
* method or <tt>0</tt> if not passing parameters.
* @param slot A SlotAsyncReady to call when the request is satisfied.
* @param cancellable A Cancellable.
* @param bus_name A unique or well-known bus name or an empty string if the
* connection is not a message bus connection.
* @param timeout_msec The timeout in milliseconds, -1 to use the default
* timeout or G_MAXINT for no timeout.
* @param flags Flags from the Gio::DBus::CallFlags enumeration.
* @param reply_type The expected type of the reply, or <tt>0</tt>.
* @newin{2,28}
*/
void call(
const Glib::ustring& object_path,
const Glib::ustring& interface_name,
const Glib::ustring& method_name,
const Glib::VariantContainerBase& parameters,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
const Glib::ustring& bus_name = Glib::ustring(),
int timeout_msec = -1,
CallFlags flags = Gio::DBus::CALL_FLAGS_NONE,
const Glib::VariantType& reply_type = Glib::VariantType());
/// A non-cancellable version of call().
void call(
const Glib::ustring& object_path,
const Glib::ustring& interface_name,
const Glib::ustring& method_name,
const Glib::VariantContainerBase& parameters,
const SlotAsyncReady& slot,
const Glib::ustring& bus_name = Glib::ustring(),
int timeout_msec = -1,
CallFlags flags = Gio::DBus::CALL_FLAGS_NONE,
const Glib::VariantType& reply_type = Glib::VariantType());
/** Finishes an operation started with call().
* @param res A AsyncResult obtained from the SlotAsyncReady passed to
* call().
* @result A Variant tuple with return values.
* @throw Glib::Error.
* @newin{2,28}
*/
Glib::VariantContainerBase call_finish(const Glib::RefPtr<AsyncResult>& res);
/** Synchronously invokes the @a method_name method on the @a interface_name
* D-Bus interface on the remote object at @a object_path owned by @a
* bus_name.
*
* If the connection is closed then the operation will fail with
* Gio::IO_ERROR_CLOSED. If @a cancellable is cancelled, the operation will
* fail with Gio::IO_ERROR_CANCELLED. If @a parameters contains a value not
* compatible with the D-Bus protocol, the operation fails with
* Gio::IO_ERROR_INVALID_ARGUMENT.
*
* If @a reply_type is non-<tt>0</tt> then the reply will be checked for
* having this type and an error will be raised if it does not match. Said
* another way, if you give a @a reply_type then any non-<tt>0</tt> return
* value will be of this type.
*
* The calling thread is blocked until a reply is received. See call() for
* the asynchronous version of this method.
*
* @param object_path Path of remote object.
* @param interface_name D-Bus interface to invoke method on.
* @param method_name The name of the method to invoke.
* @param parameters A Glib::VariantContainerBase tuple with parameters for the
* method or <tt>0</tt> if not passing parameters.
* @param cancellable A Cancellable.
* @param bus_name A unique or well-known bus name or an empty string if the
* connection is not a message bus connection.
* @param timeout_msec The timeout in milliseconds, -1 to use the default
* timeout or G_MAXINT for no timeout.
* @param flags Flags from the Gio::DBus::CallFlags enumeration.
* @param reply_type The expected type of the reply, or <tt>0</tt>.
* @result A Variant tuple with return values.
* @throw Glib::Error.
* @newin{2,28}
*/
Glib::VariantContainerBase call_sync(
const Glib::ustring& object_path,
const Glib::ustring& interface_name,
const Glib::ustring& method_name,
const Glib::VariantContainerBase& parameters,
const Glib::RefPtr<Cancellable>& cancellable,
const Glib::ustring& bus_name = Glib::ustring(),
int timeout_msec = -1,
CallFlags flags = Gio::DBus::CALL_FLAGS_NONE,
const Glib::VariantType& reply_type = Glib::VariantType());
/// A non-cancellable version of call_sync().
Glib::VariantContainerBase call_sync(
const Glib::ustring& object_path,
const Glib::ustring& interface_name,
const Glib::ustring& method_name,
const Glib::VariantContainerBase& parameters,
const Glib::ustring& bus_name = Glib::ustring(),
int timeout_msec = -1,
CallFlags flags = Gio::DBus::CALL_FLAGS_NONE,
const Glib::VariantType& reply_type = Glib::VariantType());
#ifdef G_OS_UNIX
/** Like call() but also takes a GUnixFDList object.
* This method is only available on UNIX.
*
* This is an asynchronous method. When the operation is finished, callback
* will be invoked in the thread-default main loop of the thread you are
* calling this method from. You can then call call_with_unix_fd_finish() to
* get the result of the operation. See call_sync() for the synchronous
* version of this function.
*
* @param object_path Path of remote object.
* @param interface_name D-Bus interface to invoke method on.
* @param method_name The name of the method to invoke.
* @param parameters A Glib::VariantContainerBase tuple with parameters for the
* method or <tt>0</tt> if not passing parameters.
* @param slot A SlotAsyncReady to call when the request is satisfied.
* @param cancellable A Cancellable.
* @param fd_list A UnixFDList.
* @param bus_name A unique or well-known bus name or an empty string if the
* connection is not a message bus connection.
* @param timeout_msec The timeout in milliseconds, -1 to use the default
* timeout or G_MAXINT for no timeout.
* @param flags Flags from the Gio::DBus::CallFlags enumeration.
* @param reply_type The expected type of the reply, or <tt>0</tt>.
* @newin{2,34}
*/
void call(
const Glib::ustring& object_path,
const Glib::ustring& interface_name,
const Glib::ustring& method_name,
const Glib::VariantContainerBase& parameters,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
const Glib::RefPtr<UnixFDList>& fd_list,
const Glib::ustring& bus_name = Glib::ustring(),
int timeout_msec = -1,
CallFlags flags = Gio::DBus::CALL_FLAGS_NONE,
const Glib::VariantType& reply_type = Glib::VariantType());
/** A non-cancellable version of call() (with a UnixFDList).
* @newin{2,34}
*/
void call(
const Glib::ustring& object_path,
const Glib::ustring& interface_name,
const Glib::ustring& method_name,
const Glib::VariantContainerBase& parameters,
const SlotAsyncReady& slot,
const Glib::RefPtr<UnixFDList>& fd_list,
const Glib::ustring& bus_name = Glib::ustring(),
int timeout_msec = -1,
CallFlags flags = Gio::DBus::CALL_FLAGS_NONE,
const Glib::VariantType& reply_type = Glib::VariantType());
#endif // G_OS_UNIX
#ifdef G_OS_UNIX
/** Finishes an operation started with call() (with a UnixFDList).
* @param res A AsyncResult obtained from the SlotAsyncReady passed to
* call().
* @param out_fd_list Return location for a UnixFDList.
* @result A Variant tuple with return values.
* @throw Glib::Error.
* @newin{2,34}
*/
Glib::VariantContainerBase call_finish(const Glib::RefPtr<AsyncResult>& res, Glib::RefPtr<UnixFDList>& out_fd_list);
#endif // G_OS_UNIX
#ifdef G_OS_UNIX
/** Like g_dbus_connection_call_sync() but also takes and returns UnixFDList objects.
*
* This method is only available on UNIX.
*
* @newin{2,30}
*
* @param bus_name A unique or well-known bus name or <tt>nullptr</tt>
* if @a connection is not a message bus connection.
* @param object_path Path of remote object.
* @param interface_name D-Bus interface to invoke method on.
* @param method_name The name of the method to invoke.
* @param parameters A Variant tuple with parameters for
* the method or <tt>nullptr</tt> if not passing parameters.
* @param reply_type The expected type of the reply, or <tt>nullptr</tt>.
* @param flags Flags from the DBusCallFlags enumeration.
* @param timeout_msec The timeout in milliseconds, -1 to use the default
* timeout or G_MAXINT for no timeout.
* @param fd_list A UnixFDList or <tt>nullptr</tt>.
* @param out_fd_list Return location for a UnixFDList or <tt>nullptr</tt>.
* @param cancellable A Cancellable or <tt>nullptr</tt>.
* @return <tt>nullptr</tt> if @a error is set. Otherwise a Variant tuple with
* return values. Free with Glib::variant_unref().
*
* @throws Glib::Error
*/
Glib::VariantContainerBase call_sync(const Glib::ustring& object_path, const Glib::ustring& interface_name, const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<UnixFDList>& fd_list, Glib::RefPtr<UnixFDList>& out_fd_list, const Glib::ustring& bus_name = Glib::ustring(), int timeout_msec = -1, CallFlags flags = Gio::DBus::CALL_FLAGS_NONE, const Glib::VariantType& reply_type = Glib::VariantType());
#endif // G_OS_UNIX
#ifdef G_OS_UNIX
/// A call_sync() convenience overload.
Glib::VariantContainerBase call_sync(const Glib::ustring& object_path, const Glib::ustring& interface_name, const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, const Glib::RefPtr<UnixFDList>& fd_list, Glib::RefPtr<UnixFDList>& out_fd_list, const Glib::ustring& bus_name = Glib::ustring(), int timeout_msec = -1, CallFlags flags = Gio::DBus::CALL_FLAGS_NONE, const Glib::VariantType& reply_type = Glib::VariantType());
#endif // G_OS_UNIX
/** Emits a signal.
*
* This can only fail if @a parameters is not compatible with the D-Bus
* protocol.
*
* @param object_path Path of remote object.
* @param interface_name D-Bus interface to emit a signal on.
* @param signal_name The name of the signal to emit.
* @param destination_bus_name The unique bus name for the destination for
* the signal or an empty string to emit to all listeners.
* @param parameters A Glib::VariantContainerBase tuple with parameters for the
* signal or <tt>0</tt> if not passing parameters.
* @throw Glib::Error.
* @newin{2,28}
*/
void emit_signal(
const Glib::ustring& object_path,
const Glib::ustring& interface_name,
const Glib::ustring& signal_name,
const Glib::ustring& destination_bus_name = Glib::ustring(),
const Glib::VariantContainerBase& parameters = Glib::VariantContainerBase());
/** Subscribes to signals on the connection and invokes @a slot with a
* whenever the signal is received. Note that @a slot will be invoked in the
* thread-default main loop of the thread you are calling this method from.
*
* If the connection is not a message bus connection, @a sender must be
* <tt>0</tt>.
*
* If @a sender is a well-known name note that @a slot is invoked with the
* unique name for the owner of @a sender, not the well-known name as one
* would expect. This is because the message bus rewrites the name. As such,
* to avoid certain race conditions, users should be tracking the name owner
* of the well-known name and use that when processing the received signal.
*
* @param slot Slot to invoke when there is a signal matching the requested
* data.
* @param sender Sender name to match on (unique or well-known name) or
* <tt>0</tt> to listen from all senders.
* @param interface_name D-Bus interface name to match on or <tt>0</tt> to
* match on all interfaces.
* @param member D-Bus signal name to match on or <tt>0</tt> to match on all
* signals.
* @param object_path Object path to match on or <tt>0</tt> to match on all
* object paths.
* @param arg0 Contents of first string argument to match on or <tt>0</tt>
* to match on all kinds of arguments.
* @param flags Flags describing how to subscribe to the signal (currently
* unused).
* @return A subscription identifier that can be used with
* signal_unsubscribe().
* @newin{2,28}
*/
guint signal_subscribe(
const SlotSignal& slot,
const Glib::ustring& sender = Glib::ustring(),
const Glib::ustring& interface_name = Glib::ustring(),
const Glib::ustring& member = Glib::ustring(),
const Glib::ustring& object_path = Glib::ustring(),
const Glib::ustring& arg0 = Glib::ustring(),
SignalFlags flags = Gio::DBus::SIGNAL_FLAGS_NONE);
/** Unsubscribes from signals.
*
* @newin{2,26}
*
* @param subscription_id A subscription id obtained from
* g_dbus_connection_signal_subscribe().
*/
void signal_unsubscribe(guint subscription_id);
/** Adds a message filter. Filters are handlers that are run on all incoming
* and outgoing messages, prior to standard dispatch. Filters are run in the
* order that they were added. The same handler can be added as a filter
* more than once, in which case it will be run more than once. Filters
* added during a filter slot won't be run on the message being processed.
* Filter slots are allowed to modify and even drop messages.
*
* Note that filters are run in a dedicated message handling thread so they
* can't block and, generally, can't do anything but signal a worker thread.
* Also note that filters are rarely needed - use API such as
* send_message_with_reply(), signal_subscribe() or call() instead.
*
* If a filter consumes an incoming message the message is not dispatched
* anywhere else - not even the standard dispatch machinery (that API such
* as signal_subscribe() and send_message_with_reply() relies on) will see
* the message. Similary, if a filter consumes an outgoing message, the
* message will not be sent to the other peer.
*
* @param slot A filter slot.
* @return A filter identifier that can be used with remove_filter().
* @newin{2,28}
*/
guint add_filter(const SlotMessageFilter& slot);
/** Removes a filter.
*
* Note that since filters run in a different thread, there is a race
* condition where it is possible that the filter will be running even
* after calling g_dbus_connection_remove_filter(), so you cannot just
* free data that the filter might be using. Instead, you should pass
* a DestroyNotify to g_dbus_connection_add_filter(), which will be
* called when it is guaranteed that the data is no longer needed.
*
* @newin{2,26}
*
* @param filter_id An identifier obtained from g_dbus_connection_add_filter().
*/
void remove_filter(guint filter_id);
/** Registers slots for exported objects at @a object_path with the D-Bus
* interface that is described in @a interface_info.
*
* Calls to slots in @a vtable will happen in the thread-default main loop
* of the thread you are calling this method from.
*
* Note that all Glib::VariantBase values passed to functions in @a vtable
* will match the signature given in @a interface_info - if a remote caller
* passes incorrect values, the @c org.freedesktop.DBus.Error.InvalidArgs is
* returned to the remote caller.
*
* Additionally, if the remote caller attempts to invoke methods or access
* properties not mentioned in @a interface_info the
* @c org.freedesktop.DBus.Error.UnknownMethod resp.
* @c org.freedesktop.DBus.Error.InvalidArgs errors are returned to the
* caller.
*
* It is considered a programming error if the SlotDBusInterfaceGetProperty
* slot in @a vtable returns a Glib::VariantBase of incorrect type.
*
* If an existing slot is already registered at @a object_path and @a
* interface_name, then a Glib::Error is thrown.
*
* GDBus automatically implements the standard D-Bus interfaces
* org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable and
* org.freedesktop.Peer, so you don't have to implement those for the
* objects you export. You can implement org.freedesktop.DBus.Properties
* yourself, e.g. to handle getting and setting of properties
* asynchronously.
*
* @param object_path The object path to register at.
* @param interface_info Introspection data for the interface.
* @param vtable An InterfaceVTable to call into.
* @return A registration id (never 0) that can be used with
* unregister_object() if no Glib::Error is thrown.
* @throw Glib::Error.
* @newin{2,28}
*/
guint register_object(const Glib::ustring& object_path,
const Glib::RefPtr<InterfaceInfo>& interface_info,
const InterfaceVTable& vtable);
/** Registers exported objects at @a object_path with the D-Bus
* interface that is described in @a interface_info. This method overload,
* which does not take a VTable, is useful for
* <a href="http://en.wikipedia.org/wiki/Marker_interface_pattern">marker
* interfaces</a>.
*
* If an existing slot is already registered at @a object_path and @a
* interface_name, then a Glib::Error is thrown.
*
* GDBus automatically implements the standard D-Bus interfaces
* org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable and
* org.freedesktop.Peer, so you don't have to implement those for the
* objects you export.
*
* @param object_path The object path to register at.
* @param interface_info Introspection data for the interface.
* @return A registration id (never 0) that can be used with
* unregister_object() if no Glib::Error is thrown.
* @throw Glib::Error.
* @newin{2,28}
*/
guint register_object(const Glib::ustring& object_path,
const Glib::RefPtr<InterfaceInfo>& interface_info);
/** Unregisters an object.
*
* @newin{2,26}
*
* @param registration_id A registration id obtained from
* g_dbus_connection_register_object().
* @return <tt>true</tt> if the object was unregistered, <tt>false</tt> otherwise.
*/
bool unregister_object(guint registration_id);
/** Registers a whole subtree of “dynamic” objects.
*
* Copies of the enumerate and introspection slots usted to create @a vtable
* are used to convey, to remote callers, what nodes exist in the subtree
* rooted by @a object_path.
*
* When handling remote calls into any node in the subtree, first the
* enumerate slot is used to check if the node exists. If the node
* exists or the Gio::DBus::SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag
* is set the introspection slot is used to check if the node supports the
* requested method. If so, the dispatch function is used to determine where
* to dispatch the call. The collected InterfaceVTable will be used to
* call into the interface vtable for processing the request.
*
* All calls into user-provided code will be invoked in the thread-default
* main loop of the thread you are calling this method from.
*
* If an existing subtree is already registered at @a object_path or then
* a Glib::Error is thrown.
*
* Note that it is valid to register regular objects (using
* register_object()) in a subtree registered with register_subtree() - if
* so, the subtree handler is tried as the last resort. One way to think
* about a subtree handler is to consider it a “fallback handler” for object
* paths not registered via register_object().
*
*
* @param object_path The object path to register the subtree at.
* @param vtable A SubtreeVTable to enumerate, introspect and dispatch
* nodes in the subtree.
* @param flags Flags used to fine tune the behavior of the subtree.
* @return A subtree registration id (never 0) that can be used with
* unregister_subtree() if no Glib::Error is thrown.
*
* @newin{2,28}
*/
guint register_subtree(const Glib::ustring& object_path,
const SubtreeVTable& vtable,
SubtreeFlags flags = Gio::DBus::SUBTREE_FLAGS_NONE);
/** Unregisters a subtree.
*
* @newin{2,26}
*
* @param registration_id A subtree registration id obtained from
* g_dbus_connection_register_subtree().
* @return <tt>true</tt> if the subtree was unregistered, <tt>false</tt> otherwise.
*/
bool unregister_subtree(guint registration_id);
/** Exports @a action_group on @a connection at @a object_path.
*
* The implemented D-Bus API should be considered private. It is
* subject to change in the future.
*
* A given object path can only have one action group exported on it.
* If this constraint is violated, the export will fail and 0 will be
* returned (with @a error set accordingly).
*
* You can unexport the action group using
* g_dbus_connection_unexport_action_group() with the return value of
* this function.
*
* The thread default main context is taken at the time of this call.
* All incoming action activations and state change requests are
* reported from this context. Any changes on the action group that
* cause it to emit signals must also come from this same context.
* Since incoming action activations and state change requests are
* rather likely to cause changes on the action group, this effectively
* limits a given action group to being exported from only one main
* context.
*
* @newin{2,32}
*
* @param object_path A D-Bus object path.
* @param action_group A ActionGroup.
* @return The ID of the export (never zero), or 0 in case of failure.
*
* @throws Glib::Error
*/
guint export_action_group(const Glib::ustring& object_path, const Glib::RefPtr<ActionGroup>& action_group);
/** Reverses the effect of a previous call to
* g_dbus_connection_export_action_group().
*
* It is an error to call this function with an ID that wasn't returned
* from g_dbus_connection_export_action_group() or to call it with the
* same ID more than once.
*
* @newin{2,32}
*
* @param export_id The ID from g_dbus_connection_export_action_group().
*/
void unexport_action_group(guint export_id);
/** Exports @a menu on @a connection at @a object_path.
*
* The implemented D-Bus API should be considered private.
* It is subject to change in the future.
*
* An object path can only have one menu model exported on it. If this
* constraint is violated, the export will fail and 0 will be
* returned (with @a error set accordingly).
*
* You can unexport the menu model using
* g_dbus_connection_unexport_menu_model() with the return value of
* this function.
*
* @newin{2,32}
*
* @param object_path A D-Bus object path.
* @param menu A MenuModel.
* @return The ID of the export (never zero), or 0 in case of failure.
*
* @throws Glib::Error
*/
guint export_menu_model(const Glib::ustring& object_path, const Glib::RefPtr<MenuModel>& menu);
/** Reverses the effect of a previous call to
* g_dbus_connection_export_menu_model().
*
* It is an error to call this function with an ID that wasn't returned
* from g_dbus_connection_export_menu_model() or to call it with the
* same ID more than once.
*
* @newin{2,32}
*
* @param export_id The ID from g_dbus_connection_export_menu_model().
*/
void unexport_menu_model(guint export_id);
//_WRAP_PROPERTY("address", std::string) // write-only construct-only
//_WRAP_PROPERTY("authentication-observer", Glib::RefPtr<AuthObserver>) // write-only construct-only
/** Flags from the DBusCapabilityFlags enumeration
* representing connection features negotiated with the other peer.
*
* @newin{2,26}
*
* Default value: DBUS_CAPABILITY_FLAGS_NONE
*
* @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
* or receive notification when the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly< CapabilityFlags > property_capabilities() const;
/** A boolean specifying whether the connection has been closed.
*
* @newin{2,26}
*
* Default value: <tt>false</tt>
*
* @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
* or receive notification when the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly< bool > property_closed() const;
/** A boolean specifying whether the process will be terminated (by
* calling `raise(SIGTERM)`) if the connection is closed by the
* remote peer.
*
* Note that DBusConnection objects returned by g_bus_get_finish()
* and g_bus_get_sync() will (usually) have this property set to <tt>true</tt>.
*
* @newin{2,26}
*
* Default value: <tt>false</tt>
*
* @return A PropertyProxy that allows you to get or set the value of the property,
* or receive notification when the value of the property changes.
*/
Glib::PropertyProxy< bool > property_exit_on_close() ;
/** A boolean specifying whether the process will be terminated (by
* calling `raise(SIGTERM)`) if the connection is closed by the
* remote peer.
*
* Note that DBusConnection objects returned by g_bus_get_finish()
* and g_bus_get_sync() will (usually) have this property set to <tt>true</tt>.
*
* @newin{2,26}
*
* Default value: <tt>false</tt>
*
* @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
* or receive notification when the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly< bool > property_exit_on_close() const;
//_WRAP_PROPERTY("flags", ConnectionFlags) // write-only construct-only
/** The GUID of the peer performing the role of server when
* authenticating.
*
* If you are constructing a DBusConnection and pass
* DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER in the
* DBusConnection::property_flags() property then you MUST also set this
* property to a valid guid.
*
* If you are constructing a DBusConnection and pass
* DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT in the
* DBusConnection::property_flags() property you will be able to read the GUID
* of the other peer here after the connection has been successfully
* initialized.
*
* @newin{2,26}
*
* Default value: ""
*
* @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
* or receive notification when the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly< std::string > property_guid() const;
/** The underlying IOStream used for I/O.
*
* If this is passed on construction and is a SocketConnection,
* then the corresponding Socket will be put into non-blocking mode.
*
* While the DBusConnection is active, it will interact with this
* stream from a worker thread, so it is not safe to interact with
* the stream directly.
*
* @newin{2,26}
*
* @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
* or receive notification when the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<IOStream> > property_stream() const;
/** The unique name as assigned by the message bus or <tt>nullptr</tt> if the
* connection is not open or not a message bus connection.
*
* @newin{2,26}
*
* Default value: ""
*
* @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
* or receive notification when the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_unique_name() const;
/**
* @par Slot Prototype:
* <tt>void on_my_%closed(bool remote_peer_vanished, const Glib::Error& error)</tt>
*
* Flags: Run Last
*
* Emitted when the connection is closed.
*
* The cause of this event can be
*
* - If g_dbus_connection_close() is called. In this case
* @a remote_peer_vanished is set to <tt>false</tt> and @a error is <tt>nullptr</tt>.
*
* - If the remote peer closes the connection. In this case
* @a remote_peer_vanished is set to <tt>true</tt> and @a error is set.
*
* - If the remote peer sends invalid or malformed data. In this
* case @a remote_peer_vanished is set to <tt>false</tt> and @a error is set.
*
* Upon receiving this signal, you should give up your reference to
* @a connection. You are guaranteed that this signal is emitted only
* once.
*
* @newin{2,26}
*
* @param remote_peer_vanished <tt>true</tt> if @a connection is closed because the
* remote peer closed its end of the connection.
*/
Glib::SignalProxy< void,bool,const Glib::Error& > signal_closed();
public:
public:
//C++ methods used to invoke GTK+ virtual functions:
protected:
//GTK+ Virtual Functions (override these to change behaviour):
//Default Signal Handlers::
};
} //namespace DBus
} // namespace Gio
namespace Glib
{
/** A Glib::wrap() method for this object.
*
* @param object The C instance.
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
* @result A C++ instance that wraps this C instance.
*
* @relates Gio::DBus::Connection
*/
Glib::RefPtr<Gio::DBus::Connection> wrap(GDBusConnection* object, bool take_copy = false);
}
#endif /* _GIOMM_DBUSCONNECTION_H */
|