kspread
KSpreadDocIface.cc00001
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 using namespace KSpread;
00040
00041 DocIface::DocIface( Doc* _doc )
00042 : KoDocumentIface( _doc )
00043 {
00044 doc=_doc;
00045 }
00046
00047 DCOPRef DocIface::map()
00048 {
00049 return DCOPRef( kapp->dcopClient()->appId(),
00050 doc->map()->dcopObject()->objId() );
00051 }
00052
00053 void DocIface::changeDefaultGridPenColor( const QColor &_col)
00054 {
00055 doc->setGridColor(_col);
00056 }
00057
00058 QColor DocIface::pageBorderColor() const
00059 {
00060 return doc->pageBorderColor();
00061 }
00062
00063 bool DocIface::showFormulaBar()const
00064 {
00065 return doc->getShowFormulaBar();
00066 }
00067
00068 bool DocIface::showStatusBar()const
00069 {
00070 return doc->getShowStatusBar();
00071 }
00072
00073 bool DocIface::showTabBar()const
00074 {
00075 return doc->getShowTabBar();
00076 }
00077
00078 void DocIface::setShowVerticalScrollBar(bool _show)
00079 {
00080 doc->setShowVerticalScrollBar(_show);
00081 doc->refreshInterface();
00082 }
00083
00084 void DocIface::setShowHorizontalScrollBar(bool _show)
00085 {
00086 doc->setShowHorizontalScrollBar(_show);
00087 doc->refreshInterface();
00088 }
00089
00090 void DocIface::setShowColHeader(bool _show)
00091 {
00092 doc->setShowColHeader(_show);
00093 doc->refreshInterface();
00094 }
00095
00096 void DocIface::setShowRowHeader(bool _show)
00097 {
00098 doc->setShowRowHeader(_show);
00099 doc->refreshInterface();
00100 }
00101
00102 void DocIface::setShowTabBar(bool _show)
00103 {
00104 doc->setShowTabBar(_show);
00105 doc->refreshInterface();
00106 }
00107
00108 void DocIface::changePageBorderColor( const QColor & _color)
00109 {
00110 doc->changePageBorderColor( _color);
00111 doc->refreshInterface();
00112 }
00113
00114 void DocIface::addIgnoreWordAll( const QString &word)
00115 {
00116 doc->addIgnoreWordAll( word );
00117 }
00118
00119 void DocIface::clearIgnoreWordAll( )
00120 {
00121 doc->clearIgnoreWordAll();
00122 }
00123
00124 QStringList DocIface::spellListIgnoreAll() const
00125 {
00126 return doc->spellListIgnoreAll();
00127 }
00128
00129 void DocIface::addStringCompletion(const QString & stringCompletion)
00130 {
00131 doc->addStringCompletion( stringCompletion );
00132 }
00133
00134 int DocIface::zoom() const
00135 {
00136 return doc->zoom();
00137 }
00138
00139
00140 QString DocIface::moveToValue()const
00141 {
00142 switch(doc->getMoveToValue())
00143 {
00144 case Bottom:
00145 return QString("bottom");
00146 break;
00147 case Left:
00148 return QString("left");
00149 break;
00150 case Top:
00151 return QString("top");
00152 break;
00153 case Right:
00154 return QString("right");
00155 break;
00156 case BottomFirst:
00157 return QString("bottomFirst");
00158 break;
00159 }
00160 return QString::null;
00161 }
00162
00163 void DocIface::setMoveToValue(const QString & move)
00164 {
00165 if ( move.lower()=="bottom" )
00166 doc->setMoveToValue(Bottom);
00167 else if ( move.lower()=="top" )
00168 doc->setMoveToValue(Top);
00169 else if ( move.lower()=="left" )
00170 doc->setMoveToValue(Left);
00171 else if ( move.lower()=="right" )
00172 doc->setMoveToValue(Right);
00173 else if ( move.lower()=="bottomfirst" )
00174 doc->setMoveToValue(BottomFirst);
00175 }
00176
00177 void DocIface::setTypeOfCalc( const QString & calc )
00178 {
00179 if ( calc.lower()=="sum")
00180 doc->setTypeOfCalc(SumOfNumber );
00181 else if ( calc.lower()=="min")
00182 doc->setTypeOfCalc( Min );
00183 else if ( calc.lower()=="max")
00184 doc->setTypeOfCalc(Max );
00185 else if ( calc.lower()=="average")
00186 doc->setTypeOfCalc(Average );
00187 else if ( calc.lower()=="count")
00188 doc->setTypeOfCalc(Count );
00189 else if ( calc.lower()=="none")
00190 doc->setTypeOfCalc(NoneCalc );
00191 else
00192 kdDebug()<<"Error in setTypeOfCalc( const QString & calc ) :"<<calc<<endl;
00193 doc->refreshInterface();
00194 }
00195
00196 QString DocIface::typeOfCalc() const
00197 {
00198 switch( doc->getTypeOfCalc() )
00199 {
00200 case SumOfNumber:
00201 return QString("sum");
00202 break;
00203 case Min:
00204 return QString("min");
00205 break;
00206 case Max:
00207 return QString("max");
00208 break;
00209 case Average:
00210 return QString("average");
00211 break;
00212 case Count:
00213 return QString("count");
00214 break;
00215 case NoneCalc:
00216 default:
00217 return QString("none");
00218 break;
00219 }
00220 }
00221
|