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