2003-07-31 23:52:10 +00:00
|
|
|
/*
|
|
|
|
NSProgressIndicator.h
|
|
|
|
|
|
|
|
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Author: Gerrit van Dyk <gerritvd@decimax.com>
|
|
|
|
Date: 1999
|
|
|
|
|
|
|
|
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.
|
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
|
2009-10-27 22:21:01 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2007-10-29 21:16:17 +00:00
|
|
|
Lesser General Public License for more details.
|
2003-07-31 23:52:10 +00:00
|
|
|
|
2007-10-29 21:16:17 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2003-07-31 23:52:10 +00:00
|
|
|
License along with this library; see the file COPYING.LIB.
|
2007-10-29 21:16:17 +00:00
|
|
|
If not, see <http://www.gnu.org/licenses/> or write to the
|
|
|
|
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
2006-11-06 13:58:37 +00:00
|
|
|
Boston, MA 02110-1301, USA.
|
2003-07-31 23:52:10 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GNUstep_H_NSProgressIndicator
|
|
|
|
#define _GNUstep_H_NSProgressIndicator
|
2009-10-27 22:21:01 +00:00
|
|
|
#import <GNUstepBase/GSVersionMacros.h>
|
2003-07-31 23:52:10 +00:00
|
|
|
|
2009-10-27 22:21:01 +00:00
|
|
|
#import <AppKit/NSView.h>
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
/* For NSControlTint */
|
2009-10-27 22:21:01 +00:00
|
|
|
#import <AppKit/NSColor.h>
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
/* For NSControlSize */
|
2009-10-27 22:21:01 +00:00
|
|
|
#import <AppKit/NSCell.h>
|
|
|
|
|
|
|
|
@class NSTimer;
|
|
|
|
@class NSThread;
|
|
|
|
|
|
|
|
typedef enum _NSProgressIndicatorThickness
|
|
|
|
{
|
|
|
|
NSProgressIndicatorPreferredThickness = 14,
|
|
|
|
NSProgressIndicatorPreferredSmallThickness = 10,
|
|
|
|
NSProgressIndicatorPreferredLargeThickness = 18,
|
|
|
|
NSProgressIndicatorPreferredAquaThickness = 12
|
|
|
|
} NSProgressIndicatorThickness;
|
2003-07-31 23:52:10 +00:00
|
|
|
|
2009-10-27 22:21:01 +00:00
|
|
|
typedef enum _NSProgressIndicatorStyle
|
|
|
|
{
|
|
|
|
NSProgressIndicatorBarStyle = 0,
|
|
|
|
NSProgressIndicatorSpinningStyle = 1
|
|
|
|
} NSProgressIndicatorStyle;
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
@interface NSProgressIndicator : NSView
|
|
|
|
{
|
2009-10-27 22:21:01 +00:00
|
|
|
double _doubleValue;
|
|
|
|
double _minValue;
|
|
|
|
double _maxValue;
|
|
|
|
NSTimeInterval _animationDelay;
|
|
|
|
NSProgressIndicatorStyle _style;
|
|
|
|
BOOL _isIndeterminate;
|
|
|
|
BOOL _isBezeled;
|
|
|
|
BOOL _usesThreadedAnimation;
|
|
|
|
BOOL _isDisplayedWhenStopped;
|
|
|
|
NSControlTint _controlTint;
|
|
|
|
NSControlSize _controlSize;
|
2003-07-31 23:52:10 +00:00
|
|
|
@private
|
2009-10-27 22:21:01 +00:00
|
|
|
BOOL _isVertical;
|
|
|
|
BOOL _isRunning;
|
|
|
|
int _count;
|
|
|
|
NSTimer *_timer;
|
2011-03-10 22:18:42 +00:00
|
|
|
id _reserved;
|
2003-07-31 23:52:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Animating the progress indicator
|
|
|
|
//
|
2009-10-27 22:21:01 +00:00
|
|
|
|
|
|
|
#if OS_API_VERSION(GS_API_LATEST, MAC_OS_X_VERSION_10_5)
|
2003-07-31 23:52:10 +00:00
|
|
|
- (void)animate:(id)sender;
|
|
|
|
- (NSTimeInterval)animationDelay;
|
2005-06-16 12:34:13 +00:00
|
|
|
- (void)setAnimationDelay:(NSTimeInterval)delay;
|
2009-10-27 22:21:01 +00:00
|
|
|
#endif
|
|
|
|
|
2003-07-31 23:52:10 +00:00
|
|
|
- (void)startAnimation:(id)sender;
|
|
|
|
- (void)stopAnimation:(id)sender;
|
|
|
|
- (BOOL)usesThreadedAnimation;
|
|
|
|
- (void)setUsesThreadedAnimation:(BOOL)flag;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Advancing the progress bar
|
|
|
|
//
|
|
|
|
- (void)incrementBy:(double)delta;
|
|
|
|
- (double)doubleValue;
|
|
|
|
- (void)setDoubleValue:(double)aValue;
|
|
|
|
- (double)minValue;
|
|
|
|
- (void)setMinValue:(double)newMinimum;
|
|
|
|
- (double)maxValue;
|
|
|
|
- (void)setMaxValue:(double)newMaximum;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Setting the appearance
|
|
|
|
//
|
|
|
|
- (BOOL)isBezeled;
|
|
|
|
- (void)setBezeled:(BOOL)flag;
|
|
|
|
- (BOOL)isIndeterminate;
|
|
|
|
- (void)setIndeterminate:(BOOL)flag;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Standard control layout
|
|
|
|
//
|
|
|
|
- (NSControlSize)controlSize;
|
|
|
|
- (void)setControlSize:(NSControlSize)size;
|
|
|
|
- (NSControlTint)controlTint;
|
|
|
|
- (void)setControlTint:(NSControlTint)tint;
|
|
|
|
|
2009-10-27 22:21:01 +00:00
|
|
|
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
|
|
|
|
- (BOOL)isDisplayedWhenStopped;
|
|
|
|
- (void)setDisplayedWhenStopped:(BOOL)flag;
|
|
|
|
- (void)setStyle:(NSProgressIndicatorStyle)style;
|
|
|
|
- (NSProgressIndicatorStyle)style;
|
|
|
|
- (void)sizeToFit;
|
|
|
|
#endif
|
|
|
|
|
2003-07-31 23:52:10 +00:00
|
|
|
@end
|
|
|
|
|
2006-11-06 13:58:37 +00:00
|
|
|
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
|
2003-07-31 23:52:10 +00:00
|
|
|
@interface NSProgressIndicator (GNUstepExtensions)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Enables Vertical ProgressBar
|
|
|
|
*
|
|
|
|
* If isVertical = YES, Progress is from the bottom to the top
|
|
|
|
* If isVertical = NO, Progress is from the left to the right
|
|
|
|
*/
|
|
|
|
- (BOOL)isVertical;
|
|
|
|
- (void)setVertical:(BOOL)flag;
|
|
|
|
|
|
|
|
@end
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _GNUstep_H_NSProgressIndicator */
|