1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
/*
* PQFontSampleView.h - Font Manager
*
* A font sampling view.
*
* Copyright 2007 Isaiah Beerbower.
*
* Author: Isaiah Beerbower
* Created: 05/28/07
* License: Modified BSD license (see file COPYING)
*/
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
@interface PQFontSampleView : NSView
{
id dataSource;
NSString *sampleText;
int fontSize;
NSColor *foregroundColor;
NSColor *backgroundColor;
/* Text system components */
NSTextStorage *textStorage;
NSLayoutManager *layoutManager;
NSTextContainer *textContainer;
BOOL fontAttributesNeedUpdate;
BOOL autoSize;
}
- (void) setDataSource: (id)anObject;
- (id) dataSource;
- (void) setSampleText: (NSString *)someText;
- (NSString *) sampleText;
- (void) setFontSize: (int)aSize;
- (int) fontSize;
- (void) setAutoSize: (BOOL)flag;
- (BOOL) autoSize;
- (void) setConstrainedFrameSize: (NSSize)aSize;
- (void) setForegroundColor: (NSColor *)aColor;
- (NSColor *) foregroundColor;
- (void) setBackgroundColor: (NSColor *)aColor;
- (NSColor *) backgroundColor;
@end
@interface NSObject (PQFontSampleDataSource)
- (int) numberOfFontsInFontSampleView: (PQFontSampleView *)aFontSampleView;
- (NSString *) fontSampleView: (PQFontSampleView *)aFontSampleView
fontAtIndex: (int)rowIndex;
- (BOOL) fontsShouldChangeInFontSampleView: (PQFontSampleView *)aFontSampleView;
@end
|