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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>TpPresenceMixin: telepathy-glib API Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="telepathy-glib API Reference Manual">
<link rel="up" href="ch-service-base.html" title="Service-side implementation">
<link rel="prev" href="TpBaseChannel.html" title="TpBaseChannel">
<link rel="next" href="telepathy-glib-TpPropertiesMixin.html" title="TpPropertiesMixin">
<meta name="generator" content="GTK-Doc V1.32 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#telepathy-glib-TpPresenceMixin.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
<a href="#telepathy-glib-TpPresenceMixin.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch-service-base.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="TpBaseChannel.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="telepathy-glib-TpPropertiesMixin.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="telepathy-glib-TpPresenceMixin"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="telepathy-glib-TpPresenceMixin.top_of_page"></a>TpPresenceMixin</span></h2>
<p>TpPresenceMixin — a mixin implementation of the Presence connection
interface</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="telepathy-glib-TpPresenceMixin.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-status-spec-can-set-on-self" title="tp_presence_status_spec_can_set_on_self ()">tp_presence_status_spec_can_set_on_self</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-status-spec-get-name" title="tp_presence_status_spec_get_name ()">tp_presence_status_spec_get_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="telepathy-glib-enums.html#TpConnectionPresenceType" title="enum TpConnectionPresenceType"><span class="returnvalue">TpConnectionPresenceType</span></a>
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-status-spec-get-presence-type" title="tp_presence_status_spec_get_presence_type ()">tp_presence_status_spec_get_presence_type</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-status-spec-has-message" title="tp_presence_status_spec_has_message ()">tp_presence_status_spec_has_message</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec"><span class="returnvalue">TpPresenceStatusSpec</span></a> *
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-status-spec-new" title="tp_presence_status_spec_new ()">tp_presence_status_spec_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec"><span class="returnvalue">TpPresenceStatusSpec</span></a> *
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-status-spec-copy" title="tp_presence_status_spec_copy ()">tp_presence_status_spec_copy</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-status-spec-free" title="tp_presence_status_spec_free ()">tp_presence_status_spec_free</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixinStatusAvailableFunc" title="TpPresenceMixinStatusAvailableFunc ()">*TpPresenceMixinStatusAvailableFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GHashTable</span> *
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixinGetContactStatusesFunc" title="TpPresenceMixinGetContactStatusesFunc ()">*TpPresenceMixinGetContactStatusesFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixinSetOwnStatusFunc" title="TpPresenceMixinSetOwnStatusFunc ()">*TpPresenceMixinSetOwnStatusFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">guint</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixinGetMaximumStatusMessageLengthFunc" title="TpPresenceMixinGetMaximumStatusMessageLengthFunc ()">*TpPresenceMixinGetMaximumStatusMessageLengthFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatus" title="struct TpPresenceStatus"><span class="returnvalue">TpPresenceStatus</span></a> *
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-status-new" title="tp_presence_status_new ()">tp_presence_status_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-status-free" title="tp_presence_status_free ()">tp_presence_status_free</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-class-init" title="tp_presence_mixin_class_init ()">tp_presence_mixin_class_init</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-init" title="tp_presence_mixin_init ()">tp_presence_mixin_init</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-finalize" title="tp_presence_mixin_finalize ()">tp_presence_mixin_finalize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-emit-presence-update" title="tp_presence_mixin_emit_presence_update ()">tp_presence_mixin_emit_presence_update</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-emit-one-presence-update" title="tp_presence_mixin_emit_one_presence_update ()">tp_presence_mixin_emit_one_presence_update</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-iface-init" title="tp_presence_mixin_iface_init ()">tp_presence_mixin_iface_init</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-simple-presence-iface-init" title="tp_presence_mixin_simple_presence_iface_init ()">tp_presence_mixin_simple_presence_iface_init</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-simple-presence-init-dbus-properties" title="tp_presence_mixin_simple_presence_init_dbus_properties ()">tp_presence_mixin_simple_presence_init_dbus_properties</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-simple-presence-register-with-contacts-mixin" title="tp_presence_mixin_simple_presence_register_with_contacts_mixin ()">tp_presence_mixin_simple_presence_register_with_contacts_mixin</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<a name="TpPresenceStatusSpec"></a><div class="refsect1">
<a name="telepathy-glib-TpPresenceMixin.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusOptionalArgumentSpec" title="struct TpPresenceStatusOptionalArgumentSpec">TpPresenceStatusOptionalArgumentSpec</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec-struct" title="struct TpPresenceStatusSpec">TpPresenceStatusSpec</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatus" title="struct TpPresenceStatus">TpPresenceStatus</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixin" title="struct TpPresenceMixin">TpPresenceMixin</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixinClass" title="struct TpPresenceMixinClass">TpPresenceMixinClass</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="telepathy-glib-TpPresenceMixin.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen"> <a href="/usr/share/gtk-doc/html/gobject/gobject-Boxed-Types.html">GBoxed</a>
<span class="lineart">╰──</span> TpPresenceStatusSpec
</pre>
</div>
<div class="refsect1">
<a name="telepathy-glib-TpPresenceMixin.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <telepathy-glib/telepathy-glib.h>
</pre>
</div>
<div class="refsect1">
<a name="telepathy-glib-TpPresenceMixin.description"></a><h2>Description</h2>
<p>This mixin can be added to a <a class="link" href="TpBaseConnection.html" title="TpBaseConnection"><span class="type">TpBaseConnection</span></a> subclass to implement the
SimplePresence and/or Presence interfaces. Implementing both interfaces
(as described below) is recommended. In particular, you must implement the
old-style Presence interface if compatibility with telepathy-glib
versions older than 0.11.13 is required.</p>
<p>To use the presence mixin, include a <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixinClass" title="struct TpPresenceMixinClass"><span class="type">TpPresenceMixinClass</span></a> somewhere in your
class structure and a <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixin" title="struct TpPresenceMixin"><span class="type">TpPresenceMixin</span></a> somewhere in your instance structure,
and call <a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-class-init" title="tp_presence_mixin_class_init ()"><code class="function">tp_presence_mixin_class_init()</code></a> from your class_init function,
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-init" title="tp_presence_mixin_init ()"><code class="function">tp_presence_mixin_init()</code></a> from your init function or constructor, and
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-finalize" title="tp_presence_mixin_finalize ()"><code class="function">tp_presence_mixin_finalize()</code></a> from your dispose or finalize function.</p>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id-1.6.12.8.4"></a>Implementing SimplePresence</h2></div></div></div>
<p>
Since 0.7.13 this mixin supports the entire SimplePresence interface.
You can implement <a class="link" href="telepathy-glib-svc-connection.html#TpSvcConnectionInterfaceSimplePresence"><span class="type">TpSvcConnectionInterfaceSimplePresence</span></a> as follows:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>use the <a class="link" href="telepathy-glib-TpContactsMixin.html#TpContactsMixin" title="struct TpContactsMixin"><span class="type">TpContactsMixin</span></a> and
<a class="link" href="telepathy-glib-dbus-properties-mixin.html" title="TpDBusPropertiesMixin">TpDBusPropertiesMixin</a>;</p></li>
<li class="listitem">
<p>pass <a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-simple-presence-iface-init" title="tp_presence_mixin_simple_presence_iface_init ()"><code class="function">tp_presence_mixin_simple_presence_iface_init()</code></a> as an
argument to <code class="function">G_IMPLEMENT_INTERFACE()</code>, like so:
</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="n">G_DEFINE_TYPE_WITH_CODE</span> <span class="p">(</span><span class="n">MyConnection</span><span class="p">,</span> <span class="n">my_connection</span><span class="p">,</span>
<span class="n">TP_TYPE_BASE_CONNECTION</span><span class="p">,</span>
<span class="c1">// ...</span>
<span class="n">G_IMPLEMENT_INTERFACE</span> <span class="p">(</span><span class="n">TP_TYPE_SVC_CONNECTION_INTERFACE_SIMPLE_PRESENCE</span><span class="p">,</span>
<span class="n">tp_presence_mixin_simple_presence_iface_init</span><span class="p">);</span>
<span class="c1">// ...</span>
<span class="p">)</span></pre></td>
</tr>
</tbody>
</table>
</div>
</li>
<li class="listitem"><p>
call <a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-simple-presence-init-dbus-properties" title="tp_presence_mixin_simple_presence_init_dbus_properties ()"><code class="function">tp_presence_mixin_simple_presence_init_dbus_properties()</code></a> in the
<span class="type">GTypeInfo</span> class_init function;
</p></li>
<li class="listitem"><p>
call <a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-simple-presence-register-with-contacts-mixin" title="tp_presence_mixin_simple_presence_register_with_contacts_mixin ()"><code class="function">tp_presence_mixin_simple_presence_register_with_contacts_mixin()</code></a>
in the <span class="type">GObjectClass</span> constructed function.
</p></li>
</ul></div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id-1.6.12.8.5"></a>Implementing old-style Presence</h2></div></div></div>
<p>
This mixin also supports a large subset of the deprecated Presence
interface. It does not support protocols where it is possible to set
multiple statuses on yourself at once (all presence statuses will have the
exclusive flag set), or last-activity-time information.
</p>
<p>
To use the presence mixin as the implementation of
<a class="link" href="telepathy-glib-svc-connection.html#TpSvcConnectionInterfacePresence"><span class="type">TpSvcConnectionInterfacePresence</span></a>, use <a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-iface-init" title="tp_presence_mixin_iface_init ()"><code class="function">tp_presence_mixin_iface_init()</code></a> as
the function you pass to <code class="function">G_IMPLEMENT_INTERFACE()</code>, as in the following
example. The presence mixin implements all of the D-Bus methods in the
Presence interface.
</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="n">G_DEFINE_TYPE_WITH_CODE</span> <span class="p">(</span><span class="n">MyConnection</span><span class="p">,</span> <span class="n">my_connection</span><span class="p">,</span>
<span class="n">TP_TYPE_BASE_CONNECTION</span><span class="p">,</span>
<span class="c1">// ...</span>
<span class="n">G_IMPLEMENT_INTERFACE</span> <span class="p">(</span><span class="n">TP_TYPE_SVC_CONNECTION_INTERFACE_PRESENCE</span><span class="p">,</span>
<span class="n">tp_presence_mixin_iface_init</span><span class="p">);</span>
<span class="c1">// ...</span>
<span class="p">)</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p>
In telepathy-glib versions older than 0.11.13, every connection
that used the <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixin" title="struct TpPresenceMixin"><span class="type">TpPresenceMixin</span></a> was required to implement
<a class="link" href="telepathy-glib-svc-connection.html#TpSvcConnectionInterfacePresence"><span class="type">TpSvcConnectionInterfacePresence</span></a>; failing to do so would lead to an
assertion failure. Since 0.11.13, this is no longer required.
</p>
</div>
</div>
<div class="refsect1">
<a name="telepathy-glib-TpPresenceMixin.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="tp-presence-status-spec-can-set-on-self"></a><h3>tp_presence_status_spec_can_set_on_self ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
tp_presence_status_spec_can_set_on_self
(<em class="parameter"><code>const <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec"><span class="type">TpPresenceStatusSpec</span></a> *self</code></em>);</pre>
<p></p>
<div class="refsect3">
<a name="tp-presence-status-spec-can-set-on-self.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a presence status specification</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="tp-presence-status-spec-can-set-on-self.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the user can set this presence status on themselves (most
statuses), or <code class="literal">FALSE</code> if they cannot directly set it on
themselves (typically used for <a class="link" href="telepathy-glib-enums.html#TP-CONNECTION-PRESENCE-TYPE-OFFLINE:CAPS"><code class="literal">TP_CONNECTION_PRESENCE_TYPE_OFFLINE</code></a>
and <a class="link" href="telepathy-glib-enums.html#TP-CONNECTION-PRESENCE-TYPE-ERROR:CAPS"><code class="literal">TP_CONNECTION_PRESENCE_TYPE_ERROR</code></a>)</p>
</div>
<p class="since">Since: 0.23.1</p>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-status-spec-get-name"></a><h3>tp_presence_status_spec_get_name ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> *
tp_presence_status_spec_get_name (<em class="parameter"><code>const <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec"><span class="type">TpPresenceStatusSpec</span></a> *self</code></em>);</pre>
<p></p>
<div class="refsect3">
<a name="tp-presence-status-spec-get-name.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a presence status specification</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="tp-presence-status-spec-get-name.returns"></a><h4>Returns</h4>
<p>the name of this presence status,
such as "available" or "out-to-lunch". </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: 0.23.1</p>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-status-spec-get-presence-type"></a><h3>tp_presence_status_spec_get_presence_type ()</h3>
<pre class="programlisting"><a class="link" href="telepathy-glib-enums.html#TpConnectionPresenceType" title="enum TpConnectionPresenceType"><span class="returnvalue">TpConnectionPresenceType</span></a>
tp_presence_status_spec_get_presence_type
(<em class="parameter"><code>const <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec"><span class="type">TpPresenceStatusSpec</span></a> *self</code></em>);</pre>
<p>Return the category into which this presence type falls. For instance,
for XMPP's "" (do not disturb) status, this would return
<a class="link" href="telepathy-glib-enums.html#TP-CONNECTION-PRESENCE-TYPE-BUSY:CAPS"><code class="literal">TP_CONNECTION_PRESENCE_TYPE_BUSY</code></a>.</p>
<div class="refsect3">
<a name="tp-presence-status-spec-get-presence-type.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a presence status specification</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="tp-presence-status-spec-get-presence-type.returns"></a><h4>Returns</h4>
<p> a <a class="link" href="telepathy-glib-enums.html#TpConnectionPresenceType" title="enum TpConnectionPresenceType"><span class="type">TpConnectionPresenceType</span></a></p>
</div>
<p class="since">Since: 0.23.1</p>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-status-spec-has-message"></a><h3>tp_presence_status_spec_has_message ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
tp_presence_status_spec_has_message (<em class="parameter"><code>const <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec"><span class="type">TpPresenceStatusSpec</span></a> *self</code></em>);</pre>
<p></p>
<div class="refsect3">
<a name="tp-presence-status-spec-has-message.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a presence status specification</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="tp-presence-status-spec-has-message.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if this presence status is accompanied by an optional
human-readable message</p>
</div>
<p class="since">Since: 0.23.1</p>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-status-spec-new"></a><h3>tp_presence_status_spec_new ()</h3>
<pre class="programlisting"><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec"><span class="returnvalue">TpPresenceStatusSpec</span></a> *
tp_presence_status_spec_new (<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>,
<em class="parameter"><code><a class="link" href="telepathy-glib-enums.html#TpConnectionPresenceType" title="enum TpConnectionPresenceType"><span class="type">TpConnectionPresenceType</span></a> type</code></em>,
<em class="parameter"><code><span class="type">gboolean</span> can_set_on_self</code></em>,
<em class="parameter"><code><span class="type">gboolean</span> has_message</code></em>);</pre>
<p></p>
<div class="refsect3">
<a name="tp-presence-status-spec-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p>the name of the new presence status</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>the category into which this presence status falls</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>can_set_on_self</p></td>
<td class="parameter_description"><p><code class="literal">TRUE</code> if the user can set this presence status
on themselves</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>has_message</p></td>
<td class="parameter_description"><p><code class="literal">TRUE</code> if this presence status is accompanied by an
optional human-readable message</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="tp-presence-status-spec-new.returns"></a><h4>Returns</h4>
<p>a new <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec"><span class="type">TpPresenceStatusSpec</span></a>. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: 0.23.1</p>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-status-spec-copy"></a><h3>tp_presence_status_spec_copy ()</h3>
<pre class="programlisting"><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec"><span class="returnvalue">TpPresenceStatusSpec</span></a> *
tp_presence_status_spec_copy (<em class="parameter"><code>const <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec"><span class="type">TpPresenceStatusSpec</span></a> *self</code></em>);</pre>
<p>Copy a presence status specification.</p>
<p>If <em class="parameter"><code>self</code></em>
has optional arguments other than a string named "message",
they are not copied. Optional arguments with other names or types
are deprecated.</p>
<div class="refsect3">
<a name="tp-presence-status-spec-copy.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a presence status specification</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="tp-presence-status-spec-copy.returns"></a><h4>Returns</h4>
<p>a new <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec"><span class="type">TpPresenceStatusSpec</span></a> resembling <em class="parameter"><code>self</code></em>
. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: 0.23.1</p>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-status-spec-free"></a><h3>tp_presence_status_spec_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
tp_presence_status_spec_free (<em class="parameter"><code><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec"><span class="type">TpPresenceStatusSpec</span></a> *self</code></em>);</pre>
<p>Free a presence status specification produced by
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-status-spec-new" title="tp_presence_status_spec_new ()"><code class="function">tp_presence_status_spec_new()</code></a> or <a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-status-spec-copy" title="tp_presence_status_spec_copy ()"><code class="function">tp_presence_status_spec_copy()</code></a>.</p>
<div class="refsect3">
<a name="tp-presence-status-spec-free.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a presence status specification. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: 0.23.1</p>
</div>
<hr>
<div class="refsect2">
<a name="TpPresenceMixinStatusAvailableFunc"></a><h3>TpPresenceMixinStatusAvailableFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
<span class="c_punctuation">(</span>*TpPresenceMixinStatusAvailableFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><span class="type">GObject</span> *obj</code></em>,
<em class="parameter"><code><span class="type">guint</span> which</code></em>);</pre>
<p>Signature of a callback to be used to determine if a given presence
status can be set on the connection. Most users of this mixin do not need to
supply an implementation of this callback: the value of
<span class="type">TpPresenceStatusSpec.self</span> is enough to determine whether this is a
user-settable presence, so <code class="literal">NULL</code> should be passed to
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-class-init" title="tp_presence_mixin_class_init ()"><code class="function">tp_presence_mixin_class_init()</code></a> for this callback.</p>
<p>One place where this callback may be needed is on XMPP: not all server
implementation support the user becoming invisible. So an XMPP
implementation would implement this function, so that—once connected—the
hidden status is only available if the server supports it. Before the
connection is connected, this callback should return <code class="literal">TRUE</code> for every status
that might possibly be supported: this allows the user to at least try to
sign in as invisible.</p>
<div class="refsect3">
<a name="TpPresenceMixinStatusAvailableFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>obj</p></td>
<td class="parameter_description"><p>An instance of a <a class="link" href="TpBaseConnection.html" title="TpBaseConnection"><span class="type">TpBaseConnection</span></a> subclass implementing the presence
interface with this mixin</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>which</p></td>
<td class="parameter_description"><p>An index into the array of <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec"><span class="type">TpPresenceStatusSpec</span></a> provided to
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-class-init" title="tp_presence_mixin_class_init ()"><code class="function">tp_presence_mixin_class_init()</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="TpPresenceMixinStatusAvailableFunc.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the status can be set on this connection; <code class="literal">FALSE</code> if not.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="TpPresenceMixinGetContactStatusesFunc"></a><h3>TpPresenceMixinGetContactStatusesFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">GHashTable</span> *
<span class="c_punctuation">(</span>*TpPresenceMixinGetContactStatusesFunc<span class="c_punctuation">)</span>
(<em class="parameter"><code><span class="type">GObject</span> *obj</code></em>,
<em class="parameter"><code>const <span class="type">GArray</span> *contacts</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Signature of the callback used to get the stored presence status of
contacts. The returned hash table should have contact handles mapped to
their respective presence statuses in <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatus" title="struct TpPresenceStatus"><span class="type">TpPresenceStatus</span></a> structs.</p>
<p>The returned hash table will be freed with g_hash_table_unref. The
callback is responsible for ensuring that this does any cleanup that
may be necessary.</p>
<div class="refsect3">
<a name="TpPresenceMixinGetContactStatusesFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>obj</p></td>
<td class="parameter_description"><p>An object with this mixin.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>contacts</p></td>
<td class="parameter_description"><p>An array of <a class="link" href="telepathy-glib-handle.html#TpHandle" title="TpHandle"><span class="type">TpHandle</span></a> for the contacts to get presence status for</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>Used to return a Telepathy D-Bus error if <code class="literal">NULL</code> is returned</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="TpPresenceMixinGetContactStatusesFunc.returns"></a><h4>Returns</h4>
<p>The contact presence on success, <code class="literal">NULL</code> with
error set on error. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="TpPresenceMixinSetOwnStatusFunc"></a><h3>TpPresenceMixinSetOwnStatusFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
<span class="c_punctuation">(</span>*TpPresenceMixinSetOwnStatusFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><span class="type">GObject</span> *obj</code></em>,
<em class="parameter"><code>const <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatus" title="struct TpPresenceStatus"><span class="type">TpPresenceStatus</span></a> *status</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Signature of the callback used to commit changes to the user's own presence
status in SetStatuses. It is also used in ClearStatus and RemoveStatus to
reset the user's own status back to the "default" one with a <code class="literal">NULL</code> status
argument.</p>
<p>The optional_arguments hash table in <em class="parameter"><code>status</code></em>
, if not NULL, will have been
filtered so it only contains recognised parameters, so the callback
need not (and cannot) check for unrecognised parameters. However, the
types of the parameters are not currently checked, so the callback is
responsible for doing so.</p>
<p>The callback is responsible for emitting PresenceUpdate, if appropriate,
by calling <a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-emit-presence-update" title="tp_presence_mixin_emit_presence_update ()"><code class="function">tp_presence_mixin_emit_presence_update()</code></a>.</p>
<div class="refsect3">
<a name="TpPresenceMixinSetOwnStatusFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>obj</p></td>
<td class="parameter_description"><p>An object with this mixin.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>status</p></td>
<td class="parameter_description"><p>The status to set, or NULL for whatever the protocol defines as a
"default" status</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>Used to return a Telepathy D-Bus error if <code class="literal">FALSE</code> is returned</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="TpPresenceMixinSetOwnStatusFunc.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the operation was successful, <code class="literal">FALSE</code> if not.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="TpPresenceMixinGetMaximumStatusMessageLengthFunc"></a><h3>TpPresenceMixinGetMaximumStatusMessageLengthFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">guint</span>
<span class="c_punctuation">(</span>*TpPresenceMixinGetMaximumStatusMessageLengthFunc<span class="c_punctuation">)</span>
(<em class="parameter"><code><span class="type">GObject</span> *obj</code></em>);</pre>
<p>Signature of a callback used to determine the maximum length of status
messages. If this callback is provided and returns non-zero, the
<a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixinSetOwnStatusFunc" title="TpPresenceMixinSetOwnStatusFunc ()"><span class="type">TpPresenceMixinSetOwnStatusFunc</span></a> implementation is responsible for
truncating the message to fit this limit, if necessary.</p>
<div class="refsect3">
<a name="TpPresenceMixinGetMaximumStatusMessageLengthFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>obj</p></td>
<td class="parameter_description"><p>An object with this mixin.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="TpPresenceMixinGetMaximumStatusMessageLengthFunc.returns"></a><h4>Returns</h4>
<p> the maximum number of UTF-8 characters which may appear in a status
message, or 0 if there is no limit.</p>
</div>
<p class="since">Since: 0.14.5</p>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-status-new"></a><h3>tp_presence_status_new ()</h3>
<pre class="programlisting"><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatus" title="struct TpPresenceStatus"><span class="returnvalue">TpPresenceStatus</span></a> *
tp_presence_status_new (<em class="parameter"><code><span class="type">guint</span> which</code></em>,
<em class="parameter"><code><span class="type">GHashTable</span> *optional_arguments</code></em>);</pre>
<p>Construct a presence status structure. You should free the returned
structure with <a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-status-free" title="tp_presence_status_free ()"><span class="type">tp_presence_status_free</span></a>.</p>
<p>In modern Telepathy connection managers, the only optional
argument should be a <code class="literal">G_TYPE_STRING</code> named "message", on statuses
that have an optional human-readable message. All other optional arguments
are deprecated.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="tp-presence-status-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>which</p></td>
<td class="parameter_description"><p>Index of the presence status in the provided supported presence
statuses array</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>optional_arguments</p></td>
<td class="parameter_description"><p>Optional arguments for the presence statuses. Can be
NULL if there are no optional arguments. The presence status object makes a
copy of the hashtable, so you should free the original.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="tp-presence-status-new.returns"></a><h4>Returns</h4>
<p> A pointer to the newly allocated presence status structure.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-status-free"></a><h3>tp_presence_status_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
tp_presence_status_free (<em class="parameter"><code><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatus" title="struct TpPresenceStatus"><span class="type">TpPresenceStatus</span></a> *status</code></em>);</pre>
<p>Deallocate all resources associated with a presence status structure.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="tp-presence-status-free.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>status</p></td>
<td class="parameter_description"><p>A pointer to the presence status structure to free.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-mixin-class-init"></a><h3>tp_presence_mixin_class_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
tp_presence_mixin_class_init (<em class="parameter"><code><span class="type">GObjectClass</span> *obj_cls</code></em>,
<em class="parameter"><code><span class="type">glong</span> offset</code></em>,
<em class="parameter"><code><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixinStatusAvailableFunc" title="TpPresenceMixinStatusAvailableFunc ()"><span class="type">TpPresenceMixinStatusAvailableFunc</span></a> status_available</code></em>,
<em class="parameter"><code><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixinGetContactStatusesFunc" title="TpPresenceMixinGetContactStatusesFunc ()"><span class="type">TpPresenceMixinGetContactStatusesFunc</span></a> get_contact_statuses</code></em>,
<em class="parameter"><code><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixinSetOwnStatusFunc" title="TpPresenceMixinSetOwnStatusFunc ()"><span class="type">TpPresenceMixinSetOwnStatusFunc</span></a> set_own_status</code></em>,
<em class="parameter"><code>const <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec"><span class="type">TpPresenceStatusSpec</span></a> *statuses</code></em>);</pre>
<p>Initialize the presence mixin. Should be called from the implementation's
class_init function like so:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="n">tp_presence_mixin_class_init</span> <span class="p">((</span><span class="n">GObjectClass</span> <span class="o">*</span><span class="p">)</span> <span class="n">klass</span><span class="p">,</span>
<span class="n">G_STRUCT_OFFSET</span> <span class="p">(</span><span class="n">SomeObjectClass</span><span class="p">,</span>
<span class="n">presence_mixin</span><span class="p">));</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="tp-presence-mixin-class-init.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>obj_cls</p></td>
<td class="parameter_description"><p>The class of the implementation that uses this mixin</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>offset</p></td>
<td class="parameter_description"><p>The byte offset of the TpPresenceMixinClass within the class
structure</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>status_available</p></td>
<td class="parameter_description"><p>A callback to be used to determine if a given presence
status can be set on a particular connection. Should usually be <code class="literal">NULL</code>, to
consider all statuses with <span class="type">TpPresenceStatusSpec.self</span> set to <code class="literal">TRUE</code> to be
settable.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>get_contact_statuses</p></td>
<td class="parameter_description"><p>A callback to be used get the current presence status
for contacts. This is used in implementations of various D-Bus methods and
hence must be provided.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>set_own_status</p></td>
<td class="parameter_description"><p>A callback to be used to commit changes to the user's own
presence status to the server. This is used in implementations of various
D-Bus methods and hence must be provided.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>statuses</p></td>
<td class="parameter_description"><p>An array of <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec"><span class="type">TpPresenceStatusSpec</span></a> structures representing all
presence statuses supported by the protocol, terminated by a NULL name.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-mixin-init"></a><h3>tp_presence_mixin_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
tp_presence_mixin_init (<em class="parameter"><code><span class="type">GObject</span> *obj</code></em>,
<em class="parameter"><code><span class="type">glong</span> offset</code></em>);</pre>
<p>Initialize the presence mixin. Should be called from the implementation's
instance init function like so:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="n">tp_presence_mixin_init</span> <span class="p">((</span><span class="n">GObject</span> <span class="o">*</span><span class="p">)</span> <span class="n">self</span><span class="p">,</span>
<span class="n">G_STRUCT_OFFSET</span> <span class="p">(</span><span class="n">SomeObject</span><span class="p">,</span> <span class="n">presence_mixin</span><span class="p">));</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="tp-presence-mixin-init.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>obj</p></td>
<td class="parameter_description"><p>An instance of the implementation that uses this mixin</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>offset</p></td>
<td class="parameter_description"><p>The byte offset of the TpPresenceMixin within the object structure</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-mixin-finalize"></a><h3>tp_presence_mixin_finalize ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
tp_presence_mixin_finalize (<em class="parameter"><code><span class="type">GObject</span> *obj</code></em>);</pre>
<p>Free resources held by the presence mixin.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="tp-presence-mixin-finalize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>obj</p></td>
<td class="parameter_description"><p>An object with this mixin.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-mixin-emit-presence-update"></a><h3>tp_presence_mixin_emit_presence_update ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
tp_presence_mixin_emit_presence_update
(<em class="parameter"><code><span class="type">GObject</span> *obj</code></em>,
<em class="parameter"><code><span class="type">GHashTable</span> *contact_presences</code></em>);</pre>
<p>Emit the PresenceUpdate signal for multiple contacts. For emitting
PresenceUpdate for a single contact, there is a convenience wrapper called
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-emit-one-presence-update" title="tp_presence_mixin_emit_one_presence_update ()"><span class="type">tp_presence_mixin_emit_one_presence_update</span></a>.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="tp-presence-mixin-emit-presence-update.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>obj</p></td>
<td class="parameter_description"><p>A connection object with this mixin</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>contact_presences</p></td>
<td class="parameter_description"><p>A mapping of contact handles to <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatus" title="struct TpPresenceStatus"><span class="type">TpPresenceStatus</span></a>
structures with the presence data to emit</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-mixin-emit-one-presence-update"></a><h3>tp_presence_mixin_emit_one_presence_update ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
tp_presence_mixin_emit_one_presence_update
(<em class="parameter"><code><span class="type">GObject</span> *obj</code></em>,
<em class="parameter"><code><a class="link" href="telepathy-glib-handle.html#TpHandle" title="TpHandle"><span class="type">TpHandle</span></a> handle</code></em>,
<em class="parameter"><code>const <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatus" title="struct TpPresenceStatus"><span class="type">TpPresenceStatus</span></a> *status</code></em>);</pre>
<p>Emit the PresenceUpdate signal for a single contact. This method is just a
convenience wrapper around <a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-emit-presence-update" title="tp_presence_mixin_emit_presence_update ()"><span class="type">tp_presence_mixin_emit_presence_update</span></a>.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="tp-presence-mixin-emit-one-presence-update.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>obj</p></td>
<td class="parameter_description"><p>A connection object with this mixin</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>handle</p></td>
<td class="parameter_description"><p>The handle of the contact to emit the signal for</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>status</p></td>
<td class="parameter_description"><p>The new status to emit</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-mixin-iface-init"></a><h3>tp_presence_mixin_iface_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
tp_presence_mixin_iface_init (<em class="parameter"><code><span class="type">gpointer</span> g_iface</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> iface_data</code></em>);</pre>
<p>Fill in the vtable entries needed to implement the presence interface using
this mixin. This function should usually be called via G_IMPLEMENT_INTERFACE.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="tp-presence-mixin-iface-init.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>g_iface</p></td>
<td class="parameter_description"><p>A pointer to the <a class="link" href="telepathy-glib-svc-connection.html#TpSvcConnectionInterfacePresenceClass" title="TpSvcConnectionInterfacePresenceClass"><span class="type">TpSvcConnectionInterfacePresenceClass</span></a> in an
object class</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>iface_data</p></td>
<td class="parameter_description"><p>Ignored</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-mixin-simple-presence-iface-init"></a><h3>tp_presence_mixin_simple_presence_iface_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
tp_presence_mixin_simple_presence_iface_init
(<em class="parameter"><code><span class="type">gpointer</span> g_iface</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> iface_data</code></em>);</pre>
<p>Fill in the vtable entries needed to implement the simple presence interface
using this mixin. This function should usually be called via
G_IMPLEMENT_INTERFACE.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="tp-presence-mixin-simple-presence-iface-init.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>g_iface</p></td>
<td class="parameter_description"><p>A pointer to the <a class="link" href="telepathy-glib-svc-connection.html#TpSvcConnectionInterfaceSimplePresenceClass" title="TpSvcConnectionInterfaceSimplePresenceClass"><span class="type">TpSvcConnectionInterfaceSimplePresenceClass</span></a> in
an object class</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>iface_data</p></td>
<td class="parameter_description"><p>Ignored</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 0.7.13</p>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-mixin-simple-presence-init-dbus-properties"></a><h3>tp_presence_mixin_simple_presence_init_dbus_properties ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
tp_presence_mixin_simple_presence_init_dbus_properties
(<em class="parameter"><code><span class="type">GObjectClass</span> *cls</code></em>);</pre>
<p>Set up <a class="link" href="telepathy-glib-dbus-properties-mixin.html#TpDBusPropertiesMixinClass" title="TpDBusPropertiesMixinClass"><span class="type">TpDBusPropertiesMixinClass</span></a> to use this mixin's implementation of
the SimplePresence interface's properties.</p>
<p>This automatically sets up a list of the supported properties for the
SimplePresence interface.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="tp-presence-mixin-simple-presence-init-dbus-properties.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>cls</p></td>
<td class="parameter_description"><p>The class of an object with this mixin</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: 0.7.13</p>
</div>
<hr>
<div class="refsect2">
<a name="tp-presence-mixin-simple-presence-register-with-contacts-mixin"></a><h3>tp_presence_mixin_simple_presence_register_with_contacts_mixin ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
tp_presence_mixin_simple_presence_register_with_contacts_mixin
(<em class="parameter"><code><span class="type">GObject</span> *obj</code></em>);</pre>
<p>Register the SimplePresence interface with the Contacts interface to make it
inspectable. The Contacts mixin should be initialized before this function
is called</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="tp-presence-mixin-simple-presence-register-with-contacts-mixin.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>obj</p></td>
<td class="parameter_description"><p>An instance that of the implementation that uses both the Contacts
mixin and this mixin</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="telepathy-glib-TpPresenceMixin.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="TpPresenceStatusOptionalArgumentSpec"></a><h3>struct TpPresenceStatusOptionalArgumentSpec</h3>
<pre class="programlisting">struct TpPresenceStatusOptionalArgumentSpec {
const gchar *name;
const gchar *dtype;
};
</pre>
<p>Structure specifying a supported optional argument for a presence status.</p>
<p>In addition to the fields documented here, there are two gpointer fields
which must currently be <code class="literal">NULL</code>. A meaning may be defined for these in a
future version of telepathy-glib.</p>
<div class="refsect3">
<a name="TpPresenceStatusOptionalArgumentSpec.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p>const <span class="type">gchar</span> *<em class="structfield"><code><a name="TpPresenceStatusOptionalArgumentSpec.name"></a>name</code></em>;</p></td>
<td class="struct_member_description"><p>Name of the argument as passed over D-Bus</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p>const <span class="type">gchar</span> *<em class="structfield"><code><a name="TpPresenceStatusOptionalArgumentSpec.dtype"></a>dtype</code></em>;</p></td>
<td class="struct_member_description"><p>D-Bus type signature of the argument</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="TpPresenceStatusSpec-struct"></a><h3>struct TpPresenceStatusSpec</h3>
<pre class="programlisting">struct TpPresenceStatusSpec {
const gchar *name;
TpConnectionPresenceType presence_type;
gboolean self;
const TpPresenceStatusOptionalArgumentSpec *optional_arguments;
};
</pre>
<p>Structure specifying a supported presence status.</p>
<p>In addition to the fields documented here, there are two gpointer fields
which must currently be <code class="literal">NULL</code>. A meaning may be defined for these in a
future version of telepathy-glib.</p>
<div class="refsect3">
<a name="TpPresenceStatusSpec.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p>const <span class="type">gchar</span> *<em class="structfield"><code><a name="TpPresenceStatusSpec-struct.name"></a>name</code></em>;</p></td>
<td class="struct_member_description"><p>String identifier of the presence status</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="telepathy-glib-enums.html#TpConnectionPresenceType" title="enum TpConnectionPresenceType"><span class="type">TpConnectionPresenceType</span></a> <em class="structfield"><code><a name="TpPresenceStatusSpec-struct.presence-type"></a>presence_type</code></em>;</p></td>
<td class="struct_member_description"><p>A type value, as specified by <a class="link" href="telepathy-glib-enums.html#TpConnectionPresenceType" title="enum TpConnectionPresenceType"><span class="type">TpConnectionPresenceType</span></a></p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">gboolean</span> <em class="structfield"><code><a name="TpPresenceStatusSpec-struct.self"></a>self</code></em>;</p></td>
<td class="struct_member_description"><p>Indicates if this status may be set on yourself</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p>const <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusOptionalArgumentSpec" title="struct TpPresenceStatusOptionalArgumentSpec"><span class="type">TpPresenceStatusOptionalArgumentSpec</span></a> *<em class="structfield"><code><a name="TpPresenceStatusSpec-struct.optional-arguments"></a>optional_arguments</code></em>;</p></td>
<td class="struct_member_description"><p>An array of <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusOptionalArgumentSpec" title="struct TpPresenceStatusOptionalArgumentSpec"><span class="type">TpPresenceStatusOptionalArgumentSpec</span></a>
structures representing the optional arguments for this status, terminated
by a NULL name. If there are no optional arguments for a status, this can
be NULL. In modern Telepathy connection managers, the only optional
argument should be a string (type "s") named "message" on statuses
that have an optional human-readable message. All other optional arguments
are deprecated.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="TpPresenceStatus"></a><h3>struct TpPresenceStatus</h3>
<pre class="programlisting">struct TpPresenceStatus {
guint index;
GHashTable *optional_arguments;
};
</pre>
<p>Structure representing a presence status.</p>
<p>In addition to the fields documented here, there are two gpointer fields
which must currently be <code class="literal">NULL</code>. A meaning may be defined for these in a
future version of telepathy-glib.</p>
<p>In modern Telepathy connection managers, the only optional
argument should be a <code class="literal">G_TYPE_STRING</code> named "message", on statuses
that have an optional human-readable message. All other optional arguments
are deprecated.</p>
<div class="refsect3">
<a name="TpPresenceStatus.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><span class="type">guint</span> <em class="structfield"><code><a name="TpPresenceStatus.index"></a>index</code></em>;</p></td>
<td class="struct_member_description"><p>Index of the presence status in the provided supported presence
statuses array</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">GHashTable</span> *<em class="structfield"><code><a name="TpPresenceStatus.optional-arguments"></a>optional_arguments</code></em>;</p></td>
<td class="struct_member_description"><p>A GHashTable mapping of string identifiers to GValues
of the optional status arguments, if any. If there are no optional
arguments, this pointer may be NULL.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="TpPresenceMixin"></a><h3>struct TpPresenceMixin</h3>
<pre class="programlisting">struct TpPresenceMixin {
};
</pre>
<p>Structure to be included in the instance structure of objects that
use this mixin. Initialize it with <a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-init" title="tp_presence_mixin_init ()"><code class="function">tp_presence_mixin_init()</code></a>.</p>
<p>There are no public fields.</p>
</div>
<hr>
<div class="refsect2">
<a name="TpPresenceMixinClass"></a><h3>struct TpPresenceMixinClass</h3>
<pre class="programlisting">struct TpPresenceMixinClass {
TpPresenceMixinStatusAvailableFunc status_available;
TpPresenceMixinGetContactStatusesFunc get_contact_statuses;
TpPresenceMixinSetOwnStatusFunc set_own_status;
const TpPresenceStatusSpec *statuses;
TpPresenceMixinGetMaximumStatusMessageLengthFunc get_maximum_status_message_length;
};
</pre>
<p>Structure to be included in the class structure of objects that
use this mixin. Initialize it with <a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-class-init" title="tp_presence_mixin_class_init ()"><code class="function">tp_presence_mixin_class_init()</code></a>.</p>
<p>If the protocol imposes a limit on the length of status messages, one should
implement <em class="parameter"><code>get_maximum_status_message_length</code></em>
. If this callback is not
implemented, it is assumed that there is no limit. The callback function
should be set after calling <a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-class-init" title="tp_presence_mixin_class_init ()"><code class="function">tp_presence_mixin_class_init()</code></a>, like so:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="n">TpPresenceMixinClass</span> <span class="o">*</span><span class="n">mixin_class</span><span class="p">;</span>
<span class="n">tp_presence_mixin_class_init</span> <span class="p">((</span><span class="n">GObjectClass</span> <span class="o">*</span><span class="p">)</span> <span class="n">klass</span><span class="p">,</span>
<span class="n">G_STRUCT_OFFSET</span> <span class="p">(</span><span class="n">SomeObjectClass</span><span class="p">,</span> <span class="n">presence_mixin</span><span class="p">));</span>
<span class="n">mixin_class</span> <span class="o">=</span> <span class="n">TP_PRESENCE_MIXIN_CLASS</span> <span class="p">(</span><span class="n">klass</span><span class="p">);</span>
<span class="n">mixin_class</span><span class="o">-></span><span class="n">get_maximum_status_message_length</span> <span class="o">=</span>
<span class="n">some_object_get_maximum_status_message_length</span><span class="p">;</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>All other fields should be considered read-only.</p>
<div class="refsect3">
<a name="TpPresenceMixinClass.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixinStatusAvailableFunc" title="TpPresenceMixinStatusAvailableFunc ()"><span class="type">TpPresenceMixinStatusAvailableFunc</span></a> <em class="structfield"><code><a name="TpPresenceMixinClass.status-available"></a>status_available</code></em>;</p></td>
<td class="struct_member_description"><p>The status-available function that was passed to
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-class-init" title="tp_presence_mixin_class_init ()"><code class="function">tp_presence_mixin_class_init()</code></a></p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixinGetContactStatusesFunc" title="TpPresenceMixinGetContactStatusesFunc ()"><span class="type">TpPresenceMixinGetContactStatusesFunc</span></a> <em class="structfield"><code><a name="TpPresenceMixinClass.get-contact-statuses"></a>get_contact_statuses</code></em>;</p></td>
<td class="struct_member_description"><p>The get-contact-statuses function that was passed to
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-class-init" title="tp_presence_mixin_class_init ()"><code class="function">tp_presence_mixin_class_init()</code></a></p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixinSetOwnStatusFunc" title="TpPresenceMixinSetOwnStatusFunc ()"><span class="type">TpPresenceMixinSetOwnStatusFunc</span></a> <em class="structfield"><code><a name="TpPresenceMixinClass.set-own-status"></a>set_own_status</code></em>;</p></td>
<td class="struct_member_description"><p>The set-own-status function that was passed to
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-class-init" title="tp_presence_mixin_class_init ()"><code class="function">tp_presence_mixin_class_init()</code></a></p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p>const <a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceStatusSpec"><span class="type">TpPresenceStatusSpec</span></a> *<em class="structfield"><code><a name="TpPresenceMixinClass.statuses"></a>statuses</code></em>;</p></td>
<td class="struct_member_description"><p>The presence statuses array that was passed to
<a class="link" href="telepathy-glib-TpPresenceMixin.html#tp-presence-mixin-class-init" title="tp_presence_mixin_class_init ()"><code class="function">tp_presence_mixin_class_init()</code></a></p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="telepathy-glib-TpPresenceMixin.html#TpPresenceMixinGetMaximumStatusMessageLengthFunc" title="TpPresenceMixinGetMaximumStatusMessageLengthFunc ()"><span class="type">TpPresenceMixinGetMaximumStatusMessageLengthFunc</span></a> <em class="structfield"><code><a name="TpPresenceMixinClass.get-maximum-status-message-length"></a>get_maximum_status_message_length</code></em>;</p></td>
<td class="struct_member_description"><p>The callback used to discover the
the limit for status messages length, if any. Since: 0.14.5</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="telepathy-glib-TpPresenceMixin.see-also"></a><h2>See Also</h2>
<p><a class="link" href="telepathy-glib-svc-connection.html#TpSvcConnectionInterfacePresence"><span class="type">TpSvcConnectionInterfacePresence</span></a></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.32</div>
</body>
</html>
|