Bug 1349426 - Remove nsIHTMLObjectResizeListener. r=masayuki
m-c, c-c, addons and bluegriffon don't use this interface, so we can remove it. MozReview-Commit-ID: I8sVLpDR2gx
This commit is contained in:
@@ -215,7 +215,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLEditor, TextEditor)
|
|||||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMouseMotionListenerP)
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMouseMotionListenerP)
|
||||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSelectionListenerP)
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSelectionListenerP)
|
||||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mResizeEventListenerP)
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mResizeEventListenerP)
|
||||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mObjectResizeEventListeners)
|
|
||||||
|
|
||||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAbsolutelyPositionedObject)
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAbsolutelyPositionedObject)
|
||||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGrabber)
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGrabber)
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
#include "nsIHTMLAbsPosEditor.h"
|
#include "nsIHTMLAbsPosEditor.h"
|
||||||
#include "nsIHTMLEditor.h"
|
#include "nsIHTMLEditor.h"
|
||||||
#include "nsIHTMLInlineTableEditor.h"
|
#include "nsIHTMLInlineTableEditor.h"
|
||||||
#include "nsIHTMLObjectResizeListener.h"
|
|
||||||
#include "nsIHTMLObjectResizer.h"
|
#include "nsIHTMLObjectResizer.h"
|
||||||
#include "nsISelectionListener.h"
|
#include "nsISelectionListener.h"
|
||||||
#include "nsITableEditor.h"
|
#include "nsITableEditor.h"
|
||||||
@@ -910,8 +909,6 @@ protected:
|
|||||||
nsCOMPtr<nsISelectionListener> mSelectionListenerP;
|
nsCOMPtr<nsISelectionListener> mSelectionListenerP;
|
||||||
nsCOMPtr<nsIDOMEventListener> mResizeEventListenerP;
|
nsCOMPtr<nsIDOMEventListener> mResizeEventListenerP;
|
||||||
|
|
||||||
nsTArray<OwningNonNull<nsIHTMLObjectResizeListener>> mObjectResizeEventListeners;
|
|
||||||
|
|
||||||
int32_t mOriginalX;
|
int32_t mOriginalX;
|
||||||
int32_t mOriginalY;
|
int32_t mOriginalY;
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
#include "nsIDOMText.h"
|
#include "nsIDOMText.h"
|
||||||
#include "nsIDocument.h"
|
#include "nsIDocument.h"
|
||||||
#include "nsIEditor.h"
|
#include "nsIEditor.h"
|
||||||
#include "nsIHTMLObjectResizeListener.h"
|
|
||||||
#include "nsIHTMLObjectResizer.h"
|
#include "nsIHTMLObjectResizer.h"
|
||||||
#include "nsIPresShell.h"
|
#include "nsIPresShell.h"
|
||||||
#include "nsISupportsUtils.h"
|
#include "nsISupportsUtils.h"
|
||||||
@@ -491,11 +490,6 @@ HTMLEditor::HideShadowAndInfo()
|
|||||||
nsresult
|
nsresult
|
||||||
HTMLEditor::StartResizing(nsIDOMElement* aHandle)
|
HTMLEditor::StartResizing(nsIDOMElement* aHandle)
|
||||||
{
|
{
|
||||||
// First notify the listeners if any
|
|
||||||
for (auto& listener : mObjectResizeEventListeners) {
|
|
||||||
listener->OnStartResizing(static_cast<nsIDOMElement*>(GetAsDOMNode(mResizedObject)));
|
|
||||||
}
|
|
||||||
|
|
||||||
mIsResizing = true;
|
mIsResizing = true;
|
||||||
mActivatedHandle = do_QueryInterface(aHandle);
|
mActivatedHandle = do_QueryInterface(aHandle);
|
||||||
NS_ENSURE_STATE(mActivatedHandle || !aHandle);
|
NS_ENSURE_STATE(mActivatedHandle || !aHandle);
|
||||||
@@ -970,12 +964,6 @@ HTMLEditor::SetFinalSize(int32_t aX,
|
|||||||
EmptyString());
|
EmptyString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// finally notify the listeners if any
|
|
||||||
for (auto& listener : mObjectResizeEventListeners) {
|
|
||||||
listener->OnEndResizing(static_cast<nsIDOMElement*>(GetAsDOMNode(mResizedObject)),
|
|
||||||
mResizedObjectWidth, mResizedObjectHeight, width,
|
|
||||||
height);
|
|
||||||
}
|
|
||||||
|
|
||||||
// keep track of that size
|
// keep track of that size
|
||||||
mResizedObjectWidth = width;
|
mResizedObjectWidth = width;
|
||||||
@@ -1006,33 +994,4 @@ HTMLEditor::SetObjectResizingEnabled(bool aObjectResizingEnabled)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
HTMLEditor::AddObjectResizeEventListener(nsIHTMLObjectResizeListener* aListener)
|
|
||||||
{
|
|
||||||
NS_ENSURE_ARG_POINTER(aListener);
|
|
||||||
if (mObjectResizeEventListeners.Contains(aListener)) {
|
|
||||||
/* listener already registered */
|
|
||||||
NS_ASSERTION(false,
|
|
||||||
"trying to register an already registered object resize event listener");
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
mObjectResizeEventListeners.AppendElement(*aListener);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
HTMLEditor::RemoveObjectResizeEventListener(
|
|
||||||
nsIHTMLObjectResizeListener* aListener)
|
|
||||||
{
|
|
||||||
NS_ENSURE_ARG_POINTER(aListener);
|
|
||||||
if (!mObjectResizeEventListeners.Contains(aListener)) {
|
|
||||||
/* listener was not registered */
|
|
||||||
NS_ASSERTION(false,
|
|
||||||
"trying to remove an object resize event listener that was not already registered");
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
mObjectResizeEventListeners.RemoveElement(aListener);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ XPIDL_SOURCES += [
|
|||||||
'nsIHTMLAbsPosEditor.idl',
|
'nsIHTMLAbsPosEditor.idl',
|
||||||
'nsIHTMLEditor.idl',
|
'nsIHTMLEditor.idl',
|
||||||
'nsIHTMLInlineTableEditor.idl',
|
'nsIHTMLInlineTableEditor.idl',
|
||||||
'nsIHTMLObjectResizeListener.idl',
|
|
||||||
'nsIHTMLObjectResizer.idl',
|
'nsIHTMLObjectResizer.idl',
|
||||||
'nsIPlaintextEditor.idl',
|
'nsIPlaintextEditor.idl',
|
||||||
'nsITableEditor.idl',
|
'nsITableEditor.idl',
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#include "nsISupports.idl"
|
|
||||||
#include "domstubs.idl"
|
|
||||||
|
|
||||||
[scriptable, uuid(27b00295-349c-429f-ad0c-87b859e77130)]
|
|
||||||
|
|
||||||
interface nsIHTMLObjectResizeListener : nsISupports
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Listener's callback called by the editor when the user
|
|
||||||
* starts resizing an element
|
|
||||||
* @param aElement [IN] the element
|
|
||||||
*/
|
|
||||||
void onStartResizing(in nsIDOMElement aElement);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Listener's callback called by the editor when the user
|
|
||||||
* has finalized the resizing of an element
|
|
||||||
* @param aElement [IN] the element that was resized
|
|
||||||
* @param aOldWidth [IN] the width of the element before resizing
|
|
||||||
* @param aOldHeight [IN] the height of the element before resizing
|
|
||||||
* @param aNewWidth [IN] the width of the element after resizing
|
|
||||||
* @param aNewHeight [IN] the height of the element after resizing
|
|
||||||
*/
|
|
||||||
void onEndResizing(in nsIDOMElement aElement,
|
|
||||||
in long aOldWidth, in long aOldHeight,
|
|
||||||
in long aNewWidth, in long aNewHeight);
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -6,8 +6,6 @@
|
|||||||
#include "nsISupports.idl"
|
#include "nsISupports.idl"
|
||||||
#include "domstubs.idl"
|
#include "domstubs.idl"
|
||||||
|
|
||||||
interface nsIHTMLObjectResizeListener;
|
|
||||||
|
|
||||||
[scriptable, uuid(8b396020-69d3-451f-80c1-1a96a7da25a9)]
|
[scriptable, uuid(8b396020-69d3-451f-80c1-1a96a7da25a9)]
|
||||||
|
|
||||||
interface nsIHTMLObjectResizer : nsISupports
|
interface nsIHTMLObjectResizer : nsISupports
|
||||||
@@ -74,20 +72,5 @@ interface nsIHTMLObjectResizer : nsISupports
|
|||||||
* @param aMouseEvent [IN] the event
|
* @param aMouseEvent [IN] the event
|
||||||
*/
|
*/
|
||||||
void mouseMove(in nsIDOMEvent aMouseEvent);
|
void mouseMove(in nsIDOMEvent aMouseEvent);
|
||||||
|
|
||||||
/* Event Listeners */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a resize listener that can be used to get notifications
|
|
||||||
* that the user started to resize an object or finalized such an operation
|
|
||||||
* @param aListener [IN] an instance of nsIHTMLObjectResizeListener
|
|
||||||
*/
|
|
||||||
void addObjectResizeEventListener(in nsIHTMLObjectResizeListener aListener);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Deletes a resize listener
|
|
||||||
* @param aListener [IN] an instance of nsIHTMLObjectResizeListener
|
|
||||||
*/
|
|
||||||
void removeObjectResizeEventListener(in nsIHTMLObjectResizeListener aListener);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user