Back to index

lightning-sunbird  0.9+nobinonly
nsIScrollable.idl
Go to the documentation of this file.
00001 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002  *
00003  * ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is the Mozilla browser.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Netscape Communications, Inc.
00020  * Portions created by the Initial Developer are Copyright (C) 1999
00021  * the Initial Developer. All Rights Reserved.
00022  *
00023  * Contributor(s):
00024  *   Travis Bogard <travis@netscape.com>
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either of the GNU General Public License Version 2 or later (the "GPL"),
00028  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 #include "nsISupports.idl"
00041 
00051 [scriptable, uuid(919e792a-6490-40b8-bba5-f9e9ad5640c8)]
00052 interface nsIScrollable : nsISupports
00053 {
00054        /*
00055        Constants declaring the two scroll orientations a scroll bar can be in.
00056         ScrollOrientation_X - Horizontal scrolling.  When passing this
00057                 in to a scroll position method you are requesting or
00058                 setting the positions for the horizontal scroll bar.
00059         ScrollOrientation_Y - Vertical scrolling.  When passing this
00060                 in to a scroll position you are requesting or setting
00061                 the positions for the vertical scroll bar.
00062        */
00063        const long ScrollOrientation_X = 1;
00064        const long ScrollOrientation_Y = 2;
00065 
00066        /*
00067        Retrieves or Sets the current thumb position to the curPos passed in for the
00068        scrolling orientation passed in.  curPos should be between minPos and maxPos.
00069 
00070        @return       NS_OK - Setting or Getting completed successfully.
00071                             NS_ERROR_INVALID_ARG - returned when curPos is not within the
00072                                    minPos and maxPos.
00073        */
00074        long getCurScrollPos(in long scrollOrientation);
00075        void setCurScrollPos(in long scrollOrientation, in long curPos);
00076 
00077        /*
00078        This function atomizes the ability to scroll in two dimensions at the same
00079        time.
00080        */
00081        void setCurScrollPosEx(in long curHorizontalPos, in long curVerticalPos);
00082 
00083        /*
00084        Retrieves or Sets the valid ranges for the thumb.  When maxPos is set to 
00085        something less than the current thumb position, curPos is set = to maxPos.
00086 
00087        @return       NS_OK - Setting or Getting completed successfully.
00088                             NS_ERROR_INVALID_ARG - returned when curPos is not within the
00089                                    minPos and maxPos.
00090        */
00091        void getScrollRange(in long scrollOrientation, out long minPos, out long maxPos);
00092        void setScrollRange(in long scrollOrientation, in long minPos, in long maxPos);
00093 
00094        /*
00095        This function atomizes the ability to set the ranges in two dimensions at 
00096        the same time.
00097        */
00098        void setScrollRangeEx(in long minHorizontalPos, in long maxHorizontalPos,
00099               in long minVerticalPos, in long maxVerticalPos);
00100 
00101        /*
00102        Constants declaring the states of the scroll bars.
00103        ScrollPref_Auto - bars visible only when needed.
00104        ScrollPref_Never - bars never visible, even when scrolling still possible.
00105        ScrollPref_Always - bars always visible, even when scrolling is not possible
00106        */
00107        const long Scrollbar_Auto = 1;
00108        const long Scrollbar_Never = 2;
00109        const long Scrollbar_Always = 3;
00110 
00111        /*
00112        Retrieves or Set the preferences for the scroll bar.
00113        current is 'scrolling preference for this document'
00114        default is 'scrolling preference for all documents in this shell'
00115        resetScrollbarPreferences resets current to default
00116        */
00117        long getDefaultScrollbarPreferences(in long scrollOrientation);
00118        void setDefaultScrollbarPreferences(in long scrollOrientation, in long scrollbarPref);
00119 
00120        /*
00121        Get information about whether the vertical and horizontal scrollbars are
00122        currently visible.  nsnull is a valid argument.  If you are only interested
00123        in one of the visibility settings pass nsnull in for the one you aren't
00124        interested in.
00125        */
00126        void getScrollbarVisibility(out boolean verticalVisible, 
00127               out boolean horizontalVisible);
00128 };