kformula

kformula_view_iface.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2002 Laurent Montel <lmontel@mandrakesoft.com>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#include "kformula_view_iface.h"
21#include <kformuladocument.h>
22#include <kformulaview.h>
23
24#include "kformula_view.h"
25#include "kformula_doc.h"
26#include <dcopclient.h>
27
28KformulaViewIface::KformulaViewIface( KFormulaPartView *view_ )
29 : KoViewIface( view_ )
30{
31 m_view = view_;
32}
33
34void KformulaViewIface::addThinSpace()
35{
36 m_view->document()->getDocument()->wrapper()->addThinSpace();
37}
38
39void KformulaViewIface::addMediumSpace()
40{
41 m_view->document()->getDocument()->wrapper()->addMediumSpace();
42}
43
44void KformulaViewIface::addThickSpace()
45{
46 m_view->document()->getDocument()->wrapper()->addThickSpace();
47}
48
49void KformulaViewIface::addQuadSpace()
50{
51 m_view->document()->getDocument()->wrapper()->addQuadSpace();
52}
53
54void KformulaViewIface::addBracket( int left, int right )
55{
56 m_view->document()->getDocument()->
57 wrapper()->addBracket( static_cast<KFormula::SymbolType>( left ),
58 static_cast<KFormula::SymbolType>( right ) );
59}
60
61void KformulaViewIface::addParenthesis()
62{
63 m_view->document()->getDocument()->wrapper()->addParenthesis();
64}
65
66void KformulaViewIface::addSquareBracket()
67{
68 m_view->document()->getDocument()->wrapper()->addSquareBracket();
69}
70
71void KformulaViewIface::addCurlyBracket()
72{
73 m_view->document()->getDocument()->wrapper()->addCurlyBracket();
74}
75
76void KformulaViewIface::addLineBracket()
77{
78 m_view->document()->getDocument()->wrapper()->addLineBracket();
79}
80
81void KformulaViewIface::addFraction()
82{
83 m_view->document()->getDocument()->wrapper()->addFraction();
84}
85
86void KformulaViewIface::addRoot()
87{
88 m_view->document()->getDocument()->wrapper()->addRoot();
89}
90
91void KformulaViewIface::addIntegral()
92{
93 m_view->document()->getDocument()->wrapper()->addIntegral();
94}
95
96void KformulaViewIface::addProduct()
97{
98 m_view->document()->getDocument()->wrapper()->addProduct();
99}
100
101void KformulaViewIface::addSum()
102{
103 m_view->document()->getDocument()->wrapper()->addSum();
104}
105
106void KformulaViewIface::addMatrix()
107{
108 m_view->document()->getDocument()->wrapper()->addMatrix();
109}
110
111void KformulaViewIface::addMatrix( uint rows, uint columns )
112{
113 m_view->document()->getDocument()->wrapper()->addMatrix( rows, columns );
114}
115
116void KformulaViewIface::addOneByTwoMatrix()
117{
118 m_view->document()->getDocument()->wrapper()->addOneByTwoMatrix();
119}
120
121void KformulaViewIface::addNameSequence()
122{
123 m_view->document()->getDocument()->wrapper()->addNameSequence();
124}
125
126void KformulaViewIface::addLowerLeftIndex()
127{
128 m_view->document()->getDocument()->wrapper()->addLowerLeftIndex();
129}
130
131void KformulaViewIface::addUpperLeftIndex()
132{
133 m_view->document()->getDocument()->wrapper()->addUpperLeftIndex();
134}
135
136void KformulaViewIface::addLowerRightIndex()
137{
138 m_view->document()->getDocument()->wrapper()->addLowerRightIndex();
139}
140
141void KformulaViewIface::addUpperRightIndex()
142{
143 m_view->document()->getDocument()->wrapper()->addUpperRightIndex();
144}
145
146void KformulaViewIface::addGenericLowerIndex()
147{
148 m_view->document()->getDocument()->wrapper()->addGenericLowerIndex();
149}
150
151void KformulaViewIface::addGenericUpperIndex()
152{
153 m_view->document()->getDocument()->wrapper()->addGenericUpperIndex();
154}
155
156void KformulaViewIface::removeEnclosing()
157{
158 m_view->document()->getDocument()->wrapper()->removeEnclosing();
159}
160
161void KformulaViewIface::makeGreek()
162{
163 m_view->document()->getDocument()->wrapper()->makeGreek();
164}
165
166void KformulaViewIface::insertSymbol( TQString name )
167{
168 m_view->document()->getDocument()->wrapper()->insertSymbol( name );
169}
170
171void KformulaViewIface::appendColumn()
172{
173 m_view->document()->getDocument()->wrapper()->appendColumn();
174}
175
176void KformulaViewIface::insertColumn()
177{
178 m_view->document()->getDocument()->wrapper()->insertColumn();
179}
180
181void KformulaViewIface::removeColumn()
182{
183 m_view->document()->getDocument()->wrapper()->removeColumn();
184}
185
186void KformulaViewIface::appendRow()
187{
188 m_view->document()->getDocument()->wrapper()->appendRow();
189}
190
191void KformulaViewIface::insertRow()
192{
193 m_view->document()->getDocument()->wrapper()->insertRow();
194}
195
196void KformulaViewIface::removeRow()
197{
198 m_view->document()->getDocument()->wrapper()->removeRow();
199}
200
201void KformulaViewIface::moveRight( int flag )
202{
203 m_view->formulaView()->moveRight( flag );
204}
205
206void KformulaViewIface::moveUp( int flag )
207{
208 m_view->formulaView()->moveUp( flag );
209}
210
211void KformulaViewIface::moveDown( int flag )
212{
213 m_view->formulaView()->moveDown( flag );
214}
215
216void KformulaViewIface::moveLeft( int flag )
217{
218 m_view->formulaView()->moveLeft( flag );
219}
220
221void KformulaViewIface::moveHome( int flag )
222{
223 m_view->formulaView()->moveHome( flag );
224}
225
226void KformulaViewIface::moveEnd( int flag )
227{
228 m_view->formulaView()->moveEnd( flag );
229}
230
231bool KformulaViewIface::isHome() const
232{
233 return m_view->formulaView()->isHome();
234}
235
236bool KformulaViewIface::isEnd() const
237{
238 return m_view->formulaView()->isEnd();
239}
240
241void KformulaViewIface::eraseSelection( int direction )
242{
243 m_view->formulaView()->eraseSelection( static_cast<KFormula::Direction>( direction ) );
244}
245
246void KformulaViewIface::addText( TQString str )
247{
248 m_view->formulaView()->addText( str );
249}
250
251TQStringList KformulaViewIface::readFormulaString( TQString text )
252{
253 return m_view->readFormulaString( text );
254}
The parts view.