Bug 1260651 part.57 Move classes in nsHTMLObjectResizer.h into mozilla namespace and its file name should be HTMLEditorObjectResizerUtils.h r=mccr8

This patch renames:

ResizerSelectionListener -> mozilla::ResizerSelectionListener
ResizerMouseMotionListener -> mozilla::ResizerMouseMotionListener
DocumentResizeEventListener -> mozilla::DocumentResizeEventListener

And making the header file name HTMLEditorObjectResizerUtils.h because it doesn't define specific class related to its file name and should be clearer that it's related to HTMLEditor.

MozReview-Commit-ID: GOJyEwtFdJV

--HG--
rename : editor/libeditor/nsHTMLObjectResizer.h => editor/libeditor/HTMLEditorObjectResizerUtils.h
This commit is contained in:
Masayuki Nakano 2016-07-07 19:49:07 +09:00
parent 9b6e26f0bb
commit f20dd4bac0
5 changed files with 92 additions and 111 deletions

View File

@ -7,6 +7,7 @@
#include <math.h>
#include "EditorUtils.h"
#include "HTMLEditorObjectResizerUtils.h"
#include "HTMLEditRules.h"
#include "HTMLEditUtils.h"
#include "TextEditUtils.h"
@ -22,7 +23,6 @@
#include "nsEditor.h"
#include "nsError.h"
#include "nsGkAtoms.h"
#include "nsHTMLObjectResizer.h"
#include "nsIContent.h"
#include "nsROCSSPrimitiveValue.h"
#include "nsIDOMCSSStyleDeclaration.h"

View File

@ -56,10 +56,10 @@
// Misc
#include "EditorUtils.h"
#include "HTMLEditorObjectResizerUtils.h"
#include "TextEditorTest.h"
#include "WSRunObject.h"
#include "nsGkAtoms.h"
#include "nsHTMLObjectResizer.h"
#include "nsIWidget.h"
#include "nsIFrame.h"

View File

