2003-07-31 23:52:10 +00:00
|
|
|
/*
|
|
|
|
NSScrollView.h
|
|
|
|
|
|
|
|
A view that allows you to scroll a document view that's too big to display
|
|
|
|
entirely on a window.
|
|
|
|
|
|
|
|
Copyright (C) 1996 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Author: Ovidiu Predescu <ovidiu@net-community.com>
|
|
|
|
Date: July 1997
|
|
|
|
|
|
|
|
This file is part of the GNUstep GUI Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-10-29 21:16:17 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
2003-07-31 23:52:10 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-10 04:01:49 +00:00
|
|
|
version 2 of the License, or (at your option) any later version.
|
2007-10-29 21:16:17 +00:00
|
|
|
|
2003-07-31 23:52:10 +00:00
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2007-10-29 21:16:17 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library; see the file COPYING.LIB.
|
|
|
|
If not, see <http://www.gnu.org/licenses/> or write to the
|
|
|
|
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA.
|
2003-07-31 23:52:10 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GNUstep_H_NSScrollView
|
|
|
|
#define _GNUstep_H_NSScrollView
|
2006-11-06 13:58:37 +00:00
|
|
|
#import <GNUstepBase/GSVersionMacros.h>
|
2003-07-31 23:52:10 +00:00
|
|
|
|
2010-03-31 08:14:50 +00:00
|
|
|
#import <AppKit/NSView.h>
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
@class NSClipView;
|
|
|
|
@class NSRulerView;
|
|
|
|
@class NSColor;
|
|
|
|
@class NSCursor;
|
|
|
|
@class NSScroller;
|
|
|
|
|
|
|
|
@interface NSScrollView : NSView
|
|
|
|
{
|
2007-02-28 17:53:43 +00:00
|
|
|
NSClipView *_contentView;
|
|
|
|
NSScroller *_horizScroller;
|
|
|
|
NSScroller *_vertScroller;
|
|
|
|
NSRulerView *_horizRuler;
|
|
|
|
NSRulerView *_vertRuler;
|
|
|
|
NSClipView *_headerClipView;
|
|
|
|
NSView *_cornerView;
|
2003-07-31 23:52:10 +00:00
|
|
|
float _hLineScroll;
|
|
|
|
float _hPageScroll;
|
|
|
|
float _vLineScroll;
|
|
|
|
float _vPageScroll;
|
|
|
|
NSBorderType _borderType;
|
|
|
|
BOOL _hasHorizScroller;
|
|
|
|
BOOL _hasVertScroller;
|
|
|
|
BOOL _hasHorizRuler;
|
|
|
|
BOOL _hasVertRuler;
|
|
|
|
BOOL _scrollsDynamically;
|
|
|
|
BOOL _rulersVisible;
|
|
|
|
BOOL _knobMoved;
|
|
|
|
BOOL _hasHeaderView;
|
|
|
|
BOOL _hasCornerView;
|
2007-02-28 17:53:43 +00:00
|
|
|
BOOL _autohidesScrollers;
|
2003-07-31 23:52:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Calculating layout */
|
|
|
|
+ (NSSize)contentSizeForFrameSize:(NSSize)frameSize
|
|
|
|
hasHorizontalScroller:(BOOL)hFlag
|
|
|
|
hasVerticalScroller:(BOOL)vFlag
|
|
|
|
borderType:(NSBorderType)borderType;
|
|
|
|
+ (NSSize)frameSizeForContentSize:(NSSize)contentSize
|
|
|
|
hasHorizontalScroller:(BOOL)hFlag
|
|
|
|
hasVerticalScroller:(BOOL)vFlag
|
|
|
|
borderType:(NSBorderType)borderType;
|
|
|
|
|
|
|
|
/* Determining component sizes */
|
|
|
|
- (NSSize)contentSize;
|
|
|
|
- (NSRect)documentVisibleRect;
|
|
|
|
|
|
|
|
/* Managing graphic attributes */
|
|
|
|
- (void)setBackgroundColor:(NSColor*)aColor;
|
|
|
|
- (NSColor*)backgroundColor;
|
|
|
|
- (void)setBorderType:(NSBorderType)borderType;
|
|
|
|
- (NSBorderType)borderType;
|
|
|
|
|
|
|
|
/* Managing the scrolled views */
|
|
|
|
- (void)setContentView:(NSClipView*)aView;
|
|
|
|
- (NSClipView*)contentView;
|
|
|
|
- (void)setDocumentView:(NSView*)aView;
|
|
|
|
- (id)documentView;
|
|
|
|
- (void)setDocumentCursor:(NSCursor*)aCursor;
|
|
|
|
- (NSCursor*)documentCursor;
|
|
|
|
|
|
|
|
/* Managing scrollers */
|
|
|
|
- (void)setHorizontalScroller:(NSScroller*)aScroller;
|
|
|
|
- (NSScroller*)horizontalScroller;
|
|
|
|
- (void)setHasHorizontalScroller:(BOOL)flag;
|
|
|
|
- (BOOL)hasHorizontalScroller;
|
|
|
|
- (void)setVerticalScroller:(NSScroller*)aScroller;
|
|
|
|
- (NSScroller*)verticalScroller;
|
|
|
|
- (void)setHasVerticalScroller:(BOOL)flag;
|
|
|
|
- (BOOL)hasVerticalScroller;
|
|
|
|
|
|
|
|
/* Managing rulers */
|
|
|
|
+ (void)setRulerViewClass:(Class)aClass;
|
|
|
|
+ (Class)rulerViewClass;
|
|
|
|
- (void)setHasHorizontalRuler:(BOOL)flag;
|
|
|
|
- (BOOL)hasHorizontalRuler;
|
|
|
|
- (void)setHorizontalRulerView:(NSRulerView*)aRulerView;
|
|
|
|
- (NSRulerView*)horizontalRulerView;
|
|
|
|
- (void)setHasVerticalRuler:(BOOL)flag;
|
|
|
|
- (BOOL)hasVerticalRuler;
|
|
|
|
- (void)setVerticalRulerView:(NSRulerView*)aRulerView;
|
|
|
|
- (NSRulerView*)verticalRulerView;
|
|
|
|
- (void)setRulersVisible:(BOOL)flag;
|
|
|
|
- (BOOL)rulersVisible;
|
|
|
|
|
|
|
|
/* Setting scrolling behavior */
|
2013-02-17 22:44:47 +00:00
|
|
|
- (void)setLineScroll:(CGFloat)aFloat;
|
|
|
|
- (CGFloat)lineScroll;
|
|
|
|
- (void)setPageScroll:(CGFloat)aFloat;
|
|
|
|
- (CGFloat)pageScroll;
|
2003-07-31 23:52:10 +00:00
|
|
|
- (void)setScrollsDynamically:(BOOL)flag;
|
|
|
|
- (BOOL)scrollsDynamically;
|
2006-11-06 13:58:37 +00:00
|
|
|
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
2013-02-17 22:44:47 +00:00
|
|
|
- (CGFloat) horizontalLineScroll;
|
|
|
|
- (CGFloat) horizontalPageScroll;
|
|
|
|
- (CGFloat) verticalLineScroll;
|
|
|
|
- (CGFloat) verticalPageScroll;
|
|
|
|
- (void) setHorizontalLineScroll: (CGFloat)aFloat;
|
|
|
|
- (void) setHorizontalPageScroll: (CGFloat)aFloat;
|
|
|
|
- (void) setVerticalLineScroll: (CGFloat)aFloat;
|
|
|
|
- (void) setVerticalPageScroll: (CGFloat)aFloat;
|
2003-07-31 23:52:10 +00:00
|
|
|
/* Setting the background drawing */
|
|
|
|
- (void)setDrawsBackground:(BOOL)flag;
|
|
|
|
- (BOOL)drawsBackground;
|
|
|
|
#endif
|
2007-02-28 17:53:43 +00:00
|
|
|
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
|
|
|
- (BOOL)autohidesScrollers;
|
|
|
|
- (void)setAutohidesScrollers:(BOOL)flag;
|
|
|
|
#endif
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
/* Updating display after scrolling */
|
|
|
|
- (void)reflectScrolledClipView:(NSClipView*)aClipView;
|
|
|
|
|
|
|
|
/* Arranging components */
|
|
|
|
- (void)tile;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
#endif /* _GNUstep_H_NSScrollView */
|