|
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/. */ |
|
5 |
|
6 #include "nsISupports.idl" |
|
7 |
|
8 interface nsIDOMElement; |
|
9 |
|
10 |
|
11 [scriptable, uuid(56E2ADA8-4631-11d4-BA11-001083023C1E)] |
|
12 interface nsIScrollBoxObject : nsISupports |
|
13 { |
|
14 /** |
|
15 * Scroll to the given coordinates, in css pixels. |
|
16 * (0,0) will put the top left corner of the scrolled element's padding-box |
|
17 * at the top left corner of the scrollport (which is its inner-border-box). |
|
18 * Values will be clamped to legal values. |
|
19 */ |
|
20 void scrollTo(in long x, in long y); |
|
21 |
|
22 /** |
|
23 * Scroll the given amount of device pixels to the right and down. |
|
24 * Values will be clamped to make the resuling position legal. |
|
25 */ |
|
26 void scrollBy(in long dx, in long dy); |
|
27 |
|
28 void scrollByLine(in long dlines); |
|
29 void scrollByIndex(in long dindexes); |
|
30 void scrollToLine(in long line); |
|
31 void scrollToElement(in nsIDOMElement child); |
|
32 void scrollToIndex(in long index); |
|
33 |
|
34 /** |
|
35 * Get the current scroll position in css pixels. |
|
36 * @see scrollTo for the definition of x and y. |
|
37 */ |
|
38 void getPosition(out long x, out long y); |
|
39 |
|
40 void getScrolledSize(out long width, out long height); |
|
41 void ensureElementIsVisible(in nsIDOMElement child); |
|
42 void ensureIndexIsVisible(in long index); |
|
43 void ensureLineIsVisible(in long line); |
|
44 }; |
|
45 |
|
46 %{C++ |
|
47 class nsIBoxObject; |
|
48 |
|
49 nsresult |
|
50 NS_NewScrollBoxObject(nsIBoxObject** aResult); |
|
51 |
|
52 %} |