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.
416 lines
10 KiB
416 lines
10 KiB
15 years ago
|
/* This file is part of the KDE project
|
||
|
|
||
|
Copyright 2002 Laurent Montel <montel@kde.org>
|
||
|
Copyright 2002 Philipp Mueller <philipp.mueller@gmx.de>
|
||
|
Copyright 2002 John Dailey <dailey@vt.edu>
|
||
|
|
||
|
This library is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU Library General Public
|
||
|
License as published by the Free Software Foundation; either
|
||
|
version 2 of the License, or (at your option) any later version.
|
||
|
|
||
|
This library is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
Library General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
* Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
#include "KSpreadLayoutIface.h"
|
||
13 years ago
|
#include <tqbrush.h>
|
||
15 years ago
|
#include "kspread_format.h"
|
||
|
|
||
|
using namespace KSpread;
|
||
|
|
||
|
LayoutIface::LayoutIface(Format *_layout)
|
||
|
{
|
||
13 years ago
|
layout=_layout;
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void LayoutIface::setBgColor(const TQString& _c)
|
||
15 years ago
|
{
|
||
14 years ago
|
TQColor c(_c);
|
||
13 years ago
|
layout->setBgColor(c);
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setBgColor(int r,int g,int b)
|
||
|
{
|
||
14 years ago
|
TQColor c(r,g,b);
|
||
13 years ago
|
layout->setBgColor(c);
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
void LayoutIface::setTextColor(int r,int g,int b)
|
||
|
{
|
||
14 years ago
|
TQColor c(r,g,b);
|
||
13 years ago
|
layout->setTextColor(c);
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void LayoutIface::setTextColor(const TQString& _c)
|
||
15 years ago
|
{
|
||
14 years ago
|
TQColor c(_c);
|
||
13 years ago
|
layout->setTextColor(c);
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setAngle(int angle)
|
||
|
{
|
||
13 years ago
|
layout->setAngle(angle);
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setVerticalText(bool _vertical)
|
||
|
{
|
||
13 years ago
|
layout->setVerticalText(_vertical);
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setMultiRow(bool _multi)
|
||
|
{
|
||
13 years ago
|
layout->setMultiRow( _multi );
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void LayoutIface::setAlign( const TQString& _Align )
|
||
15 years ago
|
{
|
||
|
Format::Align Align;
|
||
|
if(_Align=="Left")
|
||
|
Align=Format::Left;
|
||
|
else if(_Align=="Right")
|
||
|
Align=Format::Right;
|
||
|
else if(_Align=="Center")
|
||
|
Align=Format::Center;
|
||
|
else
|
||
|
Align=Format::Undefined;
|
||
13 years ago
|
layout->setAlign( Align);
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void LayoutIface::setAlignY( const TQString& _AlignY )
|
||
15 years ago
|
{
|
||
|
Format::AlignY AlignY;
|
||
|
if(_AlignY=="Top")
|
||
|
AlignY=Format::Top;
|
||
|
else if(_AlignY=="Middle")
|
||
|
AlignY=Format::Middle;
|
||
|
else if(_AlignY=="Bottom")
|
||
|
AlignY=Format::Bottom;
|
||
|
else
|
||
|
AlignY=Format::Middle;
|
||
13 years ago
|
layout->setAlignY( AlignY);
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void LayoutIface::setPostfix(const TQString &_postfix)
|
||
15 years ago
|
{
|
||
13 years ago
|
layout->setPostfix( _postfix );
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void LayoutIface::setPrefix(const TQString &_prefix)
|
||
15 years ago
|
{
|
||
13 years ago
|
layout->setPrefix( _prefix );
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void LayoutIface::setFormatType(const TQString &_formatType)
|
||
15 years ago
|
{
|
||
|
FormatType format;
|
||
13 years ago
|
layout->setPrecision(2);
|
||
15 years ago
|
if (_formatType=="Generic")
|
||
|
format = Generic_format;
|
||
|
else if(_formatType=="Number")
|
||
|
format=Number_format;
|
||
|
else if(_formatType=="Money")
|
||
|
format=Money_format;
|
||
|
else if(_formatType=="Percentage")
|
||
|
format=Percentage_format;
|
||
|
else if(_formatType=="Scientific")
|
||
|
format=Scientific_format;
|
||
|
else if(_formatType=="ShortDate")
|
||
|
format=ShortDate_format;
|
||
|
else if(_formatType=="TextDate")
|
||
|
format=TextDate_format;
|
||
|
else if(_formatType=="Time")
|
||
|
format=Time_format;
|
||
|
else if(_formatType=="SecondeTime")
|
||
|
format=SecondeTime_format;
|
||
|
else if(_formatType=="fraction_half")
|
||
|
format=fraction_half;
|
||
|
else if(_formatType=="fraction_quarter")
|
||
|
format=fraction_quarter;
|
||
|
else if(_formatType=="fraction_eighth")
|
||
|
format=fraction_eighth;
|
||
|
else if(_formatType=="fraction_sixteenth")
|
||
|
format=fraction_sixteenth;
|
||
|
else if(_formatType=="fraction_tenth")
|
||
|
format=fraction_tenth;
|
||
|
else if(_formatType=="fraction_hundredth")
|
||
|
format=fraction_hundredth;
|
||
|
else if(_formatType=="fraction_one_digit")
|
||
|
format=fraction_one_digit;
|
||
|
else if(_formatType=="fraction_two_digits")
|
||
|
format=fraction_two_digits;
|
||
|
else if(_formatType=="fraction_three_digits")
|
||
|
format=fraction_three_digits;
|
||
|
else
|
||
|
format=Generic_format;
|
||
13 years ago
|
layout->setFormatType( format);
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
void LayoutIface::setPrecision(int _p)
|
||
|
{
|
||
13 years ago
|
layout->setPrecision( _p );
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setTextFontBold(bool _b)
|
||
|
{
|
||
13 years ago
|
layout->setTextFontBold( _b );
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setTextFontItalic(bool _b)
|
||
|
{
|
||
13 years ago
|
layout->setTextFontItalic( _b );
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setTextFontUnderline(bool _b)
|
||
|
{
|
||
13 years ago
|
layout->setTextFontUnderline( _b );
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setTextFontStrike(bool _b)
|
||
|
{
|
||
13 years ago
|
layout->setTextFontStrike( _b );
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setTextFontSize( int _size )
|
||
|
{
|
||
13 years ago
|
layout->setTextFontSize( _size );
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void LayoutIface::setTextFontFamily( const TQString& _font )
|
||
15 years ago
|
{
|
||
13 years ago
|
layout->setTextFontFamily( _font );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
//border left
|
||
14 years ago
|
void LayoutIface::setLeftBorderStyle( const TQString& _style )
|
||
15 years ago
|
{
|
||
|
if(_style=="DotLine")
|
||
13 years ago
|
layout->setLeftBorderStyle(Qt::DotLine);
|
||
15 years ago
|
else if(_style=="DashLine")
|
||
13 years ago
|
layout->setLeftBorderStyle(Qt::DashLine);
|
||
15 years ago
|
else if(_style=="DashDotLine")
|
||
13 years ago
|
layout->setLeftBorderStyle(Qt::DashDotLine);
|
||
15 years ago
|
else if(_style=="DashDotDotLine")
|
||
13 years ago
|
layout->setLeftBorderStyle(Qt::DashDotDotLine);
|
||
15 years ago
|
else if(_style=="SolidLine")
|
||
13 years ago
|
layout->setLeftBorderStyle(Qt::SolidLine);
|
||
15 years ago
|
else
|
||
13 years ago
|
layout->setLeftBorderStyle(Qt::SolidLine);
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void LayoutIface::setLeftBorderColor(const TQString& _c)
|
||
15 years ago
|
{
|
||
14 years ago
|
TQColor c(_c);
|
||
13 years ago
|
layout->setLeftBorderColor(c );
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setLeftBorderColor(int r,int g,int b)
|
||
|
{
|
||
14 years ago
|
TQColor c(r,g,b);
|
||
13 years ago
|
layout->setLeftBorderColor(c );
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setLeftBorderWidth( int _size )
|
||
|
{
|
||
13 years ago
|
layout->setLeftBorderWidth( _size );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
//border right
|
||
14 years ago
|
void LayoutIface::setRightBorderStyle( const TQString& _style )
|
||
15 years ago
|
{
|
||
|
if(_style=="DotLine")
|
||
13 years ago
|
layout->setRightBorderStyle(Qt::DotLine);
|
||
15 years ago
|
else if(_style=="DashLine")
|
||
13 years ago
|
layout->setRightBorderStyle(Qt::DashLine);
|
||
15 years ago
|
else if(_style=="DashDotLine")
|
||
13 years ago
|
layout->setRightBorderStyle(Qt::DashDotLine);
|
||
15 years ago
|
else if(_style=="DashDotDotLine")
|
||
13 years ago
|
layout->setRightBorderStyle(Qt::DashDotDotLine);
|
||
15 years ago
|
else if(_style=="SolidLine")
|
||
13 years ago
|
layout->setRightBorderStyle(Qt::SolidLine);
|
||
15 years ago
|
else
|
||
13 years ago
|
layout->setRightBorderStyle(Qt::SolidLine);
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void LayoutIface::setRightBorderColor(const TQString& _c)
|
||
15 years ago
|
{
|
||
14 years ago
|
TQColor c(_c);
|
||
13 years ago
|
layout->setRightBorderColor(c );
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setRightBorderColor(int r,int g,int b)
|
||
|
{
|
||
14 years ago
|
TQColor c(r,g,b);
|
||
13 years ago
|
layout->setRightBorderColor(c );
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setRightBorderWidth( int _size )
|
||
|
{
|
||
13 years ago
|
layout->setRightBorderWidth( _size );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
//border top
|
||
14 years ago
|
void LayoutIface::setTopBorderStyle( const TQString& _style )
|
||
15 years ago
|
{
|
||
|
if(_style=="DotLine")
|
||
13 years ago
|
layout->setTopBorderStyle(Qt::DotLine);
|
||
15 years ago
|
else if(_style=="DashLine")
|
||
13 years ago
|
layout->setTopBorderStyle(Qt::DashLine);
|
||
15 years ago
|
else if(_style=="DashDotLine")
|
||
13 years ago
|
layout->setTopBorderStyle(Qt::DashDotLine);
|
||
15 years ago
|
else if(_style=="DashDotDotLine")
|
||
13 years ago
|
layout->setTopBorderStyle(Qt::DashDotDotLine);
|
||
15 years ago
|
else if(_style=="SolidLine")
|
||
13 years ago
|
layout->setTopBorderStyle(Qt::SolidLine);
|
||
15 years ago
|
else
|
||
13 years ago
|
layout->setTopBorderStyle(Qt::SolidLine);
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void LayoutIface::setTopBorderColor(const TQString& _c)
|
||
15 years ago
|
{
|
||
14 years ago
|
TQColor c(_c);
|
||
13 years ago
|
layout->setTopBorderColor(c );
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setTopBorderColor(int r,int g,int b)
|
||
|
{
|
||
14 years ago
|
TQColor c(r,g,b);
|
||
13 years ago
|
layout->setTopBorderColor(c );
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setTopBorderWidth( int _size )
|
||
|
{
|
||
13 years ago
|
layout->setTopBorderWidth( _size );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
//border bottom
|
||
14 years ago
|
void LayoutIface::setBottomBorderStyle( const TQString& _style )
|
||
15 years ago
|
{
|
||
|
if(_style=="DotLine")
|
||
13 years ago
|
layout->setBottomBorderStyle(Qt::DotLine);
|
||
15 years ago
|
else if(_style=="DashLine")
|
||
13 years ago
|
layout->setBottomBorderStyle(Qt::DashLine);
|
||
15 years ago
|
else if(_style=="DashDotLine")
|
||
13 years ago
|
layout->setBottomBorderStyle(Qt::DashDotLine);
|
||
15 years ago
|
else if(_style=="DashDotDotLine")
|
||
13 years ago
|
layout->setBottomBorderStyle(Qt::DashDotDotLine);
|
||
15 years ago
|
else if(_style=="SolidLine")
|
||
13 years ago
|
layout->setBottomBorderStyle(Qt::SolidLine);
|
||
15 years ago
|
else
|
||
13 years ago
|
layout->setBottomBorderStyle(Qt::SolidLine);
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void LayoutIface::setBottomBorderColor(const TQString& _c)
|
||
15 years ago
|
{
|
||
14 years ago
|
TQColor c(_c);
|
||
13 years ago
|
layout->setBottomBorderColor(c );
|
||
15 years ago
|
}
|
||
|
void LayoutIface::setBottomBorderColor(int r,int g,int b)
|
||
|
{
|
||
14 years ago
|
TQColor c(r,g,b);
|
||
13 years ago
|
layout->setBottomBorderColor(c );
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setBottomBorderWidth( int _size )
|
||
|
{
|
||
13 years ago
|
layout->setBottomBorderWidth( _size );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
//fall back diagonal
|
||
14 years ago
|
void LayoutIface::setFallDiagonalStyle( const TQString& _style )
|
||
15 years ago
|
{
|
||
|
if(_style=="DotLine")
|
||
13 years ago
|
layout->setFallDiagonalStyle(Qt::DotLine);
|
||
15 years ago
|
else if(_style=="DashLine")
|
||
13 years ago
|
layout->setFallDiagonalStyle(Qt::DashLine);
|
||
15 years ago
|
else if(_style=="DashDotLine")
|
||
13 years ago
|
layout->setFallDiagonalStyle(Qt::DashDotLine);
|
||
15 years ago
|
else if(_style=="DashDotDotLine")
|
||
13 years ago
|
layout->setFallDiagonalStyle(Qt::DashDotDotLine);
|
||
15 years ago
|
else if(_style=="SolidLine")
|
||
13 years ago
|
layout->setFallDiagonalStyle(Qt::SolidLine);
|
||
15 years ago
|
else
|
||
13 years ago
|
layout->setFallDiagonalStyle(Qt::SolidLine);
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void LayoutIface::setFallDiagonalColor(const TQString& _c)
|
||
15 years ago
|
{
|
||
14 years ago
|
TQColor c(_c);
|
||
13 years ago
|
layout->setFallDiagonalColor(c );
|
||
15 years ago
|
}
|
||
|
void LayoutIface::setFallDiagonalColor(int r,int g,int b)
|
||
|
{
|
||
14 years ago
|
TQColor c(r,g,b);
|
||
13 years ago
|
layout->setFallDiagonalColor(c );
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setFallDiagonalWidth( int _size )
|
||
|
{
|
||
13 years ago
|
layout->setFallDiagonalWidth( _size );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
|
||
|
//GoUpDiagonal
|
||
14 years ago
|
void LayoutIface::setGoUpDiagonalStyle( const TQString& _style )
|
||
15 years ago
|
{
|
||
|
if(_style=="DotLine")
|
||
13 years ago
|
layout->setGoUpDiagonalStyle(Qt::DotLine);
|
||
15 years ago
|
else if(_style=="DashLine")
|
||
13 years ago
|
layout->setGoUpDiagonalStyle(Qt::DashLine);
|
||
15 years ago
|
else if(_style=="DashDotLine")
|
||
13 years ago
|
layout->setGoUpDiagonalStyle(Qt::DashDotLine);
|
||
15 years ago
|
else if(_style=="DashDotDotLine")
|
||
13 years ago
|
layout->setGoUpDiagonalStyle(Qt::DashDotDotLine);
|
||
15 years ago
|
else if(_style=="SolidLine")
|
||
13 years ago
|
layout->setGoUpDiagonalStyle(Qt::SolidLine);
|
||
15 years ago
|
else
|
||
13 years ago
|
layout->setGoUpDiagonalStyle(Qt::SolidLine);
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void LayoutIface::setGoUpDiagonalColor(const TQString& _c)
|
||
15 years ago
|
{
|
||
14 years ago
|
TQColor c(_c);
|
||
13 years ago
|
layout->setGoUpDiagonalColor(c );
|
||
15 years ago
|
}
|
||
|
void LayoutIface::setGoUpDiagonalColor(int r,int g,int b)
|
||
|
{
|
||
14 years ago
|
TQColor c(r,g,b);
|
||
13 years ago
|
layout->setGoUpDiagonalColor(c );
|
||
15 years ago
|
}
|
||
|
|
||
|
void LayoutIface::setGoUpDiagonalWidth( int _size )
|
||
|
{
|
||
13 years ago
|
layout->setGoUpDiagonalWidth( _size );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
void LayoutIface::setIndent( double indent )
|
||
|
{
|
||
|
if( indent >= 0.0 )
|
||
13 years ago
|
layout->setIndent( indent );
|
||
15 years ago
|
else
|
||
13 years ago
|
layout->setIndent( 0.0 );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
void LayoutIface::setDontPrintText ( bool _print)
|
||
|
{
|
||
13 years ago
|
layout->setDontPrintText ( _print);
|
||
15 years ago
|
}
|
||
|
|