## Class TinyMCE_Control

    Object
       |
       +--TinyMCE_Control

class TinyMCE_Control

Defined in TinyMCE_Control.class.js

Field Summary
`Object` | `cleanup`
`Object` | `hasMouseMoved`
`Object` | `isTinyMCE_Control`
`Object` | `plugins`
`Object` | `selection`
`Object` | `settings`
`Object` | `shortcuts`
`Object` | `undoRedo`
`Object` | `undoRedoLevel`

Constructor Summary
`TinyMCE_Control (<Array> settings)` This is the TinyMCE editor control instance class.

Method Summary
`void` | `addPlugin(<string> n, p)` Adds a plugin to the editor instance.
`boolean` | `addShortcut(<string> m, <Object> k, <string> d, <string> cmd, <boolean> ui, <Object> va)` Adds a keyboard shortcut to a specific command.
`void` | `autoResetDesignMode()` Auto resets the design mode of the document if it gets lost.
`Object` | `execCommand(<string> command, <boolean> user_interface, <mixed> value)` Executes a command on the current instance.
`HTMLElement` | `getBody()` Returns the body element of a editor instance.
`DOMDocument` | `getDoc()` Returns the DOM document of a editor instance.
`HTMLElement` | `getFocusElement()` Returns the currently selected element.
`DOMRange` | `getRng()` Returns the browsers selections first range instance.
`DOMSelection` | `getSel()` Returns the browsers selection instance.
`Window` | `getWin()` Returns the window of a editor instance.
`boolean` | `handleShortcut(<DOMEvent> e)` Executes shortcuts based on the event information.
`boolean` | `hasPlugin(<string> n)` Returns true/false if the instance has the current plugin available.
`boolean` | `isDirty()` Returns true/false if the editor instance is dirty or not.
`boolean` | `isHidden()` Returns if the instance is hidden or not.
`boolean` | `queryCommandState(<string> c)` Returns a command specific state, for example if bold is enabled or not.
`mixed` | `queryCommandValue(<string> c)` Returns a command specific value, for example the current font size.
`void` | `repaint()` Repaints the editarea in Gecko browsers.
`void` | `setBaseHREF(<string> u)` Sets the base href url of the current document instance.
`void` | `switchSettings()` Switches the global TinyMCE settings to the current instance settings.
`void` | `triggerSave(<boolean> skip_cleanup, <boolean> skip_callback)` Moves the contents from the TinyMCE editor control instance to the hidden textarea that got replaced with TinyMCE.

Field Detail

### cleanup

    Object cleanup

### hasMouseMoved

    Object hasMouseMoved

### isTinyMCE_Control

    Object isTinyMCE_Control

### plugins

    Object plugins

### selection

    Object selection

### settings

    Object settings

### shortcuts

    Object shortcuts

### undoRedo

    Object undoRedo

### undoRedoLevel

    Object undoRedoLevel

Constructor Detail

### TinyMCE_Control

    TinyMCE_Control(<Array> settings)

This is the TinyMCE editor control instance class. A instance of this class will is made for each converted text area.

Parameters:

`settings` - Name/Value array of instance specific configuration settings.

Method Detail

### addPlugin

    void addPlugin(<string> n, p)

Adds a plugin to the editor instance. This will also add it globaly.

Parameters:

`n` - Plugin name to check for.

`n` - TinyMCE plugin instance.

### addShortcut

    boolean addShortcut(<string> m, <Object> k, <string> d, <string> cmd, <boolean> ui, <Object> va)

Adds a keyboard shortcut to a specific command. These shortcuts can for example be added at the initInstance callback of a plugin. The shortcut description can be a language variable name or a string describing the function. If you don't specify a command, the shortcut will simply be a blocker shortcut. This enables you to remove built in shortcuts or remove theme specific shortcuts from a plugin.
Example shortcut inst.addShortcut('ctrl,alt', 'k', 'mceSomeCommand', false, 'somevalue'); Example blocker inst.addShortcut('ctrl,alt', 'k');

Parameters:

`m` - List of shortcut modifiers keys, for example "ctrl,alt".

`k` - Shortcut key char for example "s" or a keycode value "13".

`d` - Optional Shortcut description, this will be presented in the about dialog.

`cmd` - Optional Command name to execute, for example mceLink or Bold.

`ui` - Optional True/false state if a UI (dialog) should be presented or not.

