Public Member Functions

<XAP_CocoaPlugin_Document> Protocol Reference

Plug-in API for manipulating documents which are on-screen. More...

#import <xap_CocoaPlugin.h>

Inheritance diagram for <XAP_CocoaPlugin_Document>:
AP_CocoaPlugin_Document

List of all members.

Public Member Functions

(BOOL) - documentStillExists
 It is quite possible for document windows to be closed by the user.
(NSString *) - title
(NSString *) - selectWord
 Selects and returns the current word, if any.
(NSString *) - selectedText
 Returns the current selection, if any.
(void) - insertText:
 Insert a text string into the document.
(NSString *) - documentMailMergeSource
(void) - setDocumentMailMergeSource:
(void) - insertDocumentMailMergeField:
(NSArray *) - documentMailMergeFields
(void) - setDocumentMailMergeFields:
(void) - unsetDocumentMailMergeFields
(void) - setDocumentMailMergeValues:

Detailed Description

Plug-in API for manipulating documents which are on-screen.

The current document, if any, or a list of available documents can be obtained via XAP_CocoaPlugin's currentDocument and documents methods.

Please bear in mind that documents can be closed, so if you keep these references to documents lying around for future use then you should check that the documents they refer to still exist using the documentStillExists method.

This is really a reference to a document window, and not to the specific document itself.


Member Function Documentation

- (NSArray *) documentMailMergeFields  

Reimplemented in AP_CocoaPlugin_Document.

- (NSString *) documentMailMergeSource  

Reimplemented in AP_CocoaPlugin_Document.

- (BOOL) documentStillExists  

It is quite possible for document windows to be closed by the user.

If you retain document references then it's a good idea to check that the document window still exists.

Returns:
Returns YES if the document window still exists; otherwise NO.

Reimplemented in AP_CocoaPlugin_Document.

- (void) insertDocumentMailMergeField: (NSString *)  field_name  

Reimplemented in AP_CocoaPlugin_Document.

- (void) insertText: (NSString *)  text  

Insert a text string into the document.

Parameters:
text The string to insert.

Reimplemented in AP_CocoaPlugin_Document.

- (NSString *) selectedText  

Returns the current selection, if any.

Returns:
The currently selected text, or nil if none is selected.

Reimplemented in AP_CocoaPlugin_Document.

- (NSString *) selectWord  

Selects and returns the current word, if any.

Returns:
The current word, or nil if none could be selected.

Reimplemented in AP_CocoaPlugin_Document.

- (void) setDocumentMailMergeFields: (NSArray *)  field_array  

Reimplemented in AP_CocoaPlugin_Document.

- (void) setDocumentMailMergeSource: (NSString *)  path  

Reimplemented in AP_CocoaPlugin_Document.

- (void) setDocumentMailMergeValues: (NSDictionary *)  value_dictionary  

Reimplemented in AP_CocoaPlugin_Document.

- (NSString *) title  
Returns:
The title of the document, or, if the window no longer exists, the string "(This document no longer exists!)".

Reimplemented in AP_CocoaPlugin_Document.

- (void) unsetDocumentMailMergeFields  

Reimplemented in AP_CocoaPlugin_Document.


The documentation for this protocol was generated from the following file: