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
//
// DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIVariant.idl
//


/// `interface nsIDataType : nsISupports`
///


// 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 nsIDataType {
    vtable: *const nsIDataTypeVTable,

    /// 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 nsIDataType.
unsafe impl XpCom for nsIDataType {
    const IID: nsIID = nsID(0x4d12e540, 0x83d7, 0x11d5,
        [0x90, 0xed, 0x00, 0x10, 0xa4, 0xe7, 0x3d, 0x9a]);
}

// 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 nsIDataType {
    #[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 nsIDataType.
// 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 nsIDataTypeCoerce {
    /// Cheaply cast a value of this type from a `nsIDataType`.
    fn coerce_from(v: &nsIDataType) -> &Self;
}

// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIDataTypeCoerce for nsIDataType {
    #[inline]
    fn coerce_from(v: &nsIDataType) -> &Self {
        v
    }
}

impl nsIDataType {
    /// Cast this `nsIDataType` to one of its base interfaces.
    #[inline]
    pub fn coerce<T: nsIDataTypeCoerce>(&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 nsIDataType {
    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> nsIDataTypeCoerce for T {
    #[inline]
    fn coerce_from(v: &nsIDataType) -> &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 nsIDataType
// 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 nsIDataTypeVTable {
    /// We need to include the members from the base interface's vtable at the start
    /// of the VTable definition.
    pub __base: nsISupportsVTable,

}


// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIDataType {

    pub const VTYPE_INT8: i64 = 0;


    pub const VTYPE_INT16: i64 = 1;


    pub const VTYPE_INT32: i64 = 2;


    pub const VTYPE_INT64: i64 = 3;


    pub const VTYPE_UINT8: i64 = 4;


    pub const VTYPE_UINT16: i64 = 5;


    pub const VTYPE_UINT32: i64 = 6;


    pub const VTYPE_UINT64: i64 = 7;


    pub const VTYPE_FLOAT: i64 = 8;


    pub const VTYPE_DOUBLE: i64 = 9;


    pub const VTYPE_BOOL: i64 = 10;


    pub const VTYPE_CHAR: i64 = 11;


    pub const VTYPE_WCHAR: i64 = 12;


    pub const VTYPE_VOID: i64 = 13;


    pub const VTYPE_ID: i64 = 14;


    pub const VTYPE_DOMSTRING: i64 = 15;


    pub const VTYPE_CHAR_STR: i64 = 16;


    pub const VTYPE_WCHAR_STR: i64 = 17;


    pub const VTYPE_INTERFACE: i64 = 18;


    pub const VTYPE_INTERFACE_IS: i64 = 19;


    pub const VTYPE_ARRAY: i64 = 20;


    pub const VTYPE_STRING_SIZE_IS: i64 = 21;


    pub const VTYPE_WSTRING_SIZE_IS: i64 = 22;


    pub const VTYPE_UTF8STRING: i64 = 23;


    pub const VTYPE_CSTRING: i64 = 24;


    pub const VTYPE_ASTRING: i64 = 25;


    pub const VTYPE_EMPTY_ARRAY: i64 = 254;


    pub const VTYPE_EMPTY: i64 = 255;


}


/// `interface nsIVariant : nsISupports`
///

/// ```text
/// /**
///  * XPConnect has magic to transparently convert between nsIVariant and JS types.
///  * We mark the interface [scriptable] so that JS can use methods
///  * that refer to this interface. But we mark all the methods and attributes
///  * [noscript] since any nsIVariant object will be automatically converted to a
///  * JS type anyway.
///  */
/// ```
///

// 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 nsIVariant {
    vtable: *const nsIVariantVTable,

    /// 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 nsIVariant.
unsafe impl XpCom for nsIVariant {
    const IID: nsIID = nsID(0x81e4c2de, 0xacac, 0x4ad6,
        [0x90, 0x1a, 0xb5, 0xfb, 0x1b, 0x85, 0x1a, 0x0d]);
}

// 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 nsIVariant {
    #[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 nsIVariant.
// 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 nsIVariantCoerce {
    /// Cheaply cast a value of this type from a `nsIVariant`.
    fn coerce_from(v: &nsIVariant) -> &Self;
}

// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIVariantCoerce for nsIVariant {
    #[inline]
    fn coerce_from(v: &nsIVariant) -> &Self {
        v
    }
}

