gecko-dev/editor/libeditor/HTMLEditorObjectResizerUtils.h
Masayuki Nakano 4b7e512db0 Bug 1433345 - part 4: Make EditorBase derived from nsISelectionListener and notify its owning classes of selection change r=m_kato
This patch makes EditorBase derived from nsISelectionListener.  Then, we can
make IMEContentObserver, TextInputListener, ComposerCommandsUpdater,
TypeInState not derived from nsISelectionListener since EditorBase or
HTMLEditor can notify them of selection change directly.  Additionally,
ResizerSelectionListener is not necessary anymore since it just implements
nsISelectionListener and calls only a method of HTMLEditor.  So, HTMLEditor
can call it directly.

Note that the order of selection listeners may be different.  However,
according to what each selection listener does, changing the order isn't
problem.

MozReview-Commit-ID: 1JXZxQcS0tP

--HG--
extra : rebase_source : c2ebe622a74001ad4e421da492dcdab8e6fe1649
2018-01-26 17:25:45 +09:00

66 lines
2.0 KiB
C++

/* -*- 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 "mozilla/HTMLEditor.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIDOMEventListener.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::ResizerMouseMotionListener
******************************************************************************/
class ResizerMouseMotionListener final : public nsIDOMEventListener
{
public:
explicit ResizerMouseMotionListener(HTMLEditor& aHTMLEditor);
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMEVENTLISTENER
protected:
virtual ~ResizerMouseMotionListener() {}
CachedWeakPtr<HTMLEditor, nsIHTMLEditor> mHTMLEditorWeak;
};
/******************************************************************************
* mozilla::DocumentResizeEventListener
******************************************************************************/
class DocumentResizeEventListener final : public nsIDOMEventListener
{
public:
explicit DocumentResizeEventListener(HTMLEditor& aHTMLEditor);
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMEVENTLISTENER
protected:
virtual ~DocumentResizeEventListener() {}
CachedWeakPtr<HTMLEditor, nsIHTMLEditor> mHTMLEditorWeak;
};
} // namespace mozilla
#endif // #ifndef HTMLEditorObjectResizerUtils_h