KSpreadDocIface.cc
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "KSpreadDocIface.h"
00029 #include <KoDocumentIface.h>
00030
00031 #include "kspread_doc.h"
00032 #include "kspread_map.h"
00033
00034 #include <kapplication.h>
00035 #include <dcopclient.h>
00036 #include <qcolor.h>
00037 #include <kdebug.h>
00038
00039 KSpreadDocIface::KSpreadDocIface( KSpreadDoc* _doc )
00040 : KoDocumentIface( _doc )
00041 {
00042 doc=_doc;
00043 }
00044
00045 DCOPRef KSpreadDocIface::map()
00046 {
00047 return DCOPRef( kapp->dcopClient()->appId(),
00048 doc->map()->dcopObject()->objId() );
00049 }
00050
00051 void KSpreadDocIface::changeDefaultGridPenColor( const QColor &_col)
00052 {
00053 doc->setGridColor(_col);
00054 }
00055
00056 QColor KSpreadDocIface::pageBorderColor() const
00057 {
00058 return doc->pageBorderColor();
00059 }
00060
00061
00062 bool KSpreadDocIface::showCommentIndicator()const
00063 {
00064 return doc->getShowCommentIndicator();
00065 }
00066
00067 bool KSpreadDocIface::showFormulaBar()const
00068 {
00069 return doc->getShowFormulaBar();
00070 }
00071
00072 bool KSpreadDocIface::showStatusBar()const
00073 {
00074 return doc->getShowStatusBar();
00075 }
00076
00077 bool KSpreadDocIface::showTabBar()const
00078 {
00079 return doc->getShowTabBar();
00080 }
00081
00082 void KSpreadDocIface::setShowVerticalScrollBar(bool _show)
00083 {
00084 doc->setShowVerticalScrollBar(_show);
00085 doc->refreshInterface();
00086 }
00087
00088 void KSpreadDocIface::setShowHorizontalScrollBar(bool _show)
00089 {
00090 doc->setShowHorizontalScrollBar(_show);
00091 doc->refreshInterface();
00092 }
00093
00094 void KSpreadDocIface::setShowColHeader(bool _show)
00095 {
00096 doc->setShowColHeader(_show);
00097 doc->refreshInterface();
00098 }
00099
00100 void KSpreadDocIface::setShowRowHeader(bool _show)
00101 {
00102 doc->setShowRowHeader(_show);
00103 doc->refreshInterface();
00104 }
00105
00106 void KSpreadDocIface::setShowTabBar(bool _show)
00107 {
00108 doc->setShowTabBar(_show);
00109 doc->refreshInterface();
00110 }
00111
00112 void KSpreadDocIface::setShowCommentIndicator(bool _show)
00113 {
00114 doc->setShowCommentIndicator(_show);
00115 doc->refreshInterface();
00116 }
00117
00118 void KSpreadDocIface::changePageBorderColor( const QColor & _color)
00119 {
00120 doc->changePageBorderColor( _color);
00121 doc->refreshInterface();
00122 }
00123
00124 void KSpreadDocIface::addIgnoreWordAll( const QString &word)
00125 {
00126 doc->addIgnoreWordAll( word );
00127 }
00128
00129 void KSpreadDocIface::clearIgnoreWordAll( )
00130 {
00131 doc->clearIgnoreWordAll();
00132 }
00133
00134 QStringList KSpreadDocIface::spellListIgnoreAll() const
00135 {
00136 return doc->spellListIgnoreAll();
00137 }
00138
00139 void KSpreadDocIface::addStringCompletion(const QString & stringCompletion)
00140 {
00141 doc->addStringCompletion( stringCompletion );
00142 }
00143
00144 int KSpreadDocIface::zoom() const
00145 {
00146 return doc->zoom();
00147 }
00148
00149
00150 QString KSpreadDocIface::moveToValue()const
00151 {
00152 switch(doc->getMoveToValue())
00153 {
00154 case KSpread::Bottom:
00155 return QString("bottom");
00156 break;
00157 case KSpread::Left:
00158 return QString("left");
00159 break;
00160 case KSpread::Top:
00161 return QString("top");
00162 break;
00163 case KSpread::Right:
00164 return QString("right");
00165 break;
00166 case KSpread::BottomFirst:
00167 return QString("bottomFirst");
00168 break;
00169 }
00170 return QString::null;
00171 }
00172
00173 void KSpreadDocIface::setMoveToValue(const QString & move)
00174 {
00175 if ( move.lower()=="bottom" )
00176 doc->setMoveToValue(KSpread::Bottom);
00177 else if ( move.lower()=="top" )
00178 doc->setMoveToValue(KSpread::Top);
00179 else if ( move.lower()=="left" )
00180 doc->setMoveToValue(KSpread::Left);
00181 else if ( move.lower()=="right" )
00182 doc->setMoveToValue(KSpread::Right);
00183 else if ( move.lower()=="bottomfirst" )
00184 doc->setMoveToValue(KSpread::BottomFirst);
00185 }
00186
00187 void KSpreadDocIface::setTypeOfCalc( const QString & calc )
00188 {
00189 if ( calc.lower()=="sum")
00190 doc->setTypeOfCalc(SumOfNumber );
00191 else if ( calc.lower()=="min")
00192 doc->setTypeOfCalc( Min );
00193 else if ( calc.lower()=="max")
00194 doc->setTypeOfCalc(Max );
00195 else if ( calc.lower()=="average")
00196 doc->setTypeOfCalc(Average );
00197 else if ( calc.lower()=="count")
00198 doc->setTypeOfCalc(Count );
00199 else if ( calc.lower()=="none")
00200 doc->setTypeOfCalc(NoneCalc );
00201 else
00202 kdDebug()<<"Error in setTypeOfCalc( const QString & calc ) :"<<calc<<endl;
00203 doc->refreshInterface();
00204 }
00205
00206 QString KSpreadDocIface::typeOfCalc() const
00207 {
00208 switch( doc->getTypeOfCalc() )
00209 {
00210 case SumOfNumber:
00211 return QString("sum");
00212 break;
00213 case Min:
00214 return QString("min");
00215 break;
00216 case Max:
00217 return QString("max");
00218 break;
00219 case Average:
00220 return QString("average");
00221 break;
00222 case Count:
00223 return QString("count");
00224 break;
00225 case NoneCalc:
00226 default:
00227 return QString("none");
00228 break;
00229 }
00230 }
00231
This file is part of the documentation for kspread Library Version 1.4.2.