kspread Library API Documentation

KSpreadLayoutIface.cc

00001 /* This file is part of the KDE project
00002    
00003    Copyright 2002 Laurent Montel <montel@kde.org>
00004    Copyright 2002 Philipp Mueller <philipp.mueller@gmx.de>
00005    Copyright 2002 John Dailey <dailey@vt.edu>
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License as published by the Free Software Foundation; either
00010    version 2 of the License, or (at your option) any later version.
00011 
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020    Boston, MA 02111-1307, USA.
00021 */
00022 
00023 #include "KSpreadLayoutIface.h"
00024 #include <qbrush.h>
00025 #include "kspread_format.h"
00026 
00027 KSpreadLayoutIface::KSpreadLayoutIface(KSpreadFormat *_layout)
00028 {
00029     layout=_layout;
00030 }
00031 
00032 void KSpreadLayoutIface::setBgColor(const QString& _c)
00033 {
00034     QColor c(_c);
00035     layout->setBgColor(c);
00036 }
00037 
00038 void KSpreadLayoutIface::setBgColor(int r,int g,int b)
00039 {
00040     QColor c(r,g,b);
00041     layout->setBgColor(c);
00042 }
00043 
00044 
00045 void KSpreadLayoutIface::setTextColor(int r,int g,int b)
00046 {
00047     QColor c(r,g,b);
00048     layout->setTextColor(c);
00049 }
00050 
00051 void KSpreadLayoutIface::setTextColor(const QString& _c)
00052 {
00053     QColor c(_c);
00054     layout->setTextColor(c);
00055 }
00056 
00057 void KSpreadLayoutIface::setAngle(int angle)
00058 {
00059     layout->setAngle(angle);
00060 }
00061 
00062 void KSpreadLayoutIface::setVerticalText(bool _vertical)
00063 {
00064     layout->setVerticalText(_vertical);
00065 }
00066 
00067 void KSpreadLayoutIface::setMultiRow(bool _multi)
00068 {
00069     layout->setMultiRow( _multi );
00070 }
00071 
00072 void KSpreadLayoutIface::setAlign( const QString& _Align )
00073 {
00074     KSpreadFormat::Align Align;
00075     if(_Align=="Left")
00076         Align=KSpreadFormat::Left;
00077     else if(_Align=="Right")
00078         Align=KSpreadFormat::Right;
00079     else if(_Align=="Center")
00080         Align=KSpreadFormat::Center;
00081     else
00082         Align=KSpreadFormat::Undefined;
00083     layout->setAlign( Align);
00084 }
00085 
00086 void KSpreadLayoutIface::setAlignY( const QString& _AlignY )
00087 {
00088     KSpreadFormat::AlignY AlignY;
00089     if(_AlignY=="Top")
00090         AlignY=KSpreadFormat::Top;
00091     else if(_AlignY=="Middle")
00092         AlignY=KSpreadFormat::Middle;
00093     else if(_AlignY=="Bottom")
00094         AlignY=KSpreadFormat::Bottom;
00095     else
00096         AlignY=KSpreadFormat::Middle;
00097     layout->setAlignY( AlignY);
00098 }
00099 
00100 void KSpreadLayoutIface::setPostfix(const QString &_postfix)
00101 {
00102     layout->setPostfix( _postfix );
00103 }
00104 
00105 void KSpreadLayoutIface::setPrefix(const QString &_prefix)
00106 {
00107     layout->setPrefix( _prefix );
00108 }
00109 
00110 void KSpreadLayoutIface::setFormatType(const QString &_formatType)
00111 {
00112     FormatType format;
00113     layout->setPrecision(2);
00114     if (_formatType=="Generic")
00115         format = Generic_format;
00116     else if(_formatType=="Number")
00117         format=Number_format;
00118     else if(_formatType=="Money")
00119         format=Money_format;
00120     else if(_formatType=="Percentage")
00121         format=Percentage_format;
00122     else if(_formatType=="Scientific")
00123         format=Scientific_format;
00124     else if(_formatType=="ShortDate")
00125         format=ShortDate_format;
00126     else if(_formatType=="TextDate")
00127         format=TextDate_format;
00128     else if(_formatType=="Time")
00129         format=Time_format;
00130     else if(_formatType=="SecondeTime")
00131         format=SecondeTime_format;
00132     else if(_formatType=="fraction_half")
00133         format=fraction_half;
00134     else if(_formatType=="fraction_quarter")
00135         format=fraction_quarter;
00136     else if(_formatType=="fraction_eighth")
00137         format=fraction_eighth;
00138     else if(_formatType=="fraction_sixteenth")
00139         format=fraction_sixteenth;
00140     else if(_formatType=="fraction_tenth")
00141         format=fraction_tenth;
00142     else if(_formatType=="fraction_hundredth")
00143         format=fraction_hundredth;
00144     else if(_formatType=="fraction_one_digit")
00145         format=fraction_one_digit;
00146     else if(_formatType=="fraction_two_digits")
00147         format=fraction_two_digits;
00148     else if(_formatType=="fraction_three_digits")
00149         format=fraction_three_digits;
00150     else
00151         format=Generic_format;
00152     layout->setFormatType( format);
00153 }
00154 
00155 
00156 void KSpreadLayoutIface::setPrecision(int _p)
00157 {
00158     layout->setPrecision( _p );
00159 }
00160 
00161 void KSpreadLayoutIface::setTextFontBold(bool _b)
00162 {
00163     layout->setTextFontBold( _b );
00164 }
00165 
00166 void KSpreadLayoutIface::setTextFontItalic(bool _b)
00167 {
00168     layout->setTextFontItalic( _b );
00169 }
00170 
00171 void KSpreadLayoutIface::setTextFontUnderline(bool _b)
00172 {
00173     layout->setTextFontUnderline( _b );
00174 }
00175 
00176 void KSpreadLayoutIface::setTextFontStrike(bool _b)
00177 {
00178     layout->setTextFontStrike( _b );
00179 }
00180 
00181 void KSpreadLayoutIface::setTextFontSize( int _size )
00182 {
00183     layout->setTextFontSize( _size );
00184 }
00185 
00186 void KSpreadLayoutIface::setTextFontFamily( const QString& _font )
00187 {
00188     layout->setTextFontFamily( _font );
00189 }
00190 
00191 
00192 //border left
00193 void KSpreadLayoutIface::setLeftBorderStyle( const QString& _style )
00194 {
00195     if(_style=="DotLine")
00196         layout->setLeftBorderStyle(Qt::DotLine);
00197     else if(_style=="DashLine")
00198         layout->setLeftBorderStyle(Qt::DashLine);
00199     else if(_style=="DashDotLine")
00200         layout->setLeftBorderStyle(Qt::DashDotLine);
00201     else if(_style=="DashDotDotLine")
00202         layout->setLeftBorderStyle(Qt::DashDotDotLine);
00203     else if(_style=="SolidLine")
00204         layout->setLeftBorderStyle(Qt::SolidLine);
00205     else
00206         layout->setLeftBorderStyle(Qt::SolidLine);
00207 }
00208 
00209 void KSpreadLayoutIface::setLeftBorderColor(const QString& _c)
00210 {
00211     QColor c(_c);
00212     layout->setLeftBorderColor(c );
00213 }
00214 
00215 void KSpreadLayoutIface::setLeftBorderColor(int r,int g,int b)
00216 {
00217     QColor c(r,g,b);
00218     layout->setLeftBorderColor(c );
00219 }
00220 
00221 void KSpreadLayoutIface::setLeftBorderWidth( int _size )
00222 {
00223     layout->setLeftBorderWidth( _size );
00224 }
00225 
00226 
00227 //border right
00228 void KSpreadLayoutIface::setRightBorderStyle( const QString& _style )
00229 {
00230     if(_style=="DotLine")
00231         layout->setRightBorderStyle(Qt::DotLine);
00232     else if(_style=="DashLine")
00233         layout->setRightBorderStyle(Qt::DashLine);
00234     else if(_style=="DashDotLine")
00235         layout->setRightBorderStyle(Qt::DashDotLine);
00236     else if(_style=="DashDotDotLine")
00237         layout->setRightBorderStyle(Qt::DashDotDotLine);
00238     else if(_style=="SolidLine")
00239         layout->setRightBorderStyle(Qt::SolidLine);
00240     else
00241         layout->setRightBorderStyle(Qt::SolidLine);
00242 }
00243 
00244 void KSpreadLayoutIface::setRightBorderColor(const QString& _c)
00245 {
00246     QColor c(_c);
00247     layout->setRightBorderColor(c );
00248 }
00249 
00250 void KSpreadLayoutIface::setRightBorderColor(int r,int g,int b)
00251 {
00252     QColor c(r,g,b);
00253     layout->setRightBorderColor(c );
00254 }
00255 
00256 void KSpreadLayoutIface::setRightBorderWidth( int _size )
00257 {
00258     layout->setRightBorderWidth( _size );
00259 }
00260 
00261 
00262 //border top
00263 void KSpreadLayoutIface::setTopBorderStyle( const QString& _style )
00264 {
00265     if(_style=="DotLine")
00266         layout->setTopBorderStyle(Qt::DotLine);
00267     else if(_style=="DashLine")
00268         layout->setTopBorderStyle(Qt::DashLine);
00269     else if(_style=="DashDotLine")
00270         layout->setTopBorderStyle(Qt::DashDotLine);
00271     else if(_style=="DashDotDotLine")
00272         layout->setTopBorderStyle(Qt::DashDotDotLine);
00273     else if(_style=="SolidLine")
00274         layout->setTopBorderStyle(Qt::SolidLine);
00275     else
00276         layout->setTopBorderStyle(Qt::SolidLine);
00277 }
00278 
00279 void KSpreadLayoutIface::setTopBorderColor(const QString& _c)
00280 {
00281     QColor c(_c);
00282     layout->setTopBorderColor(c );
00283 }
00284 
00285 void KSpreadLayoutIface::setTopBorderColor(int r,int g,int b)
00286 {
00287     QColor c(r,g,b);
00288     layout->setTopBorderColor(c );
00289 }
00290 
00291 void KSpreadLayoutIface::setTopBorderWidth( int _size )
00292 {
00293     layout->setTopBorderWidth( _size );
00294 }
00295 
00296 
00297 //border bottom
00298 void KSpreadLayoutIface::setBottomBorderStyle( const QString& _style )
00299 {
00300     if(_style=="DotLine")
00301         layout->setBottomBorderStyle(Qt::DotLine);
00302     else if(_style=="DashLine")
00303         layout->setBottomBorderStyle(Qt::DashLine);
00304     else if(_style=="DashDotLine")
00305         layout->setBottomBorderStyle(Qt::DashDotLine);
00306     else if(_style=="DashDotDotLine")
00307         layout->setBottomBorderStyle(Qt::DashDotDotLine);
00308     else if(_style=="SolidLine")
00309         layout->setBottomBorderStyle(Qt::SolidLine);
00310     else
00311         layout->setBottomBorderStyle(Qt::SolidLine);
00312 }
00313 
00314 void KSpreadLayoutIface::setBottomBorderColor(const QString& _c)
00315 {
00316     QColor c(_c);
00317     layout->setBottomBorderColor(c );
00318 }
00319 void KSpreadLayoutIface::setBottomBorderColor(int r,int g,int b)
00320 {
00321     QColor c(r,g,b);
00322     layout->setBottomBorderColor(c );
00323 }
00324 
00325 void KSpreadLayoutIface::setBottomBorderWidth( int _size )
00326 {
00327     layout->setBottomBorderWidth( _size );
00328 }
00329 
00330 
00331 //fall back diagonal
00332 void KSpreadLayoutIface::setFallDiagonalStyle( const QString& _style )
00333 {
00334     if(_style=="DotLine")
00335         layout->setFallDiagonalStyle(Qt::DotLine);
00336     else if(_style=="DashLine")
00337         layout->setFallDiagonalStyle(Qt::DashLine);
00338     else if(_style=="DashDotLine")
00339         layout->setFallDiagonalStyle(Qt::DashDotLine);
00340     else if(_style=="DashDotDotLine")
00341         layout->setFallDiagonalStyle(Qt::DashDotDotLine);
00342     else if(_style=="SolidLine")
00343         layout->setFallDiagonalStyle(Qt::SolidLine);
00344     else
00345         layout->setFallDiagonalStyle(Qt::SolidLine);
00346 }
00347 
00348 void KSpreadLayoutIface::setFallDiagonalColor(const QString& _c)
00349 {
00350     QColor c(_c);
00351     layout->setFallDiagonalColor(c );
00352 }
00353 void KSpreadLayoutIface::setFallDiagonalColor(int r,int g,int b)
00354 {
00355     QColor c(r,g,b);
00356     layout->setFallDiagonalColor(c );
00357 }
00358 
00359 void KSpreadLayoutIface::setFallDiagonalWidth( int _size )
00360 {
00361     layout->setFallDiagonalWidth( _size );
00362 }
00363 
00364 
00365 
00366 //GoUpDiagonal
00367 void KSpreadLayoutIface::setGoUpDiagonalStyle( const QString& _style )
00368 {
00369     if(_style=="DotLine")
00370         layout->setGoUpDiagonalStyle(Qt::DotLine);
00371     else if(_style=="DashLine")
00372         layout->setGoUpDiagonalStyle(Qt::DashLine);
00373     else if(_style=="DashDotLine")
00374         layout->setGoUpDiagonalStyle(Qt::DashDotLine);
00375     else if(_style=="DashDotDotLine")
00376         layout->setGoUpDiagonalStyle(Qt::DashDotDotLine);
00377     else if(_style=="SolidLine")
00378         layout->setGoUpDiagonalStyle(Qt::SolidLine);
00379     else
00380         layout->setGoUpDiagonalStyle(Qt::SolidLine);
00381 }
00382 
00383 void KSpreadLayoutIface::setGoUpDiagonalColor(const QString& _c)
00384 {
00385     QColor c(_c);
00386     layout->setGoUpDiagonalColor(c );
00387 }
00388 void KSpreadLayoutIface::setGoUpDiagonalColor(int r,int g,int b)
00389 {
00390     QColor c(r,g,b);
00391     layout->setGoUpDiagonalColor(c );
00392 }
00393 
00394 void KSpreadLayoutIface::setGoUpDiagonalWidth( int _size )
00395 {
00396     layout->setGoUpDiagonalWidth( _size );
00397 }
00398 
00399 
00400 void KSpreadLayoutIface::setIndent( double indent )
00401 {
00402     if( indent >= 0.0 )
00403         layout->setIndent( indent );
00404     else
00405         layout->setIndent( 0.0 );
00406 }
00407 
00408 
00409 void KSpreadLayoutIface::setDontPrintText ( bool _print)
00410 {
00411     layout->setDontPrintText ( _print);
00412 }
00413 
KDE Logo
This file is part of the documentation for kspread Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:43:38 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003