michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIDOMElement; michael@0: michael@0: michael@0: [scriptable, uuid(56E2ADA8-4631-11d4-BA11-001083023C1E)] michael@0: interface nsIScrollBoxObject : nsISupports michael@0: { michael@0: /** michael@0: * Scroll to the given coordinates, in css pixels. michael@0: * (0,0) will put the top left corner of the scrolled element's padding-box michael@0: * at the top left corner of the scrollport (which is its inner-border-box). michael@0: * Values will be clamped to legal values. michael@0: */ michael@0: void scrollTo(in long x, in long y); michael@0: michael@0: /** michael@0: * Scroll the given amount of device pixels to the right and down. michael@0: * Values will be clamped to make the resuling position legal. michael@0: */ michael@0: void scrollBy(in long dx, in long dy); michael@0: michael@0: void scrollByLine(in long dlines); michael@0: void scrollByIndex(in long dindexes); michael@0: void scrollToLine(in long line); michael@0: void scrollToElement(in nsIDOMElement child); michael@0: void scrollToIndex(in long index); michael@0: michael@0: /** michael@0: * Get the current scroll position in css pixels. michael@0: * @see scrollTo for the definition of x and y. michael@0: */ michael@0: void getPosition(out long x, out long y); michael@0: michael@0: void getScrolledSize(out long width, out long height); michael@0: void ensureElementIsVisible(in nsIDOMElement child); michael@0: void ensureIndexIsVisible(in long index); michael@0: void ensureLineIsVisible(in long line); michael@0: }; michael@0: michael@0: %{C++ michael@0: class nsIBoxObject; michael@0: michael@0: nsresult michael@0: NS_NewScrollBoxObject(nsIBoxObject** aResult); michael@0: michael@0: %}