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


/// `interface nsITreeView : 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 nsITreeView {
    vtable: *const nsITreeViewVTable,

    /// 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 nsITreeView.
unsafe impl XpCom for nsITreeView {
    const IID: nsIID = nsID(0x091116f0, 0x0bdc, 0x4b32,
        [0xb9, 0xc8, 0xc8, 0xd5, 0xa3, 0x7c, 0xb0, 0x88]);
}

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

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

impl nsITreeView {
    /// Cast this `nsITreeView` to one of its base interfaces.
    #[inline]
    pub fn coerce<T: nsITreeViewCoerce>(&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 nsITreeView {
    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> nsITreeViewCoerce for T {
    #[inline]
    fn coerce_from(v: &nsITreeView) -> &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 nsITreeView
// 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 nsITreeViewVTable {
    /// 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 rowCount; */
    pub GetRowCount: unsafe extern "system" fn (this: *const nsITreeView, aRowCount: *mut libc::int32_t) -> nsresult,

    /* attribute nsITreeSelection selection; */
    pub GetSelection: unsafe extern "system" fn (this: *const nsITreeView, aSelection: *mut *const nsITreeSelection) -> nsresult,

    /* attribute nsITreeSelection selection; */
    pub SetSelection: unsafe extern "system" fn (this: *const nsITreeView, aSelection: *const nsITreeSelection) -> nsresult,

    /* AString getRowProperties (in long index); */
    pub GetRowProperties: unsafe extern "system" fn (this: *const nsITreeView, index: libc::int32_t, _retval: &mut ::nsstring::nsAString) -> nsresult,

    /* AString getCellProperties (in long row, in nsITreeColumn col); */
    pub GetCellProperties: unsafe extern "system" fn (this: *const nsITreeView, row: libc::int32_t, col: *const nsITreeColumn, _retval: &mut ::nsstring::nsAString) -> nsresult,

    /* AString getColumnProperties (in nsITreeColumn col); */
    pub GetColumnProperties: unsafe extern "system" fn (this: *const nsITreeView, col: *const nsITreeColumn, _retval: &mut ::nsstring::nsAString) -> nsresult,

    /* boolean isContainer (in long index); */
    pub IsContainer: unsafe extern "system" fn (this: *const nsITreeView, index: libc::int32_t, _retval: *mut bool) -> nsresult,

    /* boolean isContainerOpen (in long index); */
    pub IsContainerOpen: unsafe extern "system" fn (this: *const nsITreeView, index: libc::int32_t, _retval: *mut bool) -> nsresult,

    /* boolean isContainerEmpty (in long index); */
    pub IsContainerEmpty: unsafe extern "system" fn (this: *const nsITreeView, index: libc::int32_t, _retval: *mut bool) -> nsresult,

    /* boolean isSeparator (in long index); */
    pub IsSeparator: unsafe extern "system" fn (this: *const nsITreeView, index: libc::int32_t, _retval: *mut bool) -> nsresult,

    /* boolean isSorted (); */
    pub IsSorted: unsafe extern "system" fn (this: *const nsITreeView, _retval: *mut bool) -> nsresult,

    /* boolean canDrop (in long index, in long orientation, in nsIDOMDataTransfer dataTransfer); */
    pub CanDrop: unsafe extern "system" fn (this: *const nsITreeView, index: libc::int32_t, orientation: libc::int32_t, dataTransfer: *const nsIDOMDataTransfer, _retval: *mut bool) -> nsresult,

    /* void drop (in long row, in long orientation, in nsIDOMDataTransfer dataTransfer); */
    pub Drop: unsafe extern "system" fn (this: *const nsITreeView, row: libc::int32_t, orientation: libc::int32_t, dataTransfer: *const nsIDOMDataTransfer) -> nsresult,

    /* long getParentIndex (in long rowIndex); */
    pub GetParentIndex: unsafe extern "system" fn (this: *const nsITreeView, rowIndex: libc::int32_t, _retval: *mut libc::int32_t) -> nsresult,

    /* boolean hasNextSibling (in long rowIndex, in long afterIndex); */
    pub HasNextSibling: unsafe extern "system" fn (this: *const nsITreeView, rowIndex: libc::int32_t, afterIndex: libc::int32_t, _retval: *mut bool) -> nsresult,

    /* long getLevel (in long index); */
    pub GetLevel: unsafe extern "system" fn (this: *const nsITreeView, index: libc::int32_t, _retval: *mut libc::int32_t) -> nsresult,

    /* AString getImageSrc (in long row, in nsITreeColumn col); */
    pub GetImageSrc: unsafe extern "system" fn (this: *const nsITreeView, row: libc::int32_t, col: *const nsITreeColumn, _retval: &mut ::nsstring::nsAString) -> nsresult,

    /* long getProgressMode (in long row, in nsITreeColumn col); */
    pub GetProgressMode: unsafe extern "system" fn (this: *const nsITreeView, row: libc::int32_t, col: *const nsITreeColumn, _retval: *mut libc::int32_t) -> nsresult,

    /* AString getCellValue (in long row, in nsITreeColumn col); */
    pub GetCellValue: unsafe extern "system" fn (this: *const nsITreeView, row: libc::int32_t, col: *const nsITreeColumn, _retval: &mut ::nsstring::nsAString) -> nsresult,

    /* AString getCellText (in long row, in nsITreeColumn col); */
    pub GetCellText: unsafe extern "system" fn (this: *const nsITreeView, row: libc::int32_t, col: *const nsITreeColumn, _retval: &mut ::nsstring::nsAString) -> nsresult,

    /* void setTree (in nsITreeBoxObject tree); */
    pub SetTree: unsafe extern "system" fn (this: *const nsITreeView, tree: *const nsITreeBoxObject) -> nsresult,

    /* void toggleOpenState (in long index); */
    pub ToggleOpenState: unsafe extern "system" fn (this: *const nsITreeView, index: libc::int32_t) -> nsresult,

    /* void cycleHeader (in nsITreeColumn col); */
    pub CycleHeader: unsafe extern "system" fn (this: *const nsITreeView, col: *const nsITreeColumn) -> nsresult,

    /* void selectionChanged (); */
    pub SelectionChanged: unsafe extern "system" fn (this: *const nsITreeView) -> nsresult,

    /* void cycleCell (in long row, in nsITreeColumn col); */
    pub CycleCell: unsafe extern "system" fn (this: *const nsITreeView, row: libc::int32_t, col: *const nsITreeColumn) -> nsresult,

    /* boolean isEditable (in long row, in nsITreeColumn col); */
    pub IsEditable: unsafe extern "system" fn (this: *const nsITreeView, row: libc::int32_t, col: *const nsITreeColumn, _retval: *mut bool) -> nsresult,

    /* boolean isSelectable (in long row, in nsITreeColumn col); */
    pub IsSelectable: unsafe extern "system" fn (this: *const nsITreeView, row: libc::int32_t, col: *const nsITreeColumn, _retval: *mut bool) -> nsresult,

    /* void setCellValue (in long row, in nsITreeColumn col, in AString value); */
    pub SetCellValue: unsafe extern "system" fn (this: *const nsITreeView, row: libc::int32_t, col: *const nsITreeColumn, value: &::nsstring::nsAString) -> nsresult,

    /* void setCellText (in long row, in nsITreeColumn col, in AString value); */
    pub SetCellText: unsafe extern "system" fn (this: *const nsITreeView, row: libc::int32_t, col: *const nsITreeColumn, value: &::nsstring::nsAString) -> nsresult,

    /* void performAction (in wstring action); */
    pub PerformAction: unsafe extern "system" fn (this: *const nsITreeView, action: *const libc::int16_t) -> nsresult,

    /* void performActionOnRow (in wstring action, in long row); */
    pub PerformActionOnRow: unsafe extern "system" fn (this: *const nsITreeView, action: *const libc::int16_t, row: libc::int32_t) -> nsresult,

    /* void performActionOnCell (in wstring action, in long row, in nsITreeColumn col); */
    pub PerformActionOnCell: unsafe extern "system" fn (this: *const nsITreeView, action: *const libc::int16_t, row: libc::int32_t, col: *const nsITreeColumn) -> 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 nsITreeView {

    pub const DROP_BEFORE: i64 = -1;


    pub const DROP_ON: i64 = 0;


    pub const DROP_AFTER: i64 = 1;

    /// ```text
    /// /**
    ///    * The progress mode for a given cell. This method is only called for
    ///    * columns of type |progressmeter|.
    ///    */
    /// ```
    ///

    pub const PROGRESS_NORMAL: i64 = 1;


    pub const PROGRESS_UNDETERMINED: i64 = 2;


    pub const PROGRESS_NONE: i64 = 3;

    /// ```text
    /// /**
    ///    * The total number of rows in the tree (including the offscreen rows).
    ///    */
    /// ```
    ///

    /// `readonly attribute long rowCount;`
    #[inline]
    pub unsafe fn GetRowCount(&self, aRowCount: *mut libc::int32_t) -> nsresult {
        ((*self.vtable).GetRowCount)(self, aRowCount)
    }


    /// ```text
    /// /**
    ///    * The selection for this view.
    ///    */
    /// ```
    ///

    /// `attribute nsITreeSelection selection;`
    #[inline]
    pub unsafe fn GetSelection(&self, aSelection: *mut *const nsITreeSelection) -> nsresult {
        ((*self.vtable).GetSelection)(self, aSelection)
    }


    /// ```text
    /// /**
    ///    * The selection for this view.
    ///    */
    /// ```
    ///

    /// `attribute nsITreeSelection selection;`
    #[inline]
    pub unsafe fn SetSelection(&self, aSelection: *const nsITreeSelection) -> nsresult {
        ((*self.vtable).SetSelection)(self, aSelection)
    }


    /// ```text
    /// /**
    ///    * A whitespace delimited list of properties.  For each property X the view
    ///    * gives back will cause the pseudoclasses  ::-moz-tree-cell(x),
    ///    * ::-moz-tree-row(x), ::-moz-tree-twisty(x), ::-moz-tree-image(x),
    ///    * ::-moz-tree-cell-text(x).  to be matched on the pseudoelement
    ///    * ::moz-tree-row.
    ///    */
    /// ```
    ///

    /// `AString getRowProperties (in long index);`
    #[inline]
    pub unsafe fn GetRowProperties(&self, index: libc::int32_t, _retval: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetRowProperties)(self, index, _retval)
    }


    /// ```text
    /// /**
    ///    * A whitespace delimited list of properties for a given cell.  Each
    ///    * property, x, that the view gives back will cause the pseudoclasses
    ///    *  ::-moz-tree-cell(x), ::-moz-tree-row(x), ::-moz-tree-twisty(x),
    ///    *  ::-moz-tree-image(x), ::-moz-tree-cell-text(x). to be matched on the
    ///    *  cell.
    ///    */
    /// ```
    ///

    /// `AString getCellProperties (in long row, in nsITreeColumn col);`
    #[inline]
    pub unsafe fn GetCellProperties(&self, row: libc::int32_t, col: *const nsITreeColumn, _retval: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetCellProperties)(self, row, col, _retval)
    }


    /// ```text
    /// /**
    ///    * Called to get properties to paint a column background.  For shading the sort
    ///    * column, etc.
    ///    */
    /// ```
    ///

    /// `AString getColumnProperties (in nsITreeColumn col);`
    #[inline]
    pub unsafe fn GetColumnProperties(&self, col: *const nsITreeColumn, _retval: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetColumnProperties)(self, col, _retval)
    }


    /// ```text
    /// /**
    ///    * Methods that can be used to test whether or not a twisty should be drawn,
    ///    * and if so, whether an open or closed twisty should be used.
    ///    */
    /// ```
    ///

    /// `boolean isContainer (in long index);`
    #[inline]
    pub unsafe fn IsContainer(&self, index: libc::int32_t, _retval: *mut bool) -> nsresult {
        ((*self.vtable).IsContainer)(self, index, _retval)
    }



    /// `boolean isContainerOpen (in long index);`
    #[inline]
    pub unsafe fn IsContainerOpen(&self, index: libc::int32_t, _retval: *mut bool) -> nsresult {
        ((*self.vtable).IsContainerOpen)(self, index, _retval)
    }



    /// `boolean isContainerEmpty (in long index);`
    #[inline]
    pub unsafe fn IsContainerEmpty(&self, index: libc::int32_t, _retval: *mut bool) -> nsresult {
        ((*self.vtable).IsContainerEmpty)(self, index, _retval)
    }


    /// ```text
    /// /**
    ///    * isSeparator is used to determine if the row at index is a separator.
    ///    * A value of true will result in the tree drawing a horizontal separator.
    ///    * The tree uses the ::moz-tree-separator pseudoclass to draw the separator.
    ///    */
    /// ```
    ///

    /// `boolean isSeparator (in long index);`
    #[inline]
    pub unsafe fn IsSeparator(&self, index: libc::int32_t, _retval: *mut bool) -> nsresult {
        ((*self.vtable).IsSeparator)(self, index, _retval)
    }


    /// ```text
    /// /**
    ///    * Specifies if there is currently a sort on any column. Used mostly by dragdrop
    ///    * to affect drop feedback.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * Methods used by the drag feedback code to determine if a drag is allowable at
    ///    * the current location. To get the behavior where drops are only allowed on
    ///    * items, such as the mailNews folder pane, always return false when
    ///    * the orientation is not DROP_ON.
    ///    */
    /// ```
    ///

    /// `boolean canDrop (in long index, in long orientation, in nsIDOMDataTransfer dataTransfer);`
    #[inline]
    pub unsafe fn CanDrop(&self, index: libc::int32_t, orientation: libc::int32_t, dataTransfer: *const nsIDOMDataTransfer, _retval: *mut bool) -> nsresult {
        ((*self.vtable).CanDrop)(self, index, orientation, dataTransfer, _retval)
    }


    /// ```text
    /// /**
    ///    * Called when the user drops something on this view. The |orientation| param
    ///    * specifies before/on/after the given |row|.
    ///    */
    /// ```
    ///

    /// `void drop (in long row, in long orientation, in nsIDOMDataTransfer dataTransfer);`
    #[inline]
    pub unsafe fn Drop(&self, row: libc::int32_t, orientation: libc::int32_t, dataTransfer: *const nsIDOMDataTransfer) -> nsresult {
        ((*self.vtable).Drop)(self, row, orientation, dataTransfer)
    }


    /// ```text
    /// /**
    ///    * Methods used by the tree to draw thread lines in the tree.
    ///    * getParentIndex is used to obtain the index of a parent row.
    ///    * If there is no parent row, getParentIndex returns -1.
    ///    */
    /// ```
    ///

    /// `long getParentIndex (in long rowIndex);`
    #[inline]
    pub unsafe fn GetParentIndex(&self, rowIndex: libc::int32_t, _retval: *mut libc::int32_t) -> nsresult {
        ((*self.vtable).GetParentIndex)(self, rowIndex, _retval)
    }


    /// ```text
    /// /**
    ///    * hasNextSibling is used to determine if the row at rowIndex has a nextSibling
    ///    * that occurs *after* the index specified by afterIndex.  Code that is forced
    ///    * to march down the view looking at levels can optimize the march by starting
    ///    * at afterIndex+1.
    ///    */
    /// ```
    ///

    /// `boolean hasNextSibling (in long rowIndex, in long afterIndex);`
    #[inline]
    pub unsafe fn HasNextSibling(&self, rowIndex: libc::int32_t, afterIndex: libc::int32_t, _retval: *mut bool) -> nsresult {
        ((*self.vtable).HasNextSibling)(self, rowIndex, afterIndex, _retval)
    }


    /// ```text
    /// /**
    ///    * The level is an integer value that represents
    ///    * the level of indentation.  It is multiplied by the width specified in the
    ///    * :moz-tree-indentation pseudoelement to compute the exact indendation.
    ///    */
    /// ```
    ///

    /// `long getLevel (in long index);`
    #[inline]
    pub unsafe fn GetLevel(&self, index: libc::int32_t, _retval: *mut libc::int32_t) -> nsresult {
        ((*self.vtable).GetLevel)(self, index, _retval)
    }


    /// ```text
    /// /**
    ///    * The image path for a given cell. For defining an icon for a cell.
    ///    * If the empty string is returned, the :moz-tree-image pseudoelement
    ///    * will be used.
    ///    */
    /// ```
    ///

    /// `AString getImageSrc (in long row, in nsITreeColumn col);`
    #[inline]
    pub unsafe fn GetImageSrc(&self, row: libc::int32_t, col: *const nsITreeColumn, _retval: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetImageSrc)(self, row, col, _retval)
    }



