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
|
/*
* This file is part of gtkD.
*
* gtkD 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 3
* of the License, or (at your option) any later version, with
* some exceptions, please read the COPYING file.
*
* gtkD 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 gtkD; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
module secret.Collection;
private import gio.AsyncInitableIF;
private import gio.AsyncInitableT;
private import gio.AsyncResultIF;
private import gio.Cancellable;
private import gio.DBusInterfaceIF;
private import gio.DBusInterfaceT;
private import gio.DBusProxy;
private import gio.InitableIF;
private import gio.InitableT;
private import glib.ConstructionException;
private import glib.ErrorG;
private import glib.GException;
private import glib.HashTable;
private import glib.ListG;
private import glib.Str;
private import gobject.ObjectG;
private import secret.Schema;
private import secret.Service;
private import secretc.secret;
public import secretc.secrettypes;
/**
* A proxy object representing a collection of secrets in the Secret Service.
*/
public class Collection : DBusProxy
{
/** the main Gtk struct */
protected SecretCollection* secretCollection;
/** Get the main Gtk struct */
public SecretCollection* getCollectionStruct()
{
return secretCollection;
}
/** the main Gtk struct as a void* */
protected override void* getStruct()
{
return cast(void*)secretCollection;
}
/**
* Sets our main struct and passes it to the parent class.
*/
public this (SecretCollection* secretCollection, bool ownedRef = false)
{
this.secretCollection = secretCollection;
super(cast(GDBusProxy*)secretCollection, ownedRef);
}
/** */
public static GType getType()
{
return secret_collection_get_type();
}
/**
* Finish asynchronous operation to get a new collection proxy for a
* collection in the secret service.
*
* Params:
* result = the asynchronous result passed to the callback
*
* Return: the new collection, which should be unreferenced
* with g_object_unref()
*
* Throws: GException on failure.
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this(AsyncResultIF result)
{
GError* err = null;
auto p = secret_collection_new_for_dbus_path_finish((result is null) ? null : result.getAsyncResultStruct(), &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
if(p is null)
{
throw new ConstructionException("null returned by new_for_dbus_path_finish");
}
this(cast(SecretCollection*) p, true);
}
/**
* Get a new collection proxy for a collection in the secret service.
*
* If @service is NULL, then secret_service_get_sync() will be called to get
* the default #SecretService proxy.
*
* This method may block indefinitely and should not be used in user interface
* threads.
*
* Params:
* service = a secret service object
* collectionPath = the D-Bus path of the collection
* flags = options for the collection initialization
* cancellable = optional cancellation object
*
* Return: the new collection, which should be unreferenced
* with g_object_unref()
*
* Throws: GException on failure.
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this(Service service, string collectionPath, SecretCollectionFlags flags, Cancellable cancellable)
{
GError* err = null;
auto p = secret_collection_new_for_dbus_path_sync((service is null) ? null : service.getServiceStruct(), Str.toStringz(collectionPath), flags, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
if(p is null)
{
throw new ConstructionException("null returned by new_for_dbus_path_sync");
}
this(cast(SecretCollection*) p, true);
}
/**
* Create a new collection in the secret service.
*
* This method returns immediately and completes asynchronously. The secret
* service may prompt the user. secret_service_prompt() will be used to handle
* any prompts that are required.
*
* An @alias is a well-known tag for a collection, such as 'default' (ie: the
* default collection to store items in). This allows other applications to
* easily identify and share a collection. If you specify an @alias, and a
* collection with that alias already exists, then a new collection will not
* be created. The previous one will be returned instead.
*
* If @service is NULL, then secret_service_get() will be called to get
* the default #SecretService proxy.
*
* Params:
* service = a secret service object
* label = label for the new collection
* alias_ = alias to assign to the collection
* flags = currently unused
* cancellable = optional cancellation object
* callback = called when the operation completes
* userData = data to pass to the callback
*/
public static void create(Service service, string label, string alias_, SecretCollectionCreateFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
{
secret_collection_create((service is null) ? null : service.getServiceStruct(), Str.toStringz(label), Str.toStringz(alias_), flags, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
}
/**
* Finish operation to create a new collection in the secret service.
*
* Params:
* result = the asynchronous result passed to the callback
*
* Return: the new collection, which should be unreferenced
* with g_object_unref()
*
* Throws: GException on failure.
*/
public static Collection createFinish(AsyncResultIF result)
{
GError* err = null;
auto p = secret_collection_create_finish((result is null) ? null : result.getAsyncResultStruct(), &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
if(p is null)
{
return null;
}
return ObjectG.getDObject!(Collection)(cast(SecretCollection*) p, true);
}
/**
* Create a new collection in the secret service.
*
* This method may block indefinitely and should not be used in user interface
* threads. The secret service may prompt the user. secret_service_prompt()
* will be used to handle any prompts that are required.
*
* An @alias is a well-known tag for a collection, such as 'default' (ie: the
* default collection to store items in). This allows other applications to
* easily identify and share a collection. If you specify an @alias, and a
* collection with that alias already exists, then a new collection will not
* be created. The previous one will be returned instead.
*
* If @service is NULL, then secret_service_get_sync() will be called to get
* the default #SecretService proxy.
*
* Params:
* service = a secret service object
* label = label for the new collection
* alias_ = alias to assign to the collection
* flags = currently unused
* cancellable = optional cancellation object
*
* Return: the new collection, which should be unreferenced
* with g_object_unref()
*
* Throws: GException on failure.
*/
public static Collection createSync(Service service, string label, string alias_, SecretCollectionCreateFlags flags, Cancellable cancellable)
{
GError* err = null;
auto p = secret_collection_create_sync((service is null) ? null : service.getServiceStruct(), Str.toStringz(label), Str.toStringz(alias_), flags, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
if(p is null)
{
return null;
}
return ObjectG.getDObject!(Collection)(cast(SecretCollection*) p, true);
}
/**
* Lookup which collection is assigned to this alias. Aliases help determine
* well known collections, such as 'default'.
*
* If @service is NULL, then secret_service_get() will be called to get
* the default #SecretService proxy.
*
* This method will return immediately and complete asynchronously.
*
* Params:
* service = a secret service object
* alias_ = the alias to lookup
* flags = options for the collection initialization
* cancellable = optional cancellation object
* callback = called when the operation completes
* userData = data to pass to the callback
*/
public static void forAlias(Service service, string alias_, SecretCollectionFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
{
secret_collection_for_alias((service is null) ? null : service.getServiceStruct(), Str.toStringz(alias_), flags, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
}
/**
* Finish an asynchronous operation to lookup which collection is assigned
* to an alias.
*
* Params:
* result = asynchronous result passed to callback
*
* Return: the collection, or %NULL if none assigned to the alias
*
* Throws: GException on failure.
*/
public static Collection forAliasFinish(AsyncResultIF result)
{
GError* err = null;
auto p = secret_collection_for_alias_finish((result is null) ? null : result.getAsyncResultStruct(), &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
if(p is null)
{
return null;
}
return ObjectG.getDObject!(Collection)(cast(SecretCollection*) p, true);
}
/**
* Lookup which collection is assigned to this alias. Aliases help determine
* well known collections, such as 'default'.
*
* If @service is NULL, then secret_service_get_sync() will be called to get
* the default #SecretService proxy.
*
* This method may block and should not be used in user interface threads.
*
* Params:
* service = a secret service object
* alias_ = the alias to lookup
* flags = options for the collection initialization
* cancellable = optional cancellation object
*
* Return: the collection, or %NULL if none assigned to the alias
*
* Throws: GException on failure.
*/
public static Collection forAliasSync(Service service, string alias_, SecretCollectionFlags flags, Cancellable cancellable)
{
GError* err = null;
auto p = secret_collection_for_alias_sync((service is null) ? null : service.getServiceStruct(), Str.toStringz(alias_), flags, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
if(p is null)
{
return null;
}
return ObjectG.getDObject!(Collection)(cast(SecretCollection*) p, true);
}
/**
* Get a new collection proxy for a collection in the secret service.
*
* If @service is NULL, then secret_service_get() will be called to get
* the default #SecretService proxy.
*
* This method will return immediately and complete asynchronously.
*
* Params:
* service = a secret service object
* collectionPath = the D-Bus path of the collection
* flags = options for the collection initialization
* cancellable = optional cancellation object
* callback = called when the operation completes
* userData = data to be passed to the callback
*/
public static void newForDbusPath(Service service, string collectionPath, SecretCollectionFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
{
secret_collection_new_for_dbus_path((service is null) ? null : service.getServiceStruct(), Str.toStringz(collectionPath), flags, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
}
/**
* Delete this collection.
*
* This method returns immediately and completes asynchronously. The secret
* service may prompt the user. secret_service_prompt() will be used to handle
* any prompts that show up.
*
* Params:
* cancellable = optional cancellation object
* callback = called when the operation completes
* userData = data to pass to the callback
*/
public void delet(Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
{
secret_collection_delete(secretCollection, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
}
/**
* Complete operation to delete this collection.
*
* Params:
* result = asynchronous result passed to the callback
*
* Return: whether the collection was successfully deleted or not
*
* Throws: GException on failure.
*/
public bool deleteFinish(AsyncResultIF result)
{
GError* err = null;
auto p = secret_collection_delete_finish(secretCollection, (result is null) ? null : result.getAsyncResultStruct(), &err) != 0;
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
return p;
}
/**
* Delete this collection.
*
* This method may block indefinitely and should not be used in user
* interface threads. The secret service may prompt the user.
* secret_service_prompt() will be used to handle any prompts that show up.
*
* Params:
* cancellable = optional cancellation object
*
* Return: whether the collection was successfully deleted or not
*
* Throws: GException on failure.
*/
public bool deleteSync(Cancellable cancellable)
{
GError* err = null;
auto p = secret_collection_delete_sync(secretCollection, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err) != 0;
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
return p;
}
/**
* Get the created date and time of the collection. The return value is
* the number of seconds since the unix epoch, January 1st 1970.
*
* Return: the created date and time
*/
public ulong getCreated()
{
return secret_collection_get_created(secretCollection);
}
/**
* Get the list of items in this collection.
*
* Return: a list of items,
* when done, the list should be freed with g_list_free, and each item should
* be released with g_object_unref()
*/
public ListG getItems()
{
auto p = secret_collection_get_items(secretCollection);
if(p is null)
{
return null;
}
return new ListG(cast(GList*) p, true);
}
/**
* Get the label of this collection.
*
* Return: the label, which should be freed with g_free()
*/
public string getLabel()
{
auto retStr = secret_collection_get_label(secretCollection);
scope(exit) Str.freeString(retStr);
return Str.toString(retStr);
}
/**
* Get whether the collection is locked or not.
*
* Use secret_service_lock() or secret_service_unlock() to lock or unlock the
* collection.
*
* Return: whether the collection is locked or not
*/
public bool getLocked()
{
return secret_collection_get_locked(secretCollection) != 0;
}
/**
* Get the modified date and time of the collection. The return value is
* the number of seconds since the unix epoch, January 1st 1970.
*
* Return: the modified date and time
*/
public ulong getModified()
{
return secret_collection_get_modified(secretCollection);
}
/**
* Get the Secret Service object that this collection was created with.
*
* Return: the Secret Service object
*/
public Service getService()
{
auto p = secret_collection_get_service(secretCollection);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(Service)(cast(SecretService*) p);
}
/**
* Ensure that the #SecretCollection proxy has loaded all the items present
* in the Secret Service. This affects the result of
* secret_collection_get_items().
*
* For collections returned from secret_service_get_collections() the items
* will have already been loaded.
*
* This method will return immediately and complete asynchronously.
*
* Params:
* cancellable = optional cancellation object
* callback = called when the operation completes
* userData = data to be passed to the callback
*/
public void loadItems(Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
{
secret_collection_load_items(secretCollection, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
}
/**
* Complete an asynchronous operation to ensure that the #SecretCollection proxy
* has loaded all the items present in the Secret Service.
*
* Params:
* result = the asynchronous result passed to the callback
*
* Return: whether the load was successful or not
*
* Throws: GException on failure.
*/
public bool loadItemsFinish(AsyncResultIF result)
{
GError* err = null;
auto p = secret_collection_load_items_finish(secretCollection, (result is null) ? null : result.getAsyncResultStruct(), &err) != 0;
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
return p;
}
/**
* Ensure that the #SecretCollection proxy has loaded all the items present
* in the Secret Service. This affects the result of
* secret_collection_get_items().
*
* For collections returned from secret_service_get_collections() the items
* will have already been loaded.
*
* This method may block indefinitely and should not be used in user interface
* threads.
*
* Params:
* cancellable = optional cancellation object
*
* Return: whether the load was successful or not
*
* Throws: GException on failure.
*/
public bool loadItemsSync(Cancellable cancellable)
{
GError* err = null;
auto p = secret_collection_load_items_sync(secretCollection, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err) != 0;
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
return p;
}
/**
* Refresh the properties on this collection. This fires off a request to
* refresh, and the properties will be updated later.
*
* Calling this method is not normally necessary, as the secret service
* will notify the client when properties change.
*/
public void refresh()
{
secret_collection_refresh(secretCollection);
}
/**
* Search for items matching the @attributes in the @collection.
* The @attributes should be a table of string keys and string values.
*
* If %SECRET_SEARCH_ALL is set in @flags, then all the items matching the
* search will be returned. Otherwise only the first item will be returned.
* This is almost always the unlocked item that was most recently stored.
*
* If %SECRET_SEARCH_UNLOCK is set in @flags, then items will be unlocked
* if necessary. In either case, locked and unlocked items will match the
* search and be returned. If the unlock fails, the search does not fail.
*
* If %SECRET_SEARCH_LOAD_SECRETS is set in @flags, then the items will have
* their secret values loaded and available via secret_item_get_secret().
*
* This function returns immediately and completes asynchronously.
*
* Params:
* schema = the schema for the attributes
* attributes = search for items matching these attributes
* flags = search option flags
* cancellable = optional cancellation object
* callback = called when the operation completes
* userData = data to pass to the callback
*/
public void search(Schema schema, HashTable attributes, SecretSearchFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
{
secret_collection_search(secretCollection, (schema is null) ? null : schema.getSchemaStruct(), (attributes is null) ? null : attributes.getHashTableStruct(), flags, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
}
/**
* Complete asynchronous operation to search for items in a collection.
*
* Params:
* result = asynchronous result passed to callback
*
* Return: a list of items that matched the search
*
* Throws: GException on failure.
*/
public ListG searchFinish(AsyncResultIF result)
{
GError* err = null;
auto p = secret_collection_search_finish(secretCollection, (result is null) ? null : result.getAsyncResultStruct(), &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
if(p is null)
{
return null;
}
return new ListG(cast(GList*) p, true);
}
/**
* Search for items in @collection matching the @attributes, and return their
* DBus object paths. Only the specified collection is searched. The @attributes
* should be a table of string keys and string values.
*
* This function returns immediately and completes asynchronously.
*
* When your callback is called use secret_collection_search_for_dbus_paths_finish()
* to get the results of this function. Only the DBus object paths of the
* items will be returned. If you would like #SecretItem objects to be returned
* instead, then use the secret_collection_search() function.
*
* Params:
* schema = the schema for the attributes
* attributes = search for items matching these attributes
* cancellable = optional cancellation object
* callback = called when the operation completes
* userData = data to pass to the callback
*/
public void searchForDbusPaths(Schema schema, HashTable attributes, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
{
secret_collection_search_for_dbus_paths(secretCollection, (schema is null) ? null : schema.getSchemaStruct(), (attributes is null) ? null : attributes.getHashTableStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
}
/**
* Complete asynchronous operation to search for items in a collection.
*
* DBus object paths of the items will be returned. If you would to have
* #SecretItem objects to be returned instead, then use the
* secret_collection_search() and secret_collection_search_finish() functions.
*
* Params:
* result = asynchronous result passed to callback
*
* Return: an array of DBus object
* paths for matching items.
*
* Throws: GException on failure.
*/
public string[] searchForDbusPathsFinish(AsyncResultIF result)
{
GError* err = null;
auto retStr = secret_collection_search_for_dbus_paths_finish(secretCollection, (result is null) ? null : result.getAsyncResultStruct(), &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
scope(exit) Str.freeStringArray(retStr);
return Str.toStringArray(retStr);
}
/**
* Search for items matching the @attributes in @collection, and return their
* DBus object paths. The @attributes should be a table of string keys and
* string values.
*
* This function may block indefinetely. Use the asynchronous version
* in user interface threads.
*
* DBus object paths of the items will be returned. If you would to have
* #SecretItem objects to be returned instead, then use the
* secret_collection_search_sync() function.
*
* Params:
* schema = the schema for the attributes
* attributes = search for items matching these attributes
* cancellable = optional cancellation object
*
* Return: an array of DBus object
* paths for matching items.
*
* Throws: GException on failure.
*/
public string[] searchForDbusPathsSync(Schema schema, HashTable attributes, Cancellable cancellable)
{
GError* err = null;
auto retStr = secret_collection_search_for_dbus_paths_sync(secretCollection, (schema is null) ? null : schema.getSchemaStruct(), (attributes is null) ? null : attributes.getHashTableStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
scope(exit) Str.freeStringArray(retStr);
return Str.toStringArray(retStr);
}
/**
* Search for items matching the @attributes in the @collection.
* The @attributes should be a table of string keys and string values.
*
* If %SECRET_SEARCH_ALL is set in @flags, then all the items matching the
* search will be returned. Otherwise only the first item will be returned.
* This is almost always the unlocked item that was most recently stored.
*
* If %SECRET_SEARCH_UNLOCK is set in @flags, then items will be unlocked
* if necessary. In either case, locked and unlocked items will match the
* search and be returned. If the unlock fails, the search does not fail.
*
* If %SECRET_SEARCH_LOAD_SECRETS is set in @flags, then the items will have
* their secret values loaded and available via secret_item_get_secret().
*
* This function may block indefinetely. Use the asynchronous version
* in user interface threads.
*
* Params:
* schema = the schema for the attributes
* attributes = search for items matching these attributes
* flags = search option flags
* cancellable = optional cancellation object
*
* Return: a list of items that matched the search
*
* Throws: GException on failure.
*/
public ListG searchSync(Schema schema, HashTable attributes, SecretSearchFlags flags, Cancellable cancellable)
{
GError* err = null;
auto p = secret_collection_search_sync(secretCollection, (schema is null) ? null : schema.getSchemaStruct(), (attributes is null) ? null : attributes.getHashTableStruct(), flags, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
if(p is null)
{
return null;
}
return new ListG(cast(GList*) p, true);
}
/**
* Set the label of this collection.
*
* This function returns immediately and completes asynchronously.
*
* Params:
* label = a new label
* cancellable = optional cancellation object
* callback = called when the operation completes
* userData = data to pass to the callback
*/
public void setLabel(string label, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)
{
secret_collection_set_label(secretCollection, Str.toStringz(label), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
}
/**
* Complete asynchronous operation to set the label of this collection.
*
* Params:
* result = asynchronous result passed to callback
*
* Return: whether the change was successful or not
*
* Throws: GException on failure.
*/
public bool setLabelFinish(AsyncResultIF result)
{
GError* err = null;
auto p = secret_collection_set_label_finish(secretCollection, (result is null) ? null : result.getAsyncResultStruct(), &err) != 0;
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
return p;
}
/**
* Set the label of this collection.
*
* This function may block indefinetely. Use the asynchronous version
* in user interface threads.
*
* Params:
* label = a new label
* cancellable = optional cancellation object
*
* Return: whether the change was successful or not
*
* Throws: GException on failure.
*/
public bool setLabelSync(string label, Cancellable cancellable)
{
GError* err = null;
auto p = secret_collection_set_label_sync(secretCollection, Str.toStringz(label), (cancellable is null) ? null : cancellable.getCancellableStruct(), &err) != 0;
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
return p;
}
}
|