|
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
2 * vim: set ts=2 sw=2 et tw=78: |
|
3 * |
|
4 * This Source Code Form is subject to the terms of the Mozilla Public |
|
5 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
7 |
|
8 #include "nsISupports.idl" |
|
9 |
|
10 /** |
|
11 * The nsIScrollable is an interface that can be implemented by a control that |
|
12 * supports scrolling. This is a generic interface without concern for the |
|
13 * type of content that may be inside. |
|
14 */ |
|
15 [scriptable, uuid(3507fc93-313e-4a4c-8ca8-4d0ea0f97315)] |
|
16 interface nsIScrollable : nsISupports |
|
17 { |
|
18 /** |
|
19 * Constants declaring the two scroll orientations a scrollbar can be in. |
|
20 * ScrollOrientation_X - Horizontal scrolling. When passing this |
|
21 * in to a method you are requesting or setting data for the |
|
22 * horizontal scrollbar. |
|
23 * ScrollOrientation_Y - Vertical scrolling. When passing this |
|
24 * in to a method you are requesting or setting data for the |
|
25 * vertical scrollbar. |
|
26 */ |
|
27 const long ScrollOrientation_X = 1; |
|
28 const long ScrollOrientation_Y = 2; |
|
29 |
|
30 /** |
|
31 * Constants declaring the states of the scrollbars. |
|
32 * ScrollPref_Auto - bars visible only when needed. |
|
33 * ScrollPref_Never - bars never visible, even when scrolling still possible. |
|
34 * ScrollPref_Always - bars always visible, even when scrolling is not possible |
|
35 */ |
|
36 const long Scrollbar_Auto = 1; |
|
37 const long Scrollbar_Never = 2; |
|
38 const long Scrollbar_Always = 3; |
|
39 |
|
40 /** |
|
41 * Get or set the default scrollbar state for all documents in |
|
42 * this shell. |
|
43 */ |
|
44 long getDefaultScrollbarPreferences(in long scrollOrientation); |
|
45 void setDefaultScrollbarPreferences(in long scrollOrientation, |
|
46 in long scrollbarPref); |
|
47 |
|
48 /** |
|
49 * Get information about whether the vertical and horizontal scrollbars are |
|
50 * currently visible. If you are only interested in one of the visibility |
|
51 * settings pass nullptr in for the one you aren't interested in. |
|
52 */ |
|
53 void getScrollbarVisibility(out boolean verticalVisible, |
|
54 out boolean horizontalVisible); |
|
55 }; |