kformula
kformula_view_iface.cc
00001 /* This file is part of the KDE project 00002 Copyright (C) 2002 Laurent Montel <lmontel@mandrakesoft.com> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #include "kformula_view_iface.h" 00021 #include <kformuladocument.h> 00022 #include <kformulaview.h> 00023 00024 #include "kformula_view.h" 00025 #include "kformula_doc.h" 00026 #include <dcopclient.h> 00027 00028 KformulaViewIface::KformulaViewIface( KFormulaPartView *view_ ) 00029 : KoViewIface( view_ ) 00030 { 00031 m_view = view_; 00032 } 00033 00034 void KformulaViewIface::addThinSpace() 00035 { 00036 m_view->document()->getDocument()->wrapper()->addThinSpace(); 00037 } 00038 00039 void KformulaViewIface::addMediumSpace() 00040 { 00041 m_view->document()->getDocument()->wrapper()->addMediumSpace(); 00042 } 00043 00044 void KformulaViewIface::addThickSpace() 00045 { 00046 m_view->document()->getDocument()->wrapper()->addThickSpace(); 00047 } 00048 00049 void KformulaViewIface::addQuadSpace() 00050 { 00051 m_view->document()->getDocument()->wrapper()->addQuadSpace(); 00052 } 00053 00054 void KformulaViewIface::addBracket( int left, int right ) 00055 { 00056 m_view->document()->getDocument()-> 00057 wrapper()->addBracket( static_cast<KFormula::SymbolType>( left ), 00058 static_cast<KFormula::SymbolType>( right ) ); 00059 } 00060 00061 void KformulaViewIface::addParenthesis() 00062 { 00063 m_view->document()->getDocument()->wrapper()->addParenthesis(); 00064 } 00065 00066 void KformulaViewIface::addSquareBracket() 00067 { 00068 m_view->document()->getDocument()->wrapper()->addSquareBracket(); 00069 } 00070 00071 void KformulaViewIface::addCurlyBracket() 00072 { 00073 m_view->document()->getDocument()->wrapper()->addCurlyBracket(); 00074 } 00075 00076 void KformulaViewIface::addLineBracket() 00077 { 00078 m_view->document()->getDocument()->wrapper()->addLineBracket(); 00079 } 00080 00081 void KformulaViewIface::addFraction() 00082 { 00083 m_view->document()->getDocument()->wrapper()->addFraction(); 00084 } 00085 00086 void KformulaViewIface::addRoot() 00087 { 00088 m_view->document()->getDocument()->wrapper()->addRoot(); 00089 } 00090 00091 void KformulaViewIface::addIntegral() 00092 { 00093 m_view->document()->getDocument()->wrapper()->addIntegral(); 00094 } 00095 00096 void KformulaViewIface::addProduct() 00097 { 00098 m_view->document()->getDocument()->wrapper()->addProduct(); 00099 } 00100 00101 void KformulaViewIface::addSum() 00102 { 00103 m_view->document()->getDocument()->wrapper()->addSum(); 00104 } 00105 00106 void KformulaViewIface::addMatrix() 00107 { 00108 m_view->document()->getDocument()->wrapper()->addMatrix(); 00109 } 00110 00111 void KformulaViewIface::addMatrix( uint rows, uint columns ) 00112 { 00113 m_view->document()->getDocument()->wrapper()->addMatrix( rows, columns ); 00114 } 00115 00116 void KformulaViewIface::addOneByTwoMatrix() 00117 { 00118 m_view->document()->getDocument()->wrapper()->addOneByTwoMatrix(); 00119 } 00120 00121 void KformulaViewIface::addNameSequence() 00122 { 00123 m_view->document()->getDocument()->wrapper()->addNameSequence(); 00124 } 00125 00126 void KformulaViewIface::addLowerLeftIndex() 00127 { 00128 m_view->document()->getDocument()->wrapper()->addLowerLeftIndex(); 00129 } 00130 00131 void KformulaViewIface::addUpperLeftIndex() 00132 { 00133 m_view->document()->getDocument()->wrapper()->addUpperLeftIndex(); 00134 } 00135 00136 void KformulaViewIface::addLowerRightIndex() 00137 { 00138 m_view->document()->getDocument()->wrapper()->addLowerRightIndex(); 00139 } 00140 00141 void KformulaViewIface::addUpperRightIndex() 00142 { 00143 m_view->document()->getDocument()->wrapper()->addUpperRightIndex(); 00144 } 00145 00146 void KformulaViewIface::addGenericLowerIndex() 00147 { 00148 m_view->document()->getDocument()->wrapper()->addGenericLowerIndex(); 00149 } 00150 00151 void KformulaViewIface::addGenericUpperIndex() 00152 { 00153 m_view->document()->getDocument()->wrapper()->addGenericUpperIndex(); 00154 } 00155 00156 void KformulaViewIface::removeEnclosing() 00157 { 00158 m_view->document()->getDocument()->wrapper()->removeEnclosing(); 00159 } 00160 00161 void KformulaViewIface::makeGreek() 00162 { 00163 m_view->document()->getDocument()->wrapper()->makeGreek(); 00164 } 00165 00166 void KformulaViewIface::insertSymbol( QString name ) 00167 { 00168 m_view->document()->getDocument()->wrapper()->insertSymbol( name ); 00169 } 00170 00171 void KformulaViewIface::appendColumn() 00172 { 00173 m_view->document()->getDocument()->wrapper()->appendColumn(); 00174 } 00175 00176 void KformulaViewIface::insertColumn() 00177 { 00178 m_view->document()->getDocument()->wrapper()->insertColumn(); 00179 } 00180 00181 void KformulaViewIface::removeColumn() 00182 { 00183 m_view->document()->getDocument()->wrapper()->removeColumn(); 00184 } 00185 00186 void KformulaViewIface::appendRow() 00187 { 00188 m_view->document()->getDocument()->wrapper()->appendRow(); 00189 } 00190 00191 void KformulaViewIface::insertRow() 00192 { 00193 m_view->document()->getDocument()->wrapper()->insertRow(); 00194 } 00195 00196 void KformulaViewIface::removeRow() 00197 { 00198 m_view->document()->getDocument()->wrapper()->removeRow(); 00199 } 00200 00201 void KformulaViewIface::moveRight( int flag ) 00202 { 00203 m_view->formulaView()->moveRight( flag ); 00204 } 00205 00206 void KformulaViewIface::moveUp( int flag ) 00207 { 00208 m_view->formulaView()->moveUp( flag ); 00209 } 00210 00211 void KformulaViewIface::moveDown( int flag ) 00212 { 00213 m_view->formulaView()->moveDown( flag ); 00214 } 00215 00216 void KformulaViewIface::moveLeft( int flag ) 00217 { 00218 m_view->formulaView()->moveLeft( flag ); 00219 } 00220 00221 void KformulaViewIface::moveHome( int flag ) 00222 { 00223 m_view->formulaView()->moveHome( flag ); 00224 } 00225 00226 void KformulaViewIface::moveEnd( int flag ) 00227 { 00228 m_view->formulaView()->moveEnd( flag ); 00229 } 00230 00231 bool KformulaViewIface::isHome() const 00232 { 00233 return m_view->formulaView()->isHome(); 00234 } 00235 00236 bool KformulaViewIface::isEnd() const 00237 { 00238 return m_view->formulaView()->isEnd(); 00239 } 00240 00241 void KformulaViewIface::eraseSelection( int direction ) 00242 { 00243 m_view->formulaView()->eraseSelection( static_cast<KFormula::Direction>( direction ) ); 00244 } 00245 00246 void KformulaViewIface::addText( QString str ) 00247 { 00248 m_view->formulaView()->addText( str ); 00249 } 00250 00251 QStringList KformulaViewIface::readFormulaString( QString text ) 00252 { 00253 return m_view->readFormulaString( text ); 00254 }