Source: api-agent-chat.js

define(["js/api-impl/api-agent-chat-impl"], function(impl) {

  var exports = impl.namespace("NM.api.chat.agent");

  exports.chat = {

    info : {
  
      /** This function switches the chat info view to the
       *  tab with the specified name.
       *
       *  @param tabname {string} name of the tab
       *  @function switchTab
       */
      switchTab : function(tabname) {
        return impl.chat.info.switchTab(tabname);
      }
  
    },

    editor : {

      /** This function inserts plain text at the current cursor position
       *  into the chat agent editor content area.
       *  Please note that insert operations of huge text content may cause
       *  browser freeze or crash depending on the client environment and
       *  browser type.
       *  If the select parameter is true, the inserted text will be selected
       *  automatically after the insert operation.
       * @param text {string} Text to insert into the html
       * @param select {boolean} if true, the inserted text will be selected automatically after the insert operation
       * @function insertText
       */
      insertText : function(text, select) {
        return impl.chat.editor.insertText(text, select);
      },

      /** This function inserts html text at the current cursor position
       *  into the chat agent editor content area.
       *  The html code can contain the following tags and attributes:
       *  br, p, strong, b, u, i, em, span[id|style|class],
       *  a[title|href|target|class], img[src|alt|style]
       *  Please note that insert operations of huge html content may cause
       *  browser freeze or crash depending on the client environment and
       *  browser type.
       *  If the select parameter is true, the inserted text will be selected
       *  automatically after the insert operation.
       * @param text {string} Text to insert into the html
       * @param select {boolean} if true, the inserted text will be selected automatically after the insert operation
       * @function insertHtml
       */
      insertHtml : function(html, select) {
        return impl.chat.editor.insertHtml(html, select);
      }
    }
  };

  return exports;

});