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
// // DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsINavBookmarksService.idl // /// `interface nsINavBookmarkObserver : nsISupports` /// /// ```text /// /** /// * Observer for bookmarks changes. /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsINavBookmarkObserver { vtable: *const nsINavBookmarkObserverVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsINavBookmarkObserver. unsafe impl XpCom for nsINavBookmarkObserver { const IID: nsIID = nsID(0x4d00c221, 0x2c4a, 0x47ab, [0xa6, 0x17, 0xab, 0xb3, 0x24, 0x11, 0x04, 0x92]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsINavBookmarkObserver { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsINavBookmarkObserver. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsINavBookmarkObserverCoerce { /// Cheaply cast a value of this type from a `nsINavBookmarkObserver`. fn coerce_from(v: &nsINavBookmarkObserver) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsINavBookmarkObserverCoerce for nsINavBookmarkObserver { #[inline] fn coerce_from(v: &nsINavBookmarkObserver) -> &Self { v } } impl nsINavBookmarkObserver { /// Cast this `nsINavBookmarkObserver` to one of its base interfaces. #[inline] pub fn coerce<T: nsINavBookmarkObserverCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsINavBookmarkObserver { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsINavBookmarkObserverCoerce for T { #[inline] fn coerce_from(v: &nsINavBookmarkObserver) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsINavBookmarkObserver // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsINavBookmarkObserverVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, /* readonly attribute boolean skipTags; */ pub GetSkipTags: unsafe extern "system" fn (this: *const nsINavBookmarkObserver, aSkipTags: *mut bool) -> nsresult, /* readonly attribute boolean skipDescendantsOnItemRemoval; */ pub GetSkipDescendantsOnItemRemoval: unsafe extern "system" fn (this: *const nsINavBookmarkObserver, aSkipDescendantsOnItemRemoval: *mut bool) -> nsresult, /* void onBeginUpdateBatch (); */ pub OnBeginUpdateBatch: unsafe extern "system" fn (this: *const nsINavBookmarkObserver) -> nsresult, /* void onEndUpdateBatch (); */ pub OnEndUpdateBatch: unsafe extern "system" fn (this: *const nsINavBookmarkObserver) -> nsresult, /* void onItemAdded (in long long aItemId, in long long aParentId, in long aIndex, in unsigned short aItemType, in nsIURI aURI, in AUTF8String aTitle, in PRTime aDateAdded, in ACString aGuid, in ACString aParentGuid, in unsigned short aSource); */ pub OnItemAdded: unsafe extern "system" fn (this: *const nsINavBookmarkObserver, aItemId: libc::int64_t, aParentId: libc::int64_t, aIndex: libc::int32_t, aItemType: libc::uint16_t, aURI: *const nsIURI, aTitle: &::nsstring::nsACString, aDateAdded: PRTime, aGuid: &::nsstring::nsACString, aParentGuid: &::nsstring::nsACString, aSource: libc::uint16_t) -> nsresult, /* void onItemRemoved (in long long aItemId, in long long aParentId, in long aIndex, in unsigned short aItemType, in nsIURI aURI, in ACString aGuid, in ACString aParentGuid, in unsigned short aSource); */ pub OnItemRemoved: unsafe extern "system" fn (this: *const nsINavBookmarkObserver, aItemId: libc::int64_t, aParentId: libc::int64_t, aIndex: libc::int32_t, aItemType: libc::uint16_t, aURI: *const nsIURI, aGuid: &::nsstring::nsACString, aParentGuid: &::nsstring::nsACString, aSource: libc::uint16_t) -> nsresult, /* void onItemChanged (in long long aItemId, in ACString aProperty, in boolean aIsAnnotationProperty, in AUTF8String aNewValue, in PRTime aLastModified, in unsigned short aItemType, in long long aParentId, in ACString aGuid, in ACString aParentGuid, in AUTF8String aOldValue, in unsigned short aSource); */ pub OnItemChanged: unsafe extern "system" fn (this: *const nsINavBookmarkObserver, aItemId: libc::int64_t, aProperty: &::nsstring::nsACString, aIsAnnotationProperty: bool, aNewValue: &::nsstring::nsACString, aLastModified: PRTime, aItemType: libc::uint16_t, aParentId: libc::int64_t, aGuid: &::nsstring::nsACString, aParentGuid: &::nsstring::nsACString, aOldValue: &::nsstring::nsACString, aSource: libc::uint16_t) -> nsresult, /* void onItemVisited (in long long aItemId, in long long aVisitId, in PRTime aTime, in unsigned long aTransitionType, in nsIURI aURI, in long long aParentId, in ACString aGuid, in ACString aParentGuid); */ pub OnItemVisited: unsafe extern "system" fn (this: *const nsINavBookmarkObserver, aItemId: libc::int64_t, aVisitId: libc::int64_t, aTime: PRTime, aTransitionType: libc::uint32_t, aURI: *const nsIURI, aParentId: libc::int64_t, aGuid: &::nsstring::nsACString, aParentGuid: &::nsstring::nsACString) -> nsresult, /* void onItemMoved (in long long aItemId, in long long aOldParentId, in long aOldIndex, in long long aNewParentId, in long aNewIndex, in unsigned short aItemType, in ACString aGuid, in ACString aOldParentGuid, in ACString aNewParentGuid, in unsigned short aSource); */ pub OnItemMoved: unsafe extern "system" fn (this: *const nsINavBookmarkObserver, aItemId: libc::int64_t, aOldParentId: libc::int64_t, aOldIndex: libc::int32_t, aNewParentId: libc::int64_t, aNewIndex: libc::int32_t, aItemType: libc::uint16_t, aGuid: &::nsstring::nsACString, aOldParentGuid: &::nsstring::nsACString, aNewParentGuid: &::nsstring::nsACString, aSource: libc::uint16_t) -> nsresult, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsINavBookmarkObserver { /// `readonly attribute boolean skipTags;` #[inline] pub unsafe fn GetSkipTags(&self, aSkipTags: *mut bool) -> nsresult { ((*self.vtable).GetSkipTags)(self, aSkipTags) } /// `readonly attribute boolean skipDescendantsOnItemRemoval;` #[inline] pub unsafe fn GetSkipDescendantsOnItemRemoval(&self, aSkipDescendantsOnItemRemoval: *mut bool) -> nsresult { ((*self.vtable).GetSkipDescendantsOnItemRemoval)(self, aSkipDescendantsOnItemRemoval) } /// ```text /// /** /// * Notifies that a batch transaction has started. /// * Other notifications will be sent during the batch, but the observer is /// * guaranteed that onEndUpdateBatch() will be called at its completion. /// * During a batch the observer should do its best to reduce the work done to /// * handle notifications, since multiple changes are going to happen in a short /// * timeframe. /// */ /// ``` /// /// `void onBeginUpdateBatch ();` #[inline] pub unsafe fn OnBeginUpdateBatch(&self, ) -> nsresult { ((*self.vtable).OnBeginUpdateBatch)(self, ) } /// ```text /// /** /// * Notifies that a batch transaction has ended. /// */ /// ``` /// /// `void onEndUpdateBatch ();` #[inline] pub unsafe fn OnEndUpdateBatch(&self, ) -> nsresult { ((*self.vtable).OnEndUpdateBatch)(self, ) } /// ```text /// /** /// * Notifies that an item (any type) was added. Called after the actual /// * addition took place. /// * When a new item is created, all the items following it in the same folder /// * will have their index shifted down, but no additional notifications will /// * be sent. /// * /// * @param aItemId /// * The id of the item that was added. /// * @param aParentId /// * The id of the folder to which the item was added. /// * @param aIndex /// * The item's index in the folder. /// * @param aItemType /// * The type of the added item (see TYPE_* constants below). /// * @param aURI /// * The URI of the added item if it was TYPE_BOOKMARK, null otherwise. /// * @param aTitle /// * The title of the added item. /// * @param aDateAdded /// * The stored date added value, in microseconds from the epoch. /// * @param aGuid /// * The unique ID associated with the item. /// * @param aParentGuid /// * The unique ID associated with the item's parent. /// * @param aSource /// * A change source constant from nsINavBookmarksService::SOURCE_*, /// * passed to the method that notifies the observer. /// */ /// ``` /// /// `void onItemAdded (in long long aItemId, in long long aParentId, in long aIndex, in unsigned short aItemType, in nsIURI aURI, in AUTF8String aTitle, in PRTime aDateAdded, in ACString aGuid, in ACString aParentGuid, in unsigned short aSource);` #[inline] pub unsafe fn OnItemAdded(&self, aItemId: libc::int64_t, aParentId: libc::int64_t, aIndex: libc::int32_t, aItemType: libc::uint16_t, aURI: *const nsIURI, aTitle: &::nsstring::nsACString, aDateAdded: PRTime, aGuid: &::nsstring::nsACString, aParentGuid: &::nsstring::nsACString, aSource: libc::uint16_t) -> nsresult { ((*self.vtable).OnItemAdded)(self, aItemId, aParentId, aIndex, aItemType, aURI, aTitle, aDateAdded, aGuid, aParentGuid, aSource) } /// ```text /// /** /// * Notifies that an item was removed. Called after the actual remove took /// * place. /// * When an item is removed, all the items following it in the same folder /// * will have their index shifted down, but no additional notifications will /// * be sent. /// * /// * @param aItemId /// * The id of the item that was removed. /// * @param aParentId /// * The id of the folder from which the item was removed. /// * @param aIndex /// * The bookmark's index in the folder. /// * @param aItemType /// * The type of the item to be removed (see TYPE_* constants below). /// * @param aURI /// * The URI of the added item if it was TYPE_BOOKMARK, null otherwise. /// * @param aGuid /// * The unique ID associated with the item. /// * @param aParentGuid /// * The unique ID associated with the item's parent. /// * @param aSource /// * A change source constant from nsINavBookmarksService::SOURCE_*, /// * passed to the method that notifies the observer. /// */ /// ``` /// /// `void onItemRemoved (in long long aItemId, in long long aParentId, in long aIndex, in unsigned short aItemType, in nsIURI aURI, in ACString aGuid, in ACString aParentGuid, in unsigned short aSource);` #[inline] pub unsafe fn OnItemRemoved(&self, aItemId: libc::int64_t, aParentId: libc::int64_t, aIndex: libc::int32_t, aItemType: libc::uint16_t, aURI: *const nsIURI, aGuid: &::nsstring::nsACString, aParentGuid: &::nsstring::nsACString, aSource: libc::uint16_t) -> nsresult { ((*self.vtable).OnItemRemoved)(self, aItemId, aParentId, aIndex, aItemType, aURI, aGuid, aParentGuid, aSource) } /// ```text /// /** /// * Notifies that an item's information has changed. This will be called /// * whenever any attributes like "title" are changed. /// * /// * @param aItemId /// * The id of the item that was changed. /// * @param aProperty /// * The property which changed. Can be null for the removal of all of /// * the annotations, in this case aIsAnnotationProperty is true. /// * @param aIsAnnotationProperty /// * Whether or not aProperty is the name of an annotation. If true /// * aNewValue is always an empty string. /// * @param aNewValue /// * For certain properties, this is set to the new value of the /// * property (see the list below). /// * @param aLastModified /// * The updated last-modified value. /// * @param aItemType /// * The type of the item to be removed (see TYPE_* constants below). /// * @param aParentId /// * The id of the folder containing the item. /// * @param aGuid /// * The unique ID associated with the item. /// * @param aParentGuid /// * The unique ID associated with the item's parent. /// * @param aOldValue /// * For certain properties, this is set to the new value of the /// * property (see the list below). /// * @param aSource /// * A change source constant from nsINavBookmarksService::SOURCE_*, /// * passed to the method that notifies the observer. /// * /// * @note List of values that may be associated with properties: /// * aProperty | aNewValue /// * ===================================================================== /// * guid | The new bookmark guid. /// * cleartime | Empty string (all visits to this item were removed). /// * title | The new title. /// * favicon | The "moz-anno" URL of the new favicon. /// * uri | new URL. /// * tags | Empty string (tags for this item changed) /// * dateAdded | PRTime (as string) when the item was first added. /// * lastModified | PRTime (as string) when the item was last modified. /// * /// * aProperty | aOldValue /// * ===================================================================== /// * guid | The old bookmark guid. /// * cleartime | Empty string (currently unused). /// * title | Empty string (currently unused). /// * favicon | Empty string (currently unused). /// * uri | old URL. /// * tags | Empty string (currently unused). /// * dateAdded | Empty string (currently unused). /// * lastModified | Empty string (currently unused). /// */ /// ``` /// /// `void onItemChanged (in long long aItemId, in ACString aProperty, in boolean aIsAnnotationProperty, in AUTF8String aNewValue, in PRTime aLastModified, in unsigned short aItemType, in long long aParentId, in ACString aGuid, in ACString aParentGuid, in AUTF8String aOldValue, in unsigned short aSource);` #[inline] pub unsafe fn OnItemChanged(&self, aItemId: libc::int64_t, aProperty: &::nsstring::nsACString, aIsAnnotationProperty: bool, aNewValue: &::nsstring::nsACString, aLastModified: PRTime, aItemType: libc::uint16_t, aParentId: libc::int64_t, aGuid: &::nsstring::nsACString, aParentGuid: &::nsstring::nsACString, aOldValue: &::nsstring::nsACString, aSource: libc::uint16_t) -> nsresult { ((*self.vtable).OnItemChanged)(self, aItemId, aProperty, aIsAnnotationProperty, aNewValue, aLastModified, aItemType, aParentId, aGuid, aParentGuid, aOldValue, aSource) } /// ```text /// /** /// * Notifies that the item was visited. Can be invoked only for TYPE_BOOKMARK /// * items. /// * /// * @param aItemId /// * The id of the bookmark that was visited. /// * @param aVisitId /// * The id of the visit. /// * @param aTime /// * The time of the visit. /// * @param aTransitionType /// * The transition for the visit. See nsINavHistoryService::TRANSITION_* /// * constants for a list of possible values. /// * @param aURI /// * The nsIURI for this bookmark. /// * @param aParentId /// * The id of the folder containing the item. /// * @param aGuid /// * The unique ID associated with the item. /// * @param aParentGuid /// * The unique ID associated with the item's parent. /// * /// * @see onItemChanged with property = "cleartime" for when all visits to an /// * item are removed. /// * /// * @note The reported time is the time of the visit that was added, which may /// * be well in the past since the visit time can be specified. This /// * means that the visit the observer is told about may not be the most /// * recent visit for that page. /// */ /// ``` /// /// `void onItemVisited (in long long aItemId, in long long aVisitId, in PRTime aTime, in unsigned long aTransitionType, in nsIURI aURI, in long long aParentId, in ACString aGuid, in ACString aParentGuid);` #[inline] pub unsafe fn OnItemVisited(&self, aItemId: libc::int64_t, aVisitId: libc::int64_t, aTime: PRTime, aTransitionType: libc::uint32_t, aURI: *const nsIURI, aParentId: libc::int64_t, aGuid: &::nsstring::nsACString, aParentGuid: &::nsstring::nsACString) -> nsresult { ((*self.vtable).OnItemVisited)(self, aItemId, aVisitId, aTime, aTransitionType, aURI, aParentId, aGuid, aParentGuid) } /// ```text /// /** /// * Notifies that an item has been moved. /// * /// * @param aItemId /// * The id of the item that was moved. /// * @param aOldParentId /// * The id of the old parent. /// * @param aOldIndex /// * The old index inside the old parent. /// * @param aNewParentId /// * The id of the new parent. /// * @param aNewIndex /// * The index inside the new parent. /// * @param aItemType /// * The type of the item to be removed (see TYPE_* constants below). /// * @param aGuid /// * The unique ID associated with the item. /// * @param aOldParentGuid /// * The unique ID associated with the old item's parent. /// * @param aNewParentGuid /// * The unique ID associated with the new item's parent. /// * @param aSource /// * A change source constant from nsINavBookmarksService::SOURCE_*, /// * passed to the method that notifies the observer. /// */ /// ``` /// /// `void onItemMoved (in long long aItemId, in long long aOldParentId, in long aOldIndex, in long long aNewParentId, in long aNewIndex, in unsigned short aItemType, in ACString aGuid, in ACString aOldParentGuid, in ACString aNewParentGuid, in unsigned short aSource);` #[inline] pub unsafe fn OnItemMoved(&self, aItemId: libc::int64_t, aOldParentId: libc::int64_t, aOldIndex: libc::int32_t, aNewParentId: libc::int64_t, aNewIndex: libc::int32_t, aItemType: libc::uint16_t, aGuid: &::nsstring::nsACString, aOldParentGuid: &::nsstring::nsACString, aNewParentGuid: &::nsstring::nsACString, aSource: libc::uint16_t) -> nsresult { ((*self.vtable).OnItemMoved)(self, aItemId, aOldParentId, aOldIndex, aNewParentId, aNewIndex, aItemType, aGuid, aOldParentGuid, aNewParentGuid, aSource) } } /// `interface nsINavBookmarksService : nsISupports` /// /// ```text /// /** /// * The BookmarksService interface provides methods for managing bookmarked /// * history items. Bookmarks consist of a set of user-customizable /// * folders. A URI in history can be contained in one or more such folders. /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsINavBookmarksService { vtable: *const nsINavBookmarksServiceVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsINavBookmarksService. unsafe impl XpCom for nsINavBookmarksService { const IID: nsIID = nsID(0x24533891, 0xafa6, 0x4663, [0xb7, 0x2d, 0x31, 0x43, 0xd0, 0x3f, 0x1b, 0x04]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsINavBookmarksService { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsINavBookmarksService. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsINavBookmarksServiceCoerce { /// Cheaply cast a value of this type from a `nsINavBookmarksService`. fn coerce_from(v: &nsINavBookmarksService) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsINavBookmarksServiceCoerce for nsINavBookmarksService { #[inline] fn coerce_from(v: &nsINavBookmarksService) -> &Self { v } } impl nsINavBookmarksService { /// Cast this `nsINavBookmarksService` to one of its base interfaces. #[inline] pub fn coerce<T: nsINavBookmarksServiceCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsINavBookmarksService { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsINavBookmarksServiceCoerce for T { #[inline] fn coerce_from(v: &nsINavBookmarksService) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsINavBookmarksService // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsINavBookmarksServiceVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, /* readonly attribute long long placesRoot; */ pub GetPlacesRoot: unsafe extern "system" fn (this: *const nsINavBookmarksService, aPlacesRoot: *mut libc::int64_t) -> nsresult, /* readonly attribute long long bookmarksMenuFolder; */ pub GetBookmarksMenuFolder: unsafe extern "system" fn (this: *const nsINavBookmarksService, aBookmarksMenuFolder: *mut libc::int64_t) -> nsresult, /* readonly attribute long long tagsFolder; */ pub GetTagsFolder: unsafe extern "system" fn (this: *const nsINavBookmarksService, aTagsFolder: *mut libc::int64_t) -> nsresult, /* readonly attribute long long unfiledBookmarksFolder; */ pub GetUnfiledBookmarksFolder: unsafe extern "system" fn (this: *const nsINavBookmarksService, aUnfiledBookmarksFolder: *mut libc::int64_t) -> nsresult, /* readonly attribute long long toolbarFolder; */ pub GetToolbarFolder: unsafe extern "system" fn (this: *const nsINavBookmarksService, aToolbarFolder: *mut libc::int64_t) -> nsresult, /* readonly attribute long long mobileFolder; */ pub GetMobileFolder: unsafe extern "system" fn (this: *const nsINavBookmarksService, aMobileFolder: *mut libc::int64_t) -> nsresult, /* long long insertBookmark (in long long aParentId, in nsIURI aURI, in long aIndex, in AUTF8String aTitle, [optional] in ACString aGuid, [optional] in unsigned short aSource); */ pub InsertBookmark: unsafe extern "system" fn (this: *const nsINavBookmarksService, aParentId: libc::int64_t, aURI: *const nsIURI, aIndex: libc::int32_t, aTitle: &::nsstring::nsACString, aGuid: &::nsstring::nsACString, aSource: libc::uint16_t, _retval: *mut libc::int64_t) -> nsresult, /* void removeItem (in long long aItemId, [optional] in unsigned short aSource); */ pub RemoveItem: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, aSource: libc::uint16_t) -> nsresult, /* long long createFolder (in long long aParentFolder, in AUTF8String name, in long index, [optional] in ACString aGuid, [optional] in unsigned short aSource); */ pub CreateFolder: unsafe extern "system" fn (this: *const nsINavBookmarksService, aParentFolder: libc::int64_t, name: &::nsstring::nsACString, index: libc::int32_t, aGuid: &::nsstring::nsACString, aSource: libc::uint16_t, _retval: *mut libc::int64_t) -> nsresult, /* nsITransaction getRemoveFolderTransaction (in long long aItemId, [optional] in unsigned short aSource); */ pub GetRemoveFolderTransaction: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, aSource: libc::uint16_t, _retval: *mut *const nsITransaction) -> nsresult, /* void removeFolderChildren (in long long aItemId, [optional] in unsigned short aSource); */ pub RemoveFolderChildren: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, aSource: libc::uint16_t) -> nsresult, /* void moveItem (in long long aItemId, in long long aNewParentId, in long aIndex, [optional] in unsigned short aSource); */ pub MoveItem: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, aNewParentId: libc::int64_t, aIndex: libc::int32_t, aSource: libc::uint16_t) -> nsresult, /* long long insertSeparator (in long long aParentId, in long aIndex, [optional] in ACString aGuid, [optional] in unsigned short aSource); */ pub InsertSeparator: unsafe extern "system" fn (this: *const nsINavBookmarksService, aParentId: libc::int64_t, aIndex: libc::int32_t, aGuid: &::nsstring::nsACString, aSource: libc::uint16_t, _retval: *mut libc::int64_t) -> nsresult, /* long long getIdForItemAt (in long long aParentId, in long aIndex); */ pub GetIdForItemAt: unsafe extern "system" fn (this: *const nsINavBookmarksService, aParentId: libc::int64_t, aIndex: libc::int32_t, _retval: *mut libc::int64_t) -> nsresult, /* void setItemTitle (in long long aItemId, in AUTF8String aTitle, [optional] in unsigned short aSource); */ pub SetItemTitle: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, aTitle: &::nsstring::nsACString, aSource: libc::uint16_t) -> nsresult, /* AUTF8String getItemTitle (in long long aItemId); */ pub GetItemTitle: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, _retval: &mut ::nsstring::nsACString) -> nsresult, /* void setItemDateAdded (in long long aItemId, in PRTime aDateAdded, [optional] in unsigned short aSource); */ pub SetItemDateAdded: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, aDateAdded: PRTime, aSource: libc::uint16_t) -> nsresult, /* PRTime getItemDateAdded (in long long aItemId); */ pub GetItemDateAdded: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, _retval: *mut PRTime) -> nsresult, /* void setItemLastModified (in long long aItemId, in PRTime aLastModified, [optional] in unsigned short aSource); */ pub SetItemLastModified: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, aLastModified: PRTime, aSource: libc::uint16_t) -> nsresult, /* PRTime getItemLastModified (in long long aItemId); */ pub GetItemLastModified: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, _retval: *mut PRTime) -> nsresult, /* nsIURI getBookmarkURI (in long long aItemId); */ pub GetBookmarkURI: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, _retval: *mut *const nsIURI) -> nsresult, /* long getItemIndex (in long long aItemId); */ pub GetItemIndex: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, _retval: *mut libc::int32_t) -> nsresult, /* void setItemIndex (in long long aItemId, in long aNewIndex, [optional] in unsigned short aSource); */ pub SetItemIndex: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, aNewIndex: libc::int32_t, aSource: libc::uint16_t) -> nsresult, /* unsigned short getItemType (in long long aItemId); */ pub GetItemType: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, _retval: *mut libc::uint16_t) -> nsresult, /* void changeBookmarkURI (in long long aItemId, in nsIURI aNewURI, [optional] in unsigned short aSource); */ pub ChangeBookmarkURI: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, aNewURI: *const nsIURI, aSource: libc::uint16_t) -> nsresult, /* long long getFolderIdForItem (in long long aItemId); */ pub GetFolderIdForItem: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, _retval: *mut libc::int64_t) -> nsresult, /* void getBookmarkIdsForURI (in nsIURI aURI, [optional] out unsigned long count, [array, size_is (count), retval] out long long bookmarks); */ pub GetBookmarkIdsForURI: unsafe extern "system" fn (this: *const nsINavBookmarksService, aURI: *const nsIURI, count: *mut libc::uint32_t, bookmarks: *mut *mut libc::int64_t) -> nsresult, /* void setKeywordForBookmark (in long long aItemId, in AString aKeyword, [optional] in unsigned short aSource); */ pub SetKeywordForBookmark: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, aKeyword: &::nsstring::nsAString, aSource: libc::uint16_t) -> nsresult, /* AString getKeywordForBookmark (in long long aItemId); */ pub GetKeywordForBookmark: unsafe extern "system" fn (this: *const nsINavBookmarksService, aItemId: libc::int64_t, _retval: &mut ::nsstring::nsAString) -> nsresult, /* void addObserver (in nsINavBookmarkObserver observer, [optional] in boolean ownsWeak); */ pub AddObserver: unsafe extern "system" fn (this: *const nsINavBookmarksService, observer: *const nsINavBookmarkObserver, ownsWeak: bool) -> nsresult, /* void removeObserver (in nsINavBookmarkObserver observer); */ pub RemoveObserver: unsafe extern "system" fn (this: *const nsINavBookmarksService, observer: *const nsINavBookmarkObserver) -> nsresult, /* void getObservers ([optional] out unsigned long count, [array, size_is (count), retval] out nsINavBookmarkObserver observers); */ pub GetObservers: unsafe extern "system" fn (this: *const nsINavBookmarksService, count: *mut libc::uint32_t, observers: *mut *mut *const nsINavBookmarkObserver) -> nsresult, /* void runInBatchMode (in nsINavHistoryBatchCallback aCallback, in nsISupports aUserData); */ pub RunInBatchMode: unsafe extern "system" fn (this: *const nsINavBookmarksService, aCallback: *const nsINavHistoryBatchCallback, aUserData: *const nsISupports) -> nsresult, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsINavBookmarksService { /// ```text /// /** /// * This value should be used for APIs that allow passing in an index /// * where an index is not known, or not required to be specified. /// * e.g.: When appending an item to a folder. /// */ /// ``` /// pub const DEFAULT_INDEX: i64 = -1; pub const TYPE_BOOKMARK: i64 = 1; pub const TYPE_FOLDER: i64 = 2; pub const TYPE_SEPARATOR: i64 = 3; pub const TYPE_DYNAMIC_CONTAINER: i64 = 4; pub const SOURCE_DEFAULT: i64 = 0; pub const SOURCE_SYNC: i64 = 1; pub const SOURCE_IMPORT: i64 = 2; pub const SOURCE_IMPORT_REPLACE: i64 = 3; pub const SOURCE_SYNC_REPARENT_REMOVED_FOLDER_CHILDREN: i64 = 4; /// ```text /// /** /// * Sync status flags. /// */ /// ``` /// pub const SYNC_STATUS_UNKNOWN: i64 = 0; pub const SYNC_STATUS_NEW: i64 = 1; pub const SYNC_STATUS_NORMAL: i64 = 2; /// ```text /// /** /// * The item ID of the Places root. /// */ /// ``` /// /// `readonly attribute long long placesRoot;` #[inline] pub unsafe fn GetPlacesRoot(&self, aPlacesRoot: *mut libc::int64_t) -> nsresult { ((*self.vtable).GetPlacesRoot)(self, aPlacesRoot) } /// ```text /// /** /// * The item ID of the bookmarks menu folder. /// */ /// ``` /// /// `readonly attribute long long bookmarksMenuFolder;` #[inline] pub unsafe fn GetBookmarksMenuFolder(&self, aBookmarksMenuFolder: *mut libc::int64_t) -> nsresult { ((*self.vtable).GetBookmarksMenuFolder)(self, aBookmarksMenuFolder) } /// ```text /// /** /// * The item ID of the top-level folder that contain the tag "folders". /// */ /// ``` /// /// `readonly attribute long long tagsFolder;` #[inline] pub unsafe fn GetTagsFolder(&self, aTagsFolder: *mut libc::int64_t) -> nsresult { ((*self.vtable).GetTagsFolder)(self, aTagsFolder) } /// ```text /// /** /// * The item ID of the unfiled-bookmarks folder. /// */ /// ``` /// /// `readonly attribute long long unfiledBookmarksFolder;` #[inline] pub unsafe fn GetUnfiledBookmarksFolder(&self, aUnfiledBookmarksFolder: *mut libc::int64_t) -> nsresult { ((*self.vtable).GetUnfiledBookmarksFolder)(self, aUnfiledBookmarksFolder) } /// ```text /// /** /// * The item ID of the personal toolbar folder. /// */ /// ``` /// /// `readonly attribute long long toolbarFolder;` #[inline] pub unsafe fn GetToolbarFolder(&self, aToolbarFolder: *mut libc::int64_t) -> nsresult { ((*self.vtable).GetToolbarFolder)(self, aToolbarFolder) } /// ```text /// /** /// * The item ID of the mobile bookmarks folder. /// */ /// ``` /// /// `readonly attribute long long mobileFolder;` #[inline] pub unsafe fn GetMobileFolder(&self, aMobileFolder: *mut libc::int64_t) -> nsresult { ((*self.vtable).GetMobileFolder)(self, aMobileFolder) } /// ```text /// /** /// * Inserts a child bookmark into the given folder. /// * /// * @param aParentId /// * The id of the parent folder /// * @param aURI /// * The URI to insert /// * @param aIndex /// * The index to insert at, or DEFAULT_INDEX to append /// * @param aTitle /// * The title for the new bookmark /// * @param [optional] aGuid /// * The GUID to be set for the new item. If not set, a new GUID is /// * generated. Unless you've a very sound reason, such as an undo /// * manager implementation, do not pass this argument. /// * @param [optional] aSource /// * The change source. This is forwarded to all bookmark observers, /// * allowing them to distinguish between insertions from different /// * callers. Defaults to SOURCE_DEFAULT if omitted. /// * @return The ID of the newly-created bookmark. /// * /// * @note aTitle will be truncated to TITLE_LENGTH_MAX and /// * aURI will be truncated to URI_LENGTH_MAX. /// * @throws if aGuid is malformed. /// */ /// ``` /// /// `long long insertBookmark (in long long aParentId, in nsIURI aURI, in long aIndex, in AUTF8String aTitle, [optional] in ACString aGuid, [optional] in unsigned short aSource);` #[inline] pub unsafe fn InsertBookmark(&self, aParentId: libc::int64_t, aURI: *const nsIURI, aIndex: libc::int32_t, aTitle: &::nsstring::nsACString, aGuid: &::nsstring::nsACString, aSource: libc::uint16_t, _retval: *mut libc::int64_t) -> nsresult { ((*self.vtable).InsertBookmark)(self, aParentId, aURI, aIndex, aTitle, aGuid, aSource, _retval) } /// ```text /// /** /// * Removes a child item. Used to delete a bookmark or separator. /// * @param aItemId /// * The child item to remove /// * @param [optional] aSource /// * The change source, forwarded to all bookmark observers. Defaults /// * to SOURCE_DEFAULT. /// */ /// ``` /// /// `void removeItem (in long long aItemId, [optional] in unsigned short aSource);` #[inline] pub unsafe fn RemoveItem(&self, aItemId: libc::int64_t, aSource: libc::uint16_t) -> nsresult { ((*self.vtable).RemoveItem)(self, aItemId, aSource) } /// ```text /// /** /// * Creates a new child folder and inserts it under the given parent. /// * @param aParentFolder /// * The id of the parent folder /// * @param aName /// * The name of the new folder /// * @param aIndex /// * The index to insert at, or DEFAULT_INDEX to append /// * @param [optional] aGuid /// * The GUID to be set for the new item. If not set, a new GUID is /// * generated. Unless you've a very sound reason, such as an undo /// * manager implementation, do not pass this argument. /// * @param [optional] aSource /// * The change source, forwarded to all bookmark observers. Defaults /// * to SOURCE_DEFAULT. /// * @return The ID of the newly-inserted folder. /// * @throws if aGuid is malformed. /// */ /// ``` /// /// `long long createFolder (in long long aParentFolder, in AUTF8String name, in long index, [optional] in ACString aGuid, [optional] in unsigned short aSource);` #[inline] pub unsafe fn CreateFolder(&self, aParentFolder: libc::int64_t, name: &::nsstring::nsACString, index: libc::int32_t, aGuid: &::nsstring::nsACString, aSource: libc::uint16_t, _retval: *mut libc::int64_t) -> nsresult { ((*self.vtable).CreateFolder)(self, aParentFolder, name, index, aGuid, aSource, _retval) } /// ```text /// /** /// * Gets an undo-able transaction for removing a folder from the bookmarks /// * tree. /// * @param aItemId /// * The id of the folder to remove. /// * @param [optional] aSource /// * The change source, forwarded to all bookmark observers. Defaults /// * to SOURCE_DEFAULT. /// * @return An object implementing nsITransaction that can be used to undo /// * or redo the action. /// * /// * This method exists because complex delete->undo operations rely on /// * recreated folders to have the same ID they had before they were deleted, /// * so that any other items deleted in different transactions can be /// * re-inserted correctly. This provides a safe encapsulation of this /// * functionality without exposing the ability to recreate folders with /// * specific IDs (potentially dangerous if abused by other code!) in the /// * public API. /// */ /// ``` /// /// `nsITransaction getRemoveFolderTransaction (in long long aItemId, [optional] in unsigned short aSource);` #[inline] pub unsafe fn GetRemoveFolderTransaction(&self, aItemId: libc::int64_t, aSource: libc::uint16_t, _retval: *mut *const nsITransaction) -> nsresult { ((*self.vtable).GetRemoveFolderTransaction)(self, aItemId, aSource, _retval) } /// ```text /// /** /// * Convenience function for container services. Removes /// * all children of the given folder. /// * @param aItemId /// * The id of the folder to remove children from. /// * @param [optional] aSource /// * The change source, forwarded to all bookmark observers. Defaults /// * to SOURCE_DEFAULT. /// */ /// ``` /// /// `void removeFolderChildren (in long long aItemId, [optional] in unsigned short aSource);` #[inline] pub unsafe fn RemoveFolderChildren(&self, aItemId: libc::int64_t, aSource: libc::uint16_t) -> nsresult { ((*self.vtable).RemoveFolderChildren)(self, aItemId, aSource) } /// ```text /// /** /// * Moves an item to a different container, preserving its contents. /// * @param aItemId /// * The id of the item to move /// * @param aNewParentId /// * The id of the new parent /// * @param aIndex /// * The index under aNewParent, or DEFAULT_INDEX to append /// * @param [optional] aSource /// * The change source, forwarded to all bookmark observers. Defaults /// * to SOURCE_DEFAULT. /// * /// * NOTE: When moving down in the same container we take into account the /// * removal of the original item. If you want to move from index X to /// * index Y > X you must use moveItem(id, folder, Y + 1) /// */ /// ``` /// /// `void moveItem (in long long aItemId, in long long aNewParentId, in long aIndex, [optional] in unsigned short aSource);` #[inline] pub unsafe fn MoveItem(&self, aItemId: libc::int64_t, aNewParentId: libc::int64_t, aIndex: libc::int32_t, aSource: libc::uint16_t) -> nsresult { ((*self.vtable).MoveItem)(self, aItemId, aNewParentId, aIndex, aSource) } /// ```text /// /** /// * Inserts a bookmark separator into the given folder at the given index. /// * The separator can be removed using removeChildAt(). /// * @param aParentId /// * The id of the parent folder /// * @param aIndex /// * The separator's index under folder, or DEFAULT_INDEX to append /// * @param [optional] aGuid /// * The GUID to be set for the new item. If not set, a new GUID is /// * generated. Unless you've a very sound reason, such as an undo /// * manager implementation, do not pass this argument. /// * @param [optional] aSource /// * The change source, forwarded to all bookmark observers. Defaults /// * to SOURCE_DEFAULT. /// * @return The ID of the new separator. /// * @throws if aGuid is malformed. /// */ /// ``` /// /// `long long insertSeparator (in long long aParentId, in long aIndex, [optional] in ACString aGuid, [optional] in unsigned short aSource);` #[inline] pub unsafe fn InsertSeparator(&self, aParentId: libc::int64_t, aIndex: libc::int32_t, aGuid: &::nsstring::nsACString, aSource: libc::uint16_t, _retval: *mut libc::int64_t) -> nsresult { ((*self.vtable).InsertSeparator)(self, aParentId, aIndex, aGuid, aSource, _retval) } /// ```text /// /** /// * Get the itemId given the containing folder and the index. /// * @param aParentId /// * The id of the diret parent folder of the item /// * @param aIndex /// * The index of the item within the parent folder. /// * Pass DEFAULT_INDEX for the last item. /// * @return The ID of the found item, -1 if the item does not exists. /// */ /// ``` /// /// `long long getIdForItemAt (in long long aParentId, in long aIndex);` #[inline] pub unsafe fn GetIdForItemAt(&self, aParentId: libc::int64_t, aIndex: libc::int32_t, _retval: *mut libc::int64_t) -> nsresult { ((*self.vtable).GetIdForItemAt)(self, aParentId, aIndex, _retval) } /// ```text /// /** /// * Set the title for an item. /// * @param aItemId /// * The id of the item whose title should be updated. /// * @param aTitle /// * The new title for the bookmark. /// * @param [optional] aSource /// * The change source, forwarded to all bookmark observers. Defaults /// * to SOURCE_DEFAULT. /// * /// * @note aTitle will be truncated to TITLE_LENGTH_MAX. /// */ /// ``` /// /// `void setItemTitle (in long long aItemId, in AUTF8String aTitle, [optional] in unsigned short aSource);` #[inline] pub unsafe fn SetItemTitle(&self, aItemId: libc::int64_t, aTitle: &::nsstring::nsACString, aSource: libc::uint16_t) -> nsresult { ((*self.vtable).SetItemTitle)(self, aItemId, aTitle, aSource) } /// ```text /// /** /// * Get the title for an item. /// * /// * If no item title is available it will return a void string (null in JS). /// * /// * @param aItemId /// * The id of the item whose title should be retrieved /// * @return The title of the item. /// */ /// ``` /// /// `AUTF8String getItemTitle (in long long aItemId);` #[inline] pub unsafe fn GetItemTitle(&self, aItemId: libc::int64_t, _retval: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetItemTitle)(self, aItemId, _retval) } /// ```text /// /** /// * Set the date added time for an item. /// * /// * @param aItemId /// * the id of the item whose date added time should be updated. /// * @param aDateAdded /// * the new date added value in microseconds. Note that it is rounded /// * down to milliseconds precision. /// * @param [optional] aSource /// * The change source, forwarded to all bookmark observers. Defaults /// * to SOURCE_DEFAULT. /// */ /// ``` /// /// `void setItemDateAdded (in long long aItemId, in PRTime aDateAdded, [optional] in unsigned short aSource);` #[inline] pub unsafe fn SetItemDateAdded(&self, aItemId: libc::int64_t, aDateAdded: PRTime, aSource: libc::uint16_t) -> nsresult { ((*self.vtable).SetItemDateAdded)(self, aItemId, aDateAdded, aSource) } /// ```text /// /** /// * Get the date added time for an item. /// * /// * @param aItemId /// * the id of the item whose date added time should be retrieved. /// * /// * @return the date added value in microseconds. /// */ /// ``` /// /// `PRTime getItemDateAdded (in long long aItemId);` #[inline] pub unsafe fn GetItemDateAdded(&self, aItemId: libc::int64_t, _retval: *mut PRTime) -> nsresult { ((*self.vtable).GetItemDateAdded)(self, aItemId, _retval) } /// ```text /// /** /// * Set the last modified time for an item. /// * /// * @param aItemId /// * the id of the item whose last modified time should be updated. /// * @param aLastModified /// * the new last modified value in microseconds. Note that it is /// * rounded down to milliseconds precision. /// * @param [optional] aSource /// * The change source, forwarded to all bookmark observers. Defaults /// * to SOURCE_DEFAULT. /// * /// * @note This is the only method that will send an itemChanged notification /// * for the property. lastModified will still be updated in /// * any other method that changes an item property, but we will send /// * the corresponding itemChanged notification instead. /// */ /// ``` /// /// `void setItemLastModified (in long long aItemId, in PRTime aLastModified, [optional] in unsigned short aSource);` #[inline] pub unsafe fn SetItemLastModified(&self, aItemId: libc::int64_t, aLastModified: PRTime, aSource: libc::uint16_t) -> nsresult { ((*self.vtable).SetItemLastModified)(self, aItemId, aLastModified, aSource) } /// ```text /// /** /// * Get the last modified time for an item. /// * /// * @param aItemId /// * the id of the item whose last modified time should be retrieved. /// * /// * @return the date added value in microseconds. /// * /// * @note When an item is added lastModified is set to the same value as /// * dateAdded. /// */ /// ``` /// /// `PRTime getItemLastModified (in long long aItemId);` #[inline] pub unsafe fn GetItemLastModified(&self, aItemId: libc::int64_t, _retval: *mut PRTime) -> nsresult { ((*self.vtable).GetItemLastModified)(self, aItemId, _retval) } /// ```text /// /** /// * Get the URI for a bookmark item. /// */ /// ``` /// /// `nsIURI getBookmarkURI (in long long aItemId);` #[inline] pub unsafe fn GetBookmarkURI(&self, aItemId: libc::int64_t, _retval: *mut *const nsIURI) -> nsresult { ((*self.vtable).GetBookmarkURI)(self, aItemId, _retval) } /// ```text /// /** /// * Get the index for an item. /// */ /// ``` /// /// `long getItemIndex (in long long aItemId);` #[inline] pub unsafe fn GetItemIndex(&self, aItemId: libc::int64_t, _retval: *mut libc::int32_t) -> nsresult { ((*self.vtable).GetItemIndex)(self, aItemId, _retval) } /// ```text /// /** /// * Changes the index for a item. This method does not change the indices of /// * any other items in the same folder, so ensure that the new index does not /// * already exist, or change the index of other items accordingly, otherwise /// * the indices will become corrupted. /// * /// * WARNING: This is API is intended for scenarios such as folder sorting, /// * where the caller manages the indices of *all* items in the folder. /// * You must always ensure each index is unique after a reordering. /// * /// * @param aItemId The id of the item to modify /// * @param aNewIndex The new index /// * @param aSource The optional change source, forwarded to all bookmark /// * observers. Defaults to SOURCE_DEFAULT. /// * /// * @throws If aNewIndex is out of bounds. /// */ /// ``` /// /// `void setItemIndex (in long long aItemId, in long aNewIndex, [optional] in unsigned short aSource);` #[inline] pub unsafe fn SetItemIndex(&self, aItemId: libc::int64_t, aNewIndex: libc::int32_t, aSource: libc::uint16_t) -> nsresult { ((*self.vtable).SetItemIndex)(self, aItemId, aNewIndex, aSource) } /// ```text /// /** /// * Get an item's type (bookmark, separator, folder). /// * The type is one of the TYPE_* constants defined above. /// */ /// ``` /// /// `unsigned short getItemType (in long long aItemId);` #[inline] pub unsafe fn GetItemType(&self, aItemId: libc::int64_t, _retval: *mut libc::uint16_t) -> nsresult { ((*self.vtable).GetItemType)(self, aItemId, _retval) } /// ```text /// /** /// * Change the bookmarked URI for a bookmark. /// * This changes which "place" the bookmark points at, /// * which means all annotations, etc are carried along. /// */ /// ``` /// /// `void changeBookmarkURI (in long long aItemId, in nsIURI aNewURI, [optional] in unsigned short aSource);` #[inline] pub unsafe fn ChangeBookmarkURI(&self, aItemId: libc::int64_t, aNewURI: *const nsIURI, aSource: libc::uint16_t) -> nsresult { ((*self.vtable).ChangeBookmarkURI)(self, aItemId, aNewURI, aSource) } /// ```text /// /** /// * Get the parent folder's id for an item. /// */ /// ``` /// /// `long long getFolderIdForItem (in long long aItemId);` #[inline] pub unsafe fn GetFolderIdForItem(&self, aItemId: libc::int64_t, _retval: *mut libc::int64_t) -> nsresult { ((*self.vtable).GetFolderIdForItem)(self, aItemId, _retval) } /// ```text /// /** /// * Returns the list of bookmark ids that contain the given URI. /// */ /// ``` /// /// `void getBookmarkIdsForURI (in nsIURI aURI, [optional] out unsigned long count, [array, size_is (count), retval] out long long bookmarks);` #[inline] pub unsafe fn GetBookmarkIdsForURI(&self, aURI: *const nsIURI, count: *mut libc::uint32_t, bookmarks: *mut *mut libc::int64_t) -> nsresult { ((*self.vtable).GetBookmarkIdsForURI)(self, aURI, count, bookmarks) } /// ```text /// /** /// * Associates the given keyword with the given bookmark. /// * /// * Use an empty keyword to clear the keyword associated with the URI. /// * In both of these cases, succeeds but does nothing if the URL/keyword is not found. /// * /// * @deprecated Use PlacesUtils.keywords.insert() API instead. /// */ /// ``` /// /// `void setKeywordForBookmark (in long long aItemId, in AString aKeyword, [optional] in unsigned short aSource);` #[inline] pub unsafe fn SetKeywordForBookmark(&self, aItemId: libc::int64_t, aKeyword: &::nsstring::nsAString, aSource: libc::uint16_t) -> nsresult { ((*self.vtable).SetKeywordForBookmark)(self, aItemId, aKeyword, aSource) } /// ```text /// /** /// * Retrieves the keyword for the given bookmark. Will be void string /// * (null in JS) if no such keyword is found. /// * /// * @deprecated Use PlacesUtils.keywords.fetch() API instead. /// */ /// ``` /// /// `AString getKeywordForBookmark (in long long aItemId);` #[inline] pub unsafe fn GetKeywordForBookmark(&self, aItemId: libc::int64_t, _retval: &mut ::nsstring::nsAString) -> nsresult { ((*self.vtable).GetKeywordForBookmark)(self, aItemId, _retval) } /// ```text /// /** /// * Adds a bookmark observer. If ownsWeak is false, the bookmark service will /// * keep an owning reference to the observer. If ownsWeak is true, then /// * aObserver must implement nsISupportsWeakReference, and the bookmark /// * service will keep a weak reference to the observer. /// */ /// ``` /// /// `void addObserver (in nsINavBookmarkObserver observer, [optional] in boolean ownsWeak);` #[inline] pub unsafe fn AddObserver(&self, observer: *const nsINavBookmarkObserver, ownsWeak: bool) -> nsresult { ((*self.vtable).AddObserver)(self, observer, ownsWeak) } /// ```text /// /** /// * Removes a bookmark observer. /// */ /// ``` /// /// `void removeObserver (in nsINavBookmarkObserver observer);` #[inline] pub unsafe fn RemoveObserver(&self, observer: *const nsINavBookmarkObserver) -> nsresult { ((*self.vtable).RemoveObserver)(self, observer) } /// ```text /// /** /// * Gets an array of registered nsINavBookmarkObserver objects. /// */ /// ``` /// /// `void getObservers ([optional] out unsigned long count, [array, size_is (count), retval] out nsINavBookmarkObserver observers);` #[inline] pub unsafe fn GetObservers(&self, count: *mut libc::uint32_t, observers: *mut *mut *const nsINavBookmarkObserver) -> nsresult { ((*self.vtable).GetObservers)(self, count, observers) } /// ```text /// /** /// * Runs the passed callback inside of a database transaction. /// * Use this when a lot of things are about to change, for example /// * adding or deleting a large number of bookmark items. Calls can /// * be nested. Observers are notified when batches begin and end, via /// * nsINavBookmarkObserver.onBeginUpdateBatch/onEndUpdateBatch. /// * /// * @param aCallback /// * nsINavHistoryBatchCallback interface to call. /// * @param aUserData /// * Opaque parameter passed to nsINavBookmarksBatchCallback /// */ /// ``` /// /// `void runInBatchMode (in nsINavHistoryBatchCallback aCallback, in nsISupports aUserData);` #[inline] pub unsafe fn RunInBatchMode(&self, aCallback: *const nsINavHistoryBatchCallback, aUserData: *const nsISupports) -> nsresult { ((*self.vtable).RunInBatchMode)(self, aCallback, aUserData) } }