Remove duplicate text services files, which fixes a bug with the mac build picking up the wrong source and header files (bug 184935). This fixes bugscape bug 21720.

This commit is contained in:
sfraser%netscape.com 2002-12-12 22:42:53 +00:00
Родитель 01c72c5364
Коммит bc3050dae4
9 изменённых файлов: 0 добавлений и 5637 удалений

Просмотреть файл

@ -1,152 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsISpellChecker_h__
#define nsISpellChecker_h__
#include "nsISupports.h"
#define NS_SPELLCHECKER_CONTRACTID "@mozilla.org/spellchecker;1"
#define NS_ISPELLCHECKER_IID \
{ /* F72A52F1-F83B-11d2-8D54-000064657374 */ \
0xf72a52f1, 0xf83b, 0x11d2, \
{ 0x8d, 0x54, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } }
class nsITextServicesDocument;
class nsString;
class nsStringArray;
/**
* A generic interface for a spelling checker.
*/
class nsISpellChecker : public nsISupports{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISPELLCHECKER_IID)
/**
* Tells the spellchecker what document to check.
* @param aDoc is the document to check.
* @param aFromStartOfDoc If true, start check from beginning of document,
* if false, start check from current cursor position.
*/
NS_IMETHOD SetDocument(nsITextServicesDocument *aDoc, PRBool aFromStartofDoc) = 0;
/**
* Selects (hilites) the next misspelled word in the document.
* @param aWord will contain the misspelled word.
* @param aSuggestions is an array of nsStrings, that represent the
* suggested replacements for the misspelled word.
*/
NS_IMETHOD NextMisspelledWord(nsString *aWord, nsStringArray *aSuggestions) = 0;
/**
* Checks if a word is misspelled. No document is required to use this method.
* @param aWord is the word to check.
* @param aIsMisspelled will be set to true if the word is misspelled.
* @param aSuggestions is an array of nsStrings which represent the
* suggested replacements for the misspelled word. The array will be empty
* if there aren't any suggestions.
*/
NS_IMETHOD CheckWord(const nsString *aWord, PRBool *aIsMisspelled, nsStringArray *aSuggestions) = 0;
/**
* Replaces the old word with the specified new word.
* @param aOldWord is the word to be replaced.
* @param aNewWord is the word that is to replace old word.
* @param aAllOccurrences will replace all occurrences of old
* word, in the document, with new word when it is true. If
* false, it will replace the 1st occurrence only!
*/
NS_IMETHOD Replace(const nsString *aOldWord, const nsString *aNewWord, PRBool aAllOccurrences) = 0;
/**
* Ignores all occurrences of the specified word in the document.
* @param aWord is the word to ignore.
*/
NS_IMETHOD IgnoreAll(const nsString *aWord) = 0;
/**
* Add a word to the user's personal dictionary.
* @param aWord is the word to add.
*/
NS_IMETHOD AddWordToPersonalDictionary(const nsString *aWord) = 0;
/**
* Remove a word from the user's personal dictionary.
* @param aWord is the word to remove.
*/
NS_IMETHOD RemoveWordFromPersonalDictionary(const nsString *aWord) = 0;
/**
* Returns the list of words in the user's personal dictionary.
* @param aWordList is an array of nsStrings that represent the
* list of words in the user's personal dictionary.
*/
NS_IMETHOD GetPersonalDictionary(nsStringArray *aWordList) = 0;
/**
* Returns the list of strings representing the dictionaries
* the spellchecker supports. It was suggested that the strings
* returned be in the RFC 1766 format. This format looks something
* like <ISO 639 language code>-<ISO 3166 country code>.
* For example: en-US
* @param aDictionaryList is an array of nsStrings that represent the
* dictionaries supported by the spellchecker.
*/
NS_IMETHOD GetDictionaryList(nsStringArray *aDictionaryList) = 0;
/**
* Returns a string representing the current dictionary.
* @param aDictionary will contain the name of the dictionary.
* This name is the same string that is in the list returned
* by GetDictionaryList().
*/
NS_IMETHOD GetCurrentDictionary(nsString *aDictionary) = 0;
/**
* Tells the spellchecker to use a specific dictionary.
* @param aDictionary a string that is in the list returned
* by GetDictionaryList().
*/
NS_IMETHOD SetCurrentDictionary(const nsString *aDictionary) = 0;
};
#endif // nsISpellChecker_h__

