NSFontPanelValidation Protocol Reference

(informal protocol)

Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in OS X v10.3 and later.
Companion guide
Declared in
NSFontPanel.h

Overview

Informal protocol. The Font Panel can be explicitly ordered to display some or all of its elements by responding to the validModesForFontPanel: instance method.

Tasks

Validating Modes for a Font Panel

Instance Methods

validModesForFontPanel:

Returns the mode mask corresponding to the expected font panel mode.

- (NSUInteger)validModesForFontPanel:(NSFontPanel *)fontPanel
Discussion

The mode masks are defined in Mode Masks.

The Font Panel has the ability to hide elements that are not applicable for a given context by having the target respond to validModesForFontPanel:. If the target desires a font panel mode other than the standard mode mask, it must respond to this method.

This message is sent up the responder chain to the first responder implementing the method. Ideally that object should be the first responder found that also implements changeFont:.

Availability
  • Available in OS X v10.3 and later.
Declared In
NSFontPanel.h

Constants

Mode Masks

The following constants correspond to the available font panel mode masks returned by validModesForFontPanel:.

enum {
   NSFontPanelFaceModeMask = 1 << 0,
   NSFontPanelSizeModeMask = 1 << 1,
   NSFontPanelCollectionModeMask = 1 << 2,
   NSFontPanelUnderlineEffectModeMask = 1<<8,
   NSFontPanelStrikethroughEffectModeMask = 1<<9,
   NSFontPanelTextColorEffectModeMask = 1<< 10,
   NSFontPanelDocumentColorEffectModeMask = 1<<11,
   NSFontPanelShadowEffectModeMask = 1<<12,
   NSFontPanelAllEffectsModeMask = 0XFFF00,
   NSFontPanelStandardModesMask = 0xFFFF,
   NSFontPanelAllModesMask = 0xFFFFFFFF
};
Constants
NSFontPanelFaceModeMask

Display the typeface column.

Available in OS X v10.3 and later.

Declared in NSFontPanel.h.

NSFontPanelSizeModeMask

Display the font size column.

Available in OS X v10.3 and later.

Declared in NSFontPanel.h.

NSFontPanelCollectionModeMask

Display the font collections column.

Available in OS X v10.3 and later.

Declared in NSFontPanel.h.

NSFontPanelUnderlineEffectModeMask

Display the underline popup menu.

Available in OS X v10.4 and later.

Declared in NSFontPanel.h.

NSFontPanelStrikethroughEffectModeMask

Display the strike-through popup menu.

Available in OS X v10.4 and later.

Declared in NSFontPanel.h.

NSFontPanelTextColorEffectModeMask

Display the text color button.

Available in OS X v10.4 and later.

Declared in NSFontPanel.h.

NSFontPanelDocumentColorEffectModeMask

Display the document color button.

Available in OS X v10.4 and later.

Declared in NSFontPanel.h.

NSFontPanelShadowEffectModeMask

Display the shadow effects button.

Available in OS X v10.4 and later.

Declared in NSFontPanel.h.

NSFontPanelAllEffectsModeMask

Display all the effects user interface items.

Available in OS X v10.4 and later.

Declared in NSFontPanel.h.

NSFontPanelStandardModesMask

Display the standard default font panel—that is, including the collections, typeface, and size columns.

Available in OS X v10.3 and later.

Declared in NSFontPanel.h.

NSFontPanelAllModesMask

Display all the available adornments.

Available in OS X v10.3 and later.

Declared in NSFontPanel.h.