mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 11:00:48 +00:00
Header reorganization - Please refer to ChangeLog
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17408 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8512c509e1
commit
b18f1c4ac4
280 changed files with 25303 additions and 257 deletions
195
Headers/AppKit/NSFontManager.h
Normal file
195
Headers/AppKit/NSFontManager.h
Normal file
|
@ -0,0 +1,195 @@
|
|||
/*
|
||||
NSFontManager.h
|
||||
|
||||
Manages system and user fonts
|
||||
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
|
||||
Author: Scott Christley <scottc@net-community.com>
|
||||
Date: 1996
|
||||
Modified: Fred Kiefer <FredKiefer@gmx.de>
|
||||
Date: January 2000
|
||||
Almost complete rewrite.
|
||||
|
||||
This file is part of the GNUstep GUI Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, write to the Free Software Foundation,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _GNUstep_H_NSFontManager
|
||||
#define _GNUstep_H_NSFontManager
|
||||
|
||||
#include <Foundation/NSObject.h>
|
||||
|
||||
@class NSString;
|
||||
@class NSArray;
|
||||
|
||||
@class NSFont;
|
||||
@class NSMenu;
|
||||
@class NSFontPanel;
|
||||
|
||||
typedef unsigned int NSFontTraitMask;
|
||||
|
||||
enum {
|
||||
NSItalicFontMask = 1,
|
||||
NSUnitalicFontMask = 0, //1024,
|
||||
NSBoldFontMask = 2,
|
||||
NSUnboldFontMask = 0, //2048,
|
||||
NSNarrowFontMask = 4,
|
||||
NSExpandedFontMask = 8,
|
||||
NSCondensedFontMask = 16,
|
||||
NSSmallCapsFontMask = 32,
|
||||
NSPosterFontMask = 64,
|
||||
NSCompressedFontMask = 128,
|
||||
NSNonStandardCharacterSetFontMask = 256,
|
||||
NSFixedPitchFontMask = 512
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
NSNoFontChangeAction,
|
||||
NSViaPanelFontAction,
|
||||
NSAddTraitFontAction,
|
||||
NSRemoveTraitFontAction,
|
||||
NSSizeUpFontAction,
|
||||
NSSizeDownFontAction,
|
||||
NSHeavierFontAction,
|
||||
NSLighterFontAction,
|
||||
} NSFontTag;
|
||||
|
||||
@interface NSFontManager : NSObject
|
||||
{
|
||||
// Attributes
|
||||
id _delegate;
|
||||
SEL _action;
|
||||
NSFont *_selectedFont;
|
||||
BOOL _multiple;
|
||||
NSMenu *_fontMenu;
|
||||
NSFontTag _storedTag;
|
||||
NSFontTraitMask _trait;
|
||||
id _fontEnumerator;
|
||||
}
|
||||
|
||||
//
|
||||
// Managing the FontManager
|
||||
//
|
||||
+ (void) setFontManagerFactory: (Class)class;
|
||||
+ (void) setFontPanelFactory: (Class)class;
|
||||
+ (NSFontManager *)sharedFontManager;
|
||||
|
||||
//
|
||||
// information on available fonts
|
||||
//
|
||||
- (NSArray *)availableFonts;
|
||||
- (NSArray *)availableFontFamilies;
|
||||
- (NSArray *)availableFontNamesWithTraits:(NSFontTraitMask)fontTraitMask;
|
||||
- (NSArray *)availableMembersOfFontFamily:(NSString *)family;
|
||||
- (NSString *) localizedNameForFamily:(NSString *)family face:(NSString *)face;
|
||||
|
||||
//
|
||||
// Selecting fonts
|
||||
//
|
||||
- (void)setSelectedFont:(NSFont *)fontObject
|
||||
isMultiple:(BOOL)flag;
|
||||
- (NSFont *)selectedFont;
|
||||
- (BOOL)isMultiple;
|
||||
- (BOOL)sendAction;
|
||||
|
||||
//
|
||||
// Action methods
|
||||
//
|
||||
- (void)addFontTrait:(id)sender;
|
||||
- (void)removeFontTrait:(id)sender;
|
||||
- (void)modifyFont:(id)sender;
|
||||
- (void)modifyFontViaPanel:(id)sender;
|
||||
|
||||
//
|
||||
//Automatic font conversion
|
||||
//
|
||||
- (NSFont *)convertFont:(NSFont *)fontObject;
|
||||
|
||||
//
|
||||
// Converting Fonts
|
||||
//
|
||||
- (NSFont *)convertFont:(NSFont *)fontObject
|
||||
toFamily:(NSString *)family;
|
||||
- (NSFont *)convertFont:(NSFont *)fontObject
|
||||
toFace:(NSString *)typeface;
|
||||
- (NSFont *)convertFont:(NSFont *)fontObject
|
||||
toHaveTrait:(NSFontTraitMask)trait;
|
||||
- (NSFont *)convertFont:(NSFont *)fontObject
|
||||
toNotHaveTrait:(NSFontTraitMask)trait;
|
||||
- (NSFont *)convertFont:(NSFont *)fontObject
|
||||
toSize:(float)size;
|
||||
- (NSFont *)convertWeight:(BOOL)upFlag
|
||||
ofFont:(NSFont *)fontObject;
|
||||
|
||||
//
|
||||
// Getting a font
|
||||
//
|
||||
- (NSFont *)fontWithFamily:(NSString *)family
|
||||
traits:(NSFontTraitMask)traits
|
||||
weight:(int)weight
|
||||
size:(float)size;
|
||||
//
|
||||
// Examining a font
|
||||
//
|
||||
- (NSFontTraitMask)traitsOfFont:(NSFont *)aFont;
|
||||
- (int)weightOfFont:(NSFont *)fontObject;
|
||||
- (BOOL)fontNamed:(NSString *)typeface
|
||||
hasTraits:(NSFontTraitMask)fontTraitMask;
|
||||
|
||||
//
|
||||
// Enabling
|
||||
//
|
||||
- (BOOL)isEnabled;
|
||||
- (void)setEnabled:(BOOL)flag;
|
||||
|
||||
//
|
||||
// Font menu
|
||||
//
|
||||
- (NSMenu *)fontMenu:(BOOL)create;
|
||||
- (void)setFontMenu:(NSMenu *)newMenu;
|
||||
|
||||
//
|
||||
// Font panel
|
||||
//
|
||||
- (NSFontPanel *)fontPanel:(BOOL)create;
|
||||
- (void)orderFrontFontPanel:(id)sender;
|
||||
|
||||
//
|
||||
// Assigning a Delegate
|
||||
//
|
||||
- (id)delegate;
|
||||
- (void)setDelegate:(id)anObject;
|
||||
|
||||
//
|
||||
// Action Methods
|
||||
//
|
||||
- (SEL)action;
|
||||
- (void)setAction:(SEL)aSelector;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (NSFontManagerDelegate)
|
||||
//
|
||||
// Methods Implemented by the Delegate
|
||||
//
|
||||
- (BOOL)fontManager:(id)sender willIncludeFont:(NSString *)fontName;
|
||||
@end
|
||||
|
||||
#endif // _GNUstep_H_NSFontManager
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue