/
EBook-1.2.d.ts
1572 lines (1461 loc) · 70.6 KB
/
EBook-1.2.d.ts
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
// @ts-nocheck
/*
* Type Definitions for node-gtk (https://github.com/romgrk/node-gtk)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in ts-for-gir itself or create a bug report on https://github.com/sammydre/ts-for-gjs
*/
/**
* EBook-1.2
*/
import type libxml2 from './libxml2-2.0';
import type Gio from './Gio-2.0';
import type GObject from './GObject-2.0';
import type GLib from './GLib-2.0';
import type EDataServer from './EDataServer-1.2';
import type Soup from './Soup-2.4';
import type GData from './GData-0.0';
import type Json from './Json-1.0';
import type Goa from './Goa-1.0';
import type Camel from './Camel-1.2';
import type EBookContacts from './EBookContacts-1.2';
export namespace EBook {
/**
* Error codes for the #E_BOOK_ERROR error
*/
enum BookStatus {
OK,
INVALID_ARG,
BUSY,
REPOSITORY_OFFLINE,
NO_SUCH_BOOK,
NO_SELF_CONTACT,
SOURCE_NOT_LOADED,
SOURCE_ALREADY_LOADED,
PERMISSION_DENIED,
CONTACT_NOT_FOUND,
CONTACT_ID_ALREADY_EXISTS,
PROTOCOL_NOT_SUPPORTED,
CANCELLED,
COULD_NOT_CANCEL,
AUTHENTICATION_FAILED,
AUTHENTICATION_REQUIRED,
TLS_NOT_AVAILABLE,
DBUS_EXCEPTION,
NO_SUCH_SOURCE,
OFFLINE_UNAVAILABLE,
OTHER_ERROR,
INVALID_SERVER_VERSION,
UNSUPPORTED_AUTHENTICATION_METHOD,
NO_SPACE,
NOT_SUPPORTED,
}
function bookErrorQuark(): GLib.Quark
/**
* Synchronously searches for `recipients` S/MIME or PGP certificates either
* in provided `only_clients` #EBookClient, or, when %NULL, in each found
* address book configured for auto-completion.
*
* This function can be used within camel_session_get_recipient_certificates_sync()
* implementation.
* @param registry an #ESourceRegistry
* @param onlyClients optional #GSList of the #EBookClient objects to search for the certificates in, or %NULL
* @param flags bit-or of #CamelRecipientCertificateFlags
* @param recipients a #GPtrArray of recipients' email addresses
* @param cancellable optional #GCancellable object, or %NULL
*/
function bookUtilsGetRecipientCertificatesSync(registry: EDataServer.SourceRegistry, onlyClients: BookClient[] | null, flags: Camel.RecipientCertificateFlags, recipients: string[], cancellable: Gio.Cancellable | null): [ /* returnType */ boolean, /* outCertificates */ string[] ]
interface BookClient_ConstructProps extends Gio.AsyncInitable_ConstructProps, Gio.Initable_ConstructProps, EDataServer.Client_ConstructProps {
}
interface BookClient extends Gio.AsyncInitable, Gio.Initable {
// Own properties of EBook-1.2.EBook.BookClient
/**
* The currently active locale for this addressbook.
*/
readonly locale: string
// Owm methods of EBook-1.2.EBook.BookClient
/**
* Adds `contact` to `client`.
* The call is finished by e_book_client_add_contact_finish()
* from the `callback`.
* @param contact an #EContact
* @param opflags bit-or of #EBookOperationFlags
* @param cancellable a #GCancellable; can be %NULL
* @param callback callback to call when a result is ready
*/
addContact(contact: EBookContacts.Contact, opflags: EBookContacts.BookOperationFlags, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Finishes previous call of e_book_client_add_contact() and
* sets `out_added_uid` to a UID of a newly added contact.
* This string should be freed with g_free().
*
* Note: This is not modifying original #EContact.
* @param result a #GAsyncResult
*/
addContactFinish(result: Gio.AsyncResult): [ /* returnType */ boolean, /* outAddedUid */ string ]
/**
* Adds `contact` to `client` and
* sets `out_added_uid` to a UID of a newly added contact.
* This string should be freed with g_free().
*
* Note: This is not modifying original `contact,` thus if it's needed,
* then use e_contact_set (contact, E_CONTACT_UID, new_uid).
* @param contact an #EContact
* @param opflags bit-or of #EBookOperationFlags
* @param cancellable a #GCancellable; can be %NULL
*/
addContactSync(contact: EBookContacts.Contact, opflags: EBookContacts.BookOperationFlags, cancellable: Gio.Cancellable | null): [ /* returnType */ boolean, /* outAddedUid */ string ]
/**
* Adds `contacts` to `client`.
* The call is finished by e_book_client_add_contacts_finish()
* from the `callback`.
* @param contacts a #GSList of #EContact objects to add
* @param opflags bit-or of #EBookOperationFlags
* @param cancellable a #GCancellable; can be %NULL
* @param callback callback to call when a result is ready
*/
addContacts(contacts: EBookContacts.Contact[], opflags: EBookContacts.BookOperationFlags, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Finishes previous call of e_book_client_add_contacts() and
* sets `out_added_uids` to the UIDs of newly added contacts if successful.
* This #GSList should be freed with e_client_util_free_string_slist().
*
* If any of the contacts cannot be inserted, all of the insertions will be
* reverted and this method will return %FALSE.
*
* Note: This is not modifying original #EContact objects.
* @param result a #GAsyncResult
*/
addContactsFinish(result: Gio.AsyncResult): [ /* returnType */ boolean, /* outAddedUids */ string[] ]
/**
* Adds `contacts` to `client` and
* sets `out_added_uids` to the UIDs of newly added contacts if successful.
* This #GSList should be freed with e_client_util_free_string_slist().
*
* If any of the contacts cannot be inserted, all of the insertions will be
* reverted and this method will return %FALSE.
*
* Note: This is not modifying original `contacts,` thus if it's needed,
* then use e_contact_set (contact, E_CONTACT_UID, new_uid).
* @param contacts a #GSList of #EContact objects to add
* @param opflags bit-or of #EBookOperationFlags
* @param cancellable a #GCancellable; can be %NULL
*/
addContactsSync(contacts: EBookContacts.Contact[], opflags: EBookContacts.BookOperationFlags, cancellable: Gio.Cancellable | null): [ /* returnType */ boolean, /* outAddedUids */ string[] ]
/**
* Asynchronously checks whether contains an `email_address`. When the `email_address`
* contains multiple addresses, then returns %TRUE when at least one
* address exists in the address book.
*
* When the operation is finished, `callback` will be called. You can then
* call e_book_client_contains_email_finish() to get the result of the
* operation.
* @param emailAddress an email address
* @param cancellable a #GCancellable; can be %NULL
* @param callback callback to call when a result is ready
*/
containsEmail(emailAddress: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Finishes previous call of e_book_client_contains_email().
* @param result a #GAsyncResult
*/
containsEmailFinish(result: Gio.AsyncResult): boolean
containsEmailSync(emailAddress: string, cancellable: Gio.Cancellable | null): boolean
/**
* Receive #EContact from the `client` for the gived `uid`.
* The call is finished by e_book_client_get_contact_finish()
* from the `callback`.
* @param uid a unique string ID specifying the contact
* @param cancellable a #GCancellable; can be %NULL
* @param callback callback to call when a result is ready
*/
getContact(uid: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Finishes previous call of e_book_client_get_contact().
* If successful, then the `out_contact` is set to newly allocated
* #EContact, which should be freed with g_object_unref().
* @param result a #GAsyncResult
*/
getContactFinish(result: Gio.AsyncResult): [ /* returnType */ boolean, /* outContact */ EBookContacts.Contact ]
/**
* Receive #EContact from the `client` for the gived `uid`.
* If successful, then the `out_contact` is set to newly allocated
* #EContact, which should be freed with g_object_unref().
* @param uid a unique string ID specifying the contact
* @param cancellable a #GCancellable; can be %NULL
*/
getContactSync(uid: string, cancellable: Gio.Cancellable | null): [ /* returnType */ boolean, /* outContact */ EBookContacts.Contact ]
/**
* Query `client` with `sexp,` receiving a list of contacts which
* matched. The call is finished by e_book_client_get_contacts_finish()
* from the `callback`.
*
* Note: `sexp` can be obtained through #EBookQuery, by converting it
* to a string with e_book_query_to_string().
* @param sexp an S-expression representing the query
* @param cancellable a #GCancellable; can be %NULL
* @param callback callback to call when a result is ready
*/
getContacts(sexp: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Finishes previous call of e_book_client_get_contacts().
* If successful, then the `out_contacts` is set to newly allocated list of
* #EContact(s), which should be freed with e_client_util_free_object_slist().
* @param result a #GAsyncResult
*/
getContactsFinish(result: Gio.AsyncResult): [ /* returnType */ boolean, /* outContacts */ EBookContacts.Contact[] ]
/**
* Query `client` with `sexp,` receiving a list of contacts which matched.
* If successful, then the `out_contacts` is set to newly allocated #GSList of
* #EContact(s), which should be freed with e_client_util_free_object_slist().
*
* Note: `sexp` can be obtained through #EBookQuery, by converting it
* to a string with e_book_query_to_string().
* @param sexp an S-expression representing the query
* @param cancellable a #GCancellable; can be %NULL
*/
getContactsSync(sexp: string, cancellable: Gio.Cancellable | null): [ /* returnType */ boolean, /* outContacts */ EBookContacts.Contact[] ]
/**
* Query `client` with `sexp,` receiving a list of contacts UIDs which
* matched. The call is finished by e_book_client_get_contacts_uids_finish()
* from the `callback`.
*
* Note: `sexp` can be obtained through #EBookQuery, by converting it
* to a string with e_book_query_to_string().
* @param sexp an S-expression representing the query
* @param cancellable a #GCancellable; can be %NULL
* @param callback callback to call when a result is ready
*/
getContactsUids(sexp: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Finishes previous call of e_book_client_get_contacts_uids().
* If successful, then the `out_contact_uids` is set to newly allocated list
* of UID strings, which should be freed with e_client_util_free_string_slist().
* @param result a #GAsyncResult
*/
getContactsUidsFinish(result: Gio.AsyncResult): [ /* returnType */ boolean, /* outContactUids */ string[] ]
/**
* Query `client` with `sexp,` receiving a list of contacts UIDs which matched.
* If successful, then the `out_contact_uids` is set to newly allocated list
* of UID strings, which should be freed with e_client_util_free_string_slist().
*
* Note: `sexp` can be obtained through #EBookQuery, by converting it
* to a string with e_book_query_to_string().
* @param sexp an S-expression representing the query
* @param cancellable a #GCancellable; can be %NULL
*/
getContactsUidsSync(sexp: string, cancellable: Gio.Cancellable | null): [ /* returnType */ boolean, /* outContactUids */ string[] ]
/**
* Create an #EBookClientCursor.
* The call is finished by e_book_client_get_view_finish()
* from the `callback`.
*
* Note: `sexp` can be obtained through #EBookQuery, by converting it
* to a string with e_book_query_to_string().
* @param sexp an S-expression representing the query
* @param sortFields an array of #EContactFields to sort the cursor with
* @param sortTypes an array of #EBookCursorSortTypes to complement `sort_fields`
* @param nFields the length of the input `sort_fields` and `sort_types` arrays
* @param cancellable a #GCancellable; can be %NULL
* @param callback callback to call when a result is ready
*/
getCursor(sexp: string, sortFields: EBookContacts.ContactField, sortTypes: EBookContacts.BookCursorSortType, nFields: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Finishes previous call of e_book_client_get_cursor().
* If successful, then the `out_cursor` is set to newly create
* #EBookClientCursor, the cursor should be freed with g_object_unref()
* when no longer needed.
* @param result a #GAsyncResult
*/
getCursorFinish(result: Gio.AsyncResult): [ /* returnType */ boolean, /* outCursor */ BookClientCursor ]
/**
* Create an #EBookClientCursor. If successful, then the `out_cursor` is set
* to newly allocated #EBookClientCursor, the cursor should be freed with g_object_unref()
* when no longer needed.
*
* Note: `sexp` can be obtained through #EBookQuery, by converting it
* to a string with e_book_query_to_string().
* @param sexp an S-expression representing the query
* @param sortFields an array of #EContactFields to sort the cursor with
* @param sortTypes an array of #EBookCursorSortTypes to complement `sort_fields`
* @param nFields the length of the input `sort_fields` and `sort_types` arrays
* @param cancellable a #GCancellable; can be %NULL
*/
getCursorSync(sexp: string, sortFields: EBookContacts.ContactField, sortTypes: EBookContacts.BookCursorSortType, nFields: number, cancellable: Gio.Cancellable | null): [ /* returnType */ boolean, /* outCursor */ BookClientCursor ]
/**
* Reports the locale in use for `client`. The addressbook might sort contacts
* in different orders, or store and compare phone numbers in different ways
* depending on the currently set locale.
*
* Locales can change dynamically if systemd decides to change the locale, so
* it's important to listen for notifications on the #EBookClient:locale property
* if you depend on sorted result lists. Ordered results should be reloaded
* after a locale change is detected.
*/
getLocale(): string
/**
* Query `client` with `sexp,` creating an #EBookClientView.
* The call is finished by e_book_client_get_view_finish()
* from the `callback`.
*
* Note: `sexp` can be obtained through #EBookQuery, by converting it
* to a string with e_book_query_to_string().
* @param sexp an S-expression representing the query
* @param cancellable a #GCancellable; can be %NULL
* @param callback callback to call when a result is ready
*/
getView(sexp: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Finishes previous call of e_book_client_get_view().
* If successful, then the `out_view` is set to newly allocated
* #EBookClientView, which should be freed with g_object_unref().
* @param result a #GAsyncResult
*/
getViewFinish(result: Gio.AsyncResult): [ /* returnType */ boolean, /* outView */ BookClientView ]
/**
* Query `client` with `sexp,` creating an #EBookClientView.
* If successful, then the `out_view` is set to newly allocated
* #EBookClientView, which should be freed with g_object_unref().
*
* Note: `sexp` can be obtained through #EBookQuery, by converting it
* to a string with e_book_query_to_string().
* @param sexp an S-expression representing the query
* @param cancellable a #GCancellable; can be %NULL
*/
getViewSync(sexp: string, cancellable: Gio.Cancellable | null): [ /* returnType */ boolean, /* outView */ BookClientView ]
/**
* Applies the changes made to `contact` to the stored version in `client`.
* The call is finished by e_book_client_modify_contact_finish()
* from the `callback`.
* @param contact an #EContact
* @param opflags bit-or of #EBookOperationFlags
* @param cancellable a #GCancellable; can be %NULL
* @param callback callback to call when a result is ready
*/
modifyContact(contact: EBookContacts.Contact, opflags: EBookContacts.BookOperationFlags, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Finishes previous call of e_book_client_modify_contact().
* @param result a #GAsyncResult
*/
modifyContactFinish(result: Gio.AsyncResult): boolean
/**
* Applies the changes made to `contact` to the stored version in `client`.
* @param contact an #EContact
* @param opflags bit-or of #EBookOperationFlags
* @param cancellable a #GCancellable; can be %NULL
*/
modifyContactSync(contact: EBookContacts.Contact, opflags: EBookContacts.BookOperationFlags, cancellable: Gio.Cancellable | null): boolean
/**
* Applies the changes made to `contacts` to the stored versions in `client`.
* The call is finished by e_book_client_modify_contacts_finish()
* from the `callback`.
* @param contacts a #GSList of #EContact objects
* @param opflags bit-or of #EBookOperationFlags
* @param cancellable a #GCancellable; can be %NULL
* @param callback callback to call when a result is ready
*/
modifyContacts(contacts: EBookContacts.Contact[], opflags: EBookContacts.BookOperationFlags, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Finishes previous call of e_book_client_modify_contacts().
* @param result a #GAsyncResult
*/
modifyContactsFinish(result: Gio.AsyncResult): boolean
/**
* Applies the changes made to `contacts` to the stored versions in `client`.
* @param contacts a #GSList of #EContact objects
* @param opflags bit-or of #EBookOperationFlags
* @param cancellable a #GCancellable; can be %NULL
*/
modifyContactsSync(contacts: EBookContacts.Contact[], opflags: EBookContacts.BookOperationFlags, cancellable: Gio.Cancellable | null): boolean
/**
* Removes `contact` from the `client`.
* The call is finished by e_book_client_remove_contact_finish()
* from the `callback`.
* @param contact an #EContact
* @param opflags bit-or of #EBookOperationFlags
* @param cancellable a #GCancellable; can be %NULL
* @param callback callback to call when a result is ready
*/
removeContact(contact: EBookContacts.Contact, opflags: EBookContacts.BookOperationFlags, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Removes contact with `uid` from the `client`.
* The call is finished by e_book_client_remove_contact_by_uid_finish()
* from the `callback`.
* @param uid a UID of a contact to remove
* @param opflags bit-or of #EBookOperationFlags
* @param cancellable a #GCancellable; can be %NULL
* @param callback callback to call when a result is ready
*/
removeContactByUid(uid: string, opflags: EBookContacts.BookOperationFlags, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Finishes previous call of e_book_client_remove_contact_by_uid().
* @param result a #GAsyncResult
*/
removeContactByUidFinish(result: Gio.AsyncResult): boolean
/**
* Removes contact with `uid` from the `client`.
* @param uid a UID of a contact to remove
* @param opflags bit-or of #EBookOperationFlags
* @param cancellable a #GCancellable; can be %NULL
*/
removeContactByUidSync(uid: string, opflags: EBookContacts.BookOperationFlags, cancellable: Gio.Cancellable | null): boolean
/**
* Finishes previous call of e_book_client_remove_contact().
* @param result a #GAsyncResult
*/
removeContactFinish(result: Gio.AsyncResult): boolean
/**
* Removes `contact` from the `client`.
* @param contact an #EContact
* @param opflags bit-or of #EBookOperationFlags
* @param cancellable a #GCancellable; can be %NULL
*/
removeContactSync(contact: EBookContacts.Contact, opflags: EBookContacts.BookOperationFlags, cancellable: Gio.Cancellable | null): boolean
/**
* Removes the contacts with uids from the list `uids` from `client`. This is
* always more efficient than calling e_book_client_remove_contact() if you
* have more than one uid to remove, as some backends can implement it
* as a batch request.
* The call is finished by e_book_client_remove_contacts_finish()
* from the `callback`.
* @param uids a #GSList of UIDs to remove
* @param opflags bit-or of #EBookOperationFlags
* @param cancellable a #GCancellable; can be %NULL
* @param callback callback to call when a result is ready
*/
removeContacts(uids: string[], opflags: EBookContacts.BookOperationFlags, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Finishes previous call of e_book_client_remove_contacts().
* @param result a #GAsyncResult
*/
removeContactsFinish(result: Gio.AsyncResult): boolean
/**
* Removes the contacts with uids from the list `uids` from `client`. This is
* always more efficient than calling e_book_client_remove_contact() if you
* have more than one uid to remove, as some backends can implement it
* as a batch request.
* @param uids a #GSList of UIDs to remove
* @param opflags bit-or of #EBookOperationFlags
* @param cancellable a #GCancellable; can be %NULL
*/
removeContactsSync(uids: string[], opflags: EBookContacts.BookOperationFlags, cancellable: Gio.Cancellable | null): boolean
/**
* Specify that `contact` residing in `client` is the #EContact that
* refers to the user of the address book.
* @param contact an #EContact
*/
setSelf(contact: EBookContacts.Contact): boolean
// Class property signals of EBook-1.2.EBook.BookClient
connect(sigName: "notify::locale", callback: (...args: any[]) => void): number
on(sigName: "notify::locale", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::locale", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::locale", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::locale", ...args: any[]): void
connect(sigName: "notify::capabilities", callback: (...args: any[]) => void): number
on(sigName: "notify::capabilities", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::capabilities", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::capabilities", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::capabilities", ...args: any[]): void
connect(sigName: "notify::main-context", callback: (...args: any[]) => void): number
on(sigName: "notify::main-context", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::main-context", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::main-context", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::main-context", ...args: any[]): void
connect(sigName: "notify::online", callback: (...args: any[]) => void): number
on(sigName: "notify::online", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::online", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::online", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::online", ...args: any[]): void
connect(sigName: "notify::opened", callback: (...args: any[]) => void): number
on(sigName: "notify::opened", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::opened", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::opened", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::opened", ...args: any[]): void
connect(sigName: "notify::readonly", callback: (...args: any[]) => void): number
on(sigName: "notify::readonly", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::readonly", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::readonly", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::readonly", ...args: any[]): void
connect(sigName: "notify::source", callback: (...args: any[]) => void): number
on(sigName: "notify::source", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::source", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::source", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::source", ...args: any[]): void
connect(sigName: string, callback: (...args: any[]) => void): number
on(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: string, callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: string, ...args: any[]): void
}
/**
* Contains only private data that should be read and manipulated using the
* functions below.
* @class
*/
class BookClient extends EDataServer.Client {
// Own properties of EBook-1.2.EBook.BookClient
static name: string
static $gtype: GObject.GType<BookClient>
// Constructors of EBook-1.2.EBook.BookClient
constructor(config?: BookClient_ConstructProps)
/**
* Creates a new #EBookClient corresponding to the given source. There are
* only two operations that are valid on this book at this point:
* e_client_open(), and e_client_remove().
* @constructor
* @param source An #ESource pointer
*/
constructor(source: EDataServer.Source)
/**
* Creates a new #EBookClient corresponding to the given source. There are
* only two operations that are valid on this book at this point:
* e_client_open(), and e_client_remove().
* @constructor
* @param source An #ESource pointer
*/
static new(source: EDataServer.Source): BookClient
_init(config?: BookClient_ConstructProps): void
/**
* Asynchronously creates a new #EBookClient for `source`.
*
* The `wait_for_connected_seconds` argument had been added since 3.16,
* to let the caller decide how long to wait for the backend to fully
* connect to its (possibly remote) data store. This is required due
* to a change in the authentication process, which is fully asynchronous
* and done on the client side, while not every client is supposed to
* response to authentication requests. In case the backend will not connect
* within the set interval, then it is opened in an offline mode. A special
* value -1 can be used to not wait for the connected state at all.
*
* Unlike with e_book_client_new(), there is no need to call e_client_open()
* after obtaining the #EBookClient.
*
* When the operation is finished, `callback` will be called. You can then
* call e_book_client_connect_finish() to get the result of the operation.
* @param source an #ESource
* @param waitForConnectedSeconds timeout, in seconds, to wait for the backend to be fully connected
* @param cancellable optional #GCancellable object, or %NULL
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
static connect(source: EDataServer.Source, waitForConnectedSeconds: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Like e_book_client_connect(), except creates the book client for
* direct read access to the underlying addressbook.
*
* When the operation is finished, `callback` will be called. You can then
* call e_book_client_connect_direct_finish() to get the result of the operation.
* @param source an #ESource
* @param waitForConnectedSeconds timeout, in seconds, to wait for the backend to be fully connected
* @param cancellable optional #GCancellable object, or %NULL
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
static connectDirect(source: EDataServer.Source, waitForConnectedSeconds: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Finishes the operation started with e_book_client_connect_direct().
* If an error occurs in connecting to the D-Bus service, the function sets
* `error` and returns %NULL.
*
* For error handling convenience, any error message returned by this
* function will have a descriptive prefix that includes the display
* name of the #ESource passed to e_book_client_connect_direct().
* @param result a #GAsyncResult
*/
static connectDirectFinish(result: Gio.AsyncResult): BookClient
/**
* Like e_book_client_connect_sync(), except creates the book client for
* direct read access to the underlying addressbook.
* @param registry an #ESourceRegistry
* @param source an #ESource
* @param waitForConnectedSeconds timeout, in seconds, to wait for the backend to be fully connected
* @param cancellable optional #GCancellable object, or %NULL
*/
static connectDirectSync(registry: EDataServer.SourceRegistry, source: EDataServer.Source, waitForConnectedSeconds: number, cancellable: Gio.Cancellable | null): BookClient
/**
* Finishes the operation started with e_book_client_connect(). If an
* error occurs in connecting to the D-Bus service, the function sets
* `error` and returns %NULL.
*
* For error handling convenience, any error message returned by this
* function will have a descriptive prefix that includes the display
* name of the #ESource passed to e_book_client_connect().
* @param result a #GAsyncResult
*/
static connectFinish(result: Gio.AsyncResult): BookClient
/**
* Creates a new #EBookClient for `source`. If an error occurs, the function
* will set `error` and return %FALSE.
*
* Unlike with e_book_client_new(), there is no need to call
* e_client_open_sync() after obtaining the #EBookClient.
*
* The `wait_for_connected_seconds` argument had been added since 3.16,
* to let the caller decide how long to wait for the backend to fully
* connect to its (possibly remote) data store. This is required due
* to a change in the authentication process, which is fully asynchronous
* and done on the client side, while not every client is supposed to
* response to authentication requests. In case the backend will not connect
* within the set interval, then it is opened in an offline mode. A special
* value -1 can be used to not wait for the connected state at all.
*
* For error handling convenience, any error message returned by this
* function will have a descriptive prefix that includes the display
* name of `source`.
* @param source an #ESource
* @param waitForConnectedSeconds timeout, in seconds, to wait for the backend to be fully connected
* @param cancellable optional #GCancellable object, or %NULL
*/
static connectSync(source: EDataServer.Source, waitForConnectedSeconds: number, cancellable: Gio.Cancellable | null): BookClient
/**
* Get the #EContact referring to the user of the address book
* and set it in `out_contact` and `out_client`.
* @param registry an #ESourceRegistry
*/
static getSelf(registry: EDataServer.SourceRegistry): [ /* returnType */ boolean, /* outContact */ EBookContacts.Contact, /* outClient */ BookClient ]
/**
* Check if `contact` is the user of the address book.
* @param contact an #EContact
*/
static isSelf(contact: EBookContacts.Contact): boolean
}
interface BookClientCursor_ConstructProps extends Gio.Initable_ConstructProps, GObject.Object_ConstructProps {
// Own constructor properties of EBook-1.2.EBook.BookClientCursor
/**
* The #EBookClient which this cursor was created for
*/
client?: BookClient | null
/**
* The #GDBusConnection to the addressbook server.
*
* <note><para>This is an internal parameter for constructing the
* cursor, to construct the cursor use e_book_client_get_cursor().
* </para></note>
*/
connection?: Gio.DBusConnection | null
/**
* The #GMainContext in which the #EBookClient created this cursor.
*
* <note><para>This is an internal parameter for constructing the
* cursor, to construct the cursor use e_book_client_get_cursor().
* </para></note>
*/
context?: GLib.MainContext | null
/**
* The D-Bus object path to find the server side cursor object.
*
* <note><para>This is an internal parameter for constructing the
* cursor, to construct the cursor use e_book_client_get_cursor().
* </para></note>
*/
objectPath?: string | null
/**
* The #EContactField names to sort this cursor with
*
* <note><para>This is an internal parameter for constructing the
* cursor, to construct the cursor use e_book_client_get_cursor().
* </para></note>
*/
sortFields?: string[] | null
}
/**
* Signal callback interface for `refresh`
*/
interface BookClientCursor_RefreshSignalCallback {
(): void
}
interface BookClientCursor extends Gio.Initable {
// Own properties of EBook-1.2.EBook.BookClientCursor
/**
* The currently <link linkend="cursor-alphabet">active alphabet</link>.
*
* The value is a %NULL terminated array of strings,
* each string is suitable to display a specific letter
* in the active alphabet.
*
* Indexes from this array can later be used with
* e_book_client_cursor_set_alphabetic_index().
*
* This property will automatically change if the
* active locale of the addressbook server changes.
*
* Property change notifications are guaranteed to be
* delivered in the #GMainContext which was the thread
* default context at cursor creation time.
*/
readonly alphabet: string[]
/**
* The #EBookClient which this cursor was created for
*/
readonly client: BookClient
/**
* The #GDBusConnection to the addressbook server.
*
* <note><para>This is an internal parameter for constructing the
* cursor, to construct the cursor use e_book_client_get_cursor().
* </para></note>
*/
readonly connection: Gio.DBusConnection
/**
* The #GMainContext in which the #EBookClient created this cursor.
*
* <note><para>This is an internal parameter for constructing the
* cursor, to construct the cursor use e_book_client_get_cursor().
* </para></note>
*/
readonly context: GLib.MainContext
/**
* The D-Bus object path to find the server side cursor object.
*
* <note><para>This is an internal parameter for constructing the
* cursor, to construct the cursor use e_book_client_get_cursor().
* </para></note>
*/
readonly objectPath: string
/**
* The current cursor position in the cursor's result list.
*
* More specifically, the cursor position is defined as
* the number of contacts leading up to the current
* cursor position, inclusive of the current cursor
* position.
*
* If the position value is 0, then the cursor is positioned
* before the contact list in the symbolic %E_BOOK_CURSOR_ORIGIN_BEGIN
* position. If the position value is greater than
* #EBookClientCursor:total, this indicates that the cursor is
* positioned after the contact list in the symbolic
* %E_BOOK_CURSOR_ORIGIN_END position.
*
* Property change notifications are guaranteed to be
* delivered in the #GMainContext which was the thread
* default context at cursor creation time.
*/
readonly position: number
/**
* The #EContactField names to sort this cursor with
*
* <note><para>This is an internal parameter for constructing the
* cursor, to construct the cursor use e_book_client_get_cursor().
* </para></note>
*/
readonly sortFields: string[]
/**
* The total number of contacts which satisfy the cursor's query.
*
* Property change notifications are guaranteed to be
* delivered in the #GMainContext which was the thread
* default context at cursor creation time.
*/
readonly total: number
// Owm methods of EBook-1.2.EBook.BookClientCursor
/**
* Fetches the array of displayable labels for the <link linkend="cursor-alphabet">active alphabet</link>.
*
* The active alphabet is based on the current locale configuration of the
* addressbook, and can be a different alphabet for locales requiring non-Latin
* language scripts. These UTF-8 labels are appropriate to display in a user
* interface to represent the alphabetic position of the cursor in the user's
* native alphabet.
*
* The `underflow,` `inflow` and `overflow` parameters allow one to observe which
* indexes Evolution Data Server is using to store words which sort outside
* of the alphabet, for instance words from foreign language scripts and
* words which start with numeric characters, or other types of character.
*
* While the `underflow` and `overflow` are for words which sort below or
* above the active alphabets, the `inflow` index is for words which sort
* in between multiple concurrently active alphabets. The active alphabet
* array might contain more than one alphabet for locales where it is
* very common or expected to have names in Latin script as well as names
* in another script.
*/
getAlphabet(): [ /* returnType */ string[], /* nLabels */ number, /* underflow */ number, /* inflow */ number, /* overflow */ number ]
/**
* Checks which alphabetic index `contact` would be sorted
* into according to `cursor`.
*
* So long as the active #EBookClientCursor:alphabet does
* not change, the returned index will be a valid position
* in the array of labels returned by e_book_client_cursor_get_alphabet().
*
* If the index returned by this function is needed for
* any extended period of time, it should be recalculated
* whenever the #EBookClientCursor:alphabet changes.
* @param contact the #EContact to check
*/
getContactAlphabeticIndex(contact: EBookContacts.Contact): number
/**
* Fetches the number of contacts leading up to the current
* cursor position, inclusive of the current cursor position.
*
* The position value can be anywhere from 0 to the total
* number of contacts plus one. A value of 0 indicates
* that the cursor is positioned before the contact list in
* the symbolic %E_BOOK_CURSOR_ORIGIN_BEGIN state. If
* the position is greater than the total, as returned by
* e_book_client_cursor_get_total(), then the cursor is positioned
* after the last contact in the symbolic %E_BOOK_CURSOR_ORIGIN_END position.
*/
getPosition(): number
/**
* Fetches the total number of contacts in the addressbook
* which match `cursor'`s query
*/
getTotal(): number
/**
* Returns the #EBookClientCursor:client associated with `cursor`.
*
* The returned #EBookClient is referenced because the cursor
* does not keep a strong reference to the client.
*
* Unreference the #EBookClient with g_object_unref() when finished with it.
*/
refClient(): BookClient
/**
* Sets the current cursor position to point to an <link linkend="cursor-alphabet">Alphabetic Index</link>.
*
* See: e_book_client_cursor_set_alphabetic_index_sync().
*
* This asynchronous call is completed with a call to
* e_book_client_cursor_set_alphabetic_index_finish() from the specified `callback`.
* @param index the alphabetic index
* @param cancellable a #GCancellable to optionally cancel this operation while in progress
* @param callback callback to call when a result is ready
*/
setAlphabeticIndex(index: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Completes an asynchronous call initiated by e_book_client_cursor_set_alphabetic_index().
* @param result a #GAsyncResult
*/
setAlphabeticIndexFinish(result: Gio.AsyncResult): boolean
/**
* Sets the cursor to point to an <link linkend="cursor-alphabet">Alphabetic Index</link>.
*
* After setting the alphabetic index, for example the
* index for letter 'E', then further calls to e_book_client_cursor_step()
* will return results starting with the letter 'E' (or results starting
* with the last result in 'D' when navigating through cursor results
* in reverse).
*
* The passed index must be a valid index into the alphabet parameters
* returned by e_book_client_cursor_get_alphabet().
*
* If this method is called from the same thread context in which
* the cursor was created, then the updates to the #EBookClientCursor:position
* property are guaranteed to be delivered synchronously upon successful completion
* of moving the cursor. Otherwise, notifications will be delivered asynchronously
* in the cursor's original thread context.
*
* If this method completes with an %E_CLIENT_ERROR_OUT_OF_SYNC error, it is an
* indication that the addressbook has been set into a new locale and it would be
* unsafe to set the alphabetic index at this time. If you receive an out of sync
* error from this method, then you should wait until an #EBookClientCursor:alphabet
* property change notification is delivered and then proceed to load the new
* alphabet before trying to set any alphabetic index.
* @param index the alphabetic index
* @param cancellable a #GCancellable to optionally cancel this operation while in progress
*/
setAlphabeticIndexSync(index: number, cancellable: Gio.Cancellable | null): boolean
/**
* Sets the <link linkend="cursor-search">Search Expression</link> for the cursor.
*
* See: e_book_client_cursor_set_sexp_sync().
*
* This asynchronous call is completed with a call to
* e_book_client_cursor_set_sexp_finish() from the specified `callback`.
* @param sexp the new search expression for `cursor`
* @param cancellable a #GCancellable to optionally cancel this operation while in progress
* @param callback callback to call when a result is ready
*/
setSexp(sexp: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Completes an asynchronous call initiated by e_book_client_cursor_set_sexp(), reporting
* whether the new search expression was accepted.
* @param result a #GAsyncResult
*/
setSexpFinish(result: Gio.AsyncResult): boolean
/**
* Sets the <link linkend="cursor-search">Search Expression</link> for the cursor.
*
* A side effect of setting the search expression is that the
* <link linkend="cursor-pos-total">position and total</link>
* properties will be updated.
*
* If this method is called from the same thread context in which
* the cursor was created, then the updates to the #EBookClientCursor:position
* and #EBookClientCursor:total properties are guaranteed to be delivered
* synchronously upon successful completion of setting the search expression.
* Otherwise, notifications will be delivered asynchronously in the cursor's
* original thread context.
*
* If the backend does not support the given search expression,
* an %E_CLIENT_ERROR_INVALID_QUERY error will be set.
* @param sexp the new search expression for `cursor`
* @param cancellable a #GCancellable to optionally cancel this operation while in progress
*/
setSexpSync(sexp: string, cancellable: Gio.Cancellable | null): boolean
/**
* <link linkend="cursor-iteration">Steps the cursor through the results</link> by
* a maximum of `count` and fetch the results traversed.
*
* See: e_book_client_cursor_step_sync().
*
* This asynchronous call is completed with a call to
* e_book_client_cursor_step_finish() from the specified `callback`.
* @param flags The #EBookCursorStepFlags for this step
* @param origin The #EBookCursorOrigin from whence to step
* @param count a positive or negative amount of contacts to try and fetch
* @param cancellable a #GCancellable to optionally cancel this operation while in progress
* @param callback callback to call when a result is ready
*/
step(flags: EBookContacts.BookCursorStepFlags, origin: EBookContacts.BookCursorOrigin, count: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void
/**
* Completes an asynchronous call initiated by e_book_client_cursor_step(), fetching
* any contacts which might have been returned by the call.
* @param result a #GAsyncResult
*/
stepFinish(result: Gio.AsyncResult): [ /* returnType */ number, /* outContacts */ EBookContacts.Contact[] ]
/**
* <link linkend="cursor-iteration">Steps the cursor through the results</link> by
* a maximum of `count` and fetch the results traversed.
*
* If `count` is negative, then the cursor will move backwards.
*
* If `cursor` reaches the beginning or end of the query results, then the
* returned list might not contain the amount of desired contacts, or might
* return no results if the cursor currently points to the last contact.
* Reaching the end of the list is not considered an error condition. Attempts
* to step beyond the end of the list after having reached the end of the list
* will however trigger an %E_CLIENT_ERROR_QUERY_REFUSED error.
*
* If %E_BOOK_CURSOR_STEP_FETCH is specified in `flags,` a pointer to
* a %NULL #GSList pointer should be provided for the `results` parameter.
*
* If %E_BOOK_CURSOR_STEP_MOVE is specified in `flags,` then the cursor's
* state will be modified and the <link linkend="cursor-pos-total">position</link>
* property will be updated as a result.
*
* If this method is called from the same thread context in which
* the cursor was created, then the updates to the #EBookClientCursor:position
* property are guaranteed to be delivered synchronously upon successful completion
* of moving the cursor. Otherwise, notifications will be delivered asynchronously
* in the cursor's original thread context.
*
* If this method completes with an %E_CLIENT_ERROR_OUT_OF_SYNC error, it is an
* indication that the addressbook has been modified and it would be unsafe to
* move the cursor at this time. Any %E_CLIENT_ERROR_OUT_OF_SYNC error is guaranteed
* to be followed by an #EBookClientCursor::refresh signal at which point any content
* should be reloaded.
* @param flags The #EBookCursorStepFlags for this step
* @param origin The #EBookCursorOrigin from whence to step
* @param count a positive or negative amount of contacts to try and fetch
* @param cancellable a #GCancellable to optionally cancel this operation while in progress
*/
stepSync(flags: EBookContacts.BookCursorStepFlags, origin: EBookContacts.BookCursorOrigin, count: number, cancellable: Gio.Cancellable | null): [ /* returnType */ number, /* outContacts */ EBookContacts.Contact[] ]
// Own signals of EBook-1.2.EBook.BookClientCursor
connect(sigName: "refresh", callback: BookClientCursor_RefreshSignalCallback): number
on(sigName: "refresh", callback: BookClientCursor_RefreshSignalCallback, after?: boolean): NodeJS.EventEmitter
once(sigName: "refresh", callback: BookClientCursor_RefreshSignalCallback, after?: boolean): NodeJS.EventEmitter
off(sigName: "refresh", callback: BookClientCursor_RefreshSignalCallback): NodeJS.EventEmitter
emit(sigName: "refresh", ...args: any[]): void
// Class property signals of EBook-1.2.EBook.BookClientCursor
connect(sigName: "notify::alphabet", callback: (...args: any[]) => void): number
on(sigName: "notify::alphabet", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::alphabet", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::alphabet", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::alphabet", ...args: any[]): void
connect(sigName: "notify::client", callback: (...args: any[]) => void): number
on(sigName: "notify::client", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::client", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::client", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::client", ...args: any[]): void
connect(sigName: "notify::connection", callback: (...args: any[]) => void): number