impl nsIVariant {
    /// Cast this `nsIVariant` to one of its base interfaces.
    #[inline]
    pub fn coerce<T: nsIVariantCoerce>(&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 nsIVariant {
    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> nsIVariantCoerce for T {
    #[inline]
    fn coerce_from(v: &nsIVariant) -> &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 nsIVariant
// 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 nsIVariantVTable {
    /// We need to include the members from the base interface's vtable at the start
    /// of the VTable definition.
    pub __base: nsISupportsVTable,

    /* [noscript] readonly attribute uint16_t dataType; */
    pub GetDataType: unsafe extern "system" fn (this: *const nsIVariant, aDataType: *mut uint16_t) -> nsresult,

    /* [noscript] uint8_t getAsInt8 (); */
    pub GetAsInt8: unsafe extern "system" fn (this: *const nsIVariant, _retval: *mut uint8_t) -> nsresult,

    /* [noscript] int16_t getAsInt16 (); */
    pub GetAsInt16: unsafe extern "system" fn (this: *const nsIVariant, _retval: *mut int16_t) -> nsresult,

    /* [noscript] int32_t getAsInt32 (); */
    pub GetAsInt32: unsafe extern "system" fn (this: *const nsIVariant, _retval: *mut int32_t) -> nsresult,

    /* [noscript] int64_t getAsInt64 (); */
    pub GetAsInt64: unsafe extern "system" fn (this: *const nsIVariant, _retval: *mut int64_t) -> nsresult,

    /* [noscript] uint8_t getAsUint8 (); */
    pub GetAsUint8: unsafe extern "system" fn (this: *const nsIVariant, _retval: *mut uint8_t) -> nsresult,

    /* [noscript] uint16_t getAsUint16 (); */
    pub GetAsUint16: unsafe extern "system" fn (this: *const nsIVariant, _retval: *mut uint16_t) -> nsresult,

    /* [noscript] uint32_t getAsUint32 (); */
    pub GetAsUint32: unsafe extern "system" fn (this: *const nsIVariant, _retval: *mut uint32_t) -> nsresult,

    /* [noscript] uint64_t getAsUint64 (); */
    pub GetAsUint64: unsafe extern "system" fn (this: *const nsIVariant, _retval: *mut uint64_t) -> nsresult,

    /* [noscript] float getAsFloat (); */
    pub GetAsFloat: unsafe extern "system" fn (this: *const nsIVariant, _retval: *mut libc::c_float) -> nsresult,

    /* [noscript] double getAsDouble (); */
    pub GetAsDouble: unsafe extern "system" fn (this: *const nsIVariant, _retval: *mut libc::c_double) -> nsresult,

    /* [noscript] boolean getAsBool (); */
    pub GetAsBool: unsafe extern "system" fn (this: *const nsIVariant, _retval: *mut bool) -> nsresult,

    /* [noscript] char getAsChar (); */
    pub GetAsChar: unsafe extern "system" fn (this: *const nsIVariant, _retval: *mut libc::c_char) -> nsresult,

    /* [noscript] wchar getAsWChar (); */
    pub GetAsWChar: unsafe extern "system" fn (this: *const nsIVariant, _retval: *mut libc::int16_t) -> nsresult,

    /* [notxpcom] nsresult getAsID (out nsID retval); */
    pub GetAsID: unsafe extern "system" fn (this: *const nsIVariant, retval: *mut nsID) -> nsresult,

    /* [noscript] AString getAsAString (); */
    pub GetAsAString: unsafe extern "system" fn (this: *const nsIVariant, _retval: &mut ::nsstring::nsAString) -> nsresult,

    /* [noscript] DOMString getAsDOMString (); */
    pub GetAsDOMString: unsafe extern "system" fn (this: *const nsIVariant, _retval: &mut ::nsstring::nsAString) -> nsresult,

    /* [noscript] ACString getAsACString (); */
    pub GetAsACString: unsafe extern "system" fn (this: *const nsIVariant, _retval: &mut ::nsstring::nsACString) -> nsresult,

    /* [noscript] AUTF8String getAsAUTF8String (); */
    pub GetAsAUTF8String: unsafe extern "system" fn (this: *const nsIVariant, _retval: &mut ::nsstring::nsACString) -> nsresult,

    /* [noscript] string getAsString (); */
    pub GetAsString: unsafe extern "system" fn (this: *const nsIVariant, _retval: *mut *const libc::c_char) -> nsresult,

    /* [noscript] wstring getAsWString (); */
    pub GetAsWString: unsafe extern "system" fn (this: *const nsIVariant, _retval: *mut *const libc::int16_t) -> nsresult,

    /* [noscript] nsISupports getAsISupports (); */
    pub GetAsISupports: unsafe extern "system" fn (this: *const nsIVariant, _retval: *mut *const nsISupports) -> nsresult,

    /* [noscript] jsval getAsJSVal (); */
    /// Unable to generate binding because `native type JS::Value is unsupported`
    pub GetAsJSVal: *const ::libc::c_void,

    /* [noscript] void getAsInterface (out nsIIDPtr iid, [iid_is (iid), retval] out nsQIResult iface); */
    pub GetAsInterface: unsafe extern "system" fn (this: *const nsIVariant, iid: *mut *mut nsIID, iface: *mut *mut libc::c_void) -> nsresult,

    /* [notxpcom] nsresult getAsArray (out uint16_t type, out nsIID iid, out uint32_t count, out voidPtr ptr); */
    pub GetAsArray: unsafe extern "system" fn (this: *const nsIVariant, type_: *mut uint16_t, iid: *mut nsIID, count: *mut uint32_t, ptr: *mut *mut libc::c_void) -> nsresult,

    /* [noscript] void getAsStringWithSize (out uint32_t size, [size_is (size), retval] out string str); */
    pub GetAsStringWithSize: unsafe extern "system" fn (this: *const nsIVariant, size: *mut uint32_t, str: *mut *const libc::c_char) -> nsresult,

    /* [noscript] void getAsWStringWithSize (out uint32_t size, [size_is (size), retval] out wstring str); */
    pub GetAsWStringWithSize: unsafe extern "system" fn (this: *const nsIVariant, size: *mut uint32_t, str: *mut *const libc::int16_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 nsIVariant {


    /// `[noscript] readonly attribute uint16_t dataType;`
    #[inline]
    pub unsafe fn GetDataType(&self, aDataType: *mut uint16_t) -> nsresult {
        ((*self.vtable).GetDataType)(self, aDataType)
    }



    /// `[noscript] uint8_t getAsInt8 ();`
    #[inline]
    pub unsafe fn GetAsInt8(&self, _retval: *mut uint8_t) -> nsresult {
        ((*self.vtable).GetAsInt8)(self, _retval)
    }



    /// `[noscript] int16_t getAsInt16 ();`
    #[inline]
    pub unsafe fn GetAsInt16(&self, _retval: *mut int16_t) -> nsresult {
        ((*self.vtable).GetAsInt16)(self, _retval)
    }



    /// `[noscript] int32_t getAsInt32 ();`
    #[inline]
    pub unsafe fn GetAsInt32(&self, _retval: *mut int32_t) -> nsresult {
        ((*self.vtable).GetAsInt32)(self, _retval)
    }



    /// `[noscript] int64_t getAsInt64 ();`
    #[inline]
    pub unsafe fn GetAsInt64(&self, _retval: *mut int64_t) -> nsresult {
        ((*self.vtable).GetAsInt64)(self, _retval)
    }



    /// `[noscript] uint8_t getAsUint8 ();`
    #[inline]
    pub unsafe fn GetAsUint8(&self, _retval: *mut uint8_t) -> nsresult {
        ((*self.vtable).GetAsUint8)(self, _retval)
    }



    /// `[noscript] uint16_t getAsUint16 ();`
    #[inline]
    pub unsafe fn GetAsUint16(&self, _retval: *mut uint16_t) -> nsresult {
        ((*self.vtable).GetAsUint16)(self, _retval)
    }



    /// `[noscript] uint32_t getAsUint32 ();`
    #[inline]
    pub unsafe fn GetAsUint32(&self, _retval: *mut uint32_t) -> nsresult {
        ((*self.vtable).GetAsUint32)(self, _retval)
    }



    /// `[noscript] uint64_t getAsUint64 ();`
    #[inline]
    pub unsafe fn GetAsUint64(&self, _retval: *mut uint64_t) -> nsresult {
        ((*self.vtable).GetAsUint64)(self, _retval)
    }



    /// `[noscript] float getAsFloat ();`
    #[inline]
    pub unsafe fn GetAsFloat(&self, _retval: *mut libc::c_float) -> nsresult {
        ((*self.vtable).GetAsFloat)(self, _retval)
    }



    /// `[noscript] double getAsDouble ();`
    #[inline]
    pub unsafe fn GetAsDouble(&self, _retval: *mut libc::c_double) -> nsresult {
        ((*self.vtable).GetAsDouble)(self, _retval)
    }



    /// `[noscript] boolean getAsBool ();`
    #[inline]
    pub unsafe fn GetAsBool(&self, _retval: *mut bool) -> nsresult {
        ((*self.vtable).GetAsBool)(self, _retval)
    }



    /// `[noscript] char getAsChar ();`
    #[inline]
    pub unsafe fn GetAsChar(&self, _retval: *mut libc::c_char) -> nsresult {
        ((*self.vtable).GetAsChar)(self, _retval)
    }



    /// `[noscript] wchar getAsWChar ();`
    #[inline]
    pub unsafe fn GetAsWChar(&self, _retval: *mut libc::int16_t) -> nsresult {
        ((*self.vtable).GetAsWChar)(self, _retval)
    }



    /// `[notxpcom] nsresult getAsID (out nsID retval);`
    #[inline]
    pub unsafe fn GetAsID(&self, retval: *mut nsID) -> nsresult {
        ((*self.vtable).GetAsID)(self, retval)
    }



    /// `[noscript] AString getAsAString ();`
    #[inline]
    pub unsafe fn GetAsAString(&self, _retval: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetAsAString)(self, _retval)
    }



    /// `[noscript] DOMString getAsDOMString ();`
    #[inline]
    pub unsafe fn GetAsDOMString(&self, _retval: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetAsDOMString)(self, _retval)
    }



    /// `[noscript] ACString getAsACString ();`
    #[inline]
    pub unsafe fn GetAsACString(&self, _retval: &mut ::nsstring::nsACString) -> nsresult {
        ((*self.vtable).GetAsACString)(self, _retval)
    }



    /// `[noscript] AUTF8String getAsAUTF8String ();`
    #[inline]
    pub unsafe fn GetAsAUTF8String(&self, _retval: &mut ::nsstring::nsACString) -> nsresult {
        ((*self.vtable).GetAsAUTF8String)(self, _retval)
    }



    /// `[noscript] string getAsString ();`
    #[inline]
    pub unsafe fn GetAsString(&self, _retval: *mut *const libc::c_char) -> nsresult {
        ((*self.vtable).GetAsString)(self, _retval)
    }



    /// `[noscript] wstring getAsWString ();`
    #[inline]
    pub unsafe fn GetAsWString(&self, _retval: *mut *const libc::int16_t) -> nsresult {
        ((*self.vtable).GetAsWString)(self, _retval)
    }



    /// `[noscript] nsISupports getAsISupports ();`
    #[inline]
    pub unsafe fn GetAsISupports(&self, _retval: *mut *const nsISupports) -> nsresult {
        ((*self.vtable).GetAsISupports)(self, _retval)
    }



    /// `[noscript] jsval getAsJSVal ();`
    const _GetAsJSVal: () = ();


    /// `[noscript] void getAsInterface (out nsIIDPtr iid, [iid_is (iid), retval] out nsQIResult iface);`
    #[inline]
    pub unsafe fn GetAsInterface(&self, iid: *mut *mut nsIID, iface: *mut *mut libc::c_void) -> nsresult {
        ((*self.vtable).GetAsInterface)(self, iid, iface)
    }



    /// `[notxpcom] nsresult getAsArray (out uint16_t type, out nsIID iid, out uint32_t count, out voidPtr ptr);`
    #[inline]
    pub unsafe fn GetAsArray(&self, type_: *mut uint16_t, iid: *mut nsIID, count: *mut uint32_t, ptr: *mut *mut libc::c_void) -> nsresult {
        ((*self.vtable).GetAsArray)(self, type_, iid, count, ptr)
    }



    /// `[noscript] void getAsStringWithSize (out uint32_t size, [size_is (size), retval] out string str);`
    #[inline]
    pub unsafe fn GetAsStringWithSize(&self, size: *mut uint32_t, str: *mut *const libc::c_char) -> nsresult {
        ((*self.vtable).GetAsStringWithSize)(self, size, str)
    }



    /// `[noscript] void getAsWStringWithSize (out uint32_t size, [size_is (size), retval] out wstring str);`
    #[inline]
    pub unsafe fn GetAsWStringWithSize(&self, size: *mut uint32_t, str: *mut *const libc::int16_t) -> nsresult {
        ((*self.vtable).GetAsWStringWithSize)(self, size, str)
    }


}


/// `interface nsIWritableVariant : nsIVariant`
///

/// ```text
/// /**
///  * An object that implements nsIVariant may or may NOT also implement this
///  * nsIWritableVariant.
///  *
///  * If the 'writable' attribute is false then attempts to call any of the 'set'
///  * methods can be expected to fail. Setting the 'writable' attribute may or
///  * may not succeed.
///  *
///  */
/// ```
///

// 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 nsIWritableVariant {
    vtable: *const nsIWritableVariantVTable,

    /// 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 nsIWritableVariant.
unsafe impl XpCom for nsIWritableVariant {
    const IID: nsIID = nsID(0x5586a590, 0x8c82, 0x11d5,
        [0x90, 0xf3, 0x00, 0x10, 0xa4, 0xe7, 0x3d, 0x9a]);
}

// 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 nsIWritableVariant {
    #[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 nsIWritableVariant.
// 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 nsIWritableVariantCoerce {
    /// Cheaply cast a value of this type from a `nsIWritableVariant`.
    fn coerce_from(v: &nsIWritableVariant) -> &Self;
}

// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIWritableVariantCoerce for nsIWritableVariant {
    #[inline]
    fn coerce_from(v: &nsIWritableVariant) -> &Self {
        v
    }
}

impl nsIWritableVariant {
    /// Cast this `nsIWritableVariant` to one of its base interfaces.
    #[inline]
    pub fn coerce<T: nsIWritableVariantCoerce>(&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 nsIWritableVariant {
    type Target = nsIVariant;
    #[inline]
    fn deref(&self) -> &nsIVariant {
        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: nsIVariantCoerce> nsIWritableVariantCoerce for T {
    #[inline]
    fn coerce_from(v: &nsIWritableVariant) -> &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 nsIWritableVariant
// 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 nsIWritableVariantVTable {
    /// We need to include the members from the base interface's vtable at the start
    /// of the VTable definition.
    pub __base: nsIVariantVTable,

    /* attribute boolean writable; */
    pub GetWritable: unsafe extern "system" fn (this: *const nsIWritableVariant, aWritable: *mut bool) -> nsresult,

    /* attribute boolean writable; */
    pub SetWritable: unsafe extern "system" fn (this: *const nsIWritableVariant, aWritable: bool) -> nsresult,

    /* void setAsInt8 (in uint8_t aValue); */
    pub SetAsInt8: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: uint8_t) -> nsresult,

    /* void setAsInt16 (in int16_t aValue); */
    pub SetAsInt16: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: int16_t) -> nsresult,

    /* void setAsInt32 (in int32_t aValue); */
    pub SetAsInt32: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: int32_t) -> nsresult,

    /* void setAsInt64 (in int64_t aValue); */
    pub SetAsInt64: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: int64_t) -> nsresult,

