Back to index

lightning-sunbird  0.9+nobinonly
nsIScrollableView.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either of the GNU General Public License Version 2 or later (the "GPL"),
00026  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #ifndef nsIScrollableView_h___
00039 #define nsIScrollableView_h___
00040 
00041 #include "nsCoord.h"
00042 #include "nsIViewManager.h"
00043 #include "nsIView.h"
00044 
00045 class nsIView;
00046 class nsIScrollPositionListener;
00047 struct nsMargin;
00048 struct nsSize;
00049 
00050 // IID for the nsIScrollableView interface
00051 #define NS_ISCROLLABLEVIEW_IID    \
00052 { 0x36083bcf, 0x61d7, 0x4c24, \
00053 { 0xa6, 0xd4, 0x2f, 0x05, 0xba, 0x2c, 0x1b, 0x51 } }
00054 
00065 class nsIScrollableView {
00066 public:
00067   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCROLLABLEVIEW_IID)
00068 
00069   
00075   NS_IMETHOD  CreateScrollControls(nsNativeWidget aNative = nsnull) = 0;
00076 
00082   NS_IMETHOD  GetContainerSize(nscoord *aWidth, nscoord *aHeight) const = 0;
00083 
00087   NS_IMETHOD  SetScrolledView(nsIView *aScrolledView) = 0;
00088 
00093   NS_IMETHOD  GetScrolledView(nsIView *&aScrolledView) const = 0;
00094 
00098   NS_IMETHOD  GetScrollPosition(nscoord &aX, nscoord& aY) const = 0;
00099 
00109   NS_IMETHOD ScrollTo(nscoord aX, nscoord aY, PRUint32 aUpdateFlags) = 0;
00110 
00117   NS_IMETHOD SetScrollProperties(PRUint32 aProperties) = 0;
00118 
00125   NS_IMETHOD GetScrollProperties(PRUint32 *aProperties) = 0;
00126 
00133   NS_IMETHOD SetLineHeight(nscoord aHeight) = 0;
00134 
00140   NS_IMETHOD GetLineHeight(nscoord *aHeight) = 0;
00141 
00150   NS_IMETHOD ScrollByLines(PRInt32 aNumLinesX, PRInt32 aNumLinexY) = 0;
00151 
00157   NS_IMETHOD GetPageScrollDistances(nsSize *aDistances) = 0;
00158 
00168   NS_IMETHOD ScrollByPages(PRInt32 aNumPagesX, PRInt32 aNumPagesY) = 0;
00169 
00176   NS_IMETHOD ScrollByWhole(PRBool aTop) = 0;
00177 
00185   NS_IMETHOD CanScroll(PRBool aHorizontal, PRBool aForward, PRBool &aResult) = 0;
00186 
00190   NS_IMETHOD_(nsIView*) View() = 0;
00191 
00195   NS_IMETHOD AddScrollPositionListener(nsIScrollPositionListener* aListener) = 0;
00196   
00200   NS_IMETHOD RemoveScrollPositionListener(nsIScrollPositionListener* aListener) = 0;
00201 };
00202 
00203 //regardless of the transparency or opacity settings
00204 //for this view, it can always be scrolled via a blit
00205 #define NS_SCROLL_PROPERTY_ALWAYS_BLIT    0x0001
00206 
00207 //regardless of the transparency or opacity settings
00208 //for this view, it can never be scrolled via a blit
00209 #define NS_SCROLL_PROPERTY_NEVER_BLIT     0x0002
00210 
00211 // {A1985DF6-047A-4DD7-A21A-C72559470323}
00212 #define NS_ISCROLLABLEVIEW_MOZILLA_1_8_BRANCH_IID \
00213 { 0xA1985DF6, 0x047A, 0x4DD7, \
00214 { 0xA2, 0x1A, 0xC7, 0x25, 0x59, 0x47, 0x03, 0x23 } }
00215 
00216 class nsIScrollableView_MOZILLA_1_8_BRANCH : public nsIScrollableView
00217 {
00218 public:
00219   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCROLLABLEVIEW_MOZILLA_1_8_BRANCH_IID)
00220 
00221   
00229   NS_IMETHOD ScrollByPixels(PRInt32 aNumPixelsX, PRInt32 aNumPixelsY) = 0;
00230 };
00231 
00232 #endif