pjs/extensions/xmlterm/base/mozIXMLTerminal.h

133 строки
4.1 KiB
C
Исходник Обычный вид История

/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "MPL"); you may not use this file
* except in compliance with the MPL. You may obtain a copy of
* the MPL at http://www.mozilla.org/MPL/
*
* Software distributed under the MPL is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the MPL for the specific language governing
* rights and limitations under the MPL.
*
* The Original Code is XMLterm.
*
* The Initial Developer of the Original Code is Ramalingam Saravanan.
* Portions created by Ramalingam Saravanan <svn@xmlterm.org> are
* Copyright (C) 1999 Ramalingam Saravanan. All Rights Reserved.
*
* Contributor(s):
*/
// mozIXMLTerminal.h: primary interface for XMLterm operations
// (unregistered)
#ifndef mozIXMLTerminal_h___
#define mozIXMLTerminal_h___
#include "nscore.h"
#include "nsISupports.h"
#include "nsIDOMDocument.h"
#include "nsIWebShell.h"
#include "nsIPresShell.h"
#include "nsIScriptContext.h"
#include "mozIXMLTermShell.h"
/* {0eb82b20-43a2-11d3-8e76-006008948af5} */
#define MOZIXMLTERMINAL_IID_STR "0eb82b20-43a2-11d3-8e76-006008948af5"
#define MOZIXMLTERMINAL_IID \
{0x0eb82b20, 0x43a2, 0x11d3, \
{ 0x8e, 0x76, 0x00, 0x60, 0x08, 0x94, 0x8a, 0xf5 }}
class mozIXMLTerminal : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(MOZIXMLTERMINAL_IID)
/** Initializes XMLterm in specified web shell
* @param aWebShell web shell in which to embed XMLterm
* @param aXMLTermShell scriptable wrapper shell for XMLterm
* @param URL URL of document to be loaded in the window
* (set to null string if document is already loaded in window)
* @param args argument string to be passed to XMLterm
* (at the moment this just contains any initial input data)
*/
NS_IMETHOD Init(nsIWebShell* aWebShell,
mozIXMLTermShell* aXMLTermShell,
const PRUnichar* aURL,
const PRUnichar* args) = 0;
/** Finalizes (closes) XMLterm
*/
NS_IMETHOD Finalize(void) = 0;
/** Polls for readable data from XMLterm
*/
NS_IMETHOD Poll(void) = 0;
/** Gets current entry (command) number
* @param aNumber (output) current entry number
*/
NS_IMETHOD GetCurrentEntryNumber(PRInt32 *aNumber) = 0;
/** Gets command history buffer count
* @param aHistory (output) history buffer count
*/
NS_IMETHOD GetHistory(PRInt32 *aHistory) = 0;
/** Sets command history buffer count
* @param aHistory history buffer count
*/
NS_IMETHOD SetHistory(PRInt32 aHistory) = 0;
/** Gets prompt string
* @param aPrompt (output) prompt string
*/
NS_IMETHOD GetPrompt(PRUnichar **aPrompt) = 0;
/** Sets prompt string
* @param aPrompt prompt string
*/
NS_IMETHOD SetPrompt(const PRUnichar* aPrompt) = 0;
/** Writes string to terminal as if the user had typed it (without authenitcation)
* @param aString string to be transmitted to terminal
*/
NS_IMETHOD SendTextAux(const nsString& aString) = 0;
/** Writes string to terminal as if the user had typed it (command input)
* @param aString string to be transmitted to terminal
* @param aCookie document.cookie string for authentication
*/
NS_IMETHOD SendText(const nsString& aString, const PRUnichar* aCookie) = 0;
/** Paste data from clipboard into XMLterm at current input line cursor location
*/
NS_IMETHOD Paste() = 0;
/** Gets document associated with XMLterm
* @param aDoc (output) DOM document
*/
NS_IMETHOD GetDocument(nsIDOMDocument** aDoc) = 0;
/** Gets web shell associated with XMLterm
* @param aWebShell (output) web shell
*/
NS_IMETHOD GetWebShell(nsIWebShell** aWebShell) = 0;
/** Gets presentation shell associated with XMLterm
* @param aPresShell (output) presentation shell
*/
NS_IMETHOD GetPresShell(nsIPresShell** aPresShell) = 0;
};
#define MOZXMLTERMINAL_CID \
{ /* 0eb82b21-43a2-11d3-8e76-006008948af5 */ \
0x0eb82b21, 0x43a2, 0x11d3, \
{0x8e, 0x76, 0x00, 0x60, 0x08, 0x94, 0x8a, 0xf5} }
extern nsresult
NS_NewXMLTerminal(mozIXMLTerminal** aXMLTerminal);
#endif /* mozIXMLTerminal_h___ */