Up

# NSTextAttachment

### Authors

Fred Kiefer (`FredKiefer@gmx.de`)

> Classes to represent text attachments.

Copyright: (C) 2000 Free Software Foundation, Inc.

### Contents -

1. Software documentation for the NSTextAttachment class
2. Software documentation for the NSTextAttachmentCell class
3. Software documentation for the NSAttributedString(NSTextAttachment) category
4. Software documentation for the NSMutableAttributedString(NSTextAttachment) category
5. Software documentation for the NSTextAttachmentCell protocol

# Software documentation for the NSTextAttachment class

## NSTextAttachment : NSObject

> Declared in:
>   AppKit/NSTextAttachment.h

> Conforms to:
>   NSCoding

Availability: MacOS-X 10.0.0
Description forthcoming.

Instance Variables
Method summary

- -attachmentCell
- -fileWrapper
- -initWithFileWrapper:
- -setAttachmentCell:
- -setFileWrapper:

### attachmentCell

- (id<NSTextAttachmentCell>) attachmentCell;
Availability: MacOS-X 10.0.0
Description forthcoming.

### fileWrapper

- (NSFileWrapper*) fileWrapper;
Availability: MacOS-X 10.0.0
Description forthcoming.

### initWithFileWrapper:

- (id) initWithFileWrapper: (NSFileWrapper*)fileWrapper;
Availability: MacOS-X 10.0.0
Description forthcoming.

### setAttachmentCell:

- (void) setAttachmentCell: (id<NSTextAttachmentCell>)cell;
Availability: MacOS-X 10.0.0
Description forthcoming.

### setFileWrapper:

- (void) setFileWrapper: (NSFileWrapper*)fileWrapper;
Availability: MacOS-X 10.0.0
Description forthcoming.

## Instance Variables for NSTextAttachment Class

### _cell

@protected id<NSTextAttachmentCell> _cell;
Availability: MacOS-X 10.0.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _fileWrapper

@protected NSFileWrapper* _fileWrapper;
Availability: MacOS-X 10.0.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

# Software documentation for the NSTextAttachmentCell class

## NSTextAttachmentCell : NSCell

> Declared in:
>   AppKit/NSTextAttachment.h

> Conforms to:
>   NSTextAttachmentCell

Availability: MacOS-X 10.0.0
Description forthcoming.

Instance Variables

## Instance Variables for NSTextAttachmentCell Class

### _attachment

@protected NSTextAttachment* _attachment;
Availability: MacOS-X 10.0.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

# Software documentation for the NSAttributedString(NSTextAttachment) category

## NSAttributedString(NSTextAttachment)

> Declared in:
>   AppKit/NSTextAttachment.h

Availability: MacOS-X 10.0.0
Description forthcoming.
Method summary

- +attributedStringWithAttachment:
- -containsAttachments

### attributedStringWithAttachment:

+ (NSAttributedString*) attributedStringWithAttachment: (NSTextAttachment*)attachment;
Availability: MacOS-X 10.0.0
Description forthcoming.

### containsAttachments

- (BOOL) containsAttachments;
Availability: MacOS-X 10.0.0
Description forthcoming.

# Software documentation for the NSMutableAttributedString(NSTextAttachment) category

## NSMutableAttributedString(NSTextAttachment)

> Declared in:
>   AppKit/NSTextAttachment.h

Availability: MacOS-X 10.0.0
Description forthcoming.
Method summary

- -updateAttachmentsFromPath:

### updateAttachmentsFromPath:

- (void) updateAttachmentsFromPath: (NSString*)path;
Availability: MacOS-X 10.0.0
Description forthcoming.

# Software documentation for the NSTextAttachmentCell protocol

## NSTextAttachmentCell

> Declared in:
>   AppKit/NSTextAttachment.h

> Conforms to:
>   NSObject

Availability: MacOS-X 10.0.0
Description forthcoming.
Method summary

- -attachment
- -cellBaselineOffset
- -cellFrameForTextContainer:proposedLineFragment:glyphPosition:characterIndex:
- -cellSize
- -drawWithFrame:inView:
- -drawWithFrame:inView:characterIndex:
- -drawWithFrame:inView:characterIndex:layoutManager:
- -highlight:withFrame:inView:
- -setAttachment:
- -trackMouse:inRect:ofView:atCharacterIndex:untilMouseUp:
- -trackMouse:inRect:ofView:untilMouseUp:
- -wantsToTrackMouse
- -wantsToTrackMouseForEvent:inRect:ofView:atCharacterIndex:

### attachment

- (NSTextAttachment*) attachment;
Availability: MacOS-X 10.0.0
Description forthcoming.

### cellBaselineOffset

- (NSPoint) cellBaselineOffset;
Availability: MacOS-X 10.0.0
Description forthcoming.

### cellFrameForTextContainer: proposedLineFragment: glyphPosition: characterIndex:

- (NSRect) cellFrameForTextContainer: (NSTextContainer*)textContainer proposedLineFragment: (NSRect)lineFrag glyphPosition: (NSPoint)position characterIndex: (unsigned int)charIndex;
Availability: MacOS-X 10.0.0
The new way of placing the cell.

### cellSize

- (NSSize) cellSize;
Availability: MacOS-X 10.0.0
The old way of placing the cell. The text system will never call these directly (TODO: make sure it doesn't), but other things might. The class implements the new method by calling these, so subclasses can easily change behavior by overriding these.

### drawWithFrame: inView:

- (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView;
Availability: MacOS-X 10.0.0
Description forthcoming.

### drawWithFrame: inView: characterIndex:

- (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView characterIndex: (unsigned)charIndex;
Availability: MacOS-X 10.0.0
Description forthcoming.

### drawWithFrame: inView: characterIndex: layoutManager:

- (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView characterIndex: (unsigned)charIndex layoutManager: (NSLayoutManager*)layoutManager;
Availability: MacOS-X 10.0.0
Description forthcoming.

### highlight: withFrame: inView:

- (void) highlight: (BOOL)flag withFrame: (NSRect)cellFrame inView: (NSView*)controlView;
Availability: MacOS-X 10.0.0
Description forthcoming.

### setAttachment:

- (void) setAttachment: (NSTextAttachment*)anObject;
Availability: MacOS-X 10.0.0
Description forthcoming.

### trackMouse: inRect: ofView: atCharacterIndex: untilMouseUp:

- (BOOL) trackMouse: (NSEvent*)theEvent inRect: (NSRect)cellFrame ofView: (NSView*)controlView atCharacterIndex: (unsigned)charIndex untilMouseUp: (BOOL)flag;
Availability: MacOS-X 10.0.0
Description forthcoming.

### trackMouse: inRect: ofView: untilMouseUp:

- (BOOL) trackMouse: (NSEvent*)theEvent inRect: (NSRect)cellFrame ofView: (NSView*)controlView untilMouseUp: (BOOL)flag;
Availability: MacOS-X 10.0.0
Description forthcoming.

### wantsToTrackMouse

- (BOOL) wantsToTrackMouse;
Availability: MacOS-X 10.0.0
Description forthcoming.

### wantsToTrackMouseForEvent: inRect: ofView: atCharacterIndex:

- (BOOL) wantsToTrackMouseForEvent: (NSEvent*)theEvent inRect: (NSRect)cellFrame ofView: (NSView*)controlView atCharacterIndex: (unsigned)charIndex;
Availability: MacOS-X 10.0.0
Description forthcoming.

Up