Просмотреть файл

@ -1,73 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsITextService_h__
#define nsITextService_h__
#include "nsISupports.h"
class nsITextServicesDocument;
/*
TextService interface to outside world
*/
#define NS_ITEXTSERVICE_IID \
{ /* 019718E0-CDB5-11d2-8D3C-000000000000 */ \
0x019718e0, 0xcdb5, 0x11d2, \
{ 0x8d, 0x3c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }
/**
*
*/
class nsITextService : public nsISupports{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITEXTSERVICE_IID)
/**
*
*/
NS_IMETHOD Init(nsITextServicesDocument *aDoc) = 0;
NS_IMETHOD Execute() = 0;
NS_IMETHOD GetMenuString(nsString &aString) = 0;
};
#endif // nsITextService_h__

Просмотреть файл

@ -1,229 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsITextServicesDocument_h__
#define nsITextServicesDocument_h__
#include "nsISupports.h"
class nsIDOMDocument;
class nsIPresShell;
class nsIEditor;
class nsString;
/*
TextServicesDocument interface to outside world
*/
#define NS_ITEXTSERVICESDOCUMENT_IID \
{ /* 019718E1-CDB5-11d2-8D3C-000000000000 */ \
0x019718e1, 0xcdb5, 0x11d2, \
{ 0x8d, 0x3c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }
/**
* The nsITextServicesDocument presents the document in as a
* bunch of flattened text blocks. Each text block can be retrieved
* as an nsString (array of characters).
*/
class nsITextServicesDocument : public nsISupports{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITEXTSERVICESDOCUMENT_IID)
typedef enum { eDSNormal=0, eDSUndlerline } TSDDisplayStyle;
typedef enum { eBlockNotFound=0, // There is no text block (TB) in or before the selection (S).
eBlockOutside, // No TB in S, but found one before/after S.
eBlockInside, // S extends beyond the start and end of TB.
eBlockContains, // TB contains entire S.
eBlockPartial // S begins or ends in TB but extends outside of TB.
} TSDBlockSelectionStatus;
/**
* Initailizes the text services document to use a particular
* DOM document.
* @param aDOMDocument is the document to use. It is AddRef'd
* by this method.
* @param aPresShell is the presentation shell to use when
* setting the selection. It is AddRef'd by this method.
*/
NS_IMETHOD InitWithDocument(nsIDOMDocument *aDOMDocument, nsIPresShell *aPresShell) = 0;
/**
* Initializes the text services document to use a particular
* editor. The text services document will use the DOM document
* and presentation shell used by the editor.
* @param aEditor is the editor to use. The editor is AddRef'd
* by this method.
*/
NS_IMETHOD InitWithEditor(nsIEditor *aEditor) = 0;
/**
* Returns true if the document can be modified with calls
* to DeleteSelection() and InsertText().
* @param aCanEdit is true if the document can be modified,
* false if it can't.
*/
NS_IMETHOD CanEdit(PRBool *aCanEdit) = 0;
/**
* Returns the text in the current text block.
* @param aStr will contain the text.
*/
NS_IMETHOD GetCurrentTextBlock(nsString *aStr) = 0;
/**
* Tells the document to point to the first text block
* in the document. This method does not adjust the current
* cursor position or selection.
*/
NS_IMETHOD FirstBlock() = 0;
/**
* Tells the document to point to the last text block in the
* document. This method does not adjust the current cursor
* position or selection.
*/
NS_IMETHOD LastBlock() = 0;
/**
* Tells the document to point to the first text block that
* contains the current selection or caret.
* @param aSelectionStatus will contain the text block selection status
* @param aSelectionOffset will contain the offset into the
* string returned by GetCurrentTextBlock() where the selection
* begins.
* @param aLength will contain the number of characters that are
* selected in the string.
*/
NS_IMETHOD FirstSelectedBlock(TSDBlockSelectionStatus *aSelectionStatus, PRInt32 *aSelectionOffset, PRInt32 *aSelectionLength) = 0;
/**
* Tells the document to point to the last text block that
* contains the current selection or caret.
* @param aSelectionStatus will contain the text block selection status
* @param aSelectionOffset will contain the offset into the
* string returned by GetCurrentTextBlock() where the selection
* begins.
* @param aLength will contain the number of characters that are
* selected in the string.
*/
NS_IMETHOD LastSelectedBlock(TSDBlockSelectionStatus *aSelectionStatus, PRInt32 *aSelectionOffset, PRInt32 *aSelectionLength) = 0;
/**
* Tells the document to point to the text block before
* the current one. This method will return NS_OK, even
* if there is no previous block. Callers should call IsDone()
* to check if we have gone beyond the first text block in
* the document.
*/
NS_IMETHOD PrevBlock() = 0;
/**
* Tells the document to point to the text block after
* the current one. This method will return NS_OK, even
* if there is no next block. Callers should call IsDone()
* to check if we have gone beyond the last text block
* in the document.
*/
NS_IMETHOD NextBlock() = 0;
/**
* IsDone() will always set aIsDone == PR_FALSE unless
* the document contains no text, PrevBlock() was called
* while the document was already pointing to the first
* text block in the document, or NextBlock() was called
* while the document was already pointing to the last
* text block in the document.
* @param aIsDone will contain the result.
*/
NS_IMETHOD IsDone(PRBool *aIsDone) = 0;
/**
* SetSelection() allows the caller to set the selection
* based on an offset into the string returned by
* GetCurrentTextBlock(). A length of zero places the cursor
* at that offset. A positive non-zero length "n" selects
* n characters in the string.
* @param aOffset offset into string returned by GetCurrentTextBlock().
* @param aLength number characters selected.
*/
NS_IMETHOD SetSelection(PRInt32 aOffset, PRInt32 aLength) = 0;
/**
* Scrolls the document so that the current selection is visible.
*/
NS_IMETHOD ScrollSelectionIntoView() = 0;
/**
* Deletes the text selected by SetSelection(). Calling
* DeleteSelection with nothing selected, or with a collapsed
* selection (cursor) does nothing and returns NS_OK.
*/
NS_IMETHOD DeleteSelection() = 0;
/**
* Inserts the given text at the current cursor position.
* If there is a selection, it will be deleted before the
* text is inserted.
*/
NS_IMETHOD InsertText(const nsString *aText) = 0;
/**
* Sets the display style for the text selected by SetSelection().
* @param aStyle is the style to apply to the selected text.
*/
NS_IMETHOD SetDisplayStyle(TSDDisplayStyle aStyle) = 0;
};
#endif // nsITextServicesDocument_h__

