---
title: NSTextAttachmentCellProtocol
framework: appkit
role: symbol
role_heading: Protocol
path: appkit/nstextattachmentcellprotocol
---

# NSTextAttachmentCellProtocol

A set of methods that declares the interface for objects that draw text attachment icons and handle mouse events on their icons.

## Declaration

```swift
protocol NSTextAttachmentCellProtocol : NSObjectProtocol
```

## Overview

Overview With the exceptions of cellBaselineOffset(), attachment, and attachment, all of these methods are implemented by the NSCell class.For general information on text attachments, see NSAttributedString and NSTextView.

## Topics

### Setting the attachment

- [attachment](appkit/nstextattachmentcellprotocol/attachment.md)
- [attachment](appkit/nstextattachmentcellprotocol/attachment.md)

### Drawing the cell contents

- [draw(withFrame:in:)](appkit/nstextattachmentcellprotocol/draw(withframe:in:).md)
- [draw(withFrame:in:characterIndex:)](appkit/nstextattachmentcellprotocol/draw(withframe:in:characterindex:).md)
- [draw(withFrame:in:characterIndex:layoutManager:)](appkit/nstextattachmentcellprotocol/draw(withframe:in:characterindex:layoutmanager:).md)
- [highlight(_:withFrame:in:)](appkit/nstextattachmentcellprotocol/highlight(_:withframe:in:).md)

### Providing the cell metrics

- [cellSize()](appkit/nstextattachmentcellprotocol/cellsize().md)
- [cellBaselineOffset()](appkit/nstextattachmentcellprotocol/cellbaselineoffset().md)
- [cellFrame(for:proposedLineFragment:glyphPosition:characterIndex:)](appkit/nstextattachmentcellprotocol/cellframe(for:proposedlinefragment:glyphposition:characterindex:).md)

### Responding to mouse events

- [wantsToTrackMouse()](appkit/nstextattachmentcellprotocol/wantstotrackmouse().md)
- [wantsToTrackMouse(for:in:of:atCharacterIndex:)](appkit/nstextattachmentcellprotocol/wantstotrackmouse(for:in:of:atcharacterindex:).md)
- [trackMouse(with:in:of:untilMouseUp:)](appkit/nstextattachmentcellprotocol/trackmouse(with:in:of:untilmouseup:).md)
- [trackMouse(with:in:of:atCharacterIndex:untilMouseUp:)](appkit/nstextattachmentcellprotocol/trackmouse(with:in:of:atcharacterindex:untilmouseup:).md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

### Conforming Types

- [NSTextAttachmentCell](appkit/nstextattachmentcell-swift.class.md)

## See Also

### Attachments

- [NSTextAttachment](appkit/nstextattachment.md)
- [NSTextAttachmentViewProvider](appkit/nstextattachmentviewprovider.md)
- [NSAdaptiveImageGlyph](appkit/nsadaptiveimageglyph.md)
- [NSTextAttachmentContainer](appkit/nstextattachmentcontainer.md)
- [NSTextAttachmentLayout](appkit/nstextattachmentlayout.md)
- [NSTextAttachmentCell](appkit/nstextattachmentcell-swift.class.md)
