nsIScrollable.idl 2.1 KB

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