1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is mozilla.org code.
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 * Original Author: Eric D. Vaughan (evaughan@netscape.com)
24 *
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
36 *
37 * ***** END LICENSE BLOCK ***** */
38
39 #include "nsIBoxObject.idl"
40
41 interface nsIDOMElement;
42
43
44 [scriptable, uuid(56E2ADA8-4631-11d4-BA11-001083023C1E)]
45 interface nsIScrollBoxObject : nsISupports
46 {
47 /**
48 * Scroll to the given coordinates, in css pixels.
49 * (0,0) will put the top left corner of the scrolled element's padding-box
50 * at the top left corner of the scrollport (which is its inner-border-box).
51 * Values will be clamped to legal values.
52 */
53 void scrollTo(in long x, in long y);
54
55 /**
56 * Scroll the given amount of device pixels to the right and down.
57 * Values will be clamped to make the resuling position legal.
58 */
59 void scrollBy(in long dx, in long dy);
60
61 void scrollByLine(in long dlines);
62 void scrollByIndex(in long dindexes);
63 void scrollToLine(in long line);
64 void scrollToElement(in nsIDOMElement child);
65 void scrollToIndex(in long index);
66
67 /**
68 * Get the current scroll position in css pixels.
69 * @see scrollTo for the definition of x and y.
70 */
71 void getPosition(out long x, out long y);
72
73 void getScrolledSize(out long width, out long height);
74 void ensureElementIsVisible(in nsIDOMElement child);
75 void ensureIndexIsVisible(in long index);
76 void ensureLineIsVisible(in long line);
77 };
78
79 %{C++
80 nsresult
81 NS_NewScrollBoxObject(nsIBoxObject** aResult);
82
83 %}