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.
222 lines
5.1 KiB
222 lines
5.1 KiB
15 years ago
|
/* This file is part of the KDE project
|
||
|
|
||
|
Copyright 2004 Ariya Hidayat <ariya@kde.org>
|
||
|
Copyright 2003 Norbert Andres <nandres@web.de>
|
||
|
Copyright 2002 Laurent Montel <montel@kde.org>
|
||
|
Copyright 2002 Simon Hausmann <hausmann@kde.org>
|
||
|
Copyright 2001-2002 Philipp Mueller <philipp.mueller@gmx.de>
|
||
|
Copyright 2000 Stephan Kulow <coolo@kde.org>
|
||
|
Copyright 1999-2000 David Faure <faure@kde.org>
|
||
|
Copyright 1999 Torben Weis <weis@kde.org>
|
||
|
|
||
|
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 "KSpreadDocIface.h"
|
||
|
#include <KoDocumentIface.h>
|
||
|
|
||
|
#include "kspread_doc.h"
|
||
|
#include "kspread_map.h"
|
||
|
|
||
12 years ago
|
#include <tdeapplication.h>
|
||
15 years ago
|
#include <dcopclient.h>
|
||
14 years ago
|
#include <tqcolor.h>
|
||
15 years ago
|
#include <kdebug.h>
|
||
|
|
||
|
using namespace KSpread;
|
||
|
|
||
|
DocIface::DocIface( Doc* _doc )
|
||
|
: KoDocumentIface( _doc )
|
||
|
{
|
||
|
doc=_doc;
|
||
|
}
|
||
|
|
||
|
DCOPRef DocIface::map()
|
||
|
{
|
||
|
return DCOPRef( kapp->dcopClient()->appId(),
|
||
|
doc->map()->dcopObject()->objId() );
|
||
|
}
|
||
|
|
||
14 years ago
|
void DocIface::changeDefaultGridPenColor( const TQColor &_col)
|
||
15 years ago
|
{
|
||
|
doc->setGridColor(_col);
|
||
|
}
|
||
|
|
||
14 years ago
|
TQColor DocIface::pageBorderColor() const
|
||
15 years ago
|
{
|
||
|
return doc->pageBorderColor();
|
||
|
}
|
||
|
|
||
|
bool DocIface::showFormulaBar()const
|
||
|
{
|
||
|
return doc->getShowFormulaBar();
|
||
|
}
|
||
|
|
||
|
bool DocIface::showStatusBar()const
|
||
|
{
|
||
|
return doc->getShowStatusBar();
|
||
|
}
|
||
|
|
||
|
bool DocIface::showTabBar()const
|
||
|
{
|
||
|
return doc->getShowTabBar();
|
||
|
}
|
||
|
|
||
|
void DocIface::setShowVerticalScrollBar(bool _show)
|
||
|
{
|
||
|
doc->setShowVerticalScrollBar(_show);
|
||
|
doc->refreshInterface();
|
||
|
}
|
||
|
|
||
|
void DocIface::setShowHorizontalScrollBar(bool _show)
|
||
|
{
|
||
|
doc->setShowHorizontalScrollBar(_show);
|
||
|
doc->refreshInterface();
|
||
|
}
|
||
|
|
||
|
void DocIface::setShowColHeader(bool _show)
|
||
|
{
|
||
|
doc->setShowColHeader(_show);
|
||
|
doc->refreshInterface();
|
||
|
}
|
||
|
|
||
|
void DocIface::setShowRowHeader(bool _show)
|
||
|
{
|
||
|
doc->setShowRowHeader(_show);
|
||
|
doc->refreshInterface();
|
||
|
}
|
||
|
|
||
|
void DocIface::setShowTabBar(bool _show)
|
||
|
{
|
||
|
doc->setShowTabBar(_show);
|
||
|
doc->refreshInterface();
|
||
|
}
|
||
|
|
||
14 years ago
|
void DocIface::changePageBorderColor( const TQColor & _color)
|
||
15 years ago
|
{
|
||
|
doc->changePageBorderColor( _color);
|
||
|
doc->refreshInterface();
|
||
|
}
|
||
|
|
||
14 years ago
|
void DocIface::addIgnoreWordAll( const TQString &word)
|
||
15 years ago
|
{
|
||
|
doc->addIgnoreWordAll( word );
|
||
|
}
|
||
|
|
||
|
void DocIface::clearIgnoreWordAll( )
|
||
|
{
|
||
|
doc->clearIgnoreWordAll();
|
||
|
}
|
||
|
|
||
14 years ago
|
TQStringList DocIface::spellListIgnoreAll() const
|
||
15 years ago
|
{
|
||
|
return doc->spellListIgnoreAll();
|
||
|
}
|
||
|
|
||
14 years ago
|
void DocIface::addStringCompletion(const TQString & stringCompletion)
|
||
15 years ago
|
{
|
||
|
doc->addStringCompletion( stringCompletion );
|
||
|
}
|
||
|
|
||
|
int DocIface::zoom() const
|
||
|
{
|
||
|
return doc->zoom();
|
||
|
}
|
||
|
|
||
|
|
||
14 years ago
|
TQString DocIface::moveToValue()const
|
||
15 years ago
|
{
|
||
|
switch(doc->getMoveToValue())
|
||
|
{
|
||
|
case Bottom:
|
||
14 years ago
|
return TQString("bottom");
|
||
15 years ago
|
break;
|
||
|
case Left:
|
||
14 years ago
|
return TQString("left");
|
||
15 years ago
|
break;
|
||
|
case Top:
|
||
14 years ago
|
return TQString("top");
|
||
15 years ago
|
break;
|
||
|
case Right:
|
||
14 years ago
|
return TQString("right");
|
||
15 years ago
|
break;
|
||
|
case BottomFirst:
|
||
14 years ago
|
return TQString("bottomFirst");
|
||
15 years ago
|
break;
|
||
|
}
|
||
14 years ago
|
return TQString();
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void DocIface::setMoveToValue(const TQString & move)
|
||
15 years ago
|
{
|
||
|
if ( move.lower()=="bottom" )
|
||
|
doc->setMoveToValue(Bottom);
|
||
|
else if ( move.lower()=="top" )
|
||
|
doc->setMoveToValue(Top);
|
||
|
else if ( move.lower()=="left" )
|
||
|
doc->setMoveToValue(Left);
|
||
|
else if ( move.lower()=="right" )
|
||
|
doc->setMoveToValue(Right);
|
||
|
else if ( move.lower()=="bottomfirst" )
|
||
|
doc->setMoveToValue(BottomFirst);
|
||
|
}
|
||
|
|
||
14 years ago
|
void DocIface::setTypeOfCalc( const TQString & calc )
|
||
15 years ago
|
{
|
||
|
if ( calc.lower()=="sum")
|
||
|
doc->setTypeOfCalc(SumOfNumber );
|
||
|
else if ( calc.lower()=="min")
|
||
|
doc->setTypeOfCalc( Min );
|
||
|
else if ( calc.lower()=="max")
|
||
|
doc->setTypeOfCalc(Max );
|
||
|
else if ( calc.lower()=="average")
|
||
|
doc->setTypeOfCalc(Average );
|
||
|
else if ( calc.lower()=="count")
|
||
|
doc->setTypeOfCalc(Count );
|
||
|
else if ( calc.lower()=="none")
|
||
|
doc->setTypeOfCalc(NoneCalc );
|
||
|
else
|
||
14 years ago
|
kdDebug()<<"Error in setTypeOfCalc( const TQString & calc ) :"<<calc<<endl;
|
||
15 years ago
|
doc->refreshInterface();
|
||
|
}
|
||
|
|
||
14 years ago
|
TQString DocIface::typeOfCalc() const
|
||
15 years ago
|
{
|
||
|
switch( doc->getTypeOfCalc() )
|
||
|
{
|
||
|
case SumOfNumber:
|
||
14 years ago
|
return TQString("sum");
|
||
15 years ago
|
break;
|
||
|
case Min:
|
||
14 years ago
|
return TQString("min");
|
||
15 years ago
|
break;
|
||
|
case Max:
|
||
14 years ago
|
return TQString("max");
|
||
15 years ago
|
break;
|
||
|
case Average:
|
||
14 years ago
|
return TQString("average");
|
||
15 years ago
|
break;
|
||
|
case Count:
|
||
14 years ago
|
return TQString("count");
|
||
15 years ago
|
break;
|
||
|
case NoneCalc:
|
||
|
default:
|
||
14 years ago
|
return TQString("none");
|
||
15 years ago
|
break;
|
||
|
}
|
||
|
}
|
||
|
|