1 /* 2 NSButton.h 3 4 The button class 5 6 Copyright (C) 1996 Free Software Foundation, Inc. 7 8 Author: Scott Christley <scottc@net-community.com> 9 Ovidiu Predescu <ovidiu@net-community.com> 10 Date: 1996 11 12 This file is part of the GNUstep GUI Library. 13 14 This library is free software; you can redistribute it and/or 15 modify it under the terms of the GNU Lesser General Public 16 License as published by the Free Software Foundation; either 17 version 2 of the License, or (at your option) any later version. 18 19 This library is distributed in the hope that it will be useful, 20 but WITHOUT ANY WARRANTY; without even the implied warranty of 21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22 Lesser General Public License for more details. 23 24 You should have received a copy of the GNU Lesser General Public 25 License along with this library; see the file COPYING.LIB. 26 If not, see <http://www.gnu.org/licenses/> or write to the 27 Free Software Foundation, 51 Franklin Street, Fifth Floor, 28 Boston, MA 02110-1301, USA. 29 */ 30 31 #ifndef _GNUstep_H_NSButton 32 #define _GNUstep_H_NSButton 33 #import <GNUstepBase/GSVersionMacros.h> 34 35 #import <AppKit/NSControl.h> 36 #import <AppKit/NSButtonCell.h> 37 38 @class NSAttributedString; 39 @class NSString; 40 @class NSEvent; 41 42 @interface NSButton : NSControl 43 { 44 // Attributes 45 } 46 47 // 48 // Setting the Button Type 49 // 50 - (void)setButtonType:(NSButtonType)aType; 51 #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) 52 - (void)setHighlightsBy:(NSInteger)aType; 53 - (void)setShowsStateBy:(NSInteger)aType; 54 #endif 55 56 // 57 // Setting the State 58 // 59 - (void)setState:(NSInteger)value; 60 - (NSInteger)state; 61 - (BOOL)allowsMixedState; 62 - (void)setAllowsMixedState: (BOOL)flag; 63 - (void)setNextState; 64 65 // 66 // Setting the Repeat Interval 67 // 68 - (void)getPeriodicDelay:(float *)delay 69 interval:(float *)interval; 70 - (void)setPeriodicDelay:(float)delay 71 interval:(float)interval; 72 73 // 74 // Setting the Titles 75 // 76 - (NSString *)alternateTitle; 77 - (void)setAlternateTitle:(NSString *)aString; 78 - (void)setTitle:(NSString *)aString; 79 - (NSString *)title; 80 #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) 81 - (NSAttributedString *)attributedAlternateTitle; 82 - (NSAttributedString *)attributedTitle; 83 - (void)setAttributedAlternateTitle:(NSAttributedString *)aString; 84 - (void)setAttributedTitle:(NSAttributedString *)aString; 85 - (void)setTitleWithMnemonic:(NSString *)aString; 86 #endif 87 88 // 89 // Setting the Images 90 // 91 - (NSImage *)alternateImage; 92 - (NSImage *)image; 93 - (NSCellImagePosition)imagePosition; 94 - (void)setAlternateImage:(NSImage *)anImage; 95 - (void)setImage:(NSImage *)anImage; 96 - (void)setImagePosition:(NSCellImagePosition)aPosition; 97 98 // 99 // Modifying Graphic Attributes 100 // 101 - (BOOL)isBordered; 102 - (BOOL)isTransparent; 103 - (void)setBordered:(BOOL)flag; 104 - (void)setTransparent:(BOOL)flag; 105 #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) 106 - (NSBezelStyle)bezelStyle; 107 - (void)setBezelStyle:(NSBezelStyle)bezelStyle; 108 - (void)setShowsBorderOnlyWhileMouseInside:(BOOL)show; 109 - (BOOL)showsBorderOnlyWhileMouseInside; 110 #endif 111 112 // 113 // Displaying 114 // 115 - (void)highlight:(BOOL)flag; 116 117 // 118 // Setting the Key Equivalent 119 // 120 - (NSString *)keyEquivalent; 121 - (NSUInteger)keyEquivalentModifierMask; 122 - (void)setKeyEquivalent:(NSString *)aKeyEquivalent; 123 - (void)setKeyEquivalentModifierMask:(NSUInteger)mask; 124 125 // 126 // Handling Events and Action Messages 127 // 128 - (BOOL)performKeyEquivalent:(NSEvent *)anEvent; 129 130 // 131 // Sound 132 // 133 #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) 134 - (void)setSound:(NSSound *)aSound; 135 - (NSSound *)sound; 136 #endif 137 138 @end 139 140 #endif // _GNUstep_H_NSButton 141