<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dictionary SYSTEM "file:///System/Library/DTDs/sdef.dtd">
<dictionary title="Mailplane Terminology">
    <!-- Standard Suite
         In Mac OS X 10.4 it was common practice to include the complete definition for the Standard Suite in an application's .sdef file.
         In Mac OS X 10.5 a new mechanism is in place that allows you to include the Standard Suite in your .sdef using a mechanism similar
         to the #include preprocessor directive in C: namely, XInclude.  For backwards compatibility with Mac OS X 10.4, you may continue to include
         the complete definitions for the Standard Suite in your .sdef file, but for Mac OS X 10.5 the XInclude technique described below is recommended.
    -->
    <xi:include href="file:///System/Library/ScriptingDefinitions/CocoaStandard.sdef" xpointer="xpointer(/dictionary/suite)" xmlns:xi="http://www.w3.org/2001/XInclude"/>

    <!-- The Standard Text Suite
         Applications using the Standard Text Suite will have to copy the definition for the Standard Text Suite into their .sdef file.
         At the time of this writing, this definition is not available on the system in a file that you can reference using an XInclude.
         Most applications will not need to use the Standard Text Suite unless they support scriptable rich text content and they are
         using Cocoa's model for rich text handling.
    -->
	<suite name="Text Suite" code="TEXT" description="Common text classes for all applications.">
		<cocoa name="NSTextSuite"/>

        <!-- https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/sdef.5.html -->
        <access-group identifier="com.mailplaneapp.compose" access="rw"/>

		<value-type name="RGB color" code="cRGB">
			<cocoa class="NSColor"/>
		</value-type>
		<class name="rich text" code="ctxt" description="Rich (styled) text." plural="rich text">
			<cocoa class="NSTextStorage"/>
			<element type="character"/>
			<element type="paragraph"/>
			<element type="word"/>
			<element type="attribute run"/>
			<element type="attachment"/>
			<property name="color" code="colr" description="The color of the text&apos;s first character." type="RGB color">
				<cocoa key="foregroundColor"/>
			</property>
			<property name="font" code="font" description="The name of the font of the text&apos;s first character." type="text">
				<cocoa key="fontName"/>
			</property>
			<property name="size" code="ptsz" description="The size in points of the text&apos;s first character." type="integer">
				<cocoa key="fontSize"/>
			</property>
			<type type="text"/>
		</class>
		<class name="character" code="cha " description="One of some text&apos;s characters.">
			<cocoa class="NSTextStorage"/>
			<element type="character"/>
			<element type="paragraph"/>
			<element type="word"/>
			<element type="attribute run"/>
			<element type="attachment"/>
			<property name="color" code="colr" description="Its color." type="RGB color">
				<cocoa key="foregroundColor"/>
			</property>
			<property name="font" code="font" description="The name of its font." type="text">
				<cocoa key="fontName"/>
			</property>
			<property name="size" code="ptsz" description="Its size, in points." type="integer">
				<cocoa key="fontSize"/>
			</property>
			<type type="text"/>
		</class>
		<class name="paragraph" code="cpar" description="One of some text&apos;s paragraphs.">
			<cocoa class="NSTextStorage"/>
			<element type="character"/>
			<element type="paragraph"/>
			<element type="word"/>
			<element type="attribute run"/>
			<element type="attachment"/>
			<property name="color" code="colr" description="The color of the paragraph&apos;s first character." type="RGB color">
				<cocoa key="foregroundColor"/>
			</property>
			<property name="font" code="font" description="The name of the font of the paragraph&apos;s first character." type="text">
				<cocoa key="fontName"/>
			</property>
			<property name="size" code="ptsz" description="The size in points of the paragraph&apos;s first character." type="integer">
				<cocoa key="fontSize"/>
			</property>
			<type type="text"/>
		</class>
		<class name="word" code="cwor" description="One of some text&apos;s words.">
			<cocoa class="NSTextStorage"/>
			<element type="character"/>
			<element type="paragraph"/>
			<element type="word"/>
			<element type="attribute run"/>
			<element type="attachment"/>
			<property name="color" code="colr" description="The color of the word&apos;s first character." type="RGB color">
				<cocoa key="foregroundColor"/>
			</property>
			<property name="font" code="font" description="The name of the font of the word&apos;s first character." type="text">
				<cocoa key="fontName"/>
			</property>
			<property name="size" code="ptsz" description="The size in points of the word&apos;s first character." type="integer">
				<cocoa key="fontSize"/>
			</property>
			<type type="text"/>
		</class>
		<class name="attribute run" code="catr" description="A chunk of text that all has the same attributes.">
			<cocoa class="NSTextStorage"/>
			<element type="character"/>
			<element type="paragraph"/>
			<element type="word"/>
			<element type="attribute run"/>
			<element type="attachment"/>
			<property name="color" code="colr" description="Its color." type="RGB color">
				<cocoa key="foregroundColor"/>
			</property>
			<property name="font" code="font" description="The name of its font." type="text">
				<cocoa key="fontName"/>
			</property>
			<property name="size" code="ptsz" description="Its size, in points." type="integer">
				<cocoa key="fontSize"/>
			</property>
			<type type="text"/>
		</class>
		<class name="attachment" code="atts" description="A file embedded in text. This is just for use when embedding a file using the make command." inherits="rich text">
			<cocoa class="NSAttachmentTextStorage"/>
			<property name="file name" code="atfn" description="The path to the embedded file." type="text">
				<cocoa key="filename"/>
			</property>
		</class>
	</suite>

    <!-- Mailplane Suite
    -->
	<suite name="Mailplane Suite" code="MaPl">
        <!-- https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/sdef.5.html -->
        <access-group identifier="com.mailplaneapp.compose" access="rw"/>

        <class name="application" code="capp" inherits="application"
               description="Top-level scripting object.">
            <cocoa class="UxApplication"/>
            <element type="outgoing message"/>
            <property name="currentURL" code="pURL" type="text" access="r"
                      description="Mailplane URL of the active document."/>
            <property name="currentTitle" code="pTit" type="text" access="r"
                      description="Title of the active document"/>
            <property name="currentMessageText" code="pMTX" type="text" access="r"
                      description="Returns the last message text in a conversation. Only available in conversation view."/>
            <property name="doNotDisturb" code="pDND" type="boolean"
                      description="Start or stop Mailplane from sending notifications."/>
        </class>
        <class name="item" code="cobj" plural="items"
               description="Abstract object provides a base class for scripting classes.">
            <cocoa class="Dummy"/> <!-- We need to set a dummy class here. -->
            <property name="class" code="pcls" type="type" access="r"
                      description="The class of the object."/>
            <property name="properties" code="pALL" type="record"
                      description="Properties of this object."/>
        </class>
        <class name="outgoing message" code="bcke" plural="outgoing messages" inherits="item"
               description="A new email message.">
            <cocoa class="UxASOutgoingMessage"/>
            <property name="id" code="ID  " type="integer" access="r"/>
            <property name="sender" code="sndr" type="text"
                      description="The sender of the message"/>
            <property name="subject" code="subj" type="text"/>
            <property name="content" code="ctnt" type="text"/>
            <element type="to recipient"/>
            <element type="cc recipient"/>
            <element type="bcc recipient"/>
            <element type="mail attachment"/>
            <property name="visible" code="pvis" type="boolean"
                      description="Composes the message. This is an alternative to compose command for compatibility reasons with Mail.app."/>
            <property name="directlySend" code="mpse" type="boolean"
                      description="Does automatically send the message."/>
            <property name="message signature" code="tnrg" type="signature"
                      description="This property is just for compatibility reasons with Mail.app. It does nothing."/>
            <property name="optimizeAttachments" code="opAT" type="boolean"
                      description="Optimize attachments (make them smaller)"/>
            <responds-to command="compose">
                <cocoa method="handleComposeScriptCommand:"/>
            </responds-to>
        </class>
        <class name="recipient" code="rcpt" plural="recipients" inherits="item">
            <cocoa class="UxASOutgoingMessageRecipient"/>
            <property name="address" code="radd" type="text"
                      description="Email address."/>
            <property name="name" code="pnam" type="text"
                      description="Name of the recipient."/>
        </class>
        <class name="to recipient" code="trcp" plural="to recipients" inherits="recipient">
            <cocoa class="UxASOutgoingMessageRecipient"/>
        </class>
        <class name="cc recipient" code="crcp" plural="cc recipients" inherits="recipient">
            <cocoa class="UxASOutgoingMessageRecipient"/>
        </class>
        <class name="bcc recipient" code="brcp" plural="bcc recipients" inherits="recipient">
            <cocoa class="UxASOutgoingMessageRecipient"/>
        </class>
        <class name="mail attachment" code="attm" plural="mail attachments" inherits="item">
            <cocoa class="UxASOutgoingMessageAttachment"/>
            <property name="path" code="path" type="text"/>
        </class>
        <class name="signature" code="situ" plural="signatures" inherits="item">
            <cocoa class="UxASOutgoingMessageSignature"/>
            <property name="name" code="pnam" type="text"/>
            <property name="content" code="ctnt" type="text"/>
        </class>
        <command name="compose" code="maplcomp"
                 description="Composes the message and sends it if directlySend was set to true.">
            <direct-parameter description="outgoing message" type="outgoing message"/>
            <!-- TODO: returns nil at the moment -->
            <result type="document"/>
        </command>
        <!-- TODO: Not supported yet.
        <class name="document" code="docu" plural="documents" inherits="item">
			<cocoa class=""/>
			<property name="URL" code="pURL" description="The current URL of the document." type="text">
				<cocoa key="URLString"/>
			</property>
			<responds-to command="close">
				<cocoa method="handleCloseScriptCommand:"/>
			</responds-to>
			<responds-to command="print">
				<cocoa method="handlePrintScriptCommand:"/>
			</responds-to>
		</class>
		-->
	</suite>

</dictionary>