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