@ -4,7 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/HTMLEditor.h"
#include "nsHTMLObjectResizer.h"
#include "HTMLEditorObjectResizerUtils.h"
#include "EditorUtils.h"
#include "HTMLEditUtils.h"
@ -45,8 +45,12 @@
class nsISelection;
namespace mozilla {
using namespace dom;
/******************************************************************************
* DocumentResizeEventListener
* mozilla::DocumentResizeEventListener
******************************************************************************/
NS_IMPL_ISUPPORTS(DocumentResizeEventListener, nsIDOMEventListener)
@ -56,10 +60,6 @@ DocumentResizeEventListener::DocumentResizeEventListener(nsIHTMLEditor* aEditor)
mEditor = do_GetWeakReference(aEditor);
}
DocumentResizeEventListener::~DocumentResizeEventListener()
{
}
NS_IMETHODIMP
DocumentResizeEventListener::HandleEvent(nsIDOMEvent* aMouseEvent)
{
@ -70,7 +70,7 @@ DocumentResizeEventListener::HandleEvent(nsIDOMEvent* aMouseEvent)
}
/******************************************************************************
* ResizerSelectionListener
* mozilla::ResizerSelectionListener
******************************************************************************/
NS_IMPL_ISUPPORTS(ResizerSelectionListener, nsISelectionListener)
@ -80,10 +80,6 @@ ResizerSelectionListener::ResizerSelectionListener(nsIHTMLEditor* aEditor)
mEditor = do_GetWeakReference(aEditor);
}
ResizerSelectionListener::~ResizerSelectionListener()
{
}
NS_IMETHODIMP
ResizerSelectionListener::NotifySelectionChanged(nsIDOMDocument* aDOMDocument,
nsISelection* aSelection,
@ -104,7 +100,7 @@ ResizerSelectionListener::NotifySelectionChanged(nsIDOMDocument* aDOMDocument,
}
/******************************************************************************
* ResizerMouseMotionListener
* mozilla::ResizerMouseMotionListener
******************************************************************************/
NS_IMPL_ISUPPORTS(ResizerMouseMotionListener, nsIDOMEventListener)
@ -114,10 +110,6 @@ ResizerMouseMotionListener::ResizerMouseMotionListener(nsIHTMLEditor* aEditor)
mEditor = do_GetWeakReference(aEditor);
}
ResizerMouseMotionListener::~ResizerMouseMotionListener()
{
}
NS_IMETHODIMP
ResizerMouseMotionListener::HandleEvent(nsIDOMEvent* aMouseEvent)
{
@ -138,10 +130,6 @@ ResizerMouseMotionListener::HandleEvent(nsIDOMEvent* aMouseEvent)
return NS_OK;
}
namespace mozilla {
using namespace dom;
/******************************************************************************
* mozilla::HTMLEditor
******************************************************************************/

View File

@ -0,0 +1,82 @@
/* -*- 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/. */
#ifndef HTMLEditorObjectResizerUtils_h
#define HTMLEditorObjectResizerUtils_h
#include "nsIDOMEventListener.h"
#include "nsISelectionListener.h"
#include "nsISupportsImpl.h"
#include "nsIWeakReferenceUtils.h"
#include "nsLiteralString.h"
class nsIHTMLEditor;
namespace mozilla {
#define kTopLeft NS_LITERAL_STRING("nw")
#define kTop NS_LITERAL_STRING("n")
#define kTopRight NS_LITERAL_STRING("ne")
#define kLeft NS_LITERAL_STRING("w")
#define kRight NS_LITERAL_STRING("e")
#define kBottomLeft NS_LITERAL_STRING("sw")
#define kBottom NS_LITERAL_STRING("s")
#define kBottomRight NS_LITERAL_STRING("se")
/******************************************************************************
* mozilla::ResizerSelectionListener
******************************************************************************/
class ResizerSelectionListener final : public nsISelectionListener
{
public:
explicit ResizerSelectionListener(nsIHTMLEditor* aEditor);
void Reset();
NS_DECL_ISUPPORTS
NS_DECL_NSISELECTIONLISTENER
protected:
virtual ~ResizerSelectionListener() {}
nsWeakPtr mEditor;
};
/******************************************************************************
* mozilla::ResizerMouseMotionListener
******************************************************************************/
class ResizerMouseMotionListener final : public nsIDOMEventListener
{
public:
explicit ResizerMouseMotionListener(nsIHTMLEditor* aEditor);
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMEVENTLISTENER
protected:
virtual ~ResizerMouseMotionListener() {}
nsWeakPtr mEditor;
};
/******************************************************************************
* mozilla::DocumentResizeEventListener
******************************************************************************/
class DocumentResizeEventListener final : public nsIDOMEventListener
{
public:
explicit DocumentResizeEventListener(nsIHTMLEditor* aEditor);
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMEVENTLISTENER
protected:
virtual ~DocumentResizeEventListener() {}
nsWeakPtr mEditor;
};
} // namespace mozilla
#endif // #ifndef HTMLEditorObjectResizerUtils_h

View File

@ -1,89 +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/. */
#ifndef _nshtmlobjectresizer__h
#define _nshtmlobjectresizer__h
#include "nsIDOMEventListener.h"
#include "nsISelectionListener.h"
#include "nsISupportsImpl.h"
#include "nsIWeakReferenceUtils.h"
#include "nsLiteralString.h"
class nsIHTMLEditor;
#define kTopLeft NS_LITERAL_STRING("nw")
#define kTop NS_LITERAL_STRING("n")
#define kTopRight NS_LITERAL_STRING("ne")
#define kLeft NS_LITERAL_STRING("w")
#define kRight NS_LITERAL_STRING("e")
#define kBottomLeft NS_LITERAL_STRING("sw")
#define kBottom NS_LITERAL_STRING("s")
#define kBottomRight NS_LITERAL_STRING("se")
// ==================================================================
// ResizerSelectionListener
// ==================================================================
class ResizerSelectionListener : public nsISelectionListener
{
public:
explicit ResizerSelectionListener(nsIHTMLEditor * aEditor);
void Reset();
/*interfaces for addref and release and queryinterface*/
NS_DECL_ISUPPORTS
NS_DECL_NSISELECTIONLISTENER
protected:
virtual ~ResizerSelectionListener();
nsWeakPtr mEditor;
};
// ==================================================================
// ResizerMouseMotionListener
// ==================================================================
class ResizerMouseMotionListener : public nsIDOMEventListener
{
public:
explicit ResizerMouseMotionListener(nsIHTMLEditor * aEditor);
/*interfaces for addref and release and queryinterface*/
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMEVENTLISTENER
protected:
virtual ~ResizerMouseMotionListener();
nsWeakPtr mEditor;
};
// ==================================================================
// DocumentResizeEventListener
// ==================================================================
class DocumentResizeEventListener: public nsIDOMEventListener
{
public:
explicit DocumentResizeEventListener(nsIHTMLEditor * aEditor);
/*interfaces for addref and release and queryinterface*/
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMEVENTLISTENER
protected:
virtual ~DocumentResizeEventListener();
nsWeakPtr mEditor;
};
#endif /* _nshtmlobjectresizer__h */