diff options
Diffstat (limited to 'kspread/plugins/scripting/kspreadcore')
8 files changed, 103 insertions, 103 deletions
diff --git a/kspread/plugins/scripting/kspreadcore/krs_cell.cpp b/kspread/plugins/scripting/kspreadcore/krs_cell.cpp index cabf0c50f..46ee13896 100644 --- a/kspread/plugins/scripting/kspreadcore/krs_cell.cpp +++ b/kspread/plugins/scripting/kspreadcore/krs_cell.cpp @@ -59,30 +59,30 @@ Cell::Cell(KSpread::Cell* cell, KSpread::Sheet* sheet, uint col, uint row) Cell::~Cell() { } -const QString Cell::getClassName() const { +const TQString Cell::getClassName() const { return "Kross::KSpreadCore::KSpreadCell"; } -QVariant Cell::toVariant(const KSpread::Value& value) const +TQVariant Cell::toVariant(const KSpread::Value& value) const { //Should we use following value-format enums here? //fmt_None, fmt_Boolean, fmt_Number, fmt_Percent, fmt_Money, fmt_DateTime, fmt_Date, fmt_Time, fmt_String switch(value.type()) { case KSpread::Value::Empty: - return QVariant(); + return TQVariant(); case KSpread::Value::Boolean: - return QVariant( value.asBoolean() ); + return TQVariant( value.asBoolean() ); case KSpread::Value::Integer: - return static_cast<Q_LLONG>(value.asInteger()); + return static_cast<TQ_LLONG>(value.asInteger()); case KSpread::Value::Float: return (float)value.asFloat(); case KSpread::Value::String: return value.asString(); case KSpread::Value::Array: { - QValueList<QVariant> colarray; + TQValueList<TQVariant> colarray; for(uint j = 0; j < value.rows(); j++) { - QValueList<QVariant> rowarray; + TQValueList<TQVariant> rowarray; for( uint i = 0; i < value.columns(); i++) { KSpread::Value v = value.element(i,j); rowarray.append( toVariant(v) ); @@ -93,28 +93,28 @@ QVariant Cell::toVariant(const KSpread::Value& value) const } break; case KSpread::Value::CellRange: //FIXME: not yet used - return QVariant(); + return TQVariant(); case KSpread::Value::Error: - return QVariant(); + return TQVariant(); } - return QVariant(); + return TQVariant(); } -QVariant Cell::value() const { +TQVariant Cell::value() const { return toVariant( m_cell->value() ); } -bool Cell::setValue(const QVariant& value) { +bool Cell::setValue(const TQVariant& value) { KSpread::Value v = m_cell->value(); switch(value.type()) { - case QVariant::Bool: v.setValue( value.toBool() ); break; - case QVariant::ULongLong: v.setValue( (long)value.toLongLong() ); break; - case QVariant::Int: v.setValue( value.toInt() ); break; - case QVariant::Double: v.setValue( value.toDouble() ); break; - case QVariant::String: v.setValue( value.toString() ); break; - case QVariant::Date: v.setValue( value.toDate() ); break; - case QVariant::Time: v.setValue( value.toTime() ); break; - case QVariant::DateTime: v.setValue( value.toDateTime() ); break; + case TQVariant::Bool: v.setValue( value.toBool() ); break; + case TQVariant::ULongLong: v.setValue( (long)value.toLongLong() ); break; + case TQVariant::Int: v.setValue( value.toInt() ); break; + case TQVariant::Double: v.setValue( value.toDouble() ); break; + case TQVariant::String: v.setValue( value.toString() ); break; + case TQVariant::Date: v.setValue( value.toDate() ); break; + case TQVariant::Time: v.setValue( value.toTime() ); break; + case TQVariant::DateTime: v.setValue( value.toDateTime() ); break; default: return false; } return true; @@ -146,38 +146,38 @@ void Cell::setNextCell(Cell* c) { return m_cell->setNextCell(c->m_cell); } -const QString Cell::name() const { +const TQString Cell::name() const { return m_cell->name(); } -const QString Cell::fullName() const { +const TQString Cell::fullName() const { return m_cell->fullName(); } -const QString Cell::comment() const { +const TQString Cell::comment() const { return m_cell->format()->comment(m_col, m_row); } -void Cell::setComment(const QString& c) { +void Cell::setComment(const TQString& c) { return m_cell->format()->setComment(c); } -const QString Cell::getFormatString() const { +const TQString Cell::getFormatString() const { return m_cell->format()->getFormatString(m_col, m_row); } -void Cell::setFormatString(const QString& format) { +void Cell::setFormatString(const TQString& format) { m_cell->format()->setFormatString(format); } -const QString Cell::text() const { +const TQString Cell::text() const { return m_cell->text(); } -bool Cell::setText(const QString& text) { +bool Cell::setText(const TQString& text) { KSpread::ProtectedCheck prot; prot.setSheet (m_sheet); - prot.add (QPoint (m_col, m_row)); + prot.add (TQPoint (m_col, m_row)); if (prot.check()) return false; @@ -185,26 +185,26 @@ bool Cell::setText(const QString& text) { dm->setSheet (m_sheet); dm->setValue (text); dm->setParsing (true); - dm->add (QPoint (m_col, m_row)); + dm->add (TQPoint (m_col, m_row)); dm->execute (); return true; } -const QString Cell::textColor() { +const TQString Cell::textColor() { return m_cell->format()->textColor(m_col, m_row).name(); } -void Cell::setTextColor(const QString& textcolor) { - m_cell->format()->setTextColor( QColor(textcolor) ); +void Cell::setTextColor(const TQString& textcolor) { + m_cell->format()->setTextColor( TQColor(textcolor) ); } -const QString Cell::backgroundColor() { +const TQString Cell::backgroundColor() { return m_cell->format()->bgColor(m_col, m_row).name(); } -void Cell::setBackgroundColor(const QString& backgroundcolor) { - m_cell->format()->setBgColor( QColor(backgroundcolor) ); +void Cell::setBackgroundColor(const TQString& backgroundcolor) { + m_cell->format()->setBgColor( TQColor(backgroundcolor) ); } } diff --git a/kspread/plugins/scripting/kspreadcore/krs_cell.h b/kspread/plugins/scripting/kspreadcore/krs_cell.h index 5f3f221db..c69b831d9 100644 --- a/kspread/plugins/scripting/kspreadcore/krs_cell.h +++ b/kspread/plugins/scripting/kspreadcore/krs_cell.h @@ -26,8 +26,8 @@ #include <api/class.h> -#include <qstring.h> -#include <qcolor.h> +#include <tqstring.h> +#include <tqcolor.h> namespace Kross { namespace KSpreadCore { @@ -52,17 +52,17 @@ class Cell : public Kross::Api::Class<Cell> public: Cell(KSpread::Cell* cell, KSpread::Sheet* sheet, uint col, uint row); virtual ~Cell(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; private: /** * Return the value of the cell. */ - QVariant value() const; + TQVariant value() const; /** * Set the value the cell has. */ - bool setValue(const QVariant& value); + bool setValue(const TQVariant& value); /** * Return the column number. @@ -94,21 +94,21 @@ class Cell : public Kross::Api::Class<Cell> * Returns the name of the cell. For example, the cell in first column * and first row is "A1". */ - const QString name() const; + const TQString name() const; /** * Returns the full name of the cell, i.e. including the worksheet name. * Example: "Sheet1!A1" */ - const QString fullName() const; + const TQString fullName() const; /** * Returns the comment for the cell. */ - const QString comment() const; + const TQString comment() const; /** * Set the comment for the cell. */ - void setComment(const QString& c); + void setComment(const TQString& c); #if 0 bool isFormula() const; @@ -118,50 +118,50 @@ class Cell : public Kross::Api::Class<Cell> /** * Returns the format of the cell, e.g. #.##0.00, dd/mmm/yyyy,... */ - const QString getFormatString() const; + const TQString getFormatString() const; /** * Sets the format of the cell, e.g. #.##0.00, dd/mmm/yyyy,... */ - void setFormatString(const QString& format); + void setFormatString(const TQString& format); /** * Return the text of the cell (the formula if there is one, * the value otherwise). This could be a value (e.g. "14.03") * or a formula (e.g. "=SUM(A1:A10)") */ - const QString text() const; + const TQString text() const; /** * Set the text of the cell. the text * will be handled as string */ - bool setText(const QString& text); + bool setText(const TQString& text); /** * Return the textcolor as RGB-value in the format "#RRGGBB". */ - const QString textColor(); + const TQString textColor(); /** * Set the textcolor to the RGB-value in the format "#RRGGBB" * where each of R, G, and B is a single hex digit. */ - void setTextColor(const QString& textcolor); + void setTextColor(const TQString& textcolor); /** * Return the backgroundcolor as RGB-value in the format "#RRGGBB". */ - const QString backgroundColor(); + const TQString backgroundColor(); /** * Set the backgroundcolor to the RGB-value in the format "#RRGGBB" * where each of R, G, and B is a single hex digit. */ - void setBackgroundColor(const QString& backgroundcolor); + void setBackgroundColor(const TQString& backgroundcolor); private: KSpread::Cell* m_cell; KSpread::Sheet* m_sheet; uint m_col, m_row; - QVariant toVariant(const KSpread::Value& value) const; + TQVariant toVariant(const KSpread::Value& value) const; }; } } diff --git a/kspread/plugins/scripting/kspreadcore/krs_doc.cpp b/kspread/plugins/scripting/kspreadcore/krs_doc.cpp index 37c87efdb..0372d83f3 100644 --- a/kspread/plugins/scripting/kspreadcore/krs_doc.cpp +++ b/kspread/plugins/scripting/kspreadcore/krs_doc.cpp @@ -49,7 +49,7 @@ Doc::~Doc() { } -const QString Doc::getClassName() const { +const TQString Doc::getClassName() const { return "Kross::KSpreadCore::Doc"; } @@ -58,25 +58,25 @@ Sheet* Doc::currentSheet() return new Sheet(m_doc->displaySheet(), m_doc); } -Sheet* Doc::sheetByName(const QString& name) +Sheet* Doc::sheetByName(const TQString& name) { - QPtrListIterator<KSpread::Sheet> it (m_doc->map()->sheetList()); + TQPtrListIterator<KSpread::Sheet> it (m_doc->map()->sheetList()); for( ; it.current(); ++it ) if(it.current()->sheetName() == name) return new Sheet(it.current(), m_doc); return 0; } -QStringList Doc::sheetNames() +TQStringList Doc::sheetNames() { - QStringList names; - QPtrListIterator<KSpread::Sheet> it (m_doc->map()->sheetList()); + TQStringList names; + TQPtrListIterator<KSpread::Sheet> it (m_doc->map()->sheetList()); for( ; it.current(); ++it ) names.append( it.current()->sheetName() ); return names; } -bool Doc::addSheet(const QString& sheetname) +bool Doc::addSheet(const TQString& sheetname) { KSpread::Sheet* sheet = m_doc->map()->createSheet(); if(sheet) { @@ -90,7 +90,7 @@ bool Doc::addSheet(const QString& sheetname) return false; } -bool Doc::removeSheet(const QString& sheetname) +bool Doc::removeSheet(const TQString& sheetname) { KSpread::Sheet* sheet = m_doc->map()->findSheet(sheetname); if(sheet) { @@ -100,33 +100,33 @@ bool Doc::removeSheet(const QString& sheetname) return false; } -bool Doc::loadNativeXML(const QString& xml) { - QDomDocument doc; +bool Doc::loadNativeXML(const TQString& xml) { + TQDomDocument doc; if(! doc.setContent(xml, true)) return false; return m_doc->loadXML(0, doc); } -QString Doc::saveNativeXML() { +TQString Doc::saveNativeXML() { return m_doc->saveXML().toString(2); } -bool Doc::openUrl(const QString& url) +bool Doc::openUrl(const TQString& url) { return m_doc->openURL(url); } -bool Doc::saveUrl(const QString& url) +bool Doc::saveUrl(const TQString& url) { return m_doc->saveAs(url); } -bool Doc::import(const QString& url) +bool Doc::import(const TQString& url) { return m_doc->import(url); } -bool Doc::exp0rt(const QString& url) +bool Doc::exp0rt(const TQString& url) { return m_doc->exp0rt(url); } diff --git a/kspread/plugins/scripting/kspreadcore/krs_doc.h b/kspread/plugins/scripting/kspreadcore/krs_doc.h index 28c69845f..dd3df4d62 100644 --- a/kspread/plugins/scripting/kspreadcore/krs_doc.h +++ b/kspread/plugins/scripting/kspreadcore/krs_doc.h @@ -24,9 +24,9 @@ #include <api/class.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqdom.h> namespace Kross { namespace KSpreadCore { @@ -45,7 +45,7 @@ class Doc : public Kross::Api::Class<Doc> public: explicit Doc(KSpread::Doc* doc); virtual ~Doc(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; private: /** @@ -69,7 +69,7 @@ class Doc : public Kross::Api::Class<Doc> * sheet = doc.sheetByName("foosheet") * @endcode */ - Sheet* sheetByName(const QString& name); + Sheet* sheetByName(const TQString& name); /** * This function returns an array with the sheet names @@ -81,36 +81,36 @@ class Doc : public Kross::Api::Class<Doc> * sheet = doc.sheetByName( sheetnames[0] ) * @endcode */ - QStringList sheetNames(); + TQStringList sheetNames(); /** * Add a new sheet named @p sheetname to the document. */ - bool addSheet(const QString& sheetname); + bool addSheet(const TQString& sheetname); /** * Remove the sheet named @p sheetname from the document. */ - bool removeSheet(const QString& sheetname); + bool removeSheet(const TQString& sheetname); /** * Loads the native XML document. */ - bool loadNativeXML(const QString& xml); + bool loadNativeXML(const TQString& xml); /** * Save and return the to a native document saved XML. */ - QString saveNativeXML(); + TQString saveNativeXML(); #if 0 - bool loadOpenDocXML(const QString& xml); - QString saveOpenDocXML(); + bool loadOpenDocXML(const TQString& xml); + TQString saveOpenDocXML(); #endif - bool openUrl(const QString& url); - bool saveUrl(const QString& url); - bool import(const QString& url); - bool exp0rt(const QString& url); + bool openUrl(const TQString& url); + bool saveUrl(const TQString& url); + bool import(const TQString& url); + bool exp0rt(const TQString& url); private: KSpread::Doc* m_doc; diff --git a/kspread/plugins/scripting/kspreadcore/krs_sheet.cpp b/kspread/plugins/scripting/kspreadcore/krs_sheet.cpp index 694037ede..790c21310 100644 --- a/kspread/plugins/scripting/kspreadcore/krs_sheet.cpp +++ b/kspread/plugins/scripting/kspreadcore/krs_sheet.cpp @@ -50,16 +50,16 @@ Sheet::Sheet(KSpread::Sheet* sheet, KSpread::Doc *doc) : Kross::Api::Class<Sheet Sheet::~Sheet() { } -const QString Sheet::getClassName() const { +const TQString Sheet::getClassName() const { return "Kross::KSpreadCore::Sheet"; } -const QString Sheet::name() const +const TQString Sheet::name() const { return m_sheet->sheetName(); } -void Sheet::setName(const QString& name) +void Sheet::setName(const TQString& name) { m_sheet->setSheetName(name); } @@ -78,8 +78,8 @@ Cell* Sheet::firstCell() const { } Cell* Sheet::cell(uint col, uint row) { - uint c = QMAX(uint(1), col); - uint r = QMAX(uint(1), row); + uint c = TQMAX(uint(1), col); + uint r = TQMAX(uint(1), row); return new Cell(m_sheet->cellAt(c,r),m_sheet,c,r); } @@ -92,11 +92,11 @@ bool Sheet::insertColumn(uint col) { } void Sheet::removeRow(uint row) { - m_sheet->removeRow( QMAX(uint(1), row) ); + m_sheet->removeRow( TQMAX(uint(1), row) ); } void Sheet::removeColumn(uint col) { - m_sheet->removeColumn( QMAX(uint(1), col) ); + m_sheet->removeColumn( TQMAX(uint(1), col) ); } } diff --git a/kspread/plugins/scripting/kspreadcore/krs_sheet.h b/kspread/plugins/scripting/kspreadcore/krs_sheet.h index a96e758ed..bd83b6a8f 100644 --- a/kspread/plugins/scripting/kspreadcore/krs_sheet.h +++ b/kspread/plugins/scripting/kspreadcore/krs_sheet.h @@ -52,17 +52,17 @@ class Sheet : public Kross::Api::Class<Sheet> public: Sheet(KSpread::Sheet* sheet, KSpread::Doc* doc = 0); virtual ~Sheet(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; private: /** * Return the name of the sheet. */ - const QString name() const; + const TQString name() const; /** * Set the name of the sheet. */ - void setName(const QString& name); + void setName(const TQString& name); /** * Return the currently maximum defined number of columns. diff --git a/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.cpp b/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.cpp index acfd0b2bd..108516dc1 100644 --- a/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.cpp +++ b/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.cpp @@ -45,9 +45,9 @@ using namespace Kross::KSpreadCore; KSpreadCoreModule::KSpreadCoreModule(Kross::Api::Manager* manager) : Kross::Api::Module("kspreadcore") , m_manager(manager) { - QMap<QString, Object::Ptr> children = manager->getChildren(); - kdDebug() << " there are " << children.size() << endl; - for(QMap<QString, Object::Ptr>::const_iterator it = children.begin(); it != children.end(); it++) + TQMap<TQString, Object::Ptr> tqchildren = manager->getChildren(); + kdDebug() << " there are " << tqchildren.size() << endl; + for(TQMap<TQString, Object::Ptr>::const_iterator it = tqchildren.begin(); it != tqchildren.end(); it++) { kdDebug() << it.key() << " " << it.data() << endl; } @@ -76,7 +76,7 @@ KSpreadCoreModule::~KSpreadCoreModule() } -const QString KSpreadCoreModule::getClassName() const +const TQString KSpreadCoreModule::getClassName() const { return "Kross::KSpreadCore::KSpreadCoreModule"; } diff --git a/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.h b/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.h index ffc998cc1..03bde5fc3 100644 --- a/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.h +++ b/kspread/plugins/scripting/kspreadcore/kspreadcoremodule.h @@ -20,8 +20,8 @@ #ifndef KSPREAD_KROSS_KSPREADCOREMODULE_H #define KSPREAD_KROSS_KSPREADCOREMODULE_H -#include <qstring.h> -#include <qvariant.h> +#include <tqstring.h> +#include <tqvariant.h> #define KROSS_MAIN_EXPORT KDE_EXPORT @@ -51,8 +51,8 @@ namespace Kross { namespace KSpreadCore { public: KSpreadCoreModule(Kross::Api::Manager* manager); virtual ~KSpreadCoreModule(); - virtual const QString getClassName() const; - //virtual Kross::Api::Object::Ptr call(const QString& name, Kross::Api::List::Ptr arguments); + virtual const TQString getClassName() const; + //virtual Kross::Api::Object::Ptr call(const TQString& name, Kross::Api::List::Ptr arguments); private: #if 0 |
