Mac Developer Library

Developer

AppKit Framework Reference NSFontPanelValidation Protocol Reference

Options
Deployment Target:

On This Page
Language:

NSFontPanelValidation

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.3 and later.

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

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

    Declaration

    Swift

    func validModesForFontPanel(_ fontPanel: NSFontPanel) -> Int

    Objective-C

    - (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:.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.3 and later.

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

    Declaration

    Swift

    var NSFontPanelFaceModeMask: UInt32 { get } var NSFontPanelSizeModeMask: UInt32 { get } var NSFontPanelCollectionModeMask: UInt32 { get } var NSFontPanelUnderlineEffectModeMask: UInt32 { get } var NSFontPanelStrikethroughEffectModeMask: UInt32 { get } var NSFontPanelTextColorEffectModeMask: UInt32 { get } var NSFontPanelDocumentColorEffectModeMask: UInt32 { get } var NSFontPanelShadowEffectModeMask: UInt32 { get } var NSFontPanelAllEffectsModeMask: UInt32 { get } var NSFontPanelStandardModesMask: UInt32 { get } var NSFontPanelAllModesMask: UInt32 { get }

    Objective-C

    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

      NSFontPanelFaceModeMask

      Display the typeface column.

      Available in OS X v10.3 and later.

    • NSFontPanelSizeModeMask

      NSFontPanelSizeModeMask

      Display the font size column.

      Available in OS X v10.3 and later.

    • NSFontPanelCollectionModeMask

      NSFontPanelCollectionModeMask

      Display the font collections column.

      Available in OS X v10.3 and later.

    • NSFontPanelUnderlineEffectModeMask

      NSFontPanelUnderlineEffectModeMask

      Display the underline popup menu.

      Available in OS X v10.4 and later.

    • NSFontPanelStrikethroughEffectModeMask

      NSFontPanelStrikethroughEffectModeMask

      Display the strike-through popup menu.

      Available in OS X v10.4 and later.

    • NSFontPanelTextColorEffectModeMask

      NSFontPanelTextColorEffectModeMask

      Display the text color button.

      Available in OS X v10.4 and later.

    • NSFontPanelDocumentColorEffectModeMask

      NSFontPanelDocumentColorEffectModeMask

      Display the document color button.

      Available in OS X v10.4 and later.

    • NSFontPanelShadowEffectModeMask

      NSFontPanelShadowEffectModeMask

      Display the shadow effects button.

      Available in OS X v10.4 and later.

    • NSFontPanelAllEffectsModeMask

      NSFontPanelAllEffectsModeMask

      Display all the effects user interface items.

      Available in OS X v10.4 and later.

    • NSFontPanelStandardModesMask

      NSFontPanelStandardModesMask

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

      Available in OS X v10.3 and later.

    • NSFontPanelAllModesMask

      NSFontPanelAllModesMask

      Display all the available adornments.

      Available in OS X v10.3 and later.