2001-09-26 02:53:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
1999-04-05 21:21:14 +04:00
|
|
|
|
|
|
|
#ifndef nsEditRules_h__
|
|
|
|
#define nsEditRules_h__
|
|
|
|
|
2000-03-24 03:26:47 +03:00
|
|
|
#define NS_IEDITRULES_IID \
|
2014-04-14 16:33:47 +04:00
|
|
|
{ 0x3836386d, 0x806a, 0x488d, \
|
|
|
|
{ 0x8b, 0xab, 0xaf, 0x42, 0xbb, 0x4c, 0x90, 0x66 } }
|
2000-03-24 03:26:47 +03:00
|
|
|
|
2014-11-02 15:04:13 +03:00
|
|
|
#include "nsEditor.h" // for EditAction enum
|
2012-07-13 10:33:42 +04:00
|
|
|
|
2001-01-28 23:13:07 +03:00
|
|
|
class nsPlaintextEditor;
|
2014-11-02 15:04:13 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class Selection;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
1999-04-05 21:21:14 +04:00
|
|
|
|
1999-04-12 16:01:32 +04:00
|
|
|
/***************************************************************************
|
|
|
|
* base for an object to encapsulate any additional info needed to be passed
|
|
|
|
* to rules system by the editor
|
|
|
|
*/
|
|
|
|
class nsRulesInfo
|
|
|
|
{
|
|
|
|
public:
|
2015-05-28 18:58:42 +03:00
|
|
|
|
2014-09-01 07:33:43 +04:00
|
|
|
explicit nsRulesInfo(EditAction aAction) : action(aAction) {}
|
1999-04-12 16:01:32 +04:00
|
|
|
virtual ~nsRulesInfo() {}
|
2015-05-28 18:58:42 +03:00
|
|
|
|
2012-08-12 22:28:26 +04:00
|
|
|
EditAction action;
|
1999-04-12 16:01:32 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
* Interface of editing rules.
|
2015-05-28 18:58:42 +03:00
|
|
|
*
|
1999-04-12 16:01:32 +04:00
|
|
|
*/
|
2000-03-24 03:26:47 +03:00
|
|
|
class nsIEditRules : public nsISupports
|
1999-04-05 21:21:14 +04:00
|
|
|
{
|
|
|
|
public:
|
2005-11-11 17:36:26 +03:00
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IEDITRULES_IID)
|
2015-05-28 18:58:42 +03:00
|
|
|
|
2000-03-24 03:26:47 +03:00
|
|
|
//Interfaces for addref and release and queryinterface
|
|
|
|
//NOTE: Use NS_DECL_ISUPPORTS_INHERITED in any class inherited from nsIEditRules
|
|
|
|
|
2010-04-12 06:35:18 +04:00
|
|
|
NS_IMETHOD Init(nsPlaintextEditor *aEditor)=0;
|
2014-04-14 16:33:47 +04:00
|
|
|
NS_IMETHOD SetInitialValue(const nsAString& aValue) = 0;
|
2009-05-09 08:59:24 +04:00
|
|
|
NS_IMETHOD DetachEditor()=0;
|
2012-08-12 22:28:26 +04:00
|
|
|
NS_IMETHOD BeforeEdit(EditAction action,
|
2012-05-05 22:52:29 +04:00
|
|
|
nsIEditor::EDirection aDirection) = 0;
|
2012-08-12 22:28:26 +04:00
|
|
|
NS_IMETHOD AfterEdit(EditAction action,
|
2012-05-05 22:52:29 +04:00
|
|
|
nsIEditor::EDirection aDirection) = 0;
|
2014-04-10 20:09:40 +04:00
|
|
|
NS_IMETHOD WillDoAction(mozilla::dom::Selection* aSelection, nsRulesInfo* aInfo,
|
2012-05-22 13:37:17 +04:00
|
|
|
bool* aCancel, bool* aHandled) = 0;
|
2014-11-02 15:04:13 +03:00
|
|
|
NS_IMETHOD DidDoAction(mozilla::dom::Selection* aSelection,
|
|
|
|
nsRulesInfo* aInfo, nsresult aResult) = 0;
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHOD DocumentIsEmpty(bool *aDocumentIsEmpty)=0;
|
2010-11-12 00:40:52 +03:00
|
|
|
NS_IMETHOD DocumentModified()=0;
|
1999-04-05 21:21:14 +04:00
|
|
|
};
|
|
|
|
|
2005-11-11 17:36:26 +03:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsIEditRules, NS_IEDITRULES_IID)
|
1999-12-07 11:30:19 +03:00
|
|
|
|
1999-04-05 21:21:14 +04:00
|
|
|
#endif //nsEditRules_h__
|
|
|
|
|