`va` - Optional command value, this can be anything.

Returns:

true/false if the shortcut was added or not

### autoResetDesignMode

    void autoResetDesignMode()

Auto resets the design mode of the document if it gets lost. This is a Gecko specific function since it's a workaround for a bug where Gecko browsers loose the designMode state if the editor is hidden and shown in a tab or div.

### execCommand

    Object execCommand(<string> command, <boolean> user_interface, <mixed> value)

Executes a command on the current instance. These commands can be TinyMCE internal commands prefixed with "mce" or they can be build in browser commands such as "Bold". A compleate list of browser commands is available on MSDN or Mozilla.org. This function will dispatch the execCommand function on each plugin, theme or the execcommand_callback option if none of these return true it will handle the command as a internal browser command.

Parameters:

`command` - Command name to execute, for example mceLink or Bold.

`user_interface` - True/false state if a UI (dialog) should be presented or not.

`value` - Optional command value, this can be anything.

### getBody

    HTMLElement getBody()

Returns the body element of a editor instance.

Returns:

Body element of a editor instance.

### getDoc

    DOMDocument getDoc()

Returns the DOM document of a editor instance.

Returns:

DOM document of a editor instance.

### getFocusElement

    HTMLElement getFocusElement()

Returns the currently selected element. This is was added for compatiblity and is deprecated. Please use inst.selection.getFocusElement instead.

Returns:

Currently selected element.

Deprecated

### getRng

    DOMRange getRng()

Returns the browsers selections first range instance. This is was added for compatiblity and is deprecated. Please use inst.selection.getRng instead.

Returns:

Browsers selections first range instance.

Deprecated

### getSel

    DOMSelection getSel()

Returns the browsers selection instance. This is was added for compatiblity and is deprecated. Please use inst.selection.getSel instead.

Returns:

Browser selection instance.

Deprecated

### getWin

    Window getWin()

Returns the window of a editor instance.

Returns:

Window of a editor instance.

### handleShortcut

    boolean handleShortcut(<DOMEvent> e)

Executes shortcuts based on the event information.

Parameters:

`e` - Keyboard event to handle.

Returns:

true/false if the shortcut was found and executed or not.

### hasPlugin

    boolean hasPlugin(<string> n)

Returns true/false if the instance has the current plugin available.

Parameters:

`n` - Plugin name to check for.

Returns:

true/false if the instance has the current plugin available.

### isDirty

    boolean isDirty()

Returns true/false if the editor instance is dirty or not. In other words if it has been modified or not.

Returns:

Editor instance dirty state.

### isHidden

    boolean isHidden()

Returns if the instance is hidden or not. This is a Gecko specific function other browsers will always return false. This function is used to workaround the lost designMode bug in Gecko browsers.

Returns:

Returns if the instance is hidden or not.

### queryCommandState

    boolean queryCommandState(<string> c)

Returns a command specific state, for example if bold is enabled or not.

Parameters:

`c` - Command to query state from.

Returns:

Command specific state, for example if bold is enabled or not.

### queryCommandValue

    mixed queryCommandValue(<string> c)

Returns a command specific value, for example the current font size.

Parameters:

`c` - Command to query value from.

Returns:

Command specific value, for example the current font size.

### repaint

    void repaint()

Repaints the editarea in Gecko browsers. This method removes ghost resize handlers and other trailing graphics.

### setBaseHREF

    void setBaseHREF(<string> u)

Sets the base href url of the current document instance. This method is used to temporarly remove the base url during copy/paste and drag/drop operations of relative links from external sites into TinyMCE. MSIE has a bug and converts relative links from external sites to absolute links incorrectly.

Parameters:

`u` - URL to set as base URL or null to remove it.

### switchSettings

    void switchSettings()

Switches the global TinyMCE settings to the current instance settings. This method is used to handle multiple configurations.

### triggerSave

    void triggerSave(<boolean> skip_cleanup, <boolean> skip_callback)

Moves the contents from the TinyMCE editor control instance to the hidden textarea that got replaced with TinyMCE. This is executed automaticly on for example form submit unless you configure otherwice.

Parameters:

`skip_cleanup` - Optional Skip cleanup, simply move the contents as fast as possible.

`skip_callback` - Optional Skip callback, don't call the save_callback function.

Documentation generated by JSDoc on Fri Apr 14 21:59:23 2006