3 // This file was derived from a file from #Develop.
5 // Copyright (C) 2001-2007 Mike Krüger <mkrueger@novell.com>
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 using MonoDevelop
.SourceEditor
.Gui
;
24 namespace MonoDevelop
.SourceEditor
.Actions
27 /// To define a new key for the textarea, you must write a class which
28 /// implements this interface.
30 public interface IEditAction
33 /// Whether to pass the event to the base editor
41 /// An array of keys on which this edit action occurs.
48 Gdk
.ModifierType State
{
54 /// When the key which is defined in the addin is pressed, this method will be invoked.
56 void Execute (SourceEditorView sourceView
);
59 /// Invoked before the Execute method
61 void PreExecute (SourceEditorView sourceView
);
64 /// Invoked after the Execute method
66 void PostExecute (SourceEditorView sourceView
);
70 /// To define a new key for the textarea, you must write a class which
71 /// implements this interface.
73 public abstract class AbstractEditAction
: IEditAction
75 Gdk
.ModifierType modifier
= Gdk
.ModifierType
.None
;
79 // whether to pass the event to the base editor
80 public bool PassToBase
{
86 /// An array of keys on which this edit action occurs.
94 public Gdk
.ModifierType State
{
95 get { return modifier; }
96 set { modifier = value; }
100 /// When the key which is defined in the addin is pressed, this method will be invoked.
102 public abstract void Execute (SourceEditorView sourceView
);
105 /// When the key which is defined in the addin is pressed,
106 /// this method will be invoked before Execute ().
108 public virtual void PreExecute (SourceEditorView sourceView
)
113 /// When the key which is defined in the addin is pressed,
114 /// this method will be invoked after Execute ().
116 public virtual void PostExecute (SourceEditorView sourceView
)