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.

460 lines
7.5KB

  1. /* This file is part of the KDE project
  2. Copyright 2004 Ariya Hidayat <ariya@kde.org>
  3. Copyright 2002-2003 Joseph Wenninger <jowenn@kde.org>
  4. Copyright 2002 John Dailey <dailey@vt.edu>
  5. Copyright 2001-2002 Laurent Montel <montel@kde.org>
  6. Copyright 2001 Philipp Mueller <philipp.mueller@gmx.de>
  7. Copyright 2000 Simon Hausmann <hausmann@kde.org>
  8. Copyright 1999 Torben Weis <weis@kde.org>
  9. This library is free software; you can redistribute it and/or
  10. modify it under the terms of the GNU Library General Public
  11. License as published by the Free Software Foundation; either
  12. version 2 of the License, or (at your option) any later version.
  13. This library is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. Library General Public License for more details.
  17. You should have received a copy of the GNU Library General Public License
  18. along with this library; see the file COPYING.LIB. If not, write to
  19. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  20. * Boston, MA 02110-1301, USA.
  21. */
  22. #include <dcopclient.h>
  23. #include <dcopref.h>
  24. #include <tdeapplication.h>
  25. #include "kspread_doc.h"
  26. #include "kspread_map.h"
  27. #include "selection.h"
  28. #include "kspread_sheet.h"
  29. #include "kspread_view.h"
  30. #include "KSpreadViewIface.h"
  31. using namespace KSpread;
  32. /************************************************
  33. *
  34. * ViewIface
  35. *
  36. ************************************************/
  37. ViewIface::ViewIface( View* t )
  38. : KoViewIface( t )
  39. {
  40. m_view = t;
  41. }
  42. ViewIface::~ViewIface()
  43. {
  44. }
  45. DCOPRef ViewIface::doc() const
  46. {
  47. return DCOPRef( kapp->dcopClient()->appId(), m_view->doc()->dcopObject()->objId() );
  48. }
  49. DCOPRef ViewIface::map() const
  50. {
  51. return DCOPRef( kapp->dcopClient()->appId(), m_view->doc()->map()->dcopObject()->objId() );
  52. }
  53. DCOPRef ViewIface::sheet() const
  54. {
  55. return DCOPRef( kapp->dcopClient()->appId(), m_view->activeSheet()->dcopObject()->objId() );
  56. }
  57. void ViewIface::changeNbOfRecentFiles(int _nb)
  58. {
  59. if(_nb<0)
  60. return;
  61. m_view->changeNbOfRecentFiles(_nb);
  62. }
  63. void ViewIface::hide()
  64. {
  65. m_view->hide();
  66. }
  67. void ViewIface::show()
  68. {
  69. m_view->show();
  70. }
  71. void ViewIface::find()
  72. {
  73. m_view->find();
  74. }
  75. void ViewIface::replace()
  76. {
  77. m_view->replace();
  78. }
  79. void ViewIface::conditional()
  80. {
  81. m_view->conditional();
  82. }
  83. void ViewIface::validity()
  84. {
  85. m_view->validity();
  86. }
  87. void ViewIface::insertSeries()
  88. {
  89. m_view->insertSeries();
  90. }
  91. void ViewIface::insertHyperlink()
  92. {
  93. m_view->insertHyperlink();
  94. }
  95. void ViewIface::gotoCell()
  96. {
  97. m_view->gotoCell();
  98. }
  99. void ViewIface::changeAngle()
  100. {
  101. m_view->changeAngle();
  102. }
  103. void ViewIface::preference()
  104. {
  105. m_view->preference();
  106. }
  107. void ViewIface::nextSheet()
  108. {
  109. m_view->nextSheet();
  110. }
  111. bool ViewIface::showSheet(TQString sheetName)
  112. {
  113. return m_view->showSheet(sheetName);
  114. }
  115. void ViewIface::previousSheet()
  116. {
  117. m_view->previousSheet();
  118. }
  119. void ViewIface::sortList()
  120. {
  121. m_view->sortList();
  122. }
  123. void ViewIface::setAreaName()
  124. {
  125. m_view->setAreaName();
  126. }
  127. void ViewIface::showAreaName()
  128. {
  129. m_view->showAreaName();
  130. }
  131. void ViewIface::mergeCell()
  132. {
  133. m_view->mergeCell();
  134. }
  135. void ViewIface::dissociateCell()
  136. {
  137. m_view->dissociateCell();
  138. }
  139. void ViewIface::consolidate()
  140. {
  141. m_view->consolidate();
  142. }
  143. void ViewIface::deleteColumn()
  144. {
  145. m_view->deleteColumn();
  146. }
  147. void ViewIface::insertColumn()
  148. {
  149. m_view->insertColumn();
  150. }
  151. void ViewIface::deleteRow()
  152. {
  153. m_view->deleteRow();
  154. }
  155. void ViewIface::insertRow()
  156. {
  157. m_view->insertRow();
  158. }
  159. void ViewIface::hideRow()
  160. {
  161. m_view->hideRow();
  162. }
  163. void ViewIface::showRow()
  164. {
  165. m_view->showRow();
  166. }
  167. void ViewIface::hideColumn()
  168. {
  169. m_view->hideColumn();
  170. }
  171. void ViewIface::showColumn()
  172. {
  173. m_view->showColumn();
  174. }
  175. void ViewIface::upper()
  176. {
  177. m_view->upper();
  178. }
  179. void ViewIface::lower()
  180. {
  181. m_view->lower();
  182. }
  183. void ViewIface::equalizeColumn()
  184. {
  185. m_view->equalizeColumn();
  186. }
  187. void ViewIface::equalizeRow()
  188. {
  189. m_view->equalizeRow();
  190. }
  191. void ViewIface::clearTextSelection()
  192. {
  193. m_view->clearTextSelection();
  194. }
  195. void ViewIface::clearCommentSelection()
  196. {
  197. m_view->clearCommentSelection();
  198. }
  199. void ViewIface::clearValiditySelection()
  200. {
  201. m_view->clearValiditySelection();
  202. }
  203. void ViewIface::clearConditionalSelection()
  204. {
  205. m_view->clearConditionalSelection();
  206. }
  207. void ViewIface::goalSeek()
  208. {
  209. m_view->goalSeek();
  210. }
  211. void ViewIface::insertFromDatabase()
  212. {
  213. m_view->insertFromDatabase();
  214. }
  215. void ViewIface::insertFromTextfile()
  216. {
  217. m_view->insertFromTextfile();
  218. }
  219. void ViewIface::insertFromClipboard()
  220. {
  221. m_view->insertFromClipboard();
  222. }
  223. void ViewIface::textToColumns()
  224. {
  225. m_view->textToColumns();
  226. }
  227. void ViewIface::copyAsText()
  228. {
  229. m_view->copyAsText();
  230. }
  231. void ViewIface::setSelection(TQRect selection)
  232. {
  233. m_view->selectionInfo()->initialize(selection);//,m_view->activeSheet());
  234. }
  235. TQRect ViewIface::selection()
  236. {
  237. return m_view->selectionInfo()->selection();
  238. }
  239. void ViewIface::setSelectionMoneyFormat( bool b )
  240. {
  241. m_view->moneyFormat(b);
  242. }
  243. void ViewIface::setSelectionPrecision( int delta )
  244. {
  245. m_view->setSelectionPrecision(delta);
  246. }
  247. void ViewIface::setSelectionPercent( bool b )
  248. {
  249. m_view->percent(b);
  250. }
  251. void ViewIface::setSelectionMultiRow( bool enable )
  252. {
  253. m_view->wrapText(enable);
  254. }
  255. void ViewIface::setSelectionSize(int size)
  256. {
  257. m_view->setSelectionFontSize(size);
  258. }
  259. void ViewIface::setSelectionUpper()
  260. {
  261. m_view->upper();
  262. }
  263. void ViewIface::setSelectionLower()
  264. {
  265. m_view->lower();
  266. }
  267. void ViewIface::setSelectionFirstLetterUpper()
  268. {
  269. m_view->firstLetterUpper();
  270. }
  271. void ViewIface::setSelectionVerticalText(bool enable)
  272. {
  273. m_view->verticalText(enable);
  274. }
  275. void ViewIface::setSelectionComment(TQString comment)
  276. {
  277. m_view->setSelectionComment(comment);
  278. }
  279. void ViewIface::setSelectionAngle(int value)
  280. {
  281. m_view->setSelectionAngle(value);
  282. }
  283. void ViewIface::setSelectionTextColor( TQColor txtColor )
  284. {
  285. m_view->setSelectionTextColor(txtColor);
  286. }
  287. void ViewIface::setSelectionBgColor( TQColor bgColor )
  288. {
  289. m_view->setSelectionBackgroundColor(bgColor);
  290. }
  291. void ViewIface::setSelectionBorderColor( TQColor bdColor )
  292. {
  293. m_view->setSelectionBorderColor(bdColor);
  294. }
  295. void ViewIface::deleteSelection()
  296. {
  297. m_view->clearTextSelection();
  298. }
  299. void ViewIface::copySelection()
  300. {
  301. m_view->copySelection();
  302. }
  303. void ViewIface::cutSelection()
  304. {
  305. m_view->cutSelection();
  306. }
  307. void ViewIface::setLeftBorderColor(TQColor color)
  308. {
  309. m_view->setSelectionLeftBorderColor(color);
  310. }
  311. void ViewIface::setTopBorderColor(TQColor color)
  312. {
  313. m_view->setSelectionTopBorderColor(color);
  314. }
  315. void ViewIface::setRightBorderColor(TQColor color)
  316. {
  317. m_view->setSelectionRightBorderColor(color);
  318. }
  319. void ViewIface::setBottomBorderColor(TQColor color)
  320. {
  321. m_view->setSelectionBottomBorderColor(color);
  322. }
  323. void ViewIface::setAllBorderColor(TQColor color)
  324. {
  325. m_view->setSelectionAllBorderColor(color);
  326. }
  327. void ViewIface::setOutlineBorderColor(TQColor color)
  328. {
  329. m_view->setSelectionOutlineBorderColor(color);
  330. }
  331. void ViewIface::removeBorder()
  332. {
  333. m_view->borderRemove();
  334. }
  335. void ViewIface::increaseIndent()
  336. {
  337. m_view->increaseIndent();
  338. }
  339. void ViewIface::decreaseIndent()
  340. {
  341. m_view->increaseIndent();
  342. }
  343. void ViewIface::subtotals()
  344. {
  345. m_view->subtotals();
  346. }
  347. void ViewIface::sortInc()
  348. {
  349. m_view->sortInc();
  350. }
  351. void ViewIface::sortDec()
  352. {
  353. m_view->sortDec();
  354. }
  355. void ViewIface::layoutDlg()
  356. {
  357. m_view->layoutDlg();
  358. }
  359. void ViewIface::increaseFontSize()
  360. {
  361. m_view->increaseFontSize();
  362. }
  363. void ViewIface::decreaseFontSize()
  364. {
  365. m_view->decreaseFontSize();
  366. }