Remove nsIIndpendentSelection, moving its one method onto nsISelectionPrivate. Bug 192827. r/sr=kin.

git-svn-id: svn://10.0.0.236/trunk@140665 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sfraser%netscape.com
2003-04-04 01:45:06 +00:00
parent 5b5202acf4
commit 3bb2704dcc
10 changed files with 15 additions and 182 deletions

View File

@@ -43,6 +43,7 @@
interface nsIDOMRange;
interface nsISelectionListener;
[ptr] native nsIPresShell(nsIPresShell);
[scriptable, uuid(2d5535e2-1dd2-11b2-8e38-d53ec833adf6)]
interface nsISelectionPrivate : nsISupports
@@ -84,5 +85,8 @@ interface nsISelectionPrivate : nsISupports
* a table element isn't selected.
*/
long getTableSelectionType(in nsIDOMRange range);
/* Internal utility method to set the pres shell on a newly created selection */
[noscript] void setPresShell(in nsIPresShell aPresShell);
};

View File

@@ -69,7 +69,6 @@
#include "nsISelectionListener.h"
#include "nsIContentIterator.h"
#include "nsIDocumentEncoder.h"
#include "nsIIndependentSelection.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
@@ -173,8 +172,7 @@ static void printRange(nsIDOMRange *aDomRange);
class nsTypedSelection : public nsISelection,
public nsISelectionPrivate,
public nsSupportsWeakReference,
public nsIIndependentSelection
public nsSupportsWeakReference
{
public:
nsTypedSelection();
@@ -182,44 +180,8 @@ public:
virtual ~nsTypedSelection();
NS_DECL_ISUPPORTS
/*BEGIN nsIIndependentSelection interface implementations */
NS_IMETHOD SetPresShell(nsIPresShell *aPresShell);
/*BEGIN nsISelection,Private interface implementations*/
NS_IMETHOD GetAnchorNode(nsIDOMNode** aAnchorNode);
NS_IMETHOD GetAnchorOffset(PRInt32* aAnchorOffset);
NS_IMETHOD GetFocusNode(nsIDOMNode** aFocusNode);
NS_IMETHOD GetFocusOffset(PRInt32* aFocusOffset);
NS_IMETHOD GetIsCollapsed(PRBool* aIsCollapsed);
NS_IMETHOD GetRangeCount(PRInt32* aRangeCount);
NS_IMETHOD GetRangeAt(PRInt32 aIndex, nsIDOMRange** aReturn);
NS_IMETHOD RemoveAllRanges();
NS_IMETHOD GetTableSelectionType(nsIDOMRange* aRange, PRInt32* aTableSelectionType);
NS_IMETHOD Collapse(nsIDOMNode* aParentNode, PRInt32 aOffset);
NS_IMETHOD CollapseToStart();
NS_IMETHOD CollapseToEnd();
NS_IMETHOD SelectAllChildren(nsIDOMNode* parentNode);
NS_IMETHOD Extend(nsIDOMNode* aParentNode, PRInt32 aOffset);
NS_IMETHOD ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aAYes);
NS_IMETHOD DeleteFromDocument();
NS_IMETHOD AddRange(nsIDOMRange* aRange);
NS_IMETHOD RemoveRange(nsIDOMRange* aRange);
NS_IMETHOD StartBatchChanges();
NS_IMETHOD EndBatchChanges();
NS_IMETHOD AddSelectionListener(nsISelectionListener* aNewListener);
NS_IMETHOD RemoveSelectionListener(nsISelectionListener* aListenerToRemove);
NS_IMETHOD GetEnumerator(nsIEnumerator **aIterator);
NS_IMETHOD ToString(PRUnichar **_retval);
NS_IMETHOD ToStringWithFormat(const char *aFormatType, PRUint32 aFlags, PRInt32 aWrapCount, PRUnichar ** aReturn);
NS_IMETHOD GetInterlinePosition(PRBool *aInterlinePosition);
NS_IMETHOD SetInterlinePosition(PRBool aInterlinePosition);
NS_IMETHOD SelectionLanguageChange(PRBool aLangRTL);
/*END nsISelection interface implementations*/
NS_DECL_NSISELECTION
NS_DECL_NSISELECTIONPRIVATE
// utility methods for scrolling the selection into view
nsresult GetPresContext(nsIPresContext **aPresContext);
@@ -4630,15 +4592,10 @@ nsSelection::GetMouseDoubleDown(PRBool *aDoubleDown)
//END nsISelection interface implementations
#ifdef XP_MAC
#if 0
#pragma mark -
#endif
// nsTypedSelection implementation
// note: this can return a nil anchor node
@@ -4685,7 +4642,6 @@ NS_INTERFACE_MAP_BEGIN(nsTypedSelection)
NS_INTERFACE_MAP_ENTRY(nsISelection)
NS_INTERFACE_MAP_ENTRY(nsISelectionPrivate)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_ENTRY(nsIIndependentSelection)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISelection)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(Selection)
NS_INTERFACE_MAP_END

