From f008adb5a77e094eaf6abf3fc0f36958e66896a5 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 25 Jun 2011 05:28:35 +0000 Subject: TQt4 port koffice This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- lib/kofficecore/KoApplication.cpp | 30 +- lib/kofficecore/KoApplication.h | 5 +- lib/kofficecore/KoApplicationIface.cc | 30 +- lib/kofficecore/KoApplicationIface.h | 10 +- lib/kofficecore/KoChild.cpp | 126 ++-- lib/kofficecore/KoChild.h | 77 +- lib/kofficecore/KoContainerHandler.cpp | 202 ++--- lib/kofficecore/KoContainerHandler.h | 38 +- lib/kofficecore/KoDetailsPane.cpp | 192 ++--- lib/kofficecore/KoDetailsPane.h | 48 +- lib/kofficecore/KoDocument.cpp | 636 ++++++++-------- lib/kofficecore/KoDocument.h | 225 +++--- lib/kofficecore/KoDocumentChild.cpp | 136 ++-- lib/kofficecore/KoDocumentChild.h | 41 +- lib/kofficecore/KoDocumentIface.cc | 130 ++-- lib/kofficecore/KoDocumentIface.h | 92 +-- lib/kofficecore/KoDocumentInfo.cpp | 242 +++--- lib/kofficecore/KoDocumentInfo.h | 190 ++--- lib/kofficecore/KoDocumentInfoDlg.cpp | 214 +++--- lib/kofficecore/KoDocumentInfoDlg.h | 10 +- lib/kofficecore/KoDocument_p.h | 1 + lib/kofficecore/KoDom.cpp | 6 +- lib/kofficecore/KoDom.h | 22 +- lib/kofficecore/KoFactory.cpp | 4 +- lib/kofficecore/KoFactory.h | 3 +- lib/kofficecore/KoFileDialog.cpp | 26 +- lib/kofficecore/KoFileDialog.h | 15 +- lib/kofficecore/KoFilter.cpp | 38 +- lib/kofficecore/KoFilter.h | 49 +- lib/kofficecore/KoFilterChain.cpp | 206 +++--- lib/kofficecore/KoFilterChain.h | 102 +-- lib/kofficecore/KoFilterManager.cpp | 216 +++--- lib/kofficecore/KoFilterManager.h | 43 +- lib/kofficecore/KoFilterManager_p.h | 13 +- lib/kofficecore/KoFrame.cpp | 152 ++-- lib/kofficecore/KoFrame.h | 21 +- lib/kofficecore/KoGenStyles.cpp | 150 ++-- lib/kofficecore/KoGenStyles.h | 118 +-- lib/kofficecore/KoGlobal.cpp | 70 +- lib/kofficecore/KoGlobal.h | 26 +- lib/kofficecore/KoMainWindow.cpp | 300 ++++---- lib/kofficecore/KoMainWindow.h | 23 +- lib/kofficecore/KoMainWindowIface.cc | 12 +- lib/kofficecore/KoMainWindowIface.h | 4 +- lib/kofficecore/KoOasisLoadingContext.cpp | 48 +- lib/kofficecore/KoOasisLoadingContext.h | 26 +- lib/kofficecore/KoOasisSettings.cpp | 82 +-- lib/kofficecore/KoOasisSettings.h | 46 +- lib/kofficecore/KoOasisStore.cpp | 50 +- lib/kofficecore/KoOasisStore.h | 10 +- lib/kofficecore/KoOasisStyles.cpp | 348 ++++----- lib/kofficecore/KoOasisStyles.h | 122 +-- lib/kofficecore/KoOpenPane.cpp | 120 +-- lib/kofficecore/KoOpenPane.h | 29 +- lib/kofficecore/KoPageLayout.cpp | 64 +- lib/kofficecore/KoPageLayout.h | 46 +- lib/kofficecore/KoPicture.cpp | 60 +- lib/kofficecore/KoPicture.h | 70 +- lib/kofficecore/KoPictureBase.cpp | 44 +- lib/kofficecore/KoPictureBase.h | 40 +- lib/kofficecore/KoPictureClipart.cpp | 48 +- lib/kofficecore/KoPictureClipart.h | 34 +- lib/kofficecore/KoPictureCollection.cpp | 62 +- lib/kofficecore/KoPictureCollection.h | 36 +- lib/kofficecore/KoPictureEps.cpp | 108 +-- lib/kofficecore/KoPictureEps.h | 48 +- lib/kofficecore/KoPictureImage.cpp | 62 +- lib/kofficecore/KoPictureImage.h | 40 +- lib/kofficecore/KoPictureKey.cpp | 42 +- lib/kofficecore/KoPictureKey.h | 46 +- lib/kofficecore/KoPictureShared.cpp | 126 ++-- lib/kofficecore/KoPictureShared.h | 76 +- lib/kofficecore/KoPictureWmf.cpp | 44 +- lib/kofficecore/KoPictureWmf.h | 38 +- lib/kofficecore/KoPoint.h | 24 +- lib/kofficecore/KoQueryTrader.cpp | 38 +- lib/kofficecore/KoQueryTrader.h | 46 +- lib/kofficecore/KoRect.cpp | 26 +- lib/kofficecore/KoRect.h | 22 +- lib/kofficecore/KoSetPropCommand.h | 8 +- lib/kofficecore/KoSize.h | 32 +- lib/kofficecore/KoSpeaker.cpp | 294 ++++---- lib/kofficecore/KoSpeaker.h | 39 +- lib/kofficecore/KoStyleStack.cpp | 108 +-- lib/kofficecore/KoStyleStack.h | 42 +- lib/kofficecore/KoTemplates.cpp | 130 ++-- lib/kofficecore/KoTemplates.h | 76 +- lib/kofficecore/KoUnit.cpp | 58 +- lib/kofficecore/KoUnit.h | 20 +- lib/kofficecore/KoView.cpp | 248 +++---- lib/kofficecore/KoView.h | 72 +- lib/kofficecore/KoViewIface.cc | 14 +- lib/kofficecore/KoViewIface.h | 6 +- lib/kofficecore/KoXmlNS.h | 4 +- lib/kofficecore/KoXmlReader.cpp | 424 +++++------ lib/kofficecore/KoXmlReader.h | 120 +-- lib/kofficecore/Koversiondialog.cpp | 54 +- lib/kofficecore/Koversiondialog.h | 24 +- lib/kofficecore/THOUGHTS | 10 +- lib/kofficecore/kkbdaccessextensions.cpp | 276 +++---- lib/kofficecore/kkbdaccessextensions.h | 48 +- lib/kofficecore/koDetailsPaneBase.ui | 30 +- lib/kofficecore/koDocumentInfoAboutWidget.ui | 70 +- lib/kofficecore/koDocumentInfoAuthorWidget.ui | 48 +- .../koDocumentInfoUserMetadataWidget.ui | 26 +- lib/kofficecore/koOpenPaneBase.ui | 22 +- lib/kofficecore/koffice_export.h | 2 +- lib/kofficecore/priorityqueue.h | 26 +- lib/kofficecore/tests/filter_graph.cpp | 44 +- lib/kofficecore/tests/filterchain_test.cpp | 8 +- lib/kofficecore/tests/kodomtest.cpp | 46 +- lib/kofficecore/tests/kogenstylestest.cpp | 58 +- lib/kofficecore/tests/kooasissettingstest.cpp | 6 +- lib/kofficecore/tests/kooasisstoretest.cpp | 10 +- lib/kofficecore/tests/kopointtest.cpp | 10 +- lib/kofficecore/tests/korecttest.cpp | 8 +- lib/kofficecore/tests/koxmlreadertest.cpp | 820 ++++++++++----------- lib/kofficecore/tests/priorityqueue_test.cpp | 8 +- 118 files changed, 4923 insertions(+), 4891 deletions(-) (limited to 'lib/kofficecore') diff --git a/lib/kofficecore/KoApplication.cpp b/lib/kofficecore/KoApplication.cpp index 3f2f6b238..2be62bbea 100644 --- a/lib/kofficecore/KoApplication.cpp +++ b/lib/kofficecore/KoApplication.cpp @@ -19,8 +19,8 @@ #include "KoApplication.h" #include -#include -#include +#include +#include #include #include #include @@ -106,9 +106,9 @@ bool KoApplication::start() int argsCount = args->count(); KCmdLineArgs *koargs = KCmdLineArgs::parsedArgs("koffice"); - QCString dpiValues = koargs->getOption( "dpi" ); + TQCString dpiValues = koargs->getOption( "dpi" ); if ( !dpiValues.isEmpty() ) { - int sep = dpiValues.find( QRegExp( "[x, ]" ) ); + int sep = dpiValues.tqfind( TQRegExp( "[x, ]" ) ); int dpiX; int dpiY = 0; bool ok = true; @@ -132,7 +132,7 @@ bool KoApplication::start() return false; KoMainWindow *shell = new KoMainWindow( doc->instance() ); shell->show(); - QObject::connect(doc, SIGNAL(sigProgress(int)), shell, SLOT(slotProgress(int))); + TQObject::connect(doc, TQT_SIGNAL(sigProgress(int)), shell, TQT_SLOT(slotProgress(int))); // for initDoc to fill in the recent docs list // and for KoDocument::slotStarted doc->addShell( shell ); @@ -144,7 +144,7 @@ bool KoApplication::start() } // FIXME This needs to be moved someplace else - QObject::disconnect(doc, SIGNAL(sigProgress(int)), shell, SLOT(slotProgress(int))); + TQObject::disconnect(doc, TQT_SIGNAL(sigProgress(int)), shell, TQT_SLOT(slotProgress(int))); } else { bool print = koargs->isSet("print"); bool doTemplate = koargs->isSet("template"); @@ -166,24 +166,24 @@ bool KoApplication::start() shell->show(); // are we just trying to open a template? if ( doTemplate ) { - QStringList paths; - if ( args->url(i).isLocalFile() && QFile::exists(args->url(i).path()) ) + TQStringList paths; + if ( args->url(i).isLocalFile() && TQFile::exists(args->url(i).path()) ) { - paths << QString(args->url(i).path()); + paths << TQString(args->url(i).path()); kdDebug(30003) << "using full path..." << endl; } else { - QString desktopName(args->arg(i)); - QString appName = KGlobal::instance()->instanceName(); + TQString desktopName(args->arg(i)); + TQString appName = KGlobal::instance()->instanceName(); paths = KGlobal::dirs()->findAllResources("data", appName +"/templates/*/" + desktopName ); if ( paths.isEmpty()) { paths = KGlobal::dirs()->findAllResources("data", appName +"/templates/" + desktopName ); } if ( paths.isEmpty()) { - KMessageBox::error(0L, i18n("No template found for: %1 ").arg(desktopName) ); + KMessageBox::error(0L, i18n("No template found for: %1 ").tqarg(desktopName) ); delete shell; } else if ( paths.count() > 1 ) { - KMessageBox::error(0L, i18n("Too many templates found for: %1").arg(desktopName) ); + KMessageBox::error(0L, i18n("Too many templates found for: %1").tqarg(desktopName) ); delete shell; } } @@ -193,7 +193,7 @@ bool KoApplication::start() templateBase.setPath(paths[0]); KDesktopFile templateInfo(paths[0]); - QString templateName = templateInfo.readURL(); + TQString templateName = templateInfo.readURL(); KURL templateURL; templateURL.setPath( templateBase.directory() + "/" + templateName ); if ( shell->openDocument(doc, templateURL )) { @@ -203,7 +203,7 @@ bool KoApplication::start() kdDebug(30003) << "Template loaded..." << endl; n++; } else { - KMessageBox::error(0L, i18n("Template %1 failed to load.").arg(templateURL.prettyURL()) ); + KMessageBox::error(0L, i18n("Template %1 failed to load.").tqarg(templateURL.prettyURL()) ); delete shell; } } diff --git a/lib/kofficecore/KoApplication.h b/lib/kofficecore/KoApplication.h index ecd9b9431..d6f44929a 100644 --- a/lib/kofficecore/KoApplication.h +++ b/lib/kofficecore/KoApplication.h @@ -37,11 +37,12 @@ class KoApplicationPrivate; * can find their images etc. * * If the last mainwindow becomes closed, KoApplication automatically - * calls QApplication::quit. + * calls TQApplication::quit. */ class KOFFICECORE_EXPORT KoApplication : public KApplication { Q_OBJECT + TQ_OBJECT public: /** @@ -62,7 +63,7 @@ public: * Parses command line arguments and creates the initial shells and docs * from them (or an empty doc if no cmd-line argument is specified ). * - * You must call this method directly before calling QApplication::exec. + * You must call this method directly before calling TQApplication::exec. * * It is valid behaviour not to call this method at all. In this case you * have to process your command line parameters by yourself. diff --git a/lib/kofficecore/KoApplicationIface.cc b/lib/kofficecore/KoApplicationIface.cc index eb6f4d2da..042a39a82 100644 --- a/lib/kofficecore/KoApplicationIface.cc +++ b/lib/kofficecore/KoApplicationIface.cc @@ -40,41 +40,41 @@ KoApplicationIface::~KoApplicationIface() { } -DCOPRef KoApplicationIface::createDocument( const QString &nativeFormat ) +DCOPRef KoApplicationIface::createDocument( const TQString &nativeFormat ) { KoDocumentEntry entry = KoDocumentEntry::queryByMimeType( nativeFormat ); if ( entry.isEmpty() ) { - KMessageBox::questionYesNo( 0, i18n( "Unknown KOffice MimeType %s. Check your installation." ).arg( nativeFormat ) ); + KMessageBox::questionYesNo( 0, i18n( "Unknown KOffice MimeType %s. Check your installation." ).tqarg( nativeFormat ) ); return DCOPRef(); } KoDocument* doc = entry.createDoc( 0 ); return DCOPRef( kapp->dcopClient()->appId(), doc->dcopObject()->objId() ); } -QValueList KoApplicationIface::getDocuments() +TQValueList KoApplicationIface::getDocuments() { - QValueList lst; - QPtrList *documents = KoDocument::documentList(); + TQValueList lst; + TQPtrList *documents = KoDocument::documentList(); if ( documents ) { - QPtrListIterator it( *documents ); + TQPtrListIterator it( *documents ); for (; it.current(); ++it ) lst.append( DCOPRef( kapp->dcopClient()->appId(), it.current()->dcopObject()->objId() ) ); } return lst; } -QValueList KoApplicationIface::getViews() +TQValueList KoApplicationIface::getViews() { - QValueList lst; - QPtrList *documents = KoDocument::documentList(); + TQValueList lst; + TQPtrList *documents = KoDocument::documentList(); if ( documents ) { - QPtrListIterator it( *documents ); + TQPtrListIterator it( *documents ); for (; it.current(); ++it ) { - QPtrListIterator itview( it.current()->views() ); + TQPtrListIterator itview( it.current()->views() ); for ( ; itview.current(); ++itview ) lst.append( DCOPRef( kapp->dcopClient()->appId(), itview.current()->dcopObject()->objId() ) ); } @@ -82,13 +82,13 @@ QValueList KoApplicationIface::getViews() return lst; } -QValueList KoApplicationIface::getWindows() +TQValueList KoApplicationIface::getWindows() { - QValueList lst; - QPtrList *mainWindows = KMainWindow::memberList; + TQValueList lst; + TQPtrList *mainWindows = KMainWindow::memberList; if ( mainWindows ) { - QPtrListIterator it( *mainWindows ); + TQPtrListIterator it( *mainWindows ); for (; it.current(); ++it ) lst.append( DCOPRef( kapp->dcopClient()->appId(), static_cast(it.current())->dcopObject()->objId() ) ); diff --git a/lib/kofficecore/KoApplicationIface.h b/lib/kofficecore/KoApplicationIface.h index ac72f09a0..6d8b9e99b 100644 --- a/lib/kofficecore/KoApplicationIface.h +++ b/lib/kofficecore/KoApplicationIface.h @@ -21,7 +21,7 @@ #define __KoApplicationIface_h__ #include -#include +#include #include /** @@ -40,26 +40,26 @@ k_dcop: * Creates a new document for the given native mimetype * Use it to create a shell and to load an existing file, if any */ - DCOPRef createDocument( const QString &nativeFormat ); + DCOPRef createDocument( const TQString &nativeFormat ); /** * @return a list of references to all the documents * (see KoDocumentIface) */ - QValueList getDocuments(); + TQValueList getDocuments(); /** * @return a list of references to all the views * (see KoViewIface) * Convenience method to avoid iterating over all documents to get all the views. */ - QValueList getViews(); + TQValueList getViews(); /** * @return a list of references to all the windows * (see KoMainWindowIface) */ - QValueList getWindows(); + TQValueList getWindows(); }; #endif diff --git a/lib/kofficecore/KoChild.cpp b/lib/kofficecore/KoChild.cpp index 8207d086d..85d549390 100644 --- a/lib/kofficecore/KoChild.cpp +++ b/lib/kofficecore/KoChild.cpp @@ -19,7 +19,7 @@ #include -#include +#include #include @@ -34,24 +34,24 @@ public: { } - QRect m_geometry; + TQRect m_tqgeometry; double m_rotation; double m_shearX; double m_shearY; - QPoint m_rotationPoint; + TQPoint m_rotationPoint; double m_scaleX; double m_scaleY; - QWMatrix m_matrix; + TQWMatrix m_matrix; bool m_lock; - QPointArray m_old; + TQPointArray m_old; bool m_transparent; int m_contentsX; int m_contentsY; }; -KoChild::KoChild( QObject *parent, const char *name ) -: QObject( parent, name ) +KoChild::KoChild( TQObject *tqparent, const char *name ) +: TQObject( tqparent, name ) { d = new KoChildPrivate; @@ -69,19 +69,19 @@ KoChild::~KoChild() delete d; } -void KoChild::setGeometry( const QRect &rect, bool noEmit ) +void KoChild::setGeometry( const TQRect &rect, bool noEmit ) { if ( !d->m_lock ) d->m_old = framePointArray(); - d->m_geometry = rect; + d->m_tqgeometry = rect; // Embedded objects should have a minimum size of 3, so they can be selected - if( d->m_geometry.width() < 3 ) - d->m_geometry.setWidth( 3 ); + if( d->m_tqgeometry.width() < 3 ) + d->m_tqgeometry.setWidth( 3 ); - if( d->m_geometry.height() < 3 ) - d->m_geometry.setHeight( 3 ); + if( d->m_tqgeometry.height() < 3 ) + d->m_tqgeometry.setHeight( 3 ); updateMatrix(); @@ -89,27 +89,27 @@ void KoChild::setGeometry( const QRect &rect, bool noEmit ) emit changed( this ); } -QRect KoChild::geometry() const +TQRect KoChild::tqgeometry() const { - return d->m_geometry; + return d->m_tqgeometry; } -QRegion KoChild::region( const QWMatrix &matrix ) const +TQRegion KoChild::region( const TQWMatrix &matrix ) const { - return QRegion( pointArray( matrix ) ); + return TQRegion( pointArray( matrix ) ); } -QPointArray KoChild::pointArray( const QWMatrix &matrix ) const +TQPointArray KoChild::pointArray( const TQWMatrix &matrix ) const { - return pointArray( QRect( 0, 0, d->m_geometry.width(), d->m_geometry.height() ), matrix ); + return pointArray( TQRect( 0, 0, d->m_tqgeometry.width(), d->m_tqgeometry.height() ), matrix ); } -//bool KoChild::contains( const QPoint &point ) const +//bool KoChild::tqcontains( const TQPoint &point ) const //{ -// return region().contains( point ); +// return region().tqcontains( point ); //} -QRect KoChild::boundingRect() const +TQRect KoChild::boundingRect() const { return pointArray().boundingRect(); } @@ -119,13 +119,13 @@ bool KoChild::isRectangle() const return !( d->m_shearX != 0.0 || d->m_shearY != 0.0 || d->m_rotation != 0.0 ); } -void KoChild::setClipRegion( QPainter &painter, bool combine ) +void KoChild::setClipRegion( TQPainter &painter, bool combine ) { painter.setClipping( true ); if ( combine && !painter.clipRegion().isEmpty() ) - painter.setClipRegion( region( painter.worldMatrix() ).intersect( painter.clipRegion() ) ); + painter.setClipRegion( region( painter.tqworldMatrix() ).intersect( painter.clipRegion() ) ); else - painter.setClipRegion( region( painter.worldMatrix() ) ); + painter.setClipRegion( region( painter.tqworldMatrix() ) ); } void KoChild::setScaling( double x, double y ) @@ -197,7 +197,7 @@ double KoChild::rotation() const return d->m_rotation; } -void KoChild::setRotationPoint( const QPoint &pos ) +void KoChild::setRotationPoint( const TQPoint &pos ) { if ( !d->m_lock ) d->m_old = framePointArray(); @@ -209,16 +209,16 @@ void KoChild::setRotationPoint( const QPoint &pos ) emit changed( this ); } -QPoint KoChild::rotationPoint() const +TQPoint KoChild::rotationPoint() const { return d->m_rotationPoint; } -void KoChild::transform( QPainter &painter ) +void KoChild::transform( TQPainter &painter ) { setClipRegion( painter, true ); - QWMatrix m = painter.worldMatrix(); + TQWMatrix m = painter.tqworldMatrix(); m = d->m_matrix * m; m.scale( d->m_scaleX, d->m_scaleY ); painter.setWorldMatrix( m ); @@ -230,37 +230,37 @@ void KoChild::setContentsPos( int x, int y ) d->m_contentsY = y; } -QRect KoChild::contentRect() const +TQRect KoChild::contentRect() const { - return QRect( d->m_contentsX, d->m_contentsY, int(d->m_geometry.width() / d->m_scaleX), - int(d->m_geometry.height() / d->m_scaleY) ); + return TQRect( d->m_contentsX, d->m_contentsY, int(d->m_tqgeometry.width() / d->m_scaleX), + int(d->m_tqgeometry.height() / d->m_scaleY) ); } -QPointArray KoChild::framePointArray( const QWMatrix &matrix ) const +TQPointArray KoChild::framePointArray( const TQWMatrix &matrix ) const { - return pointArray( QRect( -6, -6, d->m_geometry.width() + 12, d->m_geometry.height() + 12 ), matrix ); + return pointArray( TQRect( -6, -6, d->m_tqgeometry.width() + 12, d->m_tqgeometry.height() + 12 ), matrix ); } -QRegion KoChild::frameRegion( const QWMatrix &matrix, bool solid ) const +TQRegion KoChild::frameRegion( const TQWMatrix &matrix, bool solid ) const { - const QPointArray arr = framePointArray( matrix ); - const QRegion frameReg( arr ); + const TQPointArray arr = framePointArray( matrix ); + const TQRegion frameReg( arr ); if ( solid ) return frameReg; - const QRegion reg = region( matrix ); + const TQRegion reg = region( matrix ); return frameReg.subtract( reg ); } -QPointArray KoChild::pointArray( const QRect &r, const QWMatrix &matrix ) const +TQPointArray KoChild::pointArray( const TQRect &r, const TQWMatrix &matrix ) const { - QPoint topleft = d->m_matrix.map( QPoint( r.left(), r.top() ) ); - QPoint topright = d->m_matrix.map( QPoint( r.right(), r.top() ) ); - QPoint bottomleft = d->m_matrix.map( QPoint( r.left(), r.bottom() ) ); - QPoint bottomright = d->m_matrix.map( QPoint( r.right(), r.bottom() ) ); + TQPoint topleft = d->m_matrix.map( TQPoint( r.left(), r.top() ) ); + TQPoint topright = d->m_matrix.map( TQPoint( r.right(), r.top() ) ); + TQPoint bottomleft = d->m_matrix.map( TQPoint( r.left(), r.bottom() ) ); + TQPoint bottomright = d->m_matrix.map( TQPoint( r.right(), r.bottom() ) ); - QPointArray arr( 4 ); + TQPointArray arr( 4 ); arr.setPoint( 0, topleft ); arr.setPoint( 1, topright ); arr.setPoint( 2, bottomright ); @@ -274,21 +274,21 @@ QPointArray KoChild::pointArray( const QRect &r, const QWMatrix &matrix ) const void KoChild::updateMatrix() { - QWMatrix r; + TQWMatrix r; r.rotate( - d->m_rotation ); - QPoint p = r.map( QPoint( d->m_rotationPoint.x(), + TQPoint p = r.map( TQPoint( d->m_rotationPoint.x(), d->m_rotationPoint.y() ) ); - QWMatrix m; + TQWMatrix m; m.rotate( d->m_rotation ); - m.translate( -d->m_rotationPoint.x() + d->m_geometry.x(), -d->m_rotationPoint.y() + d->m_geometry.y() ); + m.translate( -d->m_rotationPoint.x() + d->m_tqgeometry.x(), -d->m_rotationPoint.y() + d->m_tqgeometry.y() ); m.translate( p.x(), p.y() ); m.shear( d->m_shearX, d->m_shearY ); d->m_matrix = m; } -QWMatrix KoChild::matrix() const +TQWMatrix KoChild::matrix() const { return d->m_matrix; } @@ -316,9 +316,9 @@ bool KoChild::locked() const return d->m_lock; } -QPointArray KoChild::oldPointArray( const QWMatrix &matrix ) +TQPointArray KoChild::oldPointArray( const TQWMatrix &matrix ) { - QPointArray arr = d->m_old; + TQPointArray arr = d->m_old; for( int i = 0; i < 4; ++i ) arr.setPoint( i, matrix.map( arr.point( i ) ) ); @@ -336,28 +336,28 @@ bool KoChild::isTransparent() const return d->m_transparent; } -KoChild::Gadget KoChild::gadgetHitTest( const QPoint &p ) +KoChild::Gadget KoChild::gadgetHitTest( const TQPoint &p ) { - if ( !frameRegion().contains( p ) ) + if ( !frameRegion().tqcontains( p ) ) return NoGadget; - if ( QRegion( pointArray( QRect( -5, -5, 5, 5 ) ) ).contains( p ) ) + if ( TQRegion( pointArray( TQRect( -5, -5, 5, 5 ) ) ).tqcontains( p ) ) return TopLeft; - if ( QRegion( pointArray( QRect( d->m_geometry.width() / 2 - 3, -5, 5, 5 ) ) ).contains( p ) ) + if ( TQRegion( pointArray( TQRect( d->m_tqgeometry.width() / 2 - 3, -5, 5, 5 ) ) ).tqcontains( p ) ) return TopMid; - if ( QRegion( pointArray( QRect( d->m_geometry.width(), -5, 5, 5 ) ) ).contains( p ) ) + if ( TQRegion( pointArray( TQRect( d->m_tqgeometry.width(), -5, 5, 5 ) ) ).tqcontains( p ) ) return TopRight; - if ( QRegion( pointArray( QRect( -5, d->m_geometry.height() / 2 - 3, 5, 5 ) ) ).contains( p ) ) + if ( TQRegion( pointArray( TQRect( -5, d->m_tqgeometry.height() / 2 - 3, 5, 5 ) ) ).tqcontains( p ) ) return MidLeft; - if ( QRegion( pointArray( QRect( -5, d->m_geometry.height(), 5, 5 ) ) ).contains( p ) ) + if ( TQRegion( pointArray( TQRect( -5, d->m_tqgeometry.height(), 5, 5 ) ) ).tqcontains( p ) ) return BottomLeft; - if ( QRegion( pointArray( QRect( d->m_geometry.width() / 2 - 3, - d->m_geometry.height(), 5, 5 ) ) ).contains( p ) ) + if ( TQRegion( pointArray( TQRect( d->m_tqgeometry.width() / 2 - 3, + d->m_tqgeometry.height(), 5, 5 ) ) ).tqcontains( p ) ) return BottomMid; - if ( QRegion( pointArray( QRect( d->m_geometry.width(), d->m_geometry.height(), 5, 5 ) ) ).contains( p ) ) + if ( TQRegion( pointArray( TQRect( d->m_tqgeometry.width(), d->m_tqgeometry.height(), 5, 5 ) ) ).tqcontains( p ) ) return BottomRight; - if ( QRegion( pointArray( QRect( d->m_geometry.width(), - d->m_geometry.height() / 2 - 3, 5, 5 ) ) ).contains( p ) ) + if ( TQRegion( pointArray( TQRect( d->m_tqgeometry.width(), + d->m_tqgeometry.height() / 2 - 3, 5, 5 ) ) ).tqcontains( p ) ) return MidRight; return Move; diff --git a/lib/kofficecore/KoChild.h b/lib/kofficecore/KoChild.h index 26ad4a08a..64f41064d 100644 --- a/lib/kofficecore/KoChild.h +++ b/lib/kofficecore/KoChild.h @@ -19,18 +19,18 @@ #ifndef __koChild_h__ #define __koChild_h__ -#include -#include +#include +#include #include /** - * KoChild is an abstract base class that represents the geometry + * KoChild is an abstract base class that represents the tqgeometry * associated with an embedded document. In general it handles its position - * relative to the embedded document's parent. + * relative to the embedded document's tqparent. * * In detail it handles size, matrix operations and can give you * a clip region. It can deal with scaling, rotation etc. because it - * makes heavy usage of QWMatrix. + * makes heavy usage of TQWMatrix. * * After applying the matrix, viewGeometry() applies zooming, but can be * reimplemented to also apply e.g. some translation by the application @@ -38,9 +38,10 @@ * * @see KoDocumentChild KoViewChild */ -class KOFFICECORE_EXPORT KoChild : public QObject +class KOFFICECORE_EXPORT KoChild : public TQObject { Q_OBJECT + TQ_OBJECT public: /** @@ -55,54 +56,54 @@ public: enum Gadget { NoGadget, TopLeft, TopMid, TopRight, MidLeft, MidRight, BottomLeft, BottomMid, BottomRight, Move }; - KoChild( QObject *parent = 0, const char *name = 0 ); + KoChild( TQObject *tqparent = 0, const char *name = 0 ); virtual ~KoChild(); /** - * Sets a new geometry for this child document. + * Sets a new tqgeometry for this child document. * Use noEmit = true if you do not want the 'changed'-signal to be emitted */ - void setGeometry( const QRect &rect, bool noEmit = false ); + void setGeometry( const TQRect &rect, bool noEmit = false ); /** * @return the rectangle that would be used to display this * child document if the child is not rotated or * subject to some other geometric transformation. - * The rectangle is in the coordinate system of the parent, + * The rectangle is in the coordinate system of the tqparent, * using unzoomed coordinates in points. * * @see #setGeometry */ - QRect geometry() const; + TQRect tqgeometry() const; /** * @return the region of this child part relative to the - * coordinate system of the parent. + * coordinate system of the tqparent. * The region is transformed with the passed * matrix. */ - virtual QRegion region( const QWMatrix& = QWMatrix() ) const; + virtual TQRegion region( const TQWMatrix& = TQWMatrix() ) const; /** * @return the polygon which surrounds the child part. The points - * are in coordinates of the parent. + * are in coordinates of the tqparent. * The points are transformed with the * passed matrix. */ - virtual QPointArray pointArray( const QWMatrix &matrix = QWMatrix() ) const; + virtual TQPointArray pointArray( const TQWMatrix &matrix = TQWMatrix() ) const; /** * Tests whether the part contains a certain point. The point is - * in the coordinate system of the parent. + * in the coordinate system of the tqparent. */ - //virtual bool contains( const QPoint& ) const; + //virtual bool tqcontains( const TQPoint& ) const; /** * @return the effective bounding rect after all transformations. * The coordinates of the rectangle are in the coordinate system - * of the parent. + * of the tqparent. */ - QRect boundingRect() const; + TQRect boundingRect() const; /** * Scales the content of the child part. However, that does not @@ -148,16 +149,16 @@ public: /** * Sets the center of the rotation to the point @p pos. */ - virtual void setRotationPoint( const QPoint& pos ); + virtual void setRotationPoint( const TQPoint& pos ); /** * @return the center of the rotation */ - virtual QPoint rotationPoint() const; + virtual TQPoint rotationPoint() const; /** * @return true if the child part is an orthogonal rectangle relative - * to its parents coordinate system. + * to its tqparents coordinate system. */ bool isRectangle() const; @@ -170,14 +171,14 @@ public: * of the current region with the childs region or whether only * the childs region is set. */ - virtual void setClipRegion( QPainter& painter, bool combine = true ); + virtual void setClipRegion( TQPainter& painter, bool combine = true ); /** * Transforms the painter (its worldmatrix and the clipping) * in such a way that the painter can be passed to the child part * for drawing. */ - virtual void transform( QPainter& painter ); + virtual void transform( TQPainter& painter ); /** * Sets the position of the content relative to the child frame. @@ -188,25 +189,25 @@ public: /** * @return the contents rectangle that is visible. - * This value depends on the scaling and the geometry. + * This value depends on the scaling and the tqgeometry. * This is the value that is passed to KoDocument::paintContent. * - * @see #xScaling #geometry + * @see #xScaling #tqgeometry */ - virtual QRect contentRect() const; + virtual TQRect contentRect() const; /** * @return the region of the child frame. * If solid is set to true the complete area of the child region * is returned, otherwise only the child border is returned. */ - virtual QRegion frameRegion( const QWMatrix& matrix = QWMatrix(), bool solid = false ) const; + virtual TQRegion frameRegion( const TQWMatrix& matrix = TQWMatrix(), bool solid = false ) const; /** - * @return the frame geometry including a border (6 pixels) as a point + * @return the frame tqgeometry including a border (6 pixels) as a point * array with 4 points, one for each corner, transformed by given matrix. */ - virtual QPointArray framePointArray( const QWMatrix &matrix = QWMatrix() ) const; + virtual TQPointArray framePointArray( const TQWMatrix &matrix = TQWMatrix() ) const; /** * @return the current transformation of this child as matrix. @@ -214,7 +215,7 @@ public: * * @see #updateMatrix */ - virtual QWMatrix matrix() const; + virtual TQWMatrix matrix() const; /** * Locks this child and stores the current transformation. @@ -233,11 +234,11 @@ public: void unlock(); /** - * If the child is locked, geometry changes + * If the child is locked, tqgeometry changes * (including scaling, rotation, ...) are not backed up. * * As long as this child is locked, the backed up - * geometry state can be recovered with oldPointArray. + * tqgeometry state can be recovered with oldPointArray. * * @return true when this child is locked. * @@ -246,9 +247,9 @@ public: bool locked() const; /** - * @return the backed up geometry transformed by given matrix. + * @return the backed up tqgeometry transformed by given matrix. */ - virtual QPointArray oldPointArray( const QWMatrix &matrix ); + virtual TQPointArray oldPointArray( const TQWMatrix &matrix ); /** * Marks this child as either transparent or not. @@ -260,7 +261,7 @@ public: virtual void setTransparent( bool transparent ); /** - * It might be interesting for view updates and repainting in general + * It might be interesting for view updates and tqrepainting in general * whether a child is transparent or not. * @return true when this child is marked as transparent. */ @@ -275,7 +276,7 @@ public: * * @see #Gadget */ - virtual Gadget gadgetHitTest( const QPoint& p ); + virtual Gadget gadgetHitTest( const TQPoint& p ); signals: @@ -295,7 +296,7 @@ protected: * @param matrix the transformation of r. * @param r the rectangle for which the point array should be created. */ - virtual QPointArray pointArray( const QRect& r, const QWMatrix& matrix = QWMatrix() ) const; + virtual TQPointArray pointArray( const TQRect& r, const TQWMatrix& matrix = TQWMatrix() ) const; /** * Stores the current transformation of this child into a matrix. diff --git a/lib/kofficecore/KoContainerHandler.cpp b/lib/kofficecore/KoContainerHandler.cpp index 78060592d..1f21df24b 100644 --- a/lib/kofficecore/KoContainerHandler.cpp +++ b/lib/kofficecore/KoContainerHandler.cpp @@ -23,7 +23,7 @@ #include #include -KoEventHandler::KoEventHandler( QObject* target ) +KoEventHandler::KoEventHandler( TQObject* target ) { m_target = target; @@ -34,7 +34,7 @@ KoEventHandler::~KoEventHandler() { } -QObject* KoEventHandler::target() +TQObject* KoEventHandler::target() { return m_target; } @@ -43,11 +43,11 @@ QObject* KoEventHandler::target() class KoPartResizeHandlerPrivate { public: - KoPartResizeHandlerPrivate( const QWMatrix& matrix, KoView *view, KoChild* child, - KoChild::Gadget gadget, const QPoint& point ) : + KoPartResizeHandlerPrivate( const TQWMatrix& matrix, KoView *view, KoChild* child, + KoChild::Gadget gadget, const TQPoint& point ) : m_gadget(gadget), m_view(view), m_child(child), m_parentMatrix(matrix) { - m_geometryStart = child->geometry(); + m_tqgeometryStart = child->tqgeometry(); m_matrix = child->matrix() * matrix; m_invertParentMatrix = matrix.invert(); @@ -59,19 +59,19 @@ public: ~KoPartResizeHandlerPrivate() {} KoChild::Gadget m_gadget; - QPoint m_mouseStart; - QRect m_geometryStart; + TQPoint m_mouseStart; + TQRect m_tqgeometryStart; KoView* m_view; KoChild* m_child; - QWMatrix m_invert; - QWMatrix m_matrix; - QWMatrix m_parentMatrix; - QWMatrix m_invertParentMatrix; + TQWMatrix m_invert; + TQWMatrix m_matrix; + TQWMatrix m_parentMatrix; + TQWMatrix m_invertParentMatrix; }; -KoPartResizeHandler::KoPartResizeHandler( QWidget* widget, const QWMatrix& matrix, KoView* view, KoChild* child, - KoChild::Gadget gadget, const QPoint& point ) - : KoEventHandler( widget ) +KoPartResizeHandler::KoPartResizeHandler( TQWidget* widget, const TQWMatrix& matrix, KoView* view, KoChild* child, + KoChild::Gadget gadget, const TQPoint& point ) + : KoEventHandler( TQT_TQOBJECT(widget) ) { child->lock(); d=new KoPartResizeHandlerPrivate(matrix, view, child, gadget, point); @@ -84,25 +84,25 @@ KoPartResizeHandler::~KoPartResizeHandler() d=0L; } -void KoPartResizeHandler::repaint(QRegion &rgn) +void KoPartResizeHandler::tqrepaint(TQRegion &rgn) { rgn = rgn.unite( d->m_child->frameRegion( d->m_parentMatrix, true ) ); // rgn.translate(- d->m_view->canvasXOffset(), - d->m_view->canvasYOffset()); - ((QWidget*)target())->repaint( rgn ); + ((TQWidget*)target())->tqrepaint( rgn ); } -bool KoPartResizeHandler::eventFilter( QObject*, QEvent* ev ) +bool KoPartResizeHandler::eventFilter( TQObject*, TQEvent* ev ) { - if ( ev->type() == QEvent::MouseButtonRelease ) + if ( ev->type() == TQEvent::MouseButtonRelease ) { delete this; return true; } - else if ( ev->type() == QEvent::MouseMove ) + else if ( ev->type() == TQEvent::MouseMove ) { - QMouseEvent* e = (QMouseEvent*)ev; - QPoint p = d->m_invert.map( d->m_invertParentMatrix.map( e->pos() /*+ QPoint(d->m_view->canvasXOffset(), d->m_view->canvasYOffset()) */ ) ); - QRegion rgn( d->m_child->frameRegion( d->m_parentMatrix, true ) ); + TQMouseEvent* e = (TQMouseEvent*)ev; + TQPoint p = d->m_invert.map( d->m_invertParentMatrix.map( e->pos() /*+ TQPoint(d->m_view->canvasXOffset(), d->m_view->canvasYOffset()) */ ) ); + TQRegion rgn( d->m_child->frameRegion( d->m_parentMatrix, true ) ); double x1_x, x1_y, x2_x, x2_y; d->m_matrix.map( double( p.x() ), 0.0, &x1_x, &x1_y ); @@ -123,78 +123,78 @@ bool KoPartResizeHandler::eventFilter( QObject*, QEvent* ev ) { case KoChild::TopLeft: { - x = QMIN( d->m_geometryStart.width() - 1, x ); - y = QMIN( d->m_geometryStart.height() - 1, y ); + x = TQMIN( d->m_tqgeometryStart.width() - 1, x ); + y = TQMIN( d->m_tqgeometryStart.height() - 1, y ); - d->m_child->setGeometry( QRect( d->m_geometryStart.x() + x, d->m_geometryStart.y() + y, - d->m_geometryStart.width() - x, d->m_geometryStart.height() - y ) ); - repaint(rgn); + d->m_child->setGeometry( TQRect( d->m_tqgeometryStart.x() + x, d->m_tqgeometryStart.y() + y, + d->m_tqgeometryStart.width() - x, d->m_tqgeometryStart.height() - y ) ); + tqrepaint(rgn); } break; case KoChild::TopMid: { - y = QMIN( d->m_geometryStart.height() - 1, y ); + y = TQMIN( d->m_tqgeometryStart.height() - 1, y ); - d->m_child->setGeometry( QRect( d->m_geometryStart.x(), d->m_geometryStart.y() + y, - d->m_geometryStart.width(), d->m_geometryStart.height() - y ) ); - repaint(rgn); + d->m_child->setGeometry( TQRect( d->m_tqgeometryStart.x(), d->m_tqgeometryStart.y() + y, + d->m_tqgeometryStart.width(), d->m_tqgeometryStart.height() - y ) ); + tqrepaint(rgn); } break; case KoChild::TopRight: { - x = QMAX( -d->m_geometryStart.width() + 1, x ); - y = QMIN( d->m_geometryStart.height() - 1, y ); + x = TQMAX( -d->m_tqgeometryStart.width() + 1, x ); + y = TQMIN( d->m_tqgeometryStart.height() - 1, y ); - d->m_child->setGeometry( QRect( d->m_geometryStart.x(), d->m_geometryStart.y() + y, - d->m_geometryStart.width() + x, d->m_geometryStart.height() - y ) ); - repaint(rgn); + d->m_child->setGeometry( TQRect( d->m_tqgeometryStart.x(), d->m_tqgeometryStart.y() + y, + d->m_tqgeometryStart.width() + x, d->m_tqgeometryStart.height() - y ) ); + tqrepaint(rgn); } break; case KoChild::MidLeft: { - x = QMIN( d->m_geometryStart.width() - 1, x ); + x = TQMIN( d->m_tqgeometryStart.width() - 1, x ); - d->m_child->setGeometry( QRect( d->m_geometryStart.x() + x, d->m_geometryStart.y(), - d->m_geometryStart.width() - x, d->m_geometryStart.height() ) ); - repaint(rgn); + d->m_child->setGeometry( TQRect( d->m_tqgeometryStart.x() + x, d->m_tqgeometryStart.y(), + d->m_tqgeometryStart.width() - x, d->m_tqgeometryStart.height() ) ); + tqrepaint(rgn); } break; case KoChild::MidRight: { - x = QMAX( -d->m_geometryStart.width() + 1, x ); + x = TQMAX( -d->m_tqgeometryStart.width() + 1, x ); - d->m_child->setGeometry( QRect( d->m_geometryStart.x(), d->m_geometryStart.y(), - d->m_geometryStart.width() + x, d->m_geometryStart.height() ) ); - repaint(rgn); + d->m_child->setGeometry( TQRect( d->m_tqgeometryStart.x(), d->m_tqgeometryStart.y(), + d->m_tqgeometryStart.width() + x, d->m_tqgeometryStart.height() ) ); + tqrepaint(rgn); } break; case KoChild::BottomLeft: { - x = QMIN( d->m_geometryStart.width() - 1, x ); - y = QMAX( -d->m_geometryStart.height() + 1, y ); + x = TQMIN( d->m_tqgeometryStart.width() - 1, x ); + y = TQMAX( -d->m_tqgeometryStart.height() + 1, y ); - d->m_child->setGeometry( QRect( d->m_geometryStart.x() + x, d->m_geometryStart.y(), - d->m_geometryStart.width() - x, d->m_geometryStart.height() + y ) ); - repaint(rgn); + d->m_child->setGeometry( TQRect( d->m_tqgeometryStart.x() + x, d->m_tqgeometryStart.y(), + d->m_tqgeometryStart.width() - x, d->m_tqgeometryStart.height() + y ) ); + tqrepaint(rgn); } break; case KoChild::BottomMid: { - y = QMAX( -d->m_geometryStart.height() + 1, y ); + y = TQMAX( -d->m_tqgeometryStart.height() + 1, y ); - d->m_child->setGeometry( QRect( d->m_geometryStart.x(), d->m_geometryStart.y(), - d->m_geometryStart.width(), d->m_geometryStart.height() + y ) ); - repaint(rgn); + d->m_child->setGeometry( TQRect( d->m_tqgeometryStart.x(), d->m_tqgeometryStart.y(), + d->m_tqgeometryStart.width(), d->m_tqgeometryStart.height() + y ) ); + tqrepaint(rgn); } break; case KoChild::BottomRight: { - x = QMAX( -d->m_geometryStart.width() + 1, x ); - y = QMAX( -d->m_geometryStart.height() + 1, y ); + x = TQMAX( -d->m_tqgeometryStart.width() + 1, x ); + y = TQMAX( -d->m_tqgeometryStart.height() + 1, y ); - d->m_child->setGeometry( QRect( d->m_geometryStart.x(), d->m_geometryStart.y(), - d->m_geometryStart.width() + x, d->m_geometryStart.height() + y ) ); - repaint(rgn); + d->m_child->setGeometry( TQRect( d->m_tqgeometryStart.x(), d->m_tqgeometryStart.y(), + d->m_tqgeometryStart.width() + x, d->m_tqgeometryStart.height() + y ) ); + tqrepaint(rgn); } break; default: @@ -209,28 +209,28 @@ bool KoPartResizeHandler::eventFilter( QObject*, QEvent* ev ) class KoPartMoveHandlerPrivate { public: - KoPartMoveHandlerPrivate( const QWMatrix& matrix, KoView* view, KoChild* child, - const QPoint& point) : m_view(view), m_dragChild(child), + KoPartMoveHandlerPrivate( const TQWMatrix& matrix, KoView* view, KoChild* child, + const TQPoint& point) : m_view(view), m_dragChild(child), m_parentMatrix(matrix) { m_invertParentMatrix = matrix.invert(); m_mouseDragStart = m_invertParentMatrix.map( point ); - m_geometryDragStart = m_dragChild->geometry(); + m_tqgeometryDragStart = m_dragChild->tqgeometry(); m_rotationDragStart = m_dragChild->rotationPoint(); } ~KoPartMoveHandlerPrivate() {} KoView* m_view; KoChild* m_dragChild; - QPoint m_mouseDragStart; - QRect m_geometryDragStart; - QPoint m_rotationDragStart; - QWMatrix m_invertParentMatrix; - QWMatrix m_parentMatrix; + TQPoint m_mouseDragStart; + TQRect m_tqgeometryDragStart; + TQPoint m_rotationDragStart; + TQWMatrix m_invertParentMatrix; + TQWMatrix m_parentMatrix; }; -KoPartMoveHandler::KoPartMoveHandler( QWidget* widget, const QWMatrix& matrix, KoView* view, KoChild* child, - const QPoint& point ) - : KoEventHandler( widget ) +KoPartMoveHandler::KoPartMoveHandler( TQWidget* widget, const TQWMatrix& matrix, KoView* view, KoChild* child, + const TQPoint& point ) + : KoEventHandler( TQT_TQOBJECT(widget) ) { child->lock(); d=new KoPartMoveHandlerPrivate(matrix, view, child, point); @@ -243,27 +243,27 @@ KoPartMoveHandler::~KoPartMoveHandler() d=0L; } -bool KoPartMoveHandler::eventFilter( QObject*, QEvent* ev ) +bool KoPartMoveHandler::eventFilter( TQObject*, TQEvent* ev ) { - if ( ev->type() == QEvent::MouseButtonRelease ) + if ( ev->type() == TQEvent::MouseButtonRelease ) { delete this; return true; } - else if ( ev->type() == QEvent::MouseMove ) + else if ( ev->type() == TQEvent::MouseMove ) { - QMouseEvent* e = (QMouseEvent*)ev; - - QRegion bound = d->m_dragChild->frameRegion( d->m_parentMatrix, true ); - QPoint pos = d->m_invertParentMatrix.map( e->pos() /* + QPoint(d->m_view->canvasXOffset(), d->m_view->canvasYOffset()) */ ); - d->m_dragChild->setGeometry( QRect( d->m_geometryDragStart.x() + pos.x() - d->m_mouseDragStart.x(), - d->m_geometryDragStart.y() + pos.y() - d->m_mouseDragStart.y(), - d->m_geometryDragStart.width(), d->m_geometryDragStart.height() ) ); - d->m_dragChild->setRotationPoint( QPoint( d->m_rotationDragStart.x() + pos.x() - d->m_mouseDragStart.x(), + TQMouseEvent* e = (TQMouseEvent*)ev; + + TQRegion bound = d->m_dragChild->frameRegion( d->m_parentMatrix, true ); + TQPoint pos = d->m_invertParentMatrix.map( e->pos() /* + TQPoint(d->m_view->canvasXOffset(), d->m_view->canvasYOffset()) */ ); + d->m_dragChild->setGeometry( TQRect( d->m_tqgeometryDragStart.x() + pos.x() - d->m_mouseDragStart.x(), + d->m_tqgeometryDragStart.y() + pos.y() - d->m_mouseDragStart.y(), + d->m_tqgeometryDragStart.width(), d->m_tqgeometryDragStart.height() ) ); + d->m_dragChild->setRotationPoint( TQPoint( d->m_rotationDragStart.x() + pos.x() - d->m_mouseDragStart.x(), d->m_rotationDragStart.y() + pos.y() - d->m_mouseDragStart.y() ) ); bound = bound.unite( d->m_dragChild->frameRegion( d->m_parentMatrix, false ) ); // bound.translate(- d->m_view->canvasXOffset(), - d->m_view->canvasYOffset()); - ((QWidget*)target())->repaint( bound ); + ((TQWidget*)target())->tqrepaint( bound ); return true; } @@ -273,8 +273,8 @@ bool KoPartMoveHandler::eventFilter( QObject*, QEvent* ev ) // ------------------------------------------------------- -KoContainerHandler::KoContainerHandler( KoView* view, QWidget* widget ) - : KoEventHandler( widget ) +KoContainerHandler::KoContainerHandler( KoView* view, TQWidget* widget ) + : KoEventHandler( TQT_TQOBJECT(widget) ) { m_view = view; } @@ -283,51 +283,51 @@ KoContainerHandler::~KoContainerHandler() { } -bool KoContainerHandler::eventFilter( QObject*, QEvent* ev ) +bool KoContainerHandler::eventFilter( TQObject*, TQEvent* ev ) { - if ( ev->type() == QEvent::KeyPress ) + if ( ev->type() == TQEvent::KeyPress ) { - QKeyEvent* keyEvent=(QKeyEvent*)ev; + TQKeyEvent* keyEvent=(TQKeyEvent*)ev; KoChild* child=m_view->selectedChild(); if (child != 0) { - if (keyEvent->key()==Qt::Key_Delete) + if (keyEvent->key()==TQt::Key_Delete) emit deleteChild(child); } } - if ( ev->type() == QEvent::MouseButtonPress ) + if ( ev->type() == TQEvent::MouseButtonPress ) { KoChild::Gadget gadget; - QPoint pos; - QMouseEvent *e=static_cast(ev); + TQPoint pos; + TQMouseEvent *e=TQT_TQMOUSEEVENT(ev); KoChild *ch=child(gadget, pos, e); - if ( e->button() == RightButton && gadget != KoChild::NoGadget ) + if ( e->button() == Qt::RightButton && gadget != KoChild::NoGadget ) { emit popupMenu( ch, e->globalPos() ); return true; } - else if ( e->button() == LeftButton && gadget == KoChild::Move ) + else if ( e->button() == Qt::LeftButton && gadget == KoChild::Move ) { - (void)new KoPartMoveHandler( static_cast(target()), m_view->matrix(), m_view, ch, pos ); + (void)new KoPartMoveHandler( TQT_TQWIDGET(target()), m_view->matrix(), m_view, ch, pos ); return true; } - else if ( e->button() == LeftButton && gadget != KoChild::NoGadget ) + else if ( e->button() == Qt::LeftButton && gadget != KoChild::NoGadget ) { - (void)new KoPartResizeHandler( static_cast(target()), m_view->matrix(), m_view, ch, gadget, pos ); + (void)new KoPartResizeHandler( TQT_TQWIDGET(target()), m_view->matrix(), m_view, ch, gadget, pos ); return true; } return false; } - else if ( ev->type() == QEvent::MouseMove ) + else if ( ev->type() == TQEvent::MouseMove ) { - QWidget *targetWidget = static_cast( target() ); + TQWidget *targetWidget = TQT_TQWIDGET( target() ); KoChild::Gadget gadget; - QPoint pos; - QMouseEvent *e=static_cast(ev); + TQPoint pos; + TQMouseEvent *e=TQT_TQMOUSEEVENT(ev); child(gadget, pos, e); bool retval = true; @@ -354,9 +354,9 @@ bool KoContainerHandler::eventFilter( QObject*, QEvent* ev ) return false; } -KoChild *KoContainerHandler::child(KoChild::Gadget &gadget, QPoint &pos, const QMouseEvent *ev) { +KoChild *KoContainerHandler::child(KoChild::Gadget &gadget, TQPoint &pos, const TQMouseEvent *ev) { - pos = ev->pos(); //+ QPoint(m_view->canvasXOffset(), m_view->canvasYOffset()); + pos = ev->pos(); //+ TQPoint(m_view->canvasXOffset(), m_view->canvasYOffset()); pos = m_view->reverseViewTransformations( pos ); diff --git a/lib/kofficecore/KoContainerHandler.h b/lib/kofficecore/KoContainerHandler.h index d34d05007..0ea9ba35f 100644 --- a/lib/kofficecore/KoContainerHandler.h +++ b/lib/kofficecore/KoContainerHandler.h @@ -20,10 +20,10 @@ #ifndef HANDLER_H #define HANDLER_H -#include +#include #include -class QWMatrix; +class TQWMatrix; class KoView; class KoPartResizeHandlerPrivate; @@ -40,17 +40,18 @@ class KoPartMoveHandlerPrivate; * This design pattern helps you to keep your event filters * and your mousePressEvent, mouseMoveEvent etc. methods clean. */ -class KOFFICECORE_EXPORT KoEventHandler : public QObject +class KOFFICECORE_EXPORT KoEventHandler : public TQObject { Q_OBJECT + TQ_OBJECT public: - KoEventHandler( QObject* target ); + KoEventHandler( TQObject* target ); ~KoEventHandler(); - QObject* target(); + TQObject* target(); private: - QObject* m_target; + TQObject* m_target; }; /** @@ -60,14 +61,15 @@ private: class KoPartResizeHandler : public KoEventHandler { Q_OBJECT + TQ_OBJECT public: - KoPartResizeHandler( QWidget* widget, const QWMatrix& matrix, KoView* view, KoChild* child, - KoChild::Gadget gadget, const QPoint& point ); + KoPartResizeHandler( TQWidget* widget, const TQWMatrix& matrix, KoView* view, KoChild* child, + KoChild::Gadget gadget, const TQPoint& point ); ~KoPartResizeHandler(); protected: - void repaint(QRegion &rgn); - bool eventFilter( QObject*, QEvent* ); + void tqrepaint(TQRegion &rgn); + bool eventFilter( TQObject*, TQEvent* ); private: KoPartResizeHandlerPrivate *d; @@ -80,13 +82,14 @@ private: class KoPartMoveHandler : public KoEventHandler { Q_OBJECT + TQ_OBJECT public: - KoPartMoveHandler( QWidget* widget, const QWMatrix& matrix, KoView* view, KoChild* child, - const QPoint& point ); + KoPartMoveHandler( TQWidget* widget, const TQWMatrix& matrix, KoView* view, KoChild* child, + const TQPoint& point ); ~KoPartMoveHandler(); protected: - bool eventFilter( QObject*, QEvent* ); + bool eventFilter( TQObject*, TQEvent* ); private: KoPartMoveHandlerPrivate *d; @@ -109,8 +112,9 @@ private: class KOFFICECORE_EXPORT KoContainerHandler : public KoEventHandler { Q_OBJECT + TQ_OBJECT public: - KoContainerHandler( KoView* view, QWidget* widget ); + KoContainerHandler( KoView* view, TQWidget* widget ); ~KoContainerHandler(); signals: @@ -118,7 +122,7 @@ signals: * Emitted if the user wants to open the popup menu for some * child object. */ - void popupMenu( KoChild*, const QPoint& global_pos ); + void popupMenu( KoChild*, const TQPoint& global_pos ); /** * Emitted if the user pressed the delete key whilst a child was selected @@ -126,11 +130,11 @@ signals: void deleteChild( KoChild* ); protected: - bool eventFilter( QObject*, QEvent* ); + bool eventFilter( TQObject*, TQEvent* ); private: /// This is a little helper function to get rid of some duplicated code - KoChild *child(KoChild::Gadget &gadget, QPoint &pos, const QMouseEvent *ev); + KoChild *child(KoChild::Gadget &gadget, TQPoint &pos, const TQMouseEvent *ev); KoView* m_view; }; diff --git a/lib/kofficecore/KoDetailsPane.cpp b/lib/kofficecore/KoDetailsPane.cpp index d94a01f75..85d9c3d6f 100644 --- a/lib/kofficecore/KoDetailsPane.cpp +++ b/lib/kofficecore/KoDetailsPane.cpp @@ -18,17 +18,17 @@ */ #include "KoDetailsPane.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -47,8 +47,8 @@ class KoFileListItem : public KListViewItem { public: - KoFileListItem(KListView* listView, QListViewItem* after, const QString& filename, - const QString& fullPath, KFileItem* fileItem) + KoFileListItem(KListView* listView, TQListViewItem* after, const TQString& filename, + const TQString& fullPath, KFileItem* fileItem) : KListViewItem(listView, after, filename, fullPath), m_fileItem(fileItem) { } @@ -77,13 +77,13 @@ class KoTemplatesPanePrivate KInstance* m_instance; bool m_selected; - QString m_alwaysUseTemplate; + TQString m_alwaysUseTemplate; }; -KoTemplatesPane::KoTemplatesPane(QWidget* parent, KInstance* instance, +KoTemplatesPane::KoTemplatesPane(TQWidget* tqparent, KInstance* instance, KoTemplateGroup *group, KoTemplate* /*defaultTemplate*/) - : KoDetailsPaneBase(parent, "TemplatesPane") + : KoDetailsPaneBase(tqparent, "TemplatesPane") { d = new KoTemplatesPanePrivate; d->m_instance = instance; @@ -98,24 +98,24 @@ KoTemplatesPane::KoTemplatesPane(QWidget* parent, KInstance* instance, m_openButton->setGuiItem(openGItem); m_documentList->header()->hide(); KConfigGroup cfgGrp(d->m_instance->config(), "TemplateChooserDialog"); - QString fullTemplateName = cfgGrp.readPathEntry("FullTemplateName"); + TQString fullTemplateName = cfgGrp.readPathEntry("FullTemplateName"); d->m_alwaysUseTemplate = cfgGrp.readPathEntry("AlwaysUseTemplate"); - connect(m_alwaysUseCheckBox, SIGNAL(clicked()), this, SLOT(alwaysUseClicked())); + connect(m_alwaysUseCheckBox, TQT_SIGNAL(clicked()), this, TQT_SLOT(alwaysUseClicked())); changePalette(); if(kapp) { - connect(kapp, SIGNAL(kdisplayPaletteChanged()), this, SLOT(changePalette())); + connect(kapp, TQT_SIGNAL(kdisplayPaletteChanged()), this, TQT_SLOT(changePalette())); } KListViewItem* selectItem = 0; for (KoTemplate* t = group->first(); t != 0L; t = group->next()) { KListViewItem* item = new KListViewItem(m_documentList, t->name(), t->description(), t->file()); - QImage icon = t->loadPicture(instance).convertToImage(); - icon = icon.smoothScale(64, 64, QImage::ScaleMin); + TQImage icon = t->loadPicture(instance).convertToImage(); + icon = icon.smoothScale(64, 64, TQ_ScaleMin); icon.setAlphaBuffer(true); icon = icon.copy((icon.width() - 64) / 2, (icon.height() - 64) / 2, 64, 64); - item->setPixmap(0, QPixmap(icon)); + item->setPixmap(0, TQPixmap(icon)); item->setPixmap(2, t->loadPicture(instance)); if(d->m_alwaysUseTemplate == t->file()) { @@ -125,13 +125,13 @@ KoTemplatesPane::KoTemplatesPane(QWidget* parent, KInstance* instance, } } - connect(m_documentList, SIGNAL(selectionChanged(QListViewItem*)), - this, SLOT(selectionChanged(QListViewItem*))); - connect(m_documentList, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)), - this, SLOT(openTemplate(QListViewItem*))); - connect(m_documentList, SIGNAL(returnPressed(QListViewItem*)), - this, SLOT(openTemplate(QListViewItem*))); - connect(m_openButton, SIGNAL(clicked()), this, SLOT(openTemplate())); + connect(m_documentList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), + this, TQT_SLOT(selectionChanged(TQListViewItem*))); + connect(m_documentList, TQT_SIGNAL(doubleClicked(TQListViewItem*, const TQPoint&, int)), + this, TQT_SLOT(openTemplate(TQListViewItem*))); + connect(m_documentList, TQT_SIGNAL(returnPressed(TQListViewItem*)), + this, TQT_SLOT(openTemplate(TQListViewItem*))); + connect(m_openButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(openTemplate())); if(selectItem) { m_documentList->setSelected(selectItem, true); @@ -146,7 +146,7 @@ KoTemplatesPane::~KoTemplatesPane() delete d; } -void KoTemplatesPane::selectionChanged(QListViewItem* item) +void KoTemplatesPane::selectionChanged(TQListViewItem* item) { if(item) { m_openButton->setEnabled(true); @@ -159,18 +159,18 @@ void KoTemplatesPane::selectionChanged(QListViewItem* item) m_openButton->setEnabled(false); m_alwaysUseCheckBox->setEnabled(false); m_alwaysUseCheckBox->setChecked(false); - m_titleLabel->setText(QString::null); - m_previewLabel->setPixmap(QPixmap()); + m_titleLabel->setText(TQString()); + m_previewLabel->setPixmap(TQPixmap()); } } void KoTemplatesPane::openTemplate() { - QListViewItem* item = m_documentList->selectedItem(); + TQListViewItem* item = m_documentList->selectedItem(); openTemplate(item); } -void KoTemplatesPane::openTemplate(QListViewItem* item) +void KoTemplatesPane::openTemplate(TQListViewItem* item) { if(item) { KConfigGroup cfgGrp(d->m_instance->config(), "TemplateChooserDialog"); @@ -183,9 +183,9 @@ void KoTemplatesPane::openTemplate(QListViewItem* item) void KoTemplatesPane::changePalette() { - QPalette p = kapp ? kapp->palette() : palette(); - p.setBrush(QColorGroup::Base, p.brush(QPalette::Normal, QColorGroup::Background)); - p.setColor(QColorGroup::Text, p.color(QPalette::Normal, QColorGroup::Foreground)); + TQPalette p = kapp ? kapp->palette() : palette(); + p.setBrush(TQColorGroup::Base, p.brush(TQPalette::Normal, TQColorGroup::Background)); + p.setColor(TQColorGroup::Text, p.color(TQPalette::Normal, TQColorGroup::Foreground)); m_detailsLabel->setPalette(p); } @@ -196,12 +196,12 @@ bool KoTemplatesPane::isSelected() void KoTemplatesPane::alwaysUseClicked() { - QListViewItem* item = m_documentList->selectedItem(); + TQListViewItem* item = m_documentList->selectedItem(); if(!m_alwaysUseCheckBox->isChecked()) { KConfigGroup cfgGrp(d->m_instance->config(), "TemplateChooserDialog"); - cfgGrp.writeEntry("AlwaysUseTemplate", QString::null); - d->m_alwaysUseTemplate = QString::null; + cfgGrp.writeEntry("AlwaysUseTemplate", TQString()); + d->m_alwaysUseTemplate = TQString(); } else { d->m_alwaysUseTemplate = item->text(2); } @@ -209,12 +209,12 @@ void KoTemplatesPane::alwaysUseClicked() emit alwaysUseChanged(this, d->m_alwaysUseTemplate); } -void KoTemplatesPane::changeAlwaysUseTemplate(KoTemplatesPane* sender, const QString& alwaysUse) +void KoTemplatesPane::changeAlwaysUseTemplate(KoTemplatesPane* sender, const TQString& alwaysUse) { if(this == sender) return; - QListViewItem* item = m_documentList->selectedItem(); + TQListViewItem* item = m_documentList->selectedItem(); // If the old always use template is selected uncheck the checkbox if(item && (item->text(2) == d->m_alwaysUseTemplate)) { @@ -224,16 +224,16 @@ void KoTemplatesPane::changeAlwaysUseTemplate(KoTemplatesPane* sender, const QSt d->m_alwaysUseTemplate = alwaysUse; } -bool KoTemplatesPane::eventFilter(QObject* watched, QEvent* e) +bool KoTemplatesPane::eventFilter(TQObject* watched, TQEvent* e) { - if(watched == m_previewLabel) { - if(e->type() == QEvent::MouseButtonDblClick) { + if(TQT_BASE_OBJECT(watched) == m_previewLabel) { + if(e->type() == TQEvent::MouseButtonDblClick) { openTemplate(); } } - if(watched == m_documentList) { - if((e->type() == QEvent::Resize) && isShown()) { + if(TQT_BASE_OBJECT(watched) == m_documentList) { + if((e->type() == TQEvent::Resize) && isShown()) { emit splitterResized(this, m_splitter->sizes()); } } @@ -241,7 +241,7 @@ bool KoTemplatesPane::eventFilter(QObject* watched, QEvent* e) return false; } -void KoTemplatesPane::resizeSplitter(KoDetailsPaneBase* sender, const QValueList& sizes) +void KoTemplatesPane::resizeSplitter(KoDetailsPaneBase* sender, const TQValueList& sizes) { if(sender == this) return; @@ -268,8 +268,8 @@ class KoRecentDocumentsPanePrivate KInstance* m_instance; }; -KoRecentDocumentsPane::KoRecentDocumentsPane(QWidget* parent, KInstance* instance) - : KoDetailsPaneBase(parent, "RecentDocsPane") +KoRecentDocumentsPane::KoRecentDocumentsPane(TQWidget* tqparent, KInstance* instance) + : KoDetailsPaneBase(tqparent, "RecentDocsPane") { d = new KoRecentDocumentsPanePrivate; d->m_instance = instance; @@ -284,28 +284,28 @@ KoRecentDocumentsPane::KoRecentDocumentsPane(QWidget* parent, KInstance* instanc changePalette(); if(kapp) { - connect(kapp, SIGNAL(kdisplayPaletteChanged()), this, SLOT(changePalette())); + connect(kapp, TQT_SIGNAL(kdisplayPaletteChanged()), this, TQT_SLOT(changePalette())); } - QString oldGroup = instance->config()->group(); + TQString oldGroup = instance->config()->group(); instance->config()->setGroup("RecentFiles"); int i = 0; - QString value; + TQString value; KFileItemList fileList; fileList.setAutoDelete(false); do { - QString key = QString("File%1").arg(i); + TQString key = TQString("File%1").tqarg(i); value = instance->config()->readPathEntry(key); if(!value.isEmpty()) { - QString path = value; - QString name; + TQString path = value; + TQString name; // Support for kdelibs-3.5's new RecentFiles format: name[url] if(path.endsWith("]")) { - int pos = path.find("["); + int pos = path.tqfind("["); name = path.mid(0, pos - 1); path = path.mid(pos + 1, path.length() - pos - 2); } @@ -315,16 +315,16 @@ KoRecentDocumentsPane::KoRecentDocumentsPane(QWidget* parent, KInstance* instanc if(name.isEmpty()) name = url.filename(); - if(!url.isLocalFile() || QFile::exists(url.path())) { + if(!url.isLocalFile() || TQFile::exists(url.path())) { KFileItem* fileItem = new KFileItem(KFileItem::Unknown, KFileItem::Unknown, url); fileList.append(fileItem); KoFileListItem* item = new KoFileListItem(m_documentList, m_documentList->lastItem(), name, url.url(), fileItem); //center all icons in 64x64 area - QImage icon = fileItem->pixmap(64).convertToImage(); + TQImage icon = fileItem->pixmap(64).convertToImage(); icon.setAlphaBuffer(true); icon = icon.copy((icon.width() - 64) / 2, (icon.height() - 64) / 2, 64, 64); - item->setPixmap(0, QPixmap(icon)); + item->setPixmap(0, TQPixmap(icon)); item->setPixmap(2, fileItem->pixmap(128)); } } @@ -334,23 +334,23 @@ KoRecentDocumentsPane::KoRecentDocumentsPane(QWidget* parent, KInstance* instanc instance->config()->setGroup( oldGroup ); - connect(m_documentList, SIGNAL(selectionChanged(QListViewItem*)), - this, SLOT(selectionChanged(QListViewItem*))); - connect(m_documentList, SIGNAL(clicked(QListViewItem*)), - this, SLOT(selectionChanged(QListViewItem*))); - connect(m_documentList, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)), - this, SLOT(openFile(QListViewItem*))); - connect(m_documentList, SIGNAL(returnPressed(QListViewItem*)), - this, SLOT(openFile(QListViewItem*))); - connect(m_openButton, SIGNAL(clicked()), this, SLOT(openFile())); + connect(m_documentList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), + this, TQT_SLOT(selectionChanged(TQListViewItem*))); + connect(m_documentList, TQT_SIGNAL(clicked(TQListViewItem*)), + this, TQT_SLOT(selectionChanged(TQListViewItem*))); + connect(m_documentList, TQT_SIGNAL(doubleClicked(TQListViewItem*, const TQPoint&, int)), + this, TQT_SLOT(openFile(TQListViewItem*))); + connect(m_documentList, TQT_SIGNAL(returnPressed(TQListViewItem*)), + this, TQT_SLOT(openFile(TQListViewItem*))); + connect(m_openButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(openFile())); m_documentList->setSelected(m_documentList->firstChild(), true); d->m_previewJob = KIO::filePreview(fileList, 200, 200); - connect(d->m_previewJob, SIGNAL(result(KIO::Job*)), this, SLOT(previewResult(KIO::Job*))); - connect(d->m_previewJob, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)), - this, SLOT(updatePreview(const KFileItem*, const QPixmap&))); + connect(d->m_previewJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(previewResult(KIO::Job*))); + connect(d->m_previewJob, TQT_SIGNAL(gotPreview(const KFileItem*, const TQPixmap&)), + this, TQT_SLOT(updatePreview(const KFileItem*, const TQPixmap&))); } KoRecentDocumentsPane::~KoRecentDocumentsPane() @@ -358,7 +358,7 @@ KoRecentDocumentsPane::~KoRecentDocumentsPane() delete d; } -void KoRecentDocumentsPane::selectionChanged(QListViewItem* item) +void KoRecentDocumentsPane::selectionChanged(TQListViewItem* item) { if(item) { m_openButton->setEnabled(true); @@ -367,31 +367,31 @@ void KoRecentDocumentsPane::selectionChanged(QListViewItem* item) if(static_cast(item)->fileItem()) { KFileItem* fileItem = static_cast(item)->fileItem(); - QString details = "
"; + TQString details = "
"; details += i18n("File modification date and time. %1 is date time", "") - .arg(fileItem->timeString(KIO::UDS_MODIFICATION_TIME)); + .tqarg(fileItem->timeString(KIO::UDS_MODIFICATION_TIME)); details += i18n("File access date and time. %1 is date time", "") - .arg(fileItem->timeString(KIO::UDS_ACCESS_TIME)); + .tqarg(fileItem->timeString(KIO::UDS_ACCESS_TIME)); details += "
Modified:%1
Accessed:%1
"; m_detailsLabel->setText(details); } else { - m_detailsLabel->setText(QString::null); + m_detailsLabel->setText(TQString()); } } else { m_openButton->setEnabled(false); - m_titleLabel->setText(QString::null); - m_previewLabel->setPixmap(QPixmap()); - m_detailsLabel->setText(QString::null); + m_titleLabel->setText(TQString()); + m_previewLabel->setPixmap(TQPixmap()); + m_detailsLabel->setText(TQString()); } } void KoRecentDocumentsPane::openFile() { - QListViewItem* item = m_documentList->selectedItem(); + TQListViewItem* item = m_documentList->selectedItem(); openFile(item); } -void KoRecentDocumentsPane::openFile(QListViewItem* item) +void KoRecentDocumentsPane::openFile(TQListViewItem* item) { KConfigGroup cfgGrp(d->m_instance->config(), "TemplateChooserDialog"); cfgGrp.writeEntry("LastReturnType", "File"); @@ -406,22 +406,22 @@ void KoRecentDocumentsPane::previewResult(KIO::Job* job) d->m_previewJob = 0; } -void KoRecentDocumentsPane::updatePreview(const KFileItem* fileItem, const QPixmap& preview) +void KoRecentDocumentsPane::updatePreview(const KFileItem* fileItem, const TQPixmap& preview) { if(preview.isNull()) { return; } - QListViewItemIterator it(m_documentList); + TQListViewItemIterator it(m_documentList); while(it.current()) { if(it.current()->text(1) == fileItem->url().url()) { it.current()->setPixmap(2, preview); - QImage icon = preview.convertToImage(); - icon = icon.smoothScale(64, 64, QImage::ScaleMin); + TQImage icon = preview.convertToImage(); + icon = icon.smoothScale(64, 64, TQ_ScaleMin); icon.setAlphaBuffer(true); icon = icon.copy((icon.width() - 64) / 2, (icon.height() - 64) / 2, 64, 64); - it.current()->setPixmap(0, QPixmap(icon)); + it.current()->setPixmap(0, TQPixmap(icon)); if(it.current()->isSelected()) { m_previewLabel->setPixmap(preview); @@ -436,22 +436,22 @@ void KoRecentDocumentsPane::updatePreview(const KFileItem* fileItem, const QPixm void KoRecentDocumentsPane::changePalette() { - QPalette p = kapp ? kapp->palette() : palette(); - p.setBrush(QColorGroup::Base, p.brush(QPalette::Normal, QColorGroup::Background)); - p.setColor(QColorGroup::Text, p.color(QPalette::Normal, QColorGroup::Foreground)); + TQPalette p = kapp ? kapp->palette() : palette(); + p.setBrush(TQColorGroup::Base, p.brush(TQPalette::Normal, TQColorGroup::Background)); + p.setColor(TQColorGroup::Text, p.color(TQPalette::Normal, TQColorGroup::Foreground)); m_detailsLabel->setPalette(p); } -bool KoRecentDocumentsPane::eventFilter(QObject* watched, QEvent* e) +bool KoRecentDocumentsPane::eventFilter(TQObject* watched, TQEvent* e) { - if(watched == m_previewLabel) { - if(e->type() == QEvent::MouseButtonDblClick) { + if(TQT_BASE_OBJECT(watched) == m_previewLabel) { + if(e->type() == TQEvent::MouseButtonDblClick) { openFile(); } } - if(watched == m_documentList) { - if((e->type() == QEvent::Resize) && isShown()) { + if(TQT_BASE_OBJECT(watched) == m_documentList) { + if((e->type() == TQEvent::Resize) && isShown()) { emit splitterResized(this, m_splitter->sizes()); } } @@ -459,7 +459,7 @@ bool KoRecentDocumentsPane::eventFilter(QObject* watched, QEvent* e) return false; } -void KoRecentDocumentsPane::resizeSplitter(KoDetailsPaneBase* sender, const QValueList& sizes) +void KoRecentDocumentsPane::resizeSplitter(KoDetailsPaneBase* sender, const TQValueList& sizes) { if(sender == this) return; diff --git a/lib/kofficecore/KoDetailsPane.h b/lib/kofficecore/KoDetailsPane.h index 96a92b985..bee6f14ac 100644 --- a/lib/kofficecore/KoDetailsPane.h +++ b/lib/kofficecore/KoDetailsPane.h @@ -26,11 +26,11 @@ class KoTemplateGroup; class KoTemplate; class KInstance; -class QListViewItem; +class TQListViewItem; class KoRecentDocumentsPanePrivate; class KoRichTextListItemPrivate; class KFileItem; -class QPixmap; +class TQPixmap; namespace KIO { class Job; @@ -40,46 +40,47 @@ class KoTemplatesPanePrivate; /** * This widget is the right-side part of the template opening widget. - * The parent widget is initial widget in the document space of each KOffice component. + * The tqparent widget is initial widget in the document space of each KOffice component. * This widget shows a list of templates and can show their details or open it. */ class KoTemplatesPane : public KoDetailsPaneBase { Q_OBJECT + TQ_OBJECT public: /** * Constructor. - * @param parent the parent widget + * @param tqparent the tqparent widget * @param instance the instance object for the app * @param group the group of templates this widget will show. * @param defaultTemplate pointer to the default template. Used to select a * template when none has been selected before. */ - KoTemplatesPane(QWidget* parent, KInstance* instance, + KoTemplatesPane(TQWidget* tqparent, KInstance* instance, KoTemplateGroup* group, KoTemplate* defaultTemplate); ~KoTemplatesPane(); /// Returns true if a template in this group was the last one selected bool isSelected(); - virtual bool eventFilter(QObject* watched, QEvent* e); + virtual bool eventFilter(TQObject* watched, TQEvent* e); signals: - void openTemplate(const QString&); + void openTemplate(const TQString&); /// Emited when the always use checkbox is selected - void alwaysUseChanged(KoTemplatesPane* sender, const QString& alwaysUse); + void alwaysUseChanged(KoTemplatesPane* sender, const TQString& alwaysUse); - void splitterResized(KoDetailsPaneBase* sender, const QValueList& sizes); + void splitterResized(KoDetailsPaneBase* sender, const TQValueList& sizes); public slots: - void resizeSplitter(KoDetailsPaneBase* sender, const QValueList& sizes); + void resizeSplitter(KoDetailsPaneBase* sender, const TQValueList& sizes); protected slots: - void selectionChanged(QListViewItem* item); + void selectionChanged(TQListViewItem* item); void openTemplate(); - void openTemplate(QListViewItem* item); + void openTemplate(TQListViewItem* item); void alwaysUseClicked(); - void changeAlwaysUseTemplate(KoTemplatesPane* sender, const QString& alwaysUse); + void changeAlwaysUseTemplate(KoTemplatesPane* sender, const TQString& alwaysUse); void changePalette(); @@ -90,38 +91,39 @@ class KoTemplatesPane : public KoDetailsPaneBase /** * This widget is the recent doc part of the template opening widget. - * The parent widget is initial widget in the document space of each KOffice component. + * The tqparent widget is initial widget in the document space of each KOffice component. * This widget shows a list of recent documents and can show their details or open it. */ class KoRecentDocumentsPane : public KoDetailsPaneBase { Q_OBJECT + TQ_OBJECT public: /** * Constructor. - * @param parent the parent widget + * @param tqparent the tqparent widget * @param instance the instance object for the app */ - KoRecentDocumentsPane(QWidget* parent, KInstance* instance); + KoRecentDocumentsPane(TQWidget* tqparent, KInstance* instance); ~KoRecentDocumentsPane(); - virtual bool eventFilter(QObject* watched, QEvent* e); + virtual bool eventFilter(TQObject* watched, TQEvent* e); signals: - void openFile(const QString&); + void openFile(const TQString&); - void splitterResized(KoDetailsPaneBase* sender, const QValueList& sizes); + void splitterResized(KoDetailsPaneBase* sender, const TQValueList& sizes); public slots: - void resizeSplitter(KoDetailsPaneBase* sender, const QValueList& sizes); + void resizeSplitter(KoDetailsPaneBase* sender, const TQValueList& sizes); protected slots: - void selectionChanged(QListViewItem* item); + void selectionChanged(TQListViewItem* item); void openFile(); - void openFile(QListViewItem* item); + void openFile(TQListViewItem* item); void previewResult(KIO::Job* job); - void updatePreview(const KFileItem* fileItem, const QPixmap& preview); + void updatePreview(const KFileItem* fileItem, const TQPixmap& preview); void changePalette(); diff --git a/lib/kofficecore/KoDocument.cpp b/lib/kofficecore/KoDocument.cpp index 500036274..695599d27 100644 --- a/lib/kofficecore/KoDocument.cpp +++ b/lib/kofficecore/KoDocument.cpp @@ -49,17 +49,17 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -76,7 +76,7 @@ #define INTERNAL_PREFIX "intern:/" // Warning, keep it sync in koStore.cc and koDocumentChild.cc -QPtrList *KoDocument::s_documentList=0L; +TQPtrList *KoDocument::s_documentList=0L; using namespace std; class KoViewWrapperWidget; @@ -103,7 +103,7 @@ public: m_shouldCheckAutoSaveFile( true ), m_autoErrorHandlingEnabled( true ), m_backupFile( true ), - m_backupPath( QString::null ), + m_backupPath( TQString() ), m_doNotSaveExtDoc( false ), m_current( false ), m_storeInternal( false ), @@ -119,10 +119,10 @@ public: } } - QPtrList m_views; - QPtrList m_children; - QPtrList m_shells; - QValueList m_viewBuildDocuments; + TQPtrList m_views; + TQPtrList m_tqchildren; + TQPtrList m_shells; + TQValueList m_viewBuildDocuments; KoViewWrapperWidget *m_wrapperWidget; KoDocumentIface * m_dcopObject; @@ -133,16 +133,16 @@ public: KoFilterManager * filterManager; // The filter-manager to use when loading/saving [for the options] - QCString mimeType; // The actual mimetype of the document - QCString outputMimeType; // The mimetype to use when saving + TQCString mimeType; // The actual mimetype of the document + TQCString outputMimeType; // The mimetype to use when saving bool m_confirmNonNativeSave [2]; // used to pop up a dialog when saving for the // first time if the file is in a foreign format // (Save/Save As, Export) int m_specialOutputFlag; // See KoFileDialog in koMainWindow.cc bool m_isImporting, m_isExporting; // File --> Import/Export vs File --> Open/Save - QTimer m_autoSaveTimer; - QString lastErrorMessage; // see openFile() + TQTimer m_autoSaveTimer; + TQString lastErrorMessage; // see openFile() int m_autoSaveDelay; // in seconds, 0 to disable. int m_numOperations; bool modifiedAfterAutosave; @@ -151,45 +151,45 @@ public: bool m_shouldCheckAutoSaveFile; // usually true bool m_autoErrorHandlingEnabled; // usually true bool m_backupFile; - QString m_backupPath; + TQString m_backupPath; bool m_doNotSaveExtDoc; // makes it possible to save only internally stored child documents bool m_current; bool m_storeInternal; // Store this doc internally even if url is external bool m_bLoading; // True while loading (openURL is async) KoOpenPane* m_startUpWidget; - QString m_templateType; + TQString m_templateType; }; // Used in singleViewMode -class KoViewWrapperWidget : public QWidget +class KoViewWrapperWidget : public TQWidget { public: - KoViewWrapperWidget( QWidget *parent, const char *name ) - : QWidget( parent, name ) + KoViewWrapperWidget( TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ) { KGlobal::locale()->insertCatalogue("koffice"); // Tell the iconloader about share/apps/koffice/icons KGlobal::iconLoader()->addAppDir("koffice"); m_view = 0L; // Avoid warning from KParts - we'll have the KoView as focus proxy anyway - setFocusPolicy( ClickFocus ); + setFocusPolicy( TQ_ClickFocus ); } virtual ~KoViewWrapperWidget() { setFocusProxy( 0 ); // to prevent a crash due to clearFocus (#53466) } - virtual void resizeEvent( QResizeEvent * ) + virtual void resizeEvent( TQResizeEvent * ) { - QObject *wid = child( 0, "QWidget" ); + TQObject *wid = child( 0, TQWIDGET_OBJECT_NAME_STRING ); if ( wid ) - static_cast(wid)->setGeometry( 0, 0, width(), height() ); + TQT_TQWIDGET(wid)->setGeometry( 0, 0, width(), height() ); } - virtual void childEvent( QChildEvent *ev ) + virtual void childEvent( TQChildEvent *ev ) { - if ( ev->type() == QEvent::ChildInserted ) + if ( ev->type() == TQEvent::ChildInserted ) resizeEvent( 0L ); } @@ -211,7 +211,7 @@ KoBrowserExtension::KoBrowserExtension( KoDocument * doc, const char * name ) void KoBrowserExtension::print() { - KoDocument * doc = static_cast( parent() ); + KoDocument * doc = static_cast( tqparent() ); KoViewWrapperWidget * wrapper = static_cast( doc->widget() ); KoView * view = wrapper->koView(); // TODO remove code duplication (KoMainWindow), by moving this to KoView @@ -222,32 +222,32 @@ void KoBrowserExtension::print() view->print( printer ); } -KoDocument::KoDocument( QWidget * parentWidget, const char *widgetName, QObject* parent, const char* name, bool singleViewMode ) - : KParts::ReadWritePart( parent, name ) +KoDocument::KoDocument( TQWidget * tqparentWidget, const char *widgetName, TQObject* tqparent, const char* name, bool singleViewMode ) + : KParts::ReadWritePart( tqparent, name ) { if(s_documentList==0L) - s_documentList=new QPtrList; + s_documentList=new TQPtrList; s_documentList->append(this); d = new Private; m_bEmpty = TRUE; - connect( &d->m_autoSaveTimer, SIGNAL( timeout() ), this, SLOT( slotAutoSave() ) ); + connect( &d->m_autoSaveTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotAutoSave() ) ); setAutoSave( s_defaultAutoSave ); d->m_bSingleViewMode = singleViewMode; - // the parent setting *always* overrides! (Simon) - if ( parent ) + // the tqparent setting *always* overrides! (Simon) + if ( tqparent ) { - if ( parent->inherits( "KoDocument" ) ) - d->m_bSingleViewMode = ((KoDocument *)parent)->isSingleViewMode(); - else if ( parent->inherits( "KParts::Part" ) ) + if ( tqparent->inherits( "KoDocument" ) ) + d->m_bSingleViewMode = ((KoDocument *)tqparent)->isSingleViewMode(); + else if ( tqparent->inherits( "KParts::Part" ) ) d->m_bSingleViewMode = true; } if ( singleViewMode ) { - d->m_wrapperWidget = new KoViewWrapperWidget( parentWidget, widgetName ); + d->m_wrapperWidget = new KoViewWrapperWidget( tqparentWidget, widgetName ); setWidget( d->m_wrapperWidget ); kdDebug(30003) << "creating KoBrowserExtension" << endl; (void) new KoBrowserExtension( this ); // ## only if embedded into a browser? @@ -264,29 +264,29 @@ KoDocument::KoDocument( QWidget * parentWidget, const char *widgetName, QObject* // A way to 'fix' the job's window, since we have no widget known to KParts if ( !singleViewMode ) - connect( this, SIGNAL( started( KIO::Job* ) ), SLOT( slotStarted( KIO::Job* ) ) ); + connect( this, TQT_SIGNAL( started( KIO::Job* ) ), TQT_SLOT( slotStarted( KIO::Job* ) ) ); } KoDocument::~KoDocument() { d->m_autoSaveTimer.stop(); - QPtrListIterator childIt( d->m_children ); + TQPtrListIterator childIt( d->m_tqchildren ); for (; childIt.current(); ++childIt ) - disconnect( childIt.current(), SIGNAL( destroyed() ), - this, SLOT( slotChildDestroyed() ) ); + disconnect( childIt.current(), TQT_SIGNAL( destroyed() ), + this, TQT_SLOT( slotChildDestroyed() ) ); // Tell our views that the document is already destroyed and // that they shouldn't try to access it. - QPtrListIterator vIt( d->m_views ); + TQPtrListIterator vIt( d->m_views ); for (; vIt.current(); ++vIt ) vIt.current()->setDocumentDeleted(); delete d->m_startUpWidget; d->m_startUpWidget = 0; - d->m_children.setAutoDelete( true ); - d->m_children.clear(); + d->m_tqchildren.setAutoDelete( true ); + d->m_tqchildren.clear(); d->m_shells.setAutoDelete( true ); d->m_shells.clear(); @@ -309,12 +309,12 @@ bool KoDocument::isSingleViewMode() const bool KoDocument::isEmbedded() const { - return dynamic_cast( parent() ) != 0; + return dynamic_cast( tqparent() ) != 0; } -KoView *KoDocument::createView( QWidget *parent, const char *name ) +KoView *KoDocument::createView( TQWidget *tqparent, const char *name ) { - KoView *view=createViewInstance(parent, name); + KoView *view=createViewInstance(tqparent, name); addView(view); return view; } @@ -334,10 +334,10 @@ bool KoDocument::exp0rt( const KURL & _url ) // non-virtual). // KURL oldURL = m_url; - QString oldFile = m_file; + TQString oldFile = m_file; bool wasModified = isModified (); - QCString oldMimeType = mimeType (); + TQCString oldMimeType = mimeType (); // save... @@ -382,12 +382,12 @@ bool KoDocument::saveFile() const bool wasModified = isModified (); // The output format is set by koMainWindow, and by openFile - QCString outputMimeType = d->outputMimeType; + TQCString outputMimeType = d->outputMimeType; //Q_ASSERT( !outputMimeType.isEmpty() ); // happens when using the DCOP method saveAs if ( outputMimeType.isEmpty() ) outputMimeType = d->outputMimeType = nativeFormatMimeType(); - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); if ( backupFile() ) { if ( url().isLocalFile() ) @@ -401,7 +401,7 @@ bool KoDocument::saveFile() backup = url(); else backup = d->m_backupPath +"/"+url().fileName(); - backup.setPath( backup.path() + QString::fromLatin1("~") ); + backup.setPath( backup.path() + TQString::tqfromLatin1("~") ); KFileItem item( entry, url() ); Q_ASSERT( item.name() == url().fileName() ); KIO::NetAccess::file_copy( url(), backup, item.permissions(), true /*overwrite*/, false /*resume*/, shells().current() ); @@ -418,7 +418,7 @@ bool KoDocument::saveFile() if ( !d->filterManager ) d->filterManager = new KoFilterManager( this ); - KoFilter::ConversionStatus status = d->filterManager->exp0rt( m_file, outputMimeType ); + KoFilter::ConversiontqStatus status = d->filterManager->exp0rt( m_file, outputMimeType ); ret = status == KoFilter::OK; suppressErrorDialog = (status == KoFilter::UserCancelled || status == KoFilter::BadConversionGraph ); } else { @@ -434,7 +434,7 @@ bool KoDocument::saveFile() setAutoSave( d->m_autoSaveDelay ); } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if ( !ret ) { if ( !suppressErrorDialog ) @@ -468,23 +468,23 @@ bool KoDocument::saveFile() return ret; } -QCString KoDocument::mimeType() const +TQCString KoDocument::mimeType() const { return d->mimeType; } -void KoDocument::setMimeType( const QCString & mimeType ) +void KoDocument::setMimeType( const TQCString & mimeType ) { d->mimeType = mimeType; } -void KoDocument::setOutputMimeType( const QCString & mimeType, int specialOutputFlag ) +void KoDocument::setOutputMimeType( const TQCString & mimeType, int specialOutputFlag ) { d->outputMimeType = mimeType; d->m_specialOutputFlag = specialOutputFlag; } -QCString KoDocument::outputMimeType() const +TQCString KoDocument::outputMimeType() const { return d->outputMimeType; } @@ -540,7 +540,7 @@ void KoDocument::slotAutoSave() { if ( isModified() && d->modifiedAfterAutosave && !d->m_bLoading ) { - connect( this, SIGNAL( sigProgress( int ) ), shells().current(), SLOT( slotProgress( int ) ) ); + connect( this, TQT_SIGNAL( sigProgress( int ) ), shells().current(), TQT_SLOT( slotProgress( int ) ) ); emit sigStatusBarMessage( i18n("Autosaving...") ); d->m_autosaving = true; bool ret = saveNativeFormat( autoSaveFile( m_file ) ); @@ -551,13 +551,13 @@ void KoDocument::slotAutoSave() } d->m_autosaving = false; emit sigClearStatusBarMessage(); - disconnect( this, SIGNAL( sigProgress( int ) ), shells().current(), SLOT( slotProgress( int ) ) ); + disconnect( this, TQT_SIGNAL( sigProgress( int ) ), shells().current(), TQT_SLOT( slotProgress( int ) ) ); if ( !ret ) emit sigStatusBarMessage( i18n("Error during autosave! Partition full?") ); } } -KAction *KoDocument::action( const QDomElement &element ) const +KAction *KoDocument::action( const TQDomElement &element ) const { // First look in the document itself KAction* act = KParts::ReadWritePart::action( element ); @@ -572,13 +572,13 @@ KAction *KoDocument::action( const QDomElement &element ) const return 0L; } -QDomDocument KoDocument::domDocument() const +TQDomDocument KoDocument::domDocument() const { // When embedded into e.g. konqueror, we want the view's GUI (hopefully a reduced one) // to be used. Q_ASSERT( d->m_bSingleViewMode ); if ( d->m_views.isEmpty() ) - return QDomDocument(); + return TQDomDocument(); else return d->m_views.getFirst()->domDocument(); } @@ -591,7 +591,7 @@ void KoDocument::setManager( KParts::PartManager *manager ) if ( manager ) { - QPtrListIterator it( d->m_children ); + TQPtrListIterator it( d->m_tqchildren ); for (; it.current(); ++it ) if ( it.current()->document() ) manager->addPart( it.current()->document(), false ); @@ -602,11 +602,11 @@ void KoDocument::setReadWrite( bool readwrite ) { KParts::ReadWritePart::setReadWrite( readwrite ); - QPtrListIterator vIt( d->m_views ); + TQPtrListIterator vIt( d->m_views ); for (; vIt.current(); ++vIt ) vIt.current()->updateReadWrite( readwrite ); - QPtrListIterator dIt( d->m_children ); + TQPtrListIterator dIt( d->m_tqchildren ); for (; dIt.current(); ++dIt ) if ( dIt.current()->document() ) dIt.current()->document()->setReadWrite( readwrite ); @@ -637,7 +637,7 @@ void KoDocument::removeView( KoView *view ) d->m_views.removeRef( view ); } -const QPtrList& KoDocument::views() const +const TQPtrList& KoDocument::views() const { return d->m_views; } @@ -651,12 +651,12 @@ void KoDocument::insertChild( KoDocumentChild *child ) { setModified( true ); - d->m_children.append( child ); + d->m_tqchildren.append( child ); - connect( child, SIGNAL( changed( KoChild * ) ), - this, SLOT( slotChildChanged( KoChild * ) ) ); - connect( child, SIGNAL( destroyed() ), - this, SLOT( slotChildDestroyed() ) ); + connect( child, TQT_SIGNAL( changed( KoChild * ) ), + this, TQT_SLOT( slotChildChanged( KoChild * ) ) ); + connect( child, TQT_SIGNAL( destroyed() ), + this, TQT_SLOT( slotChildDestroyed() ) ); // It may be that insertChild is called without the KoDocumentChild // having a KoDocument attached, yet. This happens for example @@ -681,23 +681,23 @@ void KoDocument::slotChildDestroyed() setModified( true ); const KoDocumentChild *child = static_cast( sender() ); - d->m_children.removeRef( child ); + d->m_tqchildren.removeRef( child ); } -const QPtrList& KoDocument::children() const +const TQPtrList& KoDocument::tqchildren() const { - return d->m_children; + return d->m_tqchildren; } -KParts::Part *KoDocument::hitTest( QWidget *widget, const QPoint &globalPos ) +KParts::Part *KoDocument::hitTest( TQWidget *widget, const TQPoint &globalPos ) { - QPtrListIterator it( d->m_views ); + TQPtrListIterator it( d->m_views ); for (; it.current(); ++it ) - if ( static_cast(it.current()) == widget ) + if ( static_cast(it.current()) == widget ) { KoView* view = it.current(); d->hitTestView = view; // koffice-1.x hack - QPoint canvasPos( view->canvas()->mapFromGlobal( globalPos ) ); + TQPoint canvasPos( view->canvas()->mapFromGlobal( globalPos ) ); canvasPos.rx() += view->canvasXOffset(); canvasPos.ry() += view->canvasYOffset(); @@ -715,10 +715,10 @@ KoView* KoDocument::hitTestView() return d->hitTestView; } -KoDocument* KoDocument::hitTest( const QPoint &pos, const QWMatrix &matrix ) +KoDocument* KoDocument::hitTest( const TQPoint &pos, const TQWMatrix &matrix ) { // Call KoDocumentChild::hitTest for any child document - QPtrListIterator it( d->m_children ); + TQPtrListIterator it( d->m_tqchildren ); for (; it.current(); ++it ) { KoDocument *doc = it.current()->hitTest( pos, matrix ); @@ -732,7 +732,7 @@ KoDocument* KoDocument::hitTest( const QPoint &pos, const QWMatrix &matrix ) KoDocumentChild *KoDocument::child( KoDocument *doc ) { - QPtrListIterator it( d->m_children ); + TQPtrListIterator it( d->m_tqchildren ); for (; it.current(); ++it ) if ( it.current()->document() == doc ) return it.current(); @@ -745,9 +745,9 @@ KoDocumentInfo *KoDocument::documentInfo() const return d->m_docInfo; } -void KoDocument::setViewBuildDocument( KoView *view, const QDomDocument &doc ) +void KoDocument::setViewBuildDocument( KoView *view, const TQDomDocument &doc ) { - if ( d->m_views.find( view ) == -1 ) + if ( d->m_views.tqfind( view ) == -1 ) return; uint viewIdx = d->m_views.at(); @@ -758,11 +758,11 @@ void KoDocument::setViewBuildDocument( KoView *view, const QDomDocument &doc ) d->m_viewBuildDocuments[ viewIdx ] = doc; } -QDomDocument KoDocument::viewBuildDocument( KoView *view ) +TQDomDocument KoDocument::viewBuildDocument( KoView *view ) { - QDomDocument res; + TQDomDocument res; - if ( d->m_views.find( view ) == -1 ) + if ( d->m_views.tqfind( view ) == -1 ) return res; uint viewIdx = d->m_views.at(); @@ -772,21 +772,21 @@ QDomDocument KoDocument::viewBuildDocument( KoView *view ) res = d->m_viewBuildDocuments[ viewIdx ]; - // make this entry empty. otherwise we get a segfault in QMap ;-( - d->m_viewBuildDocuments[ viewIdx ] = QDomDocument(); + // make this entry empty. otherwise we get a segfault in TQMap ;-( + d->m_viewBuildDocuments[ viewIdx ] = TQDomDocument(); return res; } -void KoDocument::paintEverything( QPainter &painter, const QRect &rect, bool transparent, KoView *view, double zoomX, double zoomY ) +void KoDocument::paintEverything( TQPainter &painter, const TQRect &rect, bool transparent, KoView *view, double zoomX, double zoomY ) { paintContent( painter, rect, transparent, zoomX, zoomY ); paintChildren( painter, rect, view, zoomX, zoomY ); } -void KoDocument::paintChildren( QPainter &painter, const QRect &/*rect*/, KoView *view, double zoomX, double zoomY ) +void KoDocument::paintChildren( TQPainter &painter, const TQRect &/*rect*/, KoView *view, double zoomX, double zoomY ) { - QPtrListIterator it( d->m_children ); + TQPtrListIterator it( d->m_tqchildren ); for (; it.current(); ++it ) { // #### todo: paint only if child is visible inside rect @@ -796,12 +796,12 @@ void KoDocument::paintChildren( QPainter &painter, const QRect &/*rect*/, KoView } } -void KoDocument::paintChild( KoDocumentChild *child, QPainter &painter, KoView *view, double zoomX, double zoomY ) +void KoDocument::paintChild( KoDocumentChild *child, TQPainter &painter, KoView *view, double zoomX, double zoomY ) { if ( child->isDeleted() ) return; - // QRegion rgn = painter.clipRegion(); + // TQRegion rgn = painter.clipRegion(); child->transform( painter ); child->document()->paintEverything( painter, child->contentRect(), child->isTransparent(), view, zoomX, zoomY ); @@ -816,9 +816,9 @@ void KoDocument::paintChild( KoDocumentChild *child, QPainter &painter, KoView * int w = int( (double)child->contentRect().width() * child->xScaling() ); int h = int( (double)child->contentRect().height() * child->yScaling() ); if ( ( manager->selectedPart() == (KParts::Part *)child->document() && - manager->selectedWidget() == (QWidget *)view ) || + manager->selectedWidget() == (TQWidget *)view ) || ( manager->activePart() == (KParts::Part *)child->document() && - manager->activeWidget() == (QWidget *)view ) ) + manager->activeWidget() == (TQWidget *)view ) ) { // painter.setClipRegion( rgn ); painter.setClipping( FALSE ); @@ -834,9 +834,9 @@ void KoDocument::paintChild( KoDocumentChild *child, QPainter &painter, KoView * painter.fillRect( w, -5, 5, h + 10, BDiagPattern ); if ( manager->selectedPart() == (KParts::Part *)child->document() && - manager->selectedWidget() == (QWidget *)view ) + manager->selectedWidget() == (TQWidget *)view ) { - QColor color; + TQColor color; if ( view->koDocument() == this ) color = black; else @@ -863,8 +863,8 @@ bool KoDocument::isModified() const //kdDebug(30003)< it( children() ); + TQPtrListIterator it( tqchildren() ); for( ; it.current(); ++it ) { KoDocument* childDoc = it.current()->document(); if (childDoc && !it.current()->isDeleted()) @@ -886,7 +886,7 @@ bool KoDocument::saveChildren( KoStore* _store ) if ( !childDoc->isStoredExtern() ) { //kdDebug(30003) << "KoDocument::saveChildren internal url: /" << i << endl; - if ( !childDoc->saveToStore( _store, QString::number( i++ ) ) ) + if ( !childDoc->saveToStore( _store, TQString::number( i++ ) ) ) return FALSE; if (!isExporting ()) @@ -900,8 +900,8 @@ bool KoDocument::saveChildren( KoStore* _store ) bool KoDocument::saveChildrenOasis( KoStore* store, KoXmlWriter* manifestWriter ) { - //kdDebug(30003)< it( children() ); + //kdDebug(30003)< it( tqchildren() ); for( ; it.current(); ++it ) { KoDocument* childDoc = it.current()->document(); if ( childDoc && !it.current()->isDeleted() ) @@ -924,9 +924,9 @@ bool KoDocument::saveExternalChildren() return true; } - //kdDebug(30003)< it = children(); + TQPtrListIterator it = tqchildren(); for (; (ch = it.current()); ++it ) { if ( !ch->isDeleted() ) @@ -935,7 +935,7 @@ bool KoDocument::saveExternalChildren() if ( doc && doc->isStoredExtern() && doc->isModified() ) { kdDebug(30003)<<" save external doc='"<setDoNotSaveExtDoc(); // Only save doc + it's internal children + doc->setDoNotSaveExtDoc(); // Only save doc + it's internal tqchildren if ( !doc->save() ) return false; // error } @@ -948,9 +948,9 @@ bool KoDocument::saveExternalChildren() return true; } -bool KoDocument::saveNativeFormat( const QString & file ) +bool KoDocument::saveNativeFormat( const TQString & file ) { - d->lastErrorMessage = QString::null; + d->lastErrorMessage = TQString(); //kdDebug(30003) << "Saving to store" << endl; KoStore::Backend backend = KoStore::Auto; @@ -971,10 +971,10 @@ bool KoDocument::saveNativeFormat( const QString & file ) else if ( d->m_specialOutputFlag == SaveAsFlatXML ) { kdDebug(30003) << "Saving as a flat XML file." << endl; - QFile f( file ); + TQFile f( file ); if ( f.open( IO_WriteOnly | IO_Translate ) ) { - bool success = saveToStream( &f ); + bool success = saveToStream( TQT_TQIODEVICE(&f) ); f.close(); return success; } @@ -984,9 +984,9 @@ bool KoDocument::saveNativeFormat( const QString & file ) kdDebug(30003) << "KoDocument::saveNativeFormat nativeFormatMimeType=" << nativeFormatMimeType() << endl; // OLD: bool oasis = d->m_specialOutputFlag == SaveAsOASIS; - // OLD: QCString mimeType = oasis ? nativeOasisMimeType() : nativeFormatMimeType(); - QCString mimeType = d->outputMimeType; - QCString nativeOasisMime = nativeOasisMimeType(); + // OLD: TQCString mimeType = oasis ? nativeOasisMimeType() : nativeFormatMimeType(); + TQCString mimeType = d->outputMimeType; + TQCString nativeOasisMime = nativeOasisMimeType(); bool oasis = !mimeType.isEmpty() && ( mimeType == nativeOasisMime || mimeType == nativeOasisMime + "-template" ); // TODO: use std::auto_ptr or create store on stack [needs API fixing], // to remove all the 'delete store' in all the branches @@ -1031,7 +1031,7 @@ bool KoDocument::saveNativeFormat( const QString & file ) } else { - d->lastErrorMessage = i18n( "Not able to write '%1'. Partition full?" ).arg( "meta.xml" ); + d->lastErrorMessage = i18n( "Not able to write '%1'. Partition full?" ).tqarg( "meta.xml" ); delete store; return false; } @@ -1039,7 +1039,7 @@ bool KoDocument::saveNativeFormat( const QString & file ) if ( store->open( "Thumbnails/thumbnail.png" ) ) { if ( !saveOasisPreview( store, manifestWriter ) || !store->close() ) { - d->lastErrorMessage = i18n( "Error while trying to write '%1'. Partition full?" ).arg( "Thumbnails/thumbnail.png" ); + d->lastErrorMessage = i18n( "Error while trying to write '%1'. Partition full?" ).tqarg( "Thumbnails/thumbnail.png" ); delete store; return false; } @@ -1047,7 +1047,7 @@ bool KoDocument::saveNativeFormat( const QString & file ) } else { - d->lastErrorMessage = i18n( "Not able to write '%1'. Partition full?" ).arg( "Thumbnails/thumbnail.png" ); + d->lastErrorMessage = i18n( "Not able to write '%1'. Partition full?" ).tqarg( "Thumbnails/thumbnail.png" ); delete store; return false; } @@ -1055,7 +1055,7 @@ bool KoDocument::saveNativeFormat( const QString & file ) // Write out manifest file if ( !oasisStore.closeManifestWriter() ) { - d->lastErrorMessage = i18n( "Error while trying to write '%1'. Partition full?" ).arg( "META-INF/manifest.xml" ); + d->lastErrorMessage = i18n( "Error while trying to write '%1'. Partition full?" ).tqarg( "META-INF/manifest.xml" ); delete store; return false; } @@ -1064,7 +1064,7 @@ bool KoDocument::saveNativeFormat( const QString & file ) } else { - // Save internal children first since they might get a new url + // Save internal tqchildren first since they might get a new url if ( !saveChildren( store ) && !oasis ) { if ( d->lastErrorMessage.isEmpty() ) @@ -1086,16 +1086,16 @@ bool KoDocument::saveNativeFormat( const QString & file ) } else { - d->lastErrorMessage = i18n( "Not able to write '%1'. Partition full?" ).arg( "maindoc.xml" ); + d->lastErrorMessage = i18n( "Not able to write '%1'. Partition full?" ).tqarg( "maindoc.xml" ); delete store; return false; } if ( store->open( "documentinfo.xml" ) ) { - QDomDocument doc = d->m_docInfo->save(); + TQDomDocument doc = d->m_docInfo->save(); KoStoreDevice dev( store ); - QCString s = doc.toCString(); // this is already Utf8! + TQCString s = doc.toCString(); // this is already Utf8! (void)dev.writeBlock( s.data(), s.size()-1 ); (void)store->close(); } @@ -1122,13 +1122,13 @@ bool KoDocument::saveNativeFormat( const QString & file ) return true; } -bool KoDocument::saveToStream( QIODevice * dev ) +bool KoDocument::saveToStream( TQIODevice * dev ) { - QDomDocument doc = saveXML(); + TQDomDocument doc = saveXML(); // Save to buffer - QCString s = doc.toCString(); // utf8 already - // We use QCString::size()-1 here, not the official QCString::length - // It works here, as we are not modifying QCString as QByteArray + TQCString s = doc.toCString(); // utf8 already + // We use TQCString::size()-1 here, not the official TQCString::length + // It works here, as we are not modifying TQCString as TQByteArray int nwritten = dev->writeBlock( s.data(), s.size()-1 ); if ( nwritten != (int)s.size()-1 ) kdWarning(30003) << "KoDocument::saveToStream wrote " << nwritten << " - expected " << s.size()-1 << endl; @@ -1136,7 +1136,7 @@ bool KoDocument::saveToStream( QIODevice * dev ) } // Called for embedded documents -bool KoDocument::saveToStore( KoStore* _store, const QString & _path ) +bool KoDocument::saveToStore( KoStore* _store, const TQString & _path ) { kdDebug(30003) << "Saving document to store " << _path << endl; @@ -1146,7 +1146,7 @@ bool KoDocument::saveToStore( KoStore* _store, const QString & _path ) else // ugly hack to pass a relative URI m_url = KURL( INTERNAL_PREFIX + _path ); - // To make the children happy cd to the correct directory + // To make the tqchildren happy cd to the correct directory _store->pushDirectory(); _store->enterDirectory( _path ); @@ -1180,8 +1180,8 @@ bool KoDocument::saveToStore( KoStore* _store, const QString & _path ) bool KoDocument::saveOasisPreview( KoStore* store, KoXmlWriter* manifestWriter ) { - const QPixmap pix = generatePreview( QSize( 128, 128 ) ); - QImage preview ( pix.convertToImage().convertDepth( 32, Qt::ColorOnly ) ); + const TQPixmap pix = generatePreview( TQSize( 128, 128 ) ); + TQImage preview ( pix.convertToImage().convertDepth( 32, Qt::ColorOnly ) ); if ( !preview.hasAlphaBuffer() ) { preview.setAlphaBuffer( true ); @@ -1200,9 +1200,9 @@ bool KoDocument::saveOasisPreview( KoStore* store, KoXmlWriter* manifestWriter ) bool KoDocument::savePreview( KoStore* store ) { - QPixmap pix = generatePreview(QSize(256, 256)); + TQPixmap pix = generatePreview(TQSize(256, 256)); // Reducing to 8bpp reduces file sizes quite a lot. - const QImage preview ( pix.convertToImage().convertDepth( 8, Qt::AvoidDither | Qt::DiffuseDither) ); + const TQImage preview ( pix.convertToImage().convertDepth( 8, Qt::AvoidDither | Qt::DiffuseDither) ); KoStoreDevice io ( store ); if ( !io.open( IO_WriteOnly ) ) return false; @@ -1212,24 +1212,24 @@ bool KoDocument::savePreview( KoStore* store ) return true; } -QPixmap KoDocument::generatePreview( const QSize& size ) +TQPixmap KoDocument::generatePreview( const TQSize& size ) { double docWidth, docHeight; - int pixmapSize = QMAX(size.width(), size.height()); + int pixmapSize = TQMAX(size.width(), size.height()); if (m_pageLayout.ptWidth > 1.0) { docWidth = m_pageLayout.ptWidth / 72 * KoGlobal::dpiX(); docHeight = m_pageLayout.ptHeight / 72 * KoGlobal::dpiY(); } else { - // If we don't have a page layout, just draw the top left hand corner + // If we don't have a page tqlayout, just draw the top left hand corner docWidth = 500.0; docHeight = 500.0; } double ratio = docWidth / docHeight; - QPixmap pix; + TQPixmap pix; int previewWidth, previewHeight; if (ratio > 1.0) { @@ -1244,22 +1244,22 @@ QPixmap KoDocument::generatePreview( const QSize& size ) pix.resize((int)docWidth, (int)docHeight); - pix.fill( QColor( 245, 245, 245 ) ); + pix.fill( TQColor( 245, 245, 245 ) ); - QRect rc(0, 0, pix.width(), pix.height()); + TQRect rc(0, 0, pix.width(), pix.height()); - QPainter p; + TQPainter p; p.begin(&pix); paintEverything(p, rc, false); p.end(); - // ### TODO: why re-convert it to a QPixmap, when mostly it will be re-converted back to a QImage in the calling function + // ### TODO: why re-convert it to a TQPixmap, when mostly it will be re-converted back to a TQImage in the calling function pix.convertFromImage(pix.convertToImage().smoothScale(previewWidth, previewHeight)); return pix; } -QString KoDocument::autoSaveFile( const QString & path ) const +TQString KoDocument::autoSaveFile( const TQString & path ) const { // set local again as it can happen that it gets resetted // so that all saved numbers have a . and not e.g a , as a @@ -1268,36 +1268,36 @@ QString KoDocument::autoSaveFile( const QString & path ) const // Using the extension allows to avoid relying on the mime magic when opening KMimeType::Ptr mime = KMimeType::mimeType( nativeFormatMimeType() ); - QString extension = mime->property( "X-KDE-NativeExtension" ).toString(); + TQString extension = mime->property( "X-KDE-NativeExtension" ).toString(); if ( path.isEmpty() ) { // Never saved? Use a temp file in $HOME then // Yes, two open unnamed docs will overwrite each other's autosave file, // but hmm, we can only do something if that's in the same process anyway... - QString ret = QDir::homeDirPath() + "/." + QString::fromLatin1(instance()->instanceName()) + ".autosave" + extension; + TQString ret = TQDir::homeDirPath() + "/." + TQString::tqfromLatin1(instance()->instanceName()) + ".autosave" + extension; return ret; } else { KURL url( path ); Q_ASSERT( url.isLocalFile() ); - QString dir = url.directory(false); - QString filename = url.fileName(); + TQString dir = url.directory(false); + TQString filename = url.fileName(); return dir + "." + filename + ".autosave" + extension; } } bool KoDocument::checkAutoSaveFile() { - QString asf = autoSaveFile( QString::null ); // the one in $HOME + TQString asf = autoSaveFile( TQString() ); // the one in $HOME //kdDebug(30003) << "asf=" << asf << endl; - if ( QFile::exists( asf ) ) + if ( TQFile::exists( asf ) ) { - QDateTime date = QFileInfo(asf).lastModified(); - QString dateStr = date.toString(Qt::LocalDate); + TQDateTime date = TQFileInfo(asf).lastModified(); + TQString dateStr = date.toString(Qt::LocalDate); int res = KMessageBox::warningYesNoCancel( 0, i18n( "An autosaved file for an unnamed document exists in %1.\nThis file is dated %2\nDo you want to open it?" ) - .arg(asf, dateStr) ); + .tqarg(asf, dateStr) ); switch(res) { case KMessageBox::Yes : { KURL url; @@ -1308,7 +1308,7 @@ bool KoDocument::checkAutoSaveFile() return ret; } case KMessageBox::No : - QFile::remove( asf ); + TQFile::remove( asf ); return false; default: // Cancel return false; @@ -1344,12 +1344,12 @@ bool KoDocument::import( const KURL & _url ) bool KoDocument::openURL( const KURL & _url ) { kdDebug(30003) << "KoDocument::openURL url=" << _url.url() << endl; - d->lastErrorMessage = QString::null; + d->lastErrorMessage = TQString(); // Reimplemented, to add a check for autosave files and to improve error reporting if ( !_url.isValid() ) { - d->lastErrorMessage = i18n( "Malformed URL\n%1" ).arg( _url.url() ); // ## used anywhere ? + d->lastErrorMessage = i18n( "Malformed URL\n%1" ).tqarg( _url.url() ); // ## used anywhere ? return false; } if ( !closeURL() ) @@ -1360,9 +1360,9 @@ bool KoDocument::openURL( const KURL & _url ) d->m_bLoading = true; if ( url.isLocalFile() && d->m_shouldCheckAutoSaveFile ) { - QString file = url.path(); - QString asf = autoSaveFile( file ); - if ( QFile::exists( asf ) ) + TQString file = url.path(); + TQString asf = autoSaveFile( file ); + if ( TQFile::exists( asf ) ) { //kdDebug(30003) << "KoDocument::openURL asf=" << asf << endl; // ## TODO compare timestamps ? @@ -1374,7 +1374,7 @@ bool KoDocument::openURL( const KURL & _url ) autosaveOpened = true; break; case KMessageBox::No : - QFile::remove( asf ); + TQFile::remove( asf ); break; default: // Cancel d->m_bLoading = false; @@ -1393,7 +1393,7 @@ bool KoDocument::openURL( const KURL & _url ) //if ( d->m_shells.isEmpty() ) // kdWarning(30003) << "KoDocument::openURL no shell yet !" << endl; // Add to recent actions list in our shells - QPtrListIterator it( d->m_shells ); + TQPtrListIterator it( d->m_shells ); for (; it.current(); ++it ) it.current()->addRecentURL( _url ); } @@ -1403,33 +1403,33 @@ bool KoDocument::openURL( const KURL & _url ) bool KoDocument::openFile() { //kdDebug(30003) << "KoDocument::openFile for " << m_file << endl; - if ( !QFile::exists(m_file) ) + if ( !TQFile::exists(m_file) ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if ( d->m_autoErrorHandlingEnabled ) // Maybe offer to create a new document with that name ? - KMessageBox::error(0L, i18n("The file %1 does not exist.").arg(m_file) ); + KMessageBox::error(0L, i18n("The file %1 does not exist.").tqarg(m_file) ); d->m_bLoading = false; return false; } - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); d->m_specialOutputFlag = 0; - QCString _native_format = nativeFormatMimeType(); + TQCString _native_format = nativeFormatMimeType(); KURL u; u.setPath( m_file ); - QString typeName = KMimeType::findByURL( u, 0, true )->name(); + TQString typeName = KMimeType::findByURL( u, 0, true )->name(); // Allow to open backup files, don't keep the mimetype application/x-trash. if ( typeName == "application/x-trash" ) { - QString path = u.path(); - QStringList patterns = KMimeType::mimeType( typeName )->patterns(); + TQString path = u.path(); + TQStringList patterns = KMimeType::mimeType( typeName )->patterns(); // Find the extension that makes it a backup file, and remove it - for( QStringList::Iterator it = patterns.begin(); it != patterns.end(); ++it ) { - QString ext = *it; + for( TQStringList::Iterator it = patterns.begin(); it != patterns.end(); ++it ) { + TQString ext = *it; if ( !ext.isEmpty() && ext[0] == '*' ) { ext.remove(0, 1); @@ -1451,18 +1451,18 @@ bool KoDocument::openFile() } kdDebug(30003) << "KoDocument::openFile " << m_file << " type:" << typeName << endl; - QString importedFile = m_file; + TQString importedFile = m_file; if ( !isNativeFormat( typeName.latin1() ) ) { if ( !d->filterManager ) d->filterManager = new KoFilterManager( this ); - KoFilter::ConversionStatus status; + KoFilter::ConversiontqStatus status; importedFile = d->filterManager->import( m_file, status ); if ( status != KoFilter::OK ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); - QString msg; + TQString msg; switch( status ) { case KoFilter::OK: break; @@ -1514,9 +1514,9 @@ bool KoDocument::openFile() if( d->m_autoErrorHandlingEnabled && !msg.isEmpty()) { - QString errorMsg( i18n( "Could not open\n%2.\nReason: %1" ) ); - QString docUrl = url().prettyURL( 0, KURL::StripFileProtocol ); - KMessageBox::error( 0L, errorMsg.arg(msg).arg(docUrl) ); + TQString errorMsg( i18n( "Could not open\n%2.\nReason: %1" ) ); + TQString docUrl = url().prettyURL( 0, KURL::StripFileProtocol ); + KMessageBox::error( 0L, errorMsg.tqarg(msg).tqarg(docUrl) ); } d->m_bLoading = false; @@ -1526,7 +1526,7 @@ bool KoDocument::openFile() << "', status: " << static_cast( status ) << endl; } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); bool ok = true; @@ -1563,7 +1563,7 @@ bool KoDocument::openFile() // remove temp file - uncomment this to debug import filters if(!importedFile.isEmpty()) { - QFile::remove( importedFile ); + TQFile::remove( importedFile ); } } @@ -1604,7 +1604,7 @@ bool KoDocument::openFile() } // shared between openFile and koMainWindow's "create new empty document" code -void KoDocument::setMimeTypeAfterLoading( const QString& mimeType ) +void KoDocument::setMimeTypeAfterLoading( const TQString& mimeType ) { d->mimeType = mimeType.latin1(); @@ -1616,18 +1616,18 @@ void KoDocument::setMimeTypeAfterLoading( const QString& mimeType ) } // The caller must call store->close() if loadAndParse returns true. -bool KoDocument::oldLoadAndParse(KoStore* store, const QString& filename, QDomDocument& doc) +bool KoDocument::oldLoadAndParse(KoStore* store, const TQString& filename, TQDomDocument& doc) { //kdDebug(30003) << "oldLoadAndParse: Trying to open " << filename << endl; if (!store->open(filename)) { kdWarning(30003) << "Entry " << filename << " not found!" << endl; - d->lastErrorMessage = i18n( "Could not find %1" ).arg( filename ); + d->lastErrorMessage = i18n( "Could not tqfind %1" ).tqarg( filename ); return false; } - // Error variables for QDomDocument::setContent - QString errorMsg; + // Error variables for TQDomDocument::setContent + TQString errorMsg; int errorLine, errorColumn; bool ok = doc.setContent( store->device(), &errorMsg, &errorLine, &errorColumn ); if ( !ok ) @@ -1636,8 +1636,8 @@ bool KoDocument::oldLoadAndParse(KoStore* store, const QString& filename, QDomDo << " In line: " << errorLine << ", column: " << errorColumn << endl << " Error message: " << errorMsg << endl; d->lastErrorMessage = i18n( "Parsing error in %1 at line %2, column %3\nError message: %4" ) - .arg( filename ).arg( errorLine ).arg( errorColumn ) - .arg( i18n ( "QXml", errorMsg.utf8() ) ); + .tqarg( filename ).tqarg( errorLine ).tqarg( errorColumn ) + .tqarg( i18n ( "TQXml", errorMsg.utf8() ) ); store->close(); return false; } @@ -1645,32 +1645,32 @@ bool KoDocument::oldLoadAndParse(KoStore* store, const QString& filename, QDomDo return true; } -bool KoDocument::loadNativeFormat( const QString & file ) +bool KoDocument::loadNativeFormat( const TQString & file ) { - QFileInfo fileInfo( file ); + TQFileInfo fileInfo( file ); if ( !fileInfo.exists() ) // check duplicated from openURL, but this is useful for templates { - d->lastErrorMessage = i18n("The file %1 does not exist.").arg(file); + d->lastErrorMessage = i18n("The file %1 does not exist.").tqarg(file); return false; } if ( !fileInfo.isFile() ) { - d->lastErrorMessage = i18n( "%1 is not a file." ).arg(file); + d->lastErrorMessage = i18n( "%1 is not a file." ).tqarg(file); return false; } - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); kdDebug(30003) << "KoDocument::loadNativeFormat( " << file << " )" << endl; - QFile in; + TQFile in; bool isRawXML = false; if ( d->m_specialOutputFlag != SaveAsDirectoryStore ) // Don't try to open a directory ;) { in.setName(file); if ( !in.open( IO_ReadOnly ) ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); d->lastErrorMessage = i18n( "Could not open the file for reading (check read permissions)." ); return false; } @@ -1679,7 +1679,7 @@ bool KoDocument::loadNativeFormat( const QString & file ) char buf[5]; if ( in.readBlock( buf, 4 ) < 4 ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); in.close(); d->lastErrorMessage = i18n( "Could not read the beginning of the file." ); return false; @@ -1693,16 +1693,16 @@ bool KoDocument::loadNativeFormat( const QString & file ) do { if ( in.readBlock( buf , 1 ) < 1 ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); in.close(); d->lastErrorMessage = i18n( "Could not read the beginning of the file." ); return false; } - } while ( QChar( buf[0] ).isSpace() ); + } while ( TQChar( buf[0] ).isSpace() ); if ( buf[0] == '<' ) { // First not-space character if ( in.readBlock( buf , 4 ) < 4 ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); in.close(); d->lastErrorMessage = i18n( "Could not read the beginning of the file." ); return false; @@ -1716,28 +1716,28 @@ bool KoDocument::loadNativeFormat( const QString & file ) if ( isRawXML ) { in.at(0); - QString errorMsg; + TQString errorMsg; int errorLine; int errorColumn; - QDomDocument doc; + TQDomDocument doc; bool res; if ( doc.setContent( &in, true, &errorMsg, &errorLine, &errorColumn ) ) { - res = loadXML( &in, doc ); + res = loadXML( TQT_TQIODEVICE(&in), doc ); if ( res ) res = completeLoading( 0L ); } else { - kdError (30003) << "Parsing Error! Aborting! (in KoDocument::loadNativeFormat (QFile))" << endl + kdError (30003) << "Parsing Error! Aborting! (in KoDocument::loadNativeFormat (TQFile))" << endl << " Line: " << errorLine << " Column: " << errorColumn << endl << " Message: " << errorMsg << endl; d->lastErrorMessage = i18n( "parsing error in the main document at line %1, column %2\nError message: %3" ) - .arg( errorLine ).arg( errorColumn ).arg( i18n ( errorMsg.utf8() ) ); + .tqarg( errorLine ).tqarg( errorColumn ).tqarg( i18n ( errorMsg.utf8() ) ); res=false; } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); in.close(); m_bEmpty = false; return res; @@ -1749,16 +1749,16 @@ bool KoDocument::loadNativeFormat( const QString & file ) } } -bool KoDocument::loadNativeFormatFromStore( const QString& file ) +bool KoDocument::loadNativeFormatFromStore( const TQString& file ) { KoStore::Backend backend = (d->m_specialOutputFlag == SaveAsDirectoryStore) ? KoStore::Directory : KoStore::Auto; KoStore * store = KoStore::createStore( file, KoStore::Read, "", backend ); if ( store->bad() ) { - d->lastErrorMessage = i18n( "Not a valid KOffice file: %1" ).arg( file ); + d->lastErrorMessage = i18n( "Not a valid KOffice file: %1" ).tqarg( file ); delete store; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return false; } @@ -1773,7 +1773,7 @@ bool KoDocument::loadNativeFormatFromStore( const QString& file ) if ( !loadOasisFromStore( store ) ) { delete store; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return false; } @@ -1781,21 +1781,21 @@ bool KoDocument::loadNativeFormatFromStore( const QString& file ) { oasis = false; - QDomDocument doc; + TQDomDocument doc; bool ok = oldLoadAndParse( store, "root", doc ); if ( ok ) ok = loadXML( store->device(), doc ); if ( !ok ) { delete store; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return false; } store->close(); if ( !loadChildren( store ) ) { - kdError(30003) << "ERROR: Could not load children" << endl; + kdError(30003) << "ERROR: Could not load tqchildren" << endl; // Don't abort, proceed nonetheless } @@ -1804,12 +1804,12 @@ bool KoDocument::loadNativeFormatFromStore( const QString& file ) kdError(30003) << "ERROR: No maindoc.xml" << endl; d->lastErrorMessage = i18n( "Invalid document: no file 'maindoc.xml'." ); delete store; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return false; } if ( oasis && store->hasFile( "meta.xml" ) ) { - QDomDocument metaDoc; + TQDomDocument metaDoc; KoOasisStore oasisStore( store ); if ( oasisStore.loadAndParse( "meta.xml", metaDoc, d->lastErrorMessage ) ) { d->m_docInfo->loadOasis( metaDoc ); @@ -1817,7 +1817,7 @@ bool KoDocument::loadNativeFormatFromStore( const QString& file ) } else if ( !oasis && store->hasFile( "documentinfo.xml" ) ) { - QDomDocument doc; + TQDomDocument doc; if ( oldLoadAndParse( store, "documentinfo.xml", doc ) ) { store->close(); d->m_docInfo->load( doc ); @@ -1832,17 +1832,17 @@ bool KoDocument::loadNativeFormatFromStore( const QString& file ) bool res = completeLoading( store ); delete store; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); m_bEmpty = false; return res; } // For embedded documents -bool KoDocument::loadFromStore( KoStore* _store, const QString& url ) +bool KoDocument::loadFromStore( KoStore* _store, const TQString& url ) { if ( _store->open( url ) ) { - QDomDocument doc; + TQDomDocument doc; doc.setContent( _store->device() ); if ( !loadXML( _store->device(), doc ) ) { @@ -1865,7 +1865,7 @@ bool KoDocument::loadFromStore( KoStore* _store, const QString& url ) if ( !loadChildren( _store ) ) { - kdError(30003) << "ERROR: Could not load children" << endl; + kdError(30003) << "ERROR: Could not load tqchildren" << endl; #if 0 return false; #endif @@ -1882,14 +1882,14 @@ bool KoDocument::loadFromStore( KoStore* _store, const QString& url ) bool KoDocument::loadOasisFromStore( KoStore* store ) { KoOasisStyles oasisStyles; - QDomDocument contentDoc; - QDomDocument settingsDoc; + TQDomDocument contentDoc; + TQDomDocument settingsDoc; KoOasisStore oasisStore( store ); bool ok = oasisStore.loadAndParse( "content.xml", contentDoc, d->lastErrorMessage ); if ( !ok ) return false; - QDomDocument stylesDoc; + TQDomDocument stylesDoc; (void)oasisStore.loadAndParse( "styles.xml", stylesDoc, d->lastErrorMessage ); // Load styles from style.xml oasisStyles.createStyleMap( stylesDoc, true ); @@ -1898,7 +1898,7 @@ bool KoDocument::loadOasisFromStore( KoStore* store ) // TODO post 1.4, pass manifestDoc to the apps so that they don't have to do it themselves // (when calling KoDocumentChild::loadOasisDocument) - //QDomDocument manifestDoc; + //TQDomDocument manifestDoc; //KoOasisStore oasisStore( store ); //if ( !oasisStore.loadAndParse( "tar:/META-INF/manifest.xml", manifestDoc, d->lastErrorMessage ) ) // return false; @@ -1967,7 +1967,7 @@ void KoDocument::setModified( bool mod ) m_bEmpty = FALSE; } else { // When saving this document, all non-external child documents get saved too. - QPtrListIterator it = children(); + TQPtrListIterator it = tqchildren(); for (; it.current(); ++it ) { KoDocument *doc = it.current()->document(); @@ -1990,7 +1990,7 @@ int KoDocument::queryCloseDia() { //kdDebug(30003)<title(); @@ -2002,7 +2002,7 @@ int KoDocument::queryCloseDia() name = i18n( "Untitled" ); int res = KMessageBox::warningYesNoCancel( 0L, - i18n( "

The document '%1' has been modified.

Do you want to save it?

" ).arg(name)); + i18n( "

The document '%1' has been modified.

Do you want to save it?

" ).tqarg(name)); switch(res) { @@ -2023,9 +2023,9 @@ int KoDocument::queryCloseDia() int KoDocument::queryCloseExternalChildren() { - //kdDebug(30003)< it( children() ); + TQPtrListIterator it( tqchildren() ); for (; it.current(); ++it ) { if ( !it.current()->isDeleted() ) @@ -2053,17 +2053,17 @@ int KoDocument::queryCloseExternalChildren() return KMessageBox::Ok; } -void KoDocument::setTitleModified( const QString caption, bool mod ) +void KoDocument::setTitleModified( const TQString caption, bool mod ) { //kdDebug(30003)<( parent() ); + KoDocument *doc = dynamic_cast( tqparent() ); if ( doc ) { doc->setTitleModified( caption, mod ); return; } // we must be root doc so update caption in all related windows - QPtrListIterator it( d->m_shells ); + TQPtrListIterator it( d->m_shells ); for (; it.current(); ++it ) { it.current()->updateCaption(); @@ -2075,14 +2075,14 @@ void KoDocument::setTitleModified( const QString caption, bool mod ) void KoDocument::setTitleModified() { //kdDebug(30003)<m_current<( parent() ); - QString caption; + KoDocument *doc = dynamic_cast( tqparent() ); + TQString caption; if ( (url().isEmpty() || isStoredExtern()) && d->m_current ) { // Get caption from document info (title(), in about page) if ( documentInfo() ) { - KoDocumentInfoPage * page = documentInfo()->page( QString::fromLatin1("about") ); + KoDocumentInfoPage * page = documentInfo()->page( TQString::tqfromLatin1("about") ); if (page) caption = static_cast(page)->title(); } @@ -2124,27 +2124,27 @@ bool KoDocument::completeSaving( KoStore* ) return true; } -QDomDocument KoDocument::createDomDocument( const QString& tagName, const QString& version ) const +TQDomDocument KoDocument::createDomDocument( const TQString& tagName, const TQString& version ) const { return createDomDocument( instance()->instanceName(), tagName, version ); } //static -QDomDocument KoDocument::createDomDocument( const QString& appName, const QString& tagName, const QString& version ) +TQDomDocument KoDocument::createDomDocument( const TQString& appName, const TQString& tagName, const TQString& version ) { - QDomImplementation impl; - QString url = QString("http://www.koffice.org/DTD/%1-%1.dtd").arg(appName).arg(version); - QDomDocumentType dtype = impl.createDocumentType( tagName, - QString("-//KDE//DTD %1 %1//EN").arg(appName).arg(version), + TQDomImplementation impl; + TQString url = TQString("http://www.koffice.org/DTD/%1-%1.dtd").tqarg(appName).tqarg(version); + TQDomDocumentType dtype = impl.createDocumentType( tagName, + TQString("-//KDE//DTD %1 %1//EN").tqarg(appName).tqarg(version), url ); // The namespace URN doesn't need to include the version number. - QString namespaceURN = QString("http://www.koffice.org/DTD/%1").arg(appName); - QDomDocument doc = impl.createDocument( namespaceURN, tagName, dtype ); + TQString namespaceURN = TQString("http://www.koffice.org/DTD/%1").tqarg(appName); + TQDomDocument doc = impl.createDocument( namespaceURN, tagName, dtype ); doc.insertBefore( doc.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" ), doc.documentElement() ); return doc; } -KoXmlWriter* KoDocument::createOasisXmlWriter( QIODevice* dev, const char* rootElementName ) +KoXmlWriter* KoDocument::createOasisXmlWriter( TQIODevice* dev, const char* rootElementName ) { KoXmlWriter* writer = new KoXmlWriter( dev ); writer->startDocument( rootElementName ); @@ -2176,11 +2176,11 @@ KoXmlWriter* KoDocument::createOasisXmlWriter( QIODevice* dev, const char* rootE return writer; } -QDomDocument KoDocument::saveXML() +TQDomDocument KoDocument::saveXML() { kdError(30003) << "KoDocument::saveXML not implemented" << endl; d->lastErrorMessage = i18n( "Internal error: saveXML not implemented" ); - return QDomDocument(); + return TQDomDocument(); } KService::Ptr KoDocument::nativeService() @@ -2191,15 +2191,15 @@ KService::Ptr KoDocument::nativeService() return m_nativeService; } -QCString KoDocument::nativeFormatMimeType() const +TQCString KoDocument::nativeFormatMimeType() const { KService::Ptr service = const_cast(this)->nativeService(); if ( !service ) - return QCString(); - QCString nativeMimeType = service->property( "X-KDE-NativeMimeType" ).toString().latin1(); + return TQCString(); + TQCString nativeMimeType = service->property( "X-KDE-NativeMimeType" ).toString().latin1(); if ( nativeMimeType.isEmpty() ) { // shouldn't happen, let's find out why it happened - if ( !service->serviceTypes().contains( "KOfficePart" ) ) + if ( !service->serviceTypes().tqcontains( "KOfficePart" ) ) kdWarning(30003) << "Wrong desktop file, KOfficePart isn't mentionned" << endl; else if ( !KServiceType::serviceType( "KOfficePart" ) ) kdWarning(30003) << "The KOfficePart service type isn't installed!" << endl; @@ -2207,11 +2207,11 @@ QCString KoDocument::nativeFormatMimeType() const return nativeMimeType; } -QCString KoDocument::nativeOasisMimeType() const +TQCString KoDocument::nativeOasisMimeType() const { KService::Ptr service = const_cast(this)->nativeService(); if ( !service ) - return QCString(); + return TQCString(); return service->property( "X-KDE-NativeOasisMimeType" ).toString().latin1(); } @@ -2219,10 +2219,10 @@ QCString KoDocument::nativeOasisMimeType() const //static KService::Ptr KoDocument::readNativeService( KInstance *instance ) { - QString instname = instance ? instance->instanceName() : kapp->instanceName(); + TQString instname = instance ? instance->instanceName() : kapp->instanceName(); // The new way is: we look for a foopart.desktop in the kde_services dir. - QString servicepartname = instname + "part.desktop"; + TQString servicepartname = instname + "part.desktop"; KService::Ptr service = KService::serviceByDesktopPath( servicepartname ); if ( service ) kdDebug(30003) << servicepartname << " found." << endl; @@ -2233,7 +2233,7 @@ KService::Ptr KoDocument::readNativeService( KInstance *instance ) // Try by path first, so that we find the global one (which has the native mimetype) // even if the user created a kword.desktop in ~/.kde/share/applnk or any subdir of it. // If he created it under ~/.kde/share/applnk/Office/ then no problem anyway. - service = KService::serviceByDesktopPath( QString::fromLatin1("Office/%1.desktop").arg(instname) ); + service = KService::serviceByDesktopPath( TQString::tqfromLatin1("Office/%1.desktop").tqarg(instname) ); } if ( !service ) service = KService::serviceByDesktopName( instname ); @@ -2241,11 +2241,11 @@ KService::Ptr KoDocument::readNativeService( KInstance *instance ) return service; } -QCString KoDocument::readNativeFormatMimeType( KInstance *instance ) //static +TQCString KoDocument::readNativeFormatMimeType( KInstance *instance ) //static { KService::Ptr service = readNativeService( instance ); if ( !service ) - return QCString(); + return TQCString(); if ( service->property( "X-KDE-NativeMimeType" ).toString().isEmpty() ) { @@ -2253,7 +2253,7 @@ QCString KoDocument::readNativeFormatMimeType( KInstance *instance ) //static if ( KServiceType::serviceType( "KOfficePart" ) == 0L ) kdError(30003) << "The serviceType KOfficePart is missing. Check that you have a kofficepart.desktop file in the share/servicetypes directory." << endl; else { - QString instname = instance ? instance->instanceName() : kapp->instanceName(); + TQString instname = instance ? instance->instanceName() : kapp->instanceName(); if ( instname != "koshell" ) // hack for koshell kdWarning(30003) << service->desktopEntryPath() << ": no X-KDE-NativeMimeType entry!" << endl; } @@ -2262,15 +2262,15 @@ QCString KoDocument::readNativeFormatMimeType( KInstance *instance ) //static return service->property( "X-KDE-NativeMimeType" ).toString().latin1(); } -QStringList KoDocument::readExtraNativeMimeTypes( KInstance *instance ) //static +TQStringList KoDocument::readExtraNativeMimeTypes( KInstance *instance ) //static { KService::Ptr service = readNativeService( instance ); if ( !service ) - return QStringList(); + return TQStringList(); return service->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); } -void KoDocument::setupXmlReader( QXmlSimpleReader& reader, bool namespaceProcessing ) +void KoDocument::setupXmlReader( TQXmlSimpleReader& reader, bool namespaceProcessing ) { if ( namespaceProcessing ) { @@ -2286,16 +2286,16 @@ void KoDocument::setupXmlReader( QXmlSimpleReader& reader, bool namespaceProcess } -bool KoDocument::isNativeFormat( const QCString& mimetype ) const +bool KoDocument::isNativeFormat( const TQCString& mimetype ) const { if ( mimetype == nativeFormatMimeType() ) return true; - return extraNativeMimeTypes().contains( mimetype ); + return extraNativeMimeTypes().tqcontains( mimetype ); } -QStringList KoDocument::extraNativeMimeTypes() const +TQStringList KoDocument::extraNativeMimeTypes() const { - QStringList lst; + TQStringList lst; // This implementation is temporary while we treat both koffice-1.3 and OASIS formats as native. // But it's good to have this virtual method, in case some app want to // support more than one native format. @@ -2315,7 +2315,7 @@ int KoDocument::supportedSpecialFormats() const void KoDocument::addShell( KoMainWindow *shell ) { - if ( d->m_shells.findRef( shell ) == -1 ) + if ( d->m_shells.tqfindRef( shell ) == -1 ) { //kdDebug(30003) << "addShell: shell " << (void*)shell << " added to doc " << this << endl; d->m_shells.append( shell ); @@ -2328,7 +2328,7 @@ void KoDocument::removeShell( KoMainWindow *shell ) d->m_shells.removeRef( shell ); } -const QPtrList& KoDocument::shells() const +const TQPtrList& KoDocument::shells() const { return d->m_shells; } @@ -2345,17 +2345,17 @@ DCOPObject * KoDocument::dcopObject() return d->m_dcopObject; } -QCString KoDocument::dcopObjectId() const +TQCString KoDocument::dcopObjectId() const { return const_cast(this)->dcopObject()->objId(); } -void KoDocument::setErrorMessage( const QString& errMsg ) +void KoDocument::setErrorMessage( const TQString& errMsg ) { d->lastErrorMessage = errMsg; } -QString KoDocument::errorMessage() const +TQString KoDocument::errorMessage() const { return d->lastErrorMessage; } @@ -2364,11 +2364,11 @@ void KoDocument::showSavingErrorDialog() { if ( d->lastErrorMessage.isEmpty() ) { - KMessageBox::error( 0L, i18n( "Could not save\n%1" ).arg( m_file ) ); + KMessageBox::error( 0L, i18n( "Could not save\n%1" ).tqarg( m_file ) ); } else if ( d->lastErrorMessage != "USER_CANCELED" ) { - KMessageBox::error( 0L, i18n( "Could not save %1\nReason: %2" ).arg( m_file, d->lastErrorMessage ) ); + KMessageBox::error( 0L, i18n( "Could not save %1\nReason: %2" ).tqarg( m_file, d->lastErrorMessage ) ); } } @@ -2376,11 +2376,11 @@ void KoDocument::showLoadingErrorDialog() { if ( d->lastErrorMessage.isEmpty() ) { - KMessageBox::error( 0L, i18n( "Could not open\n%1" ).arg( url().prettyURL( 0, KURL::StripFileProtocol ) ) ); + KMessageBox::error( 0L, i18n( "Could not open\n%1" ).tqarg( url().prettyURL( 0, KURL::StripFileProtocol ) ) ); } else if ( d->lastErrorMessage != "USER_CANCELED" ) { - KMessageBox::error( 0L, i18n( "Could not open %1\nReason: %2" ).arg( url().prettyURL( 0, KURL::StripFileProtocol ), d->lastErrorMessage ) ); + KMessageBox::error( 0L, i18n( "Could not open %1\nReason: %2" ).tqarg( url().prettyURL( 0, KURL::StripFileProtocol ), d->lastErrorMessage ) ); } } @@ -2397,12 +2397,12 @@ bool KoDocument::isLoading() const void KoDocument::removeAutoSaveFiles() { // Eliminate any auto-save file - QString asf = autoSaveFile( m_file ); // the one in the current dir - if ( QFile::exists( asf ) ) - QFile::remove( asf ); - asf = autoSaveFile( QString::null ); // and the one in $HOME - if ( QFile::exists( asf ) ) - QFile::remove( asf ); + TQString asf = autoSaveFile( m_file ); // the one in the current dir + if ( TQFile::exists( asf ) ) + TQFile::remove( asf ); + asf = autoSaveFile( TQString() ); // and the one in $HOME + if ( TQFile::exists( asf ) ) + TQFile::remove( asf ); } void KoDocument::setBackupFile( bool _b ) @@ -2416,12 +2416,12 @@ bool KoDocument::backupFile()const } -void KoDocument::setBackupPath( const QString & _path) +void KoDocument::setBackupPath( const TQString & _path) { d->m_backupPath = _path; } -QString KoDocument::backupPath()const +TQString KoDocument::backupPath()const { return d->m_backupPath; } @@ -2429,7 +2429,7 @@ QString KoDocument::backupPath()const void KoDocument::setCurrent( bool on ) { //kdDebug(30003)<( parent() ); + KoDocument *doc = dynamic_cast( tqparent() ); if ( doc ) { if ( !isStoredExtern() ) @@ -2442,7 +2442,7 @@ void KoDocument::setCurrent( bool on ) d->m_current = on; if ( !on ) { - doc->setCurrent( true ); // let my next external parent take over + doc->setCurrent( true ); // let my next external tqparent take over return; } doc->forceCurrent( false ); // everybody else should keep off @@ -2457,7 +2457,7 @@ void KoDocument::forceCurrent( bool on ) { //kdDebug(30003)<m_current = on; - KoDocument *doc = dynamic_cast( parent() ); + KoDocument *doc = dynamic_cast( tqparent() ); if ( doc ) { doc->forceCurrent( false ); @@ -2505,7 +2505,7 @@ static const struct { }; static const unsigned int numTN2DT = sizeof( TN2DTArray ) / sizeof( *TN2DTArray ); -QString KoDocument::tagNameToDocumentType( const QString& localName ) +TQString KoDocument::tagNameToDocumentType( const TQString& localName ) { for ( unsigned int i = 0 ; i < numTN2DT ; ++i ) if ( localName == TN2DTArray[i].localName ) @@ -2513,9 +2513,9 @@ QString KoDocument::tagNameToDocumentType( const QString& localName ) return localName; } -QValueList KoDocument::allTextDocuments() const +TQValueList KoDocument::allTextDocuments() const { - return QValueList(); + return TQValueList(); } KoPageLayout KoDocument::pageLayout(int /*pageNumber*/) const @@ -2537,16 +2537,16 @@ void KoDocument::setUnit( KoUnit::Unit unit ) } } -QString KoDocument::unitName() const +TQString KoDocument::unitName() const { return KoUnit::unitName( unit() ); } -void KoDocument::showStartUpWidget( KoMainWindow* parent, bool alwaysShow ) +void KoDocument::showStartUpWidget( KoMainWindow* tqparent, bool alwaysShow ) { if(!alwaysShow) { KConfigGroup cfgGrp( instance()->config(), "TemplateChooserDialog" ); - QString fullTemplateName = cfgGrp.readPathEntry( "AlwaysUseTemplate" ); + TQString fullTemplateName = cfgGrp.readPathEntry( "AlwaysUseTemplate" ); if( !fullTemplateName.isEmpty() ) { openTemplate( fullTemplateName ); @@ -2558,24 +2558,24 @@ void KoDocument::showStartUpWidget( KoMainWindow* parent, bool alwaysShow ) if(d->m_startUpWidget){ d->m_startUpWidget->show(); } else { - d->m_startUpWidget = createOpenPane( parent->centralWidget(), instance(), templateType() ); + d->m_startUpWidget = createOpenPane( tqparent->centralWidget(), instance(), templateType() ); } - parent->setDocToOpen( this ); - parent->factory()->container("mainToolBar", parent)->hide(); + tqparent->setDocToOpen( this ); + tqparent->factory()->container("mainToolBar", tqparent)->hide(); } -void KoDocument::openExistingFile( const QString& file ) +void KoDocument::openExistingFile( const TQString& file ) { KURL url( file ); bool ok = openURL( url ); setModified( false ); if( ok ) - QTimer::singleShot( 0, this, SLOT( deleteOpenPane() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( deleteOpenPane() ) ); } -void KoDocument::openTemplate( const QString& file ) +void KoDocument::openTemplate( const TQString& file ) { bool ok = loadNativeFormat( file ); setModified( false ); @@ -2600,31 +2600,31 @@ void KoDocument::startCustomDocument() { deleteOpenPane(); } -KoOpenPane* KoDocument::createOpenPane( QWidget* parent, KInstance* instance, - const QString& templateType ) +KoOpenPane* KoDocument::createOpenPane( TQWidget* tqparent, KInstance* instance, + const TQString& templateType ) { - KoOpenPane* openPane = new KoOpenPane( parent, instance, templateType ); - QWidget *customDoc = createCustomDocumentWidget(openPane); + KoOpenPane* openPane = new KoOpenPane( tqparent, instance, templateType ); + TQWidget *customDoc = createCustomDocumentWidget(openPane); if(customDoc) { openPane->setCustomDocumentWidget( customDoc ); - connect( customDoc, SIGNAL( documentSelected() ), this, SLOT( startCustomDocument() ) ); + connect( customDoc, TQT_SIGNAL( documentSelected() ), this, TQT_SLOT( startCustomDocument() ) ); } openPane->show(); - connect( openPane, SIGNAL( openExistingFile( const QString& ) ), - this, SLOT( openExistingFile( const QString& ) ) ); - connect( openPane, SIGNAL( openTemplate( const QString& ) ), - this, SLOT( openTemplate( const QString& ) ) ); + connect( openPane, TQT_SIGNAL( openExistingFile( const TQString& ) ), + this, TQT_SLOT( openExistingFile( const TQString& ) ) ); + connect( openPane, TQT_SIGNAL( openTemplate( const TQString& ) ), + this, TQT_SLOT( openTemplate( const TQString& ) ) ); return openPane; } -void KoDocument::setTemplateType( const QString& _templateType ) +void KoDocument::setTemplateType( const TQString& _templateType ) { d->m_templateType = _templateType; } -QString KoDocument::templateType() const +TQString KoDocument::templateType() const { return d->m_templateType; } @@ -2633,7 +2633,7 @@ void KoDocument::deleteOpenPane() { if( d->m_startUpWidget ) { d->m_startUpWidget->hide(); - QTimer::singleShot(1000, this, SLOT(deleteOpenPaneDelayed())); + TQTimer::singleShot(1000, this, TQT_SLOT(deleteOpenPaneDelayed())); shells().getFirst()->factory()->container("mainToolBar", shells().getFirst())->show(); shells().getFirst()->setRootDocument( this ); @@ -2648,20 +2648,20 @@ void KoDocument::deleteOpenPaneDelayed() d->m_startUpWidget = 0; } -QWidget* KoDocument::createCustomDocumentWidget(QWidget */*parent*/) { +TQWidget* KoDocument::createCustomDocumentWidget(TQWidget */*tqparent*/) { return 0; } -bool KoDocument::showEmbedInitDialog(QWidget* parent) +bool KoDocument::showEmbedInitDialog(TQWidget* tqparent) { - KDialogBase dlg(parent, "EmbedInitDialog", true, i18n("Embedding Object"), 0, KDialogBase::NoDefault); + KDialogBase dlg(tqparent, "EmbedInitDialog", true, i18n("Embedding Object"), 0, KDialogBase::NoDefault); KoOpenPane* pane = createOpenPane(&dlg, instance(), templateType()); - pane->layout()->setMargin(0); + pane->tqlayout()->setMargin(0); dlg.setMainWidget(pane); dlg.setInitialSize(dlg.configDialogSize("EmbedInitDialog")); - connect(this, SIGNAL(closeEmbedInitDialog()), &dlg, SLOT(slotOk())); + connect(this, TQT_SIGNAL(closeEmbedInitDialog()), &dlg, TQT_SLOT(slotOk())); - bool ok = dlg.exec() == QDialog::Accepted; + bool ok = dlg.exec() == TQDialog::Accepted; dlg.saveDialogSize("EmbedInitDialog"); diff --git a/lib/kofficecore/KoDocument.h b/lib/kofficecore/KoDocument.h index 1e8f1f83e..0499ab6c1 100644 --- a/lib/kofficecore/KoDocument.h +++ b/lib/kofficecore/KoDocument.h @@ -25,7 +25,7 @@ class KoTextDocument; namespace std { } using namespace std; -#include +#include #include #include @@ -35,9 +35,9 @@ using namespace std; #include #include -class QDomElement; -class QDomDocument; -class QXmlSimpleReader; +class TQDomElement; +class TQDomDocument; +class TQXmlSimpleReader; class KoStore; class KoMainWindow; @@ -61,8 +61,9 @@ class KoOpenPane; class KOFFICECORE_EXPORT KoDocument : public KParts::ReadWritePart { Q_OBJECT - Q_PROPERTY( QCString dcopObjectId READ dcopObjectId) - Q_PROPERTY( bool backupFile READ backupFile WRITE setBackupFile ) + TQ_OBJECT + TQ_PROPERTY( TQCString dcopObjectId READ dcopObjectId) + TQ_PROPERTY( bool backupFile READ backupFile WRITE setBackupFile ) public: @@ -70,24 +71,24 @@ public: * Constructor. * The first 4 arguments are the same as the ones passed to KParts::Factory::createPart. * - * @param parentWidget the parent widget, in case we create a wrapper widget + * @param tqparentWidget the tqparent widget, in case we create a wrapper widget * (in single view mode). * Usually the first argument passed by KParts::Factory::createPart. * @param widgetName name of the widget. - * @param parent may be another KoDocument, or anything else. + * @param tqparent may be another KoDocument, or anything else. * Usually the third argument of KParts::Factory::createPart. * @param name is used to identify this document via DCOP so you may want to * pass a meaningful name here which matches the pattern [A-Za-z_][A-Za-z_0-9]*. * @param singleViewMode determines whether the document may only have one view. In this case - * the @p parent must be a QWidget derived class. KoDocument will then create a wrapper widget - * (KoViewWrapperWidget) which is a child of @p parentWidget. + * the @p tqparent must be a TQWidget derived class. KoDocument will then create a wrapper widget + * (KoViewWrapperWidget) which is a child of @p tqparentWidget. * This widget can be retrieved by calling widget(). * * @todo explain what the purpose of widgetName is. */ - KoDocument( QWidget* parentWidget, + KoDocument( TQWidget* tqparentWidget, const char* widgetName, - QObject* parent, + TQObject* tqparent, const char* name, bool singleViewMode = false ); @@ -125,13 +126,13 @@ public: * @see KXMLGUIClient::actionCollection * @see KoView::action */ - virtual KAction *action( const QDomElement &element ) const; + virtual KAction *action( const TQDomElement &element ) const; /** * Returns the DOM document which describes the GUI of the * first view. */ - virtual QDomDocument domDocument() const; + virtual TQDomDocument domDocument() const; /** * @internal @@ -187,7 +188,7 @@ public: * @see KService * @see KDesktopFile */ - static QCString readNativeFormatMimeType( KInstance *instance = 0 ); + static TQCString readNativeFormatMimeType( KInstance *instance = 0 ); /** * Used by KoMainWindow, when no document exists yet. @@ -199,7 +200,7 @@ public: * @see KService * @see KDesktopFile */ - static QStringList readExtraNativeMimeTypes( KInstance *instance = 0 ); + static TQStringList readExtraNativeMimeTypes( KInstance *instance = 0 ); /** * With the help of @p instance or KApplication::instance() this @@ -211,7 +212,7 @@ public: /** * setup the XML reader, so that we don't have to duplicate the code. */ - static void setupXmlReader( QXmlSimpleReader& reader, bool namespaceProcessing = false ); + static void setupXmlReader( TQXmlSimpleReader& reader, bool namespaceProcessing = false ); /** * To be preferred when a document exists. It is fast when calling @@ -220,20 +221,20 @@ public: * This comes from the X-KDE-NativeMimeType key in the .desktop file * You do NOT have to reimplement this (it is only virtual for kounavail). */ - virtual QCString nativeFormatMimeType() const; + virtual TQCString nativeFormatMimeType() const; /** * Returns the OASIS OpenDocument mimetype of the document, if supported * This comes from the X-KDE-NativeOasisMimeType key in the .desktop file */ - QCString nativeOasisMimeType() const; + TQCString nativeOasisMimeType() const; /// Checks whether a given mimetype can be handled natively. - bool isNativeFormat( const QCString& mimetype ) const; + bool isNativeFormat( const TQCString& mimetype ) const; /// Returns a list of the mimetypes considered "native", i.e. which can /// be saved by KoDocument without a filter, in *addition* to the main one - virtual QStringList extraNativeMimeTypes() const; + virtual TQStringList extraNativeMimeTypes() const; /// Enum values used by specialOutputFlag - note that it's a bitfield for supportedSpecialFormats enum { /*SaveAsKOffice1dot1 = 1,*/ // old and removed @@ -251,7 +252,7 @@ public: /** * Returns the actual mimetype of the document */ - QCString mimeType() const; + TQCString mimeType() const; /** * @brief Sets the mime type for the document. @@ -259,7 +260,7 @@ public: * When choosing "save as" this is also the mime type * selected by default. */ - void setMimeType( const QCString & mimeType ); + void setMimeType( const TQCString & mimeType ); /** * @brief Set the format in which the document should be saved. @@ -270,8 +271,8 @@ public: * @param mimeType the mime type (format) to use. * @param specialOutputFlag is for "save as older version" etc. */ - void setOutputMimeType( const QCString & mimeType, int specialOutputFlag = 0 ); - QCString outputMimeType() const; + void setOutputMimeType( const TQCString & mimeType, int specialOutputFlag = 0 ); + TQCString outputMimeType() const; int specialOutputFlag() const; /** @@ -298,14 +299,14 @@ public: * If you asked the user about something and he chose "Cancel", * set the message to the magic string "USER_CANCELED", to skip the error dialog. */ - void setErrorMessage( const QString& errMsg ); + void setErrorMessage( const TQString& errMsg ); /** * Return the last error message. Usually KoDocument takes care of * showing it; this method is mostly provided for non-interactive use. * @since 1.4 */ - QString errorMessage() const; + TQString errorMessage() const; /** * Show the last error message in a message box. @@ -327,7 +328,7 @@ public: /** * Create a new view for the document. */ - KoView *createView( QWidget *parent = 0, const char *name = 0 ); + KoView *createView( TQWidget *tqparent = 0, const char *name = 0 ); /** * Adds a view to the document. @@ -345,7 +346,7 @@ public: /** * @return a list of views this document is displayed in */ - const QPtrList & views() const; + const TQPtrList & views() const; /** * @return number of views this document is displayed in @@ -355,7 +356,7 @@ public: /** * Reimplemented from KParts::Part */ - virtual KParts::Part *hitTest( QWidget *widget, const QPoint &globalPos ); + virtual KParts::Part *hitTest( TQWidget *widget, const TQPoint &globalPos ); /** * Find the most nested child document which contains the @@ -372,7 +373,7 @@ public: * * @return Pointer to the document under the mouse at that position */ - virtual KoDocument *hitTest( const QPoint &pos, const QWMatrix& matrix = QWMatrix() ); + virtual KoDocument *hitTest( const TQPoint &pos, const TQWMatrix& matrix = TQWMatrix() ); /// Temporary API for accessing the view that calls hitTest. /// Will be passed to hitTest() in 2.x. /// Only call this from within hitTest()! @@ -384,21 +385,21 @@ public: * @param painter The painter object onto which will be drawn. * @param rect The rect that should be used in the painter object. * @param transparent If true then the entire rectangle is erased before painting. - * @param view The KoView is needed to fiddle about with the active widget, when painting children. + * @param view The KoView is needed to fiddle about with the active widget, when painting tqchildren. * @param zoomX The zoom value to be applied to X coordinates when painting. * @param zoomY The zoom value to be applied to Y coordinates when painting. */ - virtual void paintEverything( QPainter &painter, const QRect &rect, bool transparent = false, + virtual void paintEverything( TQPainter &painter, const TQRect &rect, bool transparent = false, KoView *view = 0L, double zoomX = 1.0, double zoomY = 1.0 ); /** * @brief Generates a preview picture of the document * @note The preview is used in the File Dialog and also to create the Thumbnail */ - virtual QPixmap generatePreview( const QSize& size ); + virtual TQPixmap generatePreview( const TQSize& size ); /** - * Paints all of the documents children into the given painter object. + * Paints all of the documents tqchildren into the given painter object. * * @param painter The painter object onto which will be drawn. * @param rect The rect that should be used in the painter object. @@ -408,7 +409,7 @@ public: * * @see #paintChild #paintEverything #paintContent */ - virtual void paintChildren( QPainter &painter, const QRect &rect, KoView *view, double zoomX = 1.0, double zoomY = 1.0 ); + virtual void paintChildren( TQPainter &painter, const TQRect &rect, KoView *view, double zoomX = 1.0, double zoomY = 1.0 ); /** * Paint a given child. Normally called by paintChildren(). @@ -421,12 +422,12 @@ public: * * @see #paintEverything #paintChildren #paintContent */ - virtual void paintChild( KoDocumentChild *child, QPainter &painter, KoView *view, + virtual void paintChild( KoDocumentChild *child, TQPainter &painter, KoView *view, double zoomX = 1.0, double zoomY = 1.0 ); /** * Paints the data itself. Normally called by paintEverything(). It does not - * paint the children. + * paint the tqchildren. * It's this method that %KOffice Parts have to implement. * * @param painter The painter object onto which will be drawn. @@ -437,7 +438,7 @@ public: * * @see #paintEverything */ - virtual void paintContent( QPainter &painter, const QRect &rect, bool transparent = false, + virtual void paintContent( TQPainter &painter, const TQRect &rect, bool transparent = false, double zoomX = 1.0, double zoomY = 1.0 ) = 0; /** @@ -458,17 +459,17 @@ public: * Initializes an empty document (display the template dialog!). * You have to overload this method to initialize all your document variables. * @param flags see InitDocFlags - * @param parentWidget the widget this document belongs with + * @param tqparentWidget the widget this document belongs with */ - virtual bool initDoc(InitDocFlags flags, QWidget* parentWidget=0) = 0; + virtual bool initDoc(InitDocFlags flags, TQWidget* tqparentWidget=0) = 0; /** * Creates and shows the start up widget. - * @param parent the KoMainWindow used as parent for the widget. + * @param tqparent the KoMainWindow used as tqparent for the widget. * @param alwaysShow always show the widget even if the user has configured it to not show. * @since 1.5 */ - virtual void showStartUpWidget(KoMainWindow* parent, bool alwaysShow = false); + virtual void showStartUpWidget(KoMainWindow* tqparent, bool alwaysShow = false); /** * Sets the modified flag on the document. This means that it has @@ -506,7 +507,7 @@ public: * @param store The store to load from * @param url An internal url, like tar:/1/2 */ - virtual bool loadFromStore( KoStore* store, const QString& url ); + virtual bool loadFromStore( KoStore* store, const TQString& url ); /** * @brief Loads an OASIS document from a store. @@ -519,17 +520,17 @@ public: * * You should not have to reimplement this - but call it in saveChildren(). */ - virtual bool saveToStore( KoStore* store, const QString& path ); + virtual bool saveToStore( KoStore* store, const TQString& path ); /** * Reimplement this method to load the contents of your %KOffice document, * from the XML document. This is for the pre-Oasis file format (maindoc.xml). * - * You are supposed to use the QDomDocument. The QIODevice is provided only + * You are supposed to use the TQDomDocument. The TQIODevice is provided only * for the cases where some pre-processing is needed, like kpresenter's kprconverter. - * Note that the QIODevice could be 0L, when called from an import filter. + * Note that the TQIODevice could be 0L, when called from an import filter. */ - virtual bool loadXML( QIODevice *, const QDomDocument & doc ) = 0; + virtual bool loadXML( TQIODevice *, const TQDomDocument & doc ) = 0; /** * Reimplement this method to load the contents of your %KOffice document, @@ -537,8 +538,8 @@ public: * you can find them in the oasisStyles parameter. The store can be used * to load images and embedded documents. */ - virtual bool loadOasis( const QDomDocument & doc, KoOasisStyles& oasisStyles, - const QDomDocument & settings, KoStore* store ) = 0; + virtual bool loadOasis( const TQDomDocument & doc, KoOasisStyles& oasisStyles, + const TQDomDocument & settings, KoStore* store ) = 0; /** * Reimplement this method to save the contents of your %KOffice document, @@ -548,18 +549,18 @@ public: /** * Reimplement this to save the contents of the %KOffice document into - * a QDomDocument. The framework takes care of saving it to the store. + * a TQDomDocument. The framework takes care of saving it to the store. */ - virtual QDomDocument saveXML(); + virtual TQDomDocument saveXML(); /** - * Return a correctly created QDomDocument for this KoDocument, + * Return a correctly created TQDomDocument for this KoDocument, * including processing instruction, complete DOCTYPE tag (with systemId and publicId), and root element. * @param tagName the name of the tag for the root element * @param version the DTD version (usually the application's version). * @deprecated use createOasisXmlWriter instead */ - QDomDocument createDomDocument( const QString& tagName, const QString& version ) const; + TQDomDocument createDomDocument( const TQString& tagName, const TQString& version ) const; /** * Return an XML writer for saving Oasis XML into the device @p dev, @@ -578,17 +579,17 @@ public: * will need to call endElement(); endDocument(); before destroying the KoXmlWriter. * @note OASIS-specific */ - static KoXmlWriter* createOasisXmlWriter( QIODevice* dev, const char* rootElementName ); + static KoXmlWriter* createOasisXmlWriter( TQIODevice* dev, const char* rootElementName ); /** - * Return a correctly created QDomDocument for an old (1.3-style) %KOffice document, + * Return a correctly created TQDomDocument for an old (1.3-style) %KOffice document, * including processing instruction, complete DOCTYPE tag (with systemId and publicId), and root element. * This static method can be used e.g. by filters. * @param appName the app's instance name, e.g. kword, kspread, kpresenter etc. * @param tagName the name of the tag for the root element, e.g. DOC for kword/kpresenter. * @param version the DTD version (usually the application's version). */ - static QDomDocument createDomDocument( const QString& appName, const QString& tagName, const QString& version ); + static TQDomDocument createDomDocument( const TQString& appName, const TQString& tagName, const TQString& version ); /** * The first thing to do in loadOasis is get hold of the office:body tag, then its child. @@ -596,14 +597,14 @@ public: * This method returns a translated name for the type of document, * e.g. i18n("Word Processing") for office:text. */ - static QString tagNameToDocumentType( const QString& localName ); + static TQString tagNameToDocumentType( const TQString& localName ); /** * Save the document. The default implementation is to call * saveXML(). This method exists only for applications that - * don't use QDomDocument for saving, i.e. kword and kpresenter. + * don't use TQDomDocument for saving, i.e. kword and kpresenter. */ - virtual bool saveToStream( QIODevice * dev ); + virtual bool saveToStream( TQIODevice * dev ); /** * Loads a document in the native format from a given URL. @@ -611,14 +612,14 @@ public: * * @param file the file to load - usually KReadOnlyPart::m_file or the result of a filter */ - virtual bool loadNativeFormat( const QString & file ); + virtual bool loadNativeFormat( const TQString & file ); /** * Saves the document in native format, to a given file * You should never have to reimplement. * Made public for writing templates. */ - virtual bool saveNativeFormat( const QString & file ); + virtual bool saveNativeFormat( const TQString & file ); /** * Activate/deactivate/configure the autosave feature. @@ -658,17 +659,17 @@ public: static int defaultAutoSave() { return s_defaultAutoSave; } /** - * @return the list of all children. Do not modify the + * @return the list of all tqchildren. Do not modify the * returned list. */ - const QPtrList& children() const; + const TQPtrList& tqchildren() const; /** * @return the KoDocumentChild associated with the given Document, but only if * @p doc is a direct child of this document. * * This is a convenience function. You could get the same result - * by traversing the list returned by children(). + * by traversing the list returned by tqchildren(). */ KoDocumentChild *child( KoDocument *doc ); @@ -678,8 +679,8 @@ public: */ KoDocumentInfo *documentInfo() const; - void setViewBuildDocument( KoView *view, const QDomDocument &doc ); - QDomDocument viewBuildDocument( KoView *view ); + void setViewBuildDocument( KoView *view, const TQDomDocument &doc ); + TQDomDocument viewBuildDocument( KoView *view ); /** * Appends the shell to the list of shells which show this @@ -699,7 +700,7 @@ public: /** * @return the list of shells for the main window */ - const QPtrList& shells() const; + const TQPtrList& shells() const; /** * @return the number of shells for the main window @@ -709,7 +710,7 @@ public: /** * @return the list of all the currently opened documents */ - static QPtrList *documentList() { return s_documentList; } + static TQPtrList *documentList() { return s_documentList; } /** * @brief Return a DCOP interface for this document @@ -722,7 +723,7 @@ public: /** * @return the ID of the DCOP interface for this document. **/ - QCString dcopObjectId() const; + TQCString dcopObjectId() const; /** * Signal the progress of operations such as loading or saving. @@ -740,7 +741,7 @@ public: virtual bool isStoredExtern() const; /** - * @return the page layout associated with this document (margins, pageSize, etc). + * @return the page tqlayout associated with this document (margins, pageSize, etc). * Override this if you want to provide different sized pages. * * @see KoPageLayout @@ -770,14 +771,14 @@ public: int queryCloseDia(); /** - * @brief Set when we do not want to save external children when saving our 'main' doc. + * @brief Set when we do not want to save external tqchildren when saving our 'main' doc. * - * This makes it possible to save 'main' doc + all its internal children first, then - * go on to save external children. Typically used by query close. + * This makes it possible to save 'main' doc + all its internal tqchildren first, then + * go on to save external tqchildren. Typically used by query close. * Use: * @code * doc->setDoNotSaveExtDoc(); - * doc->save(); // saves doc and its internal children, + * doc->save(); // saves doc and its internal tqchildren, * //also calls saveExternalChildren() which sets setDoNotSaveExtDoc(false) * doc->saveExternalChildren(); * @endcode @@ -787,27 +788,27 @@ public: /** * Sets the backup path of the document */ - void setBackupPath( const QString & _path ); + void setBackupPath( const TQString & _path ); /** * @return path to the backup document */ - QString backupPath()const; + TQString backupPath()const; /** * Indicates that this document is currently viewed * and thus should control the title caption. - * Also resets current flag for all parents. + * Also resets current flag for all tqparents. */ void setCurrent( bool on = true ); /** - * Sets current flag for this document and all its parents + * Sets current flag for this document and all its tqparents */ void forceCurrent( bool on ); bool isCurrent() const; - void setTitleModified( const QString caption, bool mod ); + void setTitleModified( const TQString caption, bool mod ); /** * Sets the document URL to empty URL @@ -815,7 +816,7 @@ public: * After using loadNativeFormat on a template, one wants * to set the url to KURL() */ - void resetURL() { m_url = KURL(); m_file = QString::null; } + void resetURL() { m_url = KURL(); m_file = TQString(); } /** * Set when you want an external embedded document to be stored internally @@ -843,7 +844,7 @@ public: * * @internal */ - QString &file() { return m_file; } + TQString &file() { return m_file; } /** * _Only_ use these functions to restore m_file (in KoMainWindow) after a @@ -853,12 +854,12 @@ public: * * @internal */ - void setFile( const QString &file ) { m_file = file; } + void setFile( const TQString &file ) { m_file = file; } /** * @internal (public for KoMainWindow) */ - void setMimeTypeAfterLoading( const QString& mimeType ); + void setMimeTypeAfterLoading( const TQString& mimeType ); /** * @return returns the number of pages in the document. @@ -870,7 +871,7 @@ public: * This is used by some text-analyzer plugins. * @since 1.5 */ - virtual QValueList allTextDocuments() const; + virtual TQValueList allTextDocuments() const; /** * Returns the unit used to display all measures/distances. @@ -890,27 +891,27 @@ public: * unit() for everything else (conversions etc.) * @since 1.5 */ - QString unitName() const; + TQString unitName() const; /** * Set the template type used. This is used by the start up widget to show * the correct templates. * @since 1.5 */ - void setTemplateType(const QString& _templateType); + void setTemplateType(const TQString& _templateType); /** * Template type used. This is used by the start up widget to show * the correct templates. * @since 1.5 */ - QString templateType() const; + TQString templateType() const; /** * Shows the init dialog when embeding - * @param parent the parent widget + * @param tqparent the tqparent widget * @since 1.5 */ - virtual bool showEmbedInitDialog(QWidget* parent); + virtual bool showEmbedInitDialog(TQWidget* tqparent); public slots: /** @@ -949,7 +950,7 @@ signals: * Emitted e.g. at the beginning of a save operation * This is emitted by KoDocument and used by KoView to display a statusbar message */ - void sigStatusBarMessage( const QString& text ); + void sigStatusBarMessage( const TQString& text ); /** * Emitted e.g. at the end of a save operation @@ -973,21 +974,21 @@ protected slots: * @param file the file to load (including path) * @since 1.5 */ - virtual void openExistingFile( const QString& file ); + virtual void openExistingFile( const TQString& file ); /** * This slot loads a template and deletes the start up widget. * @param file the template to load * @since 1.5 */ - virtual void openTemplate( const QString& file ); + virtual void openTemplate( const TQString& file ); void deleteOpenPaneDelayed(); protected: - QString autoSaveFile( const QString & path ) const; + TQString autoSaveFile( const TQString & path ) const; - virtual KoView *createViewInstance( QWidget *parent, const char *name ) = 0; + virtual KoView *createViewInstance( TQWidget *tqparent, const char *name ) = 0; /** * Loads a document from KReadOnlyPart::m_file (KParts takes care of downloading @@ -1015,9 +1016,9 @@ protected: * implement the logic to implement the document instance correctly. * After initializing the widget should emit a signal called 'documentSelected()' which * will remove the startupWidget and show the document. - * @param parent the parent of the to be created widget. + * @param tqparent the tqparent of the to be created widget. */ - virtual QWidget* createCustomDocumentWidget(QWidget *parent); + virtual TQWidget* createCustomDocumentWidget(TQWidget *tqparent); /** * OLD XML method. For OASIS just call KoDocumentChild::loadOasisDocument @@ -1028,7 +1029,7 @@ protected: * * An example implementation may look like this: * @code - * QPtrListIterator it( children() ); + * TQPtrListIterator it( tqchildren() ); * for( ; it.current(); ++it ) * { * if ( !it.current()->loadDocument( _store ) ) @@ -1042,16 +1043,16 @@ protected: virtual bool loadChildren( KoStore* ); /** - * Saves all internal children (only!). - * @see saveExternalChildren if you have external children. + * Saves all internal tqchildren (only!). + * @see saveExternalChildren if you have external tqchildren. * Returns true on success. */ virtual bool saveChildren( KoStore* store ); /** - * Saves all internal children (only!), to the store, using the OASIS format. + * Saves all internal tqchildren (only!), to the store, using the OASIS format. * This is called automatically during saveNativeFormat. - * @see saveExternalChildren if you have external children. + * @see saveExternalChildren if you have external tqchildren. * Returns true on success. */ virtual bool saveChildrenOasis( KoStore* store, KoXmlWriter* manifestWriter ); @@ -1076,7 +1077,7 @@ protected: virtual bool completeSaving( KoStore* store ); /** - * Inserts the new child in the list of children and emits the + * Inserts the new child in the list of tqchildren and emits the * childChanged() signal. * * At the same time this method marks this document as modified. @@ -1092,14 +1093,14 @@ protected: virtual void setModified() { KParts::ReadWritePart::setModified(); } /** @internal */ - virtual void insertChild(QObject *o) { QObject::insertChild(o); } + virtual void insertChild(TQObject *o) { TQObject::insertChild(o); } KoPageLayout m_pageLayout; /** - * Saves all externally stored children. + * Saves all externally stored tqchildren. * Returns true on success. - * @see #saveChildren for internal children + * @see #saveChildren for internal tqchildren */ virtual bool saveExternalChildren(); @@ -1121,13 +1122,13 @@ protected: /** * Creates the open widget showed at application start up. - * @param parent the parent widget + * @param tqparent the tqparent widget * @param instance the KInstance to be used for KConfig data * @param templateType the template-type (group) that should be selected on creation. * @since 1.5 */ - KoOpenPane* createOpenPane( QWidget* parent, KInstance* instance, - const QString& templateType = QString::null); + KoOpenPane* createOpenPane( TQWidget* tqparent, KInstance* instance, + const TQString& templateType = TQString()); private slots: void slotChildChanged( KoChild *c ); @@ -1143,15 +1144,15 @@ private slots: private: KService::Ptr nativeService(); - bool oldLoadAndParse( KoStore* store, const QString& filename, QDomDocument& doc ); - bool loadNativeFormatFromStore( const QString& file ); + bool oldLoadAndParse( KoStore* store, const TQString& filename, TQDomDocument& doc ); + bool loadNativeFormatFromStore( const TQString& file ); bool savePreview( KoStore* store ); bool saveOasisPreview( KoStore* store, KoXmlWriter* manifestWriter ); class Private; Private *d; KService::Ptr m_nativeService; bool m_bEmpty; - static QPtrList *s_documentList; + static TQPtrList *s_documentList; static const int s_defaultAutoSave; }; diff --git a/lib/kofficecore/KoDocumentChild.cpp b/lib/kofficecore/KoDocumentChild.cpp index 8157b95ad..308493adf 100644 --- a/lib/kofficecore/KoDocumentChild.cpp +++ b/lib/kofficecore/KoDocumentChild.cpp @@ -35,7 +35,7 @@ #include #include -#include +#include #include @@ -67,32 +67,32 @@ public: bool m_deleted; }; -KoDocumentChild::KoDocumentChild( KoDocument* parent, KoDocument* doc, const QRect& geometry ) - : KoChild( parent ) +KoDocumentChild::KoDocumentChild( KoDocument* tqparent, KoDocument* doc, const TQRect& tqgeometry ) + : KoChild( tqparent ) { d = new KoDocumentChildPrivate; - d->m_parent = parent; + d->m_parent = tqparent; d->m_doc = doc; - setGeometry( geometry ); + setGeometry( tqgeometry ); d->m_deleted = false; if ( doc ) doc->setStoreInternal( !doc->hasExternURL() ); } -KoDocumentChild::KoDocumentChild( KoDocument* parent ) - : KoChild( parent ) +KoDocumentChild::KoDocumentChild( KoDocument* tqparent ) + : KoChild( tqparent ) { d = new KoDocumentChildPrivate; - d->m_parent = parent; + d->m_parent = tqparent; d->m_doc = 0L; d->m_deleted = false; } -void KoDocumentChild::setDocument( KoDocument *doc, const QRect &geometry ) +void KoDocumentChild::setDocument( KoDocument *doc, const TQRect &tqgeometry ) { kdDebug()<url().url()<m_doc = doc; - setGeometry( geometry ); + setGeometry( tqgeometry ); updateMatrix(); } @@ -102,45 +102,45 @@ KoDocument *KoDocumentChild::document() const return d->m_doc; } -KoDocument* KoDocumentChild::parentDocument() const +KoDocument* KoDocumentChild::tqparentDocument() const { return d->m_parent; } -KoDocument* KoDocumentChild::hitTest( const QPoint &p, const QWMatrix &_matrix ) +KoDocument* KoDocumentChild::hitTest( const TQPoint &p, const TQWMatrix &_matrix ) { - if ( !region( _matrix ).contains( p ) || !d->m_doc ) + if ( !region( _matrix ).tqcontains( p ) || !d->m_doc ) return 0L; - QWMatrix m( _matrix ); + TQWMatrix m( _matrix ); m = matrix() * m; m.scale( xScaling(), yScaling() ); return d->m_doc->hitTest( p, m ); } -void KoDocumentChild::loadOasis( const QDomElement &frameElement, const QDomElement& objectElement ) +void KoDocumentChild::loadOasis( const TQDomElement &frameElement, const TQDomElement& objectElement ) { double x, y, w, h; - x = KoUnit::parseValue( frameElement.attributeNS( KoXmlNS::svg, "x", QString::null ) ); - y = KoUnit::parseValue( frameElement.attributeNS( KoXmlNS::svg, "y", QString::null ) ); - w = KoUnit::parseValue( frameElement.attributeNS( KoXmlNS::svg, "width", QString::null ) ); - h = KoUnit::parseValue( frameElement.attributeNS( KoXmlNS::svg, "height", QString::null ) ); - m_tmpGeometry = QRect((int)x, (int)y, (int)w, (int)h); // #### double->int conversion + x = KoUnit::parseValue( frameElement.attributeNS( KoXmlNS::svg, "x", TQString() ) ); + y = KoUnit::parseValue( frameElement.attributeNS( KoXmlNS::svg, "y", TQString() ) ); + w = KoUnit::parseValue( frameElement.attributeNS( KoXmlNS::svg, "width", TQString() ) ); + h = KoUnit::parseValue( frameElement.attributeNS( KoXmlNS::svg, "height", TQString() ) ); + m_tmpGeometry = TQRect((int)x, (int)y, (int)w, (int)h); // #### double->int conversion setGeometry(m_tmpGeometry); - QString url = objectElement.attributeNS( KoXmlNS::xlink, "href", QString::null ); + TQString url = objectElement.attributeNS( KoXmlNS::xlink, "href", TQString() ); if ( url[0] == '#' ) url = url.mid( 1 ); if ( url.startsWith( "./" ) ) - m_tmpURL = QString( INTERNAL_PROTOCOL ) + ":/" + url.mid( 2 ); + m_tmpURL = TQString( INTERNAL_PROTOCOL ) + ":/" + url.mid( 2 ); else m_tmpURL = url; kdDebug() << k_funcinfo << m_tmpURL << endl; } -bool KoDocumentChild::load( const QDomElement& element, bool uppercase ) +bool KoDocumentChild::load( const TQDomElement& element, bool uppercase ) { if ( element.hasAttribute( "url" ) ) m_tmpURL = element.attribute("url"); @@ -159,10 +159,10 @@ bool KoDocumentChild::load( const QDomElement& element, bool uppercase ) } bool brect = FALSE; - QDomNode n = element.firstChild(); + TQDomNode n = element.firstChild(); for( ; !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.isNull() ) continue; if ( e.tagName() == "rect" || ( uppercase && e.tagName() == "RECT" ) ) { @@ -177,7 +177,7 @@ bool KoDocumentChild::load( const QDomElement& element, bool uppercase ) w = e.attribute( "w" ).toInt(&brect); if ( e.hasAttribute( "h" ) ) h = e.attribute( "h" ).toInt(&brect); - m_tmpGeometry = QRect(x, y, w, h); + m_tmpGeometry = TQRect(x, y, w, h); setGeometry(m_tmpGeometry); } } @@ -209,11 +209,11 @@ bool KoDocumentChild::loadDocument( KoStore* store ) if ( res ) { // Try to turn the mimetype name into its comment - QString mimeName = m_tmpMimeType; + TQString mimeName = m_tmpMimeType; KMimeType::Ptr mime = KMimeType::mimeType( m_tmpMimeType ); if ( mime->name() != KMimeType::defaultMimeType() ) mimeName = mime->comment(); - d->m_doc->setProperty( "unavailReason", i18n( "No handler found for %1" ).arg( mimeName ) ); + d->m_doc->setProperty( "unavailReason", i18n( "No handler found for %1" ).tqarg( mimeName ) ); } return res; } @@ -221,19 +221,19 @@ bool KoDocumentChild::loadDocument( KoStore* store ) return loadDocumentInternal( store, e, true /*open url*/, false /*not oasis*/ ); } -bool KoDocumentChild::loadOasisDocument( KoStore* store, const QDomDocument& manifestDoc ) +bool KoDocumentChild::loadOasisDocument( KoStore* store, const TQDomDocument& manifestDoc ) { - QString path = m_tmpURL; + TQString path = m_tmpURL; if ( m_tmpURL.startsWith( INTERNAL_PROTOCOL ) ) { path = store->currentDirectory(); if ( !path.isEmpty() ) path += '/'; - QString relPath = KURL( m_tmpURL ).path(); + TQString relPath = KURL( m_tmpURL ).path(); path += relPath.mid( 1 ); // remove leading '/' } if ( !path.endsWith( "/" ) ) path += '/'; - const QString mimeType = KoOasisStore::mimeForPath( manifestDoc, path ); + const TQString mimeType = KoOasisStore::mimeForPath( manifestDoc, path ); kdDebug() << k_funcinfo << "path for manifest file=" << path << " mimeType=" << mimeType << endl; if ( mimeType.isEmpty() ) { kdError(30003) << "Manifest doesn't have media-type for " << path << endl; @@ -248,11 +248,11 @@ bool KoDocumentChild::loadOasisDocument( KoStore* store, const QDomDocument& man if ( res ) { // Try to turn the mimetype name into its comment - QString mimeName = mimeType; + TQString mimeName = mimeType; KMimeType::Ptr mime = KMimeType::mimeType( mimeType ); if ( mime->name() != KMimeType::defaultMimeType() ) mimeName = mime->comment(); - d->m_doc->setProperty( "unavailReason", i18n( "No handler found for %1" ).arg( mimeName ) ); + d->m_doc->setProperty( "unavailReason", i18n( "No handler found for %1" ).tqarg( mimeName ) ); } return res; } @@ -284,7 +284,7 @@ bool KoDocumentChild::loadDocumentInternal( KoStore* store, const KoDocumentEntr if ( oasis ) { store->pushDirectory(); assert( m_tmpURL.startsWith( INTERNAL_PROTOCOL ) ); - QString relPath = KURL( m_tmpURL ).path().mid( 1 ); + TQString relPath = KURL( m_tmpURL ).path().mid( 1 ); store->enterDirectory( relPath ); res = d->m_doc->loadOasisFromStore( store ); store->popDirectory(); @@ -303,10 +303,10 @@ bool KoDocumentChild::loadDocumentInternal( KoStore* store, const KoDocumentEntr KURL url( m_tmpURL ); if ( !url.isLocalFile() ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); // For security reasons we need to ask confirmation if the url is remote int result = KMessageBox::warningYesNoCancel( - 0, i18n( "This document contains an external link to a remote document\n%1").arg(m_tmpURL), + 0, i18n( "This document contains an external link to a remote document\n%1").tqarg(m_tmpURL), i18n( "Confirmation Required" ), i18n( "Download" ), i18n( "Skip" ) ); if ( result == KMessageBox::Cancel ) @@ -324,10 +324,10 @@ bool KoDocumentChild::loadDocumentInternal( KoStore* store, const KoDocumentEntr if ( !res ) { // Keep the error message from the attempted loading - QString errorMessage = d->m_doc->errorMessage(); + TQString errorMessage = d->m_doc->errorMessage(); delete d->m_doc; d->m_doc = 0; - QString tmpURL = m_tmpURL; // keep a copy, createUnavailDocument will erase it + TQString tmpURL = m_tmpURL; // keep a copy, createUnavailDocument will erase it // Not found -> use a kounavail instead res = createUnavailDocument( store, false /* the URL doesn't exist, don't try to open it */, m_tmpMimeType ); if ( res ) @@ -335,40 +335,40 @@ bool KoDocumentChild::loadDocumentInternal( KoStore* store, const KoDocumentEntr d->m_doc->setProperty( "realURL", tmpURL ); // so that it gets saved correctly d->m_doc->setStoreInternal( true ); if ( internalURL ) - d->m_doc->setProperty( "unavailReason", i18n( "Could not load embedded object:\n%1" ).arg( errorMessage ) ); + d->m_doc->setProperty( "unavailReason", i18n( "Could not load embedded object:\n%1" ).tqarg( errorMessage ) ); else - d->m_doc->setProperty( "unavailReason", i18n( "Could not load external document %1:\n%2" ).arg( tmpURL, errorMessage ) ); + d->m_doc->setProperty( "unavailReason", i18n( "Could not load external document %1:\n%2" ).tqarg( tmpURL, errorMessage ) ); } return res; } // Still waiting... - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); } - m_tmpURL = QString::null; + m_tmpURL = TQString(); // see KoDocument::insertChild for an explanation what's going on // now :-) - if ( parentDocument() ) + if ( tqparentDocument() ) { - KoDocument *parent = parentDocument(); + KoDocument *tqparent = tqparentDocument(); - if ( parent->manager() && parent->manager()->parts() ) + if ( tqparent->manager() && tqparent->manager()->parts() ) { - KParts::PartManager *manager = parent->manager(); + KParts::PartManager *manager = tqparent->manager(); - if ( !manager->parts()->containsRef( d->m_doc ) && - !parent->isSingleViewMode() ) + if ( !manager->parts()->tqcontainsRef( d->m_doc ) && + !tqparent->isSingleViewMode() ) manager->addPart( d->m_doc, false ); } } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return res; } -bool KoDocumentChild::createUnavailDocument( KoStore* store, bool doOpenURL, const QString& mimeType ) +bool KoDocumentChild::createUnavailDocument( KoStore* store, bool doOpenURL, const TQString& mimeType ) { // We don't need a trader query here. We're looking for a very specific component. KService::Ptr serv = KService::serviceByDesktopName( "kounavail" ); @@ -386,7 +386,7 @@ bool KoDocumentChild::createUnavailDocument( KoStore* store, bool doOpenURL, con bool KoDocumentChild::saveOasis( KoStore* store, KoXmlWriter* manifestWriter ) { - QString path; + TQString path; if ( d->m_doc->isStoredExtern() ) { kdDebug(30003)<m_doc->url().url()<m_doc->url().protocol() == INTERNAL_PROTOCOL ); - const QString name = d->m_doc->url().path(); + const TQString name = d->m_doc->url().path(); kdDebug() << k_funcinfo << "saving " << name << endl; if ( d->m_doc->nativeOasisMimeType().isEmpty() ) { @@ -409,7 +409,7 @@ bool KoDocumentChild::saveOasis( KoStore* store, KoXmlWriter* manifestWriter ) } else { - // To make the children happy cd to the correct directory + // To make the tqchildren happy cd to the correct directory store->pushDirectory(); store->enterDirectory( name ); @@ -433,7 +433,7 @@ bool KoDocumentChild::saveOasis( KoStore* store, KoXmlWriter* manifestWriter ) // OOo uses a trailing slash for the path to embedded objects (== directories) if ( !path.endsWith( "/" ) ) path += '/'; - QCString mimetype = d->m_doc->nativeOasisMimeType(); + TQCString mimetype = d->m_doc->nativeOasisMimeType(); if ( mimetype.isEmpty() ) mimetype = d->m_doc->nativeFormatMimeType(); manifestWriter->addManifestEntry( path, mimetype ); @@ -441,7 +441,7 @@ bool KoDocumentChild::saveOasis( KoStore* store, KoXmlWriter* manifestWriter ) return true; } -void KoDocumentChild::saveOasisAttributes( KoXmlWriter &xmlWriter, const QString& name ) +void KoDocumentChild::saveOasisAttributes( KoXmlWriter &xmlWriter, const TQString& name ) { if ( !d->m_doc->isStoredExtern() ) { @@ -454,21 +454,21 @@ void KoDocumentChild::saveOasisAttributes( KoXmlWriter &xmlWriter, const QString d->m_doc->setURL( u ); } - // + // xmlWriter.addAttribute( "xlink:type", "simple" ); xmlWriter.addAttribute( "xlink:show", "embed" ); xmlWriter.addAttribute( "xlink:actuate", "onLoad" ); - const QString ref = d->m_doc->isStoredExtern() ? d->m_doc->url().url() : "./"+ name; + const TQString ref = d->m_doc->isStoredExtern() ? d->m_doc->url().url() : "./"+ name; kdDebug(30003) << "KoDocumentChild::saveOasis saving reference to embedded document as " << ref << endl; xmlWriter.addAttribute( "xlink:href", /*"#" + */ref ); } -QDomElement KoDocumentChild::save( QDomDocument& doc, bool uppercase ) +TQDomElement KoDocumentChild::save( TQDomDocument& doc, bool uppercase ) { if( d->m_doc ) { - QDomElement e = doc.createElement( ( uppercase ? "OBJECT" : "object" ) ); + TQDomElement e = doc.createElement( ( uppercase ? "OBJECT" : "object" ) ); if ( d->m_doc->url().protocol() != INTERNAL_PROTOCOL ) { e.setAttribute( "url", d->m_doc->url().url() ); kdDebug() << "KoDocumentChild::save url=" << d->m_doc->url().url() << endl; @@ -477,17 +477,17 @@ QDomElement KoDocumentChild::save( QDomDocument& doc, bool uppercase ) e.setAttribute( "url", d->m_doc->url().path().mid( 1 ) ); kdDebug() << "KoDocumentChild::save url=" << d->m_doc->url().path().mid( 1 ) << endl; } - e.setAttribute( "mime", d->m_doc->nativeFormatMimeType() ); + e.setAttribute( "mime", d->m_doc->nativeFormatMimeType().data() ); kdDebug() << "KoDocumentChild::save mime=" << d->m_doc->nativeFormatMimeType() << endl; - QDomElement rect = doc.createElement( ( uppercase ? "RECT" : "rect" ) ); - rect.setAttribute( "x", geometry().left() ); - rect.setAttribute( "y", geometry().top() ); - rect.setAttribute( "w", geometry().width() ); - rect.setAttribute( "h", geometry().height() ); + TQDomElement rect = doc.createElement( ( uppercase ? "RECT" : "rect" ) ); + rect.setAttribute( "x", tqgeometry().left() ); + rect.setAttribute( "y", tqgeometry().top() ); + rect.setAttribute( "w", tqgeometry().width() ); + rect.setAttribute( "h", tqgeometry().height() ); e.appendChild(rect); return e; } - return QDomElement(); + return TQDomElement(); } bool KoDocumentChild::isStoredExtern() const diff --git a/lib/kofficecore/KoDocumentChild.h b/lib/kofficecore/KoDocumentChild.h index 349961ed5..228122dca 100644 --- a/lib/kofficecore/KoDocumentChild.h +++ b/lib/kofficecore/KoDocumentChild.h @@ -21,8 +21,8 @@ #include #include -class QDomDocument; -class QDomElement; +class TQDomDocument; +class TQDomElement; class KURL; class KoStore; class KoDocument; @@ -43,22 +43,23 @@ class KoXmlWriter; class KOFFICECORE_EXPORT KoDocumentChild : public KoChild { Q_OBJECT + TQ_OBJECT public: - KoDocumentChild( KoDocument* parent, KoDocument* doc, const QRect& geometry ); + KoDocumentChild( KoDocument* tqparent, KoDocument* doc, const TQRect& tqgeometry ); /** * When using this constructor you must call @ref #setDocument before * you can call any other function of this class. */ - KoDocumentChild( KoDocument* parent ); + KoDocumentChild( KoDocument* tqparent ); virtual ~KoDocumentChild(); /** * Call this function only directly after calling the constructor - * that takes only a parent as argument. + * that takes only a tqparent as argument. */ - virtual void setDocument( KoDocument *doc, const QRect &geometry ); + virtual void setDocument( KoDocument *doc, const TQRect &tqgeometry ); /** * @return document contained in this child @@ -68,13 +69,13 @@ public: KoDocument *document() const; /** - * @return parent document of this child + * @return tqparent document of this child * * @see KoDocument */ - virtual KoDocument *parentDocument() const; // TODO: remove virtual, makes no sense + virtual KoDocument *tqparentDocument() const; // TODO: remove virtual, makes no sense - virtual KoDocument* hitTest( const QPoint& p, const QWMatrix& _matrix = QWMatrix() ); + virtual KoDocument* hitTest( const TQPoint& p, const TQWMatrix& _matrix = TQWMatrix() ); /** * @note Can be empty (which is why it doesn't return a const KURL &) @@ -93,20 +94,20 @@ public: * * @return the element containing the "object" tag. */ - virtual QDomElement save( QDomDocument& doc, bool uppercase=false ); + virtual TQDomElement save( TQDomDocument& doc, bool uppercase=false ); /** * Save an embedded object to OASIS. - * This method sets the attributes for the draw:object element in the parent XML document. + * This method sets the attributes for the draw:object element in the tqparent XML document. * It also prepares the embedded object for being saved into the store at * the end of saving (see saveOasisToStore). * Note that @p name is only used for "internal" documents (not extern). */ - void saveOasisAttributes( KoXmlWriter &xmlWriter, const QString& name ); + void saveOasisAttributes( KoXmlWriter &xmlWriter, const TQString& name ); /** * Save an embedded object to an OASIS store. - * This is called automatically by the parent KoDocument's saveOasis + * This is called automatically by the tqparent KoDocument's saveOasis */ virtual bool saveOasis( KoStore* store, KoXmlWriter* manifestWriter ); @@ -120,9 +121,9 @@ public: * @ref KoDocument::loadChildren, respectively from your implementation * of these methods. */ - virtual bool load( const QDomElement& element, bool uppercase=false ); + virtual bool load( const TQDomElement& element, bool uppercase=false ); - void loadOasis( const QDomElement &frameElement, const QDomElement& objectElement ); + void loadOasis( const TQDomElement &frameElement, const TQDomElement& objectElement ); /** * Actually loads the document from the disk/net or from the store, @@ -134,7 +135,7 @@ public: * Actually loads the document from the disk/net or from the store * depending on the document's url */ - virtual bool loadOasisDocument( KoStore* store, const QDomDocument& manifestDoc ); + virtual bool loadOasisDocument( KoStore* store, const TQDomDocument& manifestDoc ); virtual bool isStoredExtern() const; @@ -153,24 +154,24 @@ protected: // Should be private, but KWord needs access to the variables * set after parsing the OBJECT tag in @ref #load and is reset after * calling @ref #loadDocument. */ - QString m_tmpURL; + TQString m_tmpURL; /** * This variable is * set after parsing the OBJECT tag in @ref #load and is reset after * calling @ref #loadDocument. */ - QRect m_tmpGeometry; + TQRect m_tmpGeometry; /** * This variable is * set after parsing the OBJECT tag in @ref #load and is reset after * calling @ref #loadDocument. */ - QString m_tmpMimeType; + TQString m_tmpMimeType; private: - bool createUnavailDocument( KoStore* store, bool doOpenURL, const QString& mimeType ); + bool createUnavailDocument( KoStore* store, bool doOpenURL, const TQString& mimeType ); bool loadDocumentInternal( KoStore* _store, const KoDocumentEntry& e, bool doOpenURL, bool oasis ); private: diff --git a/lib/kofficecore/KoDocumentIface.cc b/lib/kofficecore/KoDocumentIface.cc index 2ff2f5fb0..2c9dbe70a 100644 --- a/lib/kofficecore/KoDocumentIface.cc +++ b/lib/kofficecore/KoDocumentIface.cc @@ -30,15 +30,15 @@ #include //static -QCString KoDocumentIface::newIfaceName() +TQCString KoDocumentIface::newIfaceName() { static int s_docIFNumber = 0; - QCString name; name.setNum( s_docIFNumber++ ); name.prepend("Document-"); + TQCString name; name.setNum( s_docIFNumber++ ); name.prepend("Document-"); return name; } KoDocumentIface::KoDocumentIface( KoDocument * doc, const char * name ) - : DCOPObject( name ? QCString(name) : newIfaceName() ) + : DCOPObject( name ? TQCString(name) : newIfaceName() ) { m_pDoc = doc; m_actionProxy = new KDCOPActionProxy( doc->actionCollection(), this ); @@ -49,7 +49,7 @@ KoDocumentIface::~KoDocumentIface() delete m_actionProxy; } -void KoDocumentIface::openURL( QString url ) +void KoDocumentIface::openURL( TQString url ) { m_pDoc->openURL( KURL( url ) ); } @@ -59,7 +59,7 @@ bool KoDocumentIface::isLoading() return m_pDoc->isLoading(); } -QString KoDocumentIface::url() +TQString KoDocumentIface::url() { return m_pDoc->url().url(); } @@ -76,7 +76,7 @@ int KoDocumentIface::viewCount() DCOPRef KoDocumentIface::view( int idx ) { - QPtrList views = m_pDoc->views(); + TQPtrList views = m_pDoc->views(); KoView *v = views.at( idx ); if ( !v ) return DCOPRef(); @@ -89,7 +89,7 @@ DCOPRef KoDocumentIface::view( int idx ) return DCOPRef( kapp->dcopClient()->appId(), obj->objId() ); } -DCOPRef KoDocumentIface::action( const QCString &name ) +DCOPRef KoDocumentIface::action( const TQCString &name ) { return DCOPRef( kapp->dcopClient()->appId(), m_actionProxy->actionObjectId( name ) ); } @@ -97,16 +97,16 @@ DCOPRef KoDocumentIface::action( const QCString &name ) QCStringList KoDocumentIface::actions() { QCStringList res; - QValueList lst = m_actionProxy->actions(); - QValueList::ConstIterator it = lst.begin(); - QValueList::ConstIterator end = lst.end(); + TQValueList lst = m_actionProxy->actions(); + TQValueList::ConstIterator it = lst.begin(); + TQValueList::ConstIterator end = lst.end(); for (; it != end; ++it ) res.append( (*it)->name() ); return res; } -QMap KoDocumentIface::actionMap() +TQMap KoDocumentIface::actionMap() { return m_actionProxy->actionMap(); } @@ -116,236 +116,236 @@ void KoDocumentIface::save() m_pDoc->save(); } -void KoDocumentIface::saveAs( const QString & url ) +void KoDocumentIface::saveAs( const TQString & url ) { m_pDoc->saveAs( KURL( url ) ); m_pDoc->waitSaveComplete(); // see ReadWritePart } -void KoDocumentIface::setOutputMimeType( const QCString & mimetype ) +void KoDocumentIface::setOutputMimeType( const TQCString & mimetype ) { m_pDoc->setOutputMimeType( mimetype ); } -QString KoDocumentIface::documentInfoAuthorName() const +TQString KoDocumentIface::documentInfoAuthorName() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->fullName(); } -QString KoDocumentIface::documentInfoEmail() const +TQString KoDocumentIface::documentInfoEmail() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->email(); } -QString KoDocumentIface::documentInfoCompanyName() const +TQString KoDocumentIface::documentInfoCompanyName() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->company(); } -QString KoDocumentIface::documentInfoTelephone() const +TQString KoDocumentIface::documentInfoTelephone() const { kdDebug()<<" Keep compatibility with koffice <= 1.3 : use documentInfoTelephoneWork\n"; return documentInfoTelephoneWork(); } -QString KoDocumentIface::documentInfoTelephoneWork() const +TQString KoDocumentIface::documentInfoTelephoneWork() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->telephoneWork(); } -QString KoDocumentIface::documentInfoTelephoneHome() const +TQString KoDocumentIface::documentInfoTelephoneHome() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->telephoneHome(); } -QString KoDocumentIface::documentInfoFax() const +TQString KoDocumentIface::documentInfoFax() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->fax(); } -QString KoDocumentIface::documentInfoCountry() const +TQString KoDocumentIface::documentInfoCountry() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->country(); } -QString KoDocumentIface::documentInfoPostalCode() const +TQString KoDocumentIface::documentInfoPostalCode() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->postalCode(); } -QString KoDocumentIface::documentInfoCity() const +TQString KoDocumentIface::documentInfoCity() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->city(); } -QString KoDocumentIface::documentInfoInitial() const +TQString KoDocumentIface::documentInfoInitial() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->initial(); } -QString KoDocumentIface::documentInfoAuthorPostion() const +TQString KoDocumentIface::documentInfoAuthorPostion() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->position(); } -QString KoDocumentIface::documentInfoStreet() const +TQString KoDocumentIface::documentInfoStreet() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); if ( !authorPage ) { kdWarning() << "Author information not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->street(); } -QString KoDocumentIface::documentInfoTitle() const +TQString KoDocumentIface::documentInfoTitle() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast(info->page( "about" )); if ( !aboutPage ) { kdWarning() << "'About' page not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return aboutPage->title(); } -QString KoDocumentIface::documentInfoAbstract() const +TQString KoDocumentIface::documentInfoAbstract() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast(info->page( "about" )); if ( !aboutPage ) { kdWarning() << "'About' page not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return aboutPage->abstract(); } -QString KoDocumentIface::documentInfoKeywords() const +TQString KoDocumentIface::documentInfoKeywords() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast(info->page( "about" )); if ( !aboutPage ) { kdWarning() << "'About' page not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return aboutPage->keywords(); } -QString KoDocumentIface::documentInfoSubject() const +TQString KoDocumentIface::documentInfoSubject() const { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast(info->page( "about" )); if ( !aboutPage ) { kdWarning() << "'About' page not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return aboutPage->subject(); } -void KoDocumentIface::setDocumentInfoKeywords(const QString & text ) +void KoDocumentIface::setDocumentInfoKeywords(const TQString & text ) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast(info->page( "about" )); @@ -357,7 +357,7 @@ void KoDocumentIface::setDocumentInfoKeywords(const QString & text ) aboutPage->setKeywords(text); } -void KoDocumentIface::setDocumentInfoSubject(const QString & text) +void KoDocumentIface::setDocumentInfoSubject(const TQString & text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast(info->page( "about" )); @@ -369,7 +369,7 @@ void KoDocumentIface::setDocumentInfoSubject(const QString & text) aboutPage->setSubject(text); } -void KoDocumentIface::setDocumentInfoAuthorName(const QString & text) +void KoDocumentIface::setDocumentInfoAuthorName(const TQString & text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -382,7 +382,7 @@ void KoDocumentIface::setDocumentInfoAuthorName(const QString & text) } -void KoDocumentIface::setDocumentInfoEmail(const QString &text) +void KoDocumentIface::setDocumentInfoEmail(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -394,7 +394,7 @@ void KoDocumentIface::setDocumentInfoEmail(const QString &text) authorPage->setEmail(text); } -void KoDocumentIface::setDocumentInfoCompanyName(const QString &text) +void KoDocumentIface::setDocumentInfoCompanyName(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -406,7 +406,7 @@ void KoDocumentIface::setDocumentInfoCompanyName(const QString &text) authorPage->setCompany(text); } -void KoDocumentIface::setDocumentInfoAuthorPosition(const QString &text) +void KoDocumentIface::setDocumentInfoAuthorPosition(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -419,13 +419,13 @@ void KoDocumentIface::setDocumentInfoAuthorPosition(const QString &text) } -void KoDocumentIface::setDocumentInfoTelephone(const QString &text) +void KoDocumentIface::setDocumentInfoTelephone(const TQString &text) { kdDebug()<<"Keep compatibility with koffice <= 1.3 : use setDocumentInfoTelephoneWork\n"; setDocumentInfoTelephoneWork(text); } -void KoDocumentIface::setDocumentInfoTelephoneWork(const QString &text) +void KoDocumentIface::setDocumentInfoTelephoneWork(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -437,7 +437,7 @@ void KoDocumentIface::setDocumentInfoTelephoneWork(const QString &text) authorPage->setTelephoneWork(text); } -void KoDocumentIface::setDocumentInfoTelephoneHome(const QString &text) +void KoDocumentIface::setDocumentInfoTelephoneHome(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -450,7 +450,7 @@ void KoDocumentIface::setDocumentInfoTelephoneHome(const QString &text) } -void KoDocumentIface::setDocumentInfoFax(const QString &text) +void KoDocumentIface::setDocumentInfoFax(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -462,7 +462,7 @@ void KoDocumentIface::setDocumentInfoFax(const QString &text) authorPage->setFax(text); } -void KoDocumentIface::setDocumentInfoCountry(const QString &text) +void KoDocumentIface::setDocumentInfoCountry(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -475,7 +475,7 @@ void KoDocumentIface::setDocumentInfoCountry(const QString &text) } -void KoDocumentIface::setDocumentInfoTitle(const QString & text) +void KoDocumentIface::setDocumentInfoTitle(const TQString & text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast(info->page( "about" )); @@ -487,7 +487,7 @@ void KoDocumentIface::setDocumentInfoTitle(const QString & text) aboutPage->setTitle(text); } -void KoDocumentIface::setDocumentInfoPostalCode(const QString &text) +void KoDocumentIface::setDocumentInfoPostalCode(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -501,7 +501,7 @@ void KoDocumentIface::setDocumentInfoPostalCode(const QString &text) } -void KoDocumentIface::setDocumentInfoCity(const QString & text) +void KoDocumentIface::setDocumentInfoCity(const TQString & text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -513,7 +513,7 @@ void KoDocumentIface::setDocumentInfoCity(const QString & text) authorPage->setCity(text); } -void KoDocumentIface::setDocumentInfoInitial(const QString & text) +void KoDocumentIface::setDocumentInfoInitial(const TQString & text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -526,7 +526,7 @@ void KoDocumentIface::setDocumentInfoInitial(const QString & text) } -void KoDocumentIface::setDocumentInfoStreet(const QString &text) +void KoDocumentIface::setDocumentInfoStreet(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAuthor * authorPage = static_cast(info->page( "author" )); @@ -540,7 +540,7 @@ void KoDocumentIface::setDocumentInfoStreet(const QString &text) } -void KoDocumentIface::setDocumentInfoAbstract(const QString &text) +void KoDocumentIface::setDocumentInfoAbstract(const TQString &text) { KoDocumentInfo * info = m_pDoc->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast(info->page( "about" )); @@ -557,8 +557,8 @@ QCStringList KoDocumentIface::functionsDynamic() return DCOPObject::functionsDynamic() + KDCOPPropertyProxy::functions( m_pDoc ); } -bool KoDocumentIface::processDynamic( const QCString &fun, const QByteArray &data, - QCString& replyType, QByteArray &replyData ) +bool KoDocumentIface::processDynamic( const TQCString &fun, const TQByteArray &data, + TQCString& replyType, TQByteArray &replyData ) { if ( KDCOPPropertyProxy::isPropertyRequest( fun, m_pDoc ) ) return KDCOPPropertyProxy::processPropertyRequest( fun, data, replyType, replyData, m_pDoc ); diff --git a/lib/kofficecore/KoDocumentIface.h b/lib/kofficecore/KoDocumentIface.h index 2713cb43a..546859ce3 100644 --- a/lib/kofficecore/KoDocumentIface.h +++ b/lib/kofficecore/KoDocumentIface.h @@ -21,7 +21,7 @@ #define __KoDocumentIface_h__ #include -#include +#include #include #include class KoDocument; @@ -48,20 +48,20 @@ public: * Generate a name for this interface. Automatically used if name=0 is * passed to the constructor */ - static QCString newIfaceName(); + static TQCString newIfaceName(); k_dcop: /** * Returns the URL for this document (empty, real URL, or internal one) */ - QString url(); + TQString url(); /** * Opens a document stored in @p url * Warning: this is asynchronous. The document might not be loaded yet when * this call returns. See isLoading. */ - void openURL( QString url ); + void openURL( TQString url ); /** * @return TRUE is the document is still loading @@ -86,7 +86,7 @@ k_dcop: /** * DCOP-action proxy */ - DCOPRef action( const QCString &name ); + DCOPRef action( const TQCString &name ); /** * @return list of actions */ @@ -94,7 +94,7 @@ k_dcop: /** * @return a map of (action name, DCOP reference) */ - QMap actionMap(); + TQMap actionMap(); /** * Saves the document under its existing filename @@ -104,49 +104,49 @@ k_dcop: /** * Saves the document under a new name */ - void saveAs( const QString & url ); - - void setOutputMimeType( const QCString & mimetype ); - - QString documentInfoAuthorName() const; - QString documentInfoEmail() const; - QString documentInfoCompanyName() const; - QString documentInfoTitle() const; - QString documentInfoAbstract() const; - QString documentInfoKeywords() const; - QString documentInfoSubject() const; - QString documentInfoTelephone() const; - QString documentInfoTelephoneWork() const; - QString documentInfoTelephoneHome() const; - QString documentInfoFax() const; - QString documentInfoCountry() const; - QString documentInfoPostalCode() const; - QString documentInfoCity() const; - QString documentInfoStreet() const; - QString documentInfoInitial() const; - QString documentInfoAuthorPostion() const; - void setDocumentInfoAuthorName(const QString & text); - void setDocumentInfoEmail(const QString &text); - void setDocumentInfoCompanyName(const QString &text); - void setDocumentInfoTelephone(const QString &text); - void setDocumentInfoTelephoneWork(const QString &text); - void setDocumentInfoTelephoneHome(const QString &text); - void setDocumentInfoFax(const QString &text); - void setDocumentInfoCountry(const QString &text); - void setDocumentInfoTitle(const QString & text); - void setDocumentInfoPostalCode(const QString &text); - void setDocumentInfoCity(const QString & text); - void setDocumentInfoStreet(const QString &text); - void setDocumentInfoAbstract(const QString &text); - void setDocumentInfoInitial(const QString & text); - void setDocumentInfoKeywords(const QString & text ); - void setDocumentInfoSubject(const QString & text); - void setDocumentInfoAuthorPosition(const QString & text); + void saveAs( const TQString & url ); + + void setOutputMimeType( const TQCString & mimetype ); + + TQString documentInfoAuthorName() const; + TQString documentInfoEmail() const; + TQString documentInfoCompanyName() const; + TQString documentInfoTitle() const; + TQString documentInfoAbstract() const; + TQString documentInfoKeywords() const; + TQString documentInfoSubject() const; + TQString documentInfoTelephone() const; + TQString documentInfoTelephoneWork() const; + TQString documentInfoTelephoneHome() const; + TQString documentInfoFax() const; + TQString documentInfoCountry() const; + TQString documentInfoPostalCode() const; + TQString documentInfoCity() const; + TQString documentInfoStreet() const; + TQString documentInfoInitial() const; + TQString documentInfoAuthorPostion() const; + void setDocumentInfoAuthorName(const TQString & text); + void setDocumentInfoEmail(const TQString &text); + void setDocumentInfoCompanyName(const TQString &text); + void setDocumentInfoTelephone(const TQString &text); + void setDocumentInfoTelephoneWork(const TQString &text); + void setDocumentInfoTelephoneHome(const TQString &text); + void setDocumentInfoFax(const TQString &text); + void setDocumentInfoCountry(const TQString &text); + void setDocumentInfoTitle(const TQString & text); + void setDocumentInfoPostalCode(const TQString &text); + void setDocumentInfoCity(const TQString & text); + void setDocumentInfoStreet(const TQString &text); + void setDocumentInfoAbstract(const TQString &text); + void setDocumentInfoInitial(const TQString & text); + void setDocumentInfoKeywords(const TQString & text ); + void setDocumentInfoSubject(const TQString & text); + void setDocumentInfoAuthorPosition(const TQString & text); public: virtual QCStringList functionsDynamic(); - virtual bool processDynamic( const QCString &fun, const QByteArray &data, - QCString& replyType, QByteArray &replyData ); + virtual bool processDynamic( const TQCString &fun, const TQByteArray &data, + TQCString& replyType, TQByteArray &replyData ); protected: KoDocument * m_pDoc; diff --git a/lib/kofficecore/KoDocumentInfo.cpp b/lib/kofficecore/KoDocumentInfo.cpp index 3d4e05059..ccec34244 100644 --- a/lib/kofficecore/KoDocumentInfo.cpp +++ b/lib/kofficecore/KoDocumentInfo.cpp @@ -32,8 +32,8 @@ #include #include -#include -#include +#include +#include #include "KoXmlNS.h" /***************************************** @@ -42,8 +42,8 @@ * *****************************************/ -KoDocumentInfo::KoDocumentInfo( QObject* parent, const char* name ) - : QObject( parent, name ) +KoDocumentInfo::KoDocumentInfo( TQObject* tqparent, const char* name ) + : TQObject( tqparent, name ) { (void)new KoDocumentInfoUserMetadata( this ); (void)new KoDocumentInfoAuthor( this ); @@ -55,10 +55,10 @@ KoDocumentInfo::~KoDocumentInfo() } // KOffice-1.3 format -bool KoDocumentInfo::load( const QDomDocument& doc ) +bool KoDocumentInfo::load( const TQDomDocument& doc ) { - QStringList lst = pages(); - QStringList::ConstIterator it = lst.begin(); + TQStringList lst = pages(); + TQStringList::ConstIterator it = lst.begin(); for( ; it != lst.end(); ++it ) { KoDocumentInfoPage* p = page( *it ); @@ -70,18 +70,18 @@ bool KoDocumentInfo::load( const QDomDocument& doc ) return true; } -bool KoDocumentInfo::loadOasis( const QDomDocument& metaDoc ) +bool KoDocumentInfo::loadOasis( const TQDomDocument& metaDoc ) { //kdDebug()<<" metaDoc.toString() :"<save( doc ); + TQDomElement s = p->save( doc ); if ( s.isNull() ) continue; e.appendChild( s ); } if ( e.isNull() ) - return QDomDocument(); + return TQDomDocument(); return doc; } @@ -122,10 +122,10 @@ bool KoDocumentInfo::saveOasis( KoStore* store ) xmlWriter->startElement( "office:meta" ); xmlWriter->startElement( "meta:generator"); - xmlWriter->addTextNode( QString( "KOffice/%1" ).arg( KOFFICE_VERSION_STRING ) ); + xmlWriter->addTextNode( TQString( "KOffice/%1" ).tqarg( KOFFICE_VERSION_STRING ) ); xmlWriter->endElement(); - QStringList lst = pages(); - QStringList::ConstIterator it = lst.begin(); + TQStringList lst = pages(); + TQStringList::ConstIterator it = lst.begin(); for( ; it != lst.end(); ++it ) { KoDocumentInfoPage* p = page( *it ); @@ -140,22 +140,22 @@ bool KoDocumentInfo::saveOasis( KoStore* store ) return true; } -KoDocumentInfoPage* KoDocumentInfo::page( const QString& name ) const +KoDocumentInfoPage* KoDocumentInfo::page( const TQString& name ) const { - QObject* obj = const_cast(this)->child( name.latin1() ); + TQObject* obj = const_cast(this)->child( name.latin1() ); return (KoDocumentInfoPage*)obj; } -QStringList KoDocumentInfo::pages() const +TQStringList KoDocumentInfo::pages() const { - QStringList ret; + TQStringList ret; - const QObjectList *list = children(); - if ( list ) + const TQObjectList list = childrenListObject(); + if ( !list.isEmpty() ) { - QObjectListIt it( *list ); - QObject *obj; + TQObjectListIt it( list ); + TQObject *obj; while ( ( obj = it.current() ) ) { ret.prepend( obj->name() ); @@ -166,23 +166,23 @@ QStringList KoDocumentInfo::pages() const return ret; } -QString KoDocumentInfo::title() const +TQString KoDocumentInfo::title() const { KoDocumentInfoAbout * aboutPage = static_cast(page( "about" )); if ( !aboutPage ) { kdWarning() << "'About' page not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return aboutPage->title(); } -QString KoDocumentInfo::creator() const +TQString KoDocumentInfo::creator() const { KoDocumentInfoAuthor * authorPage = static_cast(page( "author" )); if ( !authorPage ) { kdWarning() << "'Author' page not found in documentInfo !" << endl; - return QString::null; + return TQString(); } else return authorPage->fullName(); @@ -194,8 +194,8 @@ QString KoDocumentInfo::creator() const * *****************************************/ -KoDocumentInfoPage::KoDocumentInfoPage( QObject* parent, const char* name ) - : QObject( parent, name ) +KoDocumentInfoPage::KoDocumentInfoPage( TQObject* tqparent, const char* name ) + : TQObject( tqparent, name ) { } @@ -231,18 +231,18 @@ void KoDocumentInfoAuthor::initParameters() m_emailCfg = new KConfig( "emaildefaults", true ); m_emailCfg->setGroup( "Defaults" ); - QString group = m_emailCfg->readEntry("Profile","Default"); - m_emailCfg->setGroup(QString("PROFILE_%1").arg(group)); + TQString group = m_emailCfg->readEntry("Profile","Default"); + m_emailCfg->setGroup(TQString("PROFILE_%1").tqarg(group)); if ( m_fullName.isNull() ) // only if null. Empty means the user made it explicitly empty. { - QString name = m_emailCfg->readEntry( "FullName" ); + TQString name = m_emailCfg->readEntry( "FullName" ); if ( !name.isEmpty() ) m_fullName = name; } if ( m_company.isNull() ) { - QString name = m_emailCfg->readEntry( "Organization" ); + TQString name = m_emailCfg->readEntry( "Organization" ); if ( !name.isEmpty() ) m_company = name; } @@ -343,20 +343,20 @@ bool KoDocumentInfoAuthor::saveOasis( KoXmlWriter &xmlWriter ) return true; } -bool KoDocumentInfoAuthor::loadOasis( const QDomNode& metaDoc ) +bool KoDocumentInfoAuthor::loadOasis( const TQDomNode& metaDoc ) { - QDomElement e = KoDom::namedItemNS( metaDoc, KoXmlNS::dc, "creator" ); + TQDomElement e = KoDom::namedItemNS( metaDoc, KoXmlNS::dc, "creator" ); if ( !e.isNull() && !e.text().isEmpty() ) m_fullName = e.text(); - QDomNode n = metaDoc.firstChild(); + TQDomNode n = metaDoc.firstChild(); for ( ; !n.isNull(); n = n.nextSibling() ) { if (n.isElement()) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.namespaceURI() == KoXmlNS::meta && e.localName() == "user-defined" && !e.text().isEmpty() ) { - QString name = e.attributeNS( KoXmlNS::meta, "name", QString::null ); + TQString name = e.attributeNS( KoXmlNS::meta, "name", TQString() ); if ( name == "initial" ) m_initial = e.text(); else if ( name == "author-title" ) @@ -388,12 +388,12 @@ bool KoDocumentInfoAuthor::loadOasis( const QDomNode& metaDoc ) } // KOffice-1.3 format -bool KoDocumentInfoAuthor::load( const QDomElement& e ) +bool KoDocumentInfoAuthor::load( const TQDomElement& e ) { - QDomNode n = e.namedItem( "author" ).firstChild(); + TQDomNode n = e.namedItem( "author" ).firstChild(); for( ; !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.isNull() ) continue; if ( e.tagName() == "full-name" ) m_fullName = e.text(); @@ -425,11 +425,11 @@ bool KoDocumentInfoAuthor::load( const QDomElement& e ) return true; } -QDomElement KoDocumentInfoAuthor::save( QDomDocument& doc ) +TQDomElement KoDocumentInfoAuthor::save( TQDomDocument& doc ) { - QDomElement e = doc.createElement( "author" ); + TQDomElement e = doc.createElement( "author" ); - QDomElement t = doc.createElement( "full-name" ); + TQDomElement t = doc.createElement( "full-name" ); e.appendChild( t ); t.appendChild( doc.createTextNode( m_fullName ) ); @@ -485,132 +485,132 @@ QDomElement KoDocumentInfoAuthor::save( QDomDocument& doc ) return e; } -QString KoDocumentInfoAuthor::fullName() const +TQString KoDocumentInfoAuthor::fullName() const { return m_fullName; } -QString KoDocumentInfoAuthor::initial() const +TQString KoDocumentInfoAuthor::initial() const { return m_initial; } -QString KoDocumentInfoAuthor::title() const +TQString KoDocumentInfoAuthor::title() const { return m_title; } -QString KoDocumentInfoAuthor::company() const +TQString KoDocumentInfoAuthor::company() const { return m_company; } -QString KoDocumentInfoAuthor::email() const +TQString KoDocumentInfoAuthor::email() const { return m_email; } -QString KoDocumentInfoAuthor::telephoneHome() const +TQString KoDocumentInfoAuthor::telephoneHome() const { return m_telephoneHome; } -QString KoDocumentInfoAuthor::telephoneWork() const +TQString KoDocumentInfoAuthor::telephoneWork() const { return m_telephoneWork; } -QString KoDocumentInfoAuthor::fax() const +TQString KoDocumentInfoAuthor::fax() const { return m_fax; } -QString KoDocumentInfoAuthor::country() const +TQString KoDocumentInfoAuthor::country() const { return m_country; } -QString KoDocumentInfoAuthor::postalCode() const +TQString KoDocumentInfoAuthor::postalCode() const { return m_postalCode; } -QString KoDocumentInfoAuthor::city() const +TQString KoDocumentInfoAuthor::city() const { return m_city; } -QString KoDocumentInfoAuthor::street() const +TQString KoDocumentInfoAuthor::street() const { return m_street; } -QString KoDocumentInfoAuthor::position() const +TQString KoDocumentInfoAuthor::position() const { return m_position; } -void KoDocumentInfoAuthor::setFullName( const QString& n ) +void KoDocumentInfoAuthor::setFullName( const TQString& n ) { m_fullName = n; } -void KoDocumentInfoAuthor::setInitial( const QString& n ) +void KoDocumentInfoAuthor::setInitial( const TQString& n ) { m_initial = n; } -void KoDocumentInfoAuthor::setTitle( const QString& n ) +void KoDocumentInfoAuthor::setTitle( const TQString& n ) { m_title = n; } -void KoDocumentInfoAuthor::setCompany( const QString& n ) +void KoDocumentInfoAuthor::setCompany( const TQString& n ) { m_company = n; } -void KoDocumentInfoAuthor::setEmail( const QString& n ) +void KoDocumentInfoAuthor::setEmail( const TQString& n ) { m_email = n; } -void KoDocumentInfoAuthor::setTelephoneHome( const QString& n ) +void KoDocumentInfoAuthor::setTelephoneHome( const TQString& n ) { m_telephoneHome = n; } -void KoDocumentInfoAuthor::setTelephoneWork( const QString& n ) +void KoDocumentInfoAuthor::setTelephoneWork( const TQString& n ) { m_telephoneWork = n; } -void KoDocumentInfoAuthor::setFax( const QString& n ) +void KoDocumentInfoAuthor::setFax( const TQString& n ) { m_fax = n; } -void KoDocumentInfoAuthor::setCountry( const QString& n ) +void KoDocumentInfoAuthor::setCountry( const TQString& n ) { m_country = n; } -void KoDocumentInfoAuthor::setPostalCode( const QString& n ) +void KoDocumentInfoAuthor::setPostalCode( const TQString& n ) { m_postalCode = n; } -void KoDocumentInfoAuthor::setCity( const QString& n ) +void KoDocumentInfoAuthor::setCity( const TQString& n ) { m_city = n; } -void KoDocumentInfoAuthor::setStreet( const QString& n ) +void KoDocumentInfoAuthor::setStreet( const TQString& n ) { m_street = n; } -void KoDocumentInfoAuthor::setPosition( const QString& n ) +void KoDocumentInfoAuthor::setPosition( const TQString& n ) { m_position = n; } @@ -629,15 +629,15 @@ KoDocumentInfoAbout::KoDocumentInfoAbout( KoDocumentInfo* info ) m_docInfo = info; m_editingCycles = 0; m_initialCreator = m_docInfo->creator(); - m_creationDate = QDateTime::currentDateTime(); + m_creationDate = TQDateTime::tqcurrentDateTime(); } void KoDocumentInfoAbout::saveParameters() { - KoDocument* doc = dynamic_cast< KoDocument* >( m_docInfo->parent() ); + KoDocument* doc = dynamic_cast< KoDocument* >( m_docInfo->tqparent() ); if ( m_firstSave && doc && !doc->isAutosaving() ) m_editingCycles++; - m_modificationDate = QDateTime::currentDateTime(); + m_modificationDate = TQDateTime::tqcurrentDateTime(); m_firstSave = false; } @@ -676,7 +676,7 @@ bool KoDocumentInfoAbout::saveOasis( KoXmlWriter &xmlWriter ) } xmlWriter.startElement( "meta:editing-cycles" ); - xmlWriter.addTextNode( QString::number( m_editingCycles ) ); + xmlWriter.addTextNode( TQString::number( m_editingCycles ) ); xmlWriter.endElement(); if ( m_creationDate.isValid() ) @@ -695,9 +695,9 @@ bool KoDocumentInfoAbout::saveOasis( KoXmlWriter &xmlWriter ) return true; } -bool KoDocumentInfoAbout::loadOasis( const QDomNode& metaDoc ) +bool KoDocumentInfoAbout::loadOasis( const TQDomNode& metaDoc ) { - QDomElement e = KoDom::namedItemNS( metaDoc, KoXmlNS::dc, "title" ); + TQDomElement e = KoDom::namedItemNS( metaDoc, KoXmlNS::dc, "title" ); if ( !e.isNull() && !e.text().isEmpty() ) { m_title = e.text(); @@ -729,23 +729,23 @@ bool KoDocumentInfoAbout::loadOasis( const QDomNode& metaDoc ) e = KoDom::namedItemNS( metaDoc, KoXmlNS::meta, "creation-date" ); if ( !e.isNull() && !e.text().isEmpty() ) - m_creationDate = QDateTime::fromString( e.text(), Qt::ISODate ); + m_creationDate = TQDateTime::fromString( e.text(), Qt::ISODate ); else - m_creationDate = QDateTime(); + m_creationDate = TQDateTime(); e = KoDom::namedItemNS( metaDoc, KoXmlNS::dc, "date" ); if ( !e.isNull() && !e.text().isEmpty() ) - m_modificationDate = QDateTime::fromString( e.text(), Qt::ISODate ); + m_modificationDate = TQDateTime::fromString( e.text(), Qt::ISODate ); return true; } // KOffice-1.3 format -bool KoDocumentInfoAbout::load( const QDomElement& e ) +bool KoDocumentInfoAbout::load( const TQDomElement& e ) { - QDomNode n = e.namedItem( "about" ).firstChild(); + TQDomNode n = e.namedItem( "about" ).firstChild(); for( ; !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.isNull() ) continue; if ( e.tagName() == "abstract" ) m_abstract = e.text(); @@ -760,21 +760,21 @@ bool KoDocumentInfoAbout::load( const QDomElement& e ) else if ( e.tagName() == "editing-cycles" ) m_editingCycles = e.text().toInt(); else if ( e.tagName() == "creation-date" ) - m_creationDate = QDateTime::fromString( e.text(), Qt::ISODate ); + m_creationDate = TQDateTime::fromString( e.text(), Qt::ISODate ); else if ( e.tagName() == "date" ) - m_modificationDate = QDateTime::fromString( e.text(), Qt::ISODate ); + m_modificationDate = TQDateTime::fromString( e.text(), Qt::ISODate ); } return true; } // KOffice-1.3 format -QDomElement KoDocumentInfoAbout::save( QDomDocument& doc ) +TQDomElement KoDocumentInfoAbout::save( TQDomDocument& doc ) { saveParameters(); - QDomElement e = doc.createElement( "about" ); + TQDomElement e = doc.createElement( "about" ); - QDomElement t = doc.createElement( "abstract" ); + TQDomElement t = doc.createElement( "abstract" ); e.appendChild( t ); t.appendChild( doc.createCDATASection( m_abstract ) ); @@ -796,7 +796,7 @@ QDomElement KoDocumentInfoAbout::save( QDomDocument& doc ) t = doc.createElement( "editing-cycles" ); e.appendChild( t ); - t.appendChild( doc.createTextNode( QString::number( m_editingCycles ) ) ); + t.appendChild( doc.createTextNode( TQString::number( m_editingCycles ) ) ); t = doc.createElement( "creation-date" ); e.appendChild( t ); @@ -808,68 +808,68 @@ QDomElement KoDocumentInfoAbout::save( QDomDocument& doc ) return e; } -QString KoDocumentInfoAbout::title() const +TQString KoDocumentInfoAbout::title() const { return m_title; } -QString KoDocumentInfoAbout::abstract() const +TQString KoDocumentInfoAbout::abstract() const { return m_abstract; } -QString KoDocumentInfoAbout::initialCreator() const +TQString KoDocumentInfoAbout::initialCreator() const { return m_initialCreator; } -QString KoDocumentInfoAbout::editingCycles() const +TQString KoDocumentInfoAbout::editingCycles() const { - return QString::number( m_editingCycles ); + return TQString::number( m_editingCycles ); } -QString KoDocumentInfoAbout::creationDate() const +TQString KoDocumentInfoAbout::creationDate() const { if ( m_creationDate.isValid() ) return KGlobal::locale()->formatDateTime( m_creationDate ); else - return QString::null; + return TQString(); } -QString KoDocumentInfoAbout::modificationDate() const +TQString KoDocumentInfoAbout::modificationDate() const { if ( m_modificationDate.isValid() ) return KGlobal::locale()->formatDateTime( m_modificationDate ); else - return QString::null; + return TQString(); } -void KoDocumentInfoAbout::setTitle( const QString& n ) +void KoDocumentInfoAbout::setTitle( const TQString& n ) { m_title = n; } -void KoDocumentInfoAbout::setAbstract( const QString& n ) +void KoDocumentInfoAbout::setAbstract( const TQString& n ) { m_abstract = n; } -QString KoDocumentInfoAbout::keywords() const +TQString KoDocumentInfoAbout::keywords() const { return m_keywords; } -QString KoDocumentInfoAbout::subject() const +TQString KoDocumentInfoAbout::subject() const { return m_subject; } -void KoDocumentInfoAbout::setKeywords( const QString& n ) +void KoDocumentInfoAbout::setKeywords( const TQString& n ) { m_keywords = n; } -void KoDocumentInfoAbout::setSubject( const QString& n ) +void KoDocumentInfoAbout::setSubject( const TQString& n ) { m_subject = n; } @@ -878,8 +878,8 @@ void KoDocumentInfoAbout::resetMetaData() { m_editingCycles = 0; m_initialCreator = m_docInfo->creator(); - m_creationDate = QDateTime::currentDateTime(); - m_modificationDate = QDateTime(); + m_creationDate = TQDateTime::tqcurrentDateTime(); + m_modificationDate = TQDateTime(); } /***************************************** @@ -898,7 +898,7 @@ KoDocumentInfoUserMetadata::KoDocumentInfoUserMetadata( KoDocumentInfo* info ) bool KoDocumentInfoUserMetadata::saveOasis( KoXmlWriter &xmlWriter ) { - QMap::iterator it; + TQMap::iterator it; for ( it = m_metaList.begin(); it != m_metaList.end(); ++it ) { xmlWriter.startElement( "meta:user-defined"); @@ -909,18 +909,18 @@ bool KoDocumentInfoUserMetadata::saveOasis( KoXmlWriter &xmlWriter ) return true; } -bool KoDocumentInfoUserMetadata::loadOasis( const QDomNode& metaDoc ) +bool KoDocumentInfoUserMetadata::loadOasis( const TQDomNode& metaDoc ) { - QDomNode n = metaDoc.firstChild(); + TQDomNode n = metaDoc.firstChild(); for ( ; !n.isNull(); n = n.nextSibling() ) { if (n.isElement()) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.namespaceURI() == KoXmlNS::meta && e.localName() == "user-defined" && !e.text().isEmpty() ) { - QString name = e.attributeNS( KoXmlNS::meta, "name", QString::null ); - if ( !m_reserved.contains( name ) ) + TQString name = e.attributeNS( KoXmlNS::meta, "name", TQString() ); + if ( !m_reserved.tqcontains( name ) ) m_metaList[ name ] = e.text(); } } @@ -929,15 +929,15 @@ bool KoDocumentInfoUserMetadata::loadOasis( const QDomNode& metaDoc ) } // KOffice-1.3 format -bool KoDocumentInfoUserMetadata::load( const QDomElement& ) +bool KoDocumentInfoUserMetadata::load( const TQDomElement& ) { return true; } // KOffice-1.3 format -QDomElement KoDocumentInfoUserMetadata::save( QDomDocument& ) +TQDomElement KoDocumentInfoUserMetadata::save( TQDomDocument& ) { - return QDomElement(); + return TQDomElement(); } #include diff --git a/lib/kofficecore/KoDocumentInfo.h b/lib/kofficecore/KoDocumentInfo.h index 30e74cf7f..b94a2de01 100644 --- a/lib/kofficecore/KoDocumentInfo.h +++ b/lib/kofficecore/KoDocumentInfo.h @@ -21,142 +21,145 @@ #ifndef KO_DOCUMENT_INFO_H #define KO_DOCUMENT_INFO_H -#include -#include +#include +#include #include #include -class QString; -class QStringList; -class QDomDocument; -class QDomElement; -class QDomNode; -class QDateTime; +class TQString; +class TQStringList; +class TQDomDocument; +class TQDomElement; +class TQDomNode; +class TQDateTime; class KoStore; class KoDocumentInfoPage; class KoXmlWriter; -class KOFFICECORE_EXPORT KoDocumentInfo : public QObject +class KOFFICECORE_EXPORT KoDocumentInfo : public TQObject { Q_OBJECT + TQ_OBJECT public: - KoDocumentInfo( QObject* parent = 0, const char* name = 0 ); + KoDocumentInfo( TQObject* tqparent = 0, const char* name = 0 ); virtual ~KoDocumentInfo(); - bool load( const QDomDocument& doc ); - bool loadOasis( const QDomDocument& metaDoc ); + bool load( const TQDomDocument& doc ); + bool loadOasis( const TQDomDocument& metaDoc ); - QDomDocument save(); + TQDomDocument save(); bool saveOasis( KoStore* store ); /** * This info has an accessor because it's the most commonly used. * Equivalent to page("about")->title() (but checking that the page exists) */ - QString title() const; - QString creator() const; + TQString title() const; + TQString creator() const; - KoDocumentInfoPage* page( const QString& name ) const; - QStringList pages() const; + KoDocumentInfoPage* page( const TQString& name ) const; + TQStringList pages() const; void documentInfochanged() { emit sigDocumentInfoModifed();} signals: void sigDocumentInfoModifed(); }; -class KOFFICECORE_EXPORT KoDocumentInfoPage : public QObject +class KOFFICECORE_EXPORT KoDocumentInfoPage : public TQObject { public: - KoDocumentInfoPage( QObject *parent, const char* name ); + KoDocumentInfoPage( TQObject *tqparent, const char* name ); - virtual bool load( const QDomElement& e ) = 0; - virtual QDomElement save( QDomDocument& doc ) = 0; - virtual bool loadOasis( const QDomNode& metaDoc ) = 0; + virtual bool load( const TQDomElement& e ) = 0; + virtual TQDomElement save( TQDomDocument& doc ) = 0; + virtual bool loadOasis( const TQDomNode& metaDoc ) = 0; virtual bool saveOasis( KoXmlWriter &xmlWriter ) = 0; }; class KOFFICECORE_EXPORT KoDocumentInfoAuthor : public KoDocumentInfoPage { Q_OBJECT + TQ_OBJECT public: KoDocumentInfoAuthor( KoDocumentInfo* info ); ~KoDocumentInfoAuthor(); - virtual bool load( const QDomElement& e ); - virtual QDomElement save( QDomDocument& doc ); - virtual bool loadOasis( const QDomNode& metaDoc ); + virtual bool load( const TQDomElement& e ); + virtual TQDomElement save( TQDomDocument& doc ); + virtual bool loadOasis( const TQDomNode& metaDoc ); virtual bool saveOasis( KoXmlWriter &xmlWriter ); - QString fullName() const; - QString initial() const; - QString title() const; - QString company() const; - QString email() const; - QString telephoneHome() const; - QString telephoneWork() const; - QString fax() const; - QString country() const; - QString postalCode() const; - QString city() const; - QString street() const; - QString position() const; - - void setFullName( const QString& n ); - void setTitle( const QString& n ); - void setCompany( const QString& n ); - void setEmail( const QString& n ); - void setTelephoneHome( const QString& n ); - void setTelephoneWork( const QString& n ); - void setFax( const QString& n ); - void setCountry( const QString& n ); - void setPostalCode( const QString& n ); - void setCity( const QString& n ); - void setStreet( const QString& n ); - void setInitial( const QString& n ); - void setPosition( const QString& n ); + TQString fullName() const; + TQString initial() const; + TQString title() const; + TQString company() const; + TQString email() const; + TQString telephoneHome() const; + TQString telephoneWork() const; + TQString fax() const; + TQString country() const; + TQString postalCode() const; + TQString city() const; + TQString street() const; + TQString position() const; + + void setFullName( const TQString& n ); + void setTitle( const TQString& n ); + void setCompany( const TQString& n ); + void setEmail( const TQString& n ); + void setTelephoneHome( const TQString& n ); + void setTelephoneWork( const TQString& n ); + void setFax( const TQString& n ); + void setCountry( const TQString& n ); + void setPostalCode( const TQString& n ); + void setCity( const TQString& n ); + void setStreet( const TQString& n ); + void setInitial( const TQString& n ); + void setPosition( const TQString& n ); void initParameters(); private: - QString m_fullName; - QString m_title; - QString m_company; - QString m_email; - QString m_telephoneHome; - QString m_telephoneWork; - QString m_fax; - QString m_country; - QString m_postalCode; - QString m_city; - QString m_street; - QString m_initial; - QString m_position; + TQString m_fullName; + TQString m_title; + TQString m_company; + TQString m_email; + TQString m_telephoneHome; + TQString m_telephoneWork; + TQString m_fax; + TQString m_country; + TQString m_postalCode; + TQString m_city; + TQString m_street; + TQString m_initial; + TQString m_position; KConfig *m_emailCfg; }; class KOFFICECORE_EXPORT KoDocumentInfoAbout : public KoDocumentInfoPage { Q_OBJECT + TQ_OBJECT public: KoDocumentInfoAbout( KoDocumentInfo* info ); - virtual bool load( const QDomElement& e ); - virtual QDomElement save( QDomDocument& doc ); - virtual bool loadOasis( const QDomNode& metaDoc ); + virtual bool load( const TQDomElement& e ); + virtual TQDomElement save( TQDomDocument& doc ); + virtual bool loadOasis( const TQDomNode& metaDoc ); virtual bool saveOasis( KoXmlWriter &xmlWriter ); - QString title() const; - QString abstract() const; - QString subject() const; - QString keywords() const; - QString initialCreator() const; - QString editingCycles() const; - QString creationDate() const; - QString modificationDate() const; + TQString title() const; + TQString abstract() const; + TQString subject() const; + TQString keywords() const; + TQString initialCreator() const; + TQString editingCycles() const; + TQString creationDate() const; + TQString modificationDate() const; - void setKeywords( const QString &n ); - void setSubject( const QString& n ); + void setKeywords( const TQString &n ); + void setSubject( const TQString& n ); - void setTitle( const QString& n ); - void setAbstract( const QString& n ); + void setTitle( const TQString& n ); + void setAbstract( const TQString& n ); void saveParameters(); public slots: @@ -164,13 +167,13 @@ public slots: private: KoDocumentInfo* m_docInfo; - QString m_title; - QString m_abstract; - QString m_keywords; - QString m_subject; - QString m_initialCreator; - QDateTime m_creationDate; - QDateTime m_modificationDate; + TQString m_title; + TQString m_abstract; + TQString m_keywords; + TQString m_subject; + TQString m_initialCreator; + TQDateTime m_creationDate; + TQDateTime m_modificationDate; int m_editingCycles; bool m_firstSave; }; @@ -178,19 +181,20 @@ private: class KOFFICECORE_EXPORT KoDocumentInfoUserMetadata : public KoDocumentInfoPage { Q_OBJECT + TQ_OBJECT public: KoDocumentInfoUserMetadata( KoDocumentInfo* info ); - virtual bool load( const QDomElement& e ); - virtual QDomElement save( QDomDocument& doc ); - virtual bool loadOasis( const QDomNode& metaDoc ); + virtual bool load( const TQDomElement& e ); + virtual TQDomElement save( TQDomDocument& doc ); + virtual bool loadOasis( const TQDomNode& metaDoc ); virtual bool saveOasis( KoXmlWriter &xmlWriter ); - QMap* metadataList() { return &m_metaList; } + TQMap* metadataList() { return &m_metaList; } private: - QMap m_metaList; - QStringList m_reserved; + TQMap m_metaList; + TQStringList m_reserved; }; #endif diff --git a/lib/kofficecore/KoDocumentInfoDlg.cpp b/lib/kofficecore/KoDocumentInfoDlg.cpp index f9ad89044..8fa70f076 100644 --- a/lib/kofficecore/KoDocumentInfoDlg.cpp +++ b/lib/kofficecore/KoDocumentInfoDlg.cpp @@ -33,12 +33,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -49,10 +49,10 @@ #include #include #include -#include +#include #include -#include -#include +#include +#include #include #include #include @@ -79,9 +79,9 @@ public: KDialogBase *m_dialog; }; -KoDocumentInfoDlg::KoDocumentInfoDlg( KoDocumentInfo *docInfo, QWidget *parent, const char *name, +KoDocumentInfoDlg::KoDocumentInfoDlg( KoDocumentInfo *docInfo, TQWidget *tqparent, const char *name, KDialogBase *dialog ) -: QObject( parent, "docinfodlg" ) +: TQObject( tqparent, "docinfodlg" ) { d = new KoDocumentInfoDlgPrivate; d->m_info = docInfo; @@ -94,14 +94,14 @@ KoDocumentInfoDlg::KoDocumentInfoDlg( KoDocumentInfo *docInfo, QWidget *parent, d->m_dialog = new KDialogBase( KDialogBase::Tabbed, i18n( "Document Information" ), KDialogBase::Ok | KDialogBase::Cancel, - KDialogBase::Ok, parent, name, true, false ); - d->m_dialog->setInitialSize( QSize( 500, 500 ) ); + KDialogBase::Ok, tqparent, name, true, false ); + d->m_dialog->setInitialSize( TQSize( 500, 500 ) ); d->m_bDeleteDialog = true; } - QStringList pages = docInfo->pages(); - QStringList::ConstIterator it = pages.begin(); - QStringList::ConstIterator end = pages.end(); + TQStringList pages = docInfo->pages(); + TQStringList::ConstIterator it = pages.begin(); + TQStringList::ConstIterator end = pages.end(); for (; it != end; ++it ) { KoDocumentInfoPage *pg = docInfo->page( *it ); @@ -174,24 +174,24 @@ void KoDocumentInfoDlg::loadFromKABC() void KoDocumentInfoDlg::deleteInfo() { - d->m_authorWidget->leFullName->setText( QString::null ); - d->m_authorWidget->leInitial->setText( QString::null ); - d->m_authorWidget->leAuthorTitle->setText( QString::null ); - d->m_authorWidget->leCompany->setText( QString::null ); - d->m_authorWidget->leEmail->setText( QString::null ); - d->m_authorWidget->leTelephoneHome->setText( QString::null ); - d->m_authorWidget->leTelephoneWork->setText( QString::null ); - d->m_authorWidget->leFax->setText( QString::null ); - d->m_authorWidget->leCountry->setText( QString::null ); - d->m_authorWidget->lePostalCode->setText( QString::null ); - d->m_authorWidget->leCity->setText( QString::null ); - d->m_authorWidget->leStreet->setText( QString::null ); + d->m_authorWidget->leFullName->setText( TQString() ); + d->m_authorWidget->leInitial->setText( TQString() ); + d->m_authorWidget->leAuthorTitle->setText( TQString() ); + d->m_authorWidget->leCompany->setText( TQString() ); + d->m_authorWidget->leEmail->setText( TQString() ); + d->m_authorWidget->leTelephoneHome->setText( TQString() ); + d->m_authorWidget->leTelephoneWork->setText( TQString() ); + d->m_authorWidget->leFax->setText( TQString() ); + d->m_authorWidget->leCountry->setText( TQString() ); + d->m_authorWidget->lePostalCode->setText( TQString() ); + d->m_authorWidget->leCity->setText( TQString() ); + d->m_authorWidget->leStreet->setText( TQString() ); emit changed(); } void KoDocumentInfoDlg::resetMetaData() { - QString s = KGlobal::locale()->formatDateTime( QDateTime::currentDateTime() ); + TQString s = KGlobal::locale()->formatDateTime( TQDateTime::tqcurrentDateTime() ); d->m_aboutWidget->labelCreated->setText( s + ", " + d->m_info->creator() ); d->m_aboutWidget->labelModified->setText( "" ); d->m_aboutWidget->labelRevision->setText( "0" ); @@ -200,11 +200,11 @@ void KoDocumentInfoDlg::resetMetaData() void KoDocumentInfoDlg::addAuthorPage( KoDocumentInfoAuthor *authorInfo ) { - QVBox *page = d->m_dialog->addVBoxPage( i18n( "Author" ) ); + TQVBox *page = d->m_dialog->addVBoxPage( i18n( "Author" ) ); d->m_authorWidget = new KoDocumentInfoAuthorWidget( page ); d->m_authorWidget->labelAuthor->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 48 ) ); - d->m_authorWidget->pbLoadKABC->setIconSet( QIconSet( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Small ) ) ); - d->m_authorWidget->pbDelete->setIconSet( QIconSet( KGlobal::iconLoader()->loadIcon( "eraser", KIcon::Small ) ) ); + d->m_authorWidget->pbLoadKABC->setIconSet( TQIconSet( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Small ) ) ); + d->m_authorWidget->pbDelete->setIconSet( TQIconSet( KGlobal::iconLoader()->loadIcon( "eraser", KIcon::Small ) ) ); d->m_authorWidget->leFullName->setText( authorInfo->fullName() ); d->m_authorWidget->leInitial->setText( authorInfo->initial() ); @@ -220,53 +220,53 @@ void KoDocumentInfoDlg::addAuthorPage( KoDocumentInfoAuthor *authorInfo ) d->m_authorWidget->leStreet->setText( authorInfo->street() ); d->m_authorWidget->leAuthorPosition->setText( authorInfo->position() ); - connect( d->m_authorWidget->leFullName, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leInitial, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leAuthorTitle, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leCompany, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leEmail, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leTelephoneWork, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leTelephoneHome, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leFax, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leCountry, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->lePostalCode, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leCity, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leStreet, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leAuthorPosition, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->pbLoadKABC, SIGNAL( clicked() ), - this, SLOT( loadFromKABC() ) ); - connect( d->m_authorWidget->pbDelete, SIGNAL( clicked() ), - this, SLOT( deleteInfo() ) ); + connect( d->m_authorWidget->leFullName, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leInitial, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leAuthorTitle, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leCompany, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leEmail, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leTelephoneWork, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leTelephoneHome, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leFax, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leCountry, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->lePostalCode, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leCity, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leStreet, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leAuthorPosition, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->pbLoadKABC, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( loadFromKABC() ) ); + connect( d->m_authorWidget->pbDelete, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( deleteInfo() ) ); } void KoDocumentInfoDlg::addAboutPage( KoDocumentInfoAbout *aboutInfo ) { - QVBox *page = d->m_dialog->addVBoxPage( i18n( "General" ) ); + TQVBox *page = d->m_dialog->addVBoxPage( i18n( "General" ) ); d->m_aboutWidget = new KoDocumentInfoAboutWidget( page ); - d->m_aboutWidget->pbReset->setIconSet( QIconSet( KGlobal::iconLoader()->loadIcon( "reload", KIcon::Small ) ) ); - KoDocument* doc = dynamic_cast< KoDocument* >( d->m_info->parent() ); + d->m_aboutWidget->pbReset->setIconSet( TQIconSet( KGlobal::iconLoader()->loadIcon( "reload", KIcon::Small ) ) ); + KoDocument* doc = dynamic_cast< KoDocument* >( d->m_info->tqparent() ); if ( doc ) { d->m_aboutWidget->leDocFile->setText( doc->file() ); d->m_aboutWidget->labelType->setText( KMimeType::mimeType( doc->mimeType() )->comment() ); d->m_aboutWidget->pixmapLabel->setPixmap( KMimeType::mimeType( doc->mimeType() )->pixmap( KIcon::Desktop, 48 ) ); } - if ( aboutInfo->creationDate() != QString::null ) + if ( aboutInfo->creationDate() != TQString() ) d->m_aboutWidget->labelCreated->setText( aboutInfo->creationDate() + ", " + aboutInfo->initialCreator() ); - if ( aboutInfo->modificationDate() != QString::null ) + if ( aboutInfo->modificationDate() != TQString() ) d->m_aboutWidget->labelModified->setText( aboutInfo->modificationDate() + ", " + d->m_info->creator() ); d->m_aboutWidget->labelRevision->setText( aboutInfo->editingCycles() ); d->m_aboutWidget->leDocTitle->setText( aboutInfo->title() ); @@ -274,33 +274,33 @@ void KoDocumentInfoDlg::addAboutPage( KoDocumentInfoAbout *aboutInfo ) d->m_aboutWidget->leDocKeywords->setText( aboutInfo->keywords() ); d->m_aboutWidget->meDocAbstract->setText( aboutInfo->abstract() ); - connect( d->m_aboutWidget->leDocTitle, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_aboutWidget->meDocAbstract, SIGNAL( textChanged() ), - this, SIGNAL( changed() ) ); - connect( d->m_aboutWidget->leDocSubject, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_aboutWidget->leDocKeywords, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_aboutWidget->pbReset, SIGNAL( clicked() ), - aboutInfo, SLOT( resetMetaData() ) ); - connect( d->m_aboutWidget->pbReset, SIGNAL( clicked() ), - this, SLOT( resetMetaData() ) ); + connect( d->m_aboutWidget->leDocTitle, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_aboutWidget->meDocAbstract, TQT_SIGNAL( textChanged() ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_aboutWidget->leDocSubject, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_aboutWidget->leDocKeywords, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_aboutWidget->pbReset, TQT_SIGNAL( clicked() ), + aboutInfo, TQT_SLOT( resetMetaData() ) ); + connect( d->m_aboutWidget->pbReset, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( resetMetaData() ) ); } void KoDocumentInfoDlg::addUserMetadataPage( KoDocumentInfoUserMetadata *userMetadataInfo ) { - QVBox *page = d->m_dialog->addVBoxPage( i18n( "User-Defined Metadata" ) ); + TQVBox *page = d->m_dialog->addVBoxPage( i18n( "User-Defined Metadata" ) ); d->m_metaWidget = new KoDocumentInfoUserMetadataWidget( page ); d->m_metaWidget->metaListView->addColumn( "Name" ); d->m_metaWidget->metaListView->setFullWidth( true ); - QMap::iterator it; + TQMap::iterator it; for ( it = userMetadataInfo->metadataList()->begin(); it != userMetadataInfo->metadataList()->end(); ++it ) { - QString name = it.key(); - QString value = it.data(); + TQString name = it.key(); + TQString value = it.data(); KListViewItem* it = new KListViewItem( d->m_metaWidget->metaListView, name, value ); it->setPixmap( 0, KGlobal::iconLoader()->loadIcon( "text", KIcon::Small ) ); } @@ -308,9 +308,9 @@ void KoDocumentInfoDlg::addUserMetadataPage( KoDocumentInfoUserMetadata *userMet void KoDocumentInfoDlg::save() { - QStringList pages = d->m_info->pages(); - QStringList::ConstIterator it = pages.begin(); - QStringList::ConstIterator end = pages.end(); + TQStringList pages = d->m_info->pages(); + TQStringList::ConstIterator it = pages.begin(); + TQStringList::ConstIterator end = pages.end(); bool saveInfo=false; for (; it != end; ++it ) { @@ -385,7 +385,7 @@ public: KoDocumentInfoPropsPage::KoDocumentInfoPropsPage( KPropertiesDialog *props, const char *, - const QStringList & ) + const TQStringList & ) : KPropsDlgPlugin( props ) { d = new KoDocumentInfoPropsPagePrivate; @@ -416,18 +416,18 @@ KoDocumentInfoPropsPage::KoDocumentInfoPropsPage( KPropertiesDialog *props, { d->m_docInfoFile = static_cast( entry ); - QBuffer buffer( d->m_docInfoFile->data() ); + TQBuffer buffer( d->m_docInfoFile->data() ); buffer.open( IO_ReadOnly ); - QDomDocument doc; + TQDomDocument doc; doc.setContent( &buffer ); d->m_info->load( doc ); } d->m_dlg = new KoDocumentInfoDlg( d->m_info, 0, 0, props ); - connect( d->m_dlg, SIGNAL( changed() ), - this, SIGNAL( changed() ) ); + connect( d->m_dlg, TQT_SIGNAL( changed() ), + this, TQT_SIGNAL( changed() ) ); } KoDocumentInfoPropsPage::~KoDocumentInfoPropsPage() @@ -447,10 +447,10 @@ void KoDocumentInfoPropsPage::applyChanges() struct stat statBuff; - if ( stat( QFile::encodeName( d->m_url.path() ), &statBuff ) != 0 ) + if ( stat( TQFile::encodeName( d->m_url.path() ), &statBuff ) != 0 ) return; - KTempFile tempFile( d->m_url.path(), QString::null, statBuff.st_mode ); + KTempFile tempFile( d->m_url.path(), TQString(), statBuff.st_mode ); tempFile.setAutoDelete( true ); @@ -468,7 +468,7 @@ void KoDocumentInfoPropsPage::applyChanges() KMimeType::Ptr mimeType = KMimeType::findByURL( d->m_url, 0, true ); if ( mimeType && dynamic_cast( d->m_dst->device() ) != 0 ) { - QCString appIdentification( "KOffice " ); // We are limited in the number of chars. + TQCString appIdentification( "KOffice " ); // We are limited in the number of chars. appIdentification += mimeType->name().latin1(); appIdentification += '\004'; // Two magic bytes to make the identification appIdentification += '\006'; // more reliable (DF) @@ -477,9 +477,9 @@ void KoDocumentInfoPropsPage::applyChanges() bool docInfoSaved = false; - QStringList entries = root->entries(); - QStringList::ConstIterator it = entries.begin(); - QStringList::ConstIterator end = entries.end(); + TQStringList entries = root->entries(); + TQStringList::ConstIterator it = entries.begin(); + TQStringList::ConstIterator end = entries.end(); for (; it != end; ++it ) { const KTarEntry *entry = root->entry( *it ); @@ -487,13 +487,13 @@ void KoDocumentInfoPropsPage::applyChanges() assert( entry ); if ( entry->name() == "documentinfo.xml" || - ( !docInfoSaved && !entries.contains( "documentinfo.xml" ) ) ) + ( !docInfoSaved && !entries.tqcontains( "documentinfo.xml" ) ) ) { d->m_dlg->save(); - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); - QTextStream str( &buffer ); + TQTextStream str( &buffer ); str << d->m_info->save(); buffer.close(); @@ -504,19 +504,19 @@ void KoDocumentInfoPropsPage::applyChanges() docInfoSaved = true; } else - copy( QString::null, entry ); + copy( TQString(), entry ); } d->m_dst->close(); - QDir dir; + TQDir dir; dir.rename( tempFile.name(), d->m_url.path() ); delete d->m_dst; d->m_dst = 0; } -void KoDocumentInfoPropsPage::copy( const QString &path, const KArchiveEntry *entry ) +void KoDocumentInfoPropsPage::copy( const TQString &path, const KArchiveEntry *entry ) { kdDebug( 30003 ) << "copy " << entry->name() << endl; if ( entry->isFile() ) @@ -534,16 +534,16 @@ void KoDocumentInfoPropsPage::copy( const QString &path, const KArchiveEntry *en kdDebug( 30003 ) << "dir : " << entry->name() << endl; kdDebug( 30003 ) << "full path is: " << path << entry->name() << endl; - QString p = path + entry->name(); + TQString p = path + entry->name(); if ( p != "/" ) { d->m_dst->writeDir( p, entry->user(), entry->group() ); p.append( "/" ); } - QStringList entries = dir->entries(); - QStringList::ConstIterator it = entries.begin(); - QStringList::ConstIterator end = entries.end(); + TQStringList entries = dir->entries(); + TQStringList::ConstIterator it = entries.begin(); + TQStringList::ConstIterator end = entries.end(); for (; it != end; ++it ) copy( p, dir->entry( *it ) ); } diff --git a/lib/kofficecore/KoDocumentInfoDlg.h b/lib/kofficecore/KoDocumentInfoDlg.h index d3e1e9a3e..d346c4c12 100644 --- a/lib/kofficecore/KoDocumentInfoDlg.h +++ b/lib/kofficecore/KoDocumentInfoDlg.h @@ -32,11 +32,12 @@ class KoDocumentInfoAbout; class KoDocumentInfoUserMetadata; class KArchiveEntry; -class KOFFICECORE_EXPORT KoDocumentInfoDlg : public QObject +class KOFFICECORE_EXPORT KoDocumentInfoDlg : public TQObject { Q_OBJECT + TQ_OBJECT public: - KoDocumentInfoDlg( KoDocumentInfo *docInfo, QWidget *parent = 0, const char *name = 0, + KoDocumentInfoDlg( KoDocumentInfo *docInfo, TQWidget *tqparent = 0, const char *name = 0, KDialogBase *dialog = 0 ); virtual ~KoDocumentInfoDlg(); @@ -69,15 +70,16 @@ private: class KOFFICECORE_EXPORT KoDocumentInfoPropsPage : public KPropsDlgPlugin { Q_OBJECT + TQ_OBJECT public: KoDocumentInfoPropsPage( KPropertiesDialog *props, const char *name = 0, - const QStringList & = QStringList() ); + const TQStringList & = TQStringList() ); virtual ~KoDocumentInfoPropsPage(); virtual void applyChanges(); private: - void copy( const QString &path, const KArchiveEntry *entry ); + void copy( const TQString &path, const KArchiveEntry *entry ); class KoDocumentInfoPropsPagePrivate; KoDocumentInfoPropsPagePrivate *d; }; diff --git a/lib/kofficecore/KoDocument_p.h b/lib/kofficecore/KoDocument_p.h index 1b21f69a8..5ad033173 100644 --- a/lib/kofficecore/KoDocument_p.h +++ b/lib/kofficecore/KoDocument_p.h @@ -30,6 +30,7 @@ class KoDocument; class KoBrowserExtension : public KParts::BrowserExtension { Q_OBJECT + TQ_OBJECT public: KoBrowserExtension( KoDocument * doc, const char * name = 0 ); diff --git a/lib/kofficecore/KoDom.cpp b/lib/kofficecore/KoDom.cpp index 45b00acdc..72151c103 100644 --- a/lib/kofficecore/KoDom.cpp +++ b/lib/kofficecore/KoDom.cpp @@ -19,12 +19,12 @@ #include "KoDom.h" -QDomElement KoDom::namedItemNS( const QDomNode& node, const char* nsURI, const char* localName ) +TQDomElement KoDom::namedItemNS( const TQDomNode& node, const char* nsURI, const char* localName ) { - QDomNode n = node.firstChild(); + TQDomNode n = node.firstChild(); for ( ; !n.isNull(); n = n.nextSibling() ) { if ( n.isElement() && n.localName() == localName && n.namespaceURI() == nsURI ) return n.toElement(); } - return QDomElement(); + return TQDomElement(); } diff --git a/lib/kofficecore/KoDom.h b/lib/kofficecore/KoDom.h index 4d95a42b5..688110f09 100644 --- a/lib/kofficecore/KoDom.h +++ b/lib/kofficecore/KoDom.h @@ -20,28 +20,28 @@ #ifndef KODOM_H #define KODOM_H -#include +#include #include /** - * This namespace contains a few convenience functions to simplify code using QDom + * This namespace contains a few convenience functions to simplify code using TQDom * (when loading OASIS documents, in particular). * * To find the child element with a given name, use KoDom::namedItemNS. * * To find all child elements with a given name, use - * QDomElement e; - * forEachElement( e, parent ) + * TQDomElement e; + * forEachElement( e, tqparent ) * { * if ( e.localName() == "..." && e.namespaceURI() == KoXmlNS::... ) * { * ... * } * } - * Note that this means you don't ever need to use QDomNode nor toElement anymore! + * Note that this means you don't ever need to use TQDomNode nor toElement anymore! * Also note that localName is the part without the prefix, this is the whole point * of namespace-aware methods. * - * To find the attribute with a given name, use QDomElement::attributeNS. + * To find the attribute with a given name, use TQDomElement::attributeNS. * * Do not use getElementsByTagNameNS, it's recursive (which is never needed in KOffice). * Do not use tagName() or nodeName() or prefix(), since the prefix isn't fixed. @@ -51,19 +51,19 @@ namespace KoDom { /** - * A namespace-aware version of QDomNode::namedItem(), - * which also takes care of casting to a QDomElement. + * A namespace-aware version of TQDomNode::namedItem(), + * which also takes care of casting to a TQDomElement. * Use this when a domelement is known to have only *one* child element * with a given tagname. * * Note: do *NOT* use getElementsByTagNameNS, it's recursive! */ - KOFFICECORE_EXPORT QDomElement namedItemNS( const QDomNode& node, const char* nsURI, const char* localName ); + KOFFICECORE_EXPORT TQDomElement namedItemNS( const TQDomNode& node, const char* nsURI, const char* localName ); } -#define forEachElement( elem, parent ) \ - for ( QDomNode _node = parent.firstChild(); !_node.isNull(); _node = _node.nextSibling() ) \ +#define forEachElement( elem, tqparent ) \ + for ( TQDomNode _node = tqparent.firstChild(); !_node.isNull(); _node = _node.nextSibling() ) \ if ( !( elem = _node.toElement() ).isNull() ) #endif /* KODOM_H */ diff --git a/lib/kofficecore/KoFactory.cpp b/lib/kofficecore/KoFactory.cpp index d858e8e91..9e6a4a182 100644 --- a/lib/kofficecore/KoFactory.cpp +++ b/lib/kofficecore/KoFactory.cpp @@ -31,8 +31,8 @@ public: } }; -KoFactory::KoFactory( QObject *parent, const char *name ) - : KParts::Factory( parent, name ) +KoFactory::KoFactory( TQObject *tqparent, const char *name ) + : KParts::Factory( tqparent, name ) { //d = new KoFactoryPrivate; } diff --git a/lib/kofficecore/KoFactory.h b/lib/kofficecore/KoFactory.h index bcc77439e..e0d6b2b7e 100644 --- a/lib/kofficecore/KoFactory.h +++ b/lib/kofficecore/KoFactory.h @@ -27,8 +27,9 @@ class KInstance; class KOFFICECORE_EXPORT KoFactory : public KParts::Factory { Q_OBJECT + TQ_OBJECT public: - KoFactory( QObject *parent = 0, const char *name = 0 ); + KoFactory( TQObject *tqparent = 0, const char *name = 0 ); virtual ~KoFactory(); private: diff --git a/lib/kofficecore/KoFileDialog.cpp b/lib/kofficecore/KoFileDialog.cpp index b80c23e0a..9f581a4e2 100644 --- a/lib/kofficecore/KoFileDialog.cpp +++ b/lib/kofficecore/KoFileDialog.cpp @@ -25,13 +25,13 @@ #include #include -KoFileDialog::KoFileDialog(const QString& startDir, const QString& filter, - QWidget *parent, const char *name, +KoFileDialog::KoFileDialog(const TQString& startDir, const TQString& filter, + TQWidget *tqparent, const char *name, bool modal) - : KFileDialog( startDir, filter, parent, name, modal ) + : KFileDialog( startDir, filter, tqparent, name, modal ) { - connect( filterWidget, SIGNAL( activated( int) ), - this, SLOT( slotChangedfilter( int ) ) ); + connect( filterWidget, TQT_SIGNAL( activated( int) ), + this, TQT_SLOT( slotChangedfilter( int ) ) ); } void KoFileDialog::slotChangedfilter( int index ) @@ -50,9 +50,9 @@ void KoFileDialog::slotChangedfilter( int index ) } } -void KoFileDialog::setSpecialMimeFilter( QStringList& mimeFilter, - const QString& currentFormat, const int specialOutputFlag, - const QString& nativeFormat, +void KoFileDialog::setSpecialMimeFilter( TQStringList& mimeFilter, + const TQString& currentFormat, const int specialOutputFlag, + const TQString& nativeFormat, int supportedSpecialFormats ) { Q_ASSERT( !mimeFilter.isEmpty() ); @@ -77,7 +77,7 @@ void KoFileDialog::setSpecialMimeFilter( QStringList& mimeFilter, } // Insert numSpecialEntries entries with native mimetypes, for the special entries. - QStringList::Iterator mimeFilterIt = mimeFilter.at( 1 ); + TQStringList::Iterator mimeFilterIt = mimeFilter.at( 1 ); mimeFilter.insert( mimeFilterIt /* before 1 -> after 0 */, numSpecialEntries, nativeFormat ); // Fill in filter combo @@ -90,9 +90,9 @@ void KoFileDialog::setSpecialMimeFilter( QStringList& mimeFilter, int idx = 1; // 0 is the native format if ( addUncompressed ) - filterWidget->changeItem( i18n("%1 (Uncompressed XML Files)").arg( type->comment() ), idx++ ); + filterWidget->changeItem( i18n("%1 (Uncompressed XML Files)").tqarg( type->comment() ), idx++ ); if ( addFlatXML ) - filterWidget->changeItem( i18n("%1 (Flat XML File)").arg( type->comment() ), idx++ ); + filterWidget->changeItem( i18n("%1 (Flat XML File)").tqarg( type->comment() ), idx++ ); // if you add an entry here, update numSpecialEntries above and specialEntrySelected() below // For native format... @@ -107,9 +107,9 @@ void KoFileDialog::setSpecialMimeFilter( QStringList& mimeFilter, for (mimeFilterIt = mimeFilter.begin (); mimeFilterIt != mimeFilter.end (); ++mimeFilterIt, i++) { KMimeType::Ptr mime = KMimeType::mimeType (*mimeFilterIt); - QString compatString = mime->property ("X-KDE-CompatibleApplication").toString (); + TQString compatString = mime->property ("X-KDE-CompatibleApplication").toString (); if (!compatString.isEmpty ()) - filterWidget->changeItem (i18n ("%1 (%2 Compatible)").arg (mime->comment ()).arg (compatString), i); + filterWidget->changeItem (i18n ("%1 (%2 Compatible)").tqarg (mime->comment ()).tqarg (compatString), i); } } diff --git a/lib/kofficecore/KoFileDialog.h b/lib/kofficecore/KoFileDialog.h index fc3b61e24..1482bf362 100644 --- a/lib/kofficecore/KoFileDialog.h +++ b/lib/kofficecore/KoFileDialog.h @@ -22,7 +22,7 @@ #define KOFILEDIALOG_H #include -#include +#include /** * Extension to KFileDialog in order to add special entries to the filter combo, @@ -35,13 +35,14 @@ class KoFileDialog : public KFileDialog { Q_OBJECT + TQ_OBJECT public: - KoFileDialog( const QString& startDir, const QString& filter, - QWidget *parent, const char *name, + KoFileDialog( const TQString& startDir, const TQString& filter, + TQWidget *tqparent, const char *name, bool modal ); - void setSpecialMimeFilter( QStringList& mimeFilter, - const QString& currentFormat, const int specialOutputFlag, - const QString& nativeFormat, + void setSpecialMimeFilter( TQStringList& mimeFilter, + const TQString& currentFormat, const int specialOutputFlag, + const TQString& nativeFormat, int supportedSpecialFormats ); int specialEntrySelected(); @@ -49,7 +50,7 @@ private slots: void slotChangedfilter( int index ); private: - QValueVector m_specialFormats; + TQValueVector m_specialFormats; }; #endif /* KOFILEDIALOG_H */ diff --git a/lib/kofficecore/KoFilter.cpp b/lib/kofficecore/KoFilter.cpp index 5b1d4898d..ba37191c1 100644 --- a/lib/kofficecore/KoFilter.cpp +++ b/lib/kofficecore/KoFilter.cpp @@ -19,7 +19,7 @@ #include -#include +#include #include #include @@ -28,7 +28,7 @@ #include -KoFilter::KoFilter() : QObject( 0, 0 ), m_chain( 0 ) +KoFilter::KoFilter() : TQObject( 0, 0 ), m_chain( 0 ) { } @@ -49,12 +49,12 @@ int KoEmbeddingFilter::lruPartIndex() const return m_partStack.top()->m_lruPartIndex; } -QString KoEmbeddingFilter::mimeTypeByExtension( const QString& extension ) +TQString KoEmbeddingFilter::mimeTypeByExtension( const TQString& extension ) { // We need to resort to an ugly hack to determine the mimetype // from the extension, as kservicetypefactory.h isn't installed KURL url; - url.setPath( QString( "dummy.%1" ).arg( extension ) ); + url.setPath( TQString( "dummy.%1" ).tqarg( extension ) ); KMimeType::Ptr m( KMimeType::findByURL( url, 0, true, true ) ); return m->name(); } @@ -64,31 +64,31 @@ KoEmbeddingFilter::KoEmbeddingFilter() : KoFilter() m_partStack.push( new PartState() ); } -int KoEmbeddingFilter::embedPart( const QCString& from, QCString& to, - KoFilter::ConversionStatus& status, const QString& key ) +int KoEmbeddingFilter::embedPart( const TQCString& from, TQCString& to, + KoFilter::ConversiontqStatus& status, const TQString& key ) { ++( m_partStack.top()->m_lruPartIndex ); KTempFile tempIn; tempIn.setAutoDelete( true ); - savePartContents( tempIn.file() ); + savePartContents( TQT_TQIODEVICE(tempIn.file()) ); tempIn.file()->close(); KoFilterManager *manager = new KoFilterManager( tempIn.name(), from, m_chain ); - status = manager->exp0rt( QString::null, to ); + status = manager->exp0rt( TQString(), to ); delete manager; // Add the part to the current "stack frame", using the number as key // if the key string is empty PartReference ref( lruPartIndex(), to ); - m_partStack.top()->m_partReferences.insert( key.isEmpty() ? QString::number( lruPartIndex() ) : key, ref ); + m_partStack.top()->m_partReferences.insert( key.isEmpty() ? TQString::number( lruPartIndex() ) : key, ref ); return lruPartIndex(); } -void KoEmbeddingFilter::startInternalEmbedding( const QString& key, const QCString& mimeType ) +void KoEmbeddingFilter::startInternalEmbedding( const TQString& key, const TQCString& mimeType ) { - filterChainEnterDirectory( QString::number( ++( m_partStack.top()->m_lruPartIndex ) ) ); + filterChainEnterDirectory( TQString::number( ++( m_partStack.top()->m_lruPartIndex ) ) ); PartReference ref( lruPartIndex(), mimeType ); m_partStack.top()->m_partReferences.insert( key, ref ); m_partStack.push( new PartState() ); @@ -104,23 +104,23 @@ void KoEmbeddingFilter::endInternalEmbedding() filterChainLeaveDirectory(); } -int KoEmbeddingFilter::internalPartReference( const QString& key ) const +int KoEmbeddingFilter::internalPartReference( const TQString& key ) const { - QMapConstIterator it = m_partStack.top()->m_partReferences.find( key ); + TQMapConstIterator it = m_partStack.top()->m_partReferences.tqfind( key ); if ( it == m_partStack.top()->m_partReferences.end() ) return -1; return it.data().m_index; } -QCString KoEmbeddingFilter::internalPartMimeType( const QString& key ) const +TQCString KoEmbeddingFilter::internalPartMimeType( const TQString& key ) const { - QMapConstIterator it = m_partStack.top()->m_partReferences.find( key ); + TQMapConstIterator it = m_partStack.top()->m_partReferences.tqfind( key ); if ( it == m_partStack.top()->m_partReferences.end() ) - return QCString(); + return TQCString(); return it.data().m_mimeType; } -KoEmbeddingFilter::PartReference::PartReference( int index, const QCString& mimeType ) : +KoEmbeddingFilter::PartReference::PartReference( int index, const TQCString& mimeType ) : m_index( index ), m_mimeType( mimeType ) { } @@ -134,11 +134,11 @@ KoEmbeddingFilter::PartState::PartState() : m_lruPartIndex( 0 ) { } -void KoEmbeddingFilter::savePartContents( QIODevice* ) +void KoEmbeddingFilter::savePartContents( TQIODevice* ) { } -void KoEmbeddingFilter::filterChainEnterDirectory( const QString& directory ) const +void KoEmbeddingFilter::filterChainEnterDirectory( const TQString& directory ) const { m_chain->enterDirectory( directory ); } diff --git a/lib/kofficecore/KoFilter.h b/lib/kofficecore/KoFilter.h index 9d82a34f3..0f087252a 100644 --- a/lib/kofficecore/KoFilter.h +++ b/lib/kofficecore/KoFilter.h @@ -20,11 +20,11 @@ #ifndef __koffice_filter_h__ #define __koffice_filter_h__ -#include -#include -#include +#include +#include +#include #include -class QIODevice; +class TQIODevice; class KoFilterChain; /** @@ -32,6 +32,7 @@ class KoFilterChain; * * Derive your filter class from this base class and implement * the @ref convert() method. Don't forget to specify the Q_OBJECT + TQ_OBJECT * macro in your class even if you don't use signals or slots. * This is needed as filters are created on the fly. * The m_chain member allows access to the @ref KoFilterChain @@ -45,9 +46,10 @@ class KoFilterChain; * @author Werner Trobin * @todo the class has no constructor and therefore cannot initialize its private class */ -class KOFFICECORE_EXPORT KoFilter : public QObject +class KOFFICECORE_EXPORT KoFilter : public TQObject { Q_OBJECT + TQ_OBJECT friend class KoFilterEntry; // needed for the filter chain pointer :( friend class KoFilterChain; @@ -59,7 +61,7 @@ public: * Feel free to add some more error conditions @em before the last item * if it's needed. */ - enum ConversionStatus { OK, StupidError, UsageError, CreationError, FileNotFound, + enum ConversiontqStatus { OK, StupidError, UsageError, CreationError, FileNotFound, StorageCreationError, BadMimeType, BadConversionGraph, EmbeddedDocError, WrongFormat, NotImplemented, ParsingError, InternalError, UnexpectedEOF, @@ -77,10 +79,10 @@ public: * * @param from The mimetype of the source file/document * @param to The mimetype of the destination file/document - * @return The error status, see the @ref #ConversionStatus enum. + * @return The error status, see the @ref #ConversiontqStatus enum. * KoFilter::OK means that everything is alright. */ - virtual ConversionStatus convert( const QCString& from, const QCString& to ) = 0; + virtual ConversiontqStatus convert( const TQCString& from, const TQCString& to ) = 0; signals: /** @@ -133,7 +135,7 @@ private: * @ref #endInternalEmbedding accordingly. Try to use the previous method if possible. * * If you're using this class you can also setup a signal/slot communication - * between parent and child filter. To make that work you simply have to define + * between tqparent and child filter. To make that work you simply have to define * signals and slots along the following rules: * Signals should be named "commSignal\" where \ is the name of the signal, * slots should be named "commSlot\". The connection will be done automatically @@ -145,6 +147,7 @@ private: class KOFFICECORE_EXPORT KoEmbeddingFilter : public KoFilter { Q_OBJECT + TQ_OBJECT friend class KoFilterChain; @@ -167,7 +170,7 @@ public: * and so on. Note that you should only pass the pure extension * and not a whole pattern like "*.doc" or so. */ - static QString mimeTypeByExtension( const QString& extension ); + static TQString mimeTypeByExtension( const TQString& extension ); protected: /** @@ -197,9 +200,9 @@ protected: * @return The number of the part (can be used to refer to the part from * within the embedding filter). */ - int embedPart( const QCString& from, QCString& to, - KoFilter::ConversionStatus& status, - const QString& key = QString::null ); + int embedPart( const TQCString& from, TQCString& to, + KoFilter::ConversiontqStatus& status, + const TQString& key = TQString() ); /** * Method to perform "internal" embedding of parts in olefilter-style. @@ -211,7 +214,7 @@ protected: * @param key The key we use to store reference/mimetype of your new part * @param mimeType The mimetype of the part you're about to embed */ - void startInternalEmbedding( const QString& key, const QCString& mimeType ); + void startInternalEmbedding( const TQString& key, const TQCString& mimeType ); /** * This method signals the end of an internal embedding session. @@ -230,7 +233,7 @@ protected: * @return The reference or -1 if we didn't find a part with the * given key */ - int internalPartReference( const QString& key ) const; + int internalPartReference( const TQString& key ) const; /** * Query the internal part map for the mimetype of the part @@ -240,7 +243,7 @@ protected: * @return The mimetype, might be empty if the part matching * the given key doesn't exist. */ - QCString internalPartMimeType( const QString& key ) const; + TQCString internalPartMimeType( const TQString& key ) const; private: /** @@ -250,16 +253,16 @@ private: */ struct PartReference { - PartReference( int index = -1, const QCString& mimeType = "" ); + PartReference( int index = -1, const TQCString& mimeType = "" ); bool isValid() const; int m_index; - QCString m_mimeType; + TQCString m_mimeType; }; /** * This struct keeps track of the last used index for a - * child part and all references to existing children + * child part and all references to existing tqchildren * We use it to build a whole stack, one PartState per * embedding level. * @internal @@ -269,7 +272,7 @@ private: PartState(); int m_lruPartIndex; - QMap m_partReferences; + TQMap m_partReferences; }; /// Better do not copy the filters @@ -287,14 +290,14 @@ private: * * @param file An already opened file */ - virtual void savePartContents( QIODevice* file ); + virtual void savePartContents( TQIODevice* file ); /** * Internal methods to support the start/endInternalEmbedding * methods (we have to change directories and stuff). * These methods are declared friends of the KoFilterChain */ - void filterChainEnterDirectory( const QString& directory ) const; + void filterChainEnterDirectory( const TQString& directory ) const; /** * Internal methods to support the start/endInternalEmbedding * methods (we have to change directories and stuff). @@ -306,7 +309,7 @@ private: * A stack which keeps track of the current part references. * We push one PartState structure for every embedding level. */ - QPtrStack m_partStack; + TQPtrStack m_partStack; class Private; Private* d; diff --git a/lib/kofficecore/KoFilterChain.cpp b/lib/kofficecore/KoFilterChain.cpp index 2ab537801..ecade0930 100644 --- a/lib/kofficecore/KoFilterChain.cpp +++ b/lib/kofficecore/KoFilterChain.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include #include #include @@ -40,13 +40,13 @@ namespace { KoFilterChain::ChainLink::ChainLink( KoFilterChain* chain, KoFilterEntry::Ptr filterEntry, - const QCString& from, const QCString& to ) : + const TQCString& from, const TQCString& to ) : m_chain( chain ), m_filterEntry( filterEntry ), m_from( from ), m_to( to ), m_filter( 0 ), d( 0 ) { } -KoFilter::ConversionStatus KoFilterChain::ChainLink::invokeFilter( const ChainLink* const parentChainLink ) +KoFilter::ConversiontqStatus KoFilterChain::ChainLink::invokeFilter( const ChainLink* const tqparentChainLink ) { if ( !m_filterEntry ) { kdError( 30500 ) << "This filter entry is null. Strange stuff going on." << endl; @@ -60,10 +60,10 @@ KoFilter::ConversionStatus KoFilterChain::ChainLink::invokeFilter( const ChainLi return KoFilter::CreationError; } - if ( parentChainLink ) - setupCommunication( parentChainLink->m_filter ); + if ( tqparentChainLink ) + setupCommunication( tqparentChainLink->m_filter ); - KoFilter::ConversionStatus status = m_filter->convert( m_from, m_to ); + KoFilter::ConversiontqStatus status = m_filter->convert( m_from, m_to ); delete m_filter; m_filter=0; return status; @@ -81,41 +81,41 @@ int KoFilterChain::ChainLink::lruPartIndex() const return -1; } -void KoFilterChain::ChainLink::setupCommunication( const KoFilter* const parentFilter ) const +void KoFilterChain::ChainLink::setupCommunication( const KoFilter* const tqparentFilter ) const { // progress information - QObject::connect( m_filter, SIGNAL( sigProgress( int ) ), - m_chain->manager(), SIGNAL( sigProgress( int ) ) ); + TQObject::connect( m_filter, TQT_SIGNAL( sigProgress( int ) ), + m_chain->manager(), TQT_SIGNAL( sigProgress( int ) ) ); - if ( !parentFilter ) + if ( !tqparentFilter ) return; - const QMetaObject* const parent = parentFilter->metaObject(); - const QMetaObject* const child = m_filter->metaObject(); - if ( !parent || !child ) + const TQMetaObject* const tqparent = tqparentFilter->tqmetaObject(); + const TQMetaObject* const child = m_filter->tqmetaObject(); + if ( !tqparent || !child ) return; - setupConnections( parentFilter, parent->signalNames(), m_filter, child->slotNames() ); - setupConnections( m_filter, child->signalNames(), parentFilter, parent->slotNames() ); + setupConnections( tqparentFilter, tqparent->signalNames(), m_filter, child->slotNames() ); + setupConnections( m_filter, child->signalNames(), tqparentFilter, tqparent->slotNames() ); } -void KoFilterChain::ChainLink::setupConnections( const KoFilter* sender, const QStrList& sigs, - const KoFilter* receiver, const QStrList& sl0ts ) const +void KoFilterChain::ChainLink::setupConnections( const KoFilter* sender, const TQStrList& sigs, + const KoFilter* receiver, const TQStrList& sl0ts ) const { - QStrListIterator signalIt( sigs ); + TQStrListIterator signalIt( sigs ); for ( ; signalIt.current(); ++signalIt ) { if ( strncmp( signalIt.current(), SIGNAL_PREFIX, SIGNAL_PREFIX_LEN ) == 0 ) { - QStrListIterator slotIt( sl0ts ); + TQStrListIterator slotIt( sl0ts ); for ( ; slotIt.current(); ++slotIt ) { if ( strncmp( slotIt.current(), SLOT_PREFIX, SLOT_PREFIX_LEN ) == 0 ) { if ( strcmp( signalIt.current() + SIGNAL_PREFIX_LEN, slotIt.current() + SLOT_PREFIX_LEN ) == 0 ) { - QCString signalString; - signalString.setNum( QSIGNAL_CODE ); + TQCString signalString; + signalString.setNum( TQSIGNAL_CODE ); signalString += signalIt.current(); - QCString slotString; - slotString.setNum( QSLOT_CODE ); + TQCString slotString; + slotString.setNum( TQSLOT_CODE ); slotString += slotIt.current(); - QObject::connect( sender, signalString, receiver, slotString ); + TQObject::connect( sender, signalString, receiver, slotString ); } } } @@ -131,23 +131,23 @@ KoFilterChain::~KoFilterChain() manageIO(); // Called for the 2nd time in a row -> clean up } -KoFilter::ConversionStatus KoFilterChain::invokeChain() +KoFilter::ConversiontqStatus KoFilterChain::invokeChain() { - KoFilter::ConversionStatus status = KoFilter::OK; + KoFilter::ConversiontqStatus status = KoFilter::OK; m_state = Beginning; int count = m_chainLinks.count(); // This is needed due to nasty Microsoft design - const ChainLink* parentChainLink = 0; + const ChainLink* tqparentChainLink = 0; if ( filterManagerParentChain() ) - parentChainLink = filterManagerParentChain()->m_chainLinks.current(); + tqparentChainLink = filterManagerParentChain()->m_chainLinks.current(); // No iterator here, as we need m_chainLinks.current() in outputDocument() m_chainLinks.first(); for ( ; count > 1 && m_chainLinks.current() && status == KoFilter::OK; m_chainLinks.next(), --count ) { - status = m_chainLinks.current()->invokeFilter( parentChainLink ); + status = m_chainLinks.current()->invokeFilter( tqparentChainLink ); m_state = Middle; manageIO(); } @@ -162,7 +162,7 @@ KoFilter::ConversionStatus KoFilterChain::invokeChain() m_state |= End; else m_state = End; - status = m_chainLinks.current()->invokeFilter( parentChainLink ); + status = m_chainLinks.current()->invokeFilter( tqparentChainLink ); manageIO(); } @@ -172,20 +172,20 @@ KoFilter::ConversionStatus KoFilterChain::invokeChain() return status; } -QString KoFilterChain::chainOutput() const +TQString KoFilterChain::chainOutput() const { if ( m_state == Done ) return m_inputFile; // as we already called manageIO() - return QString::null; + return TQString(); } -QString KoFilterChain::inputFile() +TQString KoFilterChain::inputFile() { if ( m_inputQueried == File ) return m_inputFile; else if ( m_inputQueried != Nil ) { kdWarning( 30500 ) << "You already asked for some different source." << endl; - return QString::null; + return TQString(); } m_inputQueried = File; @@ -198,12 +198,12 @@ QString KoFilterChain::inputFile() } else if ( m_inputFile.isEmpty() ) - inputFileHelper( m_inputDocument, QString::null ); + inputFileHelper( m_inputDocument, TQString() ); return m_inputFile; } -QString KoFilterChain::outputFile() +TQString KoFilterChain::outputFile() { // sanity check: No embedded filter should ask for a plain file // ###### CHECK: This will break as soon as we support exporting embedding filters @@ -214,7 +214,7 @@ QString KoFilterChain::outputFile() return m_outputFile; else if ( m_outputQueried != Nil ) { kdWarning( 30500 ) << "You already asked for some different destination." << endl; - return QString::null; + return TQString(); } m_outputQueried = File; @@ -231,7 +231,7 @@ QString KoFilterChain::outputFile() return m_outputFile; } -KoStoreDevice* KoFilterChain::storageFile( const QString& name, KoStore::Mode mode ) +KoStoreDevice* KoFilterChain::storageFile( const TQString& name, KoStore::Mode mode ) { // ###### CHECK: This works only for import filters. Do we want something like // that for export filters too? @@ -308,7 +308,7 @@ KoDocument* KoFilterChain::outputDocument() void KoFilterChain::dump() const { kdDebug( 30500 ) << "########## KoFilterChain with " << m_chainLinks.count() << " members:" << endl; - QPtrListIterator it( m_chainLinks ); + TQPtrListIterator it( m_chainLinks ); for ( ; it.current(); ++it ) it.current()->dump(); kdDebug( 30500 ) << "########## KoFilterChain (done) ##########" << endl; @@ -324,17 +324,17 @@ KoFilterChain::KoFilterChain( const KoFilterManager* manager ) : m_chainLinks.setAutoDelete( true ); } -void KoFilterChain::appendChainLink( KoFilterEntry::Ptr filterEntry, const QCString& from, const QCString& to ) +void KoFilterChain::appendChainLink( KoFilterEntry::Ptr filterEntry, const TQCString& from, const TQCString& to ) { m_chainLinks.append( new ChainLink( this, filterEntry, from, to ) ); } -void KoFilterChain::prependChainLink( KoFilterEntry::Ptr filterEntry, const QCString& from, const QCString& to ) +void KoFilterChain::prependChainLink( KoFilterEntry::Ptr filterEntry, const TQCString& from, const TQCString& to ) { m_chainLinks.prepend( new ChainLink( this, filterEntry, from, to ) ); } -void KoFilterChain::enterDirectory( const QString& directory ) +void KoFilterChain::enterDirectory( const TQString& directory ) { // Only a little bit of checking as we (have to :} ) trust KoEmbeddingFilter // If the output storage isn't initialized yet, we perform that step(s) on init. @@ -351,12 +351,12 @@ void KoFilterChain::leaveDirectory() m_internalEmbeddingDirectories.pop_back(); } -QString KoFilterChain::filterManagerImportFile() const +TQString KoFilterChain::filterManagerImportFile() const { return m_manager->importFile(); } -QString KoFilterChain::filterManagerExportFile() const +TQString KoFilterChain::filterManagerExportFile() const { return m_manager->exportFile(); } @@ -373,7 +373,7 @@ int KoFilterChain::filterManagerDirection() const KoFilterChain* const KoFilterChain::filterManagerParentChain() const { - return m_manager->parentChain(); + return m_manager->tqparentChain(); } void KoFilterChain::manageIO() @@ -393,11 +393,11 @@ void KoFilterChain::manageIO() delete m_inputTempFile; // autodelete m_inputTempFile = 0; } - m_inputFile = QString::null; + m_inputFile = TQString(); if ( !m_outputFile.isEmpty() ) { m_inputFile = m_outputFile; - m_outputFile = QString::null; + m_outputFile = TQString(); m_inputTempFile = m_outputTempFile; m_outputTempFile = 0; @@ -406,7 +406,7 @@ void KoFilterChain::manageIO() if ( m_outputStorage ) { m_outputStorage->close(); // Don't delete the storage if we're just pointing to the - // storage of the parent filter chain + // storage of the tqparent filter chain if ( !filterManagerParentChain() || m_outputStorage->mode() != KoStore::Write ) delete m_outputStorage; m_outputStorage = 0; @@ -444,19 +444,19 @@ bool KoFilterChain::createTempFile( KTempFile** tempFile, bool autoDelete ) return ( *tempFile )->status() == 0; } -void KoFilterChain::inputFileHelper( KoDocument* document, const QString& alternativeFile ) +void KoFilterChain::inputFileHelper( KoDocument* document, const TQString& alternativeFile ) { if ( document ) { if ( !createTempFile( &m_inputTempFile ) ) { delete m_inputTempFile; m_inputTempFile = 0; - m_inputFile = QString::null; + m_inputFile = TQString(); return; } if ( !document->saveNativeFormat( m_inputTempFile->name() ) ) { delete m_inputTempFile; m_inputTempFile = 0; - m_inputFile = QString::null; + m_inputFile = TQString(); return; } m_inputFile = m_inputTempFile->name(); @@ -470,14 +470,14 @@ void KoFilterChain::outputFileHelper( bool autoDelete ) if ( !createTempFile( &m_outputTempFile, autoDelete ) ) { delete m_outputTempFile; m_outputTempFile = 0; - m_outputFile = QString::null; + m_outputFile = TQString(); } else m_outputFile = m_outputTempFile->name(); } KoStoreDevice* KoFilterChain::storageNewStreamHelper( KoStore** storage, KoStoreDevice** device, - const QString& name ) + const TQString& name ) { delete *device; *device = 0; @@ -492,7 +492,7 @@ KoStoreDevice* KoFilterChain::storageNewStreamHelper( KoStore** storage, KoStore return *device; } -KoStoreDevice* KoFilterChain::storageHelper( const QString& file, const QString& streamName, +KoStoreDevice* KoFilterChain::storageHelper( const TQString& file, const TQString& streamName, KoStore::Mode mode, KoStore** storage, KoStoreDevice** device ) { @@ -519,9 +519,9 @@ KoStoreDevice* KoFilterChain::storageHelper( const QString& file, const QString& return storageCreateFirstStream( streamName, storage, device ); } -void KoFilterChain::storageInit( const QString& file, KoStore::Mode mode, KoStore** storage ) +void KoFilterChain::storageInit( const TQString& file, KoStore::Mode mode, KoStore** storage ) { - QCString appIdentification( "" ); + TQCString appIdentification( "" ); if ( mode == KoStore::Write ) { // To create valid storages we also have to add the mimetype // magic "applicationIndentifier" to the storage. @@ -534,7 +534,7 @@ void KoFilterChain::storageInit( const QString& file, KoStore::Mode mode, KoStor *storage = KoStore::createStore( file, mode, appIdentification ); } -KoStoreDevice* KoFilterChain::storageInitEmbedding( const QString& name ) +KoStoreDevice* KoFilterChain::storageInitEmbedding( const TQString& name ) { if ( m_outputStorage ) { kdWarning( 30500 ) << "Ooops! Something's really screwed here." << endl; @@ -544,7 +544,7 @@ KoStoreDevice* KoFilterChain::storageInitEmbedding( const QString& name ) m_outputStorage = filterManagerParentChain()->m_outputStorage; if ( !m_outputStorage ) { - // If the storage of the parent hasn't been initialized yet, + // If the storage of the tqparent hasn't been initialized yet, // we have to do that here. Quite nasty... storageInit( filterManagerParentChain()->outputFile(), KoStore::Write, &m_outputStorage ); @@ -568,21 +568,21 @@ KoStoreDevice* KoFilterChain::storageInitEmbedding( const QString& name ) return storageCleanupHelper( &m_outputStorage ); } - if ( !m_outputStorage->enterDirectory( QString( "part%1" ).arg( lruPartIndex ) ) ) + if ( !m_outputStorage->enterDirectory( TQString( "part%1" ).tqarg( lruPartIndex ) ) ) return storageCleanupHelper( &m_outputStorage ); return storageCreateFirstStream( name, &m_outputStorage, &m_outputStorageDevice ); } -KoStoreDevice* KoFilterChain::storageCreateFirstStream( const QString& streamName, KoStore** storage, +KoStoreDevice* KoFilterChain::storageCreateFirstStream( const TQString& streamName, KoStore** storage, KoStoreDevice** device ) { // Before we go and create the first stream in this storage we // have to perform a little hack in case we're used by any ole-style // filter which utilizes internal embedding. Ugly, but well... if ( !m_internalEmbeddingDirectories.isEmpty() ) { - QStringList::ConstIterator it = m_internalEmbeddingDirectories.begin(); - QStringList::ConstIterator end = m_internalEmbeddingDirectories.end(); + TQStringList::ConstIterator it = m_internalEmbeddingDirectories.begin(); + TQStringList::ConstIterator end = m_internalEmbeddingDirectories.end(); for ( ; it != end && ( *storage )->enterDirectory( *it ); ++it ); } @@ -600,7 +600,7 @@ KoStoreDevice* KoFilterChain::storageCreateFirstStream( const QString& streamNam KoStoreDevice* KoFilterChain::storageCleanupHelper( KoStore** storage ) { - // Take care not to delete the storage of the parent chain + // Take care not to delete the storage of the tqparent chain if ( *storage != m_outputStorage || !filterManagerParentChain() || ( *storage )->mode() != KoStore::Write ) delete *storage; @@ -608,7 +608,7 @@ KoStoreDevice* KoFilterChain::storageCleanupHelper( KoStore** storage ) return 0; } -KoDocument* KoFilterChain::createDocument( const QString& file ) +KoDocument* KoFilterChain::createDocument( const TQString& file ) { KURL url; url.setPath( file ); @@ -618,7 +618,7 @@ KoDocument* KoFilterChain::createDocument( const QString& file ) return 0; } - KoDocument *doc = createDocument( QCString( t->name().latin1() ) ); + KoDocument *doc = createDocument( TQCString( t->name().latin1() ) ); if ( !doc || !doc->loadNativeFormat( file ) ) { kdError( 30500 ) << "Couldn't load from the file" << endl; @@ -628,7 +628,7 @@ KoDocument* KoFilterChain::createDocument( const QString& file ) return doc; } -KoDocument* KoFilterChain::createDocument( const QCString& mimeType ) +KoDocument* KoFilterChain::createDocument( const TQCString& mimeType ) { KoDocumentEntry entry = KoDocumentEntry::queryByMimeType(mimeType); @@ -663,7 +663,7 @@ namespace KOffice { } } - void Edge::dump( const QCString& indent ) const + void Edge::dump( const TQCString& indent ) const { if ( m_vertex ) kdDebug( 30500 ) << indent << "Edge -> '" << m_vertex->mimeType() @@ -674,7 +674,7 @@ namespace KOffice { } - Vertex::Vertex( const QCString& mimeType ) : m_predecessor( 0 ), m_mimeType( mimeType ), + Vertex::Vertex( const TQCString& mimeType ) : m_predecessor( 0 ), m_mimeType( mimeType ), m_weight( UINT_MAX ), m_index( -1 ), d( 0 ) { m_edges.setAutoDelete( true ); // we take ownership of added edges @@ -707,7 +707,7 @@ namespace KOffice { if ( !vertex ) return 0; const Edge* edge = 0; - QPtrListIterator it( m_edges ); + TQPtrListIterator it( m_edges ); for ( ; it.current(); ++it ) { if ( it.current()->vertex() == vertex && @@ -723,17 +723,17 @@ namespace KOffice { e->relax( this, queue ); } - void Vertex::dump( const QCString& indent ) const + void Vertex::dump( const TQCString& indent ) const { kdDebug( 30500 ) << indent << "Vertex: " << m_mimeType << " (" << m_weight << "):" << endl; - const QCString i( indent + " " ); - QPtrListIterator it( m_edges ); + const TQCString i( indent + " " ); + TQPtrListIterator it( m_edges ); for ( ; it.current(); ++it ) it.current()->dump( i ); } - Graph::Graph( const QCString& from ) : m_vertices( 47 ), m_from( from ), + Graph::Graph( const TQCString& from ) : m_vertices( 47 ), m_from( from ), m_graphValid( false ), d( 0 ) { m_vertices.setAutoDelete( true ); @@ -741,7 +741,7 @@ namespace KOffice { shortestPaths(); // Will return after a single lookup if "from" is invalid (->no check here) } - void Graph::setSourceMimeType( const QCString& from ) + void Graph::setSourceMimeType( const TQCString& from ) { if ( from == m_from ) return; @@ -749,7 +749,7 @@ namespace KOffice { m_graphValid = false; // Initialize with "infinity" ... - QAsciiDictIterator it( m_vertices ); + TQAsciiDictIterator it( m_vertices ); for ( ; it.current(); ++it ) it.current()->reset(); @@ -757,7 +757,7 @@ namespace KOffice { shortestPaths(); } - KoFilterChain::Ptr Graph::chain( const KoFilterManager* manager, QCString& to ) const + KoFilterChain::Ptr Graph::chain( const KoFilterManager* manager, TQCString& to ) const { if ( !isValid() || !manager ) return 0; @@ -790,7 +790,7 @@ namespace KOffice { { kdDebug( 30500 ) << "+++++++++ Graph::dump +++++++++" << endl; kdDebug( 30500 ) << "From: " << m_from << endl; - QAsciiDictIterator it( m_vertices ); + TQAsciiDictIterator it( m_vertices ); for ( ; it.current(); ++it ) it.current()->dump( " " ); kdDebug( 30500 ) << "+++++++++ Graph::dump (done) +++++++++" << endl; @@ -801,31 +801,31 @@ namespace KOffice { void Graph::buildGraph() { // Make sure that all available parts are added to the graph - QValueList parts( KoDocumentEntry::query() ); - QValueList::ConstIterator partIt( parts.begin() ); - QValueList::ConstIterator partEnd( parts.end() ); + TQValueList parts( KoDocumentEntry::query() ); + TQValueList::ConstIterator partIt( parts.begin() ); + TQValueList::ConstIterator partEnd( parts.end() ); while ( partIt != partEnd ) { - QStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); + TQStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); nativeMimeTypes += ( *partIt ).service()->property( "X-KDE-NativeMimeType" ).toString(); - QStringList::ConstIterator it = nativeMimeTypes.begin(); - QStringList::ConstIterator end = nativeMimeTypes.end(); + TQStringList::ConstIterator it = nativeMimeTypes.begin(); + TQStringList::ConstIterator end = nativeMimeTypes.end(); for ( ; it != end; ++it ) if ( !(*it).isEmpty() ) m_vertices.insert( (*it).latin1(), new Vertex( (*it).latin1() ) ); ++partIt; } - QValueList filters( KoFilterEntry::query() ); // no constraint here - we want *all* :) - QValueList::ConstIterator it = filters.begin(); - QValueList::ConstIterator end = filters.end(); + TQValueList filters( KoFilterEntry::query() ); // no constraint here - we want *all* :) + TQValueList::ConstIterator it = filters.begin(); + TQValueList::ConstIterator end = filters.end(); for ( ; it != end; ++it ) { // First add the "starting points" to the dict - QStringList::ConstIterator importIt = ( *it )->import.begin(); - QStringList::ConstIterator importEnd = ( *it )->import.end(); + TQStringList::ConstIterator importIt = ( *it )->import.begin(); + TQStringList::ConstIterator importEnd = ( *it )->import.end(); for ( ; importIt != importEnd; ++importIt ) { - const QCString key = ( *importIt ).latin1(); // latin1 is okay here (werner) + const TQCString key = ( *importIt ).latin1(); // latin1 is okay here (werner) // already there? if ( !m_vertices[ key ] ) m_vertices.insert( key, new Vertex( key ) ); @@ -833,12 +833,12 @@ namespace KOffice { // Are we allowed to use this filter at all? if ( KoFilterManager::filterAvailable( *it ) ) { - QStringList::ConstIterator exportIt = ( *it )->export_.begin(); - QStringList::ConstIterator exportEnd = ( *it )->export_.end(); + TQStringList::ConstIterator exportIt = ( *it )->export_.begin(); + TQStringList::ConstIterator exportEnd = ( *it )->export_.end(); for ( ; exportIt != exportEnd; ++exportIt ) { // First make sure the export vertex is in place - const QCString key = ( *exportIt ).latin1(); // latin1 is okay here + const TQCString key = ( *exportIt ).latin1(); // latin1 is okay here Vertex* exp = m_vertices[ key ]; if ( !exp ) { exp = new Vertex( key ); @@ -886,21 +886,21 @@ namespace KOffice { m_graphValid = true; } - QCString Graph::findKOfficePart() const + TQCString Graph::findKOfficePart() const { // Here we simply try to find the closest KOffice mimetype - QValueList parts( KoDocumentEntry::query() ); - QValueList::ConstIterator partIt( parts.begin() ); - QValueList::ConstIterator partEnd( parts.end() ); + TQValueList parts( KoDocumentEntry::query() ); + TQValueList::ConstIterator partIt( parts.begin() ); + TQValueList::ConstIterator partEnd( parts.end() ); const Vertex *v = 0; // Be sure that v gets initialized correctly while ( !v && partIt != partEnd ) { - QStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); + TQStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); nativeMimeTypes += ( *partIt ).service()->property( "X-KDE-NativeMimeType" ).toString(); - QStringList::ConstIterator it = nativeMimeTypes.begin(); - QStringList::ConstIterator end = nativeMimeTypes.end(); + TQStringList::ConstIterator it = nativeMimeTypes.begin(); + TQStringList::ConstIterator end = nativeMimeTypes.end(); for ( ; !v && it != end; ++it ) if ( !(*it).isEmpty() ) v = m_vertices[ ( *it ).latin1() ]; @@ -911,12 +911,12 @@ namespace KOffice { // Now we try to find the "cheapest" KOffice vertex while ( partIt != partEnd ) { - QStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); + TQStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); nativeMimeTypes += ( *partIt ).service()->property( "X-KDE-NativeMimeType" ).toString(); - QStringList::ConstIterator it = nativeMimeTypes.begin(); - QStringList::ConstIterator end = nativeMimeTypes.end(); + TQStringList::ConstIterator it = nativeMimeTypes.begin(); + TQStringList::ConstIterator end = nativeMimeTypes.end(); for ( ; !v && it != end; ++it ) { - QString key = *it; + TQString key = *it; if ( !key.isEmpty() ) { Vertex* tmp = m_vertices[ key.latin1() ]; if ( !v || ( tmp && tmp->key() < v->key() ) ) diff --git a/lib/kofficecore/KoFilterChain.h b/lib/kofficecore/KoFilterChain.h index 5b8dd3dde..2936ae409 100644 --- a/lib/kofficecore/KoFilterChain.h +++ b/lib/kofficecore/KoFilterChain.h @@ -19,10 +19,10 @@ #ifndef __koffice_filter_chain_h__ #define __koffice_filter_chain_h__ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -32,7 +32,7 @@ class KTempFile; class KoFilterManager; class KoDocument; -class QStrList; +class TQStrList; namespace KOffice { class Graph; @@ -69,25 +69,25 @@ public: * @return The return status of the conversion. KoFilter::OK * if everything is alright. */ - KoFilter::ConversionStatus invokeChain(); + KoFilter::ConversiontqStatus invokeChain(); /** * Tells the @ref KoFilterManager the output file of the * filter chain in case of an import operation. If it's - * QString::null we directly manipulated the document. + * TQString() we directly manipulated the document. */ - QString chainOutput() const; + TQString chainOutput() const; /** * Get the current file to read from. This part of the API * is for the filters in our chain. */ - QString inputFile(); + TQString inputFile(); /** * Get the current file to write to. This part of the API * is for the filters in our chain. */ - QString outputFile(); + TQString outputFile(); /** * Get a file from a storage. May return 0! @@ -99,7 +99,7 @@ public: * @param mode Whether we want to read or write from/to the stream * @return The storage device to access the stream. May be 0! */ - KoStoreDevice* storageFile( const QString& name = "root", KoStore::Mode mode = KoStore::Read ); + KoStoreDevice* storageFile( const TQString& name = "root", KoStore::Mode mode = KoStore::Read ); /** * This method allows your filter to work directly on the @@ -123,27 +123,27 @@ public: private: // ### API for KOffice::Graph: // Construct a filter chain belonging to some KoFilterManager. - // The parent filter manager may be 0. + // The tqparent filter manager may be 0. KoFilterChain( const KoFilterManager* manager ); - void appendChainLink( KoFilterEntry::Ptr filterEntry, const QCString& from, const QCString& to ); - void prependChainLink( KoFilterEntry::Ptr filterEntry, const QCString& from, const QCString& to ); + void appendChainLink( KoFilterEntry::Ptr filterEntry, const TQCString& from, const TQCString& to ); + void prependChainLink( KoFilterEntry::Ptr filterEntry, const TQCString& from, const TQCString& to ); // ### API for KoEmbeddingFilter // This is needed as the embedding filter might have to influence // the way we change directories (e.g. in the olefilter case) // The ugly friend methods are needed, but I'd welcome and suggestions for // better design :} - friend void KoEmbeddingFilter::filterChainEnterDirectory( const QString& directory ) const; - void enterDirectory( const QString& directory ); + friend void KoEmbeddingFilter::filterChainEnterDirectory( const TQString& directory ) const; + void enterDirectory( const TQString& directory ); friend void KoEmbeddingFilter::filterChainLeaveDirectory() const; void leaveDirectory(); // These methods are friends of KoFilterManager and provide access // to a private part of its API. As I don't want to include // koFilterManager.h in this header the direction is "int" here. - QString filterManagerImportFile() const; - QString filterManagerExportFile() const; + TQString filterManagerImportFile() const; + TQString filterManagerExportFile() const; KoDocument* filterManagerKoDocument() const; int filterManagerDirection() const; KoFilterChain* const filterManagerParentChain() const; @@ -157,18 +157,18 @@ private: bool createTempFile( KTempFile** tempFile, bool autoDelete = true ); - void inputFileHelper( KoDocument* document, const QString& alternativeFile ); + void inputFileHelper( KoDocument* document, const TQString& alternativeFile ); void outputFileHelper( bool autoDelete ); - KoStoreDevice* storageNewStreamHelper( KoStore** storage, KoStoreDevice** device, const QString& name ); - KoStoreDevice* storageHelper( const QString& file, const QString& streamName, + KoStoreDevice* storageNewStreamHelper( KoStore** storage, KoStoreDevice** device, const TQString& name ); + KoStoreDevice* storageHelper( const TQString& file, const TQString& streamName, KoStore::Mode mode, KoStore** storage, KoStoreDevice** device ); - void storageInit( const QString& file, KoStore::Mode mode, KoStore** storage ); - KoStoreDevice* storageInitEmbedding( const QString& name ); - KoStoreDevice* storageCreateFirstStream( const QString& streamName, KoStore** storage, KoStoreDevice** device ); + void storageInit( const TQString& file, KoStore::Mode mode, KoStore** storage ); + KoStoreDevice* storageInitEmbedding( const TQString& name ); + KoStoreDevice* storageCreateFirstStream( const TQString& streamName, KoStore** storage, KoStoreDevice** device ); KoStoreDevice* storageCleanupHelper( KoStore** storage ); - KoDocument* createDocument( const QString& file ); - KoDocument* createDocument( const QCString& mimeType ); + KoDocument* createDocument( const TQString& file ); + KoDocument* createDocument( const TQCString& mimeType ); /** * A small private helper class with represents one single filter @@ -180,12 +180,12 @@ private: public: ChainLink( KoFilterChain* chain, KoFilterEntry::Ptr filterEntry, - const QCString& from, const QCString& to ); + const TQCString& from, const TQCString& to ); - KoFilter::ConversionStatus invokeFilter( const ChainLink* const parentChainLink ); + KoFilter::ConversiontqStatus invokeFilter( const ChainLink* const tqparentChainLink ); - QCString from() const { return m_from; } - QCString to() const { return m_to; } + TQCString from() const { return m_from; } + TQCString to() const { return m_to; } // debugging void dump() const; @@ -198,13 +198,13 @@ private: ChainLink( const ChainLink& rhs ); ChainLink& operator=( const ChainLink& rhs ); - void setupCommunication( const KoFilter* const parentFilter ) const; - void setupConnections( const KoFilter* sender, const QStrList& sigs, - const KoFilter* receiver, const QStrList& sl0ts ) const; + void setupCommunication( const KoFilter* const tqparentFilter ) const; + void setupConnections( const KoFilter* sender, const TQStrList& sigs, + const KoFilter* receiver, const TQStrList& sl0ts ) const; KoFilterChain* m_chain; KoFilterEntry::Ptr m_filterEntry; - QCString m_from, m_to; + TQCString m_from, m_to; // This hack is only needed due to crappy Microsoft design and // circular dependencies in their embedded files :} @@ -223,13 +223,13 @@ private: KoFilterChain& operator=( const KoFilterChain& rhs ); const KoFilterManager* const m_manager; - QPtrList m_chainLinks; + TQPtrList m_chainLinks; // stuff needed for bookkeeping int m_state; - QString m_inputFile; // Did we pass around plain files? - QString m_outputFile; + TQString m_inputFile; // Did we pass around plain files? + TQString m_outputFile; KoStore* m_inputStorage; // ...or was it a storage+device? KoStoreDevice* m_inputStorageDevice; @@ -252,7 +252,7 @@ private: // as a kind of "memory" even if we didn't initialize the store yet. // I know that it's ugly, and I'll try to clean up that hack // sooner or later (Werner) - QStringList m_internalEmbeddingDirectories; + TQStringList m_internalEmbeddingDirectories; class Private; Private* d; @@ -289,7 +289,7 @@ namespace KOffice void relax( const Vertex* predecessor, PriorityQueue& queue ); // debugging - void dump( const QCString& indent ) const; + void dump( const TQCString& indent ) const; private: Edge( const Edge& rhs ); @@ -311,10 +311,10 @@ namespace KOffice { public: - Vertex( const QCString& mimeType ); + Vertex( const TQCString& mimeType ); ~Vertex() {} - QCString mimeType() const { return m_mimeType; } + TQCString mimeType() const { return m_mimeType; } // Current "weight" of the vertex - will be "relaxed" when // running the shortest path algorithm. Returns true if it @@ -345,15 +345,15 @@ namespace KOffice void relaxVertices( PriorityQueue& queue ); // debugging - void dump( const QCString& indent ) const; + void dump( const TQCString& indent ) const; private: Vertex( const Vertex& rhs ); Vertex& operator=( const Vertex& rhs ); - QPtrList m_edges; + TQPtrList m_edges; const Vertex* m_predecessor; - QCString m_mimeType; + TQCString m_mimeType; unsigned int m_weight; // "key" inside the queue int m_index; // position inside the queue, needed for a fast keyDecreased() @@ -371,20 +371,20 @@ namespace KOffice { public: - Graph( const QCString& from ); + Graph( const TQCString& from ); ~Graph() {} bool isValid() const { return m_graphValid; } - QCString sourceMimeType() const { return m_from; } - void setSourceMimeType( const QCString& from ); + TQCString sourceMimeType() const { return m_from; } + void setSourceMimeType( const TQCString& from ); // Creates a chain from "from" to the "to" mimetype // If the "to" mimetype isEmpty() then we try to find the // closest KOffice mimetype and use that as destination. // After such a search "to" will contain the dest. mimetype (return value) // if the search was successful. Might return 0! - KoFilterChain::Ptr chain( const KoFilterManager* manager, QCString& to ) const; + KoFilterChain::Ptr chain( const KoFilterManager* manager, TQCString& to ) const; // debugging void dump() const; @@ -395,10 +395,10 @@ namespace KOffice void buildGraph(); void shortestPaths(); - QCString findKOfficePart() const; + TQCString findKOfficePart() const; - QAsciiDict m_vertices; - QCString m_from; + TQAsciiDict m_vertices; + TQCString m_from; bool m_graphValid; class Private; diff --git a/lib/kofficecore/KoFilterManager.cpp b/lib/kofficecore/KoFilterManager.cpp index f3db5c735..46c20c2fc 100644 --- a/lib/kofficecore/KoFilterManager.cpp +++ b/lib/kofficecore/KoFilterManager.cpp @@ -23,11 +23,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -48,27 +48,27 @@ public: }; -KoFilterChooser::KoFilterChooser (QWidget *parent, const QStringList &mimeTypes, const QString &nativeFormat) - : KDialogBase (parent, "kofilterchooser", true, i18n ("Choose Filter"), +KoFilterChooser::KoFilterChooser (TQWidget *tqparent, const TQStringList &mimeTypes, const TQString &nativeFormat) + : KDialogBase (tqparent, "kofilterchooser", true, i18n ("Choose Filter"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, true), m_mimeTypes (mimeTypes) { - setInitialSize (QSize (300, 350)); + setInitialSize (TQSize (300, 350)); - QWidget *page = new QWidget (this); + TQWidget *page = new TQWidget (this); setMainWidget (page); // looks too squashed together without * 2 - QVBoxLayout *layout = new QVBoxLayout (page, marginHint (), spacingHint () * 2); + TQVBoxLayout *tqlayout = new TQVBoxLayout (page, marginHint (), spacingHint () * 2); - QLabel *filterLabel = new QLabel (i18n ("Select a filter:"), page, "filterlabel"); - layout->addWidget (filterLabel); + TQLabel *filterLabel = new TQLabel (i18n ("Select a filter:"), page, "filterlabel"); + tqlayout->addWidget (filterLabel); m_filterList = new KListBox (page, "filterlist"); - layout->addWidget (m_filterList); + tqlayout->addWidget (m_filterList); Q_ASSERT (!m_mimeTypes.isEmpty ()); - for (QStringList::ConstIterator it = m_mimeTypes.begin (); + for (TQStringList::ConstIterator it = m_mimeTypes.begin (); it != m_mimeTypes.end (); it++) { @@ -78,7 +78,7 @@ KoFilterChooser::KoFilterChooser (QWidget *parent, const QStringList &mimeTypes, if (nativeFormat == "application/x-kword") { - const int index = m_mimeTypes.findIndex ("text/plain"); + const int index = m_mimeTypes.tqfindIndex ("text/plain"); if (index > -1) m_filterList->setCurrentItem (index); } @@ -89,26 +89,26 @@ KoFilterChooser::KoFilterChooser (QWidget *parent, const QStringList &mimeTypes, m_filterList->centerCurrentItem (); m_filterList->setFocus (); - connect (m_filterList, SIGNAL (selected (int)), this, SLOT (slotOk ())); + connect (m_filterList, TQT_SIGNAL (selected (int)), this, TQT_SLOT (slotOk ())); } KoFilterChooser::~KoFilterChooser () { } -QString KoFilterChooser::filterSelected () +TQString KoFilterChooser::filterSelected () { const int item = m_filterList->currentItem (); if (item > -1) return m_mimeTypes [item]; else - return QString::null; + return TQString(); } // static cache for filter availability -QMap KoFilterManager::m_filterAvailable; +TQMap KoFilterManager::m_filterAvailable; const int KoFilterManager::s_area = 30500; @@ -119,14 +119,14 @@ KoFilterManager::KoFilterManager( KoDocument* document ) : d = new KoFilterManager::Private; d -> m_batch = false; if ( document ) - QObject::connect( this, SIGNAL( sigProgress( int ) ), - document, SIGNAL( sigProgress( int ) ) ); + TQObject::connect( this, TQT_SIGNAL( sigProgress( int ) ), + document, TQT_SIGNAL( sigProgress( int ) ) ); } -KoFilterManager::KoFilterManager( const QString& url, const QCString& mimetypeHint, - KoFilterChain* const parentChain ) : - m_document( 0 ), m_parentChain( parentChain ), m_importUrl( url ), m_importUrlMimetypeHint( mimetypeHint ), +KoFilterManager::KoFilterManager( const TQString& url, const TQCString& mimetypeHint, + KoFilterChain* const tqparentChain ) : + m_document( 0 ), m_parentChain( tqparentChain ), m_importUrl( url ), m_importUrlMimetypeHint( mimetypeHint ), m_graph( "" ), d( 0 ) { d = new KoFilterManager::Private; @@ -138,7 +138,7 @@ KoFilterManager::~KoFilterManager() delete d; } -QString KoFilterManager::import( const QString& url, KoFilter::ConversionStatus& status ) +TQString KoFilterManager::import( const TQString& url, KoFilter::ConversiontqStatus& status ) { // Find the mime type for the file to be imported. KURL u; @@ -155,22 +155,22 @@ QString KoFilterManager::import( const QString& url, KoFilter::ConversionStatus& if ( !m_document->isAutoErrorHandlingEnabled() ) { status = KoFilter::BadConversionGraph; - return QString::null; + return TQString(); } - QCString nativeFormat = m_document->nativeFormatMimeType (); + TQCString nativeFormat = m_document->nativeFormatMimeType (); - QApplication::setOverrideCursor( arrowCursor ); + TQApplication::setOverrideCursor( arrowCursor ); KoFilterChooser chooser(0, KoFilterManager::mimeFilter (nativeFormat, KoFilterManager::Import, m_document->extraNativeMimeTypes()), nativeFormat); if (chooser.exec ()) { - QCString f = chooser.filterSelected ().latin1(); + TQCString f = chooser.filterSelected ().latin1(); if (f == nativeFormat) { status = KoFilter::OK; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return url; } @@ -178,7 +178,7 @@ QString KoFilterManager::import( const QString& url, KoFilter::ConversionStatus& } else userCancelled = true; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } if (!m_graph.isValid()) @@ -187,15 +187,15 @@ QString KoFilterManager::import( const QString& url, KoFilter::ConversionStatus& << t->name() << endl; importErrorHelper( t->name(), userCancelled ); status = KoFilter::BadConversionGraph; - return QString::null; + return TQString(); } } KoFilterChain::Ptr chain( 0 ); // Are we owned by a KoDocument? if ( m_document ) { - QCString mimeType = m_document->nativeFormatMimeType(); - QStringList extraMimes = m_document->extraNativeMimeTypes(); + TQCString mimeType = m_document->nativeFormatMimeType(); + TQStringList extraMimes = m_document->extraNativeMimeTypes(); int i=0, n = extraMimes.count(); chain = m_graph.chain( this, mimeType ); while( !chain && iname() ); status = KoFilter::BadConversionGraph; - return QString::null; + return TQString(); } // Okay, let's invoke the filters one after the other m_direction = Import; // vital information! m_importUrl = url; // We want to load that file - m_exportUrl = QString::null; // This is null for sure, as embedded stuff isn't + m_exportUrl = TQString(); // This is null for sure, as embedded stuff isn't // allowed to use that method status = chain->invokeChain(); - m_importUrl = QString::null; // Reset the import URL + m_importUrl = TQString(); // Reset the import URL if ( status == KoFilter::OK ) return chain->chainOutput(); - return QString::null; + return TQString(); } -KoFilter::ConversionStatus KoFilterManager::exp0rt( const QString& url, QCString& mimeType ) +KoFilter::ConversiontqStatus KoFilterManager::exp0rt( const TQString& url, TQCString& mimeType ) { bool userCancelled = false; @@ -243,11 +243,11 @@ KoFilter::ConversionStatus KoFilterManager::exp0rt( const QString& url, QCString KoFilterChain::Ptr chain = 0; if ( m_document ) { // We have to pick the right native mimetype as source. - QStringList nativeMimeTypes; + TQStringList nativeMimeTypes; nativeMimeTypes.append( m_document->nativeFormatMimeType() ); nativeMimeTypes += m_document->extraNativeMimeTypes(); - QStringList::ConstIterator it = nativeMimeTypes.begin(); - const QStringList::ConstIterator end = nativeMimeTypes.end(); + TQStringList::ConstIterator it = nativeMimeTypes.begin(); + const TQStringList::ConstIterator end = nativeMimeTypes.end(); for ( ; !chain && it != end; ++it ) { m_graph.setSourceMimeType( (*it).latin1() ); @@ -272,14 +272,14 @@ KoFilter::ConversionStatus KoFilterManager::exp0rt( const QString& url, QCString if ( !m_graph.isValid() ) { kdWarning(s_area) << "Can't open " << t->name () << ", trying filter chooser" << endl; - QApplication::setOverrideCursor( arrowCursor ); + TQApplication::setOverrideCursor( arrowCursor ); KoFilterChooser chooser(0, KoFilterManager::mimeFilter ()); if (chooser.exec ()) m_graph.setSourceMimeType (chooser.filterSelected ().latin1 ()); else userCancelled = true; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } } @@ -308,28 +308,28 @@ namespace // in order not to mess with the global namespace ;) class Vertex { public: - Vertex( const QCString& mimeType ) : m_color( White ), m_mimeType( mimeType ) {} + Vertex( const TQCString& mimeType ) : m_color( White ), m_mimeType( mimeType ) {} enum Color { White, Gray, Black }; Color color() const { return m_color; } void setColor( Color color ) { m_color = color; } - QCString mimeType() const { return m_mimeType; } + TQCString mimeType() const { return m_mimeType; } void addEdge( Vertex* vertex ) { if ( vertex ) m_edges.append( vertex ); } - QPtrList edges() const { return m_edges; } + TQPtrList edges() const { return m_edges; } private: Color m_color; - QCString m_mimeType; - QPtrList m_edges; + TQCString m_mimeType; + TQPtrList m_edges; }; // Some helper methods for the static stuff // This method builds up the graph in the passed ascii dict - void buildGraph( QAsciiDict& vertices, KoFilterManager::Direction direction ) + void buildGraph( TQAsciiDict& vertices, KoFilterManager::Direction direction ) { - QStringList stopList; // Lists of mimetypes that are considered end of chains + TQStringList stopList; // Lists of mimetypes that are considered end of chains stopList << "text/plain"; stopList << "text/csv"; stopList << "text/x-tex"; @@ -339,38 +339,38 @@ namespace // in order not to mess with the global namespace ;) // partly copied from build graph, but I don't see any other // way without crude hacks, as we have to obey the direction here - QValueList parts( KoDocumentEntry::query(false, QString::null) ); - QValueList::ConstIterator partIt( parts.begin() ); - QValueList::ConstIterator partEnd( parts.end() ); + TQValueList parts( KoDocumentEntry::query(false, TQString()) ); + TQValueList::ConstIterator partIt( parts.begin() ); + TQValueList::ConstIterator partEnd( parts.end() ); while ( partIt != partEnd ) { - QStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); + TQStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); nativeMimeTypes += ( *partIt ).service()->property( "X-KDE-NativeMimeType" ).toString(); - QStringList::ConstIterator it = nativeMimeTypes.begin(); - const QStringList::ConstIterator end = nativeMimeTypes.end(); + TQStringList::ConstIterator it = nativeMimeTypes.begin(); + const TQStringList::ConstIterator end = nativeMimeTypes.end(); for ( ; it != end; ++it ) if ( !(*it).isEmpty() ) vertices.insert( (*it).latin1(), new Vertex( (*it).latin1() ) ); ++partIt; } - QValueList filters = KoFilterEntry::query(); // no constraint here - we want *all* :) - QValueList::ConstIterator it = filters.begin(); - const QValueList::ConstIterator end = filters.end(); + TQValueList filters = KoFilterEntry::query(); // no constraint here - we want *all* :) + TQValueList::ConstIterator it = filters.begin(); + const TQValueList::ConstIterator end = filters.end(); for ( ; it != end; ++it ) { - QStringList impList; // Import list - QStringList expList; // Export list + TQStringList impList; // Import list + TQStringList expList; // Export list - const QStringList::Iterator stopEnd = stopList.end(); + const TQStringList::Iterator stopEnd = stopList.end(); // Now we have to exclude the "stop" mimetypes (in the right direction!) if ( direction == KoFilterManager::Import ) { // Import: "stop" mime type should not appear in export - QStringList::ConstIterator testIt = ( *it )->export_.begin(); - QStringList::ConstIterator testEnd = ( *it )->export_.end(); + TQStringList::ConstIterator testIt = ( *it )->export_.begin(); + TQStringList::ConstIterator testEnd = ( *it )->export_.end(); for ( ; testIt != testEnd ; ++testIt ) { - if ( stopList.find( *testIt ) == stopEnd ) { + if ( stopList.tqfind( *testIt ) == stopEnd ) { expList.append( *testIt ); } } @@ -378,10 +378,10 @@ namespace // in order not to mess with the global namespace ;) } else { // Export: "stop" mime type should not appear in import - QStringList::ConstIterator testIt = ( *it )->import.begin(); - const QStringList::ConstIterator testEnd = ( *it )->import.end(); + TQStringList::ConstIterator testIt = ( *it )->import.begin(); + const TQStringList::ConstIterator testEnd = ( *it )->import.end(); for ( ; testIt != testEnd ; ++testIt ) { - if ( stopList.find( *testIt ) == stopEnd ) { + if ( stopList.tqfind( *testIt ) == stopEnd ) { impList.append( *testIt ); } } @@ -396,10 +396,10 @@ namespace // in order not to mess with the global namespace ;) } // First add the "starting points" to the dict - QStringList::ConstIterator importIt = impList.begin(); - const QStringList::ConstIterator importEnd = impList.end(); + TQStringList::ConstIterator importIt = impList.begin(); + const TQStringList::ConstIterator importEnd = impList.end(); for ( ; importIt != importEnd; ++importIt ) { - const QCString key = ( *importIt ).latin1(); // latin1 is okay here (werner) + const TQCString key = ( *importIt ).latin1(); // latin1 is okay here (werner) // already there? if ( !vertices[ key ] ) vertices.insert( key, new Vertex( key ) ); @@ -407,12 +407,12 @@ namespace // in order not to mess with the global namespace ;) // Are we allowed to use this filter at all? if ( KoFilterManager::filterAvailable( *it ) ) { - QStringList::ConstIterator exportIt = expList.begin(); - const QStringList::ConstIterator exportEnd = expList.end(); + TQStringList::ConstIterator exportIt = expList.begin(); + const TQStringList::ConstIterator exportEnd = expList.end(); for ( ; exportIt != exportEnd; ++exportIt ) { // First make sure the export vertex is in place - const QCString key = ( *exportIt ).latin1(); // latin1 is okay here + const TQCString key = ( *exportIt ).latin1(); // latin1 is okay here Vertex* exp = vertices[ key ]; if ( !exp ) { exp = new Vertex( key ); @@ -440,24 +440,24 @@ namespace // in order not to mess with the global namespace ;) // This method runs a BFS on the graph to determine the connected // nodes. Make sure that the graph is "cleared" (the colors of the // nodes are all white) - QStringList connected( const QAsciiDict& vertices, const QCString& mimetype ) + TQStringList connected( const TQAsciiDict& vertices, const TQCString& mimetype ) { if ( mimetype.isEmpty() ) - return QStringList(); + return TQStringList(); Vertex *v = vertices[ mimetype ]; if ( !v ) - return QStringList(); + return TQStringList(); v->setColor( Vertex::Gray ); std::queue queue; queue.push( v ); - QStringList connected; + TQStringList connected; while ( !queue.empty() ) { v = queue.front(); queue.pop(); - QPtrList edges = v->edges(); - QPtrListIterator it( edges ); + TQPtrList edges = v->edges(); + TQPtrListIterator it( edges ); for ( ; it.current(); ++it ) { if ( it.current()->color() == Vertex::White ) { it.current()->setColor( Vertex::Gray ); @@ -473,45 +473,45 @@ namespace // in order not to mess with the global namespace ;) // The static method to figure out to which parts of the // graph this mimetype has a connection to. -QStringList KoFilterManager::mimeFilter( const QCString& mimetype, Direction direction, const QStringList& extraNativeMimeTypes ) +TQStringList KoFilterManager::mimeFilter( const TQCString& mimetype, Direction direction, const TQStringList& extraNativeMimeTypes ) { //kdDebug(s_area) << "mimetype=" << mimetype << " extraNativeMimeTypes=" << extraNativeMimeTypes << endl; - QAsciiDict vertices; + TQAsciiDict vertices; buildGraph( vertices, direction ); // TODO maybe use the fake vertex trick from the method below, to make the search faster? - QStringList nativeMimeTypes; - nativeMimeTypes.append( QString::fromLatin1( mimetype ) ); + TQStringList nativeMimeTypes; + nativeMimeTypes.append( TQString::tqfromLatin1( mimetype ) ); nativeMimeTypes += extraNativeMimeTypes; // Add the native mimetypes first so that they are on top. - QStringList lst = nativeMimeTypes; + TQStringList lst = nativeMimeTypes; // Now look for filters which output each of those natives mimetypes - for( QStringList::ConstIterator natit = nativeMimeTypes.begin(); natit != nativeMimeTypes.end(); ++natit ) { - const QStringList outMimes = connected( vertices, (*natit).latin1() ); + for( TQStringList::ConstIterator natit = nativeMimeTypes.begin(); natit != nativeMimeTypes.end(); ++natit ) { + const TQStringList outMimes = connected( vertices, (*natit).latin1() ); //kdDebug(s_area) << k_funcinfo << "output formats connected to mime " << *natit << " : " << outMimes << endl; - for ( QStringList::ConstIterator mit = outMimes.begin(); mit != outMimes.end(); ++mit ) - if ( lst.find( *mit ) == lst.end() ) // append only if not there already. Qt4: QSet? + for ( TQStringList::ConstIterator mit = outMimes.begin(); mit != outMimes.end(); ++mit ) + if ( lst.tqfind( *mit ) == lst.end() ) // append only if not there already. TQt4: TQSet? lst.append( *mit ); } return lst; } -QStringList KoFilterManager::mimeFilter() +TQStringList KoFilterManager::mimeFilter() { - QAsciiDict vertices; + TQAsciiDict vertices; buildGraph( vertices, KoFilterManager::Import ); - QValueList parts( KoDocumentEntry::query(false, QString::null) ); - QValueList::ConstIterator partIt( parts.begin() ); - QValueList::ConstIterator partEnd( parts.end() ); + TQValueList parts( KoDocumentEntry::query(false, TQString()) ); + TQValueList::ConstIterator partIt( parts.begin() ); + TQValueList::ConstIterator partEnd( parts.end() ); if ( partIt == partEnd ) - return QStringList(); + return TQStringList(); - // To find *all* reachable mimetypes, we have to resort to + // To tqfind *all* reachable mimetypes, we have to resort to // a small hat trick, in order to avoid multiple searches: // We introduce a fake vertex, which is connected to every // single KOffice mimetype. Due to that one BFS is enough :) @@ -519,16 +519,16 @@ QStringList KoFilterManager::mimeFilter() Vertex *v = new Vertex( "supercalifragilistic/x-pialadocious" ); vertices.insert( "supercalifragilistic/x-pialadocious", v ); while ( partIt != partEnd ) { - QStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); + TQStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList(); nativeMimeTypes += ( *partIt ).service()->property( "X-KDE-NativeMimeType" ).toString(); - QStringList::ConstIterator it = nativeMimeTypes.begin(); - const QStringList::ConstIterator end = nativeMimeTypes.end(); + TQStringList::ConstIterator it = nativeMimeTypes.begin(); + const TQStringList::ConstIterator end = nativeMimeTypes.end(); for ( ; it != end; ++it ) if ( !(*it).isEmpty() ) v->addEdge( vertices[ (*it).latin1() ] ); ++partIt; } - QStringList result = connected( vertices, "supercalifragilistic/x-pialadocious" ); + TQStringList result = connected( vertices, "supercalifragilistic/x-pialadocious" ); // Finally we have to get rid of our fake mimetype again result.remove( "supercalifragilistic/x-pialadocious" ); @@ -546,14 +546,14 @@ bool KoFilterManager::filterAvailable( KoFilterEntry::Ptr entry ) //kdDebug( 30500 ) << "Checking whether " << entry->service()->name() << " applies." << endl; // generate some "unique" key - QString key( entry->service()->name() ); + TQString key( entry->service()->name() ); key += " - "; key += entry->service()->library(); - if ( !m_filterAvailable.contains( key ) ) { + if ( !m_filterAvailable.tqcontains( key ) ) { //kdDebug( 30500 ) << "Not cached, checking..." << endl; - KLibrary* library = KLibLoader::self()->library( QFile::encodeName( entry->service()->library() ) ); + KLibrary* library = KLibLoader::self()->library( TQFile::encodeName( entry->service()->library() ) ); if ( !library ) { kdWarning( 30500 ) << "Huh?? Couldn't load the lib: " << KLibLoader::self()->lastErrorMessage() << endl; @@ -562,7 +562,7 @@ bool KoFilterManager::filterAvailable( KoFilterEntry::Ptr entry ) } // This code is "borrowed" from klibloader ;) - QCString symname; + TQCString symname; symname.sprintf("check_%s", library->name().latin1() ); void* sym = library->symbol( symname ); if ( !sym ) @@ -581,9 +581,9 @@ bool KoFilterManager::filterAvailable( KoFilterEntry::Ptr entry ) return m_filterAvailable[ key ]; } -void KoFilterManager::importErrorHelper( const QString& mimeType, const bool suppressDialog ) +void KoFilterManager::importErrorHelper( const TQString& mimeType, const bool suppressDialog ) { - QString tmp = i18n("Could not import file of type\n%1").arg( mimeType ); + TQString tmp = i18n("Could not import file of type\n%1").tqarg( mimeType ); // ###### FIXME: use KLibLoader::lastErrorMessage() here if (!suppressDialog) KMessageBox::error( 0L, tmp, i18n("Missing Import Filter") ); } diff --git a/lib/kofficecore/KoFilterManager.h b/lib/kofficecore/KoFilterManager.h index 952c84753..8405f49bb 100644 --- a/lib/kofficecore/KoFilterManager.h +++ b/lib/kofficecore/KoFilterManager.h @@ -22,8 +22,8 @@ #ifndef __koffice_filter_manager_h__ #define __koffice_filter_manager_h__ -#include -#include +#include +#include #include #include class KoDocument; @@ -41,9 +41,10 @@ class KoDocument; * @author Torben Weis * @author Werner Trobin */ -class KOFFICECORE_EXPORT KoFilterManager : public QObject +class KOFFICECORE_EXPORT KoFilterManager : public TQObject { Q_OBJECT + TQ_OBJECT public: /** * This enum is used to distinguish the import/export cases @@ -65,11 +66,11 @@ public: * to specify this information only if the automatic detection will * fail because e.g. you saved an embedded stream to a *.tmp file. * Most likely you do not have to care about that. - * @param parentChain The parent filter chain of this filter manager. Used + * @param tqparentChain The tqparent filter chain of this filter manager. Used * to allow embedding for filters. Most likely you do not have to care. */ - KoFilterManager( const QString& url, const QCString& mimetypeHint = "", - KoFilterChain* const parentChain = 0 ); + KoFilterManager( const TQString& url, const TQCString& mimetypeHint = "", + KoFilterChain* const tqparentChain = 0 ); virtual ~KoFilterManager(); @@ -77,10 +78,10 @@ public: * Imports the passed URL and returns the resultant filename * (most likely some file in /tmp). * The @p status variable signals the success/error of the conversion - * If the QString which is returned isEmpty() and the status is OK, + * If the TQString which is returned isEmpty() and the status is OK, * then we imported the file directly into the document. */ - QString import( const QString& url, KoFilter::ConversionStatus& status ); + TQString import( const TQString& url, KoFilter::ConversiontqStatus& status ); /** * @brief Exports the given file/document to the specified URL/mimetype. * @@ -88,7 +89,7 @@ public: * and when the method returns @p mimeType contains this mimetype. * Oh, well, export is a C++ keyword ;) */ - KoFilter::ConversionStatus exp0rt( const QString& url, QCString& mimeType ); + KoFilter::ConversiontqStatus exp0rt( const TQString& url, TQCString& mimeType ); @@ -100,8 +101,8 @@ public: * information here. * Optionally, @p extraNativeMimeTypes are added after the native mimetype. */ - KOFFICECORE_EXPORT static QStringList mimeFilter( const QCString& mimetype, Direction direction, - const QStringList& extraNativeMimeTypes = QStringList() ); + KOFFICECORE_EXPORT static TQStringList mimeFilter( const TQCString& mimetype, Direction direction, + const TQStringList& extraNativeMimeTypes = TQStringList() ); /** * The same method as KoFilterManager::mimeFilter but suited for KoShell. @@ -110,7 +111,7 @@ public: * call this for importing. When saving from KoShell we already * know the KOffice part we are using. */ - static QStringList mimeFilter(); + static TQStringList mimeFilter(); /** * Method used to check if that filter is available at all. @@ -142,34 +143,34 @@ private: // The friend methods are private in KoFilterChain and // just forward calls to the methods here. Should be // pretty save. - friend QString KoFilterChain::filterManagerImportFile() const; - QString importFile() const { return m_importUrl; } - friend QString KoFilterChain::filterManagerExportFile() const; - QString exportFile() const { return m_exportUrl; } + friend TQString KoFilterChain::filterManagerImportFile() const; + TQString importFile() const { return m_importUrl; } + friend TQString KoFilterChain::filterManagerExportFile() const; + TQString exportFile() const { return m_exportUrl; } friend KoDocument* KoFilterChain::filterManagerKoDocument() const; KoDocument* document() const { return m_document; } friend int KoFilterChain::filterManagerDirection() const; int direction() const { return static_cast( m_direction ); } friend KoFilterChain* const KoFilterChain::filterManagerParentChain() const; - KoFilterChain* const parentChain() const { return m_parentChain; } + KoFilterChain* const tqparentChain() const { return m_parentChain; } // Private API KoFilterManager( const KoFilterManager& rhs ); KoFilterManager &operator=( const KoFilterManager& rhs ); - void importErrorHelper( const QString& mimeType, const bool suppressDialog = false ); + void importErrorHelper( const TQString& mimeType, const bool suppressDialog = false ); static const int s_area; KoDocument* m_document; KoFilterChain* const m_parentChain; - QString m_importUrl, m_exportUrl; - QCString m_importUrlMimetypeHint; ///< suggested mimetype + TQString m_importUrl, m_exportUrl; + TQCString m_importUrlMimetypeHint; ///< suggested mimetype KOffice::Graph m_graph; Direction m_direction; /// A static cache for the availability checks of filters - static QMap m_filterAvailable; + static TQMap m_filterAvailable; class Private; Private *d; diff --git a/lib/kofficecore/KoFilterManager_p.h b/lib/kofficecore/KoFilterManager_p.h index 20c6cac87..358c25cd0 100644 --- a/lib/kofficecore/KoFilterManager_p.h +++ b/lib/kofficecore/KoFilterManager_p.h @@ -19,8 +19,8 @@ #ifndef __koFilterManager_p_h__ #define __koFilterManager_p_h__ -#include -#include +#include +#include #include @@ -30,16 +30,17 @@ class KListBox; class KoFilterChooser : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KoFilterChooser (QWidget *parent, const QStringList &mimeTypes, - const QString &nativeFormat = QString::null); + KoFilterChooser (TQWidget *tqparent, const TQStringList &mimeTypes, + const TQString &nativeFormat = TQString()); ~KoFilterChooser (); - QString filterSelected (); + TQString filterSelected (); private: - QStringList m_mimeTypes; + TQStringList m_mimeTypes; KListBox *m_filterList; }; diff --git a/lib/kofficecore/KoFrame.cpp b/lib/kofficecore/KoFrame.cpp index 4c07d5c12..b6f77b8a6 100644 --- a/lib/kofficecore/KoFrame.cpp +++ b/lib/kofficecore/KoFrame.cpp @@ -20,12 +20,12 @@ #include #include -#include +#include #include #include #include -#define QMAX32767(a,b) QMAX(QMAX(32767,a),b) +#define TQMAX32767(a,b) TQMAX(TQMAX(32767,a),b) class KoFramePrivate { @@ -39,8 +39,8 @@ public: KoView *m_view; - QPoint m_mousePressPos; - QPoint m_framePos; + TQPoint m_mousePressPos; + TQPoint m_framePos; int m_width; int m_height; int m_mode; @@ -48,8 +48,8 @@ public: KoFrame::State m_state; }; -KoFrame::KoFrame( QWidget *parent, const char *name ) - : QWidget( parent, name ) +KoFrame::KoFrame( TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ) { d = new KoFramePrivate; d->m_state = Inactive; @@ -97,12 +97,12 @@ void KoFrame::setState( State s ) { /* kdDebug(30003) << "KoFrame::setView setMaximumSize " - << "QMAX32767(" << d->m_view->maximumWidth() + 2 * border() << "," << d->m_view->maximumWidth() << "), " - << "QMAX32767(" << d->m_view->maximumHeight() + 2 * border() << "," << d->m_view->maximumHeight() << ")" + << "TQMAX32767(" << d->m_view->maximumWidth() + 2 * border() << "," << d->m_view->maximumWidth() << "), " + << "TQMAX32767(" << d->m_view->maximumHeight() + 2 * border() << "," << d->m_view->maximumHeight() << ")" << endl; */ - setMaximumSize( QMAX32767( d->m_view->maximumWidth() + 2 * border(), d->m_view->maximumWidth() ), - QMAX32767( d->m_view->maximumHeight() + 2 * border(), d->m_view->maximumHeight() ) ); + setMaximumSize( TQMAX32767( d->m_view->maximumWidth() + 2 * border(), d->m_view->maximumWidth() ), + TQMAX32767( d->m_view->maximumHeight() + 2 * border(), d->m_view->maximumHeight() ) ); setMinimumSize( d->m_view->minimumWidth() + leftBorder() + rightBorder(), d->m_view->minimumHeight() + topBorder() + bottomBorder() ); } @@ -183,9 +183,9 @@ int KoFrame::border() const return 5; } -void KoFrame::paintEvent( QPaintEvent* ) +void KoFrame::paintEvent( TQPaintEvent* ) { - QPainter painter; + TQPainter painter; painter.begin( this ); painter.setPen( black ); @@ -206,32 +206,32 @@ void KoFrame::paintEvent( QPaintEvent* ) painter.end(); } -void KoFrame::mousePressEvent( QMouseEvent* ev ) +void KoFrame::mousePressEvent( TQMouseEvent* ev ) { - QRect r1( 0, 0, 5, 5 ); - QRect r2( 0, height() - 5, 5, 5 ); - QRect r3( width() - 5, height() - 5, 5, 5 ); - QRect r4( width() - 5, 0, 5, 5 ); - QRect r5( width() / 2 - 3, 0, 5, 5 ); - QRect r6( width() / 2 - 3, height() - 5, 5, 5 ); - QRect r7( 0, height() / 2 - 3, 5, 5 ); - QRect r8( width()- 5, height() / 2 - 3, 5, 5 ); - - if ( r1.contains( ev->pos() ) ) + TQRect r1( 0, 0, 5, 5 ); + TQRect r2( 0, height() - 5, 5, 5 ); + TQRect r3( width() - 5, height() - 5, 5, 5 ); + TQRect r4( width() - 5, 0, 5, 5 ); + TQRect r5( width() / 2 - 3, 0, 5, 5 ); + TQRect r6( width() / 2 - 3, height() - 5, 5, 5 ); + TQRect r7( 0, height() / 2 - 3, 5, 5 ); + TQRect r8( width()- 5, height() / 2 - 3, 5, 5 ); + + if ( r1.tqcontains( ev->pos() ) ) d->m_mode = 1; - else if ( r2.contains( ev->pos() ) ) + else if ( r2.tqcontains( ev->pos() ) ) d->m_mode = 2; - else if ( r3.contains( ev->pos() ) ) + else if ( r3.tqcontains( ev->pos() ) ) d->m_mode = 3; - else if ( r4.contains( ev->pos() ) ) + else if ( r4.tqcontains( ev->pos() ) ) d->m_mode = 4; - else if ( r5.contains( ev->pos() ) ) + else if ( r5.tqcontains( ev->pos() ) ) d->m_mode = 5; - else if ( r6.contains( ev->pos() ) ) + else if ( r6.tqcontains( ev->pos() ) ) d->m_mode = 6; - else if ( r7.contains( ev->pos() ) ) + else if ( r7.tqcontains( ev->pos() ) ) d->m_mode = 7; - else if ( r8.contains( ev->pos() ) ) + else if ( r8.tqcontains( ev->pos() ) ) d->m_mode = 8; else d->m_mode = 0; @@ -242,98 +242,98 @@ void KoFrame::mousePressEvent( QMouseEvent* ev ) kdDebug(30003) << "---- MODE=" << d->m_mode << endl; d->m_mousePressPos = mapToParent( ev->pos() ); - d->m_framePos = mapToParent( QPoint( 0, 0 ) ); + d->m_framePos = mapToParent( TQPoint( 0, 0 ) ); d->m_width = width(); d->m_height = height(); } -void KoFrame::mouseMoveEvent( QMouseEvent* ev ) +void KoFrame::mouseMoveEvent( TQMouseEvent* ev ) { if ( d->m_mode == 0 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - move( QPoint( p.x() + d->m_framePos.x() - d->m_mousePressPos.x(), + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + move( TQPoint( p.x() + d->m_framePos.x() - d->m_mousePressPos.x(), p.y() + d->m_framePos.y() - d->m_mousePressPos.y() ) ); - // The other modes change the geometry so they call resizeEvent. - // This one doesn't, so it has to emit geometryChangedby itself. - emit geometryChanged(); + // The other modes change the tqgeometry so they call resizeEvent. + // This one doesn't, so it has to emit tqgeometryChangedby itself. + emit tqgeometryChanged(); //kdDebug() << "KoFrame::mouseMoveEvent koFrame position is " << x() << "," << y() << endl; } else if ( d->m_mode == 1 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - int w = QMIN( QMAX( d->m_width + d->m_mousePressPos.x() - p.x(), minimumWidth() ), maximumWidth() ); - int h = QMIN( QMAX( d->m_height + d->m_mousePressPos.y() - p.y(), minimumHeight() ), maximumHeight() ); + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + int w = TQMIN( TQMAX( d->m_width + d->m_mousePressPos.x() - p.x(), minimumWidth() ), maximumWidth() ); + int h = TQMIN( TQMAX( d->m_height + d->m_mousePressPos.y() - p.y(), minimumHeight() ), maximumHeight() ); setGeometry( d->m_framePos.x() - w + d->m_width, d->m_framePos.y() - h + d->m_height, w, h ); } else if ( d->m_mode == 2 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - int w = QMIN( QMAX( d->m_width + d->m_mousePressPos.x() - p.x(), minimumWidth() ), maximumWidth() ); - int h = QMIN( QMAX( d->m_height - d->m_mousePressPos.y() + p.y(), minimumHeight() ), maximumHeight() ); + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + int w = TQMIN( TQMAX( d->m_width + d->m_mousePressPos.x() - p.x(), minimumWidth() ), maximumWidth() ); + int h = TQMIN( TQMAX( d->m_height - d->m_mousePressPos.y() + p.y(), minimumHeight() ), maximumHeight() ); setGeometry( d->m_framePos.x() - w + d->m_width, d->m_framePos.y(), w, h ); } else if ( d->m_mode == 3 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - int w = QMIN( QMAX( d->m_width - d->m_mousePressPos.x() + p.x(), minimumWidth() ), maximumWidth() ); - int h = QMIN( QMAX( d->m_height - d->m_mousePressPos.y() + p.y(), minimumHeight() ), maximumHeight() ); + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + int w = TQMIN( TQMAX( d->m_width - d->m_mousePressPos.x() + p.x(), minimumWidth() ), maximumWidth() ); + int h = TQMIN( TQMAX( d->m_height - d->m_mousePressPos.y() + p.y(), minimumHeight() ), maximumHeight() ); resize( w, h ); } else if ( d->m_mode == 4 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - int w = QMIN( QMAX( d->m_width - d->m_mousePressPos.x() + p.x(), minimumWidth() ), maximumWidth() ); - int h = QMIN( QMAX( d->m_height + d->m_mousePressPos.y() - p.y(), minimumHeight() ), maximumHeight() ); + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + int w = TQMIN( TQMAX( d->m_width - d->m_mousePressPos.x() + p.x(), minimumWidth() ), maximumWidth() ); + int h = TQMIN( TQMAX( d->m_height + d->m_mousePressPos.y() - p.y(), minimumHeight() ), maximumHeight() ); setGeometry( d->m_framePos.x(), d->m_framePos.y() - h + d->m_height, w, h ); } else if ( d->m_mode == 5 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - int h = QMIN( QMAX( d->m_height + d->m_mousePressPos.y() - p.y(), minimumHeight() ), maximumHeight() ); + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + int h = TQMIN( TQMAX( d->m_height + d->m_mousePressPos.y() - p.y(), minimumHeight() ), maximumHeight() ); setGeometry( d->m_framePos.x(), d->m_framePos.y() - h + d->m_height, d->m_width, h ); } else if ( d->m_mode == 6 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - int h = QMIN( QMAX( d->m_height - d->m_mousePressPos.y() + p.y(), minimumHeight() ), maximumHeight() ); + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + int h = TQMIN( TQMAX( d->m_height - d->m_mousePressPos.y() + p.y(), minimumHeight() ), maximumHeight() ); resize( d->m_width, h ); } else if ( d->m_mode == 7 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - int w = QMIN( QMAX( d->m_width + d->m_mousePressPos.x() - p.x(), minimumWidth() ), maximumWidth() ); + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + int w = TQMIN( TQMAX( d->m_width + d->m_mousePressPos.x() - p.x(), minimumWidth() ), maximumWidth() ); setGeometry( d->m_framePos.x() - w + d->m_width, d->m_framePos.y(), w, d->m_height ); } else if ( d->m_mode == 8 ) { - QPoint p = parentWidget()->mapFromGlobal( ev->globalPos() ); - int w = QMIN( QMAX( d->m_width - d->m_mousePressPos.x() + p.x(), minimumWidth() ), maximumWidth() ); + TQPoint p = tqparentWidget()->mapFromGlobal( ev->globalPos() ); + int w = TQMIN( TQMAX( d->m_width - d->m_mousePressPos.x() + p.x(), minimumWidth() ), maximumWidth() ); resize( w, d->m_height ); } else if ( d->m_state == Selected || d->m_state == Active ) { - QRect r1( 0, 0, 5, 5 ); - QRect r2( 0, height() - 5, 5, 5 ); - QRect r3( width() - 5, height() - 5, 5, 5 ); - QRect r4( width() - 5, 0, 5, 5 ); - QRect r5( width() / 2 - 3, 0, 5, 5 ); - QRect r6( width() / 2 - 3, height() - 5, 5, 5 ); - QRect r7( 0, height() / 2 - 3, 5, 5 ); - QRect r8( width()- 5, height() / 2 - 3, 5, 5 ); - - if ( r1.contains( ev->pos() ) || r3.contains( ev->pos() ) ) + TQRect r1( 0, 0, 5, 5 ); + TQRect r2( 0, height() - 5, 5, 5 ); + TQRect r3( width() - 5, height() - 5, 5, 5 ); + TQRect r4( width() - 5, 0, 5, 5 ); + TQRect r5( width() / 2 - 3, 0, 5, 5 ); + TQRect r6( width() / 2 - 3, height() - 5, 5, 5 ); + TQRect r7( 0, height() / 2 - 3, 5, 5 ); + TQRect r8( width()- 5, height() / 2 - 3, 5, 5 ); + + if ( r1.tqcontains( ev->pos() ) || r3.tqcontains( ev->pos() ) ) setCursor( sizeFDiagCursor ); - else if ( r2.contains( ev->pos() ) || r4.contains( ev->pos() ) ) + else if ( r2.tqcontains( ev->pos() ) || r4.tqcontains( ev->pos() ) ) setCursor( sizeBDiagCursor ); - else if ( r5.contains( ev->pos() ) || r6.contains( ev->pos() ) ) + else if ( r5.tqcontains( ev->pos() ) || r6.tqcontains( ev->pos() ) ) setCursor( sizeVerCursor ); - else if ( r7.contains( ev->pos() ) || r8.contains( ev->pos() ) ) + else if ( r7.tqcontains( ev->pos() ) || r8.tqcontains( ev->pos() ) ) setCursor( sizeHorCursor ); else setCursor( KCursor::handCursor() ); @@ -342,12 +342,12 @@ void KoFrame::mouseMoveEvent( QMouseEvent* ev ) setCursor( KCursor::handCursor() ); } -void KoFrame::mouseReleaseEvent( QMouseEvent* ) +void KoFrame::mouseReleaseEvent( TQMouseEvent* ) { d->m_mode = -1; } -void KoFrame::resizeEvent( QResizeEvent* ) +void KoFrame::resizeEvent( TQResizeEvent* ) { if ( !d->m_view ) return; @@ -357,12 +357,12 @@ void KoFrame::resizeEvent( QResizeEvent* ) else d->m_view->setGeometry( 0, 0, width(), height() ); - emit geometryChanged(); + emit tqgeometryChanged(); } -bool KoFrame::eventFilter( QObject* obj, QEvent* ev ) +bool KoFrame::eventFilter( TQObject* obj, TQEvent* ev ) { - if ( obj == d->m_view && KParts::PartActivateEvent::test( ev ) ) + if ( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(d->m_view) && KParts::PartActivateEvent::test( ev ) ) { kdDebug(30003) << "Activate event"<< endl; KParts::PartActivateEvent* e = (KParts::PartActivateEvent*)ev; @@ -374,7 +374,7 @@ bool KoFrame::eventFilter( QObject* obj, QEvent* ev ) setState( Inactive ); } } - else if ( obj == d->m_view && KParts::PartSelectEvent::test( ev ) ) + else if ( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(d->m_view) && KParts::PartSelectEvent::test( ev ) ) { kdDebug(30003) << "Selected event" << endl; KParts::PartSelectEvent* e = (KParts::PartSelectEvent*)ev; diff --git a/lib/kofficecore/KoFrame.h b/lib/kofficecore/KoFrame.h index 7f729bdbb..7b372b987 100644 --- a/lib/kofficecore/KoFrame.h +++ b/lib/kofficecore/KoFrame.h @@ -20,18 +20,19 @@ #ifndef __koFrame_h__ #define __koFrame_h__ -#include +#include class KoView; class KoFramePrivate; -class KoFrame : public QWidget +class KoFrame : public TQWidget { Q_OBJECT + TQ_OBJECT public: enum State { Inactive, Selected, Active }; - KoFrame( QWidget *parent, const char *name = 0 ); + KoFrame( TQWidget *tqparent, const char *name = 0 ); virtual ~KoFrame(); virtual void setView( KoView *view ); @@ -48,15 +49,15 @@ public: virtual int border() const; signals: - void geometryChanged(); + void tqgeometryChanged(); protected: - virtual void paintEvent( QPaintEvent* ); - virtual void mousePressEvent( QMouseEvent* ); - virtual void mouseMoveEvent( QMouseEvent* ); - virtual void mouseReleaseEvent( QMouseEvent* ); - virtual void resizeEvent( QResizeEvent* ); - virtual bool eventFilter( QObject*, QEvent* ); + virtual void paintEvent( TQPaintEvent* ); + virtual void mousePressEvent( TQMouseEvent* ); + virtual void mouseMoveEvent( TQMouseEvent* ); + virtual void mouseReleaseEvent( TQMouseEvent* ); + virtual void resizeEvent( TQResizeEvent* ); + virtual bool eventFilter( TQObject*, TQEvent* ); private: KoFramePrivate *d; diff --git a/lib/kofficecore/KoGenStyles.cpp b/lib/kofficecore/KoGenStyles.cpp index 503b6802c..0ee2e7302 100644 --- a/lib/kofficecore/KoGenStyles.cpp +++ b/lib/kofficecore/KoGenStyles.cpp @@ -29,39 +29,39 @@ KoGenStyles::~KoGenStyles() { } -QString KoGenStyles::lookup( const KoGenStyle& style, const QString& name, int flags ) +TQString KoGenStyles::lookup( const KoGenStyle& style, const TQString& name, int flags ) { - StyleMap::iterator it = m_styleMap.find( style ); + StyleMap::iterator it = m_styleMap.tqfind( style ); if ( it == m_styleMap.end() ) { - // Not found, try if this style is in fact equal to its parent (the find above + // Not found, try if this style is in fact equal to its tqparent (the find above // wouldn't have found it, due to m_parentName being set). - if ( !style.parentName().isEmpty() ) { + if ( !style.tqparentName().isEmpty() ) { KoGenStyle testStyle( style ); - const KoGenStyle* parentStyle = this->style( style.parentName() ); // ## linear search - if( !parentStyle ) { - kdDebug(30003) << "KoGenStyles::lookup(" << name << "): parent style '" << style.parentName() << "' not found in collection" << endl; + const KoGenStyle* tqparentStyle = this->style( style.tqparentName() ); // ## linear search + if( !tqparentStyle ) { + kdDebug(30003) << "KoGenStyles::lookup(" << name << "): tqparent style '" << style.tqparentName() << "' not found in collection" << endl; } else { - if ( testStyle.m_familyName != parentStyle->m_familyName ) + if ( testStyle.m_familyName != tqparentStyle->m_familyName ) { - kdWarning(30003) << "KoGenStyles::lookup(" << name << ", family=" << testStyle.m_familyName << ") parent style '" << style.parentName() << "' has a different family: " << parentStyle->m_familyName << endl; + kdWarning(30003) << "KoGenStyles::lookup(" << name << ", family=" << testStyle.m_familyName << ") tqparent style '" << style.tqparentName() << "' has a different family: " << tqparentStyle->m_familyName << endl; } - testStyle.m_parentName = parentStyle->m_parentName; + testStyle.m_parentName = tqparentStyle->m_parentName; // Exclude the type from the comparison. It's ok for an auto style - // to have a user style as parent; they can still be identical - testStyle.m_type = parentStyle->m_type; - // Also it's ok to not have the display name of the parent style + // to have a user style as tqparent; they can still be identical + testStyle.m_type = tqparentStyle->m_type; + // Also it's ok to not have the display name of the tqparent style // in the auto style - QMap::const_iterator it = parentStyle->m_attributes.find( "style:display-name" ); - if ( it != parentStyle->m_attributes.end() ) + TQMap::const_iterator it = tqparentStyle->m_attributes.tqfind( "style:display-name" ); + if ( it != tqparentStyle->m_attributes.end() ) testStyle.addAttribute( "style:display-name", *it ); - if ( *parentStyle == testStyle ) - return style.parentName(); + if ( *tqparentStyle == testStyle ) + return style.tqparentName(); } } - QString styleName( name ); + TQString styleName( name ); if ( styleName.isEmpty() ) { styleName = 'A'; // for "auto". flags &= ~DontForceNumbering; // i.e. force numbering @@ -80,39 +80,39 @@ QString KoGenStyles::lookup( const KoGenStyle& style, const QString& name, int f return it.data(); } -QString KoGenStyles::makeUniqueName( const QString& base, int flags ) const +TQString KoGenStyles::makeUniqueName( const TQString& base, int flags ) const { // If this name is not used yet, and numbering isn't forced, then the given name is ok. if ( ( flags & DontForceNumbering ) - && m_autoStylesInStylesDotXml.find( base ) == m_autoStylesInStylesDotXml.end() - && m_styleNames.find( base ) == m_styleNames.end() ) + && m_autoStylesInStylesDotXml.tqfind( base ) == m_autoStylesInStylesDotXml.end() + && m_styleNames.tqfind( base ) == m_styleNames.end() ) return base; int num = 1; - QString name; + TQString name; do { name = base; - name += QString::number( num++ ); - } while ( m_autoStylesInStylesDotXml.find( name ) != m_autoStylesInStylesDotXml.end() - || m_styleNames.find( name ) != m_styleNames.end() ); + name += TQString::number( num++ ); + } while ( m_autoStylesInStylesDotXml.tqfind( name ) != m_autoStylesInStylesDotXml.end() + || m_styleNames.tqfind( name ) != m_styleNames.end() ); return name; } -QValueList KoGenStyles::styles( int type, bool markedForStylesXml ) const +TQValueList KoGenStyles::styles( int type, bool markedForStylesXml ) const { - QValueList lst; + TQValueList lst; const NameMap& nameMap = markedForStylesXml ? m_autoStylesInStylesDotXml : m_styleNames; StyleArray::const_iterator it = m_styleArray.begin(); const StyleArray::const_iterator end = m_styleArray.end(); for ( ; it != end ; ++it ) { // Look up if it's marked for styles.xml or not by looking up in the corresponding style map. - if ( (*it).style->type() == type && nameMap.find((*it).name) != nameMap.end() ) { + if ( (*it).style->type() == type && nameMap.tqfind((*it).name) != nameMap.end() ) { lst.append( *it ); } } return lst; } -const KoGenStyle* KoGenStyles::style( const QString& name ) const +const KoGenStyle* KoGenStyles::style( const TQString& name ) const { StyleArray::const_iterator it = m_styleArray.begin(); const StyleArray::const_iterator end = m_styleArray.end(); @@ -123,14 +123,14 @@ const KoGenStyle* KoGenStyles::style( const QString& name ) const return 0; } -KoGenStyle* KoGenStyles::styleForModification( const QString& name ) +KoGenStyle* KoGenStyles::styleForModification( const TQString& name ) { return const_cast( style( name ) ); } -void KoGenStyles::markStyleForStylesXml( const QString& name ) +void KoGenStyles::markStyleForStylesXml( const TQString& name ) { - Q_ASSERT( m_styleNames.find( name ) != m_styleNames.end() ); + Q_ASSERT( m_styleNames.tqfind( name ) != m_styleNames.end() ); m_styleNames.remove( name ); m_autoStylesInStylesDotXml.insert( name, true ); styleForModification( name )->setAutoStyleInStylesDotXml( true ); @@ -156,10 +156,10 @@ void KoGenStyles::dump() } // Returns -1, 0 (equal) or 1 -static int compareMap( const QMap& map1, const QMap& map2 ) +static int compareMap( const TQMap& map1, const TQMap& map2 ) { - QMap::const_iterator it = map1.begin(); - QMap::const_iterator oit = map2.begin(); + TQMap::const_iterator it = map1.begin(); + TQMap::const_iterator oit = map2.begin(); for ( ; it != map1.end(); ++it, ++oit ) { // both maps have been checked for size already if ( it.key() != oit.key() ) return it.key() < oit.key() ? -1 : +1; @@ -173,8 +173,8 @@ static int compareMap( const QMap& map1, const QMapstartElement( elementName ); - QMap::const_iterator it = m_properties[i].begin(); - const QMap::const_iterator end = m_properties[i].end(); + TQMap::const_iterator it = m_properties[i].begin(); + const TQMap::const_iterator end = m_properties[i].end(); for ( ; it != end; ++it ) { - if ( !parentStyle || parentStyle->property( it.key(), i ) != it.data() ) + if ( !tqparentStyle || tqparentStyle->property( it.key(), i ) != it.data() ) writer->addAttribute( it.key().utf8(), it.data().utf8() ); } writer->endElement(); } } -void KoGenStyle::writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const char* elementName, const QString& name, const char* propertiesElementName, bool closeElement, bool drawElement ) const +void KoGenStyle::writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const char* elementName, const TQString& name, const char* propertiesElementName, bool closeElement, bool drawElement ) const { //kdDebug(30003) << "writing out style " << name << " display-name=" << m_attributes["style:display-name"] << " family=" << m_familyName << endl; writer->startElement( elementName ); - const KoGenStyle* parentStyle = 0; + const KoGenStyle* tqparentStyle = 0; if ( !m_defaultStyle ) { if ( !drawElement ) writer->addAttribute( "style:name", name ); else writer->addAttribute( "draw:name", name ); if ( !m_parentName.isEmpty() ) { - parentStyle = styles.style( m_parentName ); - if ( parentStyle && m_familyName.isEmpty() ) { - // get family from parent style, just in case + tqparentStyle = styles.style( m_parentName ); + if ( tqparentStyle && m_familyName.isEmpty() ) { + // get family from tqparent style, just in case // Note: this is saving code, don't convert to attributeNS! const_cast( this )-> - m_familyName = parentStyle->attribute( "style:family" ).latin1(); - //kdDebug(30003) << "Got familyname " << m_familyName << " from parent" << endl; + m_familyName = tqparentStyle->attribute( "style:family" ).latin1(); + //kdDebug(30003) << "Got familyname " << m_familyName << " from tqparent" << endl; } - writer->addAttribute( "style:parent-style-name", m_parentName ); + writer->addAttribute( "style:tqparent-style-name", m_parentName ); } } else { // default-style Q_ASSERT( qstrcmp( elementName, "style:default-style" ) == 0 ); @@ -225,7 +225,7 @@ void KoGenStyle::writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const cha } if ( !m_familyName.isEmpty() ) const_cast( this )-> - addAttribute( "style:family", QString::fromLatin1( m_familyName ) ); + addAttribute( "style:family", TQString::tqfromLatin1( m_familyName ) ); else { if ( qstrcmp( elementName, "style:style" ) == 0 ) kdWarning(30003) << "User style " << name << " is without family - invalid. m_type=" << m_type << endl; @@ -234,21 +234,21 @@ void KoGenStyle::writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const cha #if 0 // #ifndef NDEBUG kdDebug() << "style: " << name << endl; printDebug(); - if ( parentStyle ) { - kdDebug() << " parent: " << m_parentName << endl; - parentStyle->printDebug(); + if ( tqparentStyle ) { + kdDebug() << " tqparent: " << m_parentName << endl; + tqparentStyle->printDebug(); } #endif - // Write attributes [which differ from the parent style] - // We only look at the direct parent style because we assume + // Write attributes [which differ from the tqparent style] + // We only look at the direct tqparent style because we assume // that styles are fully specified, i.e. the inheritance is // only in the final file, not in the caller's code. - QMap::const_iterator it = m_attributes.begin(); + TQMap::const_iterator it = m_attributes.begin(); for ( ; it != m_attributes.end(); ++it ) { bool writeit = true; - if ( parentStyle && it.key() != "style:family" // always write the family out - && parentStyle->attribute( it.key() ) == it.data() ) + if ( tqparentStyle && it.key() != "style:family" // always write the family out + && tqparentStyle->attribute( it.key() ) == it.data() ) writeit = false; if ( writeit ) writer->addAttribute( it.key().utf8(), it.data().utf8() ); @@ -261,31 +261,31 @@ void KoGenStyle::writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const cha writer->startElement( propertiesElementName ); // e.g. paragraph-properties it = m_properties[i].begin(); for ( ; it != m_properties[i].end(); ++it ) { - if ( !parentStyle || parentStyle->property( it.key(), i ) != it.data() ) + if ( !tqparentStyle || tqparentStyle->property( it.key(), i ) != it.data() ) writer->addAttribute( it.key().utf8(), it.data().utf8() ); } i = KoGenStyle::ChildElement; it = m_properties[i].begin(); for ( ; it != m_properties[i].end(); ++it ) { - if ( !parentStyle || parentStyle->property( it.key(), i ) != it.data() ) { + if ( !tqparentStyle || tqparentStyle->property( it.key(), i ) != it.data() ) { writer->addCompleteElement( it.data().utf8() ); } } if ( createPropertiesTag ) writer->endElement(); } - writeStyleProperties( writer, KoGenStyle::GraphicType, "style:graphic-properties", parentStyle ); - writeStyleProperties( writer, KoGenStyle::ParagraphType, "style:paragraph-properties", parentStyle ); - writeStyleProperties( writer, KoGenStyle::TextType, "style:text-properties", parentStyle ); + writeStyleProperties( writer, KoGenStyle::GraphicType, "style:graphic-properties", tqparentStyle ); + writeStyleProperties( writer, KoGenStyle::ParagraphType, "style:paragraph-properties", tqparentStyle ); + writeStyleProperties( writer, KoGenStyle::TextType, "style:text-properties", tqparentStyle ); // And now the style maps for ( uint i = 0; i < m_maps.count(); ++i ) { bool writeit = true; - if ( parentStyle && compareMap( m_maps[i], parentStyle->m_maps[i] ) == 0 ) + if ( tqparentStyle && compareMap( m_maps[i], tqparentStyle->m_maps[i] ) == 0 ) writeit = false; if ( writeit ) { writer->startElement( "style:map" ); - QMap::const_iterator it = m_maps[i].begin(); + TQMap::const_iterator it = m_maps[i].begin(); for ( ; it != m_maps[i].end(); ++it ) { writer->addAttribute( it.key().utf8(), it.data().utf8() ); } @@ -296,17 +296,17 @@ void KoGenStyle::writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const cha writer->endElement(); } -void KoGenStyle::addPropertyPt( const QString& propName, double propValue, PropertyType type ) +void KoGenStyle::addPropertyPt( const TQString& propName, double propValue, PropertyType type ) { - QString str; + TQString str; str.setNum( propValue, 'g', DBL_DIG ); str += "pt"; m_properties[type].insert( propName, str ); } -void KoGenStyle::addAttributePt( const QString& attrName, double attrValue ) +void KoGenStyle::addAttributePt( const TQString& attrName, double attrValue ) { - QString str; + TQString str; str.setNum( attrValue, 'g', DBL_DIG ); str += "pt"; m_attributes.insert( attrName, str ); @@ -317,32 +317,32 @@ void KoGenStyle::printDebug() const { int i = DefaultType; kdDebug() << m_properties[i].count() << " properties." << endl; - for( QMap::ConstIterator it = m_properties[i].begin(); it != m_properties[i].end(); ++it ) { + for( TQMap::ConstIterator it = m_properties[i].begin(); it != m_properties[i].end(); ++it ) { kdDebug() << " " << it.key() << " = " << it.data() << endl; } i = TextType; kdDebug() << m_properties[i].count() << " text properties." << endl; - for( QMap::ConstIterator it = m_properties[i].begin(); it != m_properties[i].end(); ++it ) { + for( TQMap::ConstIterator it = m_properties[i].begin(); it != m_properties[i].end(); ++it ) { kdDebug() << " " << it.key() << " = " << it.data() << endl; } i = ParagraphType; kdDebug() << m_properties[i].count() << " paragraph properties." << endl; - for( QMap::ConstIterator it = m_properties[i].begin(); it != m_properties[i].end(); ++it ) { + for( TQMap::ConstIterator it = m_properties[i].begin(); it != m_properties[i].end(); ++it ) { kdDebug() << " " << it.key() << " = " << it.data() << endl; } i = ChildElement; kdDebug() << m_properties[i].count() << " child elements." << endl; - for( QMap::ConstIterator it = m_properties[i].begin(); it != m_properties[i].end(); ++it ) { + for( TQMap::ConstIterator it = m_properties[i].begin(); it != m_properties[i].end(); ++it ) { kdDebug() << " " << it.key() << " = " << it.data() << endl; } kdDebug() << m_attributes.count() << " attributes." << endl; - for( QMap::ConstIterator it = m_attributes.begin(); it != m_attributes.end(); ++it ) { + for( TQMap::ConstIterator it = m_attributes.begin(); it != m_attributes.end(); ++it ) { kdDebug() << " " << it.key() << " = " << it.data() << endl; } kdDebug() << m_maps.count() << " maps." << endl; for ( uint i = 0; i < m_maps.count(); ++i ) { kdDebug() << "map " << i << ":" << endl; - for( QMap::ConstIterator it = m_maps[i].begin(); it != m_maps[i].end(); ++it ) { + for( TQMap::ConstIterator it = m_maps[i].begin(); it != m_maps[i].end(); ++it ) { kdDebug() << " " << it.key() << " = " << it.data() << endl; } } diff --git a/lib/kofficecore/KoGenStyles.h b/lib/kofficecore/KoGenStyles.h index ad05d6e0e..17771c690 100644 --- a/lib/kofficecore/KoGenStyles.h +++ b/lib/kofficecore/KoGenStyles.h @@ -19,9 +19,9 @@ #ifndef KOGENSTYLES_H #define KOGENSTYLES_H -#include -#include -#include +#include +#include +#include #include @@ -76,7 +76,7 @@ public: ForceNumbering = 0, // it's the default anyway DontForceNumbering = 1 }; - // KDE4 TODO: use QFlags and change the arg type in lookup + // KDE4 TODO: use TQFlags and change the arg type in lookup /** * Look up a style in the collection, inserting it if necessary. @@ -94,9 +94,9 @@ public: * @return the name for this style * @todo ### rename lookup to insert */ - QString lookup( const KoGenStyle& style, const QString& name = QString::null, int flags = NoFlag ); + TQString lookup( const KoGenStyle& style, const TQString& name = TQString(), int flags = NoFlag ); - typedef QMap StyleMap; + typedef TQMap StyleMap; /** * Return the entire collection of styles * Use this for saving the styles @@ -105,7 +105,7 @@ public: struct NamedStyle { const KoGenStyle* style; ///< @note owned by the collection - QString name; + TQString name; }; /** * Return all styles of a given type @@ -116,12 +116,12 @@ public: * otherwise only those NOT marked for styles.xml. * @see lookup */ - QValueList styles( int type, bool markedForStylesXml = false ) const; + TQValueList styles( int type, bool markedForStylesXml = false ) const; /** * @return an existing style by name */ - const KoGenStyle* style( const QString& name ) const; + const KoGenStyle* style( const TQString& name ) const; /** * @return an existing style by name, which can be modified. @@ -130,7 +130,7 @@ public: * Only do this if you know for sure no other 'user' of that style will * be affected. */ - KoGenStyle* styleForModification( const QString& name ); + KoGenStyle* styleForModification( const TQString& name ); /** * Mark a given automatic style as being needed in styles.xml. @@ -144,7 +144,7 @@ public: * * @see styles, KoGenStyle::setAutoStyleInStylesDotXml */ - void markStyleForStylesXml( const QString& name ); + void markStyleForStylesXml( const TQString& name ); /** * Outputs debug information @@ -152,7 +152,7 @@ public: void dump(); private: - QString makeUniqueName( const QString& base, int flags ) const; + TQString makeUniqueName( const TQString& base, int flags ) const; /// style definition -> name StyleMap m_styleMap; @@ -160,12 +160,12 @@ private: /// Map with the style name as key. /// This map is mainly used to check for name uniqueness /// The value of the bool doesn't matter. - typedef QMap NameMap; // KDE4: QSet + typedef TQMap NameMap; // KDE4: TQSet NameMap m_styleNames; NameMap m_autoStylesInStylesDotXml; /// List of styles (used to preserve ordering) - typedef QValueVector StyleArray; + typedef TQValueVector StyleArray; StyleArray m_styleArray; class Private; @@ -216,10 +216,10 @@ public: * @param familyName The value for style:family, e.g. text, paragraph, graphic etc. * The family is for style:style elements only; number styles and list styles don't have one. * - * @param parentName If set, name of the parent style from which this one inherits. + * @param tqparentName If set, name of the tqparent style from which this one inherits. */ explicit KoGenStyle( int type = 0, const char* familyName = 0, - const QString& parentName = QString::null ); + const TQString& tqparentName = TQString() ); ~KoGenStyle(); /* @@ -249,8 +249,8 @@ public: /// Return the family name const char* familyName() const { return m_familyName.data(); } - /// Return the name of style's parent, if set - QString parentName() const { return m_parentName; } + /// Return the name of style's tqparent, if set + TQString tqparentName() const { return m_parentName; } /** * @brief The types of properties @@ -274,7 +274,7 @@ public: { /** * DefaultType depends on family: e.g. paragraph-properties if family=paragraph - * or on the type of style (e.g. page-layout -> page-layout-properties). + * or on the type of style (e.g. page-tqlayout -> page-tqlayout-properties). * (In fact that tag name is the one passed to writeStyle) */ DefaultType = 0, @@ -291,80 +291,80 @@ public: }; /// Add a property to the style - void addProperty( const QString& propName, const QString& propValue, PropertyType type = DefaultType ) { + void addProperty( const TQString& propName, const TQString& propValue, PropertyType type = DefaultType ) { m_properties[type].insert( propName, propValue ); } /// Overloaded version of addProperty that takes a char*, usually for "..." - void addProperty( const QString& propName, const char* propValue, PropertyType type = DefaultType ) { - m_properties[type].insert( propName, QString::fromUtf8( propValue ) ); + void addProperty( const TQString& propName, const char* propValue, PropertyType type = DefaultType ) { + m_properties[type].insert( propName, TQString::fromUtf8( propValue ) ); } /// Overloaded version of addProperty that converts an int to a string - void addProperty( const QString& propName, int propValue, PropertyType type = DefaultType ) { - m_properties[type].insert( propName, QString::number( propValue ) ); + void addProperty( const TQString& propName, int propValue, PropertyType type = DefaultType ) { + m_properties[type].insert( propName, TQString::number( propValue ) ); } /// Overloaded version of addProperty that converts a bool to a string (false/true) - void addProperty( const QString& propName, bool propValue, PropertyType type = DefaultType ) { + void addProperty( const TQString& propName, bool propValue, PropertyType type = DefaultType ) { m_properties[type].insert( propName, propValue ? "true" : "false" ); } /** * Add a property which represents a distance, measured in pt * The number is written out with the highest possible precision - * (unlike QString::number and setNum, which default to 6 digits), + * (unlike TQString::number and setNum, which default to 6 digits), * and the unit name ("pt") is appended to it. */ - void addPropertyPt( const QString& propName, double propValue, PropertyType type = DefaultType ); + void addPropertyPt( const TQString& propName, double propValue, PropertyType type = DefaultType ); /** * Add an attribute to the style * The difference between property and attributes is a bit oasis-format-specific: * attributes are for the style element itself, and properties are in the style:properties child element */ - void addAttribute( const QString& attrName, const QString& attrValue ) { + void addAttribute( const TQString& attrName, const TQString& attrValue ) { m_attributes.insert( attrName, attrValue ); } /// Overloaded version of addAttribute that takes a char*, usually for "..." - void addAttribute( const QString& attrName, const char* attrValue ) { - m_attributes.insert( attrName, QString::fromUtf8( attrValue ) ); + void addAttribute( const TQString& attrName, const char* attrValue ) { + m_attributes.insert( attrName, TQString::fromUtf8( attrValue ) ); } /// Overloaded version of addAttribute that converts an int to a string - void addAttribute( const QString& attrName, int attrValue ) { - m_attributes.insert( attrName, QString::number( attrValue ) ); + void addAttribute( const TQString& attrName, int attrValue ) { + m_attributes.insert( attrName, TQString::number( attrValue ) ); } /// Overloaded version of addAttribute that converts a bool to a string - void addAttribute( const QString& attrName, bool attrValue ) { + void addAttribute( const TQString& attrName, bool attrValue ) { m_attributes.insert( attrName, attrValue ? "true" : "false" ); } /** * Add an attribute which represents a distance, measured in pt * The number is written out with the highest possible precision - * (unlike QString::number and setNum, which default to 6 digits), + * (unlike TQString::number and setNum, which default to 6 digits), * and the unit name ("pt") is appended to it. */ - void addAttributePt( const QString& attrName, double attrValue ); + void addAttributePt( const TQString& attrName, double attrValue ); /** * @brief Add a child element to the style properties. * - * What is meant here is that the contents of the QString + * What is meant here is that the contents of the TQString * will be written out literally. This means you should use * KoXmlWriter to generate it: * @code - * QBuffer buffer; + * TQBuffer buffer; * buffer.open( IO_WriteOnly ); * KoXmlWriter elementWriter( &buffer ); // TODO pass indentation level * elementWriter.startElement( "..." ); * ... * elementWriter.endElement(); - * QString elementContents = QString::fromUtf8( buffer.buffer(), buffer.buffer().size() ); + * TQString elementContents = TQString::fromUtf8( buffer.buffer(), buffer.buffer().size() ); * gs.addChildElement( "...", elementContents ); * @endcode * * The value of @p elementName isn't used, except that it must be unique. */ - void addChildElement( const QString& elementName, const QString& elementContents ) { + void addChildElement( const TQString& elementName, const TQString& elementContents ) { m_properties[ChildElement].insert( elementName, elementContents ); } @@ -372,14 +372,14 @@ public: * @brief Add a style:map to the style. * @param styleMap the attributes for the map, associated as (name,value). */ - void addStyleMap( const QMap& styleMap ) { + void addStyleMap( const TQMap& styleMap ) { m_maps.append( styleMap ); } /** * @return true if the style has no attributes, no properties, no style map etc. * This can be used by applications which do not save all attributes unconditionally, - * but only those that differ from the parent. But note that lookup() can't find this out... + * but only those that differ from the tqparent. But note that lookup() can't find this out... */ bool isEmpty() const { if ( !m_attributes.isEmpty() || ! m_maps.isEmpty() ) @@ -393,7 +393,7 @@ public: /** * Write the definition of this style to @p writer, using the OASIS format. * @param writer the KoXmlWriter in which @p elementName will be created and filled in - * @param styles the styles collection, used to look up the parent style + * @param styles the styles collection, used to look up the tqparent style * @param elementName the name of the XML element, e.g. "style:style". Don't forget to * pass style:default-style if isDefaultStyle(). * @param name must come from the collection. It will be ignored if isDefaultStyle() is true. @@ -403,11 +403,11 @@ public: * @param closeElement set it to false to be able to add more child elements to the style element * @param drawElement set it to true to add "draw:name" (used for gradient/hatch style) otherwise add "style:name" */ - void writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const char* elementName, const QString& name, + void writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const char* elementName, const TQString& name, const char* propertiesElementName, bool closeElement = true, bool drawElement = false ) const; /** - * QMap requires a complete sorting order. + * TQMap requires a complete sorting order. * Another solution would have been a qdict and a key() here, a la KoTextFormat, * but the key was difficult to generate. * Solutions with only a hash value (not representative of the whole data) @@ -415,26 +415,26 @@ public: */ bool operator<( const KoGenStyle &other ) const; - /// Not needed for QMap, but can still be useful + /// Not needed for TQMap, but can still be useful bool operator==( const KoGenStyle &other ) const; private: - QString property( const QString& propName, PropertyType type ) const { - QMap::const_iterator it = m_properties[type].find( propName ); + TQString property( const TQString& propName, PropertyType type ) const { + TQMap::const_iterator it = m_properties[type].tqfind( propName ); if ( it != m_properties[type].end() ) return it.data(); - return QString::null; + return TQString(); } - QString attribute( const QString& propName ) const { - QMap::const_iterator it = m_attributes.find( propName ); + TQString attribute( const TQString& propName ) const { + TQMap::const_iterator it = m_attributes.tqfind( propName ); if ( it != m_attributes.end() ) return it.data(); - return QString::null; + return TQString(); } void writeStyleProperties( KoXmlWriter* writer, PropertyType i, - const char* elementName, const KoGenStyle* parentStyle ) const; + const char* elementName, const KoGenStyle* tqparentStyle ) const; #ifndef NDEBUG void printDebug() const; @@ -444,13 +444,13 @@ private: // Note that the copy constructor and assignment operator are allowed. // Better not use pointers below! int m_type; - QCString m_familyName; - QString m_parentName; - /// We use QMaps since they provide automatic sorting on the key (important for unicity!) - QMap m_properties[N_NumTypes]; - QMap m_attributes; - typedef QMap StyleMap; - QValueVector m_maps; // we can't really sort the maps between themselves... + TQCString m_familyName; + TQString m_parentName; + /// We use TQMaps since they provide automatic sorting on the key (important for unicity!) + TQMap m_properties[N_NumTypes]; + TQMap m_attributes; + typedef TQMap StyleMap; + TQValueVector m_maps; // we can't really sort the maps between themselves... bool m_autoStyleInStylesDotXml; bool m_defaultStyle; diff --git a/lib/kofficecore/KoGlobal.cpp b/lib/kofficecore/KoGlobal.cpp index 877171726..53c9e4fe8 100644 --- a/lib/kofficecore/KoGlobal.cpp +++ b/lib/kofficecore/KoGlobal.cpp @@ -21,8 +21,8 @@ #include "config.h" #include #include -#include -#include +#include +#include #include #include #include @@ -47,7 +47,7 @@ KoGlobal* KoGlobal::self() KoGlobal::KoGlobal() : m_pointSize( -1 ), m_kofficeConfig( 0L ) { - // Make sure that QCString::setNum doesn't give us "," as decimal point, e.g. when saving to OpenDocument. + // Make sure that TQCString::setNum doesn't give us "," as decimal point, e.g. when saving to OpenDocument. setlocale( LC_NUMERIC, "C" ); // Install the libkoffice* translations @@ -61,12 +61,12 @@ KoGlobal::KoGlobal() // Tell the iconloader about share/apps/koffice/icons KGlobal::iconLoader()->addAppDir("koffice"); - // Another way to get the DPI of the display would be QPaintDeviceMetrics, + // Another way to get the DPI of the display would be TQPaintDeviceMetrics, // but we have no widget here (and moving this to KoView wouldn't allow // using this from the document easily). -#ifdef Q_WS_X11 - m_dpiX = QPaintDevice::x11AppDpiX(); - m_dpiY = QPaintDevice::x11AppDpiY(); +#ifdef TQ_WS_X11 + m_dpiX = TQPaintDevice::x11AppDpiX(); + m_dpiY = TQPaintDevice::x11AppDpiY(); #else m_dpiX = 75; m_dpiY = 75; @@ -78,31 +78,31 @@ KoGlobal::~KoGlobal() delete m_kofficeConfig; } -QFont KoGlobal::_defaultFont() +TQFont KoGlobal::_defaultFont() { - QFont font = KGlobalSettings::generalFont(); - // we have to use QFontInfo, in case the font was specified with a pixel size + TQFont font = KGlobalSettings::generalFont(); + // we have to use TQFontInfo, in case the font was specified with a pixel size if ( font.pointSize() == -1 ) { - // cache size into m_pointSize, since QFontInfo loads the font -> slow + // cache size into m_pointSize, since TQFontInfo loads the font -> slow if ( m_pointSize == -1 ) - m_pointSize = QFontInfo(font).pointSize(); + m_pointSize = TQFontInfo(font).pointSize(); Q_ASSERT( m_pointSize != -1 ); font.setPointSize( m_pointSize ); } - //kdDebug()< seenLanguages; - const QStringList langlist = config.groupList(); - for ( QStringList::ConstIterator itall = langlist.begin(); + TQMap seenLanguages; + const TQStringList langlist = config.groupList(); + for ( TQStringList::ConstIterator itall = langlist.begin(); itall != langlist.end(); ++itall ) { - const QString tag = *itall; + const TQString tag = *itall; config.setGroup( tag ); - const QString name = config.readEntry("Name", tag); + const TQString name = config.readEntry("Name", tag); // e.g. name is "French" and tag is "fr" - // The QMap does the sorting on the display-name, so that + // The TQMap does the sorting on the display-name, so that // comboboxes are sorted. m_langMap.insert( name, tag ); @@ -135,23 +135,23 @@ void KoGlobal::createListOfLanguages() // Many of them are already in all_languages but all_languages doesn't // currently have en_GB or en_US etc. - const QStringList translationList = KGlobal::dirs()->findAllResources("locale", - QString::fromLatin1("*/entry.desktop")); - for ( QStringList::ConstIterator it = translationList.begin(); + const TQStringList translationList = KGlobal::dirs()->findAllResources("locale", + TQString::tqfromLatin1("*/entry.desktop")); + for ( TQStringList::ConstIterator it = translationList.begin(); it != translationList.end(); ++it ) { // Extract the language tag from the directory name - QString tag = *it; - int index = tag.findRev('/'); + TQString tag = *it; + int index = tag.tqfindRev('/'); tag = tag.left(index); - index = tag.findRev('/'); + index = tag.tqfindRev('/'); tag = tag.mid(index+1); - if ( seenLanguages.find( tag ) == seenLanguages.end() ) { + if ( seenLanguages.tqfind( tag ) == seenLanguages.end() ) { KSimpleConfig entry(*it); entry.setGroup("KCM Locale"); - const QString name = entry.readEntry("Name", tag); + const TQString name = entry.readEntry("Name", tag); // e.g. name is "US English" and tag is "en_US" m_langMap.insert( name, tag ); @@ -166,20 +166,20 @@ void KoGlobal::createListOfLanguages() // How to add them? } -QString KoGlobal::tagOfLanguage( const QString & _lang) +TQString KoGlobal::tagOfLanguage( const TQString & _lang) { const LanguageMap& map = self()->m_langMap; - QMap::ConstIterator it = map.find( _lang ); + TQMap::ConstIterator it = map.tqfind( _lang ); if ( it != map.end() ) return *it; - return QString::null; + return TQString(); } -QString KoGlobal::languageFromTag( const QString &langTag ) +TQString KoGlobal::languageFromTag( const TQString &langTag ) { const LanguageMap& map = self()->m_langMap; - QMap::ConstIterator it = map.begin(); - const QMap::ConstIterator end = map.end(); + TQMap::ConstIterator it = map.begin(); + const TQMap::ConstIterator end = map.end(); for ( ; it != end; ++it ) if ( it.data() == langTag ) return it.key(); diff --git a/lib/kofficecore/KoGlobal.h b/lib/kofficecore/KoGlobal.h index bab9c2615..367a150b7 100644 --- a/lib/kofficecore/KoGlobal.h +++ b/lib/kofficecore/KoGlobal.h @@ -22,9 +22,9 @@ #ifndef koGlobal_h #define koGlobal_h -#include -#include -#include +#include +#include +#include class KConfig; #include @@ -39,9 +39,9 @@ public: * Return the default font for KOffice programs. * This is (currently) the same as the KDE-global default font, * except that it is guaranteed to have a point size set, - * never a pixel size (see @ref QFont). + * never a pixel size (see @ref TQFont). */ - static QFont defaultFont() { + static TQFont defaultFont() { return self()->_defaultFont(); } @@ -66,32 +66,32 @@ public: /// Return the list of available languages, in their displayable form /// (translated names) - static QStringList listOfLanguages() { + static TQStringList listOfLanguages() { return self()->_listOfLanguages(); } /// Return the list of available languages, in their internal form /// e.g. "fr" or "en_US", here called "tag" - static QStringList listTagOfLanguages() { // TODO rename to listOfLanguageTags + static TQStringList listTagOfLanguages() { // TODO rename to listOfLanguageTags return self()->_listOfLanguageTags(); } /// For a given language display name, return its tag - static QString tagOfLanguage( const QString & _lang ); + static TQString tagOfLanguage( const TQString & _lang ); /// For a given language tag, return its display name - static QString languageFromTag( const QString &_lang ); + static TQString languageFromTag( const TQString &_lang ); ~KoGlobal(); private: static KoGlobal* self(); KoGlobal(); - QFont _defaultFont(); - QStringList _listOfLanguages(); - QStringList _listOfLanguageTags(); + TQFont _defaultFont(); + TQStringList _listOfLanguages(); + TQStringList _listOfLanguageTags(); KConfig* _kofficeConfig(); void createListOfLanguages(); int m_pointSize; - typedef QMap LanguageMap; + typedef TQMap LanguageMap; LanguageMap m_langMap; // display-name -> language tag KConfig* m_kofficeConfig; int m_dpiX; diff --git a/lib/kofficecore/KoMainWindow.cpp b/lib/kofficecore/KoMainWindow.cpp index bdcfaa6a0..b78677f4e 100644 --- a/lib/kofficecore/KoMainWindow.cpp +++ b/lib/kofficecore/KoMainWindow.cpp @@ -55,7 +55,7 @@ #include #include -#include +#include #include #include @@ -63,20 +63,20 @@ class KoPartManager : public KParts::PartManager { public: - KoPartManager( QWidget * parent, const char * name = 0L ) - : KParts::PartManager( parent, name ) + KoPartManager( TQWidget * tqparent, const char * name = 0L ) + : KParts::PartManager( tqparent, name ) { setSelectionPolicy( KParts::PartManager::TriState ); setAllowNestedParts( true ); setIgnoreScrollBars( true ); // Allow right-click on embedded objects (without activating them) - // But beware: this means right-click on parent, from embedded object, - // doesn't make the parent active first... + // But beware: this means right-click on tqparent, from embedded object, + // doesn't make the tqparent active first... setActivationButtonMask( Qt::LeftButton | Qt::MidButton ); } - virtual bool eventFilter( QObject *obj, QEvent *ev ) + virtual bool eventFilter( TQObject *obj, TQEvent *ev ) { - if ( !obj->isWidgetType() || ::qt_cast( obj ) ) + if ( !obj->isWidgetType() || ::tqqt_cast( obj ) ) return false; return KParts::PartManager::eventFilter( obj, ev ); } @@ -135,25 +135,25 @@ public: KoDocument *m_rootDoc; KoDocument *m_docToOpen; - QPtrList m_rootViews; + TQPtrList m_rootViews; KParts::PartManager *m_manager; KParts::Part *m_activePart; KoView *m_activeView; - QLabel * statusBarLabel; + TQLabel * statusBarLabel; KProgress *m_progress; - QPtrList m_splitViewActionList; + TQPtrList m_splitViewActionList; // This additional list is needed, because we don't plug // the first list, when an embedded view gets activated (Werner) - QPtrList m_veryHackyActionList; - QSplitter *m_splitter; + TQPtrList m_veryHackyActionList; + TQSplitter *m_splitter; KSelectAction *m_orientation; KAction *m_removeView; KoMainWindowIface *m_dcopObject; - QPtrList m_toolbarList; + TQPtrList m_toolbarList; bool bMainWindowGUIBuilt; bool m_splitted; @@ -177,7 +177,7 @@ public: bool m_isExporting; KURL m_lastExportURL; - QCString m_lastExportFormat; + TQCString m_lastExportFormat; int m_lastExportSpecialOutputFlag; KSharedPtr m_koSpeaker; @@ -192,54 +192,54 @@ KoMainWindow::KoMainWindow( KInstance *instance, const char* name ) d->m_manager = new KoPartManager( this ); - connect( d->m_manager, SIGNAL( activePartChanged( KParts::Part * ) ), - this, SLOT( slotActivePartChanged( KParts::Part * ) ) ); + connect( d->m_manager, TQT_SIGNAL( activePartChanged( KParts::Part * ) ), + TQT_TQOBJECT(this), TQT_SLOT( slotActivePartChanged( KParts::Part * ) ) ); if ( instance ) setInstance( instance, false ); // don't load plugins! we don't want // the part's plugins with this shell, even though we are using the // part's instance! (Simon) - QString doc; - QStringList allFiles = KGlobal::dirs()->findAllResources( "data", "koffice/koffice_shell.rc" ); + TQString doc; + TQStringList allFiles = KGlobal::dirs()->findAllResources( "data", "koffice/koffice_shell.rc" ); setXMLFile( findMostRecentXMLFile( allFiles, doc ) ); setLocalXMLFile( locateLocal( "data", "koffice/koffice_shell.rc" ) ); - KStdAction::openNew( this, SLOT( slotFileNew() ), actionCollection(), "file_new" ); - KStdAction::open( this, SLOT( slotFileOpen() ), actionCollection(), "file_open" ); - m_recent = KStdAction::openRecent( this, SLOT(slotFileOpenRecent(const KURL&)), actionCollection() ); - d->m_paSave = KStdAction::save( this, SLOT( slotFileSave() ), actionCollection(), "file_save" ); - d->m_paSaveAs = KStdAction::saveAs( this, SLOT( slotFileSaveAs() ), actionCollection(), "file_save_as" ); - d->m_paPrint = KStdAction::print( this, SLOT( slotFilePrint() ), actionCollection(), "file_print" ); - d->m_paPrintPreview = KStdAction::printPreview( this, SLOT( slotFilePrintPreview() ), actionCollection(), "file_print_preview" ); - d->m_sendfile = KStdAction::mail( this, SLOT( slotEmailFile() ), actionCollection(), "file_send_file"); + KStdAction::openNew( TQT_TQOBJECT(this), TQT_SLOT( slotFileNew() ), actionCollection(), "file_new" ); + KStdAction::open( TQT_TQOBJECT(this), TQT_SLOT( slotFileOpen() ), actionCollection(), "file_open" ); + m_recent = KStdAction::openRecent( TQT_TQOBJECT(this), TQT_SLOT(slotFileOpenRecent(const KURL&)), actionCollection() ); + d->m_paSave = KStdAction::save( TQT_TQOBJECT(this), TQT_SLOT( slotFileSave() ), actionCollection(), "file_save" ); + d->m_paSaveAs = KStdAction::saveAs( TQT_TQOBJECT(this), TQT_SLOT( slotFileSaveAs() ), actionCollection(), "file_save_as" ); + d->m_paPrint = KStdAction::print( TQT_TQOBJECT(this), TQT_SLOT( slotFilePrint() ), actionCollection(), "file_print" ); + d->m_paPrintPreview = KStdAction::printPreview( TQT_TQOBJECT(this), TQT_SLOT( slotFilePrintPreview() ), actionCollection(), "file_print_preview" ); + d->m_sendfile = KStdAction::mail( TQT_TQOBJECT(this), TQT_SLOT( slotEmailFile() ), actionCollection(), "file_send_file"); - d->m_paCloseFile = KStdAction::close( this, SLOT( slotFileClose() ), actionCollection(), "file_close" ); - KStdAction::quit( this, SLOT( slotFileQuit() ), actionCollection(), "file_quit" ); + d->m_paCloseFile = KStdAction::close( TQT_TQOBJECT(this), TQT_SLOT( slotFileClose() ), actionCollection(), "file_close" ); + KStdAction::quit( TQT_TQOBJECT(this), TQT_SLOT( slotFileQuit() ), actionCollection(), "file_quit" ); d->m_reloadfile = new KAction( i18n( "Reload"), 0, - this, SLOT( slotReloadFile() ), + TQT_TQOBJECT(this), TQT_SLOT( slotReloadFile() ), actionCollection(), "file_reload_file"); d->m_versionsfile = new KAction( i18n( "Versions..."), 0, - this, SLOT( slotVersionsFile() ), + TQT_TQOBJECT(this), TQT_SLOT( slotVersionsFile() ), actionCollection(), "file_versions_file"); d->m_importFile = new KAction( i18n( "I&mport..." ), 0, // clashing accel key :( - this, SLOT( slotImportFile() ), + TQT_TQOBJECT(this), TQT_SLOT( slotImportFile() ), actionCollection(), "file_import_file"); d->m_exportFile = new KAction( i18n( "E&xport..." ), 0, - this, SLOT( slotExportFile() ), + TQT_TQOBJECT(this), TQT_SLOT( slotExportFile() ), actionCollection(), "file_export_file"); /* The following entry opens the document information dialog. Since the action is named so it intends to show data this entry should not have a trailing ellipses (...). */ d->m_paDocInfo = new KAction( i18n( "&Document Information" ), "documentinfo", 0, - this, SLOT( slotDocumentInfo() ), + TQT_TQOBJECT(this), TQT_SLOT( slotDocumentInfo() ), actionCollection(), "file_documentinfo" ); - KStdAction::keyBindings( this, SLOT( slotConfigureKeys() ), actionCollection() ); - KStdAction::configureToolbars( this, SLOT( slotConfigureToolbars() ), actionCollection() ); + KStdAction::keyBindings( TQT_TQOBJECT(this), TQT_SLOT( slotConfigureKeys() ), actionCollection() ); + KStdAction::configureToolbars( TQT_TQOBJECT(this), TQT_SLOT( slotConfigureToolbars() ), actionCollection() ); d->m_paDocInfo->setEnabled( false ); d->m_paSaveAs->setEnabled( false ); @@ -253,35 +253,35 @@ KoMainWindow::KoMainWindow( KInstance *instance, const char* name ) d->m_sendfile->setEnabled( false); d->m_paCloseFile->setEnabled( false); - d->m_splitter=new QSplitter(Qt::Vertical, this, "mw-splitter"); + d->m_splitter=new TQSplitter(Qt::Vertical, this, "mw-splitter"); setCentralWidget( d->m_splitter ); // Keyboard accessibility enhancements. new KKbdAccessExtensions(this, "mw-panelSizer"); // set up the action "list" for "Close all Views" (hacky :) (Werner) d->m_veryHackyActionList.append( new KAction(i18n("&Close All Views"), "fileclose", - "ctrl+shift+w", this, SLOT(slotCloseAllViews()), + "ctrl+shift+w", TQT_TQOBJECT(this), TQT_SLOT(slotCloseAllViews()), actionCollection(), "view_closeallviews") ); // set up the action list for the splitter stuff d->m_splitViewActionList.append(new KAction(i18n("&Split View"), "view_split", 0, - this, SLOT(slotSplitView()), + TQT_TQOBJECT(this), TQT_SLOT(slotSplitView()), actionCollection(), "view_split")); d->m_removeView=new KAction(i18n("&Remove View"), "view_remove", 0, - this, SLOT(slotRemoveView()), + TQT_TQOBJECT(this), TQT_SLOT(slotRemoveView()), actionCollection(), "view_rm_splitter"); d->m_splitViewActionList.append(d->m_removeView); d->m_removeView->setEnabled(false); - d->m_orientation=new KSelectAction(i18n("Splitter &Orientation"), "view_orientation", 0, - this, SLOT(slotSetOrientation()), + d->m_orientation=new KSelectAction(i18n("Splitter &Qt::Orientation"), "view_orientation", 0, + TQT_TQOBJECT(this), TQT_SLOT(slotSetOrientation()), actionCollection(), "view_splitter_orientation"); - QStringList items; + TQStringList items; items << i18n("&Vertical") << i18n("&Horizontal"); d->m_orientation->setItems(items); d->m_orientation->setCurrentItem(static_cast(d->m_splitter->orientation())); d->m_splitViewActionList.append(d->m_orientation); - d->m_splitViewActionList.append(new KActionSeparator(this)); + d->m_splitViewActionList.append(new KActionSeparator(TQT_TQOBJECT(this))); // Load list of recent files KConfig * config = instance ? instance->config() : KGlobal::config(); @@ -322,7 +322,7 @@ KoMainWindow::~KoMainWindow() // safety first ;) d->m_manager->setActivePart(0); - if(d->m_rootViews.findRef(d->m_activeView)==-1) { + if(d->m_rootViews.tqfindRef(d->m_activeView)==-1) { delete d->m_activeView; d->m_activeView=0L; } @@ -357,7 +357,7 @@ void KoMainWindow::setRootDocument( KoDocument *doc ) } //kdDebug(30003) << "KoMainWindow::setRootDocument this = " << this << " doc = " << doc << endl; - QPtrList oldRootViews = d->m_rootViews; + TQPtrList oldRootViews = d->m_rootViews; d->m_rootViews.clear(); KoDocument *oldRootDoc = d->m_rootDoc; @@ -375,7 +375,7 @@ void KoMainWindow::setRootDocument( KoDocument *doc ) d->m_rootViews.current()->show(); // The addShell has been done already if using openURL - if ( !d->m_rootDoc->shells().contains( this ) ) + if ( !d->m_rootDoc->shells().tqcontains( this ) ) d->m_rootDoc->addShell( this ); d->m_removeView->setEnabled(false); d->m_orientation->setEnabled(false); @@ -417,7 +417,7 @@ void KoMainWindow::updateVersionsFileAction(KoDocument *doc) } -void KoMainWindow::setRootDocumentDirect( KoDocument *doc, const QPtrList & views ) +void KoMainWindow::setRootDocumentDirect( KoDocument *doc, const TQPtrList & views ) { d->m_rootDoc = doc; d->m_rootViews = views; @@ -442,10 +442,10 @@ void KoMainWindow::addRecentURL( const KURL& url ) bool ok = true; if ( url.isLocalFile() ) { - QString path = url.path( -1 ); - QStringList tmpDirs = KGlobal::dirs()->resourceDirs( "tmp" ); - for ( QStringList::Iterator it = tmpDirs.begin() ; ok && it != tmpDirs.end() ; ++it ) - if ( path.contains( *it ) ) + TQString path = url.path( -1 ); + TQStringList tmpDirs = KGlobal::dirs()->resourceDirs( "tmp" ); + for ( TQStringList::Iterator it = tmpDirs.begin() ; ok && it != tmpDirs.end() ; ++it ) + if ( path.tqcontains( *it ) ) ok = false; // it's in the tmp resource if ( ok ) KRecentDocument::add(path); @@ -492,32 +492,32 @@ void KoMainWindow::updateCaption() { //kdDebug(30003) << "KoMainWindow::updateCaption()" << endl; if ( !d->m_rootDoc ) - setCaption(QString::null); + setCaption(TQString()); else if ( rootDocument()->isCurrent() ) { - QString caption; + TQString caption; // Get caption from document info (title(), in about page) if ( rootDocument()->documentInfo() ) { - KoDocumentInfoPage * page = rootDocument()->documentInfo()->page( QString::fromLatin1("about") ); + KoDocumentInfoPage * page = rootDocument()->documentInfo()->page( TQString::tqfromLatin1("about") ); if (page) caption = static_cast(page)->title(); } - const QString url = rootDocument()->url().prettyURL( 0, KURL::StripFileProtocol ); + const TQString url = rootDocument()->url().prettyURL( 0, KURL::StripFileProtocol ); if ( !caption.isEmpty() && !url.isEmpty() ) - caption = QString( "%1 - %2" ).arg( caption ).arg( url ); + caption = TQString( "%1 - %2" ).tqarg( caption ).tqarg( url ); else if ( caption.isEmpty() ) caption = url; setCaption( caption, rootDocument()->isModified() ); if ( !rootDocument()->url().fileName(false).isEmpty() ) - d->m_paSave->setToolTip( i18n("Save as %1").arg(rootDocument()->url().fileName(false)) ); + d->m_paSave->setToolTip( i18n("Save as %1").tqarg(rootDocument()->url().fileName(false)) ); else d->m_paSave->setToolTip( i18n("Save") ); } } -void KoMainWindow::updateCaption( QString caption, bool mod ) +void KoMainWindow::updateCaption( TQString caption, bool mod ) { //kdDebug(30003)<<"KoMainWindow::updateCaption("<m_rootViews.find(d->m_activeView)!=-1) + if(d->m_rootViews.tqfind(d->m_activeView)!=-1) return d->m_activeView; return d->m_rootViews.first(); } @@ -544,7 +544,7 @@ bool KoMainWindow::openDocument( const KURL & url ) { if ( !KIO::NetAccess::exists(url,true,0) ) { - KMessageBox::error(0L, i18n("The file %1 does not exist.").arg(url.url()) ); + KMessageBox::error(0L, i18n("The file %1 does not exist.").tqarg(url.url()) ); m_recent->removeURL(url); //remove the file from the recent-opened-file-list saveRecentFiles(); return false; @@ -564,7 +564,7 @@ bool KoMainWindow::openDocument( KoDocument *newdoc, const KURL & url ) setRootDocument( newdoc ); newdoc->setURL(url); - QString mime = KMimeType::findByURL(url)->name(); + TQString mime = KMimeType::findByURL(url)->name(); if ( mime.isEmpty() || mime == KMimeType::defaultMimeType() ) mime = newdoc->nativeFormatMimeType(); if ( url.isLocalFile() ) // workaround for kde<=3.3 kparts bug, fixed for 3.4 @@ -587,9 +587,9 @@ bool KoMainWindow::openDocumentInternal( const KURL & url, KoDocument *newdoc ) return false; d->m_firstTime=true; - connect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int))); - connect(newdoc, SIGNAL(completed()), this, SLOT(slotLoadCompleted())); - connect(newdoc, SIGNAL(canceled( const QString & )), this, SLOT(slotLoadCanceled( const QString & ))); + connect(newdoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int))); + connect(newdoc, TQT_SIGNAL(completed()), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCompleted())); + connect(newdoc, TQT_SIGNAL(canceled( const TQString & )), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCanceled( const TQString & ))); newdoc->addShell( this ); // used by openURL bool openRet = (!isImporting ()) ? newdoc->openURL(url) : newdoc->import(url); if(!openRet) @@ -630,12 +630,12 @@ void KoMainWindow::slotLoadCompleted() // We had no document, set the new one setRootDocument( newdoc ); } - disconnect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int))); - disconnect(newdoc, SIGNAL(completed()), this, SLOT(slotLoadCompleted())); - disconnect(newdoc, SIGNAL(canceled( const QString & )), this, SLOT(slotLoadCanceled( const QString & ))); + disconnect(newdoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int))); + disconnect(newdoc, TQT_SIGNAL(completed()), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCompleted())); + disconnect(newdoc, TQT_SIGNAL(canceled( const TQString & )), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCanceled( const TQString & ))); } -void KoMainWindow::slotLoadCanceled( const QString & errMsg ) +void KoMainWindow::slotLoadCanceled( const TQString & errMsg ) { kdDebug(30003) << "KoMainWindow::slotLoadCanceled" << endl; if ( !errMsg.isEmpty() ) // empty when canceled by user @@ -643,15 +643,15 @@ void KoMainWindow::slotLoadCanceled( const QString & errMsg ) // ... can't delete the document, it's the one who emitted the signal... KoDocument* newdoc = (KoDocument *)(sender()); - disconnect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int))); - disconnect(newdoc, SIGNAL(completed()), this, SLOT(slotLoadCompleted())); - disconnect(newdoc, SIGNAL(canceled( const QString & )), this, SLOT(slotLoadCanceled( const QString & ))); + disconnect(newdoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int))); + disconnect(newdoc, TQT_SIGNAL(completed()), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCompleted())); + disconnect(newdoc, TQT_SIGNAL(canceled( const TQString & )), TQT_TQOBJECT(this), TQT_SLOT(slotLoadCanceled( const TQString & ))); newdoc->removeShell(this); delete newdoc; } -void KoMainWindow::slotSaveCanceled( const QString &errMsg ) +void KoMainWindow::slotSaveCanceled( const TQString &errMsg ) { kdDebug(30003) << "KoMainWindow::slotSaveCanceled" << endl; if ( !errMsg.isEmpty() ) // empty when canceled by user @@ -663,21 +663,21 @@ void KoMainWindow::slotSaveCompleted() { kdDebug(30003) << "KoMainWindow::slotSaveCompleted" << endl; KoDocument* pDoc = (KoDocument *)(sender()); - disconnect(pDoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int))); - disconnect(pDoc, SIGNAL(completed()), this, SLOT(slotSaveCompleted())); - disconnect(pDoc, SIGNAL(canceled( const QString & )), - this, SLOT(slotSaveCanceled( const QString & ))); + disconnect(pDoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int))); + disconnect(pDoc, TQT_SIGNAL(completed()), TQT_TQOBJECT(this), TQT_SLOT(slotSaveCompleted())); + disconnect(pDoc, TQT_SIGNAL(canceled( const TQString & )), + TQT_TQOBJECT(this), TQT_SLOT(slotSaveCanceled( const TQString & ))); } // returns true if we should save, false otherwise. -bool KoMainWindow::exportConfirmation( const QCString &outputFormat ) +bool KoMainWindow::exportConfirmation( const TQCString &outputFormat ) { if (!rootDocument()->wantExportConfirmation()) return true; KMimeType::Ptr mime = KMimeType::mimeType( outputFormat ); const bool neverHeardOfIt = ( mime->name() == KMimeType::defaultMimeType() ); - QString comment = neverHeardOfIt ? - i18n( "%1 (unknown file type)" ).arg( outputFormat ) + TQString comment = neverHeardOfIt ? + i18n( "%1 (unknown file type)" ).tqarg( outputFormat.data() ) : mime->comment(); // Warn the user @@ -689,7 +689,7 @@ bool KoMainWindow::exportConfirmation( const QCString &outputFormat ) this, i18n( "Saving as a %1 may result in some loss of formatting." "

Do you still want to save in this format?" ) - .arg( QString( "%1" ).arg( comment ) ), // in case we want to remove the bold later + .tqarg( TQString( "%1" ).tqarg( comment ) ), // in case we want to remove the bold later i18n( "Confirm Save" ), KStdGuiItem::save (), "NonNativeSaveConfirmation", @@ -703,7 +703,7 @@ bool KoMainWindow::exportConfirmation( const QCString &outputFormat ) this, i18n( "Exporting as a %1 may result in some loss of formatting." "

Do you still want to export to this format?" ) - .arg( QString( "%1" ).arg( comment ) ), // in case we want to remove the bold later + .tqarg( TQString( "%1" ).tqarg( comment ) ), // in case we want to remove the bold later i18n( "Confirm Export" ), i18n ("Export"), "NonNativeExportConfirmation", // different to the one used for Save (above) @@ -730,20 +730,20 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent ) else reset_url = false; - connect(pDoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int))); - connect(pDoc, SIGNAL(completed()), this, SLOT(slotSaveCompleted())); - connect(pDoc, SIGNAL(canceled( const QString & )), - this, SLOT(slotSaveCanceled( const QString & ))); + connect(pDoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int))); + connect(pDoc, TQT_SIGNAL(completed()), TQT_TQOBJECT(this), TQT_SLOT(slotSaveCompleted())); + connect(pDoc, TQT_SIGNAL(canceled( const TQString & )), + TQT_TQOBJECT(this), TQT_SLOT(slotSaveCanceled( const TQString & ))); KURL oldURL = pDoc->url(); - QString oldFile = pDoc->file(); - QCString _native_format = pDoc->nativeFormatMimeType(); - QCString oldOutputFormat = pDoc->outputMimeType(); + TQString oldFile = pDoc->file(); + TQCString _native_format = pDoc->nativeFormatMimeType(); + TQCString oldOutputFormat = pDoc->outputMimeType(); int oldSpecialOutputFlag = pDoc->specialOutputFlag(); KURL suggestedURL = pDoc->url(); - QStringList mimeFilter = KoFilterManager::mimeFilter( _native_format, KoFilterManager::Export, pDoc->extraNativeMimeTypes() ); - if (mimeFilter.findIndex (oldOutputFormat) < 0 && !isExporting()) + TQStringList mimeFilter = KoFilterManager::mimeFilter( _native_format, KoFilterManager::Export, pDoc->extraNativeMimeTypes() ); + if (mimeFilter.tqfindIndex (oldOutputFormat) < 0 && !isExporting()) { kdDebug(30003) << "KoMainWindow::saveDocument no export filter for '" << oldOutputFormat << "'" << endl; @@ -751,13 +751,13 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent ) // dialog and then tries to just plain Save --- // suggest a different filename extension (yes, we fortunately don't all live in a world of magic :)) - QString suggestedFilename = suggestedURL.fileName (); + TQString suggestedFilename = suggestedURL.fileName (); if ( !suggestedFilename.isEmpty () ) // ".kwd" looks strange for a name { - int c = suggestedFilename.findRev ('.'); + int c = suggestedFilename.tqfindRev ('.'); KMimeType::Ptr mime = KMimeType::mimeType( _native_format ); - QString ext = mime->property( "X-KDE-NativeExtension" ).toString(); + TQString ext = mime->property( "X-KDE-NativeExtension" ).toString(); if (!ext.isEmpty ()) { if (c < 0) @@ -790,7 +790,7 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent ) bool justChangingFilterOptions = false; KoFileDialog *dialog = new KoFileDialog( (isExporting() && !d->m_lastExportURL.isEmpty() )? d->m_lastExportURL.url () : suggestedURL.url (), - QString::null, this, "file dialog", true); + TQString(), this, "file dialog", true); if (!isExporting()) dialog->setCaption( i18n("Save Document As") ); @@ -805,12 +805,12 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent ) pDoc->supportedSpecialFormats() ); KURL newURL; - QCString outputFormat = _native_format; + TQCString outputFormat = _native_format; int specialOutputFlag = 0; bool bOk; do { bOk=true; - if(dialog->exec()==QDialog::Accepted) { + if(dialog->exec()==TQDialog::Accepted) { newURL=dialog->selectedURL(); outputFormat=dialog->currentMimeFilter().latin1(); specialOutputFlag = dialog->specialEntrySelected(); @@ -839,7 +839,7 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent ) // adjust URL before doing checks on whether the file exists. if ( specialOutputFlag == KoDocument::SaveAsDirectoryStore ) { - QString fileName = newURL.fileName(); + TQString fileName = newURL.fileName(); if ( fileName != "content.xml" ) { newURL.addPath( "content.xml" ); } @@ -884,7 +884,7 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent ) // (not Save As) they won't be expecting that they are // using their File/Export settings // - // As a bad side-effect of this, the modified flag will not + // As a bad side-effect of TQT_TQOBJECT(this), the modified flag will not // be updated and it is possible that what is currently on // their screen is not what is stored on disk (through loss // of formatting). But if you are dumb enough to change @@ -979,7 +979,7 @@ bool KoMainWindow::saveDocument( bool saveas, bool silent ) return ret; } -void KoMainWindow::closeEvent(QCloseEvent *e) { +void KoMainWindow::closeEvent(TQCloseEvent *e) { if(queryClose()) { saveWindowSettings(); setRootDocument(0L); @@ -1004,7 +1004,7 @@ void KoMainWindow::saveWindowSettings() } } -void KoMainWindow::resizeEvent( QResizeEvent * e ) +void KoMainWindow::resizeEvent( TQResizeEvent * e ) { d->m_windowSizeDirty = true; KParts::MainWindow::resizeEvent( e ); @@ -1027,7 +1027,7 @@ bool KoMainWindow::queryClose() // main doc + internally stored child documents if ( d->m_rootDoc->isModified() ) { - QString name; + TQString name; if ( rootDocument()->documentInfo() ) { name = rootDocument()->documentInfo()->title(); @@ -1039,8 +1039,8 @@ bool KoMainWindow::queryClose() name = i18n( "Untitled" ); int res = KMessageBox::warningYesNoCancel( this, - i18n( "

The document '%1' has been modified.

Do you want to save it?

" ).arg(name), - QString::null, + i18n( "

The document '%1' has been modified.

Do you want to save it?

" ).tqarg(name), + TQString(), KStdGuiItem::save(), KStdGuiItem::discard()); @@ -1079,8 +1079,8 @@ void KoMainWindow::chooseNewDocument( int /*KoDocument::InitDocFlags*/ initDocFl return; //FIXME: This needs to be handled differently - connect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int))); - disconnect(newdoc, SIGNAL(sigProgress(int)), this, SLOT(slotProgress(int))); + connect(newdoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int))); + disconnect(newdoc, TQT_SIGNAL(sigProgress(int)), TQT_TQOBJECT(this), TQT_SLOT(slotProgress(int))); if ( ( !doc && ( initDocFlags == KoDocument::InitDocFileNew ) ) || ( doc && !doc->isEmpty() ) ) { @@ -1108,18 +1108,18 @@ void KoMainWindow::slotFileNew() void KoMainWindow::slotFileOpen() { - KFileDialog *dialog = new KFileDialog(":OpenDialog", QString::null, this, "file dialog", true); + KFileDialog *dialog = new KFileDialog(":OpenDialog", TQString(), this, "file dialog", true); if (!isImporting()) dialog->setCaption( i18n("Open Document") ); else dialog->setCaption( i18n("Import Document") ); // The few lines below need to be kept in sync with KoTemplateChooseDia::setupFileDialog - const QStringList mimeFilter = KoFilterManager::mimeFilter( KoDocument::readNativeFormatMimeType(), + const TQStringList mimeFilter = KoFilterManager::mimeFilter( KoDocument::readNativeFormatMimeType(), KoFilterManager::Import, KoDocument::readExtraNativeMimeTypes() ); dialog->setMimeFilter( mimeFilter ); - if(dialog->exec()!=QDialog::Accepted) { + if(dialog->exec()!=TQDialog::Accepted) { delete dialog; return; } @@ -1194,14 +1194,14 @@ void KoMainWindow::print(bool quick) { return; } - KPrinter printer( true /*, QPrinter::HighResolution*/ ); - QString title = rootView()->koDocument()->documentInfo()->title(); - QString fileName = rootView()->koDocument()->url().fileName(); + KPrinter printer( true /*, TQPrinter::HighResolution*/ ); + TQString title = rootView()->koDocument()->documentInfo()->title(); + TQString fileName = rootView()->koDocument()->url().fileName(); // strip off the native extension (I don't want foobar.kwd.ps when printing into a file) KMimeType::Ptr mime = KMimeType::mimeType( rootView()->koDocument()->outputMimeType() ); if ( mime ) { - QString extension = mime->property( "X-KDE-NativeExtension" ).toString(); + TQString extension = mime->property( "X-KDE-NativeExtension" ).toString(); if ( fileName.endsWith( extension ) ) fileName.truncate( fileName.length() - extension.length() ); @@ -1211,8 +1211,8 @@ void KoMainWindow::print(bool quick) { title = fileName; if ( title.isEmpty() ) { // #139905 - breaks message freeze though - //const QString programName = instance()->aboutData() ? instance()->aboutData()->programName() : instance()->instanceName(); - //title = i18n("%1 unsaved document (%2)").arg(programName).arg(KGlobal::locale()->formatDate(QDate::currentDate(), true/*short*/)); + //const TQString programName = instance()->aboutData() ? instance()->aboutData()->programName() : instance()->instanceName(); + //title = i18n("%1 unsaved document (%2)").tqarg(programName).tqarg(KGlobal::locale()->formatDate(TQDate::tqcurrentDate(), true/*short*/)); } printer.setDocName( title ); printer.setDocFileName( fileName ); @@ -1249,13 +1249,13 @@ void KoMainWindow::slotFilePrintPreview() printer.setPreviewOnly( true ); rootView()->setupPrinter( printer ); - QString oldFileName = printer.outputFileName(); + TQString oldFileName = printer.outputFileName(); printer.setOutputFileName( tmpFile.name() ); int oldNumCopies = printer.numCopies(); printer.setNumCopies( 1 ); // Disable kdeprint's own preview, we'd get two. This shows that KPrinter needs // a "don't use the previous settings" mode. The current way is really too much of a hack. - QString oldKDEPreview = printer.option( "kde-preview" ); + TQString oldKDEPreview = printer.option( "kde-preview" ); printer.setOption( "kde-preview", "0" ); rootView()->print(printer); @@ -1277,7 +1277,7 @@ void KoMainWindow::slotConfigureToolbars() if (rootDocument()) saveMainWindowSettings( KGlobal::config(), rootDocument()->instance()->instanceName() ); KEditToolbar edit(factory(), this); - connect(&edit,SIGNAL(newToolbarConfig()),this,SLOT(slotNewToolbarConfig())); + connect(&edit,TQT_SIGNAL(newToolbarConfig()),this,TQT_SLOT(slotNewToolbarConfig())); (void) edit.exec(); } @@ -1296,7 +1296,7 @@ void KoMainWindow::slotNewToolbarConfig() d->m_veryHackyActionList); // This one only for root views - if(d->m_rootViews.findRef(d->m_activeView)!=-1) + if(d->m_rootViews.tqfindRef(d->m_activeView)!=-1) factory->plugActionList(d->m_activeView, "view_split", d->m_splitViewActionList ); plugActionList( "toolbarlist", d->m_toolbarList ); @@ -1306,7 +1306,7 @@ void KoMainWindow::slotToolbarToggled( bool toggle ) { //kdDebug(30003) << "KoMainWindow::slotToolbarToggled " << sender()->name() << " toggle=" << true << endl; // The action (sender) and the toolbar have the same name - KToolBar * bar = toolBar( sender()->name() ); + KToolBar * bar = toolBar( TQT_TQOBJECT(const_cast(sender()))->name() ); if (bar) { if (toggle) @@ -1318,18 +1318,18 @@ void KoMainWindow::slotToolbarToggled( bool toggle ) saveMainWindowSettings( KGlobal::config(), rootDocument()->instance()->instanceName() ); } else - kdWarning(30003) << "slotToolbarToggled : Toolbar " << sender()->name() << " not found!" << endl; + kdWarning(30003) << "slotToolbarToggled : Toolbar " << TQT_TQOBJECT(const_cast(sender()))->name() << " not found!" << endl; } bool KoMainWindow::toolbarIsVisible(const char *tbName) { - QWidget *tb = toolBar( tbName); + TQWidget *tb = toolBar( tbName); return !tb->isHidden(); } void KoMainWindow::showToolbar( const char * tbName, bool shown ) { - QWidget * tb = toolBar( tbName ); + TQWidget * tb = toolBar( tbName ); if ( !tb ) { kdWarning(30003) << "KoMainWindow: toolbar " << tbName << " not found." << endl; @@ -1341,7 +1341,7 @@ void KoMainWindow::showToolbar( const char * tbName, bool shown ) tb->hide(); // Update the action appropriately - QPtrListIterator it( d->m_toolbarList ); + TQPtrListIterator it( d->m_toolbarList ); for ( ; it.current() ; ++it ) if ( !strcmp( it.current()->name(), tbName ) ) { @@ -1370,7 +1370,7 @@ void KoMainWindow::slotCloseAllViews() { if(d->m_rootDoc && d->m_rootDoc->isEmbedded()) { hide(); d->m_rootDoc->removeShell(this); - QPtrListIterator it(d->m_rootDoc->shells()); + TQPtrListIterator it(d->m_rootDoc->shells()); while (it.current()) { it.current()->hide(); delete it.current(); // this updates the lists' current pointer and thus @@ -1388,7 +1388,7 @@ void KoMainWindow::slotCloseAllViews() { void KoMainWindow::slotRemoveView() { KoView *view; - if(d->m_rootViews.findRef(d->m_activeView)!=-1) + if(d->m_rootViews.tqfindRef(d->m_activeView)!=-1) view=d->m_rootViews.current(); else view=d->m_rootViews.first(); @@ -1435,10 +1435,10 @@ void KoMainWindow::slotProgress(int value) { { // The statusbar might not even be created yet. // So check for that first, and create it if necessary - QObjectList *l = queryList( "QStatusBar" ); + TQObjectList *l = queryList( "TQStatusBar" ); if ( !l || !l->first() ) { statusBar()->show(); - QApplication::sendPostedEvents( this, QEvent::ChildInserted ); + TQApplication::sendPostedEvents( TQT_TQOBJECT(this), TQEvent::ChildInserted ); setUpLayout(); } delete l; @@ -1467,7 +1467,7 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart ) // This looks very much like KParts::MainWindow::createGUI, but we have // to reimplement it because it works with an active part, whereas we work // with an active view _and_ an active part, depending for what. - // Both are KXMLGUIClients, but e.g. the plugin query needs a QObject. + // Both are KXMLGUIClients, but e.g. the plugin query needs a TQObject. //kdDebug(30003) << "KoMainWindow::slotActivePartChanged( Part * newPart) newPart = " << newPart << endl; //kdDebug(30003) << "current active part is " << d->m_activePart << endl; @@ -1484,8 +1484,8 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart ) if ( d->m_activeView ) { KParts::GUIActivateEvent ev( false ); - QApplication::sendEvent( d->m_activePart, &ev ); - QApplication::sendEvent( d->m_activeView, &ev ); + TQApplication::sendEvent( d->m_activePart, &ev ); + TQApplication::sendEvent( d->m_activeView, &ev ); factory->removeClient( d->m_activeView ); @@ -1497,7 +1497,7 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart ) if ( !d->bMainWindowGUIBuilt ) { // Load mainwindow plugins - KParts::Plugin::loadPlugins( this, this, instance(), true ); + KParts::Plugin::loadPlugins( TQT_TQOBJECT(this), this, instance(), true ); createShellGUI(); } @@ -1514,25 +1514,25 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart ) factory->plugActionList(d->m_activeView, "view_closeallviews", d->m_veryHackyActionList); // This one only for root views - if(d->m_rootViews.findRef(d->m_activeView)!=-1) + if(d->m_rootViews.tqfindRef(d->m_activeView)!=-1) factory->plugActionList(d->m_activeView, "view_split", d->m_splitViewActionList ); // Position and show toolbars according to user's preference setAutoSaveSettings( newPart->instance()->instanceName(), false ); // Create and plug toolbar list for Settings menu - //QPtrListIterator it = toolBarIterator(); - QPtrList toolBarList = factory->containers( "ToolBar" ); - QPtrListIterator it( toolBarList ); + //TQPtrListIterator it = toolBarIterator(); + TQPtrList toolBarList = factory->containers( "ToolBar" ); + TQPtrListIterator it( toolBarList ); for ( ; it.current() ; ++it ) { if ( it.current()->inherits("KToolBar") ) { KToolBar * tb = static_cast(it.current()); - KToggleAction * act = new KToggleAction( i18n("Show %1 Toolbar").arg( tb->text() ), 0, + KToggleAction * act = new KToggleAction( i18n("Show %1 Toolbar").tqarg( tb->text() ), 0, actionCollection(), tb->name() ); - act->setCheckedState(i18n("Hide %1 Toolbar").arg( tb->text() )); - connect( act, SIGNAL( toggled( bool ) ), this, SLOT( slotToolbarToggled( bool ) ) ); + act->setCheckedState(i18n("Hide %1 Toolbar").tqarg( tb->text() )); + connect( act, TQT_SIGNAL( toggled( bool ) ), TQT_TQOBJECT(this), TQT_SLOT( slotToolbarToggled( bool ) ) ); act->setChecked ( !tb->isHidden() ); d->m_toolbarList.append( act ); } @@ -1544,8 +1544,8 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart ) // Send the GUIActivateEvent only now, since it might show/hide toolbars too // (and this has priority over applyMainWindowSettings) KParts::GUIActivateEvent ev( true ); - QApplication::sendEvent( d->m_activePart, &ev ); - QApplication::sendEvent( d->m_activeView, &ev ); + TQApplication::sendEvent( d->m_activePart, &ev ); + TQApplication::sendEvent( d->m_activeView, &ev ); } else { @@ -1555,11 +1555,11 @@ void KoMainWindow::slotActivePartChanged( KParts::Part *newPart ) setUpdatesEnabled( true ); } -QLabel * KoMainWindow::statusBarLabel() +TQLabel * KoMainWindow::statusBarLabel() { if ( !d->statusBarLabel ) { - d->statusBarLabel = new QLabel( statusBar() ); + d->statusBarLabel = new TQLabel( statusBar() ); statusBar()->addWidget( d->statusBarLabel, 1, true ); } return d->statusBarLabel; @@ -1588,16 +1588,16 @@ void KoMainWindow::slotEmailFile() // Subject = Document file name // Attachment = The current file // Message Body = The current document in HTML export? <-- This may be an option. - QString theSubject; - QStringList urls; - QString fileURL; + TQString theSubject; + TQStringList urls; + TQString fileURL; if (rootDocument()->url ().isEmpty () || rootDocument()->isModified()) { //Save the file as a temporary file bool const tmp_modified = rootDocument()->isModified(); KURL const tmp_url = rootDocument()->url(); - QCString const tmp_mimetype = rootDocument()->outputMimeType(); + TQCString const tmp_mimetype = rootDocument()->outputMimeType(); KTempFile tmpfile; //TODO: The temorary file should be deleted when the mail program is closed KURL u; u.setPath(tmpfile.name()); @@ -1618,7 +1618,7 @@ void KoMainWindow::slotEmailFile() else { fileURL = rootDocument()->url().url(); - theSubject = i18n("Document - %1").arg(rootDocument()->url().fileName(false)); + theSubject = i18n("Document - %1").tqarg(rootDocument()->url().fileName(false)); urls.append( fileURL ); } @@ -1626,9 +1626,9 @@ void KoMainWindow::slotEmailFile() if (!fileURL.isEmpty()) { - kapp->invokeMailer(QString::null, QString::null, QString::null, theSubject, - QString::null, //body - QString::null, + kapp->invokeMailer(TQString(), TQString(), TQString(), theSubject, + TQString(), //body + TQString(), urls); // attachments } } diff --git a/lib/kofficecore/KoMainWindow.h b/lib/kofficecore/KoMainWindow.h index 2b738db94..f1dd6419f 100644 --- a/lib/kofficecore/KoMainWindow.h +++ b/lib/kofficecore/KoMainWindow.h @@ -26,7 +26,7 @@ #include #include "KoDocument.h" -class QLabel; +class TQLabel; class KoView; class KoMainWindowPrivate; class KURL; @@ -43,7 +43,7 @@ namespace KParts * @brief Main window for a KOffice application * * This class is used to represent a main window - * of a KOffice component. Each main window contains + * of a KOffice component. Each main window tqcontains * a menubar and some toolbars. * * @note This class does NOT need to be subclassed in your application. @@ -51,6 +51,7 @@ namespace KParts class KOFFICECORE_EXPORT KoMainWindow : public KParts::MainWindow { Q_OBJECT + TQ_OBJECT public: /** @@ -111,9 +112,9 @@ public: /** * Get hold of the label in the statusbar, to write messages to it. - * You can also insert other items in the status bar by using QStatusBar::addWidget. + * You can also insert other items in the status bar by using TQStatusBar::addWidget. */ - QLabel * statusBarLabel(); + TQLabel * statusBarLabel(); /** * Sets the maximum number of recent documents entries. @@ -150,7 +151,7 @@ public: /** * Updates the window caption based on the document info and path. */ - virtual void updateCaption( const QString caption, bool mod ); + virtual void updateCaption( const TQString caption, bool mod ); void updateReloadFileAction(KoDocument *doc); void updateVersionsFileAction(KoDocument *doc); @@ -298,7 +299,7 @@ protected: // protected methods are mostly for koshell, it's the only one derivi * Special method for KOShell, to allow switching the root * document (and its views) among a set of them. */ - void setRootDocumentDirect( KoDocument *doc, const QPtrList & views ); + void setRootDocumentDirect( KoDocument *doc, const TQPtrList & views ); /** * Create a new empty document. @@ -318,8 +319,8 @@ protected: // protected methods are mostly for koshell, it's the only one derivi */ virtual bool saveDocument( bool saveas = false, bool silent = false ); - virtual void closeEvent( QCloseEvent * e ); - virtual void resizeEvent( QResizeEvent * e ); + virtual void closeEvent( TQCloseEvent * e ); + virtual void resizeEvent( TQResizeEvent * e ); /** * Ask user about saving changes to the document upon exit. @@ -363,7 +364,7 @@ private: * * @return true if the document should be saved */ - bool exportConfirmation( const QCString &outputFormat ); + bool exportConfirmation( const TQCString &outputFormat ); void saveWindowSettings(); @@ -375,9 +376,9 @@ protected slots: private slots: void slotProgress(int value); void slotLoadCompleted(); - void slotLoadCanceled (const QString &); + void slotLoadCanceled (const TQString &); void slotSaveCompleted(); - void slotSaveCanceled(const QString &); + void slotSaveCanceled(const TQString &); private: KoMainWindowPrivate *d; diff --git a/lib/kofficecore/KoMainWindowIface.cc b/lib/kofficecore/KoMainWindowIface.cc index 356bd80b1..6d38fae0f 100644 --- a/lib/kofficecore/KoMainWindowIface.cc +++ b/lib/kofficecore/KoMainWindowIface.cc @@ -27,7 +27,7 @@ #include KoMainWindowIface::KoMainWindowIface( KoMainWindow *mainwindow ) - : DCOPObject( mainwindow ) + : DCOPObject( TQT_TQOBJECT(mainwindow) ) { m_pMainWindow = mainwindow; m_actionProxy = new KDCOPActionProxy( mainwindow->actionCollection(), this ); @@ -38,7 +38,7 @@ KoMainWindowIface::~KoMainWindowIface() delete m_actionProxy; } -DCOPRef KoMainWindowIface::action( const QCString &name ) +DCOPRef KoMainWindowIface::action( const TQCString &name ) { return DCOPRef( kapp->dcopClient()->appId(), m_actionProxy->actionObjectId( name ) ); } @@ -46,16 +46,16 @@ DCOPRef KoMainWindowIface::action( const QCString &name ) QCStringList KoMainWindowIface::actions() { QCStringList res; - QValueList lst = m_actionProxy->actions(); - QValueList::ConstIterator it = lst.begin(); - QValueList::ConstIterator end = lst.end(); + TQValueList lst = m_actionProxy->actions(); + TQValueList::ConstIterator it = lst.begin(); + TQValueList::ConstIterator end = lst.end(); for (; it != end; ++it ) res.append( (*it)->name() ); return res; } -QMap KoMainWindowIface::actionMap() +TQMap KoMainWindowIface::actionMap() { return m_actionProxy->actionMap(); } diff --git a/lib/kofficecore/KoMainWindowIface.h b/lib/kofficecore/KoMainWindowIface.h index 6b7c3cb65..9a81bc4be 100644 --- a/lib/kofficecore/KoMainWindowIface.h +++ b/lib/kofficecore/KoMainWindowIface.h @@ -35,9 +35,9 @@ public: virtual ~KoMainWindowIface(); k_dcop: - DCOPRef action( const QCString &name ); + DCOPRef action( const TQCString &name ); QCStringList actions(); - QMap actionMap(); + TQMap actionMap(); ASYNC print(bool quick); protected: diff --git a/lib/kofficecore/KoOasisLoadingContext.cpp b/lib/kofficecore/KoOasisLoadingContext.cpp index fdad0ecce..e5082dc83 100644 --- a/lib/kofficecore/KoOasisLoadingContext.cpp +++ b/lib/kofficecore/KoOasisLoadingContext.cpp @@ -31,7 +31,7 @@ KoOasisLoadingContext::KoOasisLoadingContext( KoDocument* doc, { // Ideally this should be done by KoDocument and passed as argument here... KoOasisStore oasisStore( store ); - QString dummy; + TQString dummy; (void)oasisStore.loadAndParse( "tar:/META-INF/manifest.xml", m_manifestDoc, dummy ); } @@ -41,12 +41,12 @@ KoOasisLoadingContext::~KoOasisLoadingContext() } -void KoOasisLoadingContext::fillStyleStack( const QDomElement& object, const char* nsURI, const char* attrName, const char* family ) +void KoOasisLoadingContext::fillStyleStack( const TQDomElement& object, const char* nsURI, const char* attrName, const char* family ) { // find all styles associated with an object and push them on the stack if ( object.hasAttributeNS( nsURI, attrName ) ) { - const QString styleName = object.attributeNS( nsURI, attrName, QString::null ); - const QDomElement* style = 0; + const TQString styleName = object.attributeNS( nsURI, attrName, TQString() ); + const TQDomElement* style = 0; bool isStyleAutoStyle = false; if ( m_useStylesAutoStyles ) { // When loading something from styles.xml, look into the styles.xml auto styles first @@ -64,39 +64,39 @@ void KoOasisLoadingContext::fillStyleStack( const QDomElement& object, const cha } } -void KoOasisLoadingContext::addStyles( const QDomElement* style, const char* family, bool usingStylesAutoStyles ) +void KoOasisLoadingContext::addStyles( const TQDomElement* style, const char* family, bool usingStylesAutoStyles ) { Q_ASSERT( style ); if ( !style ) return; - // this recursive function is necessary as parent styles can have parents themselves - if ( style->hasAttributeNS( KoXmlNS::style, "parent-style-name" ) ) { - const QString parentStyleName = style->attributeNS( KoXmlNS::style, "parent-style-name", QString::null ); - const QDomElement* parentStyle = 0; + // this recursive function is necessary as tqparent styles can have tqparents themselves + if ( style->hasAttributeNS( KoXmlNS::style, "tqparent-style-name" ) ) { + const TQString tqparentStyleName = style->attributeNS( KoXmlNS::style, "tqparent-style-name", TQString() ); + const TQDomElement* tqparentStyle = 0; if ( usingStylesAutoStyles ) { // When loading something from styles.xml, look into the styles.xml auto styles first - parentStyle = m_styles.findStyleAutoStyle( parentStyleName, family ); + tqparentStyle = m_styles.findStyleAutoStyle( tqparentStyleName, family ); // and fallback to looking at styles(), which includes the user styles from styles.xml } - if ( !parentStyle ) - parentStyle = m_styles.findStyle( parentStyleName, family ); - if ( parentStyle ) - addStyles( parentStyle, family, usingStylesAutoStyles ); + if ( !tqparentStyle ) + tqparentStyle = m_styles.findStyle( tqparentStyleName, family ); + if ( tqparentStyle ) + addStyles( tqparentStyle, family, usingStylesAutoStyles ); else - kdWarning(32500) << "Parent style not found: " << parentStyleName << endl; + kdWarning(32500) << "Parent style not found: " << tqparentStyleName << endl; } else if ( family ) { - const QDomElement* def = m_styles.defaultStyle( family ); + const TQDomElement* def = m_styles.defaultStyle( family ); if ( def ) { // on top of all, the default style for this family - //kdDebug(32500) << "pushing default style " << style->attributeNS( KoXmlNS::style, "name", QString::null ) << endl; + //kdDebug(32500) << "pushing default style " << style->attributeNS( KoXmlNS::style, "name", TQString() ) << endl; m_styleStack.push( *def ); } } - //kdDebug(32500) << "pushing style " << style->attributeNS( KoXmlNS::style, "name", QString::null ) << endl; + //kdDebug(32500) << "pushing style " << style->attributeNS( KoXmlNS::style, "name", TQString() ) << endl; m_styleStack.push( *style ); } -QString KoOasisLoadingContext::generator() const +TQString KoOasisLoadingContext::generator() const { parseMeta(); return m_generator; @@ -108,13 +108,13 @@ void KoOasisLoadingContext::parseMeta() const { if ( m_store->hasFile( "meta.xml" ) ) { - QDomDocument metaDoc; + TQDomDocument metaDoc; KoOasisStore oasisStore( m_store ); - QString errorMsg; + TQString errorMsg; if ( oasisStore.loadAndParse( "meta.xml", metaDoc, errorMsg ) ) { - QDomNode meta = KoDom::namedItemNS( metaDoc, KoXmlNS::office, "document-meta" ); - QDomNode office = KoDom::namedItemNS( meta, KoXmlNS::office, "meta" ); - QDomElement generator = KoDom::namedItemNS( office, KoXmlNS::meta, "generator" ); + TQDomNode meta = KoDom::namedItemNS( metaDoc, KoXmlNS::office, "document-meta" ); + TQDomNode office = KoDom::namedItemNS( meta, KoXmlNS::office, "meta" ); + TQDomElement generator = KoDom::namedItemNS( office, KoXmlNS::meta, "generator" ); if ( !generator.isNull() ) m_generator = generator.text(); } diff --git a/lib/kofficecore/KoOasisLoadingContext.h b/lib/kofficecore/KoOasisLoadingContext.h index cac1786b4..880d4117a 100644 --- a/lib/kofficecore/KoOasisLoadingContext.h +++ b/lib/kofficecore/KoOasisLoadingContext.h @@ -20,15 +20,15 @@ #define KOOASISLOADINGCONTEXT_H class KoXmlWriter; -class QDomElement; +class TQDomElement; class KoDocument; class KoOasisStyles; class KoPictureCollection; class KoStore; -#include +#include #include -#include +#include #include /** @@ -57,10 +57,10 @@ public: KoOasisStyles& oasisStyles() { return m_styles; } KoStyleStack& styleStack() { return m_styleStack; } - const QDomDocument& manifestDocument() const { return m_manifestDoc; } + const TQDomDocument& manifestDocument() const { return m_manifestDoc; } /// Return the of the document, e.g. "KOffice/1.4.0a" - QString generator() const; + TQString generator() const; /** * Convenience method for loading the style of an object @@ -68,21 +68,21 @@ public: * * Read attribute (nsURI,attrName) from the given dom element, * treat that attribute as a style name, and load that style - * including all its parent styles. + * including all its tqparent styles. * @param element the dom element to read the attribute from * @param nsURI the namespace URI of the attribute to read * @param attrName the name of the attribute to read * @param family the style family used for this object */ - void fillStyleStack( const QDomElement& element, const char* nsURI, const char* attrName, const char* family ); + void fillStyleStack( const TQDomElement& element, const char* nsURI, const char* attrName, const char* family ); /** - * Add @p style to the stack, as well as all its parent styles + * Add @p style to the stack, as well as all its tqparent styles * and the default style for this style family. * * @param style the dom element containing the style to add to the stack - * @param family the family to use when looking up parent styles - * @param usingStylesAutoStyles if true, the parent styles are looked up + * @param family the family to use when looking up tqparent styles + * @param usingStylesAutoStyles if true, the tqparent styles are looked up * in the automatic styles from styles.xml, instead of looking up * in the automatic styles from content.xml as we usually do. * This is useful for loading headers and footers for instance. @@ -90,7 +90,7 @@ public: * * Usually you would call fillStyleStack() instead. */ - void addStyles( const QDomElement* style, const char* family, bool usingStylesAutoStyles = false ); + void addStyles( const TQDomElement* style, const char* family, bool usingStylesAutoStyles = false ); /// Set to true while loading headers and footers, to remember to use auto styles /// from styles.xml @@ -106,13 +106,13 @@ private: KoOasisStyles& m_styles; KoStyleStack m_styleStack; - mutable QString m_generator; + mutable TQString m_generator; mutable bool m_metaXmlParsed; bool m_useStylesAutoStyles; bool m_unused1; // padding, can be used later bool m_unused2; // padding, can be used later - QDomDocument m_manifestDoc; + TQDomDocument m_manifestDoc; class Private; Private *d; diff --git a/lib/kofficecore/KoOasisSettings.cpp b/lib/kofficecore/KoOasisSettings.cpp index 99f63524e..37a0acecf 100644 --- a/lib/kofficecore/KoOasisSettings.cpp +++ b/lib/kofficecore/KoOasisSettings.cpp @@ -22,74 +22,74 @@ #include "KoDom.h" #include -KoOasisSettings::KoOasisSettings( const QDomDocument& doc ) +KoOasisSettings::KoOasisSettings( const TQDomDocument& doc ) : m_settingsElement( KoDom::namedItemNS( doc.documentElement(), KoXmlNS::office, "settings" ) ), m_configNSURI( KoXmlNS::config ) { - const QDomElement contents = doc.documentElement(); + const TQDomElement contents = doc.documentElement(); if ( m_settingsElement.isNull() ) kdDebug() << " document doesn't have tag 'office:settings'\n"; } -KoOasisSettings::KoOasisSettings( const QDomDocument& doc, const char* officeNSURI, const char* configNSURI ) +KoOasisSettings::KoOasisSettings( const TQDomDocument& doc, const char* officeNSURI, const char* configNSURI ) : m_settingsElement( KoDom::namedItemNS( doc.documentElement(), officeNSURI, "settings" ) ), m_configNSURI( configNSURI ) { - const QDomElement contents = doc.documentElement(); + const TQDomElement contents = doc.documentElement(); if ( m_settingsElement.isNull() ) kdDebug() << " document doesn't have tag 'office:settings'\n"; } -KoOasisSettings::Items KoOasisSettings::itemSet( const QString& itemSetName ) const +KoOasisSettings::Items KoOasisSettings::itemSet( const TQString& itemSetName ) const { - QDomElement e; + TQDomElement e; forEachElement( e, m_settingsElement ) { if ( e.localName() == "config-item-set" && e.namespaceURI() == m_configNSURI && - e.attributeNS( m_configNSURI, "name", QString::null ) == itemSetName ) + e.attributeNS( m_configNSURI, "name", TQString() ) == itemSetName ) { return Items( e, this ); } } - return Items( QDomElement(), this ); + return Items( TQDomElement(), this ); } -KoOasisSettings::IndexedMap KoOasisSettings::Items::indexedMap( const QString& itemMapName ) const +KoOasisSettings::IndexedMap KoOasisSettings::Items::indexedMap( const TQString& itemMapName ) const { - QDomElement configItem; + TQDomElement configItem; forEachElement( configItem, m_element ) { if ( configItem.localName() == "config-item-map-indexed" && configItem.namespaceURI() == m_settings->m_configNSURI && - configItem.attributeNS( m_settings->m_configNSURI, "name", QString::null ) == itemMapName ) + configItem.attributeNS( m_settings->m_configNSURI, "name", TQString() ) == itemMapName ) { return IndexedMap( configItem, m_settings ); } } - return IndexedMap( QDomElement(), m_settings ); + return IndexedMap( TQDomElement(), m_settings ); } -KoOasisSettings::NamedMap KoOasisSettings::Items::namedMap( const QString& itemMapName ) const +KoOasisSettings::NamedMap KoOasisSettings::Items::namedMap( const TQString& itemMapName ) const { - QDomElement configItem; + TQDomElement configItem; forEachElement( configItem, m_element ) { if ( configItem.localName() == "config-item-map-named" && configItem.namespaceURI() == m_settings->m_configNSURI && - configItem.attributeNS( m_settings->m_configNSURI, "name", QString::null ) == itemMapName ) + configItem.attributeNS( m_settings->m_configNSURI, "name", TQString() ) == itemMapName ) { return NamedMap( configItem, m_settings ); } } - return NamedMap( QDomElement(), m_settings ); + return NamedMap( TQDomElement(), m_settings ); } KoOasisSettings::Items KoOasisSettings::IndexedMap::entry( int entryIndex ) const { int i = 0; - QDomElement entry; + TQDomElement entry; forEachElement( entry, m_element ) { if ( entry.localName() == "config-item-map-entry" && @@ -101,51 +101,51 @@ KoOasisSettings::Items KoOasisSettings::IndexedMap::entry( int entryIndex ) cons ++i; } } - return Items( QDomElement(), m_settings ); + return Items( TQDomElement(), m_settings ); } -KoOasisSettings::Items KoOasisSettings::NamedMap::entry( const QString& entryName ) const +KoOasisSettings::Items KoOasisSettings::NamedMap::entry( const TQString& entryName ) const { - QDomElement entry; + TQDomElement entry; forEachElement( entry, m_element ) { if ( entry.localName() == "config-item-map-entry" && entry.namespaceURI() == m_settings->m_configNSURI && - entry.attributeNS( m_settings->m_configNSURI, "name", QString::null ) == entryName ) + entry.attributeNS( m_settings->m_configNSURI, "name", TQString() ) == entryName ) { return Items( entry, m_settings ); } } - return Items( QDomElement(), m_settings ); + return Items( TQDomElement(), m_settings ); } // helper method -QString KoOasisSettings::Items::findConfigItem( const QDomElement& element, - const QString& item, bool* ok ) const +TQString KoOasisSettings::Items::findConfigItem( const TQDomElement& element, + const TQString& item, bool* ok ) const { - QDomElement it; + TQDomElement it; forEachElement( it, element ) { if ( it.localName() == "config-item" && it.namespaceURI() == m_settings->m_configNSURI && - it.attributeNS( m_settings->m_configNSURI, "name", QString::null ) == item ) + it.attributeNS( m_settings->m_configNSURI, "name", TQString() ) == item ) { *ok = true; return it.text(); } } *ok = false; - return QString::null; + return TQString(); } -QString KoOasisSettings::Items::findConfigItem( const QString& item, bool* ok ) const +TQString KoOasisSettings::Items::findConfigItem( const TQString& item, bool* ok ) const { return findConfigItem( m_element, item, ok ); } #if 0 // does anyone need this one? passing a default value does the job, too -bool KoOasisSettings::Items::hasConfigItem( const QString& configName ) const +bool KoOasisSettings::Items::hasConfigItem( const TQString& configName ) const { bool ok; (void)findConfigItem( configName, &ok ); @@ -153,17 +153,17 @@ bool KoOasisSettings::Items::hasConfigItem( const QString& configName ) const } #endif -QString KoOasisSettings::Items::parseConfigItemString( const QString& configName, const QString& defValue ) const +TQString KoOasisSettings::Items::parseConfigItemString( const TQString& configName, const TQString& defValue ) const { bool ok; - const QString str = findConfigItem( configName, &ok ); + const TQString str = findConfigItem( configName, &ok ); return ok ? str : defValue; } -int KoOasisSettings::Items::parseConfigItemInt( const QString& configName, int defValue ) const +int KoOasisSettings::Items::parseConfigItemInt( const TQString& configName, int defValue ) const { bool ok; - const QString str = findConfigItem( configName, &ok ); + const TQString str = findConfigItem( configName, &ok ); int value; if ( ok ) { value = str.toInt( &ok ); @@ -173,10 +173,10 @@ int KoOasisSettings::Items::parseConfigItemInt( const QString& configName, int d return defValue; } -double KoOasisSettings::Items::parseConfigItemDouble( const QString& configName, double defValue ) const +double KoOasisSettings::Items::parseConfigItemDouble( const TQString& configName, double defValue ) const { bool ok; - const QString str = findConfigItem( configName, &ok ); + const TQString str = findConfigItem( configName, &ok ); double value; if ( ok ) { value = str.toDouble( &ok ); @@ -186,10 +186,10 @@ double KoOasisSettings::Items::parseConfigItemDouble( const QString& configName, return defValue; } -bool KoOasisSettings::Items::parseConfigItemBool( const QString& configName, bool defValue ) const +bool KoOasisSettings::Items::parseConfigItemBool( const TQString& configName, bool defValue ) const { bool ok; - const QString str = findConfigItem( configName, &ok ); + const TQString str = findConfigItem( configName, &ok ); if ( str == "true" ) return true; else if ( str == "false" ) @@ -197,10 +197,10 @@ bool KoOasisSettings::Items::parseConfigItemBool( const QString& configName, boo return defValue; } -short KoOasisSettings::Items::parseConfigItemShort( const QString& configName, short defValue ) const +short KoOasisSettings::Items::parseConfigItemShort( const TQString& configName, short defValue ) const { bool ok; - const QString str = findConfigItem( configName, &ok ); + const TQString str = findConfigItem( configName, &ok ); short value; if ( ok ) { value = str.toShort( &ok ); @@ -210,10 +210,10 @@ short KoOasisSettings::Items::parseConfigItemShort( const QString& configName, s return defValue; } -long KoOasisSettings::Items::parseConfigItemLong( const QString& configName, long defValue ) const +long KoOasisSettings::Items::parseConfigItemLong( const TQString& configName, long defValue ) const { bool ok; - const QString str = findConfigItem( configName, &ok ); + const TQString str = findConfigItem( configName, &ok ); long value; if ( ok ) { value = str.toLong( &ok ); diff --git a/lib/kofficecore/KoOasisSettings.h b/lib/kofficecore/KoOasisSettings.h index cd1ae1127..4a213ca42 100644 --- a/lib/kofficecore/KoOasisSettings.h +++ b/lib/kofficecore/KoOasisSettings.h @@ -22,7 +22,7 @@ #ifndef KOOASISSETTINGS_H #define KOOASISSETTINGS_H -#include +#include #include /** @@ -73,12 +73,12 @@ public: /** * Normal KoOasisSettings constructor, for an OASIS settings.xml */ - explicit KoOasisSettings( const QDomDocument& doc ); + explicit KoOasisSettings( const TQDomDocument& doc ); /** * KoOasisSettings constructor for an OpenOffice-1.1 file */ - KoOasisSettings( const QDomDocument& doc, const char* officeNSURI, const char* configNSURI ); + KoOasisSettings( const TQDomDocument& doc, const char* officeNSURI, const char* configNSURI ); class Items; @@ -86,7 +86,7 @@ public: * Returns the toplevel item-set named @p itemSetName. * If not found, the returned items instance is null. */ - Items itemSet( const QString& itemSetName ) const; + Items itemSet( const TQString& itemSetName ) const; class IndexedMap; class NamedMap; @@ -96,7 +96,7 @@ public: friend class KoOasisSettings; friend class IndexedMap; friend class NamedMap; - Items( const QDomElement& elem, const KoOasisSettings* settings ) + Items( const TQDomElement& elem, const KoOasisSettings* settings ) : m_element( elem ), m_settings( settings ) {} public: bool isNull() const { return m_element.isNull(); } @@ -107,7 +107,7 @@ public: * An indexed map is an array (or sequence), i.e. items are supposed to * be retrieved by index. This is useful for e.g. "view 0", "view 1" etc. */ - IndexedMap indexedMap( const QString& itemMapName ) const; + IndexedMap indexedMap( const TQString& itemMapName ) const; /** * Look for the config-item-map-named named @p mapItemName and return it. @@ -115,21 +115,21 @@ public: * A named map is a map where items are retrieved by entry name, @see selectItemMapEntry * @return false if no such map was found */ - NamedMap namedMap( const QString& itemMapName ) const; - - int parseConfigItemInt( const QString& configName, int defValue = 0 ) const; - double parseConfigItemDouble( const QString& configName, double defValue = 0 ) const; - QString parseConfigItemString( const QString& configName, const QString& defValue = QString::null ) const; - bool parseConfigItemBool( const QString& configName, bool defValue = false ) const; - short parseConfigItemShort( const QString& configName, short defValue = 0 ) const; - long parseConfigItemLong( const QString& configName, long defValue = 0 ) const; + NamedMap namedMap( const TQString& itemMapName ) const; + + int parseConfigItemInt( const TQString& configName, int defValue = 0 ) const; + double parseConfigItemDouble( const TQString& configName, double defValue = 0 ) const; + TQString parseConfigItemString( const TQString& configName, const TQString& defValue = TQString() ) const; + bool parseConfigItemBool( const TQString& configName, bool defValue = false ) const; + short parseConfigItemShort( const TQString& configName, short defValue = 0 ) const; + long parseConfigItemLong( const TQString& configName, long defValue = 0 ) const; private: /// @internal - QString findConfigItem( const QString& item, bool* ok ) const; + TQString findConfigItem( const TQString& item, bool* ok ) const; /// @internal - QString findConfigItem( const QDomElement& element, const QString& item, bool* ok ) const; + TQString findConfigItem( const TQDomElement& element, const TQString& item, bool* ok ) const; - QDomElement m_element; + TQDomElement m_element; const KoOasisSettings* m_settings; }; @@ -139,16 +139,16 @@ public: public: bool isNull() const { return m_element.isNull(); } protected: - Map( const QDomElement& elem, const KoOasisSettings* settings ) + Map( const TQDomElement& elem, const KoOasisSettings* settings ) : m_element( elem ), m_settings( settings ) {} - const QDomElement m_element; + const TQDomElement m_element; const KoOasisSettings* m_settings; }; class KOFFICECORE_EXPORT IndexedMap : public Map { friend class Items; - IndexedMap( const QDomElement& elem, const KoOasisSettings* settings ) + IndexedMap( const TQDomElement& elem, const KoOasisSettings* settings ) : Map( elem, settings ) {} public: /// Returns an entry in an indexed map @@ -158,18 +158,18 @@ public: class KOFFICECORE_EXPORT NamedMap : public Map { friend class Items; - NamedMap( const QDomElement& elem, const KoOasisSettings* settings ) + NamedMap( const TQDomElement& elem, const KoOasisSettings* settings ) : Map( elem, settings ) {} public: /// Returns an entry in a named map - Items entry( const QString& entryName ) const; + Items entry( const TQString& entryName ) const; }; private: friend class Items; friend class IndexedMap; friend class NamedMap; - const QDomElement m_settingsElement; + const TQDomElement m_settingsElement; const char* m_configNSURI; class Private; diff --git a/lib/kofficecore/KoOasisStore.cpp b/lib/kofficecore/KoOasisStore.cpp index 1b7537ae0..7eec46a5b 100644 --- a/lib/kofficecore/KoOasisStore.cpp +++ b/lib/kofficecore/KoOasisStore.cpp @@ -29,9 +29,9 @@ #include #include -#include -#include -#include +#include +#include +#include KoOasisStore::KoOasisStore( KoStore* store ) : m_store( store ), @@ -78,7 +78,7 @@ KoXmlWriter* KoOasisStore::bodyWriter() Q_ASSERT( !m_contentTmpFile ); m_contentTmpFile = new KTempFile; m_contentTmpFile->setAutoDelete( true ); - m_bodyWriter = new KoXmlWriter( m_contentTmpFile->file(), 1 ); + m_bodyWriter = new KoXmlWriter( TQT_TQIODEVICE(m_contentTmpFile->file()), 1 ); } return m_bodyWriter; } @@ -90,9 +90,9 @@ bool KoOasisStore::closeContentWriter() delete m_bodyWriter; m_bodyWriter = 0; // copy over the contents from the tempfile to the real one - QFile* tmpFile = m_contentTmpFile->file(); + TQFile* tmpFile = m_contentTmpFile->file(); tmpFile->close(); - m_contentWriter->addCompleteElement( tmpFile ); + m_contentWriter->addCompleteElement( TQT_TQIODEVICE(tmpFile) ); m_contentTmpFile->close(); delete m_contentTmpFile; m_contentTmpFile = 0; @@ -111,9 +111,9 @@ KoXmlWriter* KoOasisStore::manifestWriter( const char* mimeType ) if ( !m_manifestWriter ) { // the pointer to the buffer is already stored in the KoXmlWriter, no need to store it here as well - QBuffer *manifestBuffer = new QBuffer; + TQBuffer *manifestBuffer = new TQBuffer; manifestBuffer->open( IO_WriteOnly ); - m_manifestWriter = new KoXmlWriter( manifestBuffer ); + m_manifestWriter = new KoXmlWriter( TQT_TQIODEVICE(manifestBuffer) ); m_manifestWriter->startDocument( "manifest:manifest" ); m_manifestWriter->startElement( "manifest:manifest" ); m_manifestWriter->addAttribute( "xmlns:manifest", KoXmlNS::manifest ); @@ -126,39 +126,39 @@ bool KoOasisStore::closeManifestWriter() { m_manifestWriter->endElement(); m_manifestWriter->endDocument(); - QBuffer* buffer = static_cast( m_manifestWriter->device() ); + TQBuffer* buffer = TQT_TQBUFFER( static_cast(m_manifestWriter->device()) ); delete m_manifestWriter; m_manifestWriter = 0; bool ok = false; if ( m_store->open( "META-INF/manifest.xml" ) ) { - Q_LONG written = m_store->write( buffer->buffer() ); - ok = ( written == (Q_LONG)buffer->buffer().size() && m_store->close() ); + TQ_LONG written = m_store->write( buffer->buffer() ); + ok = ( written == (TQ_LONG)buffer->buffer().size() && m_store->close() ); } delete buffer; return ok; } -bool KoOasisStore::loadAndParse( const QString& fileName, QDomDocument& doc, QString& errorMessage ) +bool KoOasisStore::loadAndParse( const TQString& fileName, TQDomDocument& doc, TQString& errorMessage ) { //kdDebug(30003) << "loadAndParse: Trying to open " << fileName << endl; if (!m_store->open(fileName)) { kdWarning(30003) << "Entry " << fileName << " not found!" << endl; - errorMessage = i18n( "Could not find %1" ).arg( fileName ); + errorMessage = i18n( "Could not tqfind %1" ).tqarg( fileName ); return false; } - // Error variables for QDomDocument::setContent - QString errorMsg; + // Error variables for TQDomDocument::setContent + TQString errorMsg; int errorLine, errorColumn; // We need to be able to see the space in , this is why // we activate the "report-whitespace-only-CharData" feature. // Unfortunately this leads to lots of whitespace text nodes in between real // elements in the rest of the document, watch out for that. - QXmlInputSource source( m_store->device() ); - // Copied from QDomDocumentPrivate::setContent, to change the whitespace thing - QXmlSimpleReader reader; + TQXmlInputSource source( m_store->device() ); + // Copied from TQDomDocumentPrivate::setContent, to change the whitespace thing + TQXmlSimpleReader reader; KoDocument::setupXmlReader( reader, true /*namespaceProcessing*/ ); bool ok = doc.setContent( &source, &reader, &errorMsg, &errorLine, &errorColumn ); @@ -168,7 +168,7 @@ bool KoOasisStore::loadAndParse( const QString& fileName, QDomDocument& doc, QSt << " In line: " << errorLine << ", column: " << errorColumn << endl << " Error message: " << errorMsg << endl; errorMessage = i18n( "Parsing error in the main document at line %1, column %2\nError message: %3" ) - .arg( errorLine ).arg( errorColumn ).arg( i18n ( "QXml", errorMsg.utf8() ) ); + .tqarg( errorLine ).tqarg( errorColumn ).tqarg( i18n ( "TQXml", errorMsg.utf8() ) ); } else { @@ -178,17 +178,17 @@ bool KoOasisStore::loadAndParse( const QString& fileName, QDomDocument& doc, QSt return ok; } -QString KoOasisStore::mimeForPath( const QDomDocument& doc, const QString& fullPath ) +TQString KoOasisStore::mimeForPath( const TQDomDocument& doc, const TQString& fullPath ) { - QDomElement docElem = doc.documentElement(); - QDomElement elem; + TQDomElement docElem = doc.documentElement(); + TQDomElement elem; forEachElement( elem, docElem ) { if ( elem.localName() == "file-entry" && elem.namespaceURI() == KoXmlNS::manifest ) { - if ( elem.attributeNS( KoXmlNS::manifest, "full-path", QString::null ) == fullPath ) - return elem.attributeNS( KoXmlNS::manifest, "media-type", QString::null ); + if ( elem.attributeNS( KoXmlNS::manifest, "full-path", TQString() ) == fullPath ) + return elem.attributeNS( KoXmlNS::manifest, "media-type", TQString() ); } } - return QString::null; + return TQString(); } diff --git a/lib/kofficecore/KoOasisStore.h b/lib/kofficecore/KoOasisStore.h index 506700b0a..e33e95266 100644 --- a/lib/kofficecore/KoOasisStore.h +++ b/lib/kofficecore/KoOasisStore.h @@ -18,13 +18,13 @@ #ifndef KOOASISSTORE_H #define KOOASISSTORE_H -class QString; -class QDomDocument; +class TQString; +class TQDomDocument; class KTempFile; class KoXmlWriter; class KoStore; class KoStoreDevice; -class QIODevice; +class TQIODevice; /** * Helper class around KoStore for writing out OASIS files. @@ -79,10 +79,10 @@ public: bool closeManifestWriter(); /// A completely unrelated method, for loading a file from an oasis store - bool loadAndParse( const QString& fileName, QDomDocument& doc, QString& errorMessage ); + bool loadAndParse( const TQString& fileName, TQDomDocument& doc, TQString& errorMessage ); /// Another method for loading: get mimetype from full path, using the manifest - static QString mimeForPath( const QDomDocument& doc, const QString& fullPath ); + static TQString mimeForPath( const TQDomDocument& doc, const TQString& fullPath ); private: KoStore* m_store; diff --git a/lib/kofficecore/KoOasisStyles.cpp b/lib/kofficecore/KoOasisStyles.cpp index 3a0187670..d135a501a 100644 --- a/lib/kofficecore/KoOasisStyles.cpp +++ b/lib/kofficecore/KoOasisStyles.cpp @@ -19,22 +19,22 @@ #include "KoOasisStyles.h" #include #include -#include +#include #include "KoDom.h" #include "KoXmlNS.h" #include "KoGenStyles.h" -#include +#include #include #include -#include +#include #include class KoOasisStyles::Private { public: // The key of the map is the family - QMap > m_styles; - QMap > m_stylesAutoStyles; + TQMap > m_styles; + TQMap > m_stylesAutoStyles; }; KoOasisStyles::KoOasisStyles() @@ -51,11 +51,11 @@ KoOasisStyles::~KoOasisStyles() delete d; } -void KoOasisStyles::createStyleMap( const QDomDocument& doc, bool stylesDotXml ) +void KoOasisStyles::createStyleMap( const TQDomDocument& doc, bool stylesDotXml ) { - const QDomElement docElement = doc.documentElement(); + const TQDomElement docElement = doc.documentElement(); // We used to have the office:version check here, but better let the apps do that - QDomElement fontStyles = KoDom::namedItemNS( docElement, KoXmlNS::office, "font-decls" ); + TQDomElement fontStyles = KoDom::namedItemNS( docElement, KoXmlNS::office, "font-decls" ); if ( !fontStyles.isNull() ) { //kdDebug(30003) << "Starting reading in font-decl..." << endl; @@ -65,7 +65,7 @@ void KoOasisStyles::createStyleMap( const QDomDocument& doc, bool stylesDotXml ) //kdDebug(30003) << "Starting reading in office:automatic-styles. stylesDotXml=" << stylesDotXml << endl; - QDomElement autoStyles = KoDom::namedItemNS( docElement, KoXmlNS::office, "automatic-styles" ); + TQDomElement autoStyles = KoDom::namedItemNS( docElement, KoXmlNS::office, "automatic-styles" ); if ( !autoStyles.isNull() ) { insertStyles( autoStyles, stylesDotXml ); }// else @@ -74,17 +74,17 @@ void KoOasisStyles::createStyleMap( const QDomDocument& doc, bool stylesDotXml ) //kdDebug(30003) << "Reading in master styles" << endl; - QDomNode masterStyles = KoDom::namedItemNS( docElement, KoXmlNS::office, "master-styles" ); + TQDomNode masterStyles = KoDom::namedItemNS( docElement, KoXmlNS::office, "master-styles" ); if ( !masterStyles.isNull() ) { - QDomElement master; + TQDomElement master; forEachElement( master, masterStyles ) { if ( master.localName() == "master-page" && master.namespaceURI() == KoXmlNS::style ) { - const QString name = master.attributeNS( KoXmlNS::style, "name", QString::null ); + const TQString name = master.attributeNS( KoXmlNS::style, "name", TQString() ); kdDebug(30003) << "Master style: '" << name << "' loaded " << endl; - m_masterPages.insert( name, new QDomElement( master ) ); + m_masterPages.insert( name, new TQDomElement( master ) ); } else // OASIS docu mentions style:handout-master and draw:layer-set here kdWarning(30003) << "Unknown tag " << master.tagName() << " in office:master-styles" << endl; @@ -94,7 +94,7 @@ void KoOasisStyles::createStyleMap( const QDomDocument& doc, bool stylesDotXml ) kdDebug(30003) << "Starting reading in office:styles" << endl; - const QDomElement officeStyle = KoDom::namedItemNS( docElement, KoXmlNS::office, "styles" ); + const TQDomElement officeStyle = KoDom::namedItemNS( docElement, KoXmlNS::office, "styles" ); if ( !officeStyle.isNull() ) { m_officeStyle = officeStyle; @@ -105,12 +105,12 @@ void KoOasisStyles::createStyleMap( const QDomDocument& doc, bool stylesDotXml ) //kdDebug(30003) << "Styles read in." << endl; } -QValueVector KoOasisStyles::userStyles() const +TQValueVector KoOasisStyles::userStyles() const { - QValueVector vec; + TQValueVector vec; // Collect user styles unsigned int i = 0; - QDomElement e; + TQDomElement e; forEachElement( e, m_officeStyle ) { if ( e.localName() == "style" && @@ -123,20 +123,20 @@ QValueVector KoOasisStyles::userStyles() const return vec; } -const QDict& KoOasisStyles::styles(const QString& family) const +const TQDict& KoOasisStyles::styles(const TQString& family) const { // hmm this can create an empty item in the map, but otherwise we couldn't // return a const reference. return d->m_styles[family]; } -void KoOasisStyles::insertOfficeStyles( const QDomElement& styles ) +void KoOasisStyles::insertOfficeStyles( const TQDomElement& styles ) { - QDomElement e; + TQDomElement e; forEachElement( e, styles ) { - const QString localName = e.localName(); - const QString ns = e.namespaceURI(); + const TQString localName = e.localName(); + const TQString ns = e.namespaceURI(); if ( ( ns == KoXmlNS::svg && ( localName == "linearGradient" || localName == "radialGradient" ) ) @@ -149,9 +149,9 @@ void KoOasisStyles::insertOfficeStyles( const QDomElement& styles ) || localName == "opacity" ) ) ) { - const QString name = e.attributeNS( KoXmlNS::draw, "name", QString::null ); + const TQString name = e.attributeNS( KoXmlNS::draw, "name", TQString() ); Q_ASSERT( !name.isEmpty() ); - QDomElement* ep = new QDomElement( e ); + TQDomElement* ep = new TQDomElement( e ); m_drawStyles.insert( name, ep ); } else @@ -160,53 +160,53 @@ void KoOasisStyles::insertOfficeStyles( const QDomElement& styles ) } -void KoOasisStyles::insertStyles( const QDomElement& styles, bool styleAutoStyles ) +void KoOasisStyles::insertStyles( const TQDomElement& styles, bool styleAutoStyles ) { //kdDebug(30003) << "Inserting styles from " << styles.tagName() << endl; - QDomElement e; + TQDomElement e; forEachElement( e, styles ) insertStyle( e, styleAutoStyles ); } -void KoOasisStyles::insertStyle( const QDomElement& e, bool styleAutoStyles ) +void KoOasisStyles::insertStyle( const TQDomElement& e, bool styleAutoStyles ) { - const QString localName = e.localName(); - const QString ns = e.namespaceURI(); + const TQString localName = e.localName(); + const TQString ns = e.namespaceURI(); - const QString name = e.attributeNS( KoXmlNS::style, "name", QString::null ); + const TQString name = e.attributeNS( KoXmlNS::style, "name", TQString() ); if ( ns == KoXmlNS::style && localName == "style" ) { - const QString family = e.attributeNS( KoXmlNS::style, "family", QString::null ); + const TQString family = e.attributeNS( KoXmlNS::style, "family", TQString() ); if ( styleAutoStyles ) { - QDict& dict = d->m_stylesAutoStyles[ family ]; + TQDict& dict = d->m_stylesAutoStyles[ family ]; dict.setAutoDelete( true ); - if ( dict.find( name ) != 0 ) + if ( dict.tqfind( name ) != 0 ) kdDebug(30003) << "Auto-style: '" << name << "' already exists" << endl; - dict.insert( name, new QDomElement( e ) ); + dict.insert( name, new TQDomElement( e ) ); //kdDebug(30003) << "Style: '" << name << "' loaded as a style auto style" << endl; } else { - QDict& dict = d->m_styles[ family ]; + TQDict& dict = d->m_styles[ family ]; dict.setAutoDelete( true ); - if ( dict.find( name ) != 0 ) + if ( dict.tqfind( name ) != 0 ) kdDebug(30003) << "Style: '" << name << "' already exists" << endl; - dict.insert( name, new QDomElement( e ) ); + dict.insert( name, new TQDomElement( e ) ); //kdDebug(30003) << "Style: '" << name << "' loaded " << endl; } } else if ( ns == KoXmlNS::style && ( - localName == "page-layout" + localName == "page-tqlayout" || localName == "font-decl" - || localName == "presentation-page-layout" ) ) + || localName == "presentation-page-tqlayout" ) ) { - if ( m_styles.find( name ) != 0 ) + if ( m_styles.tqfind( name ) != 0 ) kdDebug(30003) << "Style: '" << name << "' already exists" << endl; - m_styles.insert( name, new QDomElement( e ) ); + m_styles.insert( name, new TQDomElement( e ) ); } else if ( localName == "default-style" && ns == KoXmlNS::style ) { - const QString family = e.attributeNS( KoXmlNS::style, "family", QString::null ); + const TQString family = e.attributeNS( KoXmlNS::style, "family", TQString() ); if ( !family.isEmpty() ) - m_defaultStyle.insert( family, new QDomElement( e ) ); + m_defaultStyle.insert( family, new TQDomElement( e ) ); } else if ( localName == "list-style" && ns == KoXmlNS::text ) { - m_listStyles.insert( name, new QDomElement( e ) ); + m_listStyles.insert( name, new TQDomElement( e ) ); //kdDebug(30003) << "List style: '" << name << "' loaded " << endl; } else if ( ns == KoXmlNS::number && ( localName == "number-style" @@ -221,14 +221,14 @@ void KoOasisStyles::insertStyle( const QDomElement& e, bool styleAutoStyles ) // The rest (text:*-configuration and text:outline-style) is to be done by the apps. } -// OO spec 2.5.4. p68. Conversion to Qt format: see qdate.html +// OO spec 2.5.4. p68. Conversion to TQt format: see qdate.html // OpenCalcImport::loadFormat has similar code, but slower, intermixed with other stuff, // lacking long-textual forms. -void KoOasisStyles::importDataStyle( const QDomElement& parent ) +void KoOasisStyles::importDataStyle( const TQDomElement& tqparent ) { NumericStyleFormat dataStyle; - const QString localName = parent.localName(); + const TQString localName = tqparent.localName(); if (localName == "number-style") dataStyle.type = NumericStyleFormat::Number; else if (localName == "currency-style") @@ -244,7 +244,7 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) else if (localName == "time-style") dataStyle.type = NumericStyleFormat::Time; - QString format; + TQString format; int precision = -1; int leadingZ = 1; bool thousandsSep = false; @@ -252,26 +252,26 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) //bool negRed = false; bool ok = false; int i = 0; - QDomElement e; - QString prefix; - QString suffix; - forEachElement( e, parent ) + TQDomElement e; + TQString prefix; + TQString suffix; + forEachElement( e, tqparent ) { if ( e.namespaceURI() != KoXmlNS::number ) continue; - QString localName = e.localName(); - const QString numberStyle = e.attributeNS( KoXmlNS::number, "style", QString::null ); + TQString localName = e.localName(); + const TQString numberStyle = e.attributeNS( KoXmlNS::number, "style", TQString() ); const bool shortForm = numberStyle == "short" || numberStyle.isEmpty(); if ( localName == "day" ) { format += shortForm ? "d" : "dd"; } else if ( localName == "day-of-week" ) { format += shortForm ? "ddd" : "dddd"; } else if ( localName == "month" ) { - if ( e.attributeNS( KoXmlNS::number, "possessive-form", QString::null ) == "true" ) { + if ( e.attributeNS( KoXmlNS::number, "possessive-form", TQString() ) == "true" ) { format += shortForm ? "PPP" : "PPPP"; } // TODO the spec has a strange mention of number:format-source - else if ( e.attributeNS( KoXmlNS::number, "textual", QString::null ) == "true" ) { + else if ( e.attributeNS( KoXmlNS::number, "textual", TQString() ) == "true" ) { format += shortForm ? "MMM" : "MMMM"; } else { // month number format += shortForm ? "M" : "MM"; @@ -281,7 +281,7 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) } else if ( localName == "era" ) { //TODO I don't know what is it... (define into oo spec) } else if ( localName == "week-of-year" || localName == "quarter") { - // ### not supported in Qt + // ### not supported in TQt } else if ( localName == "hours" ) { format += shortForm ? "h" : "hh"; } else if ( localName == "minutes" ) { @@ -309,13 +309,13 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) // TODO: number:grouping="true" if ( e.hasAttributeNS( KoXmlNS::number, "decimal-places" ) ) { - int d = e.attributeNS( KoXmlNS::number, "decimal-places", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "decimal-places", TQString() ).toInt( &ok ); if ( ok ) precision = d; } if ( e.hasAttributeNS( KoXmlNS::number, "min-integer-digits" ) ) { - int d = e.attributeNS( KoXmlNS::number, "min-integer-digits", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "min-integer-digits", TQString() ).toInt( &ok ); if ( ok ) leadingZ = d; } @@ -345,21 +345,21 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) if ( e.hasAttributeNS( KoXmlNS::number, "decimal-places" ) ) { - int d = e.attributeNS( KoXmlNS::number, "decimal-places", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "decimal-places", TQString() ).toInt( &ok ); if ( ok ) precision = d; } if ( e.hasAttributeNS( KoXmlNS::number, "min-integer-digits" ) ) { - int d = e.attributeNS( KoXmlNS::number, "min-integer-digits", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "min-integer-digits", TQString() ).toInt( &ok ); if ( ok ) leadingZ = d; } if ( e.hasAttributeNS( KoXmlNS::number, "min-exponent-digits" ) ) { - int d = e.attributeNS( KoXmlNS::number, "min-exponent-digits", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "min-exponent-digits", TQString() ).toInt( &ok ); if ( ok ) exp = d; if ( exp <= 0 ) @@ -399,25 +399,25 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) int denominatorValue=0; if ( e.hasAttributeNS( KoXmlNS::number, "min-integer-digits" ) ) { - int d = e.attributeNS( KoXmlNS::number, "min-integer-digits", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "min-integer-digits", TQString() ).toInt( &ok ); if ( ok ) integer = d; } if ( e.hasAttributeNS( KoXmlNS::number, "min-numerator-digits" ) ) { - int d = e.attributeNS( KoXmlNS::number, "min-numerator-digits", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "min-numerator-digits", TQString() ).toInt( &ok ); if ( ok ) numerator = d; } if ( e.hasAttributeNS( KoXmlNS::number, "min-denominator-digits" ) ) { - int d = e.attributeNS( KoXmlNS::number, "min-denominator-digits", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "min-denominator-digits", TQString() ).toInt( &ok ); if ( ok ) denominator = d; } if ( e.hasAttributeNS( KoXmlNS::number, "denominator-value" ) ) { - int d = e.attributeNS( KoXmlNS::number, "denominator-value", QString::null ).toInt( &ok ); + int d = e.attributeNS( KoXmlNS::number, "denominator-value", TQString() ).toInt( &ok ); if ( ok ) denominatorValue = d; } @@ -433,7 +433,7 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) format+='/'; if ( denominatorValue != 0 ) - format+=QString::number( denominatorValue ); + format+=TQString::number( denominatorValue ); else { for ( i = 0; i < denominator; ++i ) @@ -446,7 +446,7 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) } - const QString styleName = parent.attributeNS( KoXmlNS::style, "name", QString::null ); + const TQString styleName = tqparent.attributeNS( KoXmlNS::style, "name", TQString() ); kdDebug(30003) << "data style: " << styleName << " qt format=" << format << endl; if ( !prefix.isEmpty() ) { @@ -456,7 +456,7 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) format = format.right( format.length()-prefix.length() ); } else - prefix = QString::null; + prefix = TQString(); } if ( !suffix.isEmpty() ) { @@ -466,7 +466,7 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) format = format.left( format.length()-suffix.length() ); } else - suffix = QString::null; + suffix = TQString(); } dataStyle.formatStr = format; @@ -487,9 +487,9 @@ void KoOasisStyles::importDataStyle( const QDomElement& parent ) } \ } -void KoOasisStyles::parseOasisTimeKlocale(KoXmlWriter &elementWriter, QString & format, QString & text ) +void KoOasisStyles::parseOasisTimeKlocale(KoXmlWriter &elementWriter, TQString & format, TQString & text ) { - kdDebug(30003)<<"parseOasisTimeKlocale(KoXmlWriter &elementWriter, QString & format, QString & text ) :"< 0 ); addTextNumber( text, elementWriter ); } - QString elementContents = QString::fromUtf8( buffer.buffer(), buffer.buffer().size() ); + TQString elementContents = TQString::fromUtf8( buffer.buffer(), buffer.buffer().size() ); currentStyle.addChildElement( "number", elementContents ); return mainStyles.lookup( currentStyle, "N" ); } //convert klocale string to good format -void KoOasisStyles::parseOasisDateKlocale(KoXmlWriter &elementWriter, QString & format, QString & text ) +void KoOasisStyles::parseOasisDateKlocale(KoXmlWriter &elementWriter, TQString & format, TQString & text ) { - kdDebug(30003)<<"KoOasisStyles::parseOasisDateKlocale(KoXmlWriter &elementWriter, QString & format, QString & text ) :"< // //% // - kdDebug(30003)<<"QString saveOasisPercentageStyle( KoGenStyles &mainStyles, const QString & _format ) :"<<_format< // // //example 000,000e+0000 - kdDebug(30003)<<"QString saveOasisScientificStyle( KoGenStyles &mainStyles, const QString & _format ) :"<<_format< @@ -1230,14 +1230,14 @@ QString KoOasisStyles::saveOasisCurrencyStyle( KoGenStyles &mainStyles, //VEB // - kdDebug(30003)<<"QString saveOasisCurrencyStyle( KoGenStyles &mainStyles, const QString & _format ) :"<<_format< // /// - kdDebug(30003)<<"QString saveOasisTextStyle( KoGenStyles &mainStyles, const QString & _format ) :"<<_format<( 1 ) ); @@ -1436,7 +1436,7 @@ QBrush KoOasisStyles::loadOasisFillStyle( const KoStyleStack &styleStack, const tmpBrush.setColor(styleStack.attributeNS( KoXmlNS::draw, "fill-color" ) ); if ( styleStack.hasAttributeNS( KoXmlNS::draw, "transparency" ) ) { - QString transparency = styleStack.attributeNS( KoXmlNS::draw, "transparency" ); + TQString transparency = styleStack.attributeNS( KoXmlNS::draw, "transparency" ); if ( transparency == "94%" ) { tmpBrush.setStyle(Qt::Dense1Pattern); @@ -1476,25 +1476,25 @@ QBrush KoOasisStyles::loadOasisFillStyle( const KoStyleStack &styleStack, const } else if ( fill == "hatch" ) { - QString style = styleStack.attributeNS( KoXmlNS::draw, "fill-hatch-name" ); + TQString style = styleStack.attributeNS( KoXmlNS::draw, "fill-hatch-name" ); kdDebug()<<" hatch style is : "<hasAttributeNS( KoXmlNS::draw, "rotation" )) { - angle = (draw->attributeNS( KoXmlNS::draw, "rotation", QString::null ).toInt())/10; + angle = (draw->attributeNS( KoXmlNS::draw, "rotation", TQString() ).toInt())/10; kdDebug()<<"angle :"<hasAttributeNS( KoXmlNS::draw, "color" ) ) { - //kdDebug()<<" draw:color :"<attributeNS( KoXmlNS::draw, "color", QString::null )<attributeNS( KoXmlNS::draw, "color", QString::null ) ); + //kdDebug()<<" draw:color :"<attributeNS( KoXmlNS::draw, "color", TQString() )<attributeNS( KoXmlNS::draw, "color", TQString() ) ); } if( draw->hasAttributeNS( KoXmlNS::draw, "distance" )) { @@ -1507,7 +1507,7 @@ QBrush KoOasisStyles::loadOasisFillStyle( const KoStyleStack &styleStack, const if( draw->hasAttributeNS( KoXmlNS::draw, "style" )) { //todo implemente it into kpresenter - QString styleHash = draw->attributeNS( KoXmlNS::draw, "style", QString::null ); + TQString styleHash = draw->attributeNS( KoXmlNS::draw, "style", TQString() ); if( styleHash == "single") { switch( angle ) @@ -1567,21 +1567,21 @@ QBrush KoOasisStyles::loadOasisFillStyle( const KoStyleStack &styleStack, const return tmpBrush; } -const QDomElement* KoOasisStyles::defaultStyle( const QString& family ) const +const TQDomElement* KoOasisStyles::defaultStyle( const TQString& family ) const { return m_defaultStyle[family]; } -const QDomElement* KoOasisStyles::findStyle( const QString& name ) const +const TQDomElement* KoOasisStyles::findStyle( const TQString& name ) const { return m_styles[ name ]; } -const QDomElement* KoOasisStyles::findStyle( const QString& styleName, const QString& family ) const +const TQDomElement* KoOasisStyles::findStyle( const TQString& styleName, const TQString& family ) const { - const QDomElement* style = d->m_styles[ family ][ styleName ]; + const TQDomElement* style = d->m_styles[ family ][ styleName ]; if ( style && !family.isEmpty() ) { - const QString styleFamily = style->attributeNS( KoXmlNS::style, "family", QString::null ); + const TQString styleFamily = style->attributeNS( KoXmlNS::style, "family", TQString() ); if ( styleFamily != family ) { kdWarning() << "KoOasisStyles: was looking for style " << styleName << " in family " << family << " but got " << styleFamily << endl; @@ -1590,11 +1590,11 @@ const QDomElement* KoOasisStyles::findStyle( const QString& styleName, const QSt return style; } -const QDomElement* KoOasisStyles::findStyleAutoStyle( const QString& styleName, const QString& family ) const +const TQDomElement* KoOasisStyles::findStyleAutoStyle( const TQString& styleName, const TQString& family ) const { - const QDomElement* style = d->m_stylesAutoStyles[ family ][ styleName ]; + const TQDomElement* style = d->m_stylesAutoStyles[ family ][ styleName ]; if ( style ) { - const QString styleFamily = style->attributeNS( KoXmlNS::style, "family", QString::null ); + const TQString styleFamily = style->attributeNS( KoXmlNS::style, "family", TQString() ); if ( styleFamily != family ) { kdWarning() << "KoOasisStyles: was looking for style " << styleName << " in family " << family << " but got " << styleFamily << endl; diff --git a/lib/kofficecore/KoOasisStyles.h b/lib/kofficecore/KoOasisStyles.h index caa8d513b..9a8e64e44 100644 --- a/lib/kofficecore/KoOasisStyles.h +++ b/lib/kofficecore/KoOasisStyles.h @@ -19,15 +19,15 @@ #ifndef KOOASISSTYLES_H #define KOOASISSTYLES_H -#include -#include -#include -#include +#include +#include +#include +#include #include class KoGenStyles; class KoXmlWriter; -class QBrush; +class TQBrush; class KoGenStyle; class KoStyleStack; @@ -43,119 +43,119 @@ public: /// Look into @p doc for styles and remember them /// @param doc document to look into /// @param stylesDotXml true when loading styles.xml, false otherwise - void createStyleMap( const QDomDocument& doc, bool stylesDotXml ); + void createStyleMap( const TQDomDocument& doc, bool stylesDotXml ); /** * Look up a style by name. - * This method can find styles defined by the tags "style:page-layout", - * "style:presentation-page-layout", or "style:font-decl". + * This method can find styles defined by the tags "style:page-tqlayout", + * "style:presentation-page-tqlayout", or "style:font-decl". * Do NOT use this method for style:style styles. * * @param name the style name - * @return the dom element representing the style, or QString::null if it wasn't found. + * @return the dom element representing the style, or TQString() if it wasn't found. */ - const QDomElement* findStyle( const QString& name ) const; + const TQDomElement* findStyle( const TQString& name ) const; /** * Look up a style:style by name. * @param name the style name * @param family the style family (for a style:style, use 0 otherwise) - * @return the dom element representing the style, or QString::null if it wasn't found. + * @return the dom element representing the style, or TQString() if it wasn't found. */ - const QDomElement* findStyle( const QString& name, const QString& family ) const; + const TQDomElement* findStyle( const TQString& name, const TQString& family ) const; /// Similar to findStyle but for auto-styles in styles.xml only. - const QDomElement* findStyleAutoStyle( const QString& name, const QString& family ) const; + const TQDomElement* findStyleAutoStyle( const TQString& name, const TQString& family ) const; /// @return the style:styles that are "user styles", i.e. those from office:styles /// findStyle() is used for lookup. userStyles() is used to load all user styles upfront. - QValueVector userStyles() const; + TQValueVector userStyles() const; /// @return the default style for a given family ("graphic","paragraph","table" etc.) /// Returns 0 if no default style for this family is available - const QDomElement* defaultStyle( const QString& family ) const; + const TQDomElement* defaultStyle( const TQString& family ) const; /// @return the office:style element - const QDomElement& officeStyle() const { return m_officeStyle; } + const TQDomElement& officeStyle() const { return m_officeStyle; } /// @return all list styles ("text:list-style" elements), hashed by name - const QDict& listStyles() const { return m_listStyles; } + const TQDict& listStyles() const { return m_listStyles; } /// @return master pages ("style:master-page" elements), hashed by name - const QDict& masterPages() const { return m_masterPages; } + const TQDict& masterPages() const { return m_masterPages; } /// @return draw styles, hashed by name - const QDict& drawStyles() const { return m_drawStyles; } + const TQDict& drawStyles() const { return m_drawStyles; } /// @return all styles ("style:style" elements) for a given family, hashed by name - const QDict& styles(const QString& family) const; + const TQDict& styles(const TQString& family) const; /// Prefix and suffix are always included into formatStr. Having them as separate fields simply /// allows to extract them from formatStr, to display them in separate widgets. struct NumericStyleFormat { - QString formatStr; - QString prefix; - QString suffix; + TQString formatStr; + TQString prefix; + TQString suffix; enum { Number, Scientific, Fraction, Currency, Percentage, Date, Time, Boolean, Text } type; int precision; - QString currencySymbol; + TQString currencySymbol; }; - typedef QMap DataFormatsMap; + typedef TQMap DataFormatsMap; /// Value (date/time/number...) formats found while parsing styles. Used e.g. for fields. /// Key: format name. Value: const DataFormatsMap& dataFormats() const { return m_dataFormats; } - static QString saveOasisDateStyle( KoGenStyles &mainStyles, const QString & _format, bool klocaleFormat, - const QString &_prefix = QString::null , const QString &_suffix= QString::null ); - static QString saveOasisTimeStyle( KoGenStyles &mainStyles, const QString & _format, bool klocaleFormat, - const QString &_prefix = QString::null , const QString &_suffix= QString::null ); - static QString saveOasisFractionStyle( KoGenStyles &mainStyles, const QString & _format, - const QString &_prefix = QString::null , const QString &_suffix= QString::null ); - static QString saveOasisScientificStyle( KoGenStyles &mainStyles, const QString & _format, - const QString &_prefix = QString::null , const QString &_suffix= QString::null ); - static QString saveOasisNumberStyle( KoGenStyles &mainStyles, const QString & _format, - const QString &_prefix = QString::null , const QString &_suffix= QString::null ); - static QString saveOasisPercentageStyle( KoGenStyles &mainStyles, const QString & _format, - const QString &_prefix = QString::null , const QString &_suffix= QString::null ); - static QString saveOasisCurrencyStyle( KoGenStyles &mainStyles, const QString & _format, const QString &symbol, - const QString &_prefix = QString::null , const QString &_suffix= QString::null ); - static QString saveOasisTextStyle( KoGenStyles &mainStyles, const QString & _format, - const QString &_prefix = QString::null , const QString &_suffix= QString::null ); - - static void saveOasisFillStyle( KoGenStyle &styleFill, KoGenStyles& mainStyles, const QBrush & brush ); - static QString saveOasisHatchStyle( KoGenStyles& mainStyles, const QBrush &brush ); - - static QBrush loadOasisFillStyle( const KoStyleStack &styleStack, const QString & fill, const KoOasisStyles & oasisStyles ); + static TQString saveOasisDateStyle( KoGenStyles &mainStyles, const TQString & _format, bool klocaleFormat, + const TQString &_prefix = TQString() , const TQString &_suffix= TQString() ); + static TQString saveOasisTimeStyle( KoGenStyles &mainStyles, const TQString & _format, bool klocaleFormat, + const TQString &_prefix = TQString() , const TQString &_suffix= TQString() ); + static TQString saveOasisFractionStyle( KoGenStyles &mainStyles, const TQString & _format, + const TQString &_prefix = TQString() , const TQString &_suffix= TQString() ); + static TQString saveOasisScientificStyle( KoGenStyles &mainStyles, const TQString & _format, + const TQString &_prefix = TQString() , const TQString &_suffix= TQString() ); + static TQString saveOasisNumberStyle( KoGenStyles &mainStyles, const TQString & _format, + const TQString &_prefix = TQString() , const TQString &_suffix= TQString() ); + static TQString saveOasisPercentageStyle( KoGenStyles &mainStyles, const TQString & _format, + const TQString &_prefix = TQString() , const TQString &_suffix= TQString() ); + static TQString saveOasisCurrencyStyle( KoGenStyles &mainStyles, const TQString & _format, const TQString &symbol, + const TQString &_prefix = TQString() , const TQString &_suffix= TQString() ); + static TQString saveOasisTextStyle( KoGenStyles &mainStyles, const TQString & _format, + const TQString &_prefix = TQString() , const TQString &_suffix= TQString() ); + + static void saveOasisFillStyle( KoGenStyle &styleFill, KoGenStyles& mainStyles, const TQBrush & brush ); + static TQString saveOasisHatchStyle( KoGenStyles& mainStyles, const TQBrush &brush ); + + static TQBrush loadOasisFillStyle( const KoStyleStack &styleStack, const TQString & fill, const KoOasisStyles & oasisStyles ); private: /// Add styles to styles map - void insertStyles( const QDomElement& styles, bool styleAutoStyles = false ); + void insertStyles( const TQDomElement& styles, bool styleAutoStyles = false ); private: - void insertOfficeStyles( const QDomElement& styles ); - void insertStyle( const QDomElement& style, bool styleAutoStyles ); - void importDataStyle( const QDomElement& parent ); - static bool saveOasisTimeFormat( KoXmlWriter &elementWriter, QString & format, QString & text, bool &antislash ); - static void parseOasisDateKlocale(KoXmlWriter &elementWriter, QString & format, QString & text ); - static bool saveOasisKlocaleTimeFormat( KoXmlWriter &elementWriter, QString & format, QString & text ); - static void parseOasisTimeKlocale(KoXmlWriter &elementWriter, QString & format, QString & text ); - static void addKofficeNumericStyleExtension( KoXmlWriter & elementWriter, const QString &_suffix, const QString &_prefix ); + void insertOfficeStyles( const TQDomElement& styles ); + void insertStyle( const TQDomElement& style, bool styleAutoStyles ); + void importDataStyle( const TQDomElement& tqparent ); + static bool saveOasisTimeFormat( KoXmlWriter &elementWriter, TQString & format, TQString & text, bool &antislash ); + static void parseOasisDateKlocale(KoXmlWriter &elementWriter, TQString & format, TQString & text ); + static bool saveOasisKlocaleTimeFormat( KoXmlWriter &elementWriter, TQString & format, TQString & text ); + static void parseOasisTimeKlocale(KoXmlWriter &elementWriter, TQString & format, TQString & text ); + static void addKofficeNumericStyleExtension( KoXmlWriter & elementWriter, const TQString &_suffix, const TQString &_prefix ); KoOasisStyles( const KoOasisStyles & ); // forbidden KoOasisStyles& operator=( const KoOasisStyles & ); // forbidden private: - QDict m_styles; // page-layout, font-decl etc. - QDict m_defaultStyle; - QDomElement m_officeStyle; + TQDict m_styles; // page-tqlayout, font-decl etc. + TQDict m_defaultStyle; + TQDomElement m_officeStyle; - QDict m_masterPages; - QDict m_listStyles; + TQDict m_masterPages; + TQDict m_listStyles; - QDict m_drawStyles; + TQDict m_drawStyles; DataFormatsMap m_dataFormats; class Private; diff --git a/lib/kofficecore/KoOpenPane.cpp b/lib/kofficecore/KoOpenPane.cpp index 07c9580df..6c7cbb86e 100644 --- a/lib/kofficecore/KoOpenPane.cpp +++ b/lib/kofficecore/KoOpenPane.cpp @@ -19,15 +19,15 @@ #include "KoOpenPane.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -45,15 +45,15 @@ #include -class KoSectionListItem : public QListViewItem +class KoSectionListItem : public TQListViewItem { public: - KoSectionListItem(KListView* listView, const QString& name, int sortWeight, int widgetIndex = -1) - : QListViewItem(listView, name), m_sortWeight(sortWeight), m_widgetIndex(widgetIndex) + KoSectionListItem(KListView* listView, const TQString& name, int sortWeight, int widgetIndex = -1) + : TQListViewItem(listView, name), m_sortWeight(sortWeight), m_widgetIndex(widgetIndex) { } - virtual int compare(QListViewItem* i, int, bool) const + virtual int compare(TQListViewItem* i, int, bool) const { KoSectionListItem* item = dynamic_cast(i); @@ -63,13 +63,13 @@ class KoSectionListItem : public QListViewItem return sortWeight() - item->sortWeight(); } - virtual void paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align) + virtual void paintCell(TQPainter* p, const TQColorGroup& cg, int column, int width, int align) { if(widgetIndex() >= 0) { - QListViewItem::paintCell(p, cg, column, width, align); + TQListViewItem::paintCell(p, cg, column, width, align); } else { int ypos = (height() - 2) / 2; - QPen pen(cg.foreground(), 2); + TQPen pen(cg.foreground(), 2); p->setPen(pen); p->drawLine(0, ypos, width, ypos); } @@ -94,8 +94,8 @@ class KoOpenPanePrivate KInstance* m_instance; }; -KoOpenPane::KoOpenPane(QWidget *parent, KInstance* instance, const QString& templateType) - : KoOpenPaneBase(parent, "OpenPane") +KoOpenPane::KoOpenPane(TQWidget *tqparent, KInstance* instance, const TQString& templateType) + : KoOpenPaneBase(tqparent, "OpenPane") { d = new KoOpenPanePrivate; d->m_instance = instance; @@ -105,18 +105,18 @@ KoOpenPane::KoOpenPane(QWidget *parent, KInstance* instance, const QString& temp #if KDE_IS_VERSION(3,4,0) m_sectionList->setShadeSortColumn(false); #endif - connect(m_sectionList, SIGNAL(selectionChanged(QListViewItem*)), - this, SLOT(selectionChanged(QListViewItem*))); - connect(m_sectionList, SIGNAL(pressed(QListViewItem*)), - this, SLOT(itemClicked(QListViewItem*))); - connect(m_sectionList, SIGNAL(spacePressed(QListViewItem*)), - this, SLOT(itemClicked(QListViewItem*))); - connect(m_sectionList, SIGNAL(returnPressed(QListViewItem*)), - this, SLOT(itemClicked(QListViewItem*))); + connect(m_sectionList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), + this, TQT_SLOT(selectionChanged(TQListViewItem*))); + connect(m_sectionList, TQT_SIGNAL(pressed(TQListViewItem*)), + this, TQT_SLOT(itemClicked(TQListViewItem*))); + connect(m_sectionList, TQT_SIGNAL(spacePressed(TQListViewItem*)), + this, TQT_SLOT(itemClicked(TQListViewItem*))); + connect(m_sectionList, TQT_SIGNAL(returnPressed(TQListViewItem*)), + this, TQT_SLOT(itemClicked(TQListViewItem*))); KGuiItem openExistingGItem(i18n("Open Existing Document..."), "fileopen"); m_openExistingButton->setGuiItem(openExistingGItem); - connect(m_openExistingButton, SIGNAL(clicked()), this, SLOT(showOpenFileDialog())); + connect(m_openExistingButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(showOpenFileDialog())); initRecentDocs(); initTemplates(templateType); @@ -127,7 +127,7 @@ KoOpenPane::KoOpenPane(QWidget *parent, KInstance* instance, const QString& temp m_widgetStack->widget(selectedItem->widgetIndex())->setFocus(); } - QValueList sizes; + TQValueList sizes; sizes << 20 << width() - 20; m_splitter->setSizes(sizes); @@ -136,8 +136,8 @@ KoOpenPane::KoOpenPane(QWidget *parent, KInstance* instance, const QString& temp sizes = cfgGrp.readIntListEntry("DetailsPaneSplitterSizes"); emit splitterResized(0, sizes); - connect(this, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList&)), - this, SLOT(saveSplitterSizes(KoDetailsPaneBase*, const QValueList&))); + connect(this, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList&)), + this, TQT_SLOT(saveSplitterSizes(KoDetailsPaneBase*, const TQValueList&))); } KoOpenPane::~KoOpenPane() @@ -156,7 +156,7 @@ KoOpenPane::~KoOpenPane() void KoOpenPane::showOpenFileDialog() { - const QStringList mimeFilter = KoFilterManager::mimeFilter(KoDocument::readNativeFormatMimeType(), + const TQStringList mimeFilter = KoFilterManager::mimeFilter(KoDocument::readNativeFormatMimeType(), KoFilterManager::Import, KoDocument::readExtraNativeMimeTypes()); KURL url = KFileDialog::getOpenURL(":OpenDialog", mimeFilter.join(" "), this); @@ -171,12 +171,12 @@ void KoOpenPane::showOpenFileDialog() void KoOpenPane::initRecentDocs() { KoRecentDocumentsPane* recentDocPane = new KoRecentDocumentsPane(this, d->m_instance); - connect(recentDocPane, SIGNAL(openFile(const QString&)), this, SIGNAL(openExistingFile(const QString&))); - QListViewItem* item = addPane(i18n("Recent Documents"), "fileopen", recentDocPane, 0); - connect(recentDocPane, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList&)), - this, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList&))); - connect(this, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList&)), - recentDocPane, SLOT(resizeSplitter(KoDetailsPaneBase*, const QValueList&))); + connect(recentDocPane, TQT_SIGNAL(openFile(const TQString&)), this, TQT_SIGNAL(openExistingFile(const TQString&))); + TQListViewItem* item = addPane(i18n("Recent Documents"), "fileopen", recentDocPane, 0); + connect(recentDocPane, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList&)), + this, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList&))); + connect(this, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList&)), + recentDocPane, TQT_SLOT(resizeSplitter(KoDetailsPaneBase*, const TQValueList&))); KoSectionListItem* separator = new KoSectionListItem(m_sectionList, "", 1); separator->setEnabled(false); @@ -186,10 +186,10 @@ void KoOpenPane::initRecentDocs() } } -void KoOpenPane::initTemplates(const QString& templateType) +void KoOpenPane::initTemplates(const TQString& templateType) { - QListViewItem* selectItem = 0; - QListViewItem* firstItem = 0; + TQListViewItem* selectItem = 0; + TQListViewItem* firstItem = 0; const int templateOffset = 1000; if(!templateType.isEmpty()) @@ -203,16 +203,16 @@ void KoOpenPane::initTemplates(const QString& templateType) KoTemplatesPane* pane = new KoTemplatesPane(this, d->m_instance, group, templateTree.defaultTemplate()); - connect(pane, SIGNAL(openTemplate(const QString&)), this, SIGNAL(openTemplate(const QString&))); - connect(pane, SIGNAL(alwaysUseChanged(KoTemplatesPane*, const QString&)), - this, SIGNAL(alwaysUseChanged(KoTemplatesPane*, const QString&))); - connect(this, SIGNAL(alwaysUseChanged(KoTemplatesPane*, const QString&)), - pane, SLOT(changeAlwaysUseTemplate(KoTemplatesPane*, const QString&))); - connect(pane, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList&)), - this, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList&))); - connect(this, SIGNAL(splitterResized(KoDetailsPaneBase*, const QValueList&)), - pane, SLOT(resizeSplitter(KoDetailsPaneBase*, const QValueList&))); - QListViewItem* item = addPane(group->name(), group->first()->loadPicture(d->m_instance), + connect(pane, TQT_SIGNAL(openTemplate(const TQString&)), this, TQT_SIGNAL(openTemplate(const TQString&))); + connect(pane, TQT_SIGNAL(alwaysUseChanged(KoTemplatesPane*, const TQString&)), + this, TQT_SIGNAL(alwaysUseChanged(KoTemplatesPane*, const TQString&))); + connect(this, TQT_SIGNAL(alwaysUseChanged(KoTemplatesPane*, const TQString&)), + pane, TQT_SLOT(changeAlwaysUseTemplate(KoTemplatesPane*, const TQString&))); + connect(pane, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList&)), + this, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList&))); + connect(this, TQT_SIGNAL(splitterResized(KoDetailsPaneBase*, const TQValueList&)), + pane, TQT_SLOT(resizeSplitter(KoDetailsPaneBase*, const TQValueList&))); + TQListViewItem* item = addPane(group->name(), group->first()->loadPicture(d->m_instance), pane, group->sortingWeight() + templateOffset); if(!firstItem) { @@ -240,12 +240,12 @@ void KoOpenPane::initTemplates(const QString& templateType) } } -void KoOpenPane::setCustomDocumentWidget(QWidget *widget) { +void KoOpenPane::setCustomDocumentWidget(TQWidget *widget) { Q_ASSERT(widget); KoSectionListItem* separator = new KoSectionListItem(m_sectionList, "", INT_MAX-1); separator->setEnabled(false); - QListViewItem* item = addPane(i18n("Custom Document"), QString::null, widget, INT_MAX); + TQListViewItem* item = addPane(i18n("Custom Document"), TQString(), widget, INT_MAX); KConfigGroup cfgGrp(d->m_instance->config(), "TemplateChooserDialog"); @@ -256,13 +256,13 @@ void KoOpenPane::setCustomDocumentWidget(QWidget *widget) { } } -QListViewItem* KoOpenPane::addPane(const QString& title, const QString& icon, QWidget* widget, int sortWeight) +TQListViewItem* KoOpenPane::addPane(const TQString& title, const TQString& icon, TQWidget* widget, int sortWeight) { return addPane(title, SmallIcon(icon, KIcon::SizeLarge, KIcon::DefaultState, d->m_instance), widget, sortWeight); } -QListViewItem* KoOpenPane::addPane(const QString& title, const QPixmap& icon, QWidget* widget, int sortWeight) +TQListViewItem* KoOpenPane::addPane(const TQString& title, const TQPixmap& icon, TQWidget* widget, int sortWeight) { if(!widget) { return 0; @@ -272,21 +272,21 @@ QListViewItem* KoOpenPane::addPane(const QString& title, const QPixmap& icon, QW KoSectionListItem* listItem = new KoSectionListItem(m_sectionList, title, sortWeight, id); if(!icon.isNull()) { - QImage image = icon.convertToImage(); + TQImage image = icon.convertToImage(); if((image.width() > 48) || (image.height() > 48)) { - image = image.smoothScale(48, 48, QImage::ScaleMin); + image = image.smoothScale(48, 48, TQ_ScaleMin); } image.setAlphaBuffer(true); image = image.copy((image.width() - 48) / 2, (image.height() - 48) / 2, 48, 48); - listItem->setPixmap(0, QPixmap(image)); + listItem->setPixmap(0, TQPixmap(image)); } return listItem; } -void KoOpenPane::selectionChanged(QListViewItem* item) +void KoOpenPane::selectionChanged(TQListViewItem* item) { KoSectionListItem* section = dynamic_cast(item); @@ -297,13 +297,13 @@ void KoOpenPane::selectionChanged(QListViewItem* item) m_widgetStack->raiseWidget(section->widgetIndex()); } -void KoOpenPane::saveSplitterSizes(KoDetailsPaneBase* /*sender*/, const QValueList& sizes) +void KoOpenPane::saveSplitterSizes(KoDetailsPaneBase* /*sender*/, const TQValueList& sizes) { KConfigGroup cfgGrp(d->m_instance->config(), "TemplateChooserDialog"); cfgGrp.writeEntry("DetailsPaneSplitterSizes", sizes); } -void KoOpenPane::itemClicked(QListViewItem* item) +void KoOpenPane::itemClicked(TQListViewItem* item) { KoSectionListItem* selectedItem = static_cast(item); diff --git a/lib/kofficecore/KoOpenPane.h b/lib/kofficecore/KoOpenPane.h index 20bd425d9..818c6e818 100644 --- a/lib/kofficecore/KoOpenPane.h +++ b/lib/kofficecore/KoOpenPane.h @@ -26,7 +26,7 @@ class KConfig; class KoTemplateGroup; class KoOpenPanePrivate; class KInstance; -class QPixmap; +class TQPixmap; class KListViewItem; class KoTemplatesPane; class KoDetailsPaneBase; @@ -34,19 +34,20 @@ class KoDetailsPaneBase; class KoOpenPane : public KoOpenPaneBase { Q_OBJECT + TQ_OBJECT public: /** * Constructor - * @param parent the parent widget + * @param tqparent the tqparent widget * @param instance the KInstance to be used for KConfig data * @param templateType the template-type (group) that should be selected on creation. */ - KoOpenPane(QWidget *parent, KInstance* instance, const QString& templateType = QString::null); + KoOpenPane(TQWidget *tqparent, KInstance* instance, const TQString& templateType = TQString()); virtual ~KoOpenPane(); - QListViewItem* addPane(const QString& title, const QString& icon, QWidget* widget, int sortWeight); - QListViewItem* addPane(const QString& title, const QPixmap& icon, QWidget* widget, int sortWeight); + TQListViewItem* addPane(const TQString& title, const TQString& icon, TQWidget* widget, int sortWeight); + TQListViewItem* addPane(const TQString& title, const TQPixmap& icon, TQWidget* widget, int sortWeight); /** * If the application has a way to create a document not based on a template, but on user @@ -54,26 +55,26 @@ class KoOpenPane : public KoOpenPaneBase * @see KoDocument::createCustomDocumentWidget() * @param widget the widget. */ - void setCustomDocumentWidget(QWidget *widget); + void setCustomDocumentWidget(TQWidget *widget); protected slots: void showOpenFileDialog(); - void selectionChanged(QListViewItem* item); - void itemClicked(QListViewItem* item); + void selectionChanged(TQListViewItem* item); + void itemClicked(TQListViewItem* item); /// Saves the splitter sizes for KoDetailsPaneBase based panes - void saveSplitterSizes(KoDetailsPaneBase* sender, const QValueList& sizes); + void saveSplitterSizes(KoDetailsPaneBase* sender, const TQValueList& sizes); signals: - void openExistingFile(const QString&); - void openTemplate(const QString&); + void openExistingFile(const TQString&); + void openTemplate(const TQString&); /// Emitted when the always use template has changed - void alwaysUseChanged(KoTemplatesPane* sender, const QString& alwaysUse); + void alwaysUseChanged(KoTemplatesPane* sender, const TQString& alwaysUse); /// Emitted when one of the detail panes have changed it's splitter - void splitterResized(KoDetailsPaneBase* sender, const QValueList& sizes); + void splitterResized(KoDetailsPaneBase* sender, const TQValueList& sizes); protected: void initRecentDocs(); @@ -81,7 +82,7 @@ class KoOpenPane : public KoOpenPaneBase * Populate the list with all templates the user can choose. * @param templateType the template-type (group) that should be selected on creation. */ - void initTemplates(const QString& templateType); + void initTemplates(const TQString& templateType); private: KoOpenPanePrivate* d; diff --git a/lib/kofficecore/KoPageLayout.cpp b/lib/kofficecore/KoPageLayout.cpp index 36e447e9f..05eff10ba 100644 --- a/lib/kofficecore/KoPageLayout.cpp +++ b/lib/kofficecore/KoPageLayout.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include // paper formats ( mm ) #define PG_A3_WIDTH 297.0 @@ -57,21 +57,21 @@ KoGenStyle KoPageLayout::saveOasis() const return style; } -void KoPageLayout::loadOasis(const QDomElement &style) +void KoPageLayout::loadOasis(const TQDomElement &style) { - QDomElement properties( KoDom::namedItemNS( style, KoXmlNS::style, "page-layout-properties" ) ); + TQDomElement properties( KoDom::namedItemNS( style, KoXmlNS::style, "page-tqlayout-properties" ) ); if ( !properties.isNull() ) { - ptWidth = KoUnit::parseValue(properties.attributeNS( KoXmlNS::fo, "page-width", QString::null ) ); - ptHeight = KoUnit::parseValue(properties.attributeNS( KoXmlNS::fo, "page-height", QString::null ) ); - if (properties.attributeNS( KoXmlNS::style, "print-orientation", QString::null)=="portrait") + ptWidth = KoUnit::parseValue(properties.attributeNS( KoXmlNS::fo, "page-width", TQString() ) ); + ptHeight = KoUnit::parseValue(properties.attributeNS( KoXmlNS::fo, "page-height", TQString() ) ); + if (properties.attributeNS( KoXmlNS::style, "print-orientation", TQString())=="portrait") orientation=PG_PORTRAIT; else orientation=PG_LANDSCAPE; - ptRight = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-right", QString::null ) ); - ptBottom = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-bottom", QString::null ) ); - ptLeft = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-left", QString::null ) ); - ptTop = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-top", QString::null ) ); + ptRight = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-right", TQString() ) ); + ptBottom = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-bottom", TQString() ) ); + ptLeft = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-left", TQString() ) ); + ptTop = KoUnit::parseValue( properties.attributeNS( KoXmlNS::fo, "margin-top", TQString() ) ); // guessFormat takes millimeters if ( orientation == PG_LANDSCAPE ) format = KoPageFormat::guessFormat( POINT_TO_MM(ptHeight), POINT_TO_MM(ptWidth) ); @@ -82,18 +82,18 @@ void KoPageLayout::loadOasis(const QDomElement &style) KoPageLayout KoPageLayout::standardLayout() { - KoPageLayout layout; - layout.format = KoPageFormat::defaultFormat(); - layout.orientation = PG_PORTRAIT; - layout.ptWidth = MM_TO_POINT( KoPageFormat::width( layout.format, layout.orientation ) ); - layout.ptHeight = MM_TO_POINT( KoPageFormat::height( layout.format, layout.orientation ) ); - layout.ptLeft = MM_TO_POINT( 20.0 ); - layout.ptRight = MM_TO_POINT( 20.0 ); - layout.ptTop = MM_TO_POINT( 20.0 ); - layout.ptBottom = MM_TO_POINT( 20.0 ); - layout.ptPageEdge = -1; - layout.ptBindingSide = -1; - return layout; + KoPageLayout tqlayout; + tqlayout.format = KoPageFormat::defaultFormat(); + tqlayout.orientation = PG_PORTRAIT; + tqlayout.ptWidth = MM_TO_POINT( KoPageFormat::width( tqlayout.format, tqlayout.orientation ) ); + tqlayout.ptHeight = MM_TO_POINT( KoPageFormat::height( tqlayout.format, tqlayout.orientation ) ); + tqlayout.ptLeft = MM_TO_POINT( 20.0 ); + tqlayout.ptRight = MM_TO_POINT( 20.0 ); + tqlayout.ptTop = MM_TO_POINT( 20.0 ); + tqlayout.ptBottom = MM_TO_POINT( 20.0 ); + tqlayout.ptPageEdge = -1; + tqlayout.ptBindingSide = -1; + return tqlayout; } struct PageFormatInfo @@ -149,12 +149,12 @@ int KoPageFormat::printerPageSize( KoFormat format ) { if ( format == PG_SCREEN ) { - kdWarning() << "You use the page layout SCREEN. Printing in DIN A4 LANDSCAPE." << endl; + kdWarning() << "You use the page tqlayout SCREEN. Printing in DIN A4 LANDSCAPE." << endl; return KPrinter::A4; } else if ( format == PG_CUSTOM ) { - kdWarning() << "The used page layout (CUSTOM) is not supported by KPrinter. Printing in A4." << endl; + kdWarning() << "The used page tqlayout (CUSTOM) is not supported by KPrinter. Printing in A4." << endl; return KPrinter::A4; } else if ( format <= PG_LAST_FORMAT ) @@ -195,18 +195,18 @@ KoFormat KoPageFormat::guessFormat( double width, double height ) return PG_CUSTOM; } -QString KoPageFormat::formatString( KoFormat format ) +TQString KoPageFormat::formatString( KoFormat format ) { if ( format <= PG_LAST_FORMAT ) - return QString::fromLatin1( pageFormatInfo[ format ].shortName ); - return QString::fromLatin1( "A4" ); + return TQString::tqfromLatin1( pageFormatInfo[ format ].shortName ); + return TQString::tqfromLatin1( "A4" ); } -KoFormat KoPageFormat::formatFromString( const QString & string ) +KoFormat KoPageFormat::formatFromString( const TQString & string ) { for ( int i = 0 ; i <= PG_LAST_FORMAT ; ++i ) { - if (string == QString::fromLatin1( pageFormatInfo[ i ].shortName )) + if (string == TQString::tqfromLatin1( pageFormatInfo[ i ].shortName )) return pageFormatInfo[ i ].format; } // We do not know the format name, so we have a custom format @@ -224,16 +224,16 @@ KoFormat KoPageFormat::defaultFormat() return PG_DIN_A4; } -QString KoPageFormat::name( KoFormat format ) +TQString KoPageFormat::name( KoFormat format ) { if ( format <= PG_LAST_FORMAT ) return i18n( pageFormatInfo[ format ].descriptiveName ); return i18n( pageFormatInfo[ PG_DIN_A4 ].descriptiveName ); } -QStringList KoPageFormat::allFormats() +TQStringList KoPageFormat::allFormats() { - QStringList lst; + TQStringList lst; for ( int i = 0 ; i <= PG_LAST_FORMAT ; ++i ) { lst << i18n( pageFormatInfo[ i ].descriptiveName ); diff --git a/lib/kofficecore/KoPageLayout.h b/lib/kofficecore/KoPageLayout.h index f9f98fc6c..4d4dc6cc8 100644 --- a/lib/kofficecore/KoPageLayout.h +++ b/lib/kofficecore/KoPageLayout.h @@ -23,15 +23,15 @@ #define KOPAGELAYOUT_H #include -#include +#include #include -class QDomElement; +class TQDomElement; /** * @brief Represents the paper format a document shall be printed on. * * For compatibility reasons, and because of screen and custom, - * this enum doesn't map to QPrinter::PageSize but KoPageFormat::printerPageSize + * this enum doesn't map to TQPrinter::PageSize but KoPageFormat::printerPageSize * does the conversion. * * @todo convert DIN to ISO in the names @@ -108,13 +108,13 @@ namespace KoPageFormat * Returns the internal name of the given page format. * Use for saving. */ - KOFFICECORE_EXPORT QString formatString( KoFormat format ); + KOFFICECORE_EXPORT TQString formatString( KoFormat format ); /** * Convert a format string (internal name) to a page format value. * Use for loading. */ - KOFFICECORE_EXPORT KoFormat formatFromString( const QString & string ); + KOFFICECORE_EXPORT KoFormat formatFromString( const TQString & string ); /** * Returns the default format (based on the KControl settings) @@ -125,12 +125,12 @@ namespace KoPageFormat * Returns the translated name of the given page format. * Use for showing the user. */ - KOFFICECORE_EXPORT QString name( KoFormat format ); + KOFFICECORE_EXPORT TQString name( KoFormat format ); /** * Lists the translated names of all the available formats */ - KOFFICECORE_EXPORT QStringList allFormats(); + KOFFICECORE_EXPORT TQStringList allFormats(); /** * Try to find the paper format for the given width and height (in mm). @@ -154,7 +154,7 @@ enum KoHFType { }; /** - * This structure defines the page layout, including + * This structure defines the page tqlayout, including * its size in pt, its format (e.g. A4), orientation, unit, margins etc. */ struct KoPageLayout @@ -194,17 +194,17 @@ struct KoPageLayout } /** - * Save this page layout to OASIS. + * Save this page tqlayout to OASIS. */ KOFFICECORE_EXPORT KoGenStyle saveOasis() const; /** - * Load this page layout from OASIS + * Load this page tqlayout from OASIS */ - KOFFICECORE_EXPORT void loadOasis(const QDomElement &style); + KOFFICECORE_EXPORT void loadOasis(const TQDomElement &style); /** - * @return a page layout with the default page size depending on the locale settings, + * @return a page tqlayout with the default page size depending on the locale settings, * default margins (2 cm), and portrait orientation. * @since 1.4 */ @@ -214,12 +214,12 @@ struct KoPageLayout /** structure for header-footer */ struct KoHeadFoot { - QString headLeft; - QString headMid; - QString headRight; - QString footLeft; - QString footMid; - QString footRight; + TQString headLeft; + TQString headMid; + TQString headRight; + TQString footLeft; + TQString footMid; + TQString footRight; }; /** structure for columns */ @@ -229,11 +229,11 @@ struct KoColumns double ptColumnSpacing; bool operator==( const KoColumns& rhs ) const { return columns == rhs.columns && - QABS(ptColumnSpacing - rhs.ptColumnSpacing) <= 1E-10; + TQABS(ptColumnSpacing - rhs.ptColumnSpacing) <= 1E-10; } bool operator!=( const KoColumns& rhs ) const { return columns != rhs.columns || - QABS(ptColumnSpacing - rhs.ptColumnSpacing) > 1E-10; + TQABS(ptColumnSpacing - rhs.ptColumnSpacing) > 1E-10; } }; @@ -247,9 +247,9 @@ struct KoKWHeaderFooter double ptFootNoteBodySpacing; bool operator==( const KoKWHeaderFooter& rhs ) const { return header == rhs.header && footer == rhs.footer && - QABS(ptHeaderBodySpacing - rhs.ptHeaderBodySpacing) <= 1E-10 && - QABS(ptFooterBodySpacing - rhs.ptFooterBodySpacing) <= 1E-10 && - QABS(ptFootNoteBodySpacing - rhs.ptFootNoteBodySpacing) <= 1E-10; + TQABS(ptHeaderBodySpacing - rhs.ptHeaderBodySpacing) <= 1E-10 && + TQABS(ptFooterBodySpacing - rhs.ptFooterBodySpacing) <= 1E-10 && + TQABS(ptFootNoteBodySpacing - rhs.ptFootNoteBodySpacing) <= 1E-10; } bool operator!=( const KoKWHeaderFooter& rhs ) const { return !( *this == rhs ); diff --git a/lib/kofficecore/KoPicture.cpp b/lib/kofficecore/KoPicture.cpp index 11bb89ddc..8e74c0b59 100644 --- a/lib/kofficecore/KoPicture.cpp +++ b/lib/kofficecore/KoPicture.cpp @@ -18,8 +18,8 @@ * Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include #include #include @@ -35,7 +35,7 @@ uint KoPicture::uniqueValue = 0; KoPicture::KoPicture(void) : m_sharedData(NULL) { - m_uniqueName = "Pictures"+ QString::number(uniqueValue++); + m_uniqueName = "Pictures"+ TQString::number(uniqueValue++); } KoPicture::~KoPicture(void) @@ -43,7 +43,7 @@ KoPicture::~KoPicture(void) unlinkSharedData(); } -QString KoPicture::uniqueName() const +TQString KoPicture::uniqueName() const { return m_uniqueName; } @@ -60,12 +60,12 @@ void KoPicture::assignPictureId( uint _id) m_sharedData->assignPictureId(_id); } -QString KoPicture::uniquePictureId() const +TQString KoPicture::uniquePictureId() const { if ( m_sharedData ) return m_sharedData->uniquePictureId(); else - return QString::null; + return TQString(); } KoPicture& KoPicture::operator=( const KoPicture &other ) @@ -129,7 +129,7 @@ bool KoPicture::isNull(void) const return true; } -void KoPicture::draw(QPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode) +void KoPicture::draw(TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode) { if (m_sharedData) m_sharedData->draw(painter, x, y, width, height, sx, sy, sw, sh, fastMode); @@ -138,25 +138,25 @@ void KoPicture::draw(QPainter& painter, int x, int y, int width, int height, int // Draw a white box kdWarning(30003) << "Drawing white rectangle! (KoPicture::draw)" << endl; painter.save(); - painter.setBrush(QColor(255, 255, 255)); + painter.setBrush(TQColor(255, 255, 255)); painter.drawRect(x,y,width,height); painter.restore(); } } -bool KoPicture::loadXpm(QIODevice* io) +bool KoPicture::loadXpm(TQIODevice* io) { kdDebug(30003) << "KoPicture::loadXpm" << endl; if (!io) { - kdError(30003) << "No QIODevice!" << endl; + kdError(30003) << "No TQIODevice!" << endl; return false; } createSharedData(); return m_sharedData->loadXpm(io); } -bool KoPicture::save(QIODevice* io) const +bool KoPicture::save(TQIODevice* io) const { if (!io) return false; @@ -177,66 +177,66 @@ void KoPicture::clear(void) unlinkSharedData(); } -void KoPicture::clearAndSetMode(const QString& newMode) +void KoPicture::clearAndSetMode(const TQString& newMode) { createSharedData(); m_sharedData->clearAndSetMode(newMode); } -QString KoPicture::getExtension(void) const +TQString KoPicture::getExtension(void) const { if (m_sharedData) return m_sharedData->getExtension(); return "null"; // Just a dummy } -QString KoPicture::getMimeType(void) const +TQString KoPicture::getMimeType(void) const { if (m_sharedData) return m_sharedData->getMimeType(); - return QString(NULL_MIME_TYPE); + return TQString(NULL_MIME_TYPE); } -bool KoPicture::load(QIODevice* io, const QString& extension) +bool KoPicture::load(TQIODevice* io, const TQString& extension) { - kdDebug(30003) << "KoPicture::load(QIODevice*, const QString&) " << extension << endl; + kdDebug(30003) << "KoPicture::load(TQIODevice*, const TQString&) " << extension << endl; createSharedData(); return m_sharedData->load(io,extension); } -bool KoPicture::loadFromFile(const QString& fileName) +bool KoPicture::loadFromFile(const TQString& fileName) { kdDebug(30003) << "KoPicture::loadFromFile " << fileName << endl; createSharedData(); return m_sharedData->loadFromFile(fileName); } -bool KoPicture::loadFromBase64( const QCString& str ) +bool KoPicture::loadFromBase64( const TQCString& str ) { createSharedData(); return m_sharedData->loadFromBase64( str ); } -QSize KoPicture::getOriginalSize(void) const +TQSize KoPicture::getOriginalSize(void) const { if (m_sharedData) return m_sharedData->getOriginalSize(); - return QSize(0,0); + return TQSize(0,0); } -QPixmap KoPicture::generatePixmap(const QSize& size, bool smoothScale) +TQPixmap KoPicture::generatePixmap(const TQSize& size, bool smoothScale) { if (m_sharedData) return m_sharedData->generatePixmap(size, smoothScale); - return QPixmap(); + return TQPixmap(); } -bool KoPicture::setKeyAndDownloadPicture(const KURL& url, QWidget *window) +bool KoPicture::setKeyAndDownloadPicture(const KURL& url, TQWidget *window) { bool result=false; - QString tmpFileName; + TQString tmpFileName; if ( KIO::NetAccess::download(url, tmpFileName, window) ) { KoPictureKey key; @@ -249,18 +249,18 @@ bool KoPicture::setKeyAndDownloadPicture(const KURL& url, QWidget *window) return result; } -QDragObject* KoPicture::dragObject( QWidget *dragSource, const char *name ) +TQDragObject* KoPicture::dragObject( TQWidget *dragSource, const char *name ) { if (m_sharedData) return m_sharedData->dragObject( dragSource, name ); return 0L; } -QImage KoPicture::generateImage(const QSize& size) +TQImage KoPicture::generateImage(const TQSize& size) { if (m_sharedData) return m_sharedData->generateImage( size ); - return QImage(); + return TQImage(); } bool KoPicture::hasAlphaBuffer() const @@ -276,11 +276,11 @@ void KoPicture::setAlphaBuffer(bool enable) m_sharedData->setAlphaBuffer(enable); } -QImage KoPicture::createAlphaMask(int conversion_flags) const +TQImage KoPicture::createAlphaMask(int conversion_flags) const { if (m_sharedData) return m_sharedData->createAlphaMask(conversion_flags); - return QImage(); + return TQImage(); } void KoPicture::clearCache(void) diff --git a/lib/kofficecore/KoPicture.h b/lib/kofficecore/KoPicture.h index e4ed1d5d5..3fa355f8a 100644 --- a/lib/kofficecore/KoPicture.h +++ b/lib/kofficecore/KoPicture.h @@ -20,17 +20,17 @@ #ifndef __koPicture_h__ #define __koPicture_h__ -#include -#include -#include +#include +#include +#include #include #include "KoPictureKey.h" class KoXmlWriter; -class QPainter; -class QSize; -class QDragObject; +class TQPainter; +class TQSize; +class TQDragObject; class KURL; class KoPictureShared; @@ -87,31 +87,31 @@ public: * * The parameters @p width, @p height define the desired size for the picture * - * The other parameters are very similar to QPainter::drawPixmap : + * The other parameters are very similar to TQPainter::drawPixmap : * (@p x, @p y) define the position in the painter, * (@p sx, @p sy) specify the top-left point in picture that is to be drawn. The default is (0, 0). * (@p sw, @p sh) specify the size of the picture that is to be drawn. The default, (-1, -1), means all the way to the bottom * right of the pixmap. * */ - void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, + void draw(TQPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); /** * Create a dragobject containing this picture. * @param dragSource must be 0 when copying to the clipboard - * @param name name for the QDragObject + * @param name name for the TQDragObject * @return 0L if the picture is null, or if a dragobject for it isn't implemented [yet] */ - QDragObject* dragObject( QWidget *dragSource = 0L, const char *name = 0L ); + TQDragObject* dragObject( TQWidget *dragSource = 0L, const char *name = 0L ); - bool load(QIODevice* io, const QString& extension); + bool load(TQIODevice* io, const TQString& extension); /** - * Save picture into a QIODevice - * @param io QIODevice used for saving + * Save picture into a TQIODevice + * @param io TQIODevice used for saving */ - bool save(QIODevice* io) const; + bool save(TQIODevice* io) const; /** * OASIS FlatXML support: @@ -128,24 +128,24 @@ public: /** * @return the image extension (e.g. png) */ - QString getExtension(void) const; + TQString getExtension(void) const; /** * @return the image MIME type */ - QString getMimeType(void) const; + TQString getMimeType(void) const; /** * @return the original image size */ - QSize getOriginalSize(void) const; + TQSize getOriginalSize(void) const; /** * Clear and set the mode of this KoPicture * * @param newMode a file extension (like "png") giving the wanted mode */ - void clearAndSetMode(const QString& newMode); + void clearAndSetMode(const TQString& newMode); /** * Reset the KoPicture (but not the key!) @@ -155,43 +155,43 @@ public: /** * Load the picture from a file named @p fileName */ - bool loadFromFile(const QString& fileName); + bool loadFromFile(const TQString& fileName); /** * Load the picture from base64-encoded data */ - bool loadFromBase64(const QCString& str); + bool loadFromBase64(const TQCString& str); /** * Load a potentially broken XPM file (for old files of KPresenter) */ - bool loadXpm(QIODevice* io); + bool loadXpm(TQIODevice* io); /** * @deprecated To be replaced by @ref KoPicture::draw * - * Returns a QPixmap from an image - * Returns an empty QPixmap if the KoPicture is not an image. + * Returns a TQPixmap from an image + * Returns an empty TQPixmap if the KoPicture is not an image. */ - QPixmap generatePixmap(const QSize& size, bool smoothScale = false); + TQPixmap generatePixmap(const TQSize& size, bool smoothScale = false); /** * Download and set the key for a possibly remote file. * * @param url the url to download from - * @param window the parent widget for the download. You can pass - * NULL (0) if you absolutely cannot find a parent + * @param window the tqparent widget for the download. You can pass + * NULL (0) if you absolutely cannot find a tqparent * widget to use. */ - bool setKeyAndDownloadPicture(const KURL& url, QWidget *window); + bool setKeyAndDownloadPicture(const KURL& url, TQWidget *window); /** - * Generate a QImage + * Generate a TQImage * (always in slow mode) * - * @param size the wanted size for the QImage + * @param size the wanted size for the TQImage */ - QImage generateImage(const QSize& size); + TQImage generateImage(const TQSize& size); /** * @return TRUE if the alpha channel processing has been enabled @@ -204,12 +204,12 @@ public: void setAlphaBuffer(bool enable); /** - * Creates an alpha mask for the picture + * Creates an alpha tqmask for the picture * (first you have to call @ref #setAlphaBuffer). * * @see hasAlphaBuffer() setAlphaBuffer() */ - QImage createAlphaMask(int conversion_flags = 0) const; + TQImage createAlphaMask(int conversion_flags = 0) const; /** * @brief Clear any cache @@ -219,7 +219,7 @@ public: */ void clearCache(void); - QString uniquePictureId() const; + TQString uniquePictureId() const; void assignPictureId( uint _id); protected: @@ -238,7 +238,7 @@ protected: * Creare the shared data if needed */ void createSharedData(void); - QString uniqueName() const; + TQString uniqueName() const; protected: /** @@ -253,7 +253,7 @@ protected: KoPictureShared* m_sharedData; static uint uniqueValue; - QString m_uniqueName; + TQString m_uniqueName; }; #endif /* __koPicture_h__ */ diff --git a/lib/kofficecore/KoPictureBase.cpp b/lib/kofficecore/KoPictureBase.cpp index e608abc2a..29ec51b9f 100644 --- a/lib/kofficecore/KoPictureBase.cpp +++ b/lib/kofficecore/KoPictureBase.cpp @@ -27,10 +27,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include static int s_useSlowResizeMode = -1; // unset @@ -64,28 +64,28 @@ bool KoPictureBase::isNull(void) const return true; // A KoPictureBase is always null. } -void KoPictureBase::draw(QPainter& painter, int x, int y, int width, int height, int, int, int, int, bool /*fastMode*/) +void KoPictureBase::draw(TQPainter& painter, int x, int y, int width, int height, int, int, int, int, bool /*fastMode*/) { // Draw a light red box (easier DEBUG) kdWarning(30003) << "Drawing light red rectangle! (KoPictureBase::draw)" << endl; painter.save(); - painter.setBrush(QColor(128,0,0)); + painter.setBrush(TQColor(128,0,0)); painter.drawRect(x,y,width,height); painter.restore(); } -bool KoPictureBase::load(QIODevice* io, const QString& extension) +bool KoPictureBase::load(TQIODevice* io, const TQString& extension) { return loadData(io->readAll(), extension); } -bool KoPictureBase::loadData(const QByteArray&, const QString&) +bool KoPictureBase::loadData(const TQByteArray&, const TQString&) { // Nothing to load! return false; } -bool KoPictureBase::save(QIODevice*) const +bool KoPictureBase::save(TQIODevice*) const { // Nothing to save! return false; @@ -93,28 +93,28 @@ bool KoPictureBase::save(QIODevice*) const bool KoPictureBase::saveAsBase64( KoXmlWriter& writer ) const { - QBuffer buffer; + TQBuffer buffer; buffer.open(IO_ReadWrite); - if ( !save( &buffer ) ) + if ( !save( TQT_TQIODEVICE(&buffer) ) ) return false; - QCString encoded = KCodecs::base64Encode( buffer.buffer() ); + TQCString encoded = KCodecs::base64Encode( buffer.buffer() ); writer.addTextNode( encoded ); return true; } -QSize KoPictureBase::getOriginalSize(void) const +TQSize KoPictureBase::getOriginalSize(void) const { - return QSize(0,0); + return TQSize(0,0); } -QPixmap KoPictureBase::generatePixmap(const QSize&, bool /*smoothScale*/) +TQPixmap KoPictureBase::generatePixmap(const TQSize&, bool /*smoothScale*/) { - return QPixmap(); + return TQPixmap(); } -QString KoPictureBase::getMimeType(const QString&) const +TQString KoPictureBase::getMimeType(const TQString&) const { - return QString(NULL_MIME_TYPE); + return TQString(NULL_MIME_TYPE); } bool KoPictureBase::isSlowResizeModeAllowed(void) const @@ -122,16 +122,16 @@ bool KoPictureBase::isSlowResizeModeAllowed(void) const return s_useSlowResizeMode != 0; } -QDragObject* KoPictureBase::dragObject( QWidget * dragSource, const char * name ) +TQDragObject* KoPictureBase::dragObject( TQWidget * dragSource, const char * name ) { - QImage image (generateImage(getOriginalSize())); + TQImage image (generateImage(getOriginalSize())); if (image.isNull()) return 0L; else - return new QImageDrag( image, dragSource, name ); + return new TQImageDrag( image, dragSource, name ); } -QImage KoPictureBase::generateImage(const QSize& size) +TQImage KoPictureBase::generateImage(const TQSize& size) { return generatePixmap(size,true).convertToImage(); } diff --git a/lib/kofficecore/KoPictureBase.h b/lib/kofficecore/KoPictureBase.h index 17a7df968..73056aa69 100644 --- a/lib/kofficecore/KoPictureBase.h +++ b/lib/kofficecore/KoPictureBase.h @@ -22,14 +22,14 @@ #include "KoPictureKey.h" // for KoPictureType -#include -#include +#include +#include class KoXmlWriter; -class QPainter; -class QSize; -class QIODevice; -class QDragObject; +class TQPainter; +class TQSize; +class TQIODevice; +class TQDragObject; const char NULL_MIME_TYPE[]="application/x-zerosize"; @@ -70,30 +70,30 @@ public: * Note that the image is being scaled to that size using scale() - except when printing. * This avoids scaling the image at each paint event. * - * The other parameters are very similar to QPainter::drawPixmap : + * The other parameters are very similar to TQPainter::drawPixmap : * (@p x, @p y) define the position in the painter, * (@p sx, @p sy) specify the top-left point in pixmap that is to be drawn. The default is (0, 0). * (@p sw, @p sh) specify the size of the pixmap that is to be drawn. The default, (-1, -1), means all the way to the bottom * right of the pixmap. */ - virtual void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); + virtual void draw(TQPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); /** * Create a dragobject containing this picture. * @param dragSource must be 0 when copying to the clipboard * @return 0L if the picture is null! */ - virtual QDragObject* dragObject( QWidget *dragSource = 0L, const char *name = 0L ); + virtual TQDragObject* dragObject( TQWidget *dragSource = 0L, const char *name = 0L ); - virtual bool load(QIODevice* io, const QString& extension); + virtual bool load(TQIODevice* io, const TQString& extension); - virtual bool loadData(const QByteArray& array, const QString& extension); + virtual bool loadData(const TQByteArray& array, const TQString& extension); /** * save file - * @param io QIODevice used for saving + * @param io TQIODevice used for saving */ - virtual bool save(QIODevice* io) const; + virtual bool save(TQIODevice* io) const; /** * OASIS FlatXML support: @@ -101,26 +101,26 @@ public: */ virtual bool saveAsBase64( KoXmlWriter& writer ) const; - virtual QSize getOriginalSize(void) const; + virtual TQSize getOriginalSize(void) const; - virtual QPixmap generatePixmap(const QSize& size, bool smoothScale = false); + virtual TQPixmap generatePixmap(const TQSize& size, bool smoothScale = false); - virtual QString getMimeType(const QString& extension) const; + virtual TQString getMimeType(const TQString& extension) const; bool isSlowResizeModeAllowed(void) const; /** - * Generate a QImage + * Generate a TQImage * (always in slow mode) */ - virtual QImage generateImage(const QSize& size); + virtual TQImage generateImage(const TQSize& size); virtual bool hasAlphaBuffer() const { return false; } virtual void setAlphaBuffer(bool /*enable*/) { } - virtual QImage createAlphaMask(int /*conversion_flags*/ = 0) const - { return QImage(); } + virtual TQImage createAlphaMask(int /*conversion_flags*/ = 0) const + { return TQImage(); } virtual void clearCache(void); }; diff --git a/lib/kofficecore/KoPictureClipart.cpp b/lib/kofficecore/KoPictureClipart.cpp index f4d94fd2d..d5c482f8a 100644 --- a/lib/kofficecore/KoPictureClipart.cpp +++ b/lib/kofficecore/KoPictureClipart.cpp @@ -19,10 +19,10 @@ * Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -34,7 +34,7 @@ #include "KoPictureBase.h" #include "KoPictureClipart.h" -KoPictureClipart::KoPictureClipart(void) : m_clipart(KoPictureType::formatVersionQPicture) +KoPictureClipart::KoPictureClipart(void) : m_clipart(KoPictureType::formatVersionTQPicture) { } @@ -57,15 +57,15 @@ bool KoPictureClipart::isNull(void) const return m_clipart.isNull(); } -void KoPictureClipart::drawQPicture(QPicture& clipart, QPainter& painter, +void KoPictureClipart::drawTQPicture(TQPicture& clipart, TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh) { kdDebug(30003) << "Drawing KoPictureClipart " << this << endl; kdDebug(30003) << " x=" << x << " y=" << y << " width=" << width << " height=" << height << endl; kdDebug(30003) << " sx=" << sx << " sy=" << sy << " sw=" << sw << " sh=" << sh << endl; painter.save(); - // Thanks to Harri, Qt3 makes it much easier than Qt2 ;) - QRect br = clipart.boundingRect(); + // Thanks to Harri, TQt3 makes it much easier than TQt2 ;) + TQRect br = clipart.boundingRect(); kdDebug(30003) << " Bounding rect. " << br << endl; painter.translate(x,y); // Translating must be done before scaling! @@ -77,17 +77,17 @@ void KoPictureClipart::drawQPicture(QPicture& clipart, QPainter& painter, painter.restore(); } -void KoPictureClipart::draw(QPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool /*fastMode*/) +void KoPictureClipart::draw(TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool /*fastMode*/) { - drawQPicture(m_clipart, painter, x, y, width, height, sx, sy, sw, sh); + drawTQPicture(m_clipart, painter, x, y, width, height, sx, sy, sw, sh); } -bool KoPictureClipart::loadData(const QByteArray& array, const QString& extension) +bool KoPictureClipart::loadData(const TQByteArray& array, const TQString& extension) { // Second, create the original clipart kdDebug(30003) << "Trying to load clipart... (Size:" << m_rawData.size() << ")" << endl; m_rawData=array; - QBuffer buffer(m_rawData); + TQBuffer buffer(m_rawData); buffer.open(IO_ReadOnly); bool check = true; if (extension=="svg") @@ -102,7 +102,7 @@ bool KoPictureClipart::loadData(const QByteArray& array, const QString& extensio { if (!m_clipart.load(&buffer, NULL)) { - kdWarning(30003) << "Loading QPicture has failed! (KoPictureClipart::load)" << endl; + kdWarning(30003) << "Loading TQPicture has failed! (KoPictureClipart::load)" << endl; check = false; } } @@ -110,29 +110,29 @@ bool KoPictureClipart::loadData(const QByteArray& array, const QString& extensio return check; } -bool KoPictureClipart::save(QIODevice* io) const +bool KoPictureClipart::save(TQIODevice* io) const { - // We save the raw data, as the SVG supposrt in QPicture is poor - Q_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns Q_LONG but size() Q_ULONG! + // We save the raw data, as the SVG supposrt in TQPicture is poor + TQ_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns TQ_LONG but size() TQ_ULONG! return (size==m_rawData.size()); } -QSize KoPictureClipart::getOriginalSize(void) const +TQSize KoPictureClipart::getOriginalSize(void) const { return m_clipart.boundingRect().size(); } -QPixmap KoPictureClipart::generatePixmap(const QSize& size, bool /*smoothScale*/) +TQPixmap KoPictureClipart::generatePixmap(const TQSize& size, bool /*smoothScale*/) { // Not sure if it works, but it worked for KoPictureFilePreviewWidget::setClipart - QPixmap pixmap(size); - QPainter p; + TQPixmap pixmap(size); + TQPainter p; p.begin( &pixmap ); - p.setBackgroundColor( Qt::white ); - pixmap.fill( Qt::white ); + p.setBackgroundColor( TQt::white ); + pixmap.fill( TQt::white ); - QRect br = m_clipart.boundingRect(); + TQRect br = m_clipart.boundingRect(); if ( br.width() && br.height() ) p.scale( (double)pixmap.width() / (double)br.width(), (double)pixmap.height() / (double)br.height() ); p.drawPicture( m_clipart ); @@ -140,7 +140,7 @@ QPixmap KoPictureClipart::generatePixmap(const QSize& size, bool /*smoothScale*/ return pixmap; } -QString KoPictureClipart::getMimeType(const QString& extension) const +TQString KoPictureClipart::getMimeType(const TQString& extension) const { if (extension=="svg") return "image/svg+xml"; diff --git a/lib/kofficecore/KoPictureClipart.h b/lib/kofficecore/KoPictureClipart.h index 9784c6737..b390bca37 100644 --- a/lib/kofficecore/KoPictureClipart.h +++ b/lib/kofficecore/KoPictureClipart.h @@ -20,11 +20,11 @@ #ifndef __koPictureClipart_h__ #define __koPictureClipart_h__ -#include -#include +#include +#include -class QPainter; -class QSize; +class TQPainter; +class TQSize; // TODO: fix documentation @@ -64,39 +64,39 @@ public: * Note that the image is being scaled to that size using scale() - except when printing. * This avoids scaling the image at each paint event. * - * The other parameters are very similar to QPainter::drawPixmap : + * The other parameters are very similar to TQPainter::drawPixmap : * (@p x, @p y) define the position in the painter, * (@p sx, @p sy) specify the top-left point in pixmap that is to be drawn. The default is (0, 0). * (@p sw, @p sh) specify the size of the pixmap that is to be drawn. The default, (-1, -1), means all the way to the bottom * right of the pixmap. */ - virtual void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); + virtual void draw(TQPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); - virtual bool loadData(const QByteArray& array, const QString& extension); + virtual bool loadData(const TQByteArray& array, const TQString& extension); /** * save file - * @param io QIODevice used for saving + * @param io TQIODevice used for saving */ - virtual bool save(QIODevice* io) const; + virtual bool save(TQIODevice* io) const; - virtual QSize getOriginalSize(void) const; + virtual TQSize getOriginalSize(void) const; - virtual QPixmap generatePixmap(const QSize& size, bool smoothScale = false); + virtual TQPixmap generatePixmap(const TQSize& size, bool smoothScale = false); - virtual QString getMimeType(const QString& extension) const; + virtual TQString getMimeType(const TQString& extension) const; protected: - QPixmap getPixmap(QImage& image); + TQPixmap getPixmap(TQImage& image); /** * @internal - * Draw a QPicture + * Draw a TQPicture */ - void drawQPicture(QPicture& clipart, QPainter& painter, + void drawTQPicture(TQPicture& clipart, TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh); protected: - QPicture m_clipart; ///< The clipart as QPicture - QByteArray m_rawData; ///< Copy of the loaded image file + TQPicture m_clipart; ///< The clipart as TQPicture + TQByteArray m_rawData; ///< Copy of the loaded image file }; #endif /* __koPictureClipart_h__ */ diff --git a/lib/kofficecore/KoPictureCollection.cpp b/lib/kofficecore/KoPictureCollection.cpp index 8941f32e1..3d680bf73 100644 --- a/lib/kofficecore/KoPictureCollection.cpp +++ b/lib/kofficecore/KoPictureCollection.cpp @@ -19,7 +19,7 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include #include @@ -37,7 +37,7 @@ KoPicture KoPictureCollection::findPicture(const KoPictureKey& key) const #ifdef DEBUG_PICTURES kdDebug(30003) << "KoPictureCollection::findPicture " << key.toString() << endl; #endif - ConstIterator it = find( key ); + ConstIterator it = tqfind( key ); if ( it == end() ) { KoPicture picture; @@ -72,7 +72,7 @@ KoPicture KoPictureCollection::insertPicture(const KoPicture& picture) return insertPicture(picture.getKey(), picture); } -KoPicture KoPictureCollection::downloadPicture(const KURL& url, QWidget *window) +KoPicture KoPictureCollection::downloadPicture(const KURL& url, TQWidget *window) { #ifdef DEBUG_PICTURES kdDebug(30003) << "KoPictureCollection::downloadPicture " << url.prettyURL() << endl; @@ -99,7 +99,7 @@ KoPicture KoPictureCollection::downloadPicture(const KURL& url, QWidget *window) return pic; } -KoPicture KoPictureCollection::loadPicture(const QString& fileName) +KoPicture KoPictureCollection::loadPicture(const TQString& fileName) { #ifdef DEBUG_PICTURES kdDebug(30003) << "KoPictureCollection::loadPicture " << fileName << endl; @@ -122,23 +122,23 @@ KoPicture KoPictureCollection::loadPicture(const QString& fileName) return c; } -QString KoPictureCollection::getFileName(const Type pictureType, KoPicture& picture, int& counter) +TQString KoPictureCollection::getFileName(const Type pictureType, KoPicture& picture, int& counter) { - QString storeURL; + TQString storeURL; // ### TODO: remove "cliparts" when KPresenter is ready for it if (pictureType==CollectionClipart) storeURL="cliparts/clipart"; else storeURL="pictures/picture"; - storeURL+=QString::number(++counter); + storeURL+=TQString::number(++counter); storeURL+='.'; storeURL+=picture.getExtension(); return storeURL; } -QString KoPictureCollection::getOasisFileName(const KoPicture& picture) const +TQString KoPictureCollection::getOasisFileName(const KoPicture& picture) const { - QString storeURL( "Pictures/"); + TQString storeURL( "Pictures/"); if ( !picture.uniquePictureId().isEmpty() ) storeURL+=picture.uniquePictureId(); else @@ -148,10 +148,10 @@ QString KoPictureCollection::getOasisFileName(const KoPicture& picture) const return storeURL; } -bool KoPictureCollection::saveToStore(const Type pictureType, KoStore *store, const QValueList& keys) +bool KoPictureCollection::saveToStore(const Type pictureType, KoStore *store, const TQValueList& keys) { int counter=0; - QValueList::const_iterator it = keys.begin(); + TQValueList::const_iterator it = keys.begin(); for ( ; it != keys.end(); ++it ) { KoPicture c = findPicture( *it ); @@ -159,7 +159,7 @@ bool KoPictureCollection::saveToStore(const Type pictureType, KoStore *store, co kdWarning(30003) << "Picture " << (*it).toString() << " not found in collection !" << endl; else { - QString storeURL=getFileName(pictureType, c, counter); + TQString storeURL=getFileName(pictureType, c, counter); if (store->open(storeURL)) { @@ -174,9 +174,9 @@ bool KoPictureCollection::saveToStore(const Type pictureType, KoStore *store, co return true; } -bool KoPictureCollection::saveOasisToStore( KoStore *store, QValueList keys, KoXmlWriter* manifestWriter ) +bool KoPictureCollection::saveOasisToStore( KoStore *store, TQValueList keys, KoXmlWriter* manifestWriter ) { - QValueList::Iterator it = keys.begin(); + TQValueList::Iterator it = keys.begin(); for ( ; it != keys.end(); ++it ) { KoPicture c = findPicture( *it ); @@ -184,7 +184,7 @@ bool KoPictureCollection::saveOasisToStore( KoStore *store, QValueListopen(storeURL)) { KoStoreDevice dev(store); @@ -199,16 +199,16 @@ bool KoPictureCollection::saveOasisToStore( KoStore *store, QValueList keys) +TQDomElement KoPictureCollection::saveXML(const Type pictureType, TQDomDocument &doc, TQValueList keys) { - QString strElementName("PICTURES"); + TQString strElementName("PICTURES"); if (pictureType==CollectionImage) strElementName="PIXMAPS"; else if (pictureType==CollectionClipart) strElementName="CLIPARTS"; - QDomElement cliparts = doc.createElement( strElementName ); + TQDomElement cliparts = doc.createElement( strElementName ); int counter=0; - QValueList::Iterator it = keys.begin(); + TQValueList::Iterator it = keys.begin(); for ( ; it != keys.end(); ++it ) { KoPicture picture = findPicture( *it ); @@ -216,8 +216,8 @@ QDomElement KoPictureCollection::saveXML(const Type pictureType, QDomDocument &d kdWarning(30003) << "Picture " << (*it).toString() << " not found in collection !" << endl; else { - QString pictureName=getFileName(pictureType, picture, counter); - QDomElement keyElem = doc.createElement( "KEY" ); + TQString pictureName=getFileName(pictureType, picture, counter); + TQDomElement keyElem = doc.createElement( "KEY" ); cliparts.appendChild(keyElem); (*it).saveAttributes(keyElem); keyElem.setAttribute("name", pictureName); @@ -226,13 +226,13 @@ QDomElement KoPictureCollection::saveXML(const Type pictureType, QDomDocument &d return cliparts; } -void KoPictureCollection::readXML( QDomElement& pixmapsElem, QMap & map ) +void KoPictureCollection::readXML( TQDomElement& pixmapsElem, TQMap & map ) { - for( QDomNode n = pixmapsElem.firstChild(); + for( TQDomNode n = pixmapsElem.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement keyElement = n.toElement(); + TQDomElement keyElement = n.toElement(); if (keyElement.isNull()) continue; if (keyElement.tagName()=="KEY") { @@ -244,7 +244,7 @@ void KoPictureCollection::readXML( QDomElement& pixmapsElem, QMap -#include -#include +#include +#include +#include #include "KoPicture.h" @@ -37,7 +37,7 @@ class KoXmlWriter; * A collection of pictures (a key and the picture itself). * */ -class KOFFICECORE_EXPORT KoPictureCollection : public QMap +class KOFFICECORE_EXPORT KoPictureCollection : public TQMap { public: enum Type { @@ -71,10 +71,10 @@ public: * If this file is really remote, it is always downloaded. * If the file is local, it acts as @ref #loadPicture. * @param url the URL to download from - * @param window the parent window for the download. You can pass NULL (0) + * @param window the tqparent window for the download. You can pass NULL (0) * if you absolutely cannot find anything to use. */ - KoPicture downloadPicture(const KURL& url, QWidget *window); + KoPicture downloadPicture(const KURL& url, TQWidget *window); /** * @brief Load a clipart from a file (and insert into the collection). @@ -83,7 +83,7 @@ public: * for this clipart. If this key maps to an existing clipart in the * collection, then this picture is returned, otherwise the file is loaded. */ - KoPicture loadPicture( const QString &fileName ); + KoPicture loadPicture( const TQString &fileName ); /** * Save the used picturess from the collection into the store @@ -96,7 +96,7 @@ public: * * @todo Reduce lameness of dox for pictureType. */ - bool saveToStore(const Type pictureType, KoStore * store, const QValueList& keys ); + bool saveToStore(const Type pictureType, KoStore * store, const TQValueList& keys ); /** * Generate the <PICTURES>, <PIXMAPS> or <CLIPARTS> tag, that saves the key and the related @@ -106,26 +106,26 @@ public: * @param doc the DOM document in which the tags are to be generated * @param keys the list of keys */ - QDomElement saveXML(const Type pictureType, QDomDocument &doc, - QValueList keys ); + TQDomElement saveXML(const Type pictureType, TQDomDocument &doc, + TQValueList keys ); - bool saveOasisToStore( KoStore *store, QValueList keys, KoXmlWriter* manifestWriter ); + bool saveOasisToStore( KoStore *store, TQValueList keys, KoXmlWriter* manifestWriter ); - typedef QMap StoreMap; + typedef TQMap StoreMap; /** * Read the <PICTURES>, <PIXMAPS> or <CLIPARTS> tag, and save the result (key<->store-filename associations) - * into the QMap. You may want to 'new' a QMap in loadXML, and to use and then delete + * into the TQMap. You may want to 'new' a TQMap in loadXML, and to use and then delete * it in completeLoading (to save memory). * * @param pixmapsElem the <PICTURES>, <PIXMAPS> or <CLIPARTS> element */ - StoreMap readXML( QDomElement &pixmapsElem ); + StoreMap readXML( TQDomElement &pixmapsElem ); /** * Helper method for @ref #readFromStore */ - void readXML( QDomElement& pixmapsElem, QMap & map ); + void readXML( TQDomElement& pixmapsElem, TQMap & map ); /** * Read all pictures from the store, into this collection @@ -144,13 +144,13 @@ public: * * Formerly, an invalid date/time meant to read the file from disk. This is not the case anymore. */ - KoPicture findOrLoad(const QString& fileName, const QDateTime& dateTime); + KoPicture findOrLoad(const TQString& fileName, const TQDateTime& dateTime); /** * Return filename as url for picture * */ - QString getOasisFileName(const KoPicture& picture) const; + TQString getOasisFileName(const KoPicture& picture) const; /** * Call it before to save Oasis file @@ -162,7 +162,7 @@ private: /** * @internal */ - QString getFileName(const Type pictureType, KoPicture& picture, int& counter); + TQString getFileName(const Type pictureType, KoPicture& picture, int& counter); class Private; Private* d; diff --git a/lib/kofficecore/KoPictureEps.cpp b/lib/kofficecore/KoPictureEps.cpp index 752e2a450..4b47b2288 100644 --- a/lib/kofficecore/KoPictureEps.cpp +++ b/lib/kofficecore/KoPictureEps.cpp @@ -21,16 +21,16 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -48,8 +48,8 @@ KoPictureEps::KoPictureEps(void) : m_psStreamStart(0), m_psStreamLength(0), m_cacheIsInFastMode(true) { - // Forbid QPixmap to cache the X-Window resources (Yes, it is slower!) - m_cachedPixmap.setOptimization(QPixmap::MemoryOptim); + // Forbid TQPixmap to cache the X-Window resources (Yes, it is slower!) + m_cachedPixmap.setOptimization(TQPixmap::MemoryOptim); } KoPictureEps::~KoPictureEps(void) @@ -71,12 +71,12 @@ bool KoPictureEps::isNull(void) const return m_rawData.isNull(); } -QImage KoPictureEps::scaleWithGhostScript(const QSize& size, const int resolutionx, const int resolutiony ) +TQImage KoPictureEps::scaleWithGhostScript(const TQSize& size, const int resolutionx, const int resolutiony ) { if (!m_boundingBox.width() || !m_boundingBox.height()) { kdDebug(30003) << "EPS image has a null size! (in KoPictureEps::scaleWithGhostScript)" << endl; - return QImage(); + return TQImage(); } // ### TODO: do not call GhostScript up to three times for each re-scaling (one call of GhostScript should be enough to know which device is available: gs --help) @@ -86,7 +86,7 @@ QImage KoPictureEps::scaleWithGhostScript(const QSize& size, const int resolutio const char* deviceTable[] = { "png16m", "bmp16m", "ppm", 0 }; - QImage img; + TQImage img; for ( int i = 0; deviceTable[i]; ++i) { @@ -103,7 +103,7 @@ QImage KoPictureEps::scaleWithGhostScript(const QSize& size, const int resolutio // Helper method for scaleWithGhostScript. Returns 1 on success, 0 on error, -1 if nothing generated // (in which case another 'output device' can be tried) -int KoPictureEps::tryScaleWithGhostScript(QImage &image, const QSize& size, const int resolutionx, const int resolutiony, const char* device ) +int KoPictureEps::tryScaleWithGhostScript(TQImage &image, const TQSize& size, const int resolutionx, const int resolutiony, const char* device ) // Based on the code of the file kdelibs/kimgio/eps.cpp { kdDebug(30003) << "Sampling with GhostScript, using device \"" << device << "\" (in KoPictureEps::tryScaleWithGhostScript)" << endl; @@ -124,12 +124,12 @@ int KoPictureEps::tryScaleWithGhostScript(QImage &image, const QSize& size, cons // create GS command line - QString cmdBuf ( "gs -sOutputFile=" ); + TQString cmdBuf ( "gs -sOutputFile=" ); cmdBuf += KProcess::quote(tmpFile.name()); cmdBuf += " -q -g"; - cmdBuf += QString::number( wantedWidth ); + cmdBuf += TQString::number( wantedWidth ); cmdBuf += "x"; - cmdBuf += QString::number( wantedHeight ); + cmdBuf += TQString::number( wantedHeight ); if ( ( resolutionx > 0) && ( resolutiony > 0) ) { @@ -137,9 +137,9 @@ int KoPictureEps::tryScaleWithGhostScript(QImage &image, const QSize& size, cons // Do not play with resolution for now. // It brings more problems at print than solutions cmdBuf += " -r"; - cmdBuf += QString::number( resolutionx ); + cmdBuf += TQString::number( resolutionx ); cmdBuf += "x"; - cmdBuf += QString::number( resolutiony ); + cmdBuf += TQString::number( resolutiony ); #endif } @@ -151,7 +151,7 @@ int KoPictureEps::tryScaleWithGhostScript(QImage &image, const QSize& size, cons // run ghostview - FILE* ghostfd = popen (QFile::encodeName(cmdBuf), "w"); + FILE* ghostfd = popen (TQFile::encodeName(cmdBuf), "w"); if ( ghostfd == 0 ) { @@ -160,7 +160,7 @@ int KoPictureEps::tryScaleWithGhostScript(QImage &image, const QSize& size, cons } // The translation is needed as GhostScript (7.07) cannot handle negative values in the bounding box otherwise. - fprintf (ghostfd, "\n%d %d translate\n", -qRound(m_boundingBox.left()*xScale), -qRound(m_boundingBox.top()*yScale)); + fprintf (ghostfd, "\n%d %d translate\n", -tqRound(m_boundingBox.left()*xScale), -tqRound(m_boundingBox.top()*yScale)); fprintf (ghostfd, "%g %g scale\n", xScale, yScale); // write image to gs @@ -185,9 +185,9 @@ int KoPictureEps::tryScaleWithGhostScript(QImage &image, const QSize& size, cons return 1; // success } -void KoPictureEps::scaleAndCreatePixmap(const QSize& size, bool fastMode, const int resolutionx, const int resolutiony ) +void KoPictureEps::scaleAndCreatePixmap(const TQSize& size, bool fastMode, const int resolutionx, const int resolutiony ) { - kdDebug(30003) << "KoPictureEps::scaleAndCreatePixmap " << size << " " << (fastMode?QString("fast"):QString("slow")) + kdDebug(30003) << "KoPictureEps::scaleAndCreatePixmap " << size << " " << (fastMode?TQString("fast"):TQString("slow")) << " resolutionx: " << resolutionx << " resolutiony: " << resolutiony << endl; if ((size==m_cachedSize) && ((fastMode) || (!m_cacheIsInFastMode))) @@ -211,20 +211,20 @@ void KoPictureEps::scaleAndCreatePixmap(const QSize& size, bool fastMode, const if ( fastMode && !m_cachedSize.isEmpty()) { kdDebug(30003) << "Fast scaling!" << endl; - // Slower than caching a QImage, but faster than re-sampling! - QImage image( m_cachedPixmap.convertToImage() ); + // Slower than caching a TQImage, but faster than re-sampling! + TQImage image( m_cachedPixmap.convertToImage() ); m_cachedPixmap=image.scale( size ); m_cacheIsInFastMode=true; m_cachedSize=size; } else { - QTime time; + TQTime time; time.start(); - QApplication::setOverrideCursor( Qt::waitCursor ); + TQApplication::setOverrideCursor( TQt::waitCursor ); m_cachedPixmap = scaleWithGhostScript( size, resolutionx, resolutiony ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); m_cacheIsInFastMode=false; m_cachedSize=size; @@ -233,22 +233,22 @@ void KoPictureEps::scaleAndCreatePixmap(const QSize& size, bool fastMode, const kdDebug(30003) << "New size: " << size << endl; } -void KoPictureEps::draw(QPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode) +void KoPictureEps::draw(TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode) { if ( !width || !height ) return; - QSize screenSize( width, height ); + TQSize screenSize( width, height ); //kdDebug() << "KoPictureEps::draw screenSize=" << screenSize.width() << "x" << screenSize.height() << endl; - QPaintDeviceMetrics metrics (painter.device()); + TQPaintDeviceMetrics metrics (painter.device()); kdDebug(30003) << "Metrics: X: " << metrics.logicalDpiX() << " x Y: " << metrics.logicalDpiX() << " (in KoPictureEps::draw)" << endl; - if ( painter.device()->isExtDev() ) // Is it an external device (i.e. printer) + if ( painter.tqdevice()->isExtDev() ) // Is it an external device (i.e. printer) { kdDebug(30003) << "Drawing for a printer (in KoPictureEps::draw)" << endl; // For printing, always re-sample the image, as a printer has never the same resolution than a display. - QImage image( scaleWithGhostScript( screenSize, metrics.logicalDpiX(), metrics.logicalDpiY() ) ); + TQImage image( scaleWithGhostScript( screenSize, metrics.logicalDpiX(), metrics.logicalDpiY() ) ); // sx,sy,sw,sh is meant to be used as a cliprect on the pixmap, but drawImage // translates it to the (x,y) point -> we need (x+sx, y+sy). painter.drawImage( x + sx, y + sy, image, sx, sy, sw, sh ); @@ -266,9 +266,9 @@ void KoPictureEps::draw(QPainter& painter, int x, int y, int width, int height, bool KoPictureEps::extractPostScriptStream( void ) { kdDebug(30003) << "KoPictureEps::extractPostScriptStream" << endl; - QDataStream data( m_rawData, IO_ReadOnly ); - data.setByteOrder( QDataStream::LittleEndian ); - Q_UINT32 magic, offset, length; + TQDataStream data( m_rawData, IO_ReadOnly ); + data.setByteOrder( TQDataStream::LittleEndian ); + TQ_UINT32 magic, offset, length; data >> magic; data >> offset; data >> length; @@ -287,10 +287,10 @@ bool KoPictureEps::extractPostScriptStream( void ) return true; } -QString KoPictureEps::readLine( const QByteArray& array, const uint start, const uint length, uint& pos, bool& lastCharWasCr ) +TQString KoPictureEps::readLine( const TQByteArray& array, const uint start, const uint length, uint& pos, bool& lastCharWasCr ) { - QString strLine; - const uint finish = kMin( start + length, array.size() ); + TQString strLine; + const uint finish = kMin( start + length, (uint)array.size() ); for ( ; pos < finish; ++pos ) // We are starting at pos { const char ch = array[ pos ]; // Read one character @@ -330,7 +330,7 @@ QString KoPictureEps::readLine( const QByteArray& array, const uint start, const } -bool KoPictureEps::loadData(const QByteArray& array, const QString& /* extension */ ) +bool KoPictureEps::loadData(const TQByteArray& array, const TQString& /* extension */ ) { kdDebug(30003) << "KoPictureEps::load" << endl; @@ -356,17 +356,17 @@ bool KoPictureEps::loadData(const QByteArray& array, const QString& /* extension m_psStreamLength = m_rawData.size(); } - QString lineBox; // Line with the bounding box + TQString lineBox; // Line with the bounding box bool lastWasCr = false; // Was the last character of the line a carriage return? uint pos = m_psStreamStart; // We start to search the bounding box at the start of the PostScript stream - QString line( readLine( m_rawData, m_psStreamStart, m_psStreamLength, pos, lastWasCr ) ); + TQString line( readLine( m_rawData, m_psStreamStart, m_psStreamLength, pos, lastWasCr ) ); kdDebug(30003) << "Header: " << line << endl; if (!line.startsWith("%!")) { kdError(30003) << "Not a PostScript file!" << endl; return false; } - QRect rect; + TQRect rect; bool lineIsBoundingBox = false; // Does "line" has a %%BoundingBox line? for(;;) { @@ -390,7 +390,7 @@ bool KoPictureEps::loadData(const QByteArray& array, const QString& /* extension return false; } // Floating point values are not allowed in a Bounding Box, but ther are many such files out there... - QRegExp exp("(\\-?[0-9]+\\.?[0-9]*)\\s(\\-?[0-9]+\\.?[0-9]*)\\s(\\-?[0-9]+\\.?[0-9]*)\\s(\\-?[0-9]+\\.?[0-9]*)"); + TQRegExp exp("(\\-?[0-9]+\\.?[0-9]*)\\s(\\-?[0-9]+\\.?[0-9]*)\\s(\\-?[0-9]+\\.?[0-9]*)\\s(\\-?[0-9]+\\.?[0-9]*)"); if ( exp.search(line) == -1 ) { // ### TODO: it might be an "(atend)" and the bounding box is in the trailer @@ -399,7 +399,7 @@ bool KoPictureEps::loadData(const QByteArray& array, const QString& /* extension kdError(30003) << "Not standard bounding box: " << line << endl; return false; } - kdDebug(30003) << "Reg. Exp. Found: " << exp.capturedTexts() << endl; + kdDebug(30003) << "Reg. Exp. Found: " << exp.tqcapturedTexts() << endl; rect.setLeft((int)exp.cap(1).toDouble()); rect.setTop((int)exp.cap(2).toDouble()); rect.setRight((int)exp.cap(3).toDouble()); @@ -410,30 +410,30 @@ bool KoPictureEps::loadData(const QByteArray& array, const QString& /* extension return true; } -bool KoPictureEps::save(QIODevice* io) const +bool KoPictureEps::save(TQIODevice* io) const { // We save the raw data, to avoid damaging the file by many load/save cycles - Q_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns Q_LONG but size() Q_ULONG! + TQ_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns TQ_LONG but size() TQ_ULONG! return (size==m_rawData.size()); } -QSize KoPictureEps::getOriginalSize(void) const +TQSize KoPictureEps::getOriginalSize(void) const { return m_originalSize; } -QPixmap KoPictureEps::generatePixmap(const QSize& size, bool smoothScale) +TQPixmap KoPictureEps::generatePixmap(const TQSize& size, bool smoothScale) { scaleAndCreatePixmap(size,!smoothScale, 0, 0); return m_cachedPixmap; } -QString KoPictureEps::getMimeType(const QString&) const +TQString KoPictureEps::getMimeType(const TQString&) const { return "image/x-eps"; } -QImage KoPictureEps::generateImage(const QSize& size) +TQImage KoPictureEps::generateImage(const TQSize& size) { // 0, 0 == resolution unknown return scaleWithGhostScript(size, 0, 0); @@ -443,5 +443,5 @@ void KoPictureEps::clearCache(void) { m_cachedPixmap.resize(0, 0); m_cacheIsInFastMode=true; - m_cachedSize=QSize(); + m_cachedSize=TQSize(); } diff --git a/lib/kofficecore/KoPictureEps.h b/lib/kofficecore/KoPictureEps.h index ba2a4cb9c..23dfdaf4d 100644 --- a/lib/kofficecore/KoPictureEps.h +++ b/lib/kofficecore/KoPictureEps.h @@ -20,10 +20,10 @@ #ifndef __koPictureEps_h__ #define __koPictureEps_h__ -#include +#include -class QPainter; -class QSize; +class TQPainter; +class TQSize; class KoPictureEpsPrivate; // TODO: fix documentation @@ -66,43 +66,43 @@ public: * Note that the image is being scaled to that size using scale() - except when printing. * This avoids scaling the image at each paint event. * - * The other parameters are very similar to QPainter::drawPixmap : + * The other parameters are very similar to TQPainter::drawPixmap : * (@p x, @p y) define the position in the painter, * (@p sx, @p sy) specify the top-left point in pixmap that is to be drawn. The default is (0, 0). * (@p sw, @p sh) specify the size of the pixmap that is to be drawn. The default, (-1, -1), means all the way to the bottom * right of the pixmap. */ - virtual void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); + virtual void draw(TQPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); - virtual bool loadData(const QByteArray& array, const QString& extension); + virtual bool loadData(const TQByteArray& array, const TQString& extension); - virtual bool save(QIODevice* io) const; + virtual bool save(TQIODevice* io) const; - virtual QSize getOriginalSize(void) const; + virtual TQSize getOriginalSize(void) const; - virtual QPixmap generatePixmap(const QSize& size, bool smoothScale = false); + virtual TQPixmap generatePixmap(const TQSize& size, bool smoothScale = false); - virtual QString getMimeType(const QString& extension) const; + virtual TQString getMimeType(const TQString& extension) const; /** - * Generate a QImage + * Generate a TQImage * (always in slow mode) */ - virtual QImage generateImage(const QSize& size); + virtual TQImage generateImage(const TQSize& size); virtual void clearCache(void); protected: - QPixmap getPixmap(QImage& image); - void scaleAndCreatePixmap(const QSize& size, bool fastMode, const int resolutionx, const int resolutiony ); - QImage scaleWithGhostScript( const QSize& size, const int resolutionx, const int resolutiony ); + TQPixmap getPixmap(TQImage& image); + void scaleAndCreatePixmap(const TQSize& size, bool fastMode, const int resolutionx, const int resolutiony ); + TQImage scaleWithGhostScript( const TQSize& size, const int resolutionx, const int resolutiony ); bool extractPostScriptStream( void ); private: - int tryScaleWithGhostScript(QImage &image, const QSize& size, const int resolutionx, const int resolutiony, const char* device ); + int tryScaleWithGhostScript(TQImage &image, const TQSize& size, const int resolutionx, const int resolutiony, const char* device ); /** - * @brief Read a line from a PostScript stream in a QByteArray + * @brief Read a line from a PostScript stream in a TQByteArray * - * The PostScript stream is somewhere in the QByteArray and therefore has to be + * The PostScript stream is somewhere in the TQByteArray and therefore has to be * determined by the start and length of this stream and the current position * * @param array the array which is read @@ -113,17 +113,17 @@ private: * to skip an eventual Line Feed at the start of this line * @return the read line */ - QString readLine( const QByteArray& array, const uint start, const uint length, uint& pos, bool& lastCharWasCr ); + TQString readLine( const TQByteArray& array, const uint start, const uint length, uint& pos, bool& lastCharWasCr ); private: /** * Copy of the loaded EPS file */ - QByteArray m_rawData; - QPixmap m_cachedPixmap; ///< Cached pixmap - QSize m_originalSize; ///< Original size of the EPS picture - QSize m_cachedSize; ///< size of the currently cached pixmap @see m_cachedPixmap - QRect m_boundingBox; ///< Bounding box, as read from the EPS file + TQByteArray m_rawData; + TQPixmap m_cachedPixmap; ///< Cached pixmap + TQSize m_originalSize; ///< Original size of the EPS picture + TQSize m_cachedSize; ///< size of the currently cached pixmap @see m_cachedPixmap + TQRect m_boundingBox; ///< Bounding box, as read from the EPS file uint m_psStreamStart; ///< Start position of the PostScript stream (like if it was a MS-DOS EPS file) uint m_psStreamLength; ///< Lenght of the PostScript stream (like if it was a MS-DOS EPS file) /** diff --git a/lib/kofficecore/KoPictureImage.cpp b/lib/kofficecore/KoPictureImage.cpp index 021107604..c0775ac74 100644 --- a/lib/kofficecore/KoPictureImage.cpp +++ b/lib/kofficecore/KoPictureImage.cpp @@ -24,17 +24,17 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include KoPictureImage::KoPictureImage(void) : m_cacheIsInFastMode(true) { - // Forbid QPixmap to cache the X-Window resources (Yes, it is slower!) - m_cachedPixmap.setOptimization(QPixmap::MemoryOptim); + // Forbid TQPixmap to cache the X-Window resources (Yes, it is slower!) + m_cachedPixmap.setOptimization(TQPixmap::MemoryOptim); } KoPictureImage::~KoPictureImage(void) @@ -56,7 +56,7 @@ bool KoPictureImage::isNull(void) const return m_originalImage.isNull(); } -void KoPictureImage::scaleAndCreatePixmap(const QSize& size, bool fastMode) +void KoPictureImage::scaleAndCreatePixmap(const TQSize& size, bool fastMode) { if ((size==m_cachedSize) && ((fastMode) || (!m_cacheIsInFastMode))) @@ -75,27 +75,27 @@ void KoPictureImage::scaleAndCreatePixmap(const QSize& size, bool fastMode) fastMode = true; } - // Use QImage::scale if we have fastMode==true + // Use TQImage::scale if we have fastMode==true if ( fastMode ) { - m_cachedPixmap.convertFromImage(m_originalImage.scale( size ), QPixmap::Color); // Always color or else B/W can be reversed + m_cachedPixmap.convertFromImage(m_originalImage.scale( size ), TQPixmap::Color); // Always color or else B/W can be reversed m_cacheIsInFastMode=true; } else { - m_cachedPixmap.convertFromImage(m_originalImage.smoothScale( size ), QPixmap::Color); // Always color or else B/W can be reversed + m_cachedPixmap.convertFromImage(m_originalImage.smoothScale( size ), TQPixmap::Color); // Always color or else B/W can be reversed m_cacheIsInFastMode=false; } m_cachedSize=size; } -void KoPictureImage::draw(QPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode) +void KoPictureImage::draw(TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode) { //kdDebug() << "KoImage::draw currentSize:" << currentSize.width() << "x" << currentSize.height() << endl; if ( !width || !height ) return; - QSize origSize = getOriginalSize(); - const bool scaleImage = painter.device()->isExtDev() // we are printing + TQSize origSize = getOriginalSize(); + const bool scaleImage = painter.tqdevice()->isExtDev() // we are printing && ((width <= origSize.width()) || (height <= origSize.height())); if( scaleImage ) { @@ -107,14 +107,14 @@ void KoPictureImage::draw(QPainter& painter, int x, int y, int width, int height painter.translate( x, y ); painter.scale( xScale, yScale ); // Note that sx, sy, sw and sh are unused in this case. Not a problem, since it's about printing. - // Note 2: we do not cache the QPixmap. As we are printing, the next time we will probably + // Note 2: we do not cache the TQPixmap. As we are printing, the next time we will probably // need again the screen version. painter.drawImage(0, 0, m_originalImage); painter.restore(); } else { - QSize screenSize( width, height ); + TQSize screenSize( width, height ); //kdDebug() << "KoPictureImage::draw screenSize=" << screenSize.width() << "x" << screenSize.height() << endl; scaleAndCreatePixmap(screenSize, fastMode); @@ -125,13 +125,13 @@ void KoPictureImage::draw(QPainter& painter, int x, int y, int width, int height } } -bool KoPictureImage::loadData(const QByteArray& array, const QString& /* extension*/ ) +bool KoPictureImage::loadData(const TQByteArray& array, const TQString& /* extension*/ ) { m_rawData=array; // Second, create the original image - QBuffer buffer(m_rawData); + TQBuffer buffer(m_rawData); buffer.open(IO_ReadWrite); - QImageIO imageIO(&buffer,NULL); + TQImageIO imageIO(&buffer,NULL); if (!imageIO.read()) { @@ -145,42 +145,42 @@ bool KoPictureImage::loadData(const QByteArray& array, const QString& /* extensi return true; } -bool KoPictureImage::save(QIODevice* io) const +bool KoPictureImage::save(TQIODevice* io) const { kdDebug() << k_funcinfo << "writing raw data. size=" << m_rawData.size() << endl; // We save the raw data, to avoid damaging the file by many load/save cycles (especially for JPEG) - Q_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns Q_LONG but size() Q_ULONG! + TQ_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns TQ_LONG but size() TQ_ULONG! return (size==m_rawData.size()); } -QSize KoPictureImage::getOriginalSize(void) const +TQSize KoPictureImage::getOriginalSize(void) const { return m_originalImage.size(); } -QPixmap KoPictureImage::generatePixmap(const QSize& size, bool smoothScale) +TQPixmap KoPictureImage::generatePixmap(const TQSize& size, bool smoothScale) { scaleAndCreatePixmap(size,!smoothScale); return m_cachedPixmap; } -QString KoPictureImage::getMimeType(const QString& extension) const +TQString KoPictureImage::getMimeType(const TQString& extension) const { - QString fileName("/tmp/temp."); + TQString fileName("/tmp/temp."); fileName+=extension; // Find the mimetype only by the extension, not by file content (as the file is empty!) - const QString mimetype( KMimeType::findByPath( fileName, 0 ,true )->name() ); + const TQString mimetype( KMimeType::findByPath( fileName, 0 ,true )->name() ); // ### TODO: use KMimeType::findByContent (but then the mimetype probably need to be cached) kdDebug(30003) << "Image is mime type: " << mimetype << endl; return mimetype; } -QDragObject* KoPictureImage::dragObject( QWidget *dragSource, const char *name ) +TQDragObject* KoPictureImage::dragObject( TQWidget *dragSource, const char *name ) { - return new QImageDrag( m_originalImage, dragSource, name ); + return new TQImageDrag( m_originalImage, dragSource, name ); } -QImage KoPictureImage::generateImage(const QSize& size) +TQImage KoPictureImage::generateImage(const TQSize& size) { // We do not cache the image, as we will seldom need it again. return m_originalImage.smoothScale( size ); @@ -190,5 +190,5 @@ void KoPictureImage::clearCache(void) { m_cachedPixmap.resize(0, 0); m_cacheIsInFastMode=true; - m_cachedSize=QSize(); + m_cachedSize=TQSize(); } diff --git a/lib/kofficecore/KoPictureImage.h b/lib/kofficecore/KoPictureImage.h index 98d7d5880..4647ba42d 100644 --- a/lib/kofficecore/KoPictureImage.h +++ b/lib/kofficecore/KoPictureImage.h @@ -21,14 +21,14 @@ #define __koPictureImage_h__ #include "KoPictureBase.h" -#include +#include class KoPictureImagePrivate; // TODO: fix documentation /** * @internal - * KoPictureImage is a container class for a QImage-based picture + * KoPictureImage is a container class for a TQImage-based picture * \todo remove private class, as the header is not installed */ class KoPictureImage : public KoPictureBase @@ -65,31 +65,31 @@ public: * Note that the image is being scaled to that size using scale() - except when printing. * This avoids scaling the image at each paint event. * - * The other parameters are very similar to QPainter::drawPixmap : + * The other parameters are very similar to TQPainter::drawPixmap : * (@p x, @p y) define the position in the painter, * (@p sx, @p sy) specify the top-left point in pixmap that is to be drawn. The default is (0, 0). * (@p sw, @p sh) specify the size of the pixmap that is to be drawn. The default, (-1, -1), means all the way to the bottom * right of the pixmap. */ - virtual void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); + virtual void draw(TQPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); - virtual QDragObject* dragObject( QWidget *dragSource = 0L, const char *name = 0L ); + virtual TQDragObject* dragObject( TQWidget *dragSource = 0L, const char *name = 0L ); - virtual bool loadData(const QByteArray& array, const QString& extension); + virtual bool loadData(const TQByteArray& array, const TQString& extension); - virtual bool save(QIODevice* io) const; + virtual bool save(TQIODevice* io) const; - virtual QSize getOriginalSize(void) const; + virtual TQSize getOriginalSize(void) const; - virtual QPixmap generatePixmap(const QSize& size, bool smoothScale = false); + virtual TQPixmap generatePixmap(const TQSize& size, bool smoothScale = false); - virtual QString getMimeType(const QString& extension) const; + virtual TQString getMimeType(const TQString& extension) const; /** - * Generate a QImage + * Generate a TQImage * (always in slow mode) */ - virtual QImage generateImage(const QSize& size); + virtual TQImage generateImage(const TQSize& size); virtual bool hasAlphaBuffer() const { return m_originalImage.hasAlphaBuffer(); } @@ -97,20 +97,20 @@ public: virtual void setAlphaBuffer(bool enable) { m_originalImage.setAlphaBuffer(enable); } - virtual QImage createAlphaMask(int conversion_flags = 0) const - { return m_originalImage.createAlphaMask(conversion_flags); } + virtual TQImage createAlphaMask(int conversion_flags = 0) const + { return m_originalImage.createAlphaMask((Qt::ImageConversionFlags)conversion_flags); } virtual void clearCache(void); protected: - QPixmap getPixmap(QImage& image); - void scaleAndCreatePixmap(const QSize& size, bool fastMode=false); + TQPixmap getPixmap(TQImage& image); + void scaleAndCreatePixmap(const TQSize& size, bool fastMode=false); private: - QImage m_originalImage; ///< Image as Qimage - QByteArray m_rawData; ///< Binary copy of the loaded image file - QPixmap m_cachedPixmap; ///< Cached pixmap - QSize m_cachedSize; ///< size of the currently cached pixmap @see m_cachedPixmap + TQImage m_originalImage; ///< Image as Qimage + TQByteArray m_rawData; ///< Binary copy of the loaded image file + TQPixmap m_cachedPixmap; ///< Cached pixmap + TQSize m_cachedSize; ///< size of the currently cached pixmap @see m_cachedPixmap /** * true, if the last cached image was done using fast mode. * false, if the last cached image was done using slow mode. diff --git a/lib/kofficecore/KoPictureKey.cpp b/lib/kofficecore/KoPictureKey.cpp index ef60cfed8..0badb429e 100644 --- a/lib/kofficecore/KoPictureKey.cpp +++ b/lib/kofficecore/KoPictureKey.cpp @@ -19,20 +19,20 @@ * Boston, MA 02110-1301, USA. */ -#include -#include -#include +#include +#include +#include #include #include "KoPictureKey.h" -static void resetDateTimeToEpoch(QDateTime& dt) +static void resetDateTimeToEpoch(TQDateTime& dt) { // set the time point to 1970-01-01 - dt.setDate(QDate(1970,1,1)); - dt.setTime(QTime(0,0)); - // Note: we cannot use QDateTime;;setTime_t as it makes a local time correction! (### TODO: not true anymore with recent Qt versions) + dt.setDate(TQDate(1970,1,1)); + dt.setTime(TQTime(0,0)); + // Note: we cannot use TQDateTime;;setTime_t as it makes a local time correction! (### TODO: not true anymore with recent TQt versions) } KoPictureKey::KoPictureKey() @@ -40,7 +40,7 @@ KoPictureKey::KoPictureKey() resetDateTimeToEpoch(m_lastModified); } -KoPictureKey::KoPictureKey( const QString &fn, const QDateTime &mod ) +KoPictureKey::KoPictureKey( const TQString &fn, const TQDateTime &mod ) : m_filename( fn ), m_lastModified( mod ) { if (!m_lastModified.isValid()) @@ -50,7 +50,7 @@ KoPictureKey::KoPictureKey( const QString &fn, const QDateTime &mod ) } } -KoPictureKey::KoPictureKey( const QString &fn ) +KoPictureKey::KoPictureKey( const TQString &fn ) : m_filename( fn ) { resetDateTimeToEpoch(m_lastModified); @@ -79,10 +79,10 @@ bool KoPictureKey::operator<( const KoPictureKey &key ) const return key.toString() < toString(); } -void KoPictureKey::saveAttributes( QDomElement &elem ) const +void KoPictureKey::saveAttributes( TQDomElement &elem ) const { - QDate date = m_lastModified.date(); - QTime time = m_lastModified.time(); + TQDate date = m_lastModified.date(); + TQTime time = m_lastModified.time(); elem.setAttribute( "filename", m_filename ); elem.setAttribute( "year", date.year() ); elem.setAttribute( "month", date.month() ); @@ -93,7 +93,7 @@ void KoPictureKey::saveAttributes( QDomElement &elem ) const elem.setAttribute( "msec", time.msec() ); } -void KoPictureKey::loadAttributes( const QDomElement &elem ) +void KoPictureKey::loadAttributes( const TQDomElement &elem ) { // Default date/time is the *nix epoch: 1970-01-01 00:00:00,000 int year=1970, month=1, day=1; @@ -125,8 +125,8 @@ void KoPictureKey::loadAttributes( const QDomElement &elem ) if( elem.hasAttribute( "msec" ) ) msec=elem.attribute( "msec" ).toInt(); - m_lastModified.setDate( QDate( year, month, day ) ); - m_lastModified.setTime( QTime( hour, minute, second, msec ) ); + m_lastModified.setDate( TQDate( year, month, day ) ); + m_lastModified.setTime( TQTime( hour, minute, second, msec ) ); if (!m_lastModified.isValid()) { @@ -136,16 +136,16 @@ void KoPictureKey::loadAttributes( const QDomElement &elem ) } } -QString KoPictureKey::toString() const +TQString KoPictureKey::toString() const { - // We do not use the default QDateTime::toString has it does not show microseconds - return QString::fromLatin1( "%1 %2" ) - .arg( m_filename, m_lastModified.toString("yyyy-MM-dd hh:mm:ss.zzz") ); + // We do not use the default TQDateTime::toString has it does not show microseconds + return TQString::tqfromLatin1( "%1 %2" ) + .tqarg( m_filename, m_lastModified.toString("yyyy-MM-dd hh:mm:ss.zzz") ); } -void KoPictureKey::setKeyFromFile (const QString& filename) +void KoPictureKey::setKeyFromFile (const TQString& filename) { - QFileInfo inf(filename); + TQFileInfo inf(filename); m_filename = filename; m_lastModified = inf.lastModified(); } diff --git a/lib/kofficecore/KoPictureKey.h b/lib/kofficecore/KoPictureKey.h index d336215b8..09cf63207 100644 --- a/lib/kofficecore/KoPictureKey.h +++ b/lib/kofficecore/KoPictureKey.h @@ -20,35 +20,35 @@ #ifndef __koPictureKey_h__ #define __koPictureKey_h__ -#include -#include +#include +#include #include /** * \file koPictureKey.h * \todo correct documentation (for example: sed "s/image/picture/g") */ -class QDomElement; +class TQDomElement; namespace KoPictureType { /** - * QPicture version used by KoPictureClipart + * TQPicture version used by KoPictureClipart * * Possible values: - * \li 3 for Qt 2.1.x and later Qt 2.x - * \li 4 for Qt 3.0 - * \li 5 for Qt 3.1 and later Qt 3.x - * \li -1 for current Qt + * \li 3 for TQt 2.1.x and later TQt 2.x + * \li 4 for TQt 3.0 + * \li 5 for TQt 3.1 and later TQt 3.x + * \li -1 for current TQt */ - const int formatVersionQPicture=-1; + const int formatVersionTQPicture=-1; enum Type { TypeUnknown = 0, ///< Unknown or not-an-image @see KoPictureBase - TypeImage, ///< Image, QImage-based @see KoPictureImage + TypeImage, ///< Image, TQImage-based @see KoPictureImage TypeEps, ///< Encapsulated Postscript @see KoPictureEps - TypeClipart, ///< Clipart, QPicture-based @see KoPictureClipart + TypeClipart, ///< Clipart, TQPicture-based @see KoPictureClipart TypeWmf ///< WMF (Windows Meta File) @see KoPictureWmf }; } @@ -61,8 +61,8 @@ namespace KoPictureType * @short Structure describing a picture on disk * * @note We use the *nix epoch (1970-01-01) as a time base because it is a valid date. - * That way we do not depend on a behaviour of the current QDateTime that might change in future versions of Qt - * and we are also nice to non-Qt programs wanting to read KOffice's files. + * That way we do not depend on a behaviour of the current TQDateTime that might change in future versions of TQt + * and we are also nice to non-TQt programs wanting to read KOffice's files. * * @note This behaviour is also needed for re-saving KWord files having \. When saving again, * these files get a \ element as child of \ but not one as child of \ and \. @@ -87,13 +87,13 @@ public: * to update the file and import it into the application again, without * the application reusing the old copy from the collection. */ - KoPictureKey( const QString &fn, const QDateTime &mod ); + KoPictureKey( const TQString &fn, const TQDateTime &mod ); /** * Constructs a key from a filename * @note The modification date is set to 1970-01-01 */ - KoPictureKey( const QString &fn ); + KoPictureKey( const TQString &fn ); /** * Copy constructor @@ -119,36 +119,36 @@ public: /** * Convert this key into a string representation of it */ - QString toString() const; + TQString toString() const; /** * Save this key in XML (as %KOffice 1.3) */ - void saveAttributes( QDomElement &elem ) const; + void saveAttributes( TQDomElement &elem ) const; /** * Load this key from XML (as %KOffice 1.3) */ - void loadAttributes( const QDomElement &elem ); + void loadAttributes( const TQDomElement &elem ); /** * First part of the key: the filename */ - QString filename() const { return m_filename; } + TQString filename() const { return m_filename; } /** * Second part of the key: the modification date */ - QDateTime lastModified() const { return m_lastModified; } + TQDateTime lastModified() const { return m_lastModified; } /** * Sets the key according to @p filename, including modification time */ - void setKeyFromFile (const QString& filename); + void setKeyFromFile (const TQString& filename); protected: - QString m_filename; - QDateTime m_lastModified; + TQString m_filename; + TQDateTime m_lastModified; }; #endif /* __koPictureKey_h__ */ diff --git a/lib/kofficecore/KoPictureShared.cpp b/lib/kofficecore/KoPictureShared.cpp index 5c2ff2a2b..16fea2efb 100644 --- a/lib/kofficecore/KoPictureShared.cpp +++ b/lib/kofficecore/KoPictureShared.cpp @@ -18,8 +18,8 @@ * Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include #include #include @@ -45,9 +45,9 @@ void KoPictureShared::assignPictureId( uint _id) m_pictureId = _id; } -QString KoPictureShared::uniquePictureId() const +TQString KoPictureShared::uniquePictureId() const { - return "Pictures"+ QString::number(m_pictureId); + return "Pictures"+ TQString::number(m_pictureId); } KoPictureShared::~KoPictureShared(void) @@ -56,7 +56,7 @@ KoPictureShared::~KoPictureShared(void) } KoPictureShared::KoPictureShared(const KoPictureShared &other) - : QShared() // Some compilers want it explicitly! + : TQShared() // Some compilers want it explicitly! { // We need to use newCopy, because we want a real copy, not just a copy of the part of KoPictureBase if (other.m_base) @@ -89,7 +89,7 @@ bool KoPictureShared::isNull(void) const return true; } -void KoPictureShared::draw(QPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode) +void KoPictureShared::draw(TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool fastMode) { if (m_base) m_base->draw(painter, x, y, width, height, sx, sy, sw, sh, fastMode); @@ -98,27 +98,27 @@ void KoPictureShared::draw(QPainter& painter, int x, int y, int width, int heigh // Draw a red box (easier DEBUG) kdWarning(30003) << "Drawing red rectangle! (KoPictureShared::draw)" << endl; painter.save(); - painter.setBrush(QColor(255,0,0)); + painter.setBrush(TQColor(255,0,0)); painter.drawRect(x,y,width,height); painter.restore(); } } -bool KoPictureShared::loadWmf(QIODevice* io) +bool KoPictureShared::loadWmf(TQIODevice* io) { kdDebug(30003) << "KoPictureShared::loadWmf" << endl; if (!io) { - kdError(30003) << "No QIODevice!" << endl; + kdError(30003) << "No TQIODevice!" << endl; return false; } clear(); - // The extension .wmf was used (KOffice 1.1.x) for QPicture files + // The extension .wmf was used (KOffice 1.1.x) for TQPicture files // For an extern file or in the storage, .wmf can mean a real Windows Meta File. - QByteArray array ( io->readAll() ); + TQByteArray array ( io->readAll() ); if ((array[0]=='Q') && (array[1]=='P') &&(array[2]=='I') && (array[3]=='C')) { @@ -133,25 +133,25 @@ bool KoPictureShared::loadWmf(QIODevice* io) return m_base->loadData(array, m_extension); } -bool KoPictureShared::loadTmp(QIODevice* io) +bool KoPictureShared::loadTmp(TQIODevice* io) // We have a temp file, probably from a downloaded file // We must check the file type { kdDebug(30003) << "KoPictureShared::loadTmp" << endl; if (!io) { - kdError(30003) << "No QIODevice!" << endl; + kdError(30003) << "No TQIODevice!" << endl; return false; } - // The extension .wmf was used (KOffice 1.1.x) for QPicture files + // The extension .wmf was used (KOffice 1.1.x) for TQPicture files // For an extern file or in the storage, .wmf can mean a real Windows Meta File. - QByteArray array ( io->readAll() ); + TQByteArray array ( io->readAll() ); return identifyAndLoad( array ); } -bool KoPictureShared::identifyAndLoad( QByteArray array ) +bool KoPictureShared::identifyAndLoad( TQByteArray array ) { if ( array.size() < 5 ) { @@ -159,11 +159,11 @@ bool KoPictureShared::identifyAndLoad( QByteArray array ) return false; } - QString strExtension; + TQString strExtension; bool flag=false; // Try to find the file type by comparing magic on the first few bytes! - // ### TODO: could not QImageIO::imageFormat do it too? (At least most of them?) + // ### TODO: could not TQImageIO::imageFormat do it too? (At least most of them?) if ((array[0]==char(0x89)) && (array[1]=='P') &&(array[2]=='N') && (array[3]=='G')) { strExtension="png"; @@ -205,19 +205,19 @@ bool KoPictureShared::identifyAndLoad( QByteArray array ) else if ( ( array[0] == char( 0037 ) ) && ( array[1] == char( 0213 ) ) ) { // Gzip - QBuffer buffer(array); + TQBuffer buffer(array); buffer.open(IO_ReadOnly); - const bool flag = loadCompressed( &buffer, "application/x-gzip", "tmp" ); + const bool flag = loadCompressed( TQT_TQIODEVICE(&buffer), "application/x-gzip", "tmp" ); buffer.close(); return flag; } else if ( ( array[0] == 'B' ) && ( array[1] == 'Z' ) && ( array[2] == 'h') ) { // BZip2 - QBuffer buffer(array); + TQBuffer buffer(array); buffer.open(IO_ReadOnly); - const bool flag = loadCompressed( &buffer, "application/x-bzip2", "tmp" ); + const bool flag = loadCompressed( TQT_TQIODEVICE(&buffer), "application/x-bzip2", "tmp" ); buffer.close(); return flag; } @@ -226,17 +226,17 @@ bool KoPictureShared::identifyAndLoad( QByteArray array ) kdDebug(30003) << "Cannot identify the type of temp file!" << " Trying to convert to PNG! (in KoPictureShared::loadTmp" << endl; - // Do not trust QBuffer and do not work directly on the QByteArray array + // Do not trust TQBuffer and do not work directly on the TQByteArray array // DF: It would be faster to work on array here, and to create a completely - // different QBuffer for the writing code! - QBuffer buf( array.copy() ); + // different TQBuffer for the writing code! + TQBuffer buf( array.copy() ); if (!buf.open(IO_ReadOnly)) { kdError(30003) << "Could not open read buffer!" << endl; return false; } - QImageIO imageIO(&buf,NULL); + TQImageIO imageIO(&buf,NULL); if (!imageIO.read()) { @@ -252,7 +252,7 @@ bool KoPictureShared::identifyAndLoad( QByteArray array ) return false; } - imageIO.setIODevice(&buf); + imageIO.setIODevice(TQT_TQIODEVICE(&buf)); imageIO.setFormat("PNG"); if (!imageIO.write()) @@ -279,12 +279,12 @@ bool KoPictureShared::identifyAndLoad( QByteArray array ) -bool KoPictureShared::loadXpm(QIODevice* io) +bool KoPictureShared::loadXpm(TQIODevice* io) { kdDebug(30003) << "KoPictureShared::loadXpm" << endl; if (!io) { - kdError(30003) << "No QIODevice!" << endl; + kdError(30003) << "No TQIODevice!" << endl; return false; } @@ -293,13 +293,13 @@ bool KoPictureShared::loadXpm(QIODevice* io) // Old KPresenter XPM files have char(1) instead of some " // Therefore we need to treat XPM separately - QByteArray array=io->readAll(); + TQByteArray array=io->readAll(); // As XPM files are normally only ASCII files, we can replace it without problems int pos=0; - while ((pos=array.find(char(1),pos))!=-1) + while ((pos=array.tqfind(char(1),pos))!=-1) { array[pos]='"'; } @@ -308,13 +308,13 @@ bool KoPictureShared::loadXpm(QIODevice* io) m_base=new KoPictureImage(); - QBuffer buffer(array); - bool check = m_base->load(&buffer,"xpm"); + TQBuffer buffer(array); + bool check = m_base->load(TQT_TQIODEVICE(&buffer),"xpm"); setExtension("xpm"); return check; } -bool KoPictureShared::save(QIODevice* io) const +bool KoPictureShared::save(TQIODevice* io) const { if (!io) return false; @@ -337,12 +337,12 @@ void KoPictureShared::clear(void) m_base=NULL; } -void KoPictureShared::clearAndSetMode(const QString& newMode) +void KoPictureShared::clearAndSetMode(const TQString& newMode) { delete m_base; m_base=NULL; - const QString mode=newMode.lower(); + const TQString mode=newMode.lower(); if ((mode=="svg") || (mode=="qpic")) { @@ -357,42 +357,42 @@ void KoPictureShared::clearAndSetMode(const QString& newMode) m_base=new KoPictureEps(); } else - { // TODO: test if QImageIO really knows the file format + { // TODO: test if TQImageIO really knows the file format m_base=new KoPictureImage(); } } -QString KoPictureShared::getExtension(void) const +TQString KoPictureShared::getExtension(void) const { return m_extension; } -void KoPictureShared::setExtension(const QString& extension) +void KoPictureShared::setExtension(const TQString& extension) { m_extension = extension; } -QString KoPictureShared::getMimeType(void) const +TQString KoPictureShared::getMimeType(void) const { if (m_base) return m_base->getMimeType(m_extension); - return QString(NULL_MIME_TYPE); + return TQString(NULL_MIME_TYPE); } -bool KoPictureShared::loadFromBase64( const QCString& str ) +bool KoPictureShared::loadFromBase64( const TQCString& str ) { clear(); - QByteArray data; + TQByteArray data; KCodecs::base64Decode( str, data ); return identifyAndLoad( data ); } -bool KoPictureShared::load(QIODevice* io, const QString& extension) +bool KoPictureShared::load(TQIODevice* io, const TQString& extension) { - kdDebug(30003) << "KoPictureShared::load(QIODevice*, const QString&) " << extension << endl; + kdDebug(30003) << "KoPictureShared::load(TQIODevice*, const TQString&) " << extension << endl; bool flag=false; - QString ext(extension.lower()); + TQString ext(extension.lower()); if (ext=="wmf") flag=loadWmf(io); else if (ext=="tmp") // ### TODO: also remote scripts need this, don't they? @@ -423,7 +423,7 @@ bool KoPictureShared::load(QIODevice* io, const QString& extension) return flag; } -bool KoPictureShared::loadFromFile(const QString& fileName) +bool KoPictureShared::loadFromFile(const TQString& fileName) { kdDebug(30003) << "KoPictureShared::loadFromFile " << fileName << endl; if ( fileName.isEmpty() ) @@ -431,54 +431,54 @@ bool KoPictureShared::loadFromFile(const QString& fileName) kdError(30003) << "Cannot load file with empty name!" << endl; return false; } - QFile file(fileName); + TQFile file(fileName); if (!file.open(IO_ReadOnly)) return false; bool flag = false; - const int pos=fileName.findRev('.'); + const int pos=fileName.tqfindRev('.'); if (pos==-1) { kdDebug(30003) << "File with no extension!" << endl; // As we have no extension, consider it like a temporary file - flag = loadTmp( &file ); + flag = loadTmp( TQT_TQIODEVICE(&file) ); } else { - const QString extension( fileName.mid( pos+1 ) ); + const TQString extension( fileName.mid( pos+1 ) ); // ### TODO: check if the extension if gz or bz2 and find the previous extension - flag = load( &file, extension ); + flag = load( TQT_TQIODEVICE(&file), extension ); } file.close(); return flag; } -QSize KoPictureShared::getOriginalSize(void) const +TQSize KoPictureShared::getOriginalSize(void) const { if (m_base) return m_base->getOriginalSize(); - return QSize(0,0); + return TQSize(0,0); } -QPixmap KoPictureShared::generatePixmap(const QSize& size, bool smoothScale) +TQPixmap KoPictureShared::generatePixmap(const TQSize& size, bool smoothScale) { if (m_base) return m_base->generatePixmap(size, smoothScale); - return QPixmap(); + return TQPixmap(); } -QDragObject* KoPictureShared::dragObject( QWidget *dragSource, const char *name ) +TQDragObject* KoPictureShared::dragObject( TQWidget *dragSource, const char *name ) { if (m_base) return m_base->dragObject( dragSource, name ); return 0L; } -QImage KoPictureShared::generateImage(const QSize& size) +TQImage KoPictureShared::generateImage(const TQSize& size) { if (m_base) return m_base->generateImage( size ); - return QImage(); + return TQImage(); } bool KoPictureShared::hasAlphaBuffer() const @@ -494,11 +494,11 @@ void KoPictureShared::setAlphaBuffer(bool enable) m_base->setAlphaBuffer(enable); } -QImage KoPictureShared::createAlphaMask(int conversion_flags) const +TQImage KoPictureShared::createAlphaMask(int conversion_flags) const { if (m_base) return m_base->createAlphaMask(conversion_flags); - return QImage(); + return TQImage(); } void KoPictureShared::clearCache(void) @@ -507,10 +507,10 @@ void KoPictureShared::clearCache(void) m_base->clearCache(); } -bool KoPictureShared::loadCompressed( QIODevice* io, const QString& mimeType, const QString& extension ) +bool KoPictureShared::loadCompressed( TQIODevice* io, const TQString& mimeType, const TQString& extension ) { // ### TODO: check that we do not have an endless recursion - QIODevice* in = KFilterDev::device( io, mimeType, false); + TQIODevice* in = KFilterDev::device( io, mimeType, false); if ( !in ) { diff --git a/lib/kofficecore/KoPictureShared.h b/lib/kofficecore/KoPictureShared.h index da286368c..f90c91e42 100644 --- a/lib/kofficecore/KoPictureShared.h +++ b/lib/kofficecore/KoPictureShared.h @@ -20,16 +20,16 @@ #ifndef __koPictureShared_h__ #define __koPictureShared_h__ -#include -#include -#include -#include +#include +#include +#include +#include #include "KoPictureKey.h" class KoXmlWriter; -class QPainter; -class QSize; +class TQPainter; +class TQSize; class KURL; @@ -39,9 +39,9 @@ class KoPictureBase; * @internal * KoPictureShared is the class that contains the shared part for KoPicture * - * @warning As with all QShared objects, the sharing is neither automatic nor transparent! + * @warning As with all TQShared objects, the sharing is neither automatic nor transparent! */ -class KoPictureShared : public QShared +class KoPictureShared : public TQShared { public: /** @@ -82,29 +82,29 @@ public: * * The parameters @p width, @p height define the desired size for the picture * - * The other parameters are very similar to QPainter::drawPixmap : + * The other parameters are very similar to TQPainter::drawPixmap : * (@p x, @p y) define the position in the painter, * (@p sx, @p sy) specify the top-left point in pixmap that is to be drawn. The default is (0, 0). * (@p sw, @p sh) specify the size of the pixmap that is to be drawn. The default, (-1, -1), means all the way to the bottom * right of the pixmap. */ - void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); + void draw(TQPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); /** * Create a dragobject containing this picture. * @param dragSource must be 0 when copying to the clipboard * @return 0L if the picture is null! */ - QDragObject* dragObject( QWidget *dragSource = 0L, const char *name = 0L ); + TQDragObject* dragObject( TQWidget *dragSource = 0L, const char *name = 0L ); - bool load(QIODevice* io, const QString& extension); - bool loadFromBase64( const QCString& str ); + bool load(TQIODevice* io, const TQString& extension); + bool loadFromBase64( const TQCString& str ); /** - * Save picture into a QIODevice - * @param io QIODevice used for saving + * Save picture into a TQIODevice + * @param io TQIODevice used for saving */ - bool save(QIODevice* io) const; + bool save(TQIODevice* io) const; /** * OASIS FlatXML support: @@ -112,18 +112,18 @@ public: */ bool saveAsBase64( KoXmlWriter& writer ) const; - void setExtension(const QString& extension); + void setExtension(const TQString& extension); - QString getExtension(void) const; + TQString getExtension(void) const; - QSize getOriginalSize(void) const; + TQSize getOriginalSize(void) const; /** * Clear and set the mode of this KoPictureShared * * @param newMode file extension (like "png") giving the wanted mode */ - void clearAndSetMode(const QString& newMode); + void clearAndSetMode(const TQString& newMode); /** * Reset the KoPictureShared (but not the key!) @@ -135,35 +135,35 @@ public: * * @param fileName the name of the file to load */ - bool loadFromFile(const QString& fileName); + bool loadFromFile(const TQString& fileName); /** * Load a potentially broken XPM file (for KPresenter) */ - bool loadXpm(QIODevice* io); + bool loadXpm(TQIODevice* io); /** * @deprecated - * Returns a QPixmap from an image + * Returns a TQPixmap from an image * - * @param size the wanted size for the QPixmap + * @param size the wanted size for the TQPixmap */ - QPixmap generatePixmap(const QSize& size, bool smoothScale = false); + TQPixmap generatePixmap(const TQSize& size, bool smoothScale = false); - QString getMimeType(void) const; + TQString getMimeType(void) const; /** - * Generate a QImage + * Generate a TQImage * * (always in slow mode) * - * @param size the wanted size for the QImage + * @param size the wanted size for the TQImage */ - QImage generateImage(const QSize& size); + TQImage generateImage(const TQSize& size); bool hasAlphaBuffer() const; void setAlphaBuffer(bool enable); - QImage createAlphaMask(int conversion_flags = 0) const; + TQImage createAlphaMask(int conversion_flags = 0) const; /** * Clear any cache @@ -173,25 +173,25 @@ public: */ void clearCache(void); - QString uniquePictureId() const; + TQString uniquePictureId() const; void assignPictureId( uint _id); protected: /** * @internal * Load a WMF file - * \note In %KOffice 1.1, a .wmf file was a QPicture file + * \note In %KOffice 1.1, a .wmf file was a TQPicture file */ - bool loadWmf(QIODevice* io); + bool loadWmf(TQIODevice* io); /** * @internal * Loads a temporary file, probably from a downloaded file */ - bool loadTmp(QIODevice* io); + bool loadTmp(TQIODevice* io); /// Find type of image, create base accordingly, and load data - bool identifyAndLoad( QByteArray data ); + bool identifyAndLoad( TQByteArray data ); /** * @internal @@ -199,15 +199,15 @@ protected: * * @warning risk of endless recurision, be careful when it is called from @see load * - * @param io QIODevice of the compressed file/strea, + * @param io TQIODevice of the compressed file/strea, * @param mimeType mimetype of the (de-)compressor * @param extension extension of the uncompressed file */ - bool loadCompressed( QIODevice* io, const QString& mimeType, const QString& extension ); + bool loadCompressed( TQIODevice* io, const TQString& mimeType, const TQString& extension ); protected: KoPictureBase* m_base; - QString m_extension; + TQString m_extension; uint m_pictureId; }; diff --git a/lib/kofficecore/KoPictureWmf.cpp b/lib/kofficecore/KoPictureWmf.cpp index 96872af74..ccbab3620 100644 --- a/lib/kofficecore/KoPictureWmf.cpp +++ b/lib/kofficecore/KoPictureWmf.cpp @@ -19,10 +19,10 @@ * Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -35,7 +35,7 @@ #include "KoPictureBase.h" #include "KoPictureWmf.h" -KoPictureWmf::KoPictureWmf(void) : m_clipart(KoPictureType::formatVersionQPicture) +KoPictureWmf::KoPictureWmf(void) : m_clipart(KoPictureType::formatVersionTQPicture) { } @@ -58,15 +58,15 @@ bool KoPictureWmf::isNull(void) const return m_clipart.isNull(); } -void KoPictureWmf::drawQPicture(QPicture& clipart, QPainter& painter, +void KoPictureWmf::drawTQPicture(TQPicture& clipart, TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh) { kdDebug(30003) << "Drawing KoPictureWmf " << this << endl; kdDebug(30003) << " x=" << x << " y=" << y << " width=" << width << " height=" << height << endl; kdDebug(30003) << " sx=" << sx << " sy=" << sy << " sw=" << sw << " sh=" << sh << endl; painter.save(); - // Thanks to Harri, Qt3 makes it much easier than Qt2 ;) - QRect br = clipart.boundingRect(); + // Thanks to Harri, TQt3 makes it much easier than TQt2 ;) + TQRect br = clipart.boundingRect(); kdDebug(30003) << " Bounding rect. " << br << endl; painter.translate(x,y); // Translating must be done before scaling! @@ -78,12 +78,12 @@ void KoPictureWmf::drawQPicture(QPicture& clipart, QPainter& painter, painter.restore(); } -void KoPictureWmf::draw(QPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool /*fastMode*/) +void KoPictureWmf::draw(TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool /*fastMode*/) { - drawQPicture(m_clipart, painter, x, y, width, height, sx, sy, sw, sh); + drawTQPicture(m_clipart, painter, x, y, width, height, sx, sy, sw, sh); } -bool KoPictureWmf::loadData(const QByteArray& array, const QString& /* extension */) +bool KoPictureWmf::loadData(const TQByteArray& array, const TQString& /* extension */) { // Second, create the original clipart kdDebug(30003) << "Trying to load clipart... (Size:" << array.size() << ")" << endl; @@ -97,32 +97,32 @@ bool KoPictureWmf::loadData(const QByteArray& array, const QString& /* extension } m_originalSize = wmf.boundingRect().size(); // draw wmf file with relative coordinate - wmf.play(m_clipart, true); + wmf.play(*TQT_TQPAINTDEVICE(&m_clipart), true); return true; } -bool KoPictureWmf::save(QIODevice* io) const +bool KoPictureWmf::save(TQIODevice* io) const { - // We save the raw data, as the SVG supposrt in QPicture is poor - Q_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns Q_LONG but size() Q_ULONG! + // We save the raw data, as the SVG supposrt in TQPicture is poor + TQ_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns TQ_LONG but size() TQ_ULONG! return (size==m_rawData.size()); } -QSize KoPictureWmf::getOriginalSize(void) const +TQSize KoPictureWmf::getOriginalSize(void) const { return m_originalSize; } -QPixmap KoPictureWmf::generatePixmap(const QSize& size, bool /*smoothScale*/) +TQPixmap KoPictureWmf::generatePixmap(const TQSize& size, bool /*smoothScale*/) { // Not sure if it works, but it worked for KoPictureFilePreviewWidget::setClipart - QPixmap pixmap(size); - QPainter p; + TQPixmap pixmap(size); + TQPainter p; p.begin( &pixmap ); - p.setBackgroundColor( Qt::white ); - pixmap.fill( Qt::white ); + p.setBackgroundColor( TQt::white ); + pixmap.fill( TQt::white ); if ( m_originalSize.width() && m_originalSize.height() ) p.scale( (double)pixmap.width() / (double)m_originalSize.width(), (double)pixmap.height() / (double)m_originalSize.height() ); @@ -131,7 +131,7 @@ QPixmap KoPictureWmf::generatePixmap(const QSize& size, bool /*smoothScale*/) return pixmap; } -QString KoPictureWmf::getMimeType(const QString& /* extension */) const +TQString KoPictureWmf::getMimeType(const TQString& /* extension */) const { return "image/x-wmf"; } diff --git a/lib/kofficecore/KoPictureWmf.h b/lib/kofficecore/KoPictureWmf.h index f1924d9c9..dfe158bfa 100644 --- a/lib/kofficecore/KoPictureWmf.h +++ b/lib/kofficecore/KoPictureWmf.h @@ -20,12 +20,12 @@ #ifndef __koPictureWmf_h__ #define __koPictureWmf_h__ -#include -#include +#include +#include #include -class QPainter; -class QSize; +class TQPainter; +class TQSize; /** * \file koPictureWmf.h @@ -68,41 +68,41 @@ public: * Note that the image is being scaled to that size using scale() - except when printing. * This avoids scaling the image at each paint event. * - * The other parameters are very similar to QPainter::drawPixmap : + * The other parameters are very similar to TQPainter::drawPixmap : * (@p x, @p y) define the position in the painter, * (@p sx, @p sy) specify the top-left point in pixmap that is to be drawn. The default is (0, 0). * (@p sw, @p sh) specify the size of the pixmap that is to be drawn. The default, (-1, -1), means all the way to the bottom * right of the pixmap. */ - virtual void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); + virtual void draw(TQPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false); - virtual bool loadData(const QByteArray& array, const QString& extension); + virtual bool loadData(const TQByteArray& array, const TQString& extension); /** * save file - * @param io QIODevice used for saving + * @param io TQIODevice used for saving */ - virtual bool save(QIODevice* io) const; + virtual bool save(TQIODevice* io) const; - virtual QSize getOriginalSize(void) const; + virtual TQSize getOriginalSize(void) const; - virtual QPixmap generatePixmap(const QSize& size, bool smoothScale = false); + virtual TQPixmap generatePixmap(const TQSize& size, bool smoothScale = false); - virtual QString getMimeType(const QString& extension) const; + virtual TQString getMimeType(const TQString& extension) const; protected: - QPixmap getPixmap(QImage& image); + TQPixmap getPixmap(TQImage& image); /** * @internal - * Draw a QPicture + * Draw a TQPicture */ - void drawQPicture(QPicture& clipart, QPainter& painter, + void drawTQPicture(TQPicture& clipart, TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh); protected: - QPicture m_clipart; - QByteArray m_rawData; - QSize m_size; - QSize m_originalSize; + TQPicture m_clipart; + TQByteArray m_rawData; + TQSize m_size; + TQSize m_originalSize; }; #endif /* __koPictureWmf_h__ */ diff --git a/lib/kofficecore/KoPoint.h b/lib/kofficecore/KoPoint.h index 5f39e6c69..a52516389 100644 --- a/lib/kofficecore/KoPoint.h +++ b/lib/kofficecore/KoPoint.h @@ -20,23 +20,23 @@ #ifndef koPoint_h #define koPoint_h -#include +#include #include /** * A point whose coordinates are floating-point values ( "double"s ). - * The API isn't documented, it's a perfect mirror of QPoint. + * The API isn't documented, it's a perfect mirror of TQPoint. */ class KoPoint { public: KoPoint() { m_x = 0; m_y = 0; } KoPoint(const double &x, const double &y) : m_x(x), m_y(y) {} - explicit KoPoint(const QPoint & p) : m_x(p.x()), m_y(p.y()) {} + explicit KoPoint(const TQPoint & p) : m_x(p.x()), m_y(p.y()) {} ~KoPoint() {} - bool operator==(const KoPoint &rhs) const { return QABS(m_x-rhs.x()) < 1E-10 && QABS(m_y-rhs.y()) < 1E-10; } - bool operator!=(const KoPoint &rhs) const { return QABS(m_x-rhs.x()) > 1E-10 || QABS(m_y-rhs.y()) > 1E-10; } + bool operator==(const KoPoint &rhs) const { return TQABS(m_x-rhs.x()) < 1E-10 && TQABS(m_y-rhs.y()) < 1E-10; } + bool operator!=(const KoPoint &rhs) const { return TQABS(m_x-rhs.x()) > 1E-10 || TQABS(m_y-rhs.y()) > 1E-10; } bool isNull() const { return m_x == 0 && m_y == 0; } @@ -59,9 +59,9 @@ public: friend inline KoPoint operator*( const double &, const KoPoint & ); friend inline double operator*( const KoPoint &a, const KoPoint &b ); - // Not in QPoint: + // Not in TQPoint: void setCoords(const double &x, const double &y) { m_x = x; m_y = y; } - KoPoint transform (const QWMatrix &m) const + KoPoint transform (const TQWMatrix &m) const { double x, y; m.map(m_x, m_y, &x, &y); @@ -80,13 +80,13 @@ public: double manhattanLength() const { - return QABS( m_x ) + QABS( m_y ); + return TQABS( m_x ) + TQABS( m_y ); } - /// Convert to a QPoint - with precision loss! - QPoint toQPoint() const + /// Convert to a TQPoint - with precision loss! + TQPoint toTQPoint() const { - return QPoint( qRound( m_x ), qRound( m_y ) ); + return TQPoint( tqRound( m_x ), tqRound( m_y ) ); } private: @@ -115,7 +115,7 @@ inline double operator*( const KoPoint &a, const KoPoint &b ) #include /** Show a floating point value with great precision (use within kdDebug) */ -#define DEBUGDOUBLE(d) QString::number( (d), 'g', 20 ) +#define DEBUGDOUBLE(d) TQString::number( (d), 'g', 20 ) inline kdbgstream operator<<( kdbgstream str, const KoPoint & r ) { // should this use DEBUGDOUBLE? diff --git a/lib/kofficecore/KoQueryTrader.cpp b/lib/kofficecore/KoQueryTrader.cpp index 00f4379b3..e164aa1af 100644 --- a/lib/kofficecore/KoQueryTrader.cpp +++ b/lib/kofficecore/KoQueryTrader.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include // UINT_MAX @@ -48,21 +48,21 @@ KoDocumentEntry::KoDocumentEntry( KService::Ptr service ) { } -KoDocument* KoDocumentEntry::createDoc( KoDocument* parent, const char* name ) const +KoDocument* KoDocumentEntry::createDoc( KoDocument* tqparent, const char* name ) const { - KLibFactory* factory = KLibLoader::self()->factory( QFile::encodeName(m_service->library()) ); + KLibFactory* factory = KLibLoader::self()->factory( TQFile::encodeName(m_service->library()) ); if( !factory ) { kdWarning(30003) << KLibLoader::self()->lastErrorMessage() << endl; return 0; } - QObject* obj; + TQObject* obj; if ( factory->inherits( "KParts::Factory" ) ) - obj = static_cast(factory)->createPart( 0L, "", parent, name, "KoDocument" ); + obj = static_cast(factory)->createPart( 0L, "", tqparent, name, "KoDocument" ); else { kdWarning(30003) << "factory doesn't inherit KParts::Factory ! It is a " << factory->className() << endl; // This shouldn't happen... - obj = factory->create( parent, name, "KoDocument" ); + obj = factory->create( tqparent, name, "KoDocument" ); } if ( !obj || !obj->inherits( "KoDocument" ) ) @@ -74,16 +74,16 @@ KoDocument* KoDocumentEntry::createDoc( KoDocument* parent, const char* name ) c return static_cast(obj); } -KoDocumentEntry KoDocumentEntry::queryByMimeType( const QString & mimetype ) +KoDocumentEntry KoDocumentEntry::queryByMimeType( const TQString & mimetype ) { - QString constr = QString::fromLatin1( "[X-KDE-NativeMimeType] == '%1' or '%2' in [X-KDE-ExtraNativeMimeTypes]" ).arg( mimetype ).arg( mimetype ); + TQString constr = TQString::tqfromLatin1( "[X-KDE-NativeMimeType] == '%1' or '%2' in [X-KDE-ExtraNativeMimeTypes]" ).tqarg( mimetype ).tqarg( mimetype ); - QValueList vec = query( false,constr ); + TQValueList vec = query( false,constr ); if ( vec.isEmpty() ) { kdWarning(30003) << "Got no results with " << constr << endl; // Fallback to the old way (which was probably wrong, but better be safe) - QString constr = QString::fromLatin1( "'%1' in ServiceTypes" ).arg( mimetype ); + TQString constr = TQString::tqfromLatin1( "'%1' in ServiceTypes" ).tqarg( mimetype ); vec = query( constr ); if ( vec.isEmpty() ) { @@ -105,16 +105,16 @@ KoDocumentEntry KoDocumentEntry::queryByMimeType( const QString & mimetype ) return vec[0]; } -QValueList KoDocumentEntry::query( const QString & _constr ) +TQValueList KoDocumentEntry::query( const TQString & _constr ) { return query(true,_constr); } -QValueList KoDocumentEntry::query( bool _onlyDocEmb, const QString & _constr ) +TQValueList KoDocumentEntry::query( bool _onlyDocEmb, const TQString & _constr ) { - QValueList lst; - QString constr; + TQValueList lst; + TQString constr; if ( !_constr.isEmpty() ) { constr = "("; constr += _constr; @@ -169,10 +169,10 @@ KoFilterEntry::KoFilterEntry( KService::Ptr service ) available = service->property( "X-KDE-Available" ).toString(); } -QValueList KoFilterEntry::query( const QString & _constr ) +TQValueList KoFilterEntry::query( const TQString & _constr ) { kdDebug(30500) << "KoFilterEntry::query( " << _constr << " )" << endl; - QValueList lst; + TQValueList lst; KTrader::OfferList offers = KTrader::self()->query( "KOfficeFilter", _constr ); @@ -192,16 +192,16 @@ QValueList KoFilterEntry::query( const QString & _constr ) return lst; } -KoFilter* KoFilterEntry::createFilter( KoFilterChain* chain, QObject* parent, const char* name ) +KoFilter* KoFilterEntry::createFilter( KoFilterChain* chain, TQObject* tqparent, const char* name ) { - KLibFactory* factory = KLibLoader::self()->factory( QFile::encodeName( m_service->library() ) ); + KLibFactory* factory = KLibLoader::self()->factory( TQFile::encodeName( m_service->library() ) ); if ( !factory ) { kdWarning(30003) << KLibLoader::self()->lastErrorMessage() << endl; return 0; } - QObject* obj = factory->create( parent, name, "KoFilter" ); + TQObject* obj = factory->create( tqparent, name, "KoFilter" ); if ( !obj || !obj->inherits( "KoFilter" ) ) { delete obj; diff --git a/lib/kofficecore/KoQueryTrader.h b/lib/kofficecore/KoQueryTrader.h index 55ab8dbef..ff2a51000 100644 --- a/lib/kofficecore/KoQueryTrader.h +++ b/lib/kofficecore/KoQueryTrader.h @@ -22,11 +22,11 @@ #include #include -#include +#include #include -class QObject; -class QStringList; +class TQObject; +class TQStringList; class KoDocument; class KoFilter; class KoFilterChain; @@ -39,7 +39,7 @@ class KOFFICECORE_EXPORT KoDocumentEntry { public: - KoDocumentEntry() { m_service = 0L; } // for QValueList + KoDocumentEntry() { m_service = 0L; } // for TQValueList KoDocumentEntry( KService::Ptr service ); ~KoDocumentEntry() { } @@ -53,24 +53,24 @@ public: /** * @return name of the associated service */ - QString name() const { return m_service->name(); } + TQString name() const { return m_service->name(); } /** * Mimetypes (and other service types) which this document can handle. */ - QStringList mimeTypes() const { return m_service->serviceTypes(); } + TQStringList mimeTypes() const { return m_service->serviceTypes(); } /** * @return TRUE if the document can handle the requested mimetype. */ - bool supportsMimeType( const QString & _mimetype ) const - { return mimeTypes().contains( _mimetype ); } + bool supportsMimeType( const TQString & _mimetype ) const + { return mimeTypes().tqcontains( _mimetype ); } /** * Uses the factory of the component to create * a document. If that is not possible, 0 is returned. */ - KoDocument* createDoc( KoDocument* parent = 0, const char* name = 0 ) const; + KoDocument* createDoc( KoDocument* tqparent = 0, const char* name = 0 ) const; /** * This function will query ksycoca to find all available components. @@ -80,7 +80,7 @@ public: * You can use it to set additional restrictions on the available * components. */ - static QValueList query( const QString & _constr = QString::null ); + static TQValueList query( const TQString & _constr = TQString() ); /** * This function will query the system to find all available filters. @@ -94,9 +94,9 @@ public: * components. */ // ### TODO: MERGE WITH ABOVE METHODE WHEN BIC+SIC CHANGES ARE ALLOWED - static QValueList query( bool _onlyDocEmb,const QString& _constr); + static TQValueList query( bool _onlyDocEmb,const TQString& _constr); /* this is how the signature should be looking after merging - static QValueList query( bool _onlyDocEmb =true, const QString& _constr = QString::null ); + static TQValueList query( bool _onlyDocEmb =true, const TQString& _constr = TQString() ); or better: use an enum for the first arg. */ @@ -107,7 +107,7 @@ public: * @return a document entry for the KOffice component that supports * the requested mimetype and fits the user best. */ - static KoDocumentEntry queryByMimeType( const QString & mimetype ); + static KoDocumentEntry queryByMimeType( const TQString & mimetype ); private: KService::Ptr m_service; @@ -122,21 +122,21 @@ class KoFilterEntry : public KShared public: typedef KSharedPtr Ptr; - KoFilterEntry() : weight( 0 ) { m_service = 0L; } // for QValueList + KoFilterEntry() : weight( 0 ) { m_service = 0L; } // for TQValueList KoFilterEntry( KService::Ptr service ); ~KoFilterEntry() { } - KoFilter* createFilter( KoFilterChain* chain, QObject* parent = 0, const char* name = 0 ); + KoFilter* createFilter( KoFilterChain* chain, TQObject* tqparent = 0, const char* name = 0 ); /** * The imported mimetype(s). */ - QStringList import; + TQStringList import; /** * The exported mimetype(s). */ - QStringList export_; + TQStringList export_; /** * The "weight" of this filter path. Has to be > 0 to be valid. @@ -146,19 +146,19 @@ public: /** * Do we have to check during runtime? */ - QString available; + TQString available; /** * @return TRUE if the filter can import the requested mimetype. */ - bool imports( const QString& _mimetype ) const - { return ( import.contains( _mimetype ) ); } + bool imports( const TQString& _mimetype ) const + { return ( import.tqcontains( _mimetype ) ); } /** * @return TRUE if the filter can export the requested mimetype. */ - bool exports( const QString& _m ) const - { return ( export_.contains( _m ) ); } + bool exports( const TQString& _m ) const + { return ( export_.tqcontains( _m ) ); } /** * This function will query KDED to find all available filters. @@ -167,7 +167,7 @@ public: * You can use it to set additional restrictions on the available * components. */ - static QValueList query( const QString& _constr = QString::null ); + static TQValueList query( const TQString& _constr = TQString() ); KService::Ptr service() const { return m_service; } diff --git a/lib/kofficecore/KoRect.cpp b/lib/kofficecore/KoRect.cpp index b93a577d6..78a63992d 100644 --- a/lib/kofficecore/KoRect.cpp +++ b/lib/kofficecore/KoRect.cpp @@ -166,15 +166,15 @@ KoRect &KoRect::operator&=(const KoRect &rhs) { return *this; } -bool KoRect::contains(const KoPoint &p) const { +bool KoRect::tqcontains(const KoPoint &p) const { return (p.x() >= m_tl.x() && p.x() <= m_br.x() && p.y() >= m_tl.y() && p.y() <= m_br.y()); } -bool KoRect::contains(const double &x, const double &y) const { +bool KoRect::tqcontains(const double &x, const double &y) const { return (x >= m_tl.x() && x <= m_br.x() && y >= m_tl.y() && y <= m_br.y()); } -bool KoRect::contains(const KoRect &r) const { +bool KoRect::tqcontains(const KoRect &r) const { return (r.left() >= m_tl.x() && r.right() <= m_br.x() && r.top() >= m_tl.y() && r.bottom() <= m_br.y()); } @@ -188,8 +188,8 @@ KoRect KoRect::intersect(const KoRect &r) const { } bool KoRect::intersects(const KoRect &r) const { - return ( QMAX(m_tl.x(), r.left()) <= QMIN(m_br.x(), r.right()) && - QMAX(m_tl.y(), r.top()) <= QMIN(m_br.y(), r.bottom()) ); + return ( TQMAX(m_tl.x(), r.left()) <= TQMIN(m_br.x(), r.right()) && + TQMAX(m_tl.y(), r.top()) <= TQMIN(m_br.y(), r.bottom()) ); } KoRect operator|(const KoRect &lhs, const KoRect &rhs) { @@ -226,7 +226,7 @@ bool operator!=(const KoRect &lhs, const KoRect &rhs) { lhs.bottomRight()!=rhs.bottomRight() ); } -KoRect KoRect::transform(const QWMatrix &m) const +KoRect KoRect::transform(const TQWMatrix &m) const { KoRect result; if(m.m12() == 0.0F && m.m21() == 0.0F) @@ -248,10 +248,10 @@ KoRect KoRect::transform(const QWMatrix &m) const for(int i = 1; i < 4; i++) { - result.setLeft(QMIN(p[i].x(), result.left())); - result.setTop(QMIN(p[i].y(), result.top())); - result.setRight(QMAX(p[i].x(), result.right())); - result.setBottom(QMAX(p[i].y(), result.bottom())); + result.setLeft(TQMIN(p[i].x(), result.left())); + result.setTop(TQMIN(p[i].y(), result.top())); + result.setRight(TQMAX(p[i].x(), result.right())); + result.setBottom(TQMAX(p[i].y(), result.bottom())); } } return result; @@ -262,13 +262,13 @@ KoRect KoRect::translate(double dx, double dy) const return KoRect(left() + dx, top() + dy, width(), height()); } -QRect KoRect::toQRect() const +TQRect KoRect::toTQRect() const { - return QRect( qRound( left() ), qRound( top() ), qRound( width() ), qRound( height() ) ); + return TQRect( tqRound( left() ), tqRound( top() ), tqRound( width() ), tqRound( height() ) ); } //static -KoRect KoRect::fromQRect( const QRect &rect ) +KoRect KoRect::fromTQRect( const TQRect &rect ) { return KoRect( rect.left(), rect.top(), rect.width(), rect.height() ); } diff --git a/lib/kofficecore/KoRect.h b/lib/kofficecore/KoRect.h index dfc639462..b42890887 100644 --- a/lib/kofficecore/KoRect.h +++ b/lib/kofficecore/KoRect.h @@ -21,12 +21,12 @@ #include "KoPoint.h" #include "KoSize.h" -#include +#include #include "koffice_export.h" /** * A rect whose coordinates are floating-point values ( "double"s ). - * The API isn't documented, it's a perfect mirror of QRect. + * The API isn't documented, it's a perfect mirror of TQRect. */ class KOFFICEUI_EXPORT KoRect { @@ -42,9 +42,9 @@ public: ~KoRect() {} bool isNull() const { return m_tl == m_br; } - // Like QRect, a null KoRect is empty. + // Like TQRect, a null KoRect is empty. bool isEmpty() const { return m_tl.x() > m_br.x() || m_tl.y() > m_br.y() || isNull(); } - // Unlike QRect, a null KoRect is valid (0-sized). + // Unlike TQRect, a null KoRect is valid (0-sized). bool isValid() const { return m_tl.x() <= m_br.x() && m_tl.y() <= m_br.y(); } KoRect normalize() const; @@ -108,20 +108,20 @@ public: * Note that for KoRect(0, 0, 100, 100) the KoPoint(0, 0) as well as KoPoint(100, 100) are * mathmatically contained in the rect, this in contrary to pixel based rectangles. */ - bool contains(const KoPoint &p) const; + bool tqcontains(const KoPoint &p) const; /// Helper function for the above function. - bool contains(const double &x, const double &y) const; + bool tqcontains(const double &x, const double &y) const; /// Helper function for the above function. - bool contains(const KoRect &r) const; + bool tqcontains(const KoRect &r) const; KoRect unite(const KoRect &r) const; KoRect intersect(const KoRect &r) const; bool intersects(const KoRect &r) const; - KoRect transform(const QWMatrix &m) const; + KoRect transform(const TQWMatrix &m) const; KoRect translate(double dx, double dy) const; - QRect toQRect() const; - static KoRect fromQRect( const QRect &rect ); + TQRect toTQRect() const; + static KoRect fromTQRect( const TQRect &rect ); private: KoPoint m_tl, m_br; @@ -141,7 +141,7 @@ inline kdbgstream operator<<( kdbgstream str, const KoRect & r ) { str << "[" < inline kndbgstream operator<<( kndbgstream str, const KoRect & ) { return str; } /** Show the rectangles that form a region (use as a standalone statement) */ -#define DEBUGREGION(reg) { QMemArrayrs=reg.rects(); for (int i=0;irs=reg.rects(); for (int i=0;i class KoSetBasicPropCommand : public KNamedCommand { public: - KoSetBasicPropCommand(Object *object, const QString &name) : KNamedCommand(name), m_object(object) {} - KoSetBasicPropCommand(Object *object, const QString &name, + KoSetBasicPropCommand(Object *object, const TQString &name) : KNamedCommand(name), m_object(object) {} + KoSetBasicPropCommand(Object *object, const TQString &name, const Property &oldProperty, const Property &newProperty) : KNamedCommand(name), m_object(object), m_oldProperty(oldProperty), m_newProperty(newProperty) {} virtual ~KoSetBasicPropCommand() {} @@ -59,8 +59,8 @@ private: template class KoSetPropCommand : public KNamedCommand { public: - KoSetPropCommand(Object *object, const QString &name) : KNamedCommand(name), m_object(object) {} - KoSetPropCommand(Object *object, const QString &name, + KoSetPropCommand(Object *object, const TQString &name) : KNamedCommand(name), m_object(object) {} + KoSetPropCommand(Object *object, const TQString &name, const Property &oldProperty, const Property &newProperty) : KNamedCommand(name), m_object(object), m_oldProperty(oldProperty), m_newProperty(newProperty) {} virtual ~KoSetPropCommand() {} diff --git a/lib/kofficecore/KoSize.h b/lib/kofficecore/KoSize.h index 3cdc30bc3..6f8aa253f 100644 --- a/lib/kofficecore/KoSize.h +++ b/lib/kofficecore/KoSize.h @@ -16,19 +16,19 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. - This file borrows from the QSize class; + This file borrows from the TQSize class; Copyright (C) 1992-2000 Trolltech AS. All rights reserved. */ #ifndef koSize_h #define koSize_h -#include -#include +#include +#include /** * A size whose coordinates are floating-point values ( "double"s ). - * The API isn't documented, it's a perfect mirror of QSize. + * The API isn't documented, it's a perfect mirror of TQSize. */ class KoSize { @@ -69,21 +69,21 @@ public: friend inline const KoSize operator/( const KoSize &, int ); friend inline const KoSize operator/( const KoSize &, double ); - inline QSize toQSize() const; - static KoSize fromQSize( const QSize &size ) + inline TQSize toTQSize() const; + static KoSize fromTQSize( const TQSize &size ) { return KoSize(size.width(), size.height()); } void transpose() { - qSwap(wd, ht); + tqSwap(wd, ht); } private: static void warningDivByZero() { -#if defined(QT_CHECK_MATH) +#if defined(TQT_CHECK_MATH) qWarning( "KoSize: Division by zero error" ); #endif } @@ -168,7 +168,7 @@ inline const KoSize operator*( double c, const KoSize &s ) inline KoSize &KoSize::operator/=( int c ) { -#if defined(QT_CHECK_MATH) +#if defined(TQT_CHECK_MATH) if ( c == 0 ) warningDivByZero(); #endif @@ -178,7 +178,7 @@ inline KoSize &KoSize::operator/=( int c ) inline KoSize &KoSize::operator/=( double c ) { -#if defined(QT_CHECK_MATH) +#if defined(TQT_CHECK_MATH) if ( c == 0.0 ) warningDivByZero(); #endif @@ -188,7 +188,7 @@ inline KoSize &KoSize::operator/=( double c ) inline const KoSize operator/( const KoSize &s, int c ) { -#if defined(QT_CHECK_MATH) +#if defined(TQT_CHECK_MATH) if ( c == 0 ) KoSize::warningDivByZero(); #endif @@ -197,7 +197,7 @@ inline const KoSize operator/( const KoSize &s, int c ) inline const KoSize operator/( const KoSize &s, double c ) { -#if defined(QT_CHECK_MATH) +#if defined(TQT_CHECK_MATH) if ( c == 0.0 ) KoSize::warningDivByZero(); #endif @@ -206,17 +206,17 @@ inline const KoSize operator/( const KoSize &s, double c ) inline KoSize KoSize::expandedTo( const KoSize & otherSize ) const { - return KoSize( QMAX(wd,otherSize.wd), QMAX(ht,otherSize.ht) ); + return KoSize( TQMAX(wd,otherSize.wd), TQMAX(ht,otherSize.ht) ); } inline KoSize KoSize::boundedTo( const KoSize & otherSize ) const { - return KoSize( QMIN(wd,otherSize.wd), QMIN(ht,otherSize.ht) ); + return KoSize( TQMIN(wd,otherSize.wd), TQMIN(ht,otherSize.ht) ); } -inline QSize KoSize::toQSize() const +inline TQSize KoSize::toTQSize() const { - return QSize(qRound(wd), qRound(ht)); + return TQSize(tqRound(wd), tqRound(ht)); } /****************************** diff --git a/lib/kofficecore/KoSpeaker.cpp b/lib/kofficecore/KoSpeaker.cpp index db9756238..b8c0c098c 100644 --- a/lib/kofficecore/KoSpeaker.cpp +++ b/lib/kofficecore/KoSpeaker.cpp @@ -21,26 +21,26 @@ * Boston, MA 02110-1301, USA. */ -// Qt includes. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +// TQt includes. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // KDE includes. #include @@ -76,29 +76,29 @@ public: {} // List of text jobs. - QValueList m_jobNums; + TQValueList m_jobNums; // Whether the version of KTTSD has been requested from the daemon. bool m_versionChecked; // KTTSD version string. - QString m_kttsdVersion; + TQString m_kttsdVersion; // Language code of last spoken text. - QString m_langCode; + TQString m_langCode; // Word used before speaking an accelerator letter. - QString m_acceleratorPrefix; + TQString m_acceleratorPrefix; // Whether TTS service is available or not. bool m_enabled; // TTS options. uint m_speakFlags; // Timer which implements the polling interval. int m_timeout; - QTimer* m_timer; + TQTimer* m_timer; // Widget and part of widget for 1) last widget under mouse pointer, 2) last widget with focus, and // last widget spoken. - QWidget* m_prevPointerWidget; + TQWidget* m_prevPointerWidget; int m_prevPointerId; - QWidget* m_prevFocusWidget; + TQWidget* m_prevFocusWidget; int m_prevFocusId; - QWidget* m_prevWidget; + TQWidget* m_prevWidget; int m_prevId; // True when cancelSpeakWidget has been called in response to customSpeakWidget signal. bool m_cancelSpeakWidget; @@ -132,11 +132,11 @@ bool KoSpeaker::isEnabled() const { return d->m_enabled; } void KoSpeaker::probe() { d->m_timer->stop(); - QWidget* w; - QPoint pos; + TQWidget* w; + TQPoint pos; bool spoke = false; if ( d->m_speakFlags & SpeakFocusWidget ) { - w = kapp->focusWidget(); + w = kapp->tqfocusWidget(); if (w) { spoke = maybeSayWidget(w); if (!spoke) @@ -144,7 +144,7 @@ void KoSpeaker::probe() } } if ( !spoke && d->m_speakFlags & SpeakPointerWidget ) { - pos = QCursor::pos(); + pos = TQCursor::pos(); w = kapp->widgetAt(pos, true); if (w) { if (!maybeSayWidget(w, pos)) @@ -154,7 +154,7 @@ void KoSpeaker::probe() d->m_timer->start(d->m_timeout); } -void KoSpeaker::queueSpeech(const QString& msg, const QString& langCode /*= QString()*/, bool first /*= true*/) +void KoSpeaker::queueSpeech(const TQString& msg, const TQString& langCode /*= TQString()*/, bool first /*= true*/) { if (!startKttsd()) return; int jobCount = d->m_jobNums.count(); @@ -164,11 +164,11 @@ void KoSpeaker::queueSpeech(const QString& msg, const QString& langCode /*= QStr d->m_jobNums.clear(); jobCount = 0; } - QString s = msg.stripWhiteSpace(); + TQString s = msg.stripWhiteSpace(); if (s.isEmpty()) return; // kdDebug() << "KoSpeaker::queueSpeech: s = [" << s << "]" << endl; // If no language code given, assume desktop setting. - QString languageCode = langCode; + TQString languageCode = langCode; if (langCode.isEmpty()) languageCode = KGlobal::locale()->language(); // kdDebug() << "KoSpeaker::queueSpeech:languageCode = " << languageCode << endl; @@ -209,45 +209,45 @@ void KoSpeaker::readConfig(KConfig* config) d->m_acceleratorPrefix = config->readEntry("AcceleratorPrefixWord", i18n("Accelerator")); if (d->m_speakFlags & (SpeakPointerWidget | SpeakFocusWidget)) { if (startKttsd()) { - d->m_timer = new QTimer( this ); - connect( d->m_timer, SIGNAL(timeout()), this, SLOT(probe()) ); + d->m_timer = new TQTimer( this ); + connect( d->m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(probe()) ); d->m_timer->start( d->m_timeout ); } } } -bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) +bool KoSpeaker::maybeSayWidget(TQWidget* w, const TQPoint& pos /*=TQPoint()*/) { if (!w) return false; int id = -1; - QString text; + TQString text; - if (w->inherits("QViewportWidget")) { - w = w->parentWidget(); + if (w->inherits("TQViewportWidget")) { + w = w->tqparentWidget(); if (!w) return false; } // Handle widgets that have multiple parts. - if ( w->inherits("QMenuBar") ) { - QMenuBar* menuBar = dynamic_cast(w); - if (pos == QPoint()) { + if ( w->inherits(TQMENUBAR_OBJECT_NAME_STRING) ) { + TQMenuBar* menuBar = dynamic_cast(w); + if (pos == TQPoint()) { for (uint i = 0; i < menuBar->count(); ++i) if (menuBar->isItemActive(menuBar->idAt(i))) { id = menuBar->idAt(i); break; } } - // TODO: This doesn't work. Need way to figure out the QMenuItem underneath mouse pointer. + // TODO: This doesn't work. Need way to figure out the TQMenuItem underneath mouse pointer. // id = menuBarItemAt(menuBar, pos); if ( id != -1 ) text = menuBar->text(id); } else - if (w->inherits("QPopupMenu")) { - QPopupMenu* popupMenu = dynamic_cast(w); - if (pos == QPoint()) { + if (w->inherits(TQPOPUPMENU_OBJECT_NAME_STRING)) { + TQPopupMenu* popupMenu = dynamic_cast(w); + if (pos == TQPoint()) { for (uint i = 0; i < popupMenu->count(); ++i) if (popupMenu->isItemActive(popupMenu->idAt(i))) { id = popupMenu->idAt(i); @@ -259,10 +259,10 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) text = popupMenu->text(id); } else - if (w->inherits("QTabBar")) { - QTabBar* tabBar = dynamic_cast(w); - QTab* tab = 0; - if (pos == QPoint()) + if (w->inherits(TQTABBAR_OBJECT_NAME_STRING)) { + TQTabBar* tabBar = dynamic_cast(w); + TQTab* tab = 0; + if (pos == TQPoint()) tab = tabBar->tabAt(tabBar->currentTab()); else tab = tabBar->selectTab(tabBar->mapFromGlobal(pos)); @@ -272,10 +272,10 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) } } else - if (w->inherits("QListView")) { - QListView* lv = dynamic_cast(w); - QListViewItem* item = 0; - if (pos == QPoint()) + if (w->inherits(TQLISTVIEW_OBJECT_NAME_STRING)) { + TQListView* lv = dynamic_cast(w); + TQListViewItem* item = 0; + if (pos == TQPoint()) item = lv->currentItem(); else item = lv->itemAt(lv->viewport()->mapFromGlobal(pos)); @@ -287,11 +287,11 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) } } else - if (w->inherits("QListBox")) { - QListBox* lb = dynamic_cast(w); + if (w->inherits(TQLISTBOX_OBJECT_NAME_STRING)) { + TQListBox* lb = dynamic_cast(w); // qt docs say coordinates are in "on-screen" coordinates. What does that mean? - QListBoxItem* item = 0; - if (pos == QPoint()) + TQListBoxItem* item = 0; + if (pos == TQPoint()) item = lb->item(lb->currentItem()); else item = lb->itemAt(lb->mapFromGlobal(pos)); @@ -301,28 +301,28 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) } } else - if (w->inherits("QIconView")) { - QIconView* iv = dynamic_cast(w); - QIconViewItem* item = 0; - if (pos == QPoint()) + if (w->inherits(TQICONVIEW_OBJECT_NAME_STRING)) { + TQIconView* iv = dynamic_cast(w); + TQIconViewItem* item = 0; + if (pos == TQPoint()) item = iv->currentItem(); else - item = iv->findItem(iv->viewportToContents(iv->viewport()->mapFromGlobal(pos))); + item = iv->tqfindItem(iv->viewportToContents(iv->viewport()->mapFromGlobal(pos))); if (item) { id = item->index(); text = item->text(); } } else - if (w->inherits("QTable")) { - QTable* tbl = dynamic_cast(w); + if (w->inherits(TQTABLE_OBJECT_NAME_STRING)) { + TQTable* tbl = dynamic_cast(w); int row = -1; int col = -1; - if (pos == QPoint()) { + if (pos == TQPoint()) { row = tbl->currentRow(); col = tbl->currentColumn(); } else { - QPoint p = tbl->viewportToContents(tbl->viewport()->mapFromGlobal(pos)); + TQPoint p = tbl->viewportToContents(tbl->viewport()->mapFromGlobal(pos)); row = tbl->rowAt(p.y()); col = tbl->columnAt(p.x()); } @@ -332,13 +332,13 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) } } else - if (w->inherits("QGridView")) { - QGridView* gv = dynamic_cast(w); - // TODO: QGridView does not have a "current" row or column. Don't think they can even get focus? + if (w->inherits(TQGRIDVIEW_OBJECT_NAME_STRING)) { + TQGridView* gv = dynamic_cast(w); + // TODO: TQGridView does not have a "current" row or column. Don't think they can even get focus? int row = -1; int col = -1; - if (pos != QPoint()) { - QPoint p = gv->viewportToContents(gv->viewport()->mapFromGlobal(pos)); + if (pos != TQPoint()) { + TQPoint p = gv->viewportToContents(gv->viewport()->mapFromGlobal(pos)); row = gv->rowAt(p.y()); col = gv->columnAt(p.x()); } @@ -346,7 +346,7 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) id = (row * gv->numCols()) + col; } - if (pos == QPoint()) { + if (pos == TQPoint()) { if ( w == d->m_prevFocusWidget && id == d->m_prevFocusId) return false; d->m_prevFocusWidget = w; d->m_prevFocusId = id; @@ -366,29 +366,29 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) if (d->m_cancelSpeakWidget) return true; // Handle simple, single-part widgets. - if ( w->inherits("QButton") ) - text = dynamic_cast(w)->text(); + if ( w->inherits(TQBUTTON_OBJECT_NAME_STRING) ) + text = dynamic_cast(w)->text(); else - if (w->inherits("QComboBox")) - text = dynamic_cast(w)->currentText(); + if (w->inherits(TQCOMBOBOX_OBJECT_NAME_STRING)) + text = dynamic_cast(w)->currentText(); else - if (w->inherits("QLineEdit")) - text = dynamic_cast(w)->text(); + if (w->inherits(TQLINEEDIT_OBJECT_NAME_STRING)) + text = dynamic_cast(w)->text(); else - if (w->inherits("QTextEdit")) - text = dynamic_cast(w)->text(); + if (w->inherits(TQTEXTEDIT_OBJECT_NAME_STRING)) + text = dynamic_cast(w)->text(); else - if (w->inherits("QLabel")) - text = dynamic_cast(w)->text(); + if (w->inherits(TQLABEL_OBJECT_NAME_STRING)) + text = dynamic_cast(w)->text(); else - if (w->inherits("QGroupBox")) { + if (w->inherits(TQGROUPBOX_OBJECT_NAME_STRING)) { // TODO: Should calculate this number from font size? if (w->mapFromGlobal(pos).y() < 30) - text = dynamic_cast(w)->title(); + text = dynamic_cast(w)->title(); } // else -// if (w->inherits("QWhatsThat")) { -// text = dynamic_cast(w)->text(); +// if (w->inherits("TQWhatsThat")) { +// text = dynamic_cast(w)->text(); // } text = text.stripWhiteSpace(); @@ -400,9 +400,9 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) } if (d->m_speakFlags & SpeakTooltip || text.isEmpty()) { // kdDebug() << "pos = " << pos << endl; - // QPoint p = w->mapFromGlobal(pos); + // TQPoint p = w->mapFromGlobal(pos); // kdDebug() << "p = " << p << endl; - QString t = QToolTip::textFor(w, pos); + TQString t = TQToolTip::textFor(w, pos); t = t.stripWhiteSpace(); if (!t.isEmpty()) { if (t.right(1) != ".") t += "."; @@ -411,7 +411,7 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) } if (d->m_speakFlags & SpeakWhatsThis || text.isEmpty()) { - QString t = QWhatsThis::textFor(w, pos); + TQString t = TQWhatsThis::textFor(w, pos); t = t.stripWhiteSpace(); if (!t.isEmpty()) { if (t.right(1) != ".") t += "."; @@ -427,48 +427,48 @@ bool KoSpeaker::maybeSayWidget(QWidget* w, const QPoint& pos /*=QPoint()*/) return sayWidget(text); } -bool KoSpeaker::sayWidget(const QString& msg) +bool KoSpeaker::sayWidget(const TQString& msg) { - QString s = msg; + TQString s = msg; if (d->m_speakFlags & SpeakAccelerator) { - int amp = s.find("&"); + int amp = s.tqfind("&"); if (amp >= 0) { - QString acc = s.mid(++amp,1); + TQString acc = s.mid(++amp,1); acc = acc.stripWhiteSpace(); if (!acc.isEmpty()) s += ". " + d->m_acceleratorPrefix + " " + acc + "."; } } s.remove("&"); - if (QStyleSheet::mightBeRichText(s)) { + if (TQStyleSheet::mightBeRichText(s)) { // kdDebug() << "richtext" << endl; - s.replace(QRegExp(""), ""); - s.replace(QRegExp(""), ""); - s.replace(QRegExp("<(br|hr)>"), " "); - s.replace(QRegExp( + s.tqreplace(TQRegExp(""), ""); + s.tqreplace(TQRegExp(""), ""); + s.tqreplace(TQRegExp("<(br|hr)>"), " "); + s.tqreplace(TQRegExp( ""), ""); - s.replace(QRegExp(""), ""); - s.replace(QRegExp(""), ""); + s.tqreplace(TQRegExp(""), ""); + s.tqreplace(TQRegExp(""), ""); // Replace with "small frame_text image. " - s.replace(QRegExp(""), "\\1 \\2 image. "); + s.tqreplace(TQRegExp(""), "\\1 \\2 image. "); } if (s.isEmpty()) return false; - s.replace("Ctrl+", i18n("control plus ")); - s.replace("Alt+", i18n("alt plus ")); - s.replace("+", i18n(" plus ")); + s.tqreplace("Ctrl+", i18n("control plus ")); + s.tqreplace("Alt+", i18n("alt plus ")); + s.tqreplace("+", i18n(" plus ")); sayScreenReaderOutput(s, ""); return true; } // This doesn't work. Anybody know how to find the menu item underneath mouse pointer -// in a QMenuBar? -// int KoSpeaker::menuBarItemAt(QMenuBar* m, const QPoint& p) +// in a TQMenuBar? +// int KoSpeaker::menuBarItemAt(TQMenuBar* m, const TQPoint& p) // { // for (uint i = 0; i < m->count(); i++) { // int id = m->idAt(i); -// QMenuItem* mi = m->findItem(id); -// QWidget* w = mi->widget(); -// if (w->rect().contains(w->mapFromGlobal(p))) return id; +// TQMenuItem* mi = m->findItem(id); +// TQWidget* w = mi->widget(); +// if (w->rect().tqcontains(w->mapFromGlobal(p))) return id; // } // return -1; // } @@ -485,8 +485,8 @@ bool KoSpeaker::startKttsd() // If KTTSD not running, start it. if (!client->isApplicationRegistered("kttsd")) { - QString error; - if (kapp->startServiceByDesktopName("kttsd", QStringList(), &error)) { + TQString error; + if (kapp->startServiceByDesktopName("kttsd", TQStringList(), &error)) { kdDebug() << "KoSpeaker::startKttsd: error starting KTTSD service: " << error << endl; d->m_enabled = false; } else @@ -496,18 +496,18 @@ bool KoSpeaker::startKttsd() return d->m_enabled; } -QString KoSpeaker::getKttsdVersion() +TQString KoSpeaker::getKttsdVersion() { // Determine which version of KTTSD is running. Note that earlier versions of KSpeech interface // did not support version() method, so we must manually marshall this call ourselves. if (d->m_enabled) { if (!d->m_versionChecked) { DCOPClient *client = kapp->dcopClient(); - QByteArray data; - QCString replyType; - QByteArray replyData; + TQByteArray data; + TQCString replyType; + TQByteArray replyData; if ( client->call("kttsd", "KSpeech", "version()", data, replyType, replyData, true) ) { - QDataStream arg(replyData, IO_ReadOnly); + TQDataStream arg(replyData, IO_ReadOnly); arg >> d->m_kttsdVersion; kdDebug() << "KoSpeaker::startKttsd: KTTSD version = " << d->m_kttsdVersion << endl; } @@ -517,56 +517,56 @@ QString KoSpeaker::getKttsdVersion() return d->m_kttsdVersion; } -void KoSpeaker::sayScreenReaderOutput(const QString &msg, const QString &talker) +void KoSpeaker::sayScreenReaderOutput(const TQString &msg, const TQString &talker) { if (msg.isEmpty()) return; DCOPClient *client = kapp->dcopClient(); - QByteArray data; - QCString replyType; - QByteArray replyData; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQCString replyType; + TQByteArray replyData; + TQDataStream arg(data, IO_WriteOnly); arg << msg << talker; - if ( !client->call("kttsd", "KSpeech", "sayScreenReaderOutput(QString,QString)", + if ( !client->call("kttsd", "KSpeech", "sayScreenReaderOutput(TQString,TQString)", data, replyType, replyData, true) ) { kdDebug() << "KoSpeaker::sayScreenReaderOutput: failed" << endl; } } -uint KoSpeaker::setText(const QString &text, const QString &talker) +uint KoSpeaker::setText(const TQString &text, const TQString &talker) { if (text.isEmpty()) return 0; DCOPClient *client = kapp->dcopClient(); - QByteArray data; - QCString replyType; - QByteArray replyData; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQCString replyType; + TQByteArray replyData; + TQDataStream arg(data, IO_WriteOnly); arg << text << talker; uint jobNum = 0; - if ( !client->call("kttsd", "KSpeech", "setText(QString,QString)", + if ( !client->call("kttsd", "KSpeech", "setText(TQString,TQString)", data, replyType, replyData, true) ) { kdDebug() << "KoSpeaker::sayText: failed" << endl; } else { - QDataStream arg2(replyData, IO_ReadOnly); + TQDataStream arg2(replyData, IO_ReadOnly); arg2 >> jobNum; } return jobNum; } -int KoSpeaker::appendText(const QString &text, uint jobNum /*=0*/) +int KoSpeaker::appendText(const TQString &text, uint jobNum /*=0*/) { if (text.isEmpty()) return 0; DCOPClient *client = kapp->dcopClient(); - QByteArray data; - QCString replyType; - QByteArray replyData; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQCString replyType; + TQByteArray replyData; + TQDataStream arg(data, IO_WriteOnly); arg << text << jobNum; int partNum = 0; - if ( !client->call("kttsd", "KSpeech", "appendText(QString,uint)", + if ( !client->call("kttsd", "KSpeech", "appendText(TQString,uint)", data, replyType, replyData, true) ) { kdDebug() << "KoSpeaker::appendText: failed" << endl; } else { - QDataStream arg2(replyData, IO_ReadOnly); + TQDataStream arg2(replyData, IO_ReadOnly); arg2 >> partNum; } return partNum; @@ -575,10 +575,10 @@ int KoSpeaker::appendText(const QString &text, uint jobNum /*=0*/) void KoSpeaker::startText(uint jobNum /*=0*/) { DCOPClient *client = kapp->dcopClient(); - QByteArray data; - QCString replyType; - QByteArray replyData; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQCString replyType; + TQByteArray replyData; + TQDataStream arg(data, IO_WriteOnly); arg << jobNum; if ( !client->call("kttsd", "KSpeech", "startText(uint)", data, replyType, replyData, true) ) { @@ -589,10 +589,10 @@ void KoSpeaker::startText(uint jobNum /*=0*/) void KoSpeaker::removeText(uint jobNum /*=0*/) { DCOPClient *client = kapp->dcopClient(); - QByteArray data; - QCString replyType; - QByteArray replyData; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQCString replyType; + TQByteArray replyData; + TQDataStream arg(data, IO_WriteOnly); arg << jobNum; if ( !client->call("kttsd", "KSpeech", "removeText(uint)", data, replyType, replyData, true) ) { diff --git a/lib/kofficecore/KoSpeaker.h b/lib/kofficecore/KoSpeaker.h index 6f8b430f9..1e2d3188c 100644 --- a/lib/kofficecore/KoSpeaker.h +++ b/lib/kofficecore/KoSpeaker.h @@ -24,9 +24,9 @@ #ifndef KOSPEAKER_H #define KOSPEAKER_H -// Qt includes. -#include -#include +// TQt includes. +#include +#include // KDE includes. #include @@ -34,8 +34,8 @@ // KOffice includes. #include -class QWidget; -class QPoint; +class TQWidget; +class TQPoint; class KConfig; class KoSpeakerPrivate; @@ -51,7 +51,7 @@ class KoSpeakerPrivate; * It will be replaced with a proper screen reading capability using the AT-SPI. * * This is quite a hack and doesn't work reliably. The following are current problems: - * 1. Cannot speak menu items in a QMenuBar (top menu of app). + * 1. Cannot speak menu items in a TQMenuBar (top menu of app). * 2. Doesn't understand every possible widget. * * This capability is @em not intended for completely blind users. Such users cannot use @@ -60,9 +60,10 @@ class KoSpeakerPrivate; * * KOffice applications can access this object using the kospeaker global. */ -class KOFFICECORE_EXPORT KoSpeaker : public QObject, public KShared +class KOFFICECORE_EXPORT KoSpeaker : public TQObject, public KShared { Q_OBJECT + TQ_OBJECT public: KoSpeaker(); ~KoSpeaker(); @@ -96,21 +97,21 @@ public: /** * Given a widget @p w and its @p pos screen coordinates, tries to extract the text of the widget * and speak it. If @p pos is not specified, and the widget has multiple parts (such as - * a QListView), uses the current part. + * a TQListView), uses the current part. * Call @ref isEnabled to ensure TTS is available before calling this method. */ - bool maybeSayWidget(QWidget* w, const QPoint& pos = QPoint()); + bool maybeSayWidget(TQWidget* w, const TQPoint& pos = TQPoint()); /** * Speak a @p msg that came from a widget, such as the widget's text label, tool tip, etc. * Speaks using ScreenReaderOutput, which has highest priority, and therefore, should only be * be used in very time-sensitive contexts and for short messages. * Certain standard substitutions are performed on the message. For example, "Ctrl+" becomes - * "control plus". "Qt" markup is stripped. + * "control plus". "TQt" markup is stripped. * @returns true if anything is actually spoken. * Call @ref isEnabled to ensure TTS is available before calling this method. */ - bool sayWidget(const QString& msg); + bool sayWidget(const TQString& msg); /** * Cancels speaking of widget. Usually called by slots that receive @ref customSpeakNewWidget @@ -125,7 +126,7 @@ public: * If @p first is false, appends to the already queued job. * If the KTTSD daemon is not already running, it is started. */ - void queueSpeech(const QString& msg, const QString& langCode = QString(), bool first = true); + void queueSpeech(const TQString& msg, const TQString& langCode = TQString(), bool first = true); /** * Start speaking queued text job (if any). @@ -156,7 +157,7 @@ signals: * IMPORTANT: This signal is emitted from the @ref maybeSayWidget method. Slots who * call maybeSayWidget should take care to avoid infinite recursion. */ - void customSpeakNewWidget(QWidget* w, const QPoint& p, uint flags); + void customSpeakNewWidget(TQWidget* w, const TQPoint& p, uint flags); /** * This signal is emitted each polling interval when KoSpeaker did not speak the widget @@ -169,7 +170,7 @@ signals: * * IMPORTANT: This signal is emitted frequently. Receivers should be coded efficiently. */ - void customSpeakWidget(QWidget* w, const QPoint& p, uint flags); + void customSpeakWidget(TQWidget* w, const TQPoint& p, uint flags); protected: static KoSpeaker* KSpkr; @@ -182,19 +183,19 @@ private slots: void probe(); private: - // int menuBarItemAt(QMenuBar* m, const QPoint& p); + // int menuBarItemAt(TQMenuBar* m, const TQPoint& p); // Start the KTTSD daemon if not already running. bool startKttsd(); // Return the KTTSD daemon version string. - QString getKttsdVersion(); + TQString getKttsdVersion(); // These methods correspond to dcop interface in kdelibs/interfaces/kspeech/kspeech.h. // They use manual marshalling, instead of using kspeech_stub, because KOffice // supports KDE 3.3 and above and kspeech.h didn't appear until 3.4. - void sayScreenReaderOutput(const QString &msg, const QString &talker); - uint setText(const QString &text, const QString &talker); - int appendText(const QString &text, uint jobNum=0); + void sayScreenReaderOutput(const TQString &msg, const TQString &talker); + uint setText(const TQString &text, const TQString &talker); + int appendText(const TQString &text, uint jobNum=0); void startText(uint jobNum=0); void removeText(uint jobNum=0); diff --git a/lib/kofficecore/KoStyleStack.cpp b/lib/kofficecore/KoStyleStack.cpp index 4b5b807b8..227992096 100644 --- a/lib/kofficecore/KoStyleStack.cpp +++ b/lib/kofficecore/KoStyleStack.cpp @@ -81,27 +81,27 @@ void KoStyleStack::pop() #endif } -void KoStyleStack::push( const QDomElement& style ) +void KoStyleStack::push( const TQDomElement& style ) { m_stack.append( style ); #ifdef DEBUG_STYLESTACK - kdDebug(30003) << "pushed " << style.attributeNS( m_styleNSURI, "name", QString::null ) << " -> count=" << m_stack.count() << endl; + kdDebug(30003) << "pushed " << style.attributeNS( m_styleNSURI, "name", TQString() ) << " -> count=" << m_stack.count() << endl; #endif } -bool KoStyleStack::hasAttribute( const QString& name, const QString& detail ) const +bool KoStyleStack::hasAttribute( const TQString& name, const TQString& detail ) const { - QString fullName( name ); + TQString fullName( name ); if ( !detail.isEmpty() ) { fullName += '-'; fullName += detail; } - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - QDomElement properties = (*it).namedItem( "style:"+m_propertiesTagName ).toElement(); + TQDomElement properties = (*it).namedItem( "style:"+m_propertiesTagName ).toElement(); if ( properties.hasAttribute( name ) || ( !detail.isEmpty() && properties.hasAttribute( fullName ) ) ) return true; @@ -109,61 +109,61 @@ bool KoStyleStack::hasAttribute( const QString& name, const QString& detail ) co return false; } -QString KoStyleStack::attribute( const QString& name, const QString& detail ) const +TQString KoStyleStack::attribute( const TQString& name, const TQString& detail ) const { - QString fullName( name ); + TQString fullName( name ); if ( !detail.isEmpty() ) { fullName += '-'; fullName += detail; } - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - QDomElement properties = (*it).namedItem( "style:"+m_propertiesTagName ).toElement(); + TQDomElement properties = (*it).namedItem( "style:"+m_propertiesTagName ).toElement(); if ( properties.hasAttribute( name ) ) return properties.attribute( name ); if ( !detail.isEmpty() && properties.hasAttribute( fullName ) ) return properties.attribute( fullName ); } - return QString::null; + return TQString(); } -QString KoStyleStack::attributeNS( const char* nsURI, const char* name, const char* detail ) const +TQString KoStyleStack::attributeNS( const char* nsURI, const char* name, const char* detail ) const { - QString fullName( name ); + TQString fullName( name ); if ( detail ) { fullName += '-'; fullName += detail; } - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - QDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ); + TQDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ); if ( properties.hasAttributeNS( nsURI, name ) ) - return properties.attributeNS( nsURI, name, QString::null ); + return properties.attributeNS( nsURI, name, TQString() ); if ( detail && properties.hasAttributeNS( nsURI, fullName ) ) - return properties.attributeNS( nsURI, fullName, QString::null ); + return properties.attributeNS( nsURI, fullName, TQString() ); } - return QString::null; + return TQString(); } bool KoStyleStack::hasAttributeNS( const char* nsURI, const char* name, const char* detail ) const { - QString fullName( name ); + TQString fullName( name ); if ( detail ) { fullName += '-'; fullName += detail; } - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - QDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ); + TQDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ); if ( properties.hasAttributeNS( nsURI, name ) || ( detail && properties.hasAttributeNS( nsURI, fullName ) ) ) return true; @@ -171,21 +171,21 @@ bool KoStyleStack::hasAttributeNS( const char* nsURI, const char* name, const ch return false; } -// Font size is a bit special. "115%" applies to "the fontsize of the parent style". +// Font size is a bit special. "115%" applies to "the fontsize of the tqparent style". // This can be generalized though (hasAttributeThatCanBePercentOfParent() ? :) // Although, if we also add support for fo:font-size-rel here then it's not general anymore. double KoStyleStack::fontSize() const { - const QString name = "font-size"; + const TQString name = "font-size"; double percent = 1; - QValueList::ConstIterator it = m_stack.end(); // reverse iterator + TQValueList::ConstIterator it = m_stack.end(); // reverse iterator while ( it != m_stack.begin() ) { --it; - QDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ).toElement(); + TQDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ).toElement(); if ( properties.hasAttributeNS( m_foNSURI, name ) ) { - const QString value = properties.attributeNS( m_foNSURI, name, QString::null ); + const TQString value = properties.attributeNS( m_foNSURI, name, TQString() ); if ( value.endsWith( "%" ) ) percent *= value.left( value.length() - 1 ).toDouble() / 100.0; else @@ -195,13 +195,13 @@ double KoStyleStack::fontSize() const return 0; } -bool KoStyleStack::hasChildNode(const QString & name) const +bool KoStyleStack::hasChildNode(const TQString & name) const { - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - QDomElement properties = (*it).namedItem( "style:"+m_propertiesTagName ).toElement(); + TQDomElement properties = (*it).namedItem( "style:"+m_propertiesTagName ).toElement(); if ( !properties.namedItem( name ).isNull() ) return true; } @@ -209,28 +209,28 @@ bool KoStyleStack::hasChildNode(const QString & name) const return false; } -QDomElement KoStyleStack::childNode(const QString & name) const +TQDomElement KoStyleStack::childNode(const TQString & name) const { - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - QDomElement properties = (*it).namedItem( "style:"+m_propertiesTagName ).toElement(); + TQDomElement properties = (*it).namedItem( "style:"+m_propertiesTagName ).toElement(); if ( !properties.namedItem( name ).isNull() ) return properties.namedItem( name ).toElement(); } - return QDomElement(); // a null element + return TQDomElement(); // a null element } bool KoStyleStack::hasChildNodeNS( const char* nsURI, const char* localName ) const { - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - QDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ); + TQDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ); if ( !KoDom::namedItemNS( properties, nsURI, localName ).isNull() ) return true; } @@ -238,59 +238,59 @@ bool KoStyleStack::hasChildNodeNS( const char* nsURI, const char* localName ) co return false; } -QDomElement KoStyleStack::childNodeNS( const char* nsURI, const char* localName) const +TQDomElement KoStyleStack::childNodeNS( const char* nsURI, const char* localName) const { - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - QDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ); - QDomElement e = KoDom::namedItemNS( properties, nsURI, localName ); + TQDomElement properties = KoDom::namedItemNS( *it, m_styleNSURI, m_propertiesTagName ); + TQDomElement e = KoDom::namedItemNS( properties, nsURI, localName ); if ( !e.isNull() ) return e; } - return QDomElement(); // a null element + return TQDomElement(); // a null element } -bool KoStyleStack::isUserStyle( const QDomElement& e, const QString& family ) const +bool KoStyleStack::isUserStyle( const TQDomElement& e, const TQString& family ) const { - if ( e.attributeNS( m_styleNSURI, "family", QString::null ) != family ) + if ( e.attributeNS( m_styleNSURI, "family", TQString() ) != family ) return false; - const QDomElement parent = e.parentNode().toElement(); - //kdDebug(30003) << k_funcinfo << "tagName=" << e.tagName() << " parent-tagName=" << parent.tagName() << endl; - return parent.localName() == "styles" /*&& parent.namespaceURI() == KoXmlNS::office*/; + const TQDomElement tqparent = e.tqparentNode().toElement(); + //kdDebug(30003) << k_funcinfo << "tagName=" << e.tagName() << " tqparent-tagName=" << tqparent.tagName() << endl; + return tqparent.localName() == "styles" /*&& tqparent.namespaceURI() == KoXmlNS::office*/; } -QString KoStyleStack::userStyleName( const QString& family ) const +TQString KoStyleStack::userStyleName( const TQString& family ) const { - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; - //kdDebug(30003) << k_funcinfo << (*it).attributeNS( m_styleNSURI, "name", QString::null) << endl; + //kdDebug(30003) << k_funcinfo << (*it).attributeNS( m_styleNSURI, "name", TQString()) << endl; if ( isUserStyle( *it, family ) ) - return (*it).attributeNS( m_styleNSURI, "name", QString::null ); + return (*it).attributeNS( m_styleNSURI, "name", TQString() ); } // Can this ever happen? return "Standard"; } -QString KoStyleStack::userStyleDisplayName( const QString& family ) const +TQString KoStyleStack::userStyleDisplayName( const TQString& family ) const { - QValueList::ConstIterator it = m_stack.end(); + TQValueList::ConstIterator it = m_stack.end(); while ( it != m_stack.begin() ) { --it; //kdDebug(30003) << k_funcinfo << (*it).attributeNS( m_styleNSURI, "display-name") << endl; if ( isUserStyle( *it, family ) ) - return (*it).attributeNS( m_styleNSURI, "display-name", QString::null ); + return (*it).attributeNS( m_styleNSURI, "display-name", TQString() ); } - return QString::null; // no display name, this can happen since it's optional + return TQString(); // no display name, this can happen since it's optional } void KoStyleStack::setTypeProperties( const char* typeProperties ) { - m_propertiesTagName = typeProperties == 0 ? QCString( "properties" ) : ( QCString( typeProperties ) + "-properties" ); + m_propertiesTagName = typeProperties == 0 ? TQCString( "properties" ) : ( TQCString( typeProperties ) + "-properties" ); } diff --git a/lib/kofficecore/KoStyleStack.h b/lib/kofficecore/KoStyleStack.h index f3c5faf10..4e6cfa7e2 100644 --- a/lib/kofficecore/KoStyleStack.h +++ b/lib/kofficecore/KoStyleStack.h @@ -22,9 +22,9 @@ #define KOSTYLESTACK_H -#include -#include -#include +#include +#include +#include #include @@ -36,7 +36,7 @@ * There can be several styles that are valid for one object. For example * a textobject on a page has styles 'pr3' and 'P7' and a paragraph in * that textobject has styles 'P1' and 'T3'. And some styles even have - * parent-styles... + * tqparent-styles... * * If you want to know if there is, for example, the attribute 'fo:font-family' * for this paragraph, you have to look into style 'T3', 'P1', 'P7' and 'pr3'. @@ -54,7 +54,7 @@ * * In general though, you wouldn't use push/pop directly, but KoOasisLoadingContext::fillStyleStack * or KoOasisLoadingContext::addStyles to automatically push a style and all its - * parent styles onto the stack. + * tqparent styles onto the stack. */ class KOFFICECORE_EXPORT KoStyleStack { @@ -93,25 +93,25 @@ public: /** * Pushes the new style onto the stack. */ - void push( const QDomElement& style ); + void push( const TQDomElement& style ); /** * Check if any of the styles on the stack has an attribute called 'name'-'detail' * where detail is e.g. left, right, top or bottom. - * This allows to also find 'name' alone (e.g. padding implies padding-left, padding-right etc.) + * This allows to also tqfind 'name' alone (e.g. padding implies padding-left, padding-right etc.) */ - bool hasAttribute( const QString& name, const QString& detail = QString::null ) const KDE_DEPRECATED; + bool hasAttribute( const TQString& name, const TQString& detail = TQString() ) const KDE_DEPRECATED; /** * Search for the attribute called 'name', starting on top of the stack, * and return it. */ - QString attribute( const QString& name, const QString& detail = QString::null ) const KDE_DEPRECATED; + TQString attribute( const TQString& name, const TQString& detail = TQString() ) const KDE_DEPRECATED; /** * Check if any of the styles on the stack has an attribute called 'name'-'detail' * where detail is e.g. left, right, top or bottom. - * This allows to also find 'name' alone (e.g. padding implies padding-left, padding-right etc.) + * This allows to also tqfind 'name' alone (e.g. padding implies padding-left, padding-right etc.) */ bool hasAttributeNS( const char* nsURI, const char* localName, const char* detail = 0 ) const; @@ -119,18 +119,18 @@ public: * Search for the attribute called 'name', starting on top of the stack, * and return it. */ - QString attributeNS( const char* nsURI, const char* localName, const char* detail = 0 ) const; + TQString attributeNS( const char* nsURI, const char* localName, const char* detail = 0 ) const; /** * Check if any of the styles on the stack has a child node called 'name'. */ - bool hasChildNode( const QString & name ) const KDE_DEPRECATED; + bool hasChildNode( const TQString & name ) const KDE_DEPRECATED; /** * Search for a child node called 'name', starting on top of the stack, * and return it. */ - QDomElement childNode( const QString & name ) const KDE_DEPRECATED; + TQDomElement childNode( const TQString & name ) const KDE_DEPRECATED; /** * Check if any of the styles on the stack has a child element called 'localName' in the namespace 'nsURI'. @@ -142,7 +142,7 @@ public: * in the namespace 'nsURI' starting on top of the stack, * and return it. */ - QDomElement childNodeNS( const char* nsURI, const char* localName ) const; + TQDomElement childNodeNS( const char* nsURI, const char* localName ) const; /** * Special case for the current font size, due to special handling of fo:font-size="115%". @@ -155,13 +155,13 @@ public: * This is used to know e.g. which user-style is associated with the current paragraph. * There could be none though. */ - QString userStyleName( const QString& family ) const; + TQString userStyleName( const TQString& family ) const; /** * Return the display name of the style specified by the user, * i.e. not an auto style */ - QString userStyleDisplayName( const QString& family ) const; + TQString userStyleDisplayName( const TQString& family ) const; /** * Set the type of properties that will be looked for. @@ -173,19 +173,19 @@ public: void setTypeProperties( const char* typeProperties ); private: - bool isUserStyle( const QDomElement& e, const QString& family ) const; + bool isUserStyle( const TQDomElement& e, const TQString& family ) const; private: /// For save/restore: stack of "marks". Each mark is an index in m_stack. - QValueStack m_marks; + TQValueStack m_marks; /** - * We use QValueList instead of QValueStack because we need access to all styles + * We use TQValueList instead of TQValueStack because we need access to all styles * not only the top one. */ - QValueList m_stack; + TQValueList m_stack; - QCString m_propertiesTagName; + TQCString m_propertiesTagName; const char* m_styleNSURI; const char* m_foNSURI; diff --git a/lib/kofficecore/KoTemplates.cpp b/lib/kofficecore/KoTemplates.cpp index 7fbf3a994..178c6271e 100644 --- a/lib/kofficecore/KoTemplates.cpp +++ b/lib/kofficecore/KoTemplates.cpp @@ -19,9 +19,9 @@ #include -#include -#include -#include +#include +#include +#include #include #include @@ -37,31 +37,31 @@ #include -KoTemplate::KoTemplate(const QString &name, const QString &description, const QString &file, - const QString &picture, const QString &fileName, const QString &_measureSystem, +KoTemplate::KoTemplate(const TQString &name, const TQString &description, const TQString &file, + const TQString &picture, const TQString &fileName, const TQString &_measureSystem, bool hidden, bool touched) : m_name(name), m_descr(description), m_file(file), m_picture(picture), m_fileName(fileName), m_hidden(hidden), m_touched(touched), m_cached(false), m_measureSystem(_measureSystem) { } -const QPixmap &KoTemplate::loadPicture( KInstance* instance ) { +const TQPixmap &KoTemplate::loadPicture( KInstance* instance ) { if(m_cached) return m_pixmap; m_cached=true; if ( m_picture[ 0 ] == '/' ) { - // ### TODO: use the class KoPicture instead of QImage to support non-image pictures - QImage img( m_picture ); + // ### TODO: use the class KoPicture instead of TQImage to support non-image pictures + TQImage img( m_picture ); if (img.isNull()) { kdWarning() << "Couldn't find icon " << m_picture << endl; - m_pixmap=QPixmap(); + m_pixmap=TQPixmap(); return m_pixmap; } const int maxHeightWidth = 128; // ### TODO: some people would surely like to have 128x128 if (img.width() > maxHeightWidth || img.height() > maxHeightWidth) { - img = img.smoothScale( maxHeightWidth, maxHeightWidth, QImage::ScaleMax ); + img = img.smoothScale( maxHeightWidth, maxHeightWidth, TQ_ScaleMax ); } m_pixmap.convertFromImage(img); return m_pixmap; @@ -72,7 +72,7 @@ const QPixmap &KoTemplate::loadPicture( KInstance* instance ) { } -KoTemplateGroup::KoTemplateGroup(const QString &name, const QString &dir, +KoTemplateGroup::KoTemplateGroup(const TQString &name, const TQString &dir, int _sortingWeight, bool touched) : m_name(name), m_touched(touched), m_sortingWeight(_sortingWeight) { @@ -82,7 +82,7 @@ KoTemplateGroup::KoTemplateGroup(const QString &name, const QString &dir, bool KoTemplateGroup::isHidden() const { - QPtrListIterator it(m_templates); + TQPtrListIterator it(m_templates); bool hidden=true; while(it.current()!=0L && hidden) { hidden=it.current()->isHidden(); @@ -93,7 +93,7 @@ bool KoTemplateGroup::isHidden() const { void KoTemplateGroup::setHidden(bool hidden) const { - QPtrListIterator it(m_templates); + TQPtrListIterator it(m_templates); for( ; it.current()!=0L; ++it) it.current()->setHidden(hidden); m_touched=true; @@ -101,7 +101,7 @@ void KoTemplateGroup::setHidden(bool hidden) const { bool KoTemplateGroup::add(KoTemplate *t, bool force, bool touch) { - KoTemplate *myTemplate=find(t->name()); + KoTemplate *myTemplate=tqfind(t->name()); if(myTemplate==0L) { m_templates.append(t); m_touched=touch; @@ -109,9 +109,9 @@ bool KoTemplateGroup::add(KoTemplate *t, bool force, bool touch) { } else if(myTemplate && force) { //kdDebug() << "removing :" << myTemplate->fileName() << endl; - QFile::remove( myTemplate->fileName() ); - QFile::remove( myTemplate->picture() ); - QFile::remove( myTemplate->file() ); + TQFile::remove( myTemplate->fileName() ); + TQFile::remove( myTemplate->picture() ); + TQFile::remove( myTemplate->file() ); m_templates.removeRef(myTemplate); m_templates.append(t); m_touched=touch; @@ -120,16 +120,16 @@ bool KoTemplateGroup::add(KoTemplate *t, bool force, bool touch) { return false; } -KoTemplate *KoTemplateGroup::find(const QString &name) const { +KoTemplate *KoTemplateGroup::tqfind(const TQString &name) const { - QPtrListIterator it(m_templates); + TQPtrListIterator it(m_templates); while(it.current() && it.current()->name()!=name) ++it; return it.current(); } -KoTemplateTree::KoTemplateTree(const QCString &templateType, +KoTemplateTree::KoTemplateTree(const TQCString &templateType, KInstance *instance, bool readTree) : m_templateType(templateType), m_instance(instance), m_defaultGroup(0L), m_defaultTemplate(0L) { @@ -146,7 +146,7 @@ void KoTemplateTree::readTemplateTree() { } void KoTemplateTree::writeTemplateTree() { - QString localDir=m_instance->dirs()->saveLocation(m_templateType); + TQString localDir=m_instance->dirs()->saveLocation(m_templateType); for(KoTemplateGroup *group=m_groups.first(); group!=0L; group=m_groups.next()) { //kdDebug() << "---------------------------------" << endl; @@ -183,8 +183,8 @@ void KoTemplateTree::writeTemplateTree() { if(t->isHidden() && t->touched() ) { //kdDebug() << "+++ delete local template ##############" << endl; writeTemplate(t, group, localDir); - QFile::remove(t->file()); - QFile::remove(t->picture()); + TQFile::remove(t->file()); + TQFile::remove(t->picture()); } } } @@ -192,16 +192,16 @@ void KoTemplateTree::writeTemplateTree() { void KoTemplateTree::add(KoTemplateGroup *g) { - KoTemplateGroup *group=find(g->name()); + KoTemplateGroup *group=tqfind(g->name()); if(group==0L) m_groups.append(g); else group->addDir(g->dirs().first()); // "...there can be only one..." (Queen) } -KoTemplateGroup *KoTemplateTree::find(const QString &name) const { +KoTemplateGroup *KoTemplateTree::tqfind(const TQString &name) const { - QPtrListIterator it(m_groups); + TQPtrListIterator it(m_groups); while(it.current() && it.current()->name()!=name) ++it; return it.current(); @@ -209,21 +209,21 @@ KoTemplateGroup *KoTemplateTree::find(const QString &name) const { void KoTemplateTree::readGroups() { - QStringList dirs = m_instance->dirs()->resourceDirs(m_templateType); - for(QStringList::ConstIterator it=dirs.begin(); it!=dirs.end(); ++it) { + TQStringList dirs = m_instance->dirs()->resourceDirs(m_templateType); + for(TQStringList::ConstIterator it=dirs.begin(); it!=dirs.end(); ++it) { //kdDebug() << "dir: " << *it << endl; - QDir dir(*it); + TQDir dir(*it); // avoid the annoying warning if(!dir.exists()) continue; - dir.setFilter(QDir::Dirs); - QStringList templateDirs=dir.entryList(); - for(QStringList::ConstIterator tdirIt=templateDirs.begin(); tdirIt!=templateDirs.end(); ++tdirIt) { + dir.setFilter(TQDir::Dirs); + TQStringList templateDirs=dir.entryList(); + for(TQStringList::ConstIterator tdirIt=templateDirs.begin(); tdirIt!=templateDirs.end(); ++tdirIt) { if(*tdirIt=="." || *tdirIt=="..") // we don't want to check those dirs :) continue; - QDir templateDir(*it+*tdirIt); - QString name=*tdirIt; - QString defaultTab; + TQDir templateDir(*it+*tdirIt); + TQString name=*tdirIt; + TQString defaultTab; int sortingWeight = 1000; if(templateDir.exists(".directory")) { KSimpleConfig config(templateDir.absPath()+"/.directory", true); @@ -233,7 +233,7 @@ void KoTemplateTree::readGroups() { sortingWeight=config.readNumEntry("X-KDE-SortingWeight", 1000); //kdDebug() << "name: " << name <pageSize() == QPrinter::Letter) { + if(KGlobal::locale()->pageSize() == TQPrinter::Letter) { dontShow = "metric"; } - QPtrListIterator groupIt(m_groups); + TQPtrListIterator groupIt(m_groups); for( ; groupIt.current()!=0L; ++groupIt) { - QStringList dirs=groupIt.current()->dirs(); - for(QStringList::ConstIterator it=dirs.begin(); it!=dirs.end(); ++it) { - QDir d(*it); + TQStringList dirs=groupIt.current()->dirs(); + for(TQStringList::ConstIterator it=dirs.begin(); it!=dirs.end(); ++it) { + TQDir d(*it); if( !d.exists() ) continue; - QStringList files=d.entryList( QDir::Files | QDir::Readable, QDir::Name ); + TQStringList files=d.entryList( TQDir::Files | TQDir::Readable, TQDir::Name ); for(unsigned int i=0; i