    /* void setAsUint8 (in uint8_t aValue); */
    pub SetAsUint8: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: uint8_t) -> nsresult,

    /* void setAsUint16 (in uint16_t aValue); */
    pub SetAsUint16: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: uint16_t) -> nsresult,

    /* void setAsUint32 (in uint32_t aValue); */
    pub SetAsUint32: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: uint32_t) -> nsresult,

    /* void setAsUint64 (in uint64_t aValue); */
    pub SetAsUint64: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: uint64_t) -> nsresult,

    /* void setAsFloat (in float aValue); */
    pub SetAsFloat: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: libc::c_float) -> nsresult,

    /* void setAsDouble (in double aValue); */
    pub SetAsDouble: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: libc::c_double) -> nsresult,

    /* void setAsBool (in boolean aValue); */
    pub SetAsBool: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: bool) -> nsresult,

    /* void setAsChar (in char aValue); */
    pub SetAsChar: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: libc::c_char) -> nsresult,

    /* void setAsWChar (in wchar aValue); */
    pub SetAsWChar: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: libc::int16_t) -> nsresult,

    /* void setAsID (in nsIDRef aValue); */
    pub SetAsID: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: &nsID) -> nsresult,

    /* void setAsAString (in AString aValue); */
    pub SetAsAString: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: &::nsstring::nsAString) -> nsresult,

    /* void setAsDOMString (in DOMString aValue); */
    pub SetAsDOMString: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: &::nsstring::nsAString) -> nsresult,

    /* void setAsACString (in ACString aValue); */
    pub SetAsACString: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: &::nsstring::nsACString) -> nsresult,

    /* void setAsAUTF8String (in AUTF8String aValue); */
    pub SetAsAUTF8String: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: &::nsstring::nsACString) -> nsresult,

    /* void setAsString (in string aValue); */
    pub SetAsString: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: *const libc::c_char) -> nsresult,

    /* void setAsWString (in wstring aValue); */
    pub SetAsWString: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: *const libc::int16_t) -> nsresult,

    /* void setAsISupports (in nsISupports aValue); */
    pub SetAsISupports: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: *const nsISupports) -> nsresult,

    /* void setAsInterface (in nsIIDRef iid, [iid_is (iid)] in nsQIResult iface); */
    pub SetAsInterface: unsafe extern "system" fn (this: *const nsIWritableVariant, iid: &nsIID, iface: *mut libc::c_void) -> nsresult,

    /* [noscript] void setAsArray (in uint16_t type, in nsIIDPtr iid, in uint32_t count, in voidPtr ptr); */
    pub SetAsArray: unsafe extern "system" fn (this: *const nsIWritableVariant, type_: uint16_t, iid: *const nsIID, count: uint32_t, ptr: *mut libc::c_void) -> nsresult,

    /* void setAsStringWithSize (in uint32_t size, [size_is (size)] in string str); */
    pub SetAsStringWithSize: unsafe extern "system" fn (this: *const nsIWritableVariant, size: uint32_t, str: *const libc::c_char) -> nsresult,

    /* void setAsWStringWithSize (in uint32_t size, [size_is (size)] in wstring str); */
    pub SetAsWStringWithSize: unsafe extern "system" fn (this: *const nsIWritableVariant, size: uint32_t, str: *const libc::int16_t) -> nsresult,

    /* void setAsVoid (); */
    pub SetAsVoid: unsafe extern "system" fn (this: *const nsIWritableVariant) -> nsresult,

    /* void setAsEmpty (); */
    pub SetAsEmpty: unsafe extern "system" fn (this: *const nsIWritableVariant) -> nsresult,

    /* void setAsEmptyArray (); */
    pub SetAsEmptyArray: unsafe extern "system" fn (this: *const nsIWritableVariant) -> nsresult,

    /* void setFromVariant (in nsIVariant aValue); */
    pub SetFromVariant: unsafe extern "system" fn (this: *const nsIWritableVariant, aValue: *const nsIVariant) -> 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 nsIWritableVariant {


    /// `attribute boolean writable;`
    #[inline]
    pub unsafe fn GetWritable(&self, aWritable: *mut bool) -> nsresult {
        ((*self.vtable).GetWritable)(self, aWritable)
    }



    /// `attribute boolean writable;`
    #[inline]
    pub unsafe fn SetWritable(&self, aWritable: bool) -> nsresult {
        ((*self.vtable).SetWritable)(self, aWritable)
    }



    /// `void setAsInt8 (in uint8_t aValue);`
    #[inline]
    pub unsafe fn SetAsInt8(&self, aValue: uint8_t) -> nsresult {
        ((*self.vtable).SetAsInt8)(self, aValue)
    }



    /// `void setAsInt16 (in int16_t aValue);`
    #[inline]
    pub unsafe fn SetAsInt16(&self, aValue: int16_t) -> nsresult {
        ((*self.vtable).SetAsInt16)(self, aValue)
    }



    /// `void setAsInt32 (in int32_t aValue);`
    #[inline]
    pub unsafe fn SetAsInt32(&self, aValue: int32_t) -> nsresult {
        ((*self.vtable).SetAsInt32)(self, aValue)
    }



    /// `void setAsInt64 (in int64_t aValue);`
    #[inline]
    pub unsafe fn SetAsInt64(&self, aValue: int64_t) -> nsresult {
        ((*self.vtable).SetAsInt64)(self, aValue)
    }



    /// `void setAsUint8 (in uint8_t aValue);`
    #[inline]
    pub unsafe fn SetAsUint8(&self, aValue: uint8_t) -> nsresult {
        ((*self.vtable).SetAsUint8)(self, aValue)
    }



    /// `void setAsUint16 (in uint16_t aValue);`
    #[inline]
    pub unsafe fn SetAsUint16(&self, aValue: uint16_t) -> nsresult {
        ((*self.vtable).SetAsUint16)(self, aValue)
    }



    /// `void setAsUint32 (in uint32_t aValue);`
    #[inline]
    pub unsafe fn SetAsUint32(&self, aValue: uint32_t) -> nsresult {
        ((*self.vtable).SetAsUint32)(self, aValue)
    }



    /// `void setAsUint64 (in uint64_t aValue);`
    #[inline]
    pub unsafe fn SetAsUint64(&self, aValue: uint64_t) -> nsresult {
        ((*self.vtable).SetAsUint64)(self, aValue)
    }



    /// `void setAsFloat (in float aValue);`
    #[inline]
    pub unsafe fn SetAsFloat(&self, aValue: libc::c_float) -> nsresult {
        ((*self.vtable).SetAsFloat)(self, aValue)
    }



    /// `void setAsDouble (in double aValue);`
    #[inline]
    pub unsafe fn SetAsDouble(&self, aValue: libc::c_double) -> nsresult {
        ((*self.vtable).SetAsDouble)(self, aValue)
    }



    /// `void setAsBool (in boolean aValue);`
    #[inline]
    pub unsafe fn SetAsBool(&self, aValue: bool) -> nsresult {
        ((*self.vtable).SetAsBool)(self, aValue)
    }



    /// `void setAsChar (in char aValue);`
    #[inline]
    pub unsafe fn SetAsChar(&self, aValue: libc::c_char) -> nsresult {
        ((*self.vtable).SetAsChar)(self, aValue)
    }



    /// `void setAsWChar (in wchar aValue);`
    #[inline]
    pub unsafe fn SetAsWChar(&self, aValue: libc::int16_t) -> nsresult {
        ((*self.vtable).SetAsWChar)(self, aValue)
    }



    /// `void setAsID (in nsIDRef aValue);`
    #[inline]
    pub unsafe fn SetAsID(&self, aValue: &nsID) -> nsresult {
        ((*self.vtable).SetAsID)(self, aValue)
    }



    /// `void setAsAString (in AString aValue);`
    #[inline]
    pub unsafe fn SetAsAString(&self, aValue: &::nsstring::nsAString) -> nsresult {
        ((*self.vtable).SetAsAString)(self, aValue)
    }



    /// `void setAsDOMString (in DOMString aValue);`
    #[inline]
    pub unsafe fn SetAsDOMString(&self, aValue: &::nsstring::nsAString) -> nsresult {
        ((*self.vtable).SetAsDOMString)(self, aValue)
    }



    /// `void setAsACString (in ACString aValue);`
    #[inline]
    pub unsafe fn SetAsACString(&self, aValue: &::nsstring::nsACString) -> nsresult {
        ((*self.vtable).SetAsACString)(self, aValue)
    }



    /// `void setAsAUTF8String (in AUTF8String aValue);`
    #[inline]
    pub unsafe fn SetAsAUTF8String(&self, aValue: &::nsstring::nsACString) -> nsresult {
        ((*self.vtable).SetAsAUTF8String)(self, aValue)
    }



    /// `void setAsString (in string aValue);`
    #[inline]
    pub unsafe fn SetAsString(&self, aValue: *const libc::c_char) -> nsresult {
        ((*self.vtable).SetAsString)(self, aValue)
    }



    /// `void setAsWString (in wstring aValue);`
    #[inline]
    pub unsafe fn SetAsWString(&self, aValue: *const libc::int16_t) -> nsresult {
        ((*self.vtable).SetAsWString)(self, aValue)
    }



    /// `void setAsISupports (in nsISupports aValue);`
    #[inline]
    pub unsafe fn SetAsISupports(&self, aValue: *const nsISupports) -> nsresult {
        ((*self.vtable).SetAsISupports)(self, aValue)
    }



    /// `void setAsInterface (in nsIIDRef iid, [iid_is (iid)] in nsQIResult iface);`
    #[inline]
    pub unsafe fn SetAsInterface(&self, iid: &nsIID, iface: *mut libc::c_void) -> nsresult {
        ((*self.vtable).SetAsInterface)(self, iid, iface)
    }



    /// `[noscript] void setAsArray (in uint16_t type, in nsIIDPtr iid, in uint32_t count, in voidPtr ptr);`
    #[inline]
    pub unsafe fn SetAsArray(&self, type_: uint16_t, iid: *const nsIID, count: uint32_t, ptr: *mut libc::c_void) -> nsresult {
        ((*self.vtable).SetAsArray)(self, type_, iid, count, ptr)
    }



    /// `void setAsStringWithSize (in uint32_t size, [size_is (size)] in string str);`
    #[inline]
    pub unsafe fn SetAsStringWithSize(&self, size: uint32_t, str: *const libc::c_char) -> nsresult {
        ((*self.vtable).SetAsStringWithSize)(self, size, str)
    }



    /// `void setAsWStringWithSize (in uint32_t size, [size_is (size)] in wstring str);`
    #[inline]
    pub unsafe fn SetAsWStringWithSize(&self, size: uint32_t, str: *const libc::int16_t) -> nsresult {
        ((*self.vtable).SetAsWStringWithSize)(self, size, str)
    }



    /// `void setAsVoid ();`
    #[inline]
    pub unsafe fn SetAsVoid(&self, ) -> nsresult {
        ((*self.vtable).SetAsVoid)(self, )
    }



    /// `void setAsEmpty ();`
    #[inline]
    pub unsafe fn SetAsEmpty(&self, ) -> nsresult {
        ((*self.vtable).SetAsEmpty)(self, )
    }



    /// `void setAsEmptyArray ();`
    #[inline]
    pub unsafe fn SetAsEmptyArray(&self, ) -> nsresult {
        ((*self.vtable).SetAsEmptyArray)(self, )
    }



    /// `void setFromVariant (in nsIVariant aValue);`
    #[inline]
    pub unsafe fn SetFromVariant(&self, aValue: *const nsIVariant) -> nsresult {
        ((*self.vtable).SetFromVariant)(self, aValue)
    }


}