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
// // DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsIURI.idl // /// `interface nsIURI : nsISupports` /// /// ```text /// /** /// * nsIURI - interface for an uniform resource identifier w/ i18n support. /// * /// * AUTF8String attributes may contain unescaped UTF-8 characters. /// * Consumers should be careful to escape the UTF-8 strings as necessary, but /// * should always try to "display" the UTF-8 version as provided by this /// * interface. /// * /// * AUTF8String attributes may also contain escaped characters. /// * /// * Unescaping URI segments is unadvised unless there is intimate /// * knowledge of the underlying charset or there is no plan to display (or /// * otherwise enforce a charset on) the resulting URI substring. /// * /// * The correct way to create an nsIURI from a string is via /// * nsIIOService.newURI. /// * /// * NOTE: nsBinaryInputStream::ReadObject contains a hackaround to intercept the /// * old (pre-gecko6) nsIURI IID and swap in the current IID instead, in order /// * for sessionstore to work after an upgrade. If this IID is revved further, /// * we will need to add additional checks there for all intermediate IIDs, until /// * ContentPrincipal is fixed to serialize its URIs as nsISupports (bug 662693). /// */ /// ``` /// // 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 nsIURI { vtable: *const nsIURIVTable, /// 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 nsIURI. unsafe impl XpCom for nsIURI { const IID: nsIID = nsID(0x92073a54, 0x6d78, 0x4f30, [0x91, 0x3a, 0xb8, 0x71, 0x81, 0x32, 0x08, 0xc6]); } // 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 nsIURI { #[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 nsIURI. // 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 nsIURICoerce { /// Cheaply cast a value of this type from a `nsIURI`. fn coerce_from(v: &nsIURI) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIURICoerce for nsIURI { #[inline] fn coerce_from(v: &nsIURI) -> &Self { v } } impl nsIURI { /// Cast this `nsIURI` to one of its base interfaces. #[inline] pub fn coerce<T: nsIURICoerce>(&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 nsIURI { 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> nsIURICoerce for T { #[inline] fn coerce_from(v: &nsIURI) -> &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 nsIURI // 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 nsIURIVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, /* attribute AUTF8String spec; */ pub GetSpec: unsafe extern "system" fn (this: *const nsIURI, aSpec: &mut ::nsstring::nsACString) -> nsresult, /* attribute AUTF8String spec; */ pub SetSpec: unsafe extern "system" fn (this: *const nsIURI, aSpec: &::nsstring::nsACString) -> nsresult, /* readonly attribute AUTF8String prePath; */ pub GetPrePath: unsafe extern "system" fn (this: *const nsIURI, aPrePath: &mut ::nsstring::nsACString) -> nsresult, /* attribute ACString scheme; */ pub GetScheme: unsafe extern "system" fn (this: *const nsIURI, aScheme: &mut ::nsstring::nsACString) -> nsresult, /* attribute ACString scheme; */ pub SetScheme: unsafe extern "system" fn (this: *const nsIURI, aScheme: &::nsstring::nsACString) -> nsresult, /* attribute AUTF8String userPass; */ pub GetUserPass: unsafe extern "system" fn (this: *const nsIURI, aUserPass: &mut ::nsstring::nsACString) -> nsresult, /* attribute AUTF8String userPass; */ pub SetUserPass: unsafe extern "system" fn (this: *const nsIURI, aUserPass: &::nsstring::nsACString) -> nsresult, /* attribute AUTF8String username; */ pub GetUsername: unsafe extern "system" fn (this: *const nsIURI, aUsername: &mut ::nsstring::nsACString) -> nsresult, /* attribute AUTF8String username; */ pub SetUsername: unsafe extern "system" fn (this: *const nsIURI, aUsername: &::nsstring::nsACString) -> nsresult, /* attribute AUTF8String password; */ pub GetPassword: unsafe extern "system" fn (this: *const nsIURI, aPassword: &mut ::nsstring::nsACString) -> nsresult, /* attribute AUTF8String password; */ pub SetPassword: unsafe extern "system" fn (this: *const nsIURI, aPassword: &::nsstring::nsACString) -> nsresult, /* attribute AUTF8String hostPort; */ pub GetHostPort: unsafe extern "system" fn (this: *const nsIURI, aHostPort: &mut ::nsstring::nsACString) -> nsresult, /* attribute AUTF8String hostPort; */ pub SetHostPort: unsafe extern "system" fn (this: *const nsIURI, aHostPort: &::nsstring::nsACString) -> nsresult, /* void setHostAndPort (in AUTF8String hostport); */ pub SetHostAndPort: unsafe extern "system" fn (this: *const nsIURI, hostport: &::nsstring::nsACString) -> nsresult, /* attribute AUTF8String host; */ pub GetHost: unsafe extern "system" fn (this: *const nsIURI, aHost: &mut ::nsstring::nsACString) -> nsresult, /* attribute AUTF8String host; */ pub SetHost: unsafe extern "system" fn (this: *const nsIURI, aHost: &::nsstring::nsACString) -> nsresult, /* attribute long port; */ pub GetPort: unsafe extern "system" fn (this: *const nsIURI, aPort: *mut libc::int32_t) -> nsresult, /* attribute long port; */ pub SetPort: unsafe extern "system" fn (this: *const nsIURI, aPort: libc::int32_t) -> nsresult, /* attribute AUTF8String pathQueryRef; */ pub GetPathQueryRef: unsafe extern "system" fn (this: *const nsIURI, aPathQueryRef: &mut ::nsstring::nsACString) -> nsresult, /* attribute AUTF8String pathQueryRef; */ pub SetPathQueryRef: unsafe extern "system" fn (this: *const nsIURI, aPathQueryRef: &::nsstring::nsACString) -> nsresult, /* boolean equals (in nsIURI other); */ pub Equals: unsafe extern "system" fn (this: *const nsIURI, other: *const nsIURI, _retval: *mut bool) -> nsresult, /* boolean schemeIs (in string scheme); */ pub SchemeIs: unsafe extern "system" fn (this: *const nsIURI, scheme: *const libc::c_char, _retval: *mut bool) -> nsresult, /* nsIURI clone (); */ pub Clone: unsafe extern "system" fn (this: *const nsIURI, _retval: *mut *const nsIURI) -> nsresult, /* AUTF8String resolve (in AUTF8String relativePath); */ pub Resolve: unsafe extern "system" fn (this: *const nsIURI, relativePath: &::nsstring::nsACString, _retval: &mut ::nsstring::nsACString) -> nsresult, /* readonly attribute ACString asciiSpec; */ pub GetAsciiSpec: unsafe extern "system" fn (this: *const nsIURI, aAsciiSpec: &mut ::nsstring::nsACString) -> nsresult, /* readonly attribute ACString asciiHostPort; */ pub GetAsciiHostPort: unsafe extern "system" fn (this: *const nsIURI, aAsciiHostPort: &mut ::nsstring::nsACString) -> nsresult, /* readonly attribute ACString asciiHost; */ pub GetAsciiHost: unsafe extern "system" fn (this: *const nsIURI, aAsciiHost: &mut ::nsstring::nsACString) -> nsresult, /* attribute AUTF8String ref; */ pub GetRef: unsafe extern "system" fn (this: *const nsIURI, aRef: &mut ::nsstring::nsACString) -> nsresult, /* attribute AUTF8String ref; */ pub SetRef: unsafe extern "system" fn (this: *const nsIURI, aRef: &::nsstring::nsACString) -> nsresult, /* boolean equalsExceptRef (in nsIURI other); */ pub EqualsExceptRef: unsafe extern "system" fn (this: *const nsIURI, other: *const nsIURI, _retval: *mut bool) -> nsresult, /* nsIURI cloneIgnoringRef (); */ pub CloneIgnoringRef: unsafe extern "system" fn (this: *const nsIURI, _retval: *mut *const nsIURI) -> nsresult, /* nsIURI cloneWithNewRef (in AUTF8String newRef); */ pub CloneWithNewRef: unsafe extern "system" fn (this: *const nsIURI, newRef: &::nsstring::nsACString, _retval: *mut *const nsIURI) -> nsresult, /* readonly attribute AUTF8String specIgnoringRef; */ pub GetSpecIgnoringRef: unsafe extern "system" fn (this: *const nsIURI, aSpecIgnoringRef: &mut ::nsstring::nsACString) -> nsresult, /* readonly attribute boolean hasRef; */ pub GetHasRef: unsafe extern "system" fn (this: *const nsIURI, aHasRef: *mut bool) -> nsresult, /* attribute AUTF8String filePath; */ pub GetFilePath: unsafe extern "system" fn (this: *const nsIURI, aFilePath: &mut ::nsstring::nsACString) -> nsresult, /* attribute AUTF8String filePath; */ pub SetFilePath: unsafe extern "system" fn (this: *const nsIURI, aFilePath: &::nsstring::nsACString) -> nsresult, /* attribute AUTF8String query; */ pub GetQuery: unsafe extern "system" fn (this: *const nsIURI, aQuery: &mut ::nsstring::nsACString) -> nsresult, /* attribute AUTF8String query; */ pub SetQuery: unsafe extern "system" fn (this: *const nsIURI, aQuery: &::nsstring::nsACString) -> nsresult, /* [noscript] void setQueryWithEncoding (in AUTF8String query, in Encoding encoding); */ /// Unable to generate binding because `native type const mozilla::Encoding is unsupported` pub SetQueryWithEncoding: *const ::libc::c_void, /* readonly attribute AUTF8String displayHost; */ pub GetDisplayHost: unsafe extern "system" fn (this: *const nsIURI, aDisplayHost: &mut ::nsstring::nsACString) -> nsresult, /* readonly attribute AUTF8String displayHostPort; */ pub GetDisplayHostPort: unsafe extern "system" fn (this: *const nsIURI, aDisplayHostPort: &mut ::nsstring::nsACString) -> nsresult, /* readonly attribute AUTF8String displaySpec; */ pub GetDisplaySpec: unsafe extern "system" fn (this: *const nsIURI, aDisplaySpec: &mut ::nsstring::nsACString) -> nsresult, /* readonly attribute AUTF8String displayPrePath; */ pub GetDisplayPrePath: unsafe extern "system" fn (this: *const nsIURI, aDisplayPrePath: &mut ::nsstring::nsACString) -> nsresult, /* nsIURIMutator mutate (); */ pub Mutate: unsafe extern "system" fn (this: *const nsIURI, _retval: *mut *const nsIURIMutator) -> 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 nsIURI { /// ```text /// /************************************************************************ /// * The URI is broken down into the following principal components: /// */ /// /** /// * Returns a string representation of the URI. Setting the spec causes /// * the new spec to be parsed per the rules for the scheme the URI /// * currently has. In particular, setting the spec to a URI string with a /// * different scheme will generally produce incorrect results; no one /// * outside of a protocol handler implementation should be doing that. If /// * the URI stores information from the nsIIOService.newURI call used to /// * create it other than just the parsed string, then behavior of this /// * information on setting the spec attribute is undefined. /// * /// * Some characters may be escaped. /// */ /// ``` /// /// `attribute AUTF8String spec;` #[inline] pub unsafe fn GetSpec(&self, aSpec: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetSpec)(self, aSpec) } /// ```text /// /************************************************************************ /// * The URI is broken down into the following principal components: /// */ /// /** /// * Returns a string representation of the URI. Setting the spec causes /// * the new spec to be parsed per the rules for the scheme the URI /// * currently has. In particular, setting the spec to a URI string with a /// * different scheme will generally produce incorrect results; no one /// * outside of a protocol handler implementation should be doing that. If /// * the URI stores information from the nsIIOService.newURI call used to /// * create it other than just the parsed string, then behavior of this /// * information on setting the spec attribute is undefined. /// * /// * Some characters may be escaped. /// */ /// ``` /// /// `attribute AUTF8String spec;` #[inline] pub unsafe fn SetSpec(&self, aSpec: &::nsstring::nsACString) -> nsresult { ((*self.vtable).SetSpec)(self, aSpec) } /// ```text /// /** /// * The prePath (eg. scheme://user:password@host:port) returns the string /// * before the path. This is useful for authentication or managing sessions. /// * /// * Some characters may be escaped. /// */ /// ``` /// /// `readonly attribute AUTF8String prePath;` #[inline] pub unsafe fn GetPrePath(&self, aPrePath: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetPrePath)(self, aPrePath) } /// ```text /// /** /// * The Scheme is the protocol to which this URI refers. The scheme is /// * restricted to the US-ASCII charset per RFC3986. Setting this is /// * highly discouraged outside of a protocol handler implementation, since /// * that will generally lead to incorrect results. /// */ /// ``` /// /// `attribute ACString scheme;` #[inline] pub unsafe fn GetScheme(&self, aScheme: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetScheme)(self, aScheme) } /// ```text /// /** /// * The Scheme is the protocol to which this URI refers. The scheme is /// * restricted to the US-ASCII charset per RFC3986. Setting this is /// * highly discouraged outside of a protocol handler implementation, since /// * that will generally lead to incorrect results. /// */ /// ``` /// /// `attribute ACString scheme;` #[inline] pub unsafe fn SetScheme(&self, aScheme: &::nsstring::nsACString) -> nsresult { ((*self.vtable).SetScheme)(self, aScheme) } /// ```text /// /** /// * The username:password (or username only if value doesn't contain a ':') /// * /// * Some characters may be escaped. /// */ /// ``` /// /// `attribute AUTF8String userPass;` #[inline] pub unsafe fn GetUserPass(&self, aUserPass: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetUserPass)(self, aUserPass) } /// ```text /// /** /// * The username:password (or username only if value doesn't contain a ':') /// * /// * Some characters may be escaped. /// */ /// ``` /// /// `attribute AUTF8String userPass;` #[inline] pub unsafe fn SetUserPass(&self, aUserPass: &::nsstring::nsACString) -> nsresult { ((*self.vtable).SetUserPass)(self, aUserPass) } /// ```text /// /** /// * The optional username and password, assuming the preHost consists of /// * username:password. /// * /// * Some characters may be escaped. /// */ /// ``` /// /// `attribute AUTF8String username;` #[inline] pub unsafe fn GetUsername(&self, aUsername: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetUsername)(self, aUsername) } /// ```text /// /** /// * The optional username and password, assuming the preHost consists of /// * username:password. /// * /// * Some characters may be escaped. /// */ /// ``` /// /// `attribute AUTF8String username;` #[inline] pub unsafe fn SetUsername(&self, aUsername: &::nsstring::nsACString) -> nsresult { ((*self.vtable).SetUsername)(self, aUsername) } /// `attribute AUTF8String password;` #[inline] pub unsafe fn GetPassword(&self, aPassword: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetPassword)(self, aPassword) } /// `attribute AUTF8String password;` #[inline] pub unsafe fn SetPassword(&self, aPassword: &::nsstring::nsACString) -> nsresult { ((*self.vtable).SetPassword)(self, aPassword) } /// ```text /// /** /// * The host:port (or simply the host, if port == -1). /// * /// * If this attribute is set to a value that only has a host part, the port /// * will not be reset. To reset the port as well use setHostAndPort. /// */ /// ``` /// /// `attribute AUTF8String hostPort;` #[inline] pub unsafe fn GetHostPort(&self, aHostPort: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetHostPort)(self, aHostPort) } /// ```text /// /** /// * The host:port (or simply the host, if port == -1). /// * /// * If this attribute is set to a value that only has a host part, the port /// * will not be reset. To reset the port as well use setHostAndPort. /// */ /// ``` /// /// `attribute AUTF8String hostPort;` #[inline] pub unsafe fn SetHostPort(&self, aHostPort: &::nsstring::nsACString) -> nsresult { ((*self.vtable).SetHostPort)(self, aHostPort) } /// ```text /// /** /// * This function will always set a host and a port. If the port part is /// * empty, the value of the port will be set to the default value. /// */ /// ``` /// /// `void setHostAndPort (in AUTF8String hostport);` #[inline] pub unsafe fn SetHostAndPort(&self, hostport: &::nsstring::nsACString) -> nsresult { ((*self.vtable).SetHostAndPort)(self, hostport) } /// ```text /// /** /// * The host is the internet domain name to which this URI refers. It could /// * be an IPv4 (or IPv6) address literal. Otherwise it is an ASCII or punycode /// * encoded string. /// */ /// ``` /// /// `attribute AUTF8String host;` #[inline] pub unsafe fn GetHost(&self, aHost: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetHost)(self, aHost) } /// ```text /// /** /// * The host is the internet domain name to which this URI refers. It could /// * be an IPv4 (or IPv6) address literal. Otherwise it is an ASCII or punycode /// * encoded string. /// */ /// ``` /// /// `attribute AUTF8String host;` #[inline] pub unsafe fn SetHost(&self, aHost: &::nsstring::nsACString) -> nsresult { ((*self.vtable).SetHost)(self, aHost) } /// ```text /// /** /// * A port value of -1 corresponds to the protocol's default port (eg. -1 /// * implies port 80 for http URIs). /// */ /// ``` /// /// `attribute long port;` #[inline] pub unsafe fn GetPort(&self, aPort: *mut libc::int32_t) -> nsresult { ((*self.vtable).GetPort)(self, aPort) } /// ```text /// /** /// * A port value of -1 corresponds to the protocol's default port (eg. -1 /// * implies port 80 for http URIs). /// */ /// ``` /// /// `attribute long port;` #[inline] pub unsafe fn SetPort(&self, aPort: libc::int32_t) -> nsresult { ((*self.vtable).SetPort)(self, aPort) } /// ```text /// /** /// * The path, typically including at least a leading '/' (but may also be /// * empty, depending on the protocol). /// * /// * Some characters may be escaped. /// * /// * This attribute contains query and ref parts for historical reasons. /// * Use the 'filePath' attribute if you do not want those parts included. /// */ /// ``` /// /// `attribute AUTF8String pathQueryRef;` #[inline] pub unsafe fn GetPathQueryRef(&self, aPathQueryRef: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetPathQueryRef)(self, aPathQueryRef) } /// ```text /// /** /// * The path, typically including at least a leading '/' (but may also be /// * empty, depending on the protocol). /// * /// * Some characters may be escaped. /// * /// * This attribute contains query and ref parts for historical reasons. /// * Use the 'filePath' attribute if you do not want those parts included. /// */ /// ``` /// /// `attribute AUTF8String pathQueryRef;` #[inline] pub unsafe fn SetPathQueryRef(&self, aPathQueryRef: &::nsstring::nsACString) -> nsresult { ((*self.vtable).SetPathQueryRef)(self, aPathQueryRef) } /// ```text /// /************************************************************************ /// * An URI supports the following methods: /// */ /// /** /// * URI equivalence test (not a strict string comparison). /// * /// * eg. http://foo.com:80/ == http://foo.com/ /// */ /// ``` /// /// `boolean equals (in nsIURI other);` #[inline] pub unsafe fn Equals(&self, other: *const nsIURI, _retval: *mut bool) -> nsresult { ((*self.vtable).Equals)(self, other, _retval) } /// ```text /// /** /// * An optimization to do scheme checks without requiring the users of nsIURI /// * to GetScheme, thereby saving extra allocating and freeing. Returns true if /// * the schemes match (case ignored). /// */ /// ``` /// /// `boolean schemeIs (in string scheme);` #[inline] pub unsafe fn SchemeIs(&self, scheme: *const libc::c_char, _retval: *mut bool) -> nsresult { ((*self.vtable).SchemeIs)(self, scheme, _retval) } /// ```text /// /** /// * Clones the current URI. /// */ /// ``` /// /// `nsIURI clone ();` #[inline] pub unsafe fn Clone(&self, _retval: *mut *const nsIURI) -> nsresult { ((*self.vtable).Clone)(self, _retval) } /// ```text /// /** /// * This method resolves a relative string into an absolute URI string, /// * using this URI as the base. /// * /// * NOTE: some implementations may have no concept of a relative URI. /// */ /// ``` /// /// `AUTF8String resolve (in AUTF8String relativePath);` #[inline] pub unsafe fn Resolve(&self, relativePath: &::nsstring::nsACString, _retval: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).Resolve)(self, relativePath, _retval) } /// ```text /// /************************************************************************ /// * Additional attributes: /// */ /// /** /// * The URI spec with an ASCII compatible encoding. Host portion follows /// * the IDNA draft spec. Other parts are URL-escaped per the rules of /// * RFC2396. The result is strictly ASCII. /// */ /// ``` /// /// `readonly attribute ACString asciiSpec;` #[inline] pub unsafe fn GetAsciiSpec(&self, aAsciiSpec: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetAsciiSpec)(self, aAsciiSpec) } /// ```text /// /** /// * The host:port (or simply the host, if port == -1), with an ASCII compatible /// * encoding. Host portion follows the IDNA draft spec. The result is strictly /// * ASCII. /// */ /// ``` /// /// `readonly attribute ACString asciiHostPort;` #[inline] pub unsafe fn GetAsciiHostPort(&self, aAsciiHostPort: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetAsciiHostPort)(self, aAsciiHostPort) } /// ```text /// /** /// * The URI host with an ASCII compatible encoding. Follows the IDNA /// * draft spec for converting internationalized domain names (UTF-8) to /// * ASCII for compatibility with existing internet infrasture. /// */ /// ``` /// /// `readonly attribute ACString asciiHost;` #[inline] pub unsafe fn GetAsciiHost(&self, aAsciiHost: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetAsciiHost)(self, aAsciiHost) } /// ```text /// /************************************************************************ /// * Additional attribute & methods added for .ref support: /// */ /// /** /// * Returns the reference portion (the part after the "#") of the URI. /// * If there isn't one, an empty string is returned. /// * /// * Some characters may be escaped. /// */ /// ``` /// /// `attribute AUTF8String ref;` #[inline] pub unsafe fn GetRef(&self, aRef: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetRef)(self, aRef) } /// ```text /// /************************************************************************ /// * Additional attribute & methods added for .ref support: /// */ /// /** /// * Returns the reference portion (the part after the "#") of the URI. /// * If there isn't one, an empty string is returned. /// * /// * Some characters may be escaped. /// */ /// ``` /// /// `attribute AUTF8String ref;` #[inline] pub unsafe fn SetRef(&self, aRef: &::nsstring::nsACString) -> nsresult { ((*self.vtable).SetRef)(self, aRef) } /// ```text /// /** /// * URI equivalence test (not a strict string comparison), ignoring /// * the value of the .ref member. /// * /// * eg. http://foo.com/# == http://foo.com/ /// * http://foo.com/#aaa == http://foo.com/#bbb /// */ /// ``` /// /// `boolean equalsExceptRef (in nsIURI other);` #[inline] pub unsafe fn EqualsExceptRef(&self, other: *const nsIURI, _retval: *mut bool) -> nsresult { ((*self.vtable).EqualsExceptRef)(self, other, _retval) } /// ```text /// /** /// * Clones the current URI, clearing the 'ref' attribute in the clone. /// */ /// ``` /// /// `nsIURI cloneIgnoringRef ();` #[inline] pub unsafe fn CloneIgnoringRef(&self, _retval: *mut *const nsIURI) -> nsresult { ((*self.vtable).CloneIgnoringRef)(self, _retval) } /// ```text /// /** /// * Clones the current URI, replacing the 'ref' attribute in the clone with /// * the ref supplied. /// */ /// ``` /// /// `nsIURI cloneWithNewRef (in AUTF8String newRef);` #[inline] pub unsafe fn CloneWithNewRef(&self, newRef: &::nsstring::nsACString, _retval: *mut *const nsIURI) -> nsresult { ((*self.vtable).CloneWithNewRef)(self, newRef, _retval) } /// ```text /// /** /// * returns a string for the current URI with the ref element cleared. /// */ /// ``` /// /// `readonly attribute AUTF8String specIgnoringRef;` #[inline] pub unsafe fn GetSpecIgnoringRef(&self, aSpecIgnoringRef: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetSpecIgnoringRef)(self, aSpecIgnoringRef) } /// ```text /// /** /// * Returns if there is a reference portion (the part after the "#") of the URI. /// */ /// ``` /// /// `readonly attribute boolean hasRef;` #[inline] pub unsafe fn GetHasRef(&self, aHasRef: *mut bool) -> nsresult { ((*self.vtable).GetHasRef)(self, aHasRef) } /// ```text /// /************************************************************************ /// * Additional attributes added for .query support: /// */ /// /** /// * Returns a path including the directory and file portions of a /// * URL. For example, the filePath of "http://host/foo/bar.html#baz" /// * is "/foo/bar.html". /// * /// * Some characters may be escaped. /// */ /// ``` /// /// `attribute AUTF8String filePath;` #[inline] pub unsafe fn GetFilePath(&self, aFilePath: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetFilePath)(self, aFilePath) } /// ```text /// /************************************************************************ /// * Additional attributes added for .query support: /// */ /// /** /// * Returns a path including the directory and file portions of a /// * URL. For example, the filePath of "http://host/foo/bar.html#baz" /// * is "/foo/bar.html". /// * /// * Some characters may be escaped. /// */ /// ``` /// /// `attribute AUTF8String filePath;` #[inline] pub unsafe fn SetFilePath(&self, aFilePath: &::nsstring::nsACString) -> nsresult { ((*self.vtable).SetFilePath)(self, aFilePath) } /// ```text /// /** /// * Returns the query portion (the part after the "?") of the URL. /// * If there isn't one, an empty string is returned. /// * /// * Some characters may be escaped. /// */ /// ``` /// /// `attribute AUTF8String query;` #[inline] pub unsafe fn GetQuery(&self, aQuery: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetQuery)(self, aQuery) } /// ```text /// /** /// * Returns the query portion (the part after the "?") of the URL. /// * If there isn't one, an empty string is returned. /// * /// * Some characters may be escaped. /// */ /// ``` /// /// `attribute AUTF8String query;` #[inline] pub unsafe fn SetQuery(&self, aQuery: &::nsstring::nsACString) -> nsresult { ((*self.vtable).SetQuery)(self, aQuery) } /// `[noscript] void setQueryWithEncoding (in AUTF8String query, in Encoding encoding);` const _SetQueryWithEncoding: () = (); /// ```text /// /** /// * If the URI has a punycode encoded hostname, this will hold the UTF8 /// * representation of that hostname (if that representation doesn't contain /// * blacklisted characters, and the network.IDN_show_punycode pref is false) /// * Otherwise, if the hostname is ASCII, it will return the same as .asciiHost /// */ /// ``` /// /// `readonly attribute AUTF8String displayHost;` #[inline] pub unsafe fn GetDisplayHost(&self, aDisplayHost: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetDisplayHost)(self, aDisplayHost) } /// ```text /// /** /// * The displayHost:port (or simply the displayHost, if port == -1). /// */ /// ``` /// /// `readonly attribute AUTF8String displayHostPort;` #[inline] pub unsafe fn GetDisplayHostPort(&self, aDisplayHostPort: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetDisplayHostPort)(self, aDisplayHostPort) } /// ```text /// /** /// * Returns the same as calling .spec, only with a UTF8 encoded hostname /// * (if that hostname doesn't contain blacklisted characters, and /// * the network.IDN_show_punycode pref is false) /// */ /// ``` /// /// `readonly attribute AUTF8String displaySpec;` #[inline] pub unsafe fn GetDisplaySpec(&self, aDisplaySpec: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetDisplaySpec)(self, aDisplaySpec) } /// ```text /// /** /// * Returns the same as calling .prePath, only with a UTF8 encoded hostname /// * (if that hostname doesn't contain blacklisted characters, and /// * the network.IDN_show_punycode pref is false) /// */ /// ``` /// /// `readonly attribute AUTF8String displayPrePath;` #[inline] pub unsafe fn GetDisplayPrePath(&self, aDisplayPrePath: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetDisplayPrePath)(self, aDisplayPrePath) } /// ```text /// /** /// * Returns an nsIURIMutator that can be used to make changes to the URI. /// * After performing the setter operations on the mutator, one may call /// * mutator.finalize() to get a new immutable URI with the desired /// * properties. /// */ /// ``` /// /// `nsIURIMutator mutate ();` #[inline] pub unsafe fn Mutate(&self, _retval: *mut *const nsIURIMutator) -> nsresult { ((*self.vtable).Mutate)(self, _retval) } }