kspread
KSpreadViewIface.cc
00001 /* This file is part of the KDE project 00002 00003 Copyright 2004 Ariya Hidayat <ariya@kde.org> 00004 Copyright 2002-2003 Joseph Wenninger <jowenn@kde.org> 00005 Copyright 2002 John Dailey <dailey@vt.edu> 00006 Copyright 2001-2002 Laurent Montel <montel@kde.org> 00007 Copyright 2001 Philipp Mueller <philipp.mueller@gmx.de> 00008 Copyright 2000 Simon Hausmann <hausmann@kde.org> 00009 Copyright 1999 Torben Weis <weis@kde.org> 00010 00011 This library is free software; you can redistribute it and/or 00012 modify it under the terms of the GNU Library General Public 00013 License as published by the Free Software Foundation; either 00014 version 2 of the License, or (at your option) any later version. 00015 00016 This library is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 Library General Public License for more details. 00020 00021 You should have received a copy of the GNU Library General Public License 00022 along with this library; see the file COPYING.LIB. If not, write to 00023 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00024 * Boston, MA 02110-1301, USA. 00025 */ 00026 00027 #include <dcopclient.h> 00028 #include <dcopref.h> 00029 #include <kapplication.h> 00030 00031 #include "kspread_doc.h" 00032 #include "kspread_map.h" 00033 #include "selection.h" 00034 #include "kspread_sheet.h" 00035 #include "kspread_view.h" 00036 00037 #include "KSpreadViewIface.h" 00038 00039 using namespace KSpread; 00040 00041 /************************************************ 00042 * 00043 * ViewIface 00044 * 00045 ************************************************/ 00046 00047 ViewIface::ViewIface( View* t ) 00048 : KoViewIface( t ) 00049 { 00050 m_view = t; 00051 } 00052 00053 ViewIface::~ViewIface() 00054 { 00055 } 00056 00057 DCOPRef ViewIface::doc() const 00058 { 00059 return DCOPRef( kapp->dcopClient()->appId(), m_view->doc()->dcopObject()->objId() ); 00060 } 00061 00062 DCOPRef ViewIface::map() const 00063 { 00064 return DCOPRef( kapp->dcopClient()->appId(), m_view->doc()->map()->dcopObject()->objId() ); 00065 } 00066 00067 DCOPRef ViewIface::sheet() const 00068 { 00069 return DCOPRef( kapp->dcopClient()->appId(), m_view->activeSheet()->dcopObject()->objId() ); 00070 } 00071 00072 void ViewIface::changeNbOfRecentFiles(int _nb) 00073 { 00074 if(_nb<0) 00075 return; 00076 m_view->changeNbOfRecentFiles(_nb); 00077 } 00078 00079 00080 void ViewIface::hide() 00081 { 00082 m_view->hide(); 00083 } 00084 00085 void ViewIface::show() 00086 { 00087 m_view->show(); 00088 } 00089 00090 void ViewIface::find() 00091 { 00092 m_view->find(); 00093 } 00094 00095 void ViewIface::replace() 00096 { 00097 m_view->replace(); 00098 } 00099 00100 void ViewIface::conditional() 00101 { 00102 m_view->conditional(); 00103 } 00104 00105 void ViewIface::validity() 00106 { 00107 m_view->validity(); 00108 } 00109 00110 void ViewIface::insertSeries() 00111 { 00112 m_view->insertSeries(); 00113 } 00114 00115 void ViewIface::insertHyperlink() 00116 { 00117 m_view->insertHyperlink(); 00118 } 00119 00120 void ViewIface::gotoCell() 00121 { 00122 m_view->gotoCell(); 00123 } 00124 00125 void ViewIface::changeAngle() 00126 { 00127 m_view->changeAngle(); 00128 } 00129 00130 void ViewIface::preference() 00131 { 00132 m_view->preference(); 00133 } 00134 00135 void ViewIface::nextSheet() 00136 { 00137 m_view->nextSheet(); 00138 } 00139 00140 bool ViewIface::showSheet(QString sheetName) 00141 { 00142 return m_view->showSheet(sheetName); 00143 } 00144 00145 void ViewIface::previousSheet() 00146 { 00147 m_view->previousSheet(); 00148 } 00149 00150 void ViewIface::sortList() 00151 { 00152 m_view->sortList(); 00153 } 00154 00155 void ViewIface::setAreaName() 00156 { 00157 m_view->setAreaName(); 00158 } 00159 00160 void ViewIface::showAreaName() 00161 { 00162 m_view->showAreaName(); 00163 } 00164 00165 void ViewIface::mergeCell() 00166 { 00167 m_view->mergeCell(); 00168 } 00169 00170 void ViewIface::dissociateCell() 00171 { 00172 m_view->dissociateCell(); 00173 } 00174 00175 void ViewIface::consolidate() 00176 { 00177 m_view->consolidate(); 00178 } 00179 00180 void ViewIface::deleteColumn() 00181 { 00182 m_view->deleteColumn(); 00183 } 00184 00185 void ViewIface::insertColumn() 00186 { 00187 m_view->insertColumn(); 00188 } 00189 00190 void ViewIface::deleteRow() 00191 { 00192 m_view->deleteRow(); 00193 } 00194 00195 void ViewIface::insertRow() 00196 { 00197 m_view->insertRow(); 00198 } 00199 00200 void ViewIface::hideRow() 00201 { 00202 m_view->hideRow(); 00203 } 00204 00205 void ViewIface::showRow() 00206 { 00207 m_view->showRow(); 00208 } 00209 00210 void ViewIface::hideColumn() 00211 { 00212 m_view->hideColumn(); 00213 } 00214 00215 void ViewIface::showColumn() 00216 { 00217 m_view->showColumn(); 00218 } 00219 00220 void ViewIface::upper() 00221 { 00222 m_view->upper(); 00223 } 00224 00225 void ViewIface::lower() 00226 { 00227 m_view->lower(); 00228 } 00229 00230 void ViewIface::equalizeColumn() 00231 { 00232 m_view->equalizeColumn(); 00233 } 00234 00235 void ViewIface::equalizeRow() 00236 { 00237 m_view->equalizeRow(); 00238 } 00239 00240 void ViewIface::clearTextSelection() 00241 { 00242 m_view->clearTextSelection(); 00243 } 00244 00245 void ViewIface::clearCommentSelection() 00246 { 00247 m_view->clearCommentSelection(); 00248 } 00249 00250 void ViewIface::clearValiditySelection() 00251 { 00252 m_view->clearValiditySelection(); 00253 } 00254 00255 void ViewIface::clearConditionalSelection() 00256 { 00257 m_view->clearConditionalSelection(); 00258 } 00259 00260 void ViewIface::goalSeek() 00261 { 00262 m_view->goalSeek(); 00263 } 00264 00265 void ViewIface::insertFromDatabase() 00266 { 00267 m_view->insertFromDatabase(); 00268 } 00269 00270 void ViewIface::insertFromTextfile() 00271 { 00272 m_view->insertFromTextfile(); 00273 } 00274 00275 void ViewIface::insertFromClipboard() 00276 { 00277 m_view->insertFromClipboard(); 00278 } 00279 00280 void ViewIface::textToColumns() 00281 { 00282 m_view->textToColumns(); 00283 } 00284 00285 void ViewIface::copyAsText() 00286 { 00287 m_view->copyAsText(); 00288 } 00289 00290 void ViewIface::setSelection(QRect selection) 00291 { 00292 m_view->selectionInfo()->initialize(selection);//,m_view->activeSheet()); 00293 } 00294 00295 QRect ViewIface::selection() 00296 { 00297 return m_view->selectionInfo()->selection(); 00298 } 00299 00300 void ViewIface::setSelectionMoneyFormat( bool b ) 00301 { 00302 m_view->moneyFormat(b); 00303 } 00304 00305 void ViewIface::setSelectionPrecision( int delta ) 00306 { 00307 m_view->setSelectionPrecision(delta); 00308 } 00309 00310 void ViewIface::setSelectionPercent( bool b ) 00311 { 00312 m_view->percent(b); 00313 } 00314 00315 void ViewIface::setSelectionMultiRow( bool enable ) 00316 { 00317 m_view->wrapText(enable); 00318 } 00319 00320 void ViewIface::setSelectionSize(int size) 00321 { 00322 m_view->setSelectionFontSize(size); 00323 } 00324 00325 void ViewIface::setSelectionUpper() 00326 { 00327 m_view->upper(); 00328 } 00329 00330 void ViewIface::setSelectionLower() 00331 { 00332 m_view->lower(); 00333 } 00334 00335 void ViewIface::setSelectionFirstLetterUpper() 00336 { 00337 m_view->firstLetterUpper(); 00338 } 00339 00340 void ViewIface::setSelectionVerticalText(bool enable) 00341 { 00342 m_view->verticalText(enable); 00343 } 00344 00345 void ViewIface::setSelectionComment(QString comment) 00346 { 00347 m_view->setSelectionComment(comment); 00348 } 00349 00350 void ViewIface::setSelectionAngle(int value) 00351 { 00352 m_view->setSelectionAngle(value); 00353 } 00354 00355 void ViewIface::setSelectionTextColor( QColor txtColor ) 00356 { 00357 m_view->setSelectionTextColor(txtColor); 00358 } 00359 00360 void ViewIface::setSelectionBgColor( QColor bgColor ) 00361 { 00362 m_view->setSelectionBackgroundColor(bgColor); 00363 } 00364 00365 void ViewIface::setSelectionBorderColor( QColor bdColor ) 00366 { 00367 m_view->setSelectionBorderColor(bdColor); 00368 } 00369 00370 void ViewIface::deleteSelection() 00371 { 00372 m_view->clearTextSelection(); 00373 } 00374 00375 void ViewIface::copySelection() 00376 { 00377 m_view->copySelection(); 00378 } 00379 00380 void ViewIface::cutSelection() 00381 { 00382 m_view->cutSelection(); 00383 } 00384 00385 void ViewIface::setLeftBorderColor(QColor color) 00386 { 00387 m_view->setSelectionLeftBorderColor(color); 00388 } 00389 00390 void ViewIface::setTopBorderColor(QColor color) 00391 { 00392 m_view->setSelectionTopBorderColor(color); 00393 } 00394 00395 void ViewIface::setRightBorderColor(QColor color) 00396 { 00397 m_view->setSelectionRightBorderColor(color); 00398 } 00399 00400 void ViewIface::setBottomBorderColor(QColor color) 00401 { 00402 m_view->setSelectionBottomBorderColor(color); 00403 } 00404 00405 void ViewIface::setAllBorderColor(QColor color) 00406 { 00407 m_view->setSelectionAllBorderColor(color); 00408 } 00409 00410 void ViewIface::setOutlineBorderColor(QColor color) 00411 { 00412 m_view->setSelectionOutlineBorderColor(color); 00413 } 00414 00415 void ViewIface::removeBorder() 00416 { 00417 m_view->borderRemove(); 00418 } 00419 00420 void ViewIface::increaseIndent() 00421 { 00422 m_view->increaseIndent(); 00423 } 00424 00425 void ViewIface::decreaseIndent() 00426 { 00427 m_view->increaseIndent(); 00428 } 00429 00430 void ViewIface::subtotals() 00431 { 00432 m_view->subtotals(); 00433 } 00434 00435 void ViewIface::sortInc() 00436 { 00437 m_view->sortInc(); 00438 } 00439 00440 void ViewIface::sortDec() 00441 { 00442 m_view->sortDec(); 00443 } 00444 00445 void ViewIface::layoutDlg() 00446 { 00447 m_view->layoutDlg(); 00448 } 00449 00450 00451 void ViewIface::increaseFontSize() 00452 { 00453 m_view->increaseFontSize(); 00454 } 00455 00456 void ViewIface::decreaseFontSize() 00457 { 00458 m_view->decreaseFontSize(); 00459 }