KOffice – TDE office suite
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

kformula_view_iface.cc 6.0KB

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