1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_dom_ScrollBoxObject_h
7 #define mozilla_dom_ScrollBoxObject_h
9 #include "mozilla/dom/BoxObject.h"
12 class nsIScrollableFrame
;
18 class ScrollBoxObject MOZ_FINAL
: public BoxObject
23 virtual JSObject
* WrapObject(JSContext
* aCx
) MOZ_OVERRIDE
;
25 virtual nsIScrollableFrame
* GetScrollFrame();
27 void ScrollTo(int32_t x
, int32_t y
, ErrorResult
& aRv
);
28 void ScrollBy(int32_t dx
, int32_t dy
, ErrorResult
& aRv
);
29 void ScrollByLine(int32_t dlines
, ErrorResult
& aRv
);
30 void ScrollByIndex(int32_t dindexes
, ErrorResult
& aRv
);
31 void ScrollToLine(int32_t line
, ErrorResult
& aRv
);
32 void ScrollToElement(Element
& child
, ErrorResult
& aRv
);
33 void ScrollToIndex(int32_t index
, ErrorResult
& aRv
);
34 int32_t GetPositionX(ErrorResult
& aRv
);
35 int32_t GetPositionY(ErrorResult
& aRv
);
36 int32_t GetScrolledWidth(ErrorResult
& aRv
);
37 int32_t GetScrolledHeight(ErrorResult
& aRv
);
38 void EnsureElementIsVisible(Element
& child
, ErrorResult
& aRv
);
39 void EnsureIndexIsVisible(int32_t index
, ErrorResult
& aRv
);
40 void EnsureLineIsVisible(int32_t line
, ErrorResult
& aRv
);
42 // Deprecated APIs from old IDL
43 void GetPosition(JSContext
* cx
,
44 JS::Handle
<JSObject
*> x
,
45 JS::Handle
<JSObject
*> y
,
48 void GetScrolledSize(JSContext
* cx
,
49 JS::Handle
<JSObject
*> width
,
50 JS::Handle
<JSObject
*> height
,
54 void GetScrolledSize(nsRect
& aRect
, ErrorResult
& aRv
);
55 void GetPosition(CSSIntPoint
& aPos
, ErrorResult
& aRv
);
62 } // namespace mozilla
64 #endif // mozilla_dom_ScrollBoxObject_h