]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/modules/lseditor/lseditorpl.h
More updates.
[wxWidgets.git] / utils / wxPython / modules / lseditor / lseditorpl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: nativeeditorpl.h
3 // Purpose: Language-sensative editor plugin for wxStudio
4 // Author: Aleksandras Gluchovas
5 // Modified by:
6 // Created: 11/04/1999
7 // RCS-ID: $Id$
8 // Copyright: (c) Aleskandars Gluchovas
9 // Licence: GNU General Public License
10 /////////////////////////////////////////////////////////////////////////////
11 //
12 // This program is free software; you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation; either version 2 of the License, or
15 // (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 /////////////////////////////////////////////////////////////////////////////
26
27 #ifndef __LSEDITORPL_G__
28 #define __LSEDITORPL_G__
29
30 #include "editorpl.h"
31
32 class wxTextEditorModel;
33 class wxTextEditorView;
34
35 class wxsLSEditorPlugin : public wxsSourceEditorPlugin
36 {
37 protected:
38 wxTextEditorModel* mpModel;
39 wxTextEditorView* mpView;
40
41 public:
42 wxsLSEditorPlugin();
43 ~wxsLSEditorPlugin();
44
45 void Create( wxWindow* parent, wxWindowID id );
46
47 virtual void OnOpen( const string& fname );
48 virtual void OnSave( const string& fname );
49
50 virtual void OnCopy();
51 virtual void OnCut();
52 virtual void OnPaste();
53 virtual void OnDelete();
54
55 void OnUndo();
56 void OnRedo();
57
58 void SelectAll();
59 void OnGotoLine( int lineNo, int column = 0 );
60 void OnGotoLine();
61 void OnProperties();
62
63 void OnFind();
64 void OnFindNext();
65 void OnFindPrevious();
66 void OnReplace();
67
68 virtual void OnToggleBookmark();
69 virtual void OnNextBookmark();
70 virtual void OnPreviousBookmark();
71 virtual void OnShowBookmarks();
72
73 virtual void SetCheckpoint();
74 virtual bool CheckpointModified();
75
76 // UI-updates
77
78 bool CanCopy();
79 bool CanCut();
80 bool CanPaste();
81 bool CanUndo();
82 bool CanRedo();
83
84 // accesed by framework
85
86 virtual string GetName(){ return "Alex's Language Sensitive Editor"; }
87
88 virtual bool IsModified();
89
90 virtual wxWindow* GetWindow();
91
92 virtual void GetAllText( char** ppBuf, size_t* length );
93
94 virtual void SetFileName( const string& fname );
95
96 virtual void HoldCursor( bool hold );
97
98 virtual wxsPluginBase* Clone() { return new wxsLSEditorPlugin(); };
99
100 virtual string FindWordAtCursor();
101
102 virtual void GetCursorPos( int* line, int* column );
103 virtual void SetCursorPos( int line, int column );
104
105 virtual void GetPagePos( int* line, int* column );
106
107 virtual void GetText( int fromLine, int fromColumn,
108 int tillLine, int tillColumn,
109 char** ppBuf, size_t* length );
110
111 virtual void InsertText( int line, int column,
112 char* text, size_t lenght );
113
114 virtual void DeleteText( int fromLine, int fromColumn,
115 int tillLine, int tillColumn );
116
117 virtual void PositionToXY( int line, int column, int* x, int* y );
118
119 virtual void GetSelectionRange( int* fromLine, int* fromColumn,
120 int* tillLine, int* tillColumn );
121
122 virtual wxSize GetCharacterSize();
123
124 virtual bool IsUnixText();
125
126 // some extras (just in case..)
127
128 wxTextEditorModel& GetModel();
129 wxTextEditorView& GetView();
130 };
131
132 #endif
133 // __LSEDITORPL_G__