Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/TreeBoxObject.h
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef mozilla_dom_TreeBoxObject_h
8
#define mozilla_dom_TreeBoxObject_h
9
10
#include "mozilla/dom/BoxObject.h"
11
#include "nsITreeView.h"
12
#include "nsITreeBoxObject.h"
13
14
class nsTreeBodyFrame;
15
class nsTreeColumn;
16
class nsTreeColumns;
17
18
namespace mozilla {
19
namespace dom {
20
21
struct TreeCellInfo;
22
class DOMRect;
23
enum class CallerType : uint32_t;
24
25
class TreeBoxObject final : public BoxObject,
26
                            public nsITreeBoxObject
27
{
28
public:
29
  NS_DECL_ISUPPORTS_INHERITED
30
  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TreeBoxObject, BoxObject)
31
  NS_DECL_NSITREEBOXOBJECT
32
33
  TreeBoxObject();
34
35
  nsTreeBodyFrame* GetTreeBodyFrame(bool aFlushLayout = false);
36
0
  nsTreeBodyFrame* GetCachedTreeBodyFrame() { return mTreeBody; }
37
38
  //NS_PIBOXOBJECT interfaces
39
  virtual void Clear() override;
40
  virtual void ClearCachedValues() override;
41
42
  // WebIDL
43
  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
44
45
  already_AddRefed<nsTreeColumns> GetColumns();
46
47
  already_AddRefed<nsITreeView> GetView(CallerType /* unused */);
48
49
  void SetView(nsITreeView* arg, CallerType aCallerType,
50
               ErrorResult& aRv);
51
52
  bool Focused();
53
54
  already_AddRefed<Element> GetTreeBody();
55
56
  int32_t RowHeight();
57
58
  int32_t RowWidth();
59
60
  int32_t HorizontalPosition();
61
62
  void EnsureCellIsVisible(int32_t row, nsTreeColumn* col, ErrorResult& aRv);
63
64
  void ScrollToRow(int32_t aRow);
65
66
  void ScrollByLines(int32_t aNumLines);
67
68
  void ScrollByPages(int32_t aNumPages);
69
70
  int32_t GetFirstVisibleRow();
71
72
  int32_t GetLastVisibleRow();
73
74
  int32_t GetPageLength();
75
76
  int32_t GetRowAt(int32_t x, int32_t y);
77
78
  void GetCellAt(int32_t x, int32_t y, TreeCellInfo& aRetVal, ErrorResult& aRv);
79
80
  already_AddRefed<DOMRect> GetCoordsForCellItem(int32_t row,
81
                                                 nsTreeColumn& col,
82
                                                 const nsAString& element,
83
                                                 ErrorResult& aRv);
84
85
  bool IsCellCropped(int32_t row, nsTreeColumn* col, ErrorResult& aRv);
86
87
  void RemoveImageCacheEntry(int32_t row, nsTreeColumn& col, ErrorResult& aRv);
88
89
  // Deprecated APIs from old IDL
90
  void GetCellAt(JSContext* cx,
91
                 int32_t x, int32_t y,
92
                 JS::Handle<JSObject*> rowOut,
93
                 JS::Handle<JSObject*> colOut,
94
                 JS::Handle<JSObject*> childEltOut,
95
                 ErrorResult& aRv);
96
97
  void GetCoordsForCellItem(JSContext* cx,
98
                            int32_t row,
99
                            nsTreeColumn& col,
100
                            const nsAString& element,
101
                            JS::Handle<JSObject*> xOut,
102
                            JS::Handle<JSObject*> yOut,
103
                            JS::Handle<JSObject*> widthOut,
104
                            JS::Handle<JSObject*> heightOut,
105
                            ErrorResult& aRv);
106
107
  // Same signature (except for nsresult return type) as the XPIDL impls
108
  // void Invalidate();
109
  // void BeginUpdateBatch();
110
  // void EndUpdateBatch();
111
  // void ClearStyleAndImageCaches();
112
  // void SetFocused(bool arg);
113
  // void EnsureRowIsVisible(int32_t index);
114
  // void InvalidateColumn(nsTreeColumn* col);
115
  // void InvalidateRow(int32_t index);
116
  // void InvalidateCell(int32_t row, nsTreeColumn* col);
117
  // void InvalidateRange(int32_t startIndex, int32_t endIndex);
118
  // void RowCountChanged(int32_t index, int32_t count);
119
120
protected:
121
  nsTreeBodyFrame* mTreeBody;
122
  nsCOMPtr<nsITreeView> mView;
123
124
private:
125
  ~TreeBoxObject();
126
};
127
128
} // namespace dom
129
} // namespace mozilla
130
131
#endif