Просмотреть файл

@ -1,244 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#error This file is no longer used.
#include "nsString.h"
#include "nsIEditActionListener.h"
#include "nsTSDNotifier.h"
#include "nsTextServicesDocument.h"
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIEditActionListenerIID, NS_IEDITACTIONLISTENER_IID);
nsTSDNotifier::nsTSDNotifier(nsTextServicesDocument *aDoc) : mDoc(aDoc)
{
}
nsTSDNotifier::~nsTSDNotifier()
{
mDoc = 0;
}
#define DEBUG_TSD_NOTIFIER_REFCNT 1
#ifdef DEBUG_TSD_NOTIFIER_REFCNT
nsrefcnt nsTSDNotifier::AddRef(void)
{
return ++mRefCnt;
}
nsrefcnt nsTSDNotifier::Release(void)
{
NS_PRECONDITION(0 != mRefCnt, "dup release");
if (--mRefCnt == 0) {
NS_DELETEXPCOM(this);
return 0;
}
return mRefCnt;
}
#else
NS_IMPL_ADDREF(nsTSDNotifier)
NS_IMPL_RELEASE(nsTSDNotifier)
#endif
NS_IMETHODIMP
nsTSDNotifier::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
if (nsnull == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(kISupportsIID)) {
*aInstancePtr = (void*)(nsISupports*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(kIEditActionListenerIID)) {
*aInstancePtr = (void*)(nsIEditActionListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
*aInstancePtr = 0;
return NS_NOINTERFACE;
}
NS_IMETHODIMP
nsTSDNotifier::WillInsertNode(nsIDOMNode *aNode,
nsIDOMNode *aParent,
PRInt32 aPosition)
{
return NS_OK;
}
NS_IMETHODIMP
nsTSDNotifier::DidInsertNode(nsIDOMNode *aNode,
nsIDOMNode *aParent,
PRInt32 aPosition,
nsresult aResult)
{
if (NS_FAILED(aResult))
return NS_OK;
if (!mDoc)
return NS_ERROR_FAILURE;
return mDoc->InsertNode(aNode, aParent, aPosition);
}
NS_IMETHODIMP
nsTSDNotifier::WillDeleteNode(nsIDOMNode *aChild)
{
return NS_OK;
}
NS_IMETHODIMP
nsTSDNotifier::DidDeleteNode(nsIDOMNode *aChild, nsresult aResult)
{
if (NS_FAILED(aResult))
return NS_OK;
if (!mDoc)
return NS_ERROR_FAILURE;
return mDoc->DeleteNode(aChild);
}
NS_IMETHODIMP
nsTSDNotifier::WillSplitNode(nsIDOMNode *aExistingRightNode,
PRInt32 aOffset)
{
return NS_OK;
}
NS_IMETHODIMP
nsTSDNotifier::DidSplitNode(nsIDOMNode *aExistingRightNode,
PRInt32 aOffset,
nsIDOMNode *aNewLeftNode,
nsresult aResult)
{
if (NS_FAILED(aResult))
return NS_OK;
if (!mDoc)
return NS_ERROR_FAILURE;
return mDoc->SplitNode(aExistingRightNode, aOffset, aNewLeftNode);
}
NS_IMETHODIMP
nsTSDNotifier::WillJoinNodes(nsIDOMNode *aLeftNode,
nsIDOMNode *aRightNode,
nsIDOMNode *aParent)
{
return NS_OK;
}
NS_IMETHODIMP
nsTSDNotifier::DidJoinNodes(nsIDOMNode *aLeftNode,
nsIDOMNode *aRightNode,
nsIDOMNode *aParent,
nsresult aResult)
{
if (NS_FAILED(aResult))
return NS_OK;
if (!mDoc)
return NS_ERROR_FAILURE;
return mDoc->JoinNodes(aLeftNode, aRightNode, aParent);
}
// -------------------------------
// stubs for unused listen methods
// -------------------------------
NS_IMETHODIMP
nsTSDNotifier::WillCreateNode(const nsAString& aTag, nsIDOMNode *aParent, PRInt32 aPosition)
{
return NS_OK;
}
NS_IMETHODIMP
nsTSDNotifier::DidCreateNode(const nsAString& aTag, nsIDOMNode *aNode, nsIDOMNode *aParent, PRInt32 aPosition, nsresult aResult)
{
return NS_OK;
}
NS_IMETHODIMP
nsTSDNotifier::WillInsertText(nsIDOMCharacterData *aTextNode, PRInt32 aOffset, const nsAString &aString)
{
return NS_OK;
}
NS_IMETHODIMP
nsTSDNotifier::DidInsertText(nsIDOMCharacterData *aTextNode, PRInt32 aOffset, const nsAString &aString, nsresult aResult)
{
return NS_OK;
}
NS_IMETHODIMP
nsTSDNotifier::WillDeleteText(nsIDOMCharacterData *aTextNode, PRInt32 aOffset, PRInt32 aLength)
{
return NS_OK;
}
NS_IMETHODIMP
nsTSDNotifier::DidDeleteText(nsIDOMCharacterData *aTextNode, PRInt32 aOffset, PRInt32 aLength, nsresult aResult)
{
return NS_OK;
}
NS_IMETHODIMP
nsTSDNotifier::WillDeleteSelection(nsISelection *aSelection)
{
return NS_OK;
}
NS_IMETHODIMP
nsTSDNotifier::DidDeleteSelection(nsISelection *aSelection)
{
return NS_OK;
}

Просмотреть файл

@ -1,103 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsTSDNotifier_h__
#define nsTSDNotifier_h__
#include "nsCOMPtr.h"
#include "nsIEditActionListener.h"
class nsTextServicesDocument;
class nsTSDNotifier : public nsIEditActionListener
{
private:
nsTextServicesDocument *mDoc;
public:
/** The default constructor.
*/
nsTSDNotifier(nsTextServicesDocument *aDoc);
/** The default destructor.
*/
virtual ~nsTSDNotifier();
/* Macro for AddRef(), Release(), and QueryInterface() */
NS_DECL_ISUPPORTS
/* nsIEditActionListener method implementations. */
NS_IMETHOD WillInsertNode(nsIDOMNode *aNode,
nsIDOMNode *aParent,
PRInt32 aPosition);
NS_IMETHOD DidInsertNode(nsIDOMNode *aNode,
nsIDOMNode *aParent,
PRInt32 aPosition,
nsresult aResult);
NS_IMETHOD WillDeleteNode(nsIDOMNode *aChild);
NS_IMETHOD DidDeleteNode(nsIDOMNode *aChild, nsresult aResult);
NS_IMETHOD WillSplitNode(nsIDOMNode * aExistingRightNode,
PRInt32 aOffset);
NS_IMETHOD DidSplitNode(nsIDOMNode *aExistingRightNode,
PRInt32 aOffset,
nsIDOMNode *aNewLeftNode,
nsresult aResult);
NS_IMETHOD WillJoinNodes(nsIDOMNode *aLeftNode,
nsIDOMNode *aRightNode,
nsIDOMNode *aParent);
NS_IMETHOD DidJoinNodes(nsIDOMNode *aLeftNode,
nsIDOMNode *aRightNode,
nsIDOMNode *aParent,
nsresult aResult);
// these listen methods are unused:
NS_IMETHOD WillCreateNode(const nsAString& aTag, nsIDOMNode *aParent, PRInt32 aPosition);
NS_IMETHOD DidCreateNode(const nsAString& aTag, nsIDOMNode *aNode, nsIDOMNode *aParent, PRInt32 aPosition, nsresult aResult);
NS_IMETHOD WillInsertText(nsIDOMCharacterData *aTextNode, PRInt32 aOffset, const nsAString &aString);
NS_IMETHOD DidInsertText(nsIDOMCharacterData *aTextNode, PRInt32 aOffset, const nsAString &aString, nsresult aResult);
NS_IMETHOD WillDeleteText(nsIDOMCharacterData *aTextNode, PRInt32 aOffset, PRInt32 aLength);
NS_IMETHOD DidDeleteText(nsIDOMCharacterData *aTextNode, PRInt32 aOffset, PRInt32 aLength, nsresult aResult);
NS_IMETHOD WillDeleteSelection(nsISelection *aSelection);
NS_IMETHOD DidDeleteSelection(nsISelection *aSelection);
};
#endif // nsTSDNotifier_h__

Просмотреть файл

@ -1,52 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsTextServicesCID_h__
#define nsTextServicesCID_h__
#define NS_TEXTSERVICESDOCUMENTINTERNAL_CID \
{ /* 019718E2-CDB5-11d2-8D3C-000000000000 */ \
0x019718e2, 0xcdb5, 0x11d2, \
{ 0x8d, 0x3c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }
#define NS_TEXTSERVICESDOCUMENT_CID \
{ /* 019718E3-CDB5-11d2-8D3C-000000000000 */ \
0x019718e3, 0xcdb5, 0x11d2, \
{ 0x8d, 0x3c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }
#endif /* nsTextServicesCID_h__ */

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,205 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsTextServicesDocument_h__
#define nsTextServicesDocument_h__
#include "nsCOMPtr.h"
#include "nsIPresShell.h"
#include "nsIDOMDocument.h"
#include "nsIDOMRange.h"
#include "nsIContent.h"
#include "nsIContentIterator.h"
#include "nsIEditor.h"
#include "nsIEditActionListener.h"
#include "nsITextServicesDocument.h"
#include "nsVoidArray.h"
#include "nsTSDNotifier.h"
#include "nsISelectionController.h"
/** implementation of a text services object.
*
*/
class nsTextServicesDocument : public nsITextServicesDocument
{
private:
static nsIAtom *sAAtom;
static nsIAtom *sAddressAtom;
static nsIAtom *sBigAtom;
static nsIAtom *sBlinkAtom;
static nsIAtom *sBAtom;
static nsIAtom *sCiteAtom;
static nsIAtom *sCodeAtom;
static nsIAtom *sDfnAtom;
static nsIAtom *sEmAtom;
static nsIAtom *sFontAtom;
static nsIAtom *sIAtom;
static nsIAtom *sKbdAtom;
static nsIAtom *sKeygenAtom;
static nsIAtom *sNobrAtom;
static nsIAtom *sSAtom;
static nsIAtom *sSampAtom;
static nsIAtom *sSmallAtom;
static nsIAtom *sSpacerAtom;
static nsIAtom *sSpanAtom;
static nsIAtom *sStrikeAtom;
static nsIAtom *sStrongAtom;
static nsIAtom *sSubAtom;
static nsIAtom *sSupAtom;
static nsIAtom *sTtAtom;
static nsIAtom *sUAtom;
static nsIAtom *sVarAtom;
static nsIAtom *sWbrAtom;
static PRInt32 sInstanceCount;
typedef enum { eIsDone=0, // No iterator (I), or itertor doesn't point to anything valid.
eValid, // I points to first text node (TN) in current block (CB).
ePrev, // No TN in CB, I points to first TN in prev block.
eNext // No TN in CB, I points to first TN in next block.
} TSDIteratorStatus;
nsCOMPtr<nsIDOMDocument> mDOMDocument;
nsCOMPtr<nsISelectionController>mSelCon;
nsCOMPtr<nsIEditor> mEditor;
nsCOMPtr<nsIContentIterator> mIterator;
TSDIteratorStatus mIteratorStatus;
nsCOMPtr<nsIContent> mPrevTextBlock;
nsCOMPtr<nsIContent> mNextTextBlock;
nsCOMPtr<nsIEditActionListener> mNotifier;
nsVoidArray mOffsetTable;
PRInt32 mSelStartIndex;
PRInt32 mSelStartOffset;
PRInt32 mSelEndIndex;
PRInt32 mSelEndOffset;
public:
/** The default constructor.
*/
nsTextServicesDocument();
/** The default destructor.
*/
virtual ~nsTextServicesDocument();
/* Macro for AddRef(), Release(), and QueryInterface() */
NS_DECL_ISUPPORTS
/* nsITextServicesDocument method implementations. */
NS_IMETHOD InitWithDocument(nsIDOMDocument *aDOMDocument, nsIPresShell *aPresShell);
NS_IMETHOD InitWithEditor(nsIEditor *aEditor);
NS_IMETHOD CanEdit(PRBool *aCanEdit);
NS_IMETHOD GetCurrentTextBlock(nsString *aStr);
NS_IMETHOD FirstBlock();
NS_IMETHOD LastBlock();
NS_IMETHOD FirstSelectedBlock(TSDBlockSelectionStatus *aSelStatus, PRInt32 *aSelOffset, PRInt32 *aSelLength);
NS_IMETHOD LastSelectedBlock(TSDBlockSelectionStatus *aSelStatus, PRInt32 *aSelOffset, PRInt32 *aSelLength);
NS_IMETHOD PrevBlock();
NS_IMETHOD NextBlock();
NS_IMETHOD IsDone(PRBool *aIsDone);
NS_IMETHOD SetSelection(PRInt32 aOffset, PRInt32 aLength);
NS_IMETHOD ScrollSelectionIntoView();
NS_IMETHOD DeleteSelection();
NS_IMETHOD InsertText(const nsString *aText);
NS_IMETHOD SetDisplayStyle(TSDDisplayStyle aStyle);
/* nsIEditActionListener method implementations. */
nsresult InsertNode(nsIDOMNode * aNode,
nsIDOMNode * aParent,
PRInt32 aPosition);
nsresult DeleteNode(nsIDOMNode * aChild);
nsresult SplitNode(nsIDOMNode * aExistingRightNode,
PRInt32 aOffset,
nsIDOMNode * aNewLeftNode);
nsresult JoinNodes(nsIDOMNode *aLeftNode,
nsIDOMNode *aRightNode,
nsIDOMNode *aParent);
private:
/* nsTextServicesDocument private methods. */
nsresult CreateContentIterator(nsIDOMRange *aRange, nsIContentIterator **aIterator);
nsresult GetDocumentContentRootNode(nsIDOMNode **aNode);
nsresult CreateDocumentContentRange(nsIDOMRange **aRange);
nsresult CreateDocumentContentRootToNodeOffsetRange(nsIDOMNode *aParent, PRInt32 aOffset, PRBool aToStart, nsIDOMRange **aRange);
nsresult CreateDocumentContentIterator(nsIContentIterator **aIterator);
nsresult AdjustContentIterator();
nsresult FirstTextNodeInCurrentBlock(nsIContentIterator *aIterator);
nsresult FirstTextNodeInPrevBlock(nsIContentIterator *aIterator);
nsresult FirstTextNodeInNextBlock(nsIContentIterator *aIterator);
nsresult GetFirstTextNodeInPrevBlock(nsIContent **aContent);
nsresult GetFirstTextNodeInNextBlock(nsIContent **aContent);
PRBool IsBlockNode(nsIContent *aContent);
PRBool IsTextNode(nsIContent *aContent);
PRBool IsTextNode(nsIDOMNode *aNode);
PRBool HasSameBlockNodeParent(nsIContent *aContent1, nsIContent *aContent2);
nsresult SetSelectionInternal(PRInt32 aOffset, PRInt32 aLength, PRBool aDoUpdate);
nsresult GetSelection(TSDBlockSelectionStatus *aSelStatus, PRInt32 *aSelOffset, PRInt32 *aSelLength);
nsresult GetCollapsedSelection(TSDBlockSelectionStatus *aSelStatus, PRInt32 *aSelOffset, PRInt32 *aSelLength);
nsresult GetUncollapsedSelection(TSDBlockSelectionStatus *aSelStatus, PRInt32 *aSelOffset, PRInt32 *aSelLength);
PRBool SelectionIsCollapsed();
PRBool SelectionIsValid();
nsresult ComparePoints(nsIDOMNode *aParent1, PRInt32 aOffset1, nsIDOMNode *aParent2, PRInt32 aOffset2, PRInt32 *aResult);
nsresult GetRangeEndPoints(nsIDOMRange *aRange, nsIDOMNode **aParent1, PRInt32 *aOffset1, nsIDOMNode **aParent2, PRInt32 *aOffset2);
nsresult CreateRange(nsIDOMNode *aStartParent, PRInt32 aStartOffset, nsIDOMNode *aEndParent, PRInt32 aEndOffset, nsIDOMRange **aRange);
nsresult RemoveInvalidOffsetEntries();
nsresult CreateOffsetTable(nsString *aStr=0);
nsresult ClearOffsetTable();
nsresult SplitOffsetEntry(PRInt32 aTableIndex, PRInt32 aOffsetIntoEntry);
nsresult NodeHasOffsetEntry(nsIDOMNode *aNode, PRBool *aHasEntry, PRInt32 *aEntryIndex);
/* DEBUG */
void PrintOffsetTable();
void PrintContentNode(nsIContent *aContent);
};
#endif // nsTextServicesDocument_h__

Просмотреть файл

@ -1,66 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#error This file is no longer used.
#include "nsIGenericFactory.h"
#include "nsTextServicesDocument.h"
#include "nsTextServicesCID.h"
////////////////////////////////////////////////////////////////////////
// Define the contructor function for the objects
//
// NOTE: This creates an instance of objects by using the default constructor
//
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTextServicesDocument)
////////////////////////////////////////////////////////////////////////
// Define a table of CIDs implemented by this module along with other
// information like the function to create an instance, contractid, and
// class name.
//
static const nsModuleComponentInfo components[] = {
{ NULL, NS_TEXTSERVICESDOCUMENT_CID, "@mozilla.org/textservices/textservicesdocument;1", nsTextServicesDocumentConstructor },
};
////////////////////////////////////////////////////////////////////////
// Implement the NSGetModule() exported function for your module
// and the entire implementation of the module object.
//
NS_IMPL_NSGETMODULE(nsTextServicesModule, components)