Salome HOME
PyEditor refactoring
[modules/gui.git] / tools / PyEditor / src / python / PyEditorPy.sip
1 // Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // File   : SalomePyQt.sip
23 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
24 //
25
26 %Module PyEditorPy
27
28 %Import QtCore/QtCoremod.sip
29 %Import QtGui/QtGuimod.sip
30 %If (Qt_5_0_0 -)
31 %Import QtWidgets/QtWidgetsmod.sip
32 %End
33
34 class PyEditor_Settings
35 {
36 %TypeHeaderCode
37 #include <PyEditor_Settings.h>
38 %End
39
40 public:
41   PyEditor_Settings();
42
43   void setHighlightCurrentLine( bool );
44   bool highlightCurrentLine() const;
45
46   void setTextWrapping( bool );
47   bool textWrapping() const;
48
49   void setCenterCursorOnScroll( bool );
50   bool centerCursorOnScroll() const;
51
52   void setLineNumberArea( bool );
53   bool lineNumberArea() const;
54
55   void setVerticalEdge( bool );
56   bool verticalEdge() const;
57
58   void setNumberColumns( int );
59   int numberColumns() const;
60
61   void setTabSpaceVisible( bool );
62   bool tabSpaceVisible() const;
63
64   void setTabSize( int );
65   int tabSize() const;
66
67   void setFont( const QFont& );
68   QFont font() const;
69 };
70
71 class PyEditor_Editor : QPlainTextEdit
72
73 %TypeHeaderCode
74 #include <PyEditor_Editor.h>
75 %End
76
77 public:
78   explicit PyEditor_Editor( QWidget* /TransferThis/ = 0 );
79   virtual ~PyEditor_Editor();
80
81   void setSettings( const PyEditor_Settings& );
82   const PyEditor_Settings& settings() const;
83   QString text() const;
84
85 public slots:
86   void deleteSelected();
87   void append( const QString& );  
88   void setText( const QString& text );
89
90 protected:
91   virtual void keyPressEvent( QKeyEvent* );
92   virtual void resizeEvent( QResizeEvent* );
93   virtual void paintEvent( QPaintEvent* );
94
95 private:
96   PyEditor_Editor( const PyEditor_Editor& );
97   PyEditor_Editor& operator=( const PyEditor_Editor& );
98 };