109 | 109 |
enum {
|
110 | 110 |
PROP_ACCOUNT = 1,
|
111 | 111 |
PROP_REQUEST,
|
|
112 |
PROP_REQUEST_VARDICT,
|
112 | 113 |
PROP_USER_ACTION_TIME,
|
113 | 114 |
PROP_CHANNEL_REQUEST,
|
114 | 115 |
N_PROPS
|
|
243 | 244 |
g_value_set_boxed (value, self->priv->request);
|
244 | 245 |
break;
|
245 | 246 |
|
|
247 |
case PROP_REQUEST_VARDICT:
|
|
248 |
g_value_take_variant (value,
|
|
249 |
tp_account_channel_request_dup_request (self));
|
|
250 |
break;
|
|
251 |
|
246 | 252 |
case PROP_USER_ACTION_TIME:
|
247 | 253 |
g_value_set_int64 (value, self->priv->user_action_time);
|
248 | 254 |
break;
|
|
273 | 279 |
break;
|
274 | 280 |
|
275 | 281 |
case PROP_REQUEST:
|
|
282 |
/* If this property remains unset, GObject will set it to a NULL
|
|
283 |
* value. Ignore that, so request-vardict can be set instead. */
|
|
284 |
if (g_value_get_boxed (value) == NULL)
|
|
285 |
return;
|
|
286 |
|
|
287 |
/* Construct-only and mutually exclusive with request-vardict */
|
|
288 |
g_return_if_fail (self->priv->request == NULL);
|
|
289 |
|
276 | 290 |
/* We do not use tp_asv_new() and friends, because in principle,
|
277 | 291 |
* the request can contain user-defined keys. */
|
278 | 292 |
self->priv->request = g_hash_table_new_full (g_str_hash, g_str_equal,
|
|
283 | 297 |
(GBoxedCopyFunc) tp_g_value_slice_dup);
|
284 | 298 |
break;
|
285 | 299 |
|
|
300 |
case PROP_REQUEST_VARDICT:
|
|
301 |
{
|
|
302 |
GHashTable *hash;
|
|
303 |
|
|
304 |
/* If this property remains unset, GObject will set it to a NULL
|
|
305 |
* value. Ignore that, so request can be set instead. */
|
|
306 |
if (g_value_get_variant (value) == NULL)
|
|
307 |
return;
|
|
308 |
|
|
309 |
/* Construct-only and mutually exclusive with request */
|
|
310 |
g_return_if_fail (self->priv->request == NULL);
|
|
311 |
|
|
312 |
hash = _tp_asv_from_vardict (g_value_get_variant (value));
|
|
313 |
self->priv->request = g_hash_table_new_full (g_str_hash,
|
|
314 |
g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free);
|
|
315 |
|
|
316 |
tp_g_hash_table_update (self->priv->request,
|
|
317 |
hash, (GBoxedCopyFunc) g_strdup,
|
|
318 |
(GBoxedCopyFunc) tp_g_value_slice_dup);
|
|
319 |
g_hash_table_unref (hash);
|
|
320 |
}
|
|
321 |
break;
|
|
322 |
|
286 | 323 |
case PROP_USER_ACTION_TIME:
|
287 | 324 |
self->priv->user_action_time = g_value_get_int64 (value);
|
288 | 325 |
break;
|
|
349 | 386 |
* The desired D-Bus properties for the channel, represented as a
|
350 | 387 |
* #GHashTable where the keys are strings and the values are #GValue.
|
351 | 388 |
*
|
352 | |
* This property can't be %NULL.
|
|
389 |
* When constructing a new object, one of
|
|
390 |
* #TpAccountChannelRequest:request or
|
|
391 |
* #TpAccountChannelRequest:request-vardict must be set to a non-%NULL
|
|
392 |
* value, and the other must remain unspecified.
|
353 | 393 |
*
|
354 | 394 |
* Since: 0.11.12
|
355 | 395 |
*/
|
|
358 | 398 |
TP_HASH_TYPE_STRING_VARIANT_MAP,
|
359 | 399 |
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
|
360 | 400 |
g_object_class_install_property (object_class, PROP_REQUEST,
|
|
401 |
param_spec);
|
|
402 |
|
|
403 |
/**
|
|
404 |
* TpAccountChannelRequest:request-vardict:
|
|
405 |
*
|
|
406 |
* The desired D-Bus properties for the channel.
|
|
407 |
*
|
|
408 |
* When constructing a new object, one of
|
|
409 |
* #TpAccountChannelRequest:request or
|
|
410 |
* #TpAccountChannelRequest:request-vardict must be set to a non-%NULL
|
|
411 |
* value, and the other must remain unspecified.
|
|
412 |
*
|
|
413 |
* Since: 0.UNRELEASED
|
|
414 |
*/
|
|
415 |
param_spec = g_param_spec_variant ("request-vardict", "Request",
|
|
416 |
"A dictionary containing desirable properties for the channel",
|
|
417 |
G_VARIANT_TYPE_VARDICT, NULL,
|
|
418 |
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
|
|
419 |
g_object_class_install_property (object_class, PROP_REQUEST_VARDICT,
|
361 | 420 |
param_spec);
|
362 | 421 |
|
363 | 422 |
/**
|
|
518 | 577 |
GVariant *request,
|
519 | 578 |
gint64 user_action_time)
|
520 | 579 |
{
|
521 | |
GHashTable *hash;
|
522 | 580 |
TpAccountChannelRequest *ret;
|
523 | 581 |
|
524 | 582 |
g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL);
|
|
527 | 585 |
NULL);
|
528 | 586 |
|
529 | 587 |
g_variant_ref_sink (request);
|
530 | |
hash = _tp_asv_from_vardict (request);
|
531 | |
g_variant_unref (request);
|
532 | 588 |
|
533 | 589 |
ret = g_object_new (TP_TYPE_ACCOUNT_CHANNEL_REQUEST,
|
534 | 590 |
"account", account,
|
535 | |
"request", hash,
|
|
591 |
"request-vardict", request,
|
536 | 592 |
"user-action-time", user_action_time,
|
537 | 593 |
NULL);
|
538 | |
g_hash_table_unref (hash);
|
|
594 |
g_variant_unref (request);
|
539 | 595 |
return ret;
|
540 | 596 |
}
|
541 | 597 |
|
|
571 | 627 |
TpAccountChannelRequest *self)
|
572 | 628 |
{
|
573 | 629 |
return self->priv->request;
|
|
630 |
}
|
|
631 |
|
|
632 |
/**
|
|
633 |
* tp_account_channel_request_dup_request:
|
|
634 |
* @self: a #TpAccountChannelRequest
|
|
635 |
*
|
|
636 |
* Return the #TpAccountChannelRequest:request-vardict construct-only
|
|
637 |
* property.
|
|
638 |
*
|
|
639 |
* Returns: (transfer full): the value of
|
|
640 |
* #TpAccountChannelRequest:request-vardict
|
|
641 |
*
|
|
642 |
* Since: 0.11.UNRELEASED
|
|
643 |
*/
|
|
644 |
GVariant *
|
|
645 |
tp_account_channel_request_dup_request (
|
|
646 |
TpAccountChannelRequest *self)
|
|
647 |
{
|
|
648 |
g_return_val_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self), NULL);
|
|
649 |
|
|
650 |
return _tp_asv_to_vardict (self->priv->request);
|
574 | 651 |
}
|
575 | 652 |
|
576 | 653 |
/**
|