    /// `long getProgressMode (in long row, in nsITreeColumn col);`
    #[inline]
    pub unsafe fn GetProgressMode(&self, row: libc::int32_t, col: *const nsITreeColumn, _retval: *mut libc::int32_t) -> nsresult {
        ((*self.vtable).GetProgressMode)(self, row, col, _retval)
    }


    /// ```text
    /// /**
    ///    * The value for a given cell. This method is only called for columns
    ///    * of type other than |text|.
    ///    */
    /// ```
    ///

    /// `AString getCellValue (in long row, in nsITreeColumn col);`
    #[inline]
    pub unsafe fn GetCellValue(&self, row: libc::int32_t, col: *const nsITreeColumn, _retval: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetCellValue)(self, row, col, _retval)
    }


    /// ```text
    /// /**
    ///    * The text for a given cell.  If a column consists only of an image, then
    ///    * the empty string is returned.
    ///    */
    /// ```
    ///

    /// `AString getCellText (in long row, in nsITreeColumn col);`
    #[inline]
    pub unsafe fn GetCellText(&self, row: libc::int32_t, col: *const nsITreeColumn, _retval: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetCellText)(self, row, col, _retval)
    }


    /// ```text
    /// /**
    ///    * Called during initialization to link the view to the front end box object.
    ///    */
    /// ```
    ///

    /// `void setTree (in nsITreeBoxObject tree);`
    #[inline]
    pub unsafe fn SetTree(&self, tree: *const nsITreeBoxObject) -> nsresult {
        ((*self.vtable).SetTree)(self, tree)
    }


    /// ```text
    /// /**
    ///    * Called on the view when an item is opened or closed.
    ///    */
    /// ```
    ///

    /// `void toggleOpenState (in long index);`
    #[inline]
    pub unsafe fn ToggleOpenState(&self, index: libc::int32_t) -> nsresult {
        ((*self.vtable).ToggleOpenState)(self, index)
    }


    /// ```text
    /// /**
    ///    * Called on the view when a header is clicked.
    ///    */
    /// ```
    ///

    /// `void cycleHeader (in nsITreeColumn col);`
    #[inline]
    pub unsafe fn CycleHeader(&self, col: *const nsITreeColumn) -> nsresult {
        ((*self.vtable).CycleHeader)(self, col)
    }


    /// ```text
    /// /**
    ///    * Should be called from a XUL onselect handler whenever the selection changes.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * Called on the view when a cell in a non-selectable cycling column (e.g., unread/flag/etc.) is clicked.
    ///    */
    /// ```
    ///

    /// `void cycleCell (in long row, in nsITreeColumn col);`
    #[inline]
    pub unsafe fn CycleCell(&self, row: libc::int32_t, col: *const nsITreeColumn) -> nsresult {
        ((*self.vtable).CycleCell)(self, row, col)
    }


    /// ```text
    /// /**
    ///    * isEditable is called to ask the view if the cell contents are editable.
    ///    * A value of true will result in the tree popping up a text field when
    ///    * the user tries to inline edit the cell.
    ///    */
    /// ```
    ///

    /// `boolean isEditable (in long row, in nsITreeColumn col);`
    #[inline]
    pub unsafe fn IsEditable(&self, row: libc::int32_t, col: *const nsITreeColumn, _retval: *mut bool) -> nsresult {
        ((*self.vtable).IsEditable)(self, row, col, _retval)
    }


    /// ```text
    /// /**
    ///    * isSelectable is called to ask the view if the cell is selectable.
    ///    * This method is only called if the selection style is |cell| or |text|.
    ///    * XXXvarga shouldn't this be called isCellSelectable?
    ///    */
    /// ```
    ///

    /// `boolean isSelectable (in long row, in nsITreeColumn col);`
    #[inline]
    pub unsafe fn IsSelectable(&self, row: libc::int32_t, col: *const nsITreeColumn, _retval: *mut bool) -> nsresult {
        ((*self.vtable).IsSelectable)(self, row, col, _retval)
    }


    /// ```text
    /// /**
    ///    * setCellValue is called when the value of the cell has been set by the user.
    ///    * This method is only called for columns of type other than |text|.
    ///    */
    /// ```
    ///

    /// `void setCellValue (in long row, in nsITreeColumn col, in AString value);`
    #[inline]
    pub unsafe fn SetCellValue(&self, row: libc::int32_t, col: *const nsITreeColumn, value: &::nsstring::nsAString) -> nsresult {
        ((*self.vtable).SetCellValue)(self, row, col, value)
    }


    /// ```text
    /// /**
    ///    * setCellText is called when the contents of the cell have been edited by the user.
    ///    */
    /// ```
    ///

    /// `void setCellText (in long row, in nsITreeColumn col, in AString value);`
    #[inline]
    pub unsafe fn SetCellText(&self, row: libc::int32_t, col: *const nsITreeColumn, value: &::nsstring::nsAString) -> nsresult {
        ((*self.vtable).SetCellText)(self, row, col, value)
    }


    /// ```text
    /// /**
    ///    * A command API that can be used to invoke commands on the selection.  The tree
    ///    * will automatically invoke this method when certain keys are pressed.  For example,
    ///    * when the DEL key is pressed, performAction will be called with the "delete" string.
    ///    */
    /// ```
    ///

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


    /// ```text
    /// /**
    ///    * A command API that can be used to invoke commands on a specific row.
    ///    */
    /// ```
    ///

    /// `void performActionOnRow (in wstring action, in long row);`
    #[inline]
    pub unsafe fn PerformActionOnRow(&self, action: *const libc::int16_t, row: libc::int32_t) -> nsresult {
        ((*self.vtable).PerformActionOnRow)(self, action, row)
    }


    /// ```text
    /// /**
    ///    * A command API that can be used to invoke commands on a specific cell.
    ///    */
    /// ```
    ///

    /// `void performActionOnCell (in wstring action, in long row, in nsITreeColumn col);`
    #[inline]
    pub unsafe fn PerformActionOnCell(&self, action: *const libc::int16_t, row: libc::int32_t, col: *const nsITreeColumn) -> nsresult {
        ((*self.vtable).PerformActionOnCell)(self, action, row, col)
    }


}


/// `interface nsINativeTreeView : nsITreeView`
///

/// ```text
/// /**
///  * The following interface is not scriptable and MUST NEVER BE MADE scriptable.
///  * Native treeviews implement it, and we use this to check whether a treeview
///  * is native (and therefore suitable for use by untrusted content).
///  */
/// ```
///

// 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 nsINativeTreeView {
    vtable: *const nsINativeTreeViewVTable,

    /// 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 nsINativeTreeView.
unsafe impl XpCom for nsINativeTreeView {
    const IID: nsIID = nsID(0x46c90265, 0x6553, 0x41ae,
        [0x8d, 0x39, 0x70, 0x22, 0xe7, 0xd0, 0x91, 0x45]);
}

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

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

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

    /* [noscript] void ensureNative (); */
    pub EnsureNative: unsafe extern "system" fn (this: *const nsINativeTreeView) -> 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 nsINativeTreeView {


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


}