View File

@@ -64,8 +64,6 @@
#include "nsISelectionController.h"
#include "nsIFileChannel.h"
#include "nsIFrameSelection.h" // For TABLESELECTION_ defines
#include "nsIIndependentSelection.h" //domselections answer to frameselection
#include "nsICSSLoader.h"
#include "nsICSSStyleSheet.h"

View File

@@ -78,8 +78,6 @@
#include "TransactionFactory.h"
#include "nsIIndependentSelection.h" //domselections answer to frameselection
#include "nsICSSLoader.h"
#include "nsICSSStyleSheet.h"
#include "nsIHTMLContentContainer.h"

View File

@@ -59,7 +59,6 @@
#include "nsISelectionController.h"
#include "nsIFrameSelection.h" // For TABLESELECTION_ defines
#include "nsIIndependentSelection.h" //domselections answer to frameselection
#include "nsICSSLoader.h"
#include "nsICSSStyleSheet.h"

View File

@@ -64,8 +64,6 @@
#include "nsIDOMEventGroup.h"
#include "nsCRT.h"
#include "nsIIndependentSelection.h" //domselections answer to frameselection
#include "nsIDocumentObserver.h"
#include "nsIDocumentStateListener.h"
@@ -1484,9 +1482,9 @@ nsPlaintextEditor::GetAndInitDocEncoder(const nsAString& aFormatType,
if (!selection) return NS_ERROR_FAILURE;
// get the independent selection interface
nsCOMPtr<nsIIndependentSelection> indSel = do_QueryInterface(selection);
if (indSel)
indSel->SetPresShell(presShell);
nsCOMPtr<nsISelectionPrivate> selPriv(do_QueryInterface(selection));
if (selPriv)
selPriv->SetPresShell(presShell);
nsCOMPtr<nsIContent> content(do_QueryInterface(rootElement));
if (content)

View File

@@ -20,7 +20,6 @@ nsIFrameTraversal.h
nsIFrameUtil.h
nsIImageFrame.h
nsIImageMap.h
nsIIndependentSelection.h
nsILayoutDebugger.h
nsILayoutHistoryState.h
nsIMutableStyleContext.h

View File

@@ -50,7 +50,6 @@ nsIFrameTraversal.h \
nsIFrameUtil.h \
nsIImageFrame.h \
nsIImageMap.h \
nsIIndependentSelection.h \
nsILayoutDebugger.h \
nsILayoutHistoryState.h \
nsIMutableStyleContext.h \

View File

@@ -1,74 +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 ***** */
/*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* NOTE!! This is not a general class, but specific to layout and frames.
* Consumers looking for the general selection interface should look at
* nsISelection.
*/
#ifndef nsIIndependentSelection_h___
#define nsIIndependentSelection_h___
#include "nsISupports.h"
#define NS_IINDEPENDENTSELECTION_IID \
/* {3B7ABF61-33DB-4a47-8FFA-FFD6EA47CB1A} */ \
{ 0x3b7abf61, 0x33db, 0x4a47, \
{ 0x8f, 0xfa, 0xff, 0xd6, 0xea, 0x47, 0xcb, 0x1a } }
/*This interface is used to allow nsDOMSelection become more of an independent entity from nsSelection. */
class nsIIndependentSelection: public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IINDEPENDENTSELECTION_IID)
/** SetPresShell
* this method sets the internal pres shell to aPresShell
* @param aPresShell weak reference should be kept to this.
*/
NS_IMETHOD SetPresShell(nsIPresShell *aPresShell) =0;
};
#endif //nsIIndependentSelection_h___

View File

@@ -69,7 +69,6 @@
#include "nsISelectionListener.h"
#include "nsIContentIterator.h"
#include "nsIDocumentEncoder.h"
#include "nsIIndependentSelection.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
@@ -173,8 +172,7 @@ static void printRange(nsIDOMRange *aDomRange);
class nsTypedSelection : public nsISelection,
public nsISelectionPrivate,
public nsSupportsWeakReference,
public nsIIndependentSelection
public nsSupportsWeakReference
{
public:
nsTypedSelection();
@@ -182,44 +180,8 @@ public:
virtual ~nsTypedSelection();
NS_DECL_ISUPPORTS
/*BEGIN nsIIndependentSelection interface implementations */
NS_IMETHOD SetPresShell(nsIPresShell *aPresShell);
/*BEGIN nsISelection,Private interface implementations*/
NS_IMETHOD GetAnchorNode(nsIDOMNode** aAnchorNode);
NS_IMETHOD GetAnchorOffset(PRInt32* aAnchorOffset);
NS_IMETHOD GetFocusNode(nsIDOMNode** aFocusNode);
NS_IMETHOD GetFocusOffset(PRInt32* aFocusOffset);
NS_IMETHOD GetIsCollapsed(PRBool* aIsCollapsed);
NS_IMETHOD GetRangeCount(PRInt32* aRangeCount);
NS_IMETHOD GetRangeAt(PRInt32 aIndex, nsIDOMRange** aReturn);
NS_IMETHOD RemoveAllRanges();
NS_IMETHOD GetTableSelectionType(nsIDOMRange* aRange, PRInt32* aTableSelectionType);
NS_IMETHOD Collapse(nsIDOMNode* aParentNode, PRInt32 aOffset);
NS_IMETHOD CollapseToStart();
NS_IMETHOD CollapseToEnd();
NS_IMETHOD SelectAllChildren(nsIDOMNode* parentNode);
NS_IMETHOD Extend(nsIDOMNode* aParentNode, PRInt32 aOffset);
NS_IMETHOD ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aAYes);
NS_IMETHOD DeleteFromDocument();
NS_IMETHOD AddRange(nsIDOMRange* aRange);
NS_IMETHOD RemoveRange(nsIDOMRange* aRange);
NS_IMETHOD StartBatchChanges();
NS_IMETHOD EndBatchChanges();
NS_IMETHOD AddSelectionListener(nsISelectionListener* aNewListener);
NS_IMETHOD RemoveSelectionListener(nsISelectionListener* aListenerToRemove);
NS_IMETHOD GetEnumerator(nsIEnumerator **aIterator);
NS_IMETHOD ToString(PRUnichar **_retval);
NS_IMETHOD ToStringWithFormat(const char *aFormatType, PRUint32 aFlags, PRInt32 aWrapCount, PRUnichar ** aReturn);
NS_IMETHOD GetInterlinePosition(PRBool *aInterlinePosition);
NS_IMETHOD SetInterlinePosition(PRBool aInterlinePosition);
NS_IMETHOD SelectionLanguageChange(PRBool aLangRTL);
/*END nsISelection interface implementations*/
NS_DECL_NSISELECTION
NS_DECL_NSISELECTIONPRIVATE
// utility methods for scrolling the selection into view
nsresult GetPresContext(nsIPresContext **aPresContext);
@@ -4630,15 +4592,10 @@ nsSelection::GetMouseDoubleDown(PRBool *aDoubleDown)
//END nsISelection interface implementations
#ifdef XP_MAC
#if 0
#pragma mark -
#endif
// nsTypedSelection implementation
// note: this can return a nil anchor node
@@ -4685,7 +4642,6 @@ NS_INTERFACE_MAP_BEGIN(nsTypedSelection)
NS_INTERFACE_MAP_ENTRY(nsISelection)
NS_INTERFACE_MAP_ENTRY(nsISelectionPrivate)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_ENTRY(nsIIndependentSelection)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISelection)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(Selection)
NS_INTERFACE_MAP_END