diff options
Diffstat (limited to 'src/notecontent.cpp')
-rw-r--r-- | src/notecontent.cpp | 836 |
1 files changed, 418 insertions, 418 deletions
diff --git a/src/notecontent.cpp b/src/notecontent.cpp index 39d4688..38f01cd 100644 --- a/src/notecontent.cpp +++ b/src/notecontent.cpp @@ -18,16 +18,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qfile.h> -#include <qdir.h> -#include <qdom.h> -#include <qpainter.h> -#include <qstylesheet.h> -#include <qfontmetrics.h> -#include <qwidget.h> -#include <qcursor.h> -#include <qstringlist.h> -#include <qbuffer.h> +#include <tqfile.h> +#include <tqdir.h> +#include <tqdom.h> +#include <tqpainter.h> +#include <tqstylesheet.h> +#include <tqfontmetrics.h> +#include <tqwidget.h> +#include <tqcursor.h> +#include <tqstringlist.h> +#include <tqbuffer.h> #include <ktextedit.h> #include <kservice.h> #include <kcolordialog.h> @@ -35,14 +35,14 @@ #include <klocale.h> #include <kglobalsettings.h> #include <kpixmapeffect.h> -#include <qbitmap.h> +#include <tqbitmap.h> #include <kurifilter.h> //#include <kstringhandler.h> #include <kfilemetainfo.h> -#include <qdatetime.h> +#include <tqdatetime.h> #include <kmultipledrag.h> -#include <qfileinfo.h> +#include <tqfileinfo.h> //#include <kio/kfileitem.h> #include <kfileitem.h> #include <kio/previewjob.h> @@ -80,27 +80,27 @@ const int NoteContent::FEEDBACK_DARKING = 105; -NoteContent::NoteContent(Note *parent, const QString &fileName) - : m_note(parent) +NoteContent::NoteContent(Note *tqparent, const TQString &fileName) + : m_note(tqparent) { - parent->setContent(this); + tqparent->setContent(this); setFileName(fileName); } -void NoteContent::saveToNode(QDomDocument &doc, QDomElement &content) +void NoteContent::saveToNode(TQDomDocument &doc, TQDomElement &content) { if (useFile()) { - QDomText textNode = doc.createTextNode(fileName()); + TQDomText textNode = doc.createTextNode(fileName()); content.appendChild(textNode); } } -QRect NoteContent::zoneRect(int zone, const QPoint &/*pos*/) +TQRect NoteContent::zoneRect(int zone, const TQPoint &/*pos*/) { if (zone == Note::Content) - return QRect(0, 0, note()->width(), note()->height()); // Too wide and height, but it will be clipped by Note::zoneRect() + return TQRect(0, 0, note()->width(), note()->height()); // Too wide and height, but it will be clipped by Note::zoneRect() else - return QRect(); + return TQRect(); } KURL NoteContent::urlToOpen(bool /*with*/) @@ -108,16 +108,16 @@ KURL NoteContent::urlToOpen(bool /*with*/) return (useFile() ? KURL(fullPath()) : KURL()); } -void NoteContent::setFileName(const QString &fileName) +void NoteContent::setFileName(const TQString &fileName) { m_fileName = fileName; } -bool NoteContent::trySetFileName(const QString &fileName) +bool NoteContent::trySetFileName(const TQString &fileName) { if (useFile() && fileName != m_fileName) { - QString newFileName = Tools::fileNameForNewFile(fileName, basket()->fullPath()); - QDir dir; + TQString newFileName = Tools::fileNameForNewFile(fileName, basket()->fullPath()); + TQDir dir; dir.rename(fullPath(), basket()->fullPathForFileName(newFileName)); return true; } @@ -125,7 +125,7 @@ bool NoteContent::trySetFileName(const QString &fileName) return false; // !useFile() or unsuccesful rename } -QString NoteContent::fullPath() +TQString NoteContent::fullPath() { if (note() && useFile()) return note()->fullPath(); @@ -138,7 +138,7 @@ void NoteContent::contentChanged(int newMinWidth) m_minWidth = newMinWidth; if (note()) { // note()->unbufferize(); - note()->requestRelayout(); // TODO: It should re-set the width! m_width = 0 ? contentChanged: setWidth, geteight, if size havent changed, only repaint and not relayout + note()->requestRetqlayout(); // TODO: It should re-set the width! m_width = 0 ? contentChanged: setWidth, geteight, if size havent changed, only tqrepaint and not retqlayout } } @@ -152,7 +152,7 @@ Basket* NoteContent::basket() void NoteContent::setEdited() { - note()->setLastModificationDate(QDateTime::currentDateTime()); + note()->setLastModificationDate(TQDateTime::tqcurrentDateTime()); basket()->save(); } @@ -170,36 +170,36 @@ NoteType::Id LauncherContent::type() { return NoteType::Launcher; } NoteType::Id ColorContent::type() { return NoteType::Color; } NoteType::Id UnknownContent::type() { return NoteType::Unknown; } -QString TextContent::typeName() { return i18n("Plain Text"); } -QString HtmlContent::typeName() { return i18n("Text"); } -QString ImageContent::typeName() { return i18n("Image"); } -QString AnimationContent::typeName() { return i18n("Animation"); } -QString SoundContent::typeName() { return i18n("Sound"); } -QString FileContent::typeName() { return i18n("File"); } -QString LinkContent::typeName() { return i18n("Link"); } -QString LauncherContent::typeName() { return i18n("Launcher"); } -QString ColorContent::typeName() { return i18n("Color"); } -QString UnknownContent::typeName() { return i18n("Unknown"); } - -QString TextContent::lowerTypeName() { return "text"; } -QString HtmlContent::lowerTypeName() { return "html"; } -QString ImageContent::lowerTypeName() { return "image"; } -QString AnimationContent::lowerTypeName() { return "animation"; } -QString SoundContent::lowerTypeName() { return "sound"; } -QString FileContent::lowerTypeName() { return "file"; } -QString LinkContent::lowerTypeName() { return "link"; } -QString LauncherContent::lowerTypeName() { return "launcher"; } -QString ColorContent::lowerTypeName() { return "color"; } -QString UnknownContent::lowerTypeName() { return "unknown"; } - -QString NoteContent::toText(const QString &cuttedFullPath) +TQString TextContent::typeName() { return i18n("Plain Text"); } +TQString HtmlContent::typeName() { return i18n("Text"); } +TQString ImageContent::typeName() { return i18n("Image"); } +TQString AnimationContent::typeName() { return i18n("Animation"); } +TQString SoundContent::typeName() { return i18n("Sound"); } +TQString FileContent::typeName() { return i18n("File"); } +TQString LinkContent::typeName() { return i18n("Link"); } +TQString LauncherContent::typeName() { return i18n("Launcher"); } +TQString ColorContent::typeName() { return i18n("Color"); } +TQString UnknownContent::typeName() { return i18n("Unknown"); } + +TQString TextContent::lowerTypeName() { return "text"; } +TQString HtmlContent::lowerTypeName() { return "html"; } +TQString ImageContent::lowerTypeName() { return "image"; } +TQString AnimationContent::lowerTypeName() { return "animation"; } +TQString SoundContent::lowerTypeName() { return "sound"; } +TQString FileContent::lowerTypeName() { return "file"; } +TQString LinkContent::lowerTypeName() { return "link"; } +TQString LauncherContent::lowerTypeName() { return "launcher"; } +TQString ColorContent::lowerTypeName() { return "color"; } +TQString UnknownContent::lowerTypeName() { return "unknown"; } + +TQString NoteContent::toText(const TQString &cuttedFullPath) { return (cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath); } -QString TextContent::toText(const QString &/*cuttedFullPath*/) { return text(); } -QString HtmlContent::toText(const QString &/*cuttedFullPath*/) { return Tools::htmlToText(html()); } -QString LinkContent::toText(const QString &/*cuttedFullPath*/) +TQString TextContent::toText(const TQString &/*cuttedFullPath*/) { return text(); } +TQString HtmlContent::toText(const TQString &/*cuttedFullPath*/) { return Tools::htmlToText(html()); } +TQString LinkContent::toText(const TQString &/*cuttedFullPath*/) { if (autoTitle()) return url().prettyURL(); @@ -210,70 +210,70 @@ QString LinkContent::toText(const QString &/*cuttedFullPath*/) else if (title().isEmpty()) return url().prettyURL(); else - return QString("%1 <%2>").arg(title(), url().prettyURL()); + return TQString("%1 <%2>").tqarg(title(), url().prettyURL()); } -QString ColorContent::toText(const QString &/*cuttedFullPath*/) { return color().name(); } -QString UnknownContent::toText(const QString &/*cuttedFullPath*/) { return ""; } +TQString ColorContent::toText(const TQString &/*cuttedFullPath*/) { return color().name(); } +TQString UnknownContent::toText(const TQString &/*cuttedFullPath*/) { return ""; } // TODO: If imageName.isEmpty() return fullPath() because it's for external use, else return fileName() because it's to display in a tooltip -QString TextContent::toHtml(const QString &/*imageName*/, const QString &/*cuttedFullPath*/) +TQString TextContent::toHtml(const TQString &/*imageName*/, const TQString &/*cuttedFullPath*/) { return Tools::textToHTMLWithoutP(text()); } -QString HtmlContent::toHtml(const QString &/*imageName*/, const QString &/*cuttedFullPath*/) +TQString HtmlContent::toHtml(const TQString &/*imageName*/, const TQString &/*cuttedFullPath*/) { return Tools::htmlToParagraph(html()); } -QString ImageContent::toHtml(const QString &/*imageName*/, const QString &cuttedFullPath) -{ return QString("<img src=\"%1\">").arg(cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath); } +TQString ImageContent::toHtml(const TQString &/*imageName*/, const TQString &cuttedFullPath) +{ return TQString("<img src=\"%1\">").tqarg(cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath); } -QString AnimationContent::toHtml(const QString &/*imageName*/, const QString &cuttedFullPath) -{ return QString("<img src=\"%1\">").arg(cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath); } +TQString AnimationContent::toHtml(const TQString &/*imageName*/, const TQString &cuttedFullPath) +{ return TQString("<img src=\"%1\">").tqarg(cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath); } -QString SoundContent::toHtml(const QString &/*imageName*/, const QString &cuttedFullPath) -{ return QString("<a href=\"%1\">%2</a>").arg((cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath), fileName()); } // With the icon? +TQString SoundContent::toHtml(const TQString &/*imageName*/, const TQString &cuttedFullPath) +{ return TQString("<a href=\"%1\">%2</a>").tqarg((cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath), fileName()); } // With the icon? -QString FileContent::toHtml(const QString &/*imageName*/, const QString &cuttedFullPath) -{ return QString("<a href=\"%1\">%2</a>").arg((cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath), fileName()); } // With the icon? +TQString FileContent::toHtml(const TQString &/*imageName*/, const TQString &cuttedFullPath) +{ return TQString("<a href=\"%1\">%2</a>").tqarg((cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath), fileName()); } // With the icon? -QString LinkContent::toHtml(const QString &/*imageName*/, const QString &/*cuttedFullPath*/) -{ return QString("<a href=\"%1\">%2</a>").arg(url().prettyURL(), title()); } // With the icon? +TQString LinkContent::toHtml(const TQString &/*imageName*/, const TQString &/*cuttedFullPath*/) +{ return TQString("<a href=\"%1\">%2</a>").tqarg(url().prettyURL(), title()); } // With the icon? -QString LauncherContent::toHtml(const QString &/*imageName*/, const QString &cuttedFullPath) -{ return QString("<a href=\"%1\">%2</a>").arg((cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath), name()); } // With the icon? +TQString LauncherContent::toHtml(const TQString &/*imageName*/, const TQString &cuttedFullPath) +{ return TQString("<a href=\"%1\">%2</a>").tqarg((cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath), name()); } // With the icon? -QString ColorContent::toHtml(const QString &/*imageName*/, const QString &/*cuttedFullPath*/) -{ return QString("<span style=\"color: %1\">%2</span>").arg(color().name(), color().name()); } +TQString ColorContent::toHtml(const TQString &/*imageName*/, const TQString &/*cuttedFullPath*/) +{ return TQString("<span style=\"color: %1\">%2</span>").tqarg(color().name(), color().name()); } -QString UnknownContent::toHtml(const QString &/*imageName*/, const QString &/*cuttedFullPath*/) +TQString UnknownContent::toHtml(const TQString &/*imageName*/, const TQString &/*cuttedFullPath*/) { return ""; } -QPixmap ImageContent::toPixmap() { return pixmap(); } -QPixmap AnimationContent::toPixmap() { return movie().framePixmap(); } +TQPixmap ImageContent::toPixmap() { return pixmap(); } +TQPixmap AnimationContent::toPixmap() { return movie().framePixmap(); } -void NoteContent::toLink(KURL *url, QString *title, const QString &cuttedFullPath) +void NoteContent::toLink(KURL *url, TQString *title, const TQString &cuttedFullPath) { if (useFile()) { *url = KURL(cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath); *title = (cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath); } else { *url = KURL(); - *title = QString(); + *title = TQString(); } } -void LinkContent::toLink(KURL *url, QString *title, const QString &/*cuttedFullPath*/) +void LinkContent::toLink(KURL *url, TQString *title, const TQString &/*cuttedFullPath*/) { *url = this->url(); *title = this->title(); } -void LauncherContent::toLink(KURL *url, QString *title, const QString &cuttedFullPath) +void LauncherContent::toLink(KURL *url, TQString *title, const TQString &cuttedFullPath) { *url = KURL(cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath); *title = name(); } -void UnknownContent::toLink(KURL *url, QString *title, const QString &/*cuttedFullPath*/) +void UnknownContent::toLink(KURL *url, TQString *title, const TQString &/*cuttedFullPath*/) { *url = KURL(); - *title = QString(); + *title = TQString(); } bool TextContent::useFile() { return true; } @@ -298,49 +298,49 @@ bool LauncherContent::canBeSavedAs() { return true; } bool ColorContent::canBeSavedAs() { return false; } bool UnknownContent::canBeSavedAs() { return false; } -QString TextContent::saveAsFilters() { return "text/plain"; } -QString HtmlContent::saveAsFilters() { return "text/html"; } -QString ImageContent::saveAsFilters() { return "image/png"; } // TODO: Offer more types -QString AnimationContent::saveAsFilters() { return "image/gif"; } // TODO: MNG... -QString SoundContent::saveAsFilters() { return "audio/x-mp3"; } // TODO: OGG... -QString FileContent::saveAsFilters() { return "*"; } // TODO: Get MIME type of the url target -QString LinkContent::saveAsFilters() { return "*"; } // TODO: idem File + If isDir(): return -QString LauncherContent::saveAsFilters() { return "application/x-desktop"; } -QString ColorContent::saveAsFilters() { return ""; } -QString UnknownContent::saveAsFilters() { return ""; } - -bool TextContent::match(const FilterData &data) { return (text().find(data.string, /*index=*/0, /*cs=*/false) != -1); } -bool HtmlContent::match(const FilterData &data) { return (m_textEquivalent/*toText("")*/.find(data.string, /*index=*/0, /*cs=*/false) != -1); } //OPTIM_FILTER +TQString TextContent::saveAsFilters() { return "text/plain"; } +TQString HtmlContent::saveAsFilters() { return "text/html"; } +TQString ImageContent::saveAsFilters() { return "image/png"; } // TODO: Offer more types +TQString AnimationContent::saveAsFilters() { return "image/gif"; } // TODO: MNG... +TQString SoundContent::saveAsFilters() { return "audio/x-mp3"; } // TODO: OGG... +TQString FileContent::saveAsFilters() { return "*"; } // TODO: Get MIME type of the url target +TQString LinkContent::saveAsFilters() { return "*"; } // TODO: idem File + If isDir(): return +TQString LauncherContent::saveAsFilters() { return "application/x-desktop"; } +TQString ColorContent::saveAsFilters() { return ""; } +TQString UnknownContent::saveAsFilters() { return ""; } + +bool TextContent::match(const FilterData &data) { return (text().tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); } +bool HtmlContent::match(const FilterData &data) { return (m_textEquivalent/*toText("")*/.tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); } //OPTIM_FILTER bool ImageContent::match(const FilterData &/*data*/) { return false; } bool AnimationContent::match(const FilterData &/*data*/) { return false; } -bool SoundContent::match(const FilterData &data) { return (fileName().find(data.string, /*index=*/0, /*cs=*/false) != -1); } -bool FileContent::match(const FilterData &data) { return (fileName().find(data.string, /*index=*/0, /*cs=*/false) != -1); } -bool LinkContent::match(const FilterData &data) { return (title().find(data.string, 0, false) != -1 || url().prettyURL().find(data.string, 0, false) != -1); } -bool LauncherContent::match(const FilterData &data) { return (exec().find(data.string, 0, false) != -1 || name().find(data.string, 0, false) != -1); } -bool ColorContent::match(const FilterData &data) { return (color().name().find(data.string, /*index=*/0, /*cs=*/false) != -1); } -bool UnknownContent::match(const FilterData &data) { return (mimeTypes().find(data.string, /*index=*/0, /*cs=*/false) != -1); } - -QString TextContent::editToolTipText() { return i18n("Edit this plain text"); } -QString HtmlContent::editToolTipText() { return i18n("Edit this text"); } -QString ImageContent::editToolTipText() { return i18n("Edit this image"); } -QString AnimationContent::editToolTipText() { return i18n("Edit this animation"); } -QString SoundContent::editToolTipText() { return i18n("Edit the file name of this sound"); } -QString FileContent::editToolTipText() { return i18n("Edit the name of this file"); } -QString LinkContent::editToolTipText() { return i18n("Edit this link"); } -QString LauncherContent::editToolTipText() { return i18n("Edit this launcher"); } -QString ColorContent::editToolTipText() { return i18n("Edit this color"); } -QString UnknownContent::editToolTipText() { return i18n("Edit this unknown object"); } - -QString TextContent::cssClass() { return ""; } -QString HtmlContent::cssClass() { return ""; } -QString ImageContent::cssClass() { return ""; } -QString AnimationContent::cssClass() { return ""; } -QString SoundContent::cssClass() { return "sound"; } -QString FileContent::cssClass() { return "file"; } -QString LinkContent::cssClass() { return (LinkLook::lookForURL(m_url) == LinkLook::localLinkLook ? "local" : "network"); } -QString LauncherContent::cssClass() { return "launcher"; } -QString ColorContent::cssClass() { return "" ; } -QString UnknownContent::cssClass() { return ""; } +bool SoundContent::match(const FilterData &data) { return (fileName().tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); } +bool FileContent::match(const FilterData &data) { return (fileName().tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); } +bool LinkContent::match(const FilterData &data) { return (title().tqfind(data.string, 0, false) != -1 || url().prettyURL().tqfind(data.string, 0, false) != -1); } +bool LauncherContent::match(const FilterData &data) { return (exec().tqfind(data.string, 0, false) != -1 || name().tqfind(data.string, 0, false) != -1); } +bool ColorContent::match(const FilterData &data) { return (TQString(color().name()).tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); } +bool UnknownContent::match(const FilterData &data) { return (mimeTypes().tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); } + +TQString TextContent::editToolTipText() { return i18n("Edit this plain text"); } +TQString HtmlContent::editToolTipText() { return i18n("Edit this text"); } +TQString ImageContent::editToolTipText() { return i18n("Edit this image"); } +TQString AnimationContent::editToolTipText() { return i18n("Edit this animation"); } +TQString SoundContent::editToolTipText() { return i18n("Edit the file name of this sound"); } +TQString FileContent::editToolTipText() { return i18n("Edit the name of this file"); } +TQString LinkContent::editToolTipText() { return i18n("Edit this link"); } +TQString LauncherContent::editToolTipText() { return i18n("Edit this launcher"); } +TQString ColorContent::editToolTipText() { return i18n("Edit this color"); } +TQString UnknownContent::editToolTipText() { return i18n("Edit this unknown object"); } + +TQString TextContent::cssClass() { return ""; } +TQString HtmlContent::cssClass() { return ""; } +TQString ImageContent::cssClass() { return ""; } +TQString AnimationContent::cssClass() { return ""; } +TQString SoundContent::cssClass() { return "sound"; } +TQString FileContent::cssClass() { return "file"; } +TQString LinkContent::cssClass() { return (LinkLook::lookForURL(m_url) == LinkLook::localLinkLook ? "local" : "network"); } +TQString LauncherContent::cssClass() { return "launcher"; } +TQString ColorContent::cssClass() { return "" ; } +TQString UnknownContent::cssClass() { return ""; } void TextContent::fontChanged() { setText(text()); } void HtmlContent::fontChanged() { setHtml(html()); } @@ -352,64 +352,64 @@ void LauncherContent::fontChanged() { setLauncher(name(), icon(), exec()); void ColorContent::fontChanged() { setColor(color()); } void UnknownContent::fontChanged() { loadFromFile(/*lazyLoad=*/false); } // TODO: Optimize: setMimeTypes() -//QString TextContent::customOpenCommand() { return (Settings::isTextUseProg() && ! Settings::textProg().isEmpty() ? Settings::textProg() : QString()); } -QString HtmlContent::customOpenCommand() { return (Settings::isHtmlUseProg() && ! Settings::htmlProg().isEmpty() ? Settings::htmlProg() : QString()); } -QString ImageContent::customOpenCommand() { return (Settings::isImageUseProg() && ! Settings::imageProg().isEmpty() ? Settings::imageProg() : QString()); } -QString AnimationContent::customOpenCommand() { return (Settings::isAnimationUseProg() && ! Settings::animationProg().isEmpty() ? Settings::animationProg() : QString()); } -QString SoundContent::customOpenCommand() { return (Settings::isSoundUseProg() && ! Settings::soundProg().isEmpty() ? Settings::soundProg() : QString()); } +//TQString TextContent::customOpenCommand() { return (Settings::isTextUseProg() && ! Settings::textProg().isEmpty() ? Settings::textProg() : TQString()); } +TQString HtmlContent::customOpenCommand() { return (Settings::isHtmlUseProg() && ! Settings::htmlProg().isEmpty() ? Settings::htmlProg() : TQString()); } +TQString ImageContent::customOpenCommand() { return (Settings::isImageUseProg() && ! Settings::imageProg().isEmpty() ? Settings::imageProg() : TQString()); } +TQString AnimationContent::customOpenCommand() { return (Settings::isAnimationUseProg() && ! Settings::animationProg().isEmpty() ? Settings::animationProg() : TQString()); } +TQString SoundContent::customOpenCommand() { return (Settings::isSoundUseProg() && ! Settings::soundProg().isEmpty() ? Settings::soundProg() : TQString()); } -void LinkContent::serialize(QDataStream &stream) { stream << url() << title() << icon() << (Q_UINT64)autoTitle() << (Q_UINT64)autoIcon(); } -void ColorContent::serialize(QDataStream &stream) { stream << color(); } +void LinkContent::serialize(TQDataStream &stream) { stream << url() << title() << icon() << (TQ_UINT64)autoTitle() << (TQ_UINT64)autoIcon(); } +void ColorContent::serialize(TQDataStream &stream) { stream << color(); } -QPixmap TextContent::feedbackPixmap(int width, int height) +TQPixmap TextContent::feedbackPixmap(int width, int height) { - QRect textRect = QFontMetrics(note()->font()).boundingRect(0, 0, width, height, Qt::AlignAuto | Qt::AlignTop | Qt::WordBreak, text()); - QPixmap pixmap( QMIN(width, textRect.width()), QMIN(height, textRect.height()) ); + TQRect textRect = TQFontMetrics(note()->font()).boundingRect(0, 0, width, height, TQt::AlignAuto | TQt::AlignTop | TQt::WordBreak, text()); + TQPixmap pixmap( TQMIN(width, textRect.width()), TQMIN(height, textRect.height()) ); pixmap.fill(note()->backgroundColor().dark(FEEDBACK_DARKING)); - QPainter painter(&pixmap); + TQPainter painter(&pixmap); painter.setPen(note()->textColor()); painter.setFont(note()->font()); - painter.drawText(0, 0, pixmap.width(), pixmap.height(), Qt::AlignAuto | Qt::AlignTop | Qt::WordBreak, text()); + painter.drawText(0, 0, pixmap.width(), pixmap.height(), TQt::AlignAuto | TQt::AlignTop | TQt::WordBreak, text()); painter.end(); return pixmap; } -QPixmap HtmlContent::feedbackPixmap(int width, int height) +TQPixmap HtmlContent::feedbackPixmap(int width, int height) { - QSimpleRichText richText(html(), note()->font()); + TQSimpleRichText richText(html(), note()->font()); richText.setWidth(width); - QColorGroup colorGroup(basket()->colorGroup()); - colorGroup.setColor(QColorGroup::Text, note()->textColor()); - colorGroup.setColor(QColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); - QPixmap pixmap( QMIN(width, richText.widthUsed()), QMIN(height, richText.height()) ); + TQColorGroup tqcolorGroup(basket()->tqcolorGroup()); + tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor()); + tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); + TQPixmap pixmap( TQMIN(width, richText.widthUsed()), TQMIN(height, richText.height()) ); pixmap.fill(note()->backgroundColor().dark(FEEDBACK_DARKING)); - QPainter painter(&pixmap); + TQPainter painter(&pixmap); painter.setPen(note()->textColor()); - richText.draw(&painter, 0, 0, QRect(0, 0, pixmap.width(), pixmap.height()), colorGroup); + richText.draw(&painter, 0, 0, TQRect(0, 0, pixmap.width(), pixmap.height()), tqcolorGroup); painter.end(); return pixmap; } -QPixmap ImageContent::feedbackPixmap(int width, int height) +TQPixmap ImageContent::feedbackPixmap(int width, int height) { if (width >= m_pixmap.width() && height >= m_pixmap.height()) { // Full size if (m_pixmap.hasAlpha()) { - QPixmap opaque(m_pixmap.width(), m_pixmap.height()); + TQPixmap opaque(m_pixmap.width(), m_pixmap.height()); opaque.fill(note()->backgroundColor().dark(FEEDBACK_DARKING)); - QPainter painter(&opaque); + TQPainter painter(&opaque); painter.drawPixmap(0, 0, m_pixmap); painter.end(); return opaque; } else return m_pixmap; } else { // Scalled down - QImage imageToScale = m_pixmap.convertToImage(); - QPixmap pmScaled; - pmScaled.convertFromImage(imageToScale./*smoothScale*/scale(width, height, QImage::ScaleMin)); + TQImage imageToScale = m_pixmap.convertToImage(); + TQPixmap pmScaled; + pmScaled.convertFromImage(imageToScale./*smoothScale*/scale(width, height, TQ_ScaleMin)); if (pmScaled.hasAlpha()) { - QPixmap opaque(pmScaled.width(), pmScaled.height()); + TQPixmap opaque(pmScaled.width(), pmScaled.height()); opaque.fill(note()->backgroundColor().dark(FEEDBACK_DARKING)); - QPainter painter(&opaque); + TQPainter painter(&opaque); painter.drawPixmap(0, 0, pmScaled); painter.end(); return opaque; @@ -418,73 +418,73 @@ QPixmap ImageContent::feedbackPixmap(int width, int height) } } -QPixmap AnimationContent::feedbackPixmap(int width, int height) +TQPixmap AnimationContent::feedbackPixmap(int width, int height) { - QPixmap pixmap = m_movie.framePixmap(); + TQPixmap pixmap = m_movie.framePixmap(); if (width >= pixmap.width() && height >= pixmap.height()) // Full size return pixmap; else { // Scalled down - QImage imageToScale = pixmap.convertToImage(); - QPixmap pmScaled; - pmScaled.convertFromImage(imageToScale./*smoothScale*/scale(width, height, QImage::ScaleMin)); + TQImage imageToScale = pixmap.convertToImage(); + TQPixmap pmScaled; + pmScaled.convertFromImage(imageToScale./*smoothScale*/scale(width, height, TQ_ScaleMin)); return pmScaled; } } -QPixmap LinkContent::feedbackPixmap(int width, int height) +TQPixmap LinkContent::feedbackPixmap(int width, int height) { - QColorGroup colorGroup(basket()->colorGroup()); - colorGroup.setColor(QColorGroup::Text, note()->textColor()); - colorGroup.setColor(QColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); - return m_linkDisplay.feedbackPixmap(width, height, colorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor()); + TQColorGroup tqcolorGroup(basket()->tqcolorGroup()); + tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor()); + tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); + return m_linkDisplay.feedbackPixmap(width, height, tqcolorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor()); } -QPixmap ColorContent::feedbackPixmap(int width, int height) +TQPixmap ColorContent::feedbackPixmap(int width, int height) { // TODO: Duplicate code: make a rect() method! - QRect textRect = QFontMetrics(note()->font()).boundingRect(color().name()); + TQRect textRect = TQFontMetrics(note()->font()).boundingRect(color().name()); int rectHeight = (textRect.height() + 2)*3/2; int rectWidth = rectHeight * 14 / 10; // 1.4 times the height, like A4 papers. - QColorGroup colorGroup(basket()->colorGroup()); - colorGroup.setColor(QColorGroup::Text, note()->textColor()); - colorGroup.setColor(QColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); + TQColorGroup tqcolorGroup(basket()->tqcolorGroup()); + tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor()); + tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); - QPixmap pixmap( QMIN(width, rectWidth + RECT_MARGIN + textRect.width() + RECT_MARGIN), QMIN(height, rectHeight) ); + TQPixmap pixmap( TQMIN(width, rectWidth + RECT_MARGIN + textRect.width() + RECT_MARGIN), TQMIN(height, rectHeight) ); pixmap.fill(note()->backgroundColor().dark(FEEDBACK_DARKING)); - QPainter painter(&pixmap); - paint(&painter, pixmap.width(), pixmap.height(), colorGroup, false, false, false); // We don't care of the three last boolean parameters. + TQPainter painter(&pixmap); + paint(&painter, pixmap.width(), pixmap.height(), tqcolorGroup, false, false, false); // We don't care of the three last boolean parameters. painter.end(); return pixmap; } -QPixmap FileContent::feedbackPixmap(int width, int height) +TQPixmap FileContent::feedbackPixmap(int width, int height) { - QColorGroup colorGroup(basket()->colorGroup()); - colorGroup.setColor(QColorGroup::Text, note()->textColor()); - colorGroup.setColor(QColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); - return m_linkDisplay.feedbackPixmap(width, height, colorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor()); + TQColorGroup tqcolorGroup(basket()->tqcolorGroup()); + tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor()); + tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); + return m_linkDisplay.feedbackPixmap(width, height, tqcolorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor()); } -QPixmap LauncherContent::feedbackPixmap(int width, int height) +TQPixmap LauncherContent::feedbackPixmap(int width, int height) { - QColorGroup colorGroup(basket()->colorGroup()); - colorGroup.setColor(QColorGroup::Text, note()->textColor()); - colorGroup.setColor(QColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); - return m_linkDisplay.feedbackPixmap(width, height, colorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor()); + TQColorGroup tqcolorGroup(basket()->tqcolorGroup()); + tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor()); + tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); + return m_linkDisplay.feedbackPixmap(width, height, tqcolorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor()); } -QPixmap UnknownContent::feedbackPixmap(int width, int height) +TQPixmap UnknownContent::feedbackPixmap(int width, int height) { - QRect textRect = QFontMetrics(note()->font()).boundingRect(0, 0, /*width=*/1, 500000, Qt::AlignAuto | Qt::AlignTop | Qt::WordBreak, m_mimeTypes); + TQRect textRect = TQFontMetrics(note()->font()).boundingRect(0, 0, /*width=*/1, 500000, TQt::AlignAuto | TQt::AlignTop | TQt::WordBreak, m_mimeTypes); - QColorGroup colorGroup(basket()->colorGroup()); - colorGroup.setColor(QColorGroup::Text, note()->textColor()); - colorGroup.setColor(QColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); + TQColorGroup tqcolorGroup(basket()->tqcolorGroup()); + tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor()); + tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); - QPixmap pixmap( QMIN(width, DECORATION_MARGIN + textRect.width() + DECORATION_MARGIN), QMIN(height, DECORATION_MARGIN + textRect.height() + DECORATION_MARGIN) ); - QPainter painter(&pixmap); - paint(&painter, pixmap.width() + 1, pixmap.height(), colorGroup, false, false, false); // We don't care of the three last boolean parameters. + TQPixmap pixmap( TQMIN(width, DECORATION_MARGIN + textRect.width() + DECORATION_MARGIN), TQMIN(height, DECORATION_MARGIN + textRect.height() + DECORATION_MARGIN) ); + TQPainter painter(&pixmap); + paint(&painter, pixmap.width() + 1, pixmap.height(), tqcolorGroup, false, false, false); // We don't care of the three last boolean parameters. painter.setPen(note()->backgroundColor().dark(FEEDBACK_DARKING)); painter.drawPoint(0, 0); painter.drawPoint(pixmap.width() - 1, 0); @@ -498,8 +498,8 @@ QPixmap UnknownContent::feedbackPixmap(int width, int height) /** class TextContent: */ -TextContent::TextContent(Note *parent, const QString &fileName, bool lazyLoad) - : NoteContent(parent, fileName), m_simpleRichText(0) +TextContent::TextContent(Note *tqparent, const TQString &fileName, bool lazyLoad) + : NoteContent(tqparent, fileName), m_simpleRichText(0) { basket()->addWatchedFile(fullPath()); loadFromFile(lazyLoad); @@ -520,11 +520,11 @@ int TextContent::setWidthAndGetHeight(int width) return 10; // Lazy loaded } -void TextContent::paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) +void TextContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) { if (m_simpleRichText) { width -= 1; - m_simpleRichText->draw(painter, 0, 0, QRect(0, 0, width, height), colorGroup); + m_simpleRichText->draw(painter, 0, 0, TQRect(0, 0, width, height), tqcolorGroup); } } @@ -532,7 +532,7 @@ bool TextContent::loadFromFile(bool lazyLoad) { DEBUG_WIN << "Loading TextContent From " + basket()->folderName() + fileName(); - QString content; + TQString content; bool success = basket()->loadFromFile(fullPath(), &content, /*isLocalEncoding=*/true); if (success) @@ -540,7 +540,7 @@ bool TextContent::loadFromFile(bool lazyLoad) else { std::cout << "FAILED TO LOAD TextContent: " << fullPath() << std::endl; setText("", lazyLoad); - if (!QFile::exists(fullPath())) + if (!TQFile::exists(fullPath())) saveToFile(); // Reserve the fileName so no new note will have the same name! } return success; @@ -550,8 +550,8 @@ bool TextContent::finishLazyLoad() { int width = (m_simpleRichText ? m_simpleRichText->width() : 1); delete m_simpleRichText; - QString html = "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" + Tools::tagURLs(Tools::textToHTML(m_text)); // Don't collapse multiple spaces! - m_simpleRichText = new QSimpleRichText(html, note()->font()); + TQString html = "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" + Tools::tagURLs(Tools::textToHTML(m_text)); // Don't collapse multiple spaces! + m_simpleRichText = new TQSimpleRichText(html, note()->font()); m_simpleRichText->setWidth(1); // We put a width of 1 pixel, so usedWidth() is egual to the minimum width int minWidth = m_simpleRichText->widthUsed(); m_simpleRichText->setWidth(width); @@ -565,7 +565,7 @@ bool TextContent::saveToFile() return basket()->saveToFile(fullPath(), text(), /*isLocalEncoding=*/true); } -QString TextContent::linkAt(const QPoint &pos) +TQString TextContent::linkAt(const TQPoint &pos) { if (m_simpleRichText) return m_simpleRichText->anchorAt(pos); @@ -574,7 +574,7 @@ QString TextContent::linkAt(const QPoint &pos) } -QString TextContent::messageWhenOpenning(OpenMessage where) +TQString TextContent::messageWhenOpenning(OpenMessage where) { switch (where) { case OpenOne: return i18n("Opening plain text..."); @@ -587,7 +587,7 @@ QString TextContent::messageWhenOpenning(OpenMessage where) } } -void TextContent::setText(const QString &text, bool lazyLoad) +void TextContent::setText(const TQString &text, bool lazyLoad) { m_text = text; if (!lazyLoad) @@ -598,17 +598,17 @@ void TextContent::setText(const QString &text, bool lazyLoad) void TextContent::exportToHTML(HTMLExporter *exporter, int indent) { - QString spaces; - QString html = "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" + - Tools::tagURLs(Tools::textToHTMLWithoutP(text().replace("\t", " "))); // Don't collapse multiple spaces! - exporter->stream << html.replace(" ", " ").replace("\n", "\n" + spaces.fill(' ', indent + 1)); + TQString spaces; + TQString html = "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" + + Tools::tagURLs(Tools::textToHTMLWithoutP(text().tqreplace("\t", " "))); // Don't collapse multiple spaces! + exporter->stream << html.tqreplace(" ", " ").tqreplace("\n", "\n" + spaces.fill(' ', indent + 1)); } /** class HtmlContent: */ -HtmlContent::HtmlContent(Note *parent, const QString &fileName, bool lazyLoad) - : NoteContent(parent, fileName), m_simpleRichText(0) +HtmlContent::HtmlContent(Note *tqparent, const TQString &fileName, bool lazyLoad) + : NoteContent(tqparent, fileName), m_simpleRichText(0) { basket()->addWatchedFile(fullPath()); loadFromFile(lazyLoad); @@ -629,11 +629,11 @@ int HtmlContent::setWidthAndGetHeight(int width) return 10; // Lazy loaded } -void HtmlContent::paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) +void HtmlContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) { if (m_simpleRichText) { width -= 1; - m_simpleRichText->draw(painter, 0, 0, QRect(0, 0, width, height), colorGroup); + m_simpleRichText->draw(painter, 0, 0, TQRect(0, 0, width, height), tqcolorGroup); } } @@ -641,7 +641,7 @@ bool HtmlContent::loadFromFile(bool lazyLoad) { DEBUG_WIN << "Loading HtmlContent From " + basket()->folderName() + fileName(); - QString content; + TQString content; bool success = basket()->loadFromFile(fullPath(), &content, /*isLocalEncoding=*/true); if (success) @@ -649,7 +649,7 @@ bool HtmlContent::loadFromFile(bool lazyLoad) else { std::cout << "FAILED TO LOAD HtmlContent: " << fullPath() << std::endl; setHtml("", lazyLoad); - if (!QFile::exists(fullPath())) + if (!TQFile::exists(fullPath())) saveToFile(); // Reserve the fileName so no new note will have the same name! } return success; @@ -659,7 +659,7 @@ bool HtmlContent::finishLazyLoad() { int width = (m_simpleRichText ? m_simpleRichText->width() : 1); delete m_simpleRichText; - m_simpleRichText = new QSimpleRichText(Tools::tagURLs(m_html), note()->font()); + m_simpleRichText = new TQSimpleRichText(Tools::tagURLs(m_html), note()->font()); m_simpleRichText->setWidth(1); // We put a width of 1 pixel, so usedWidth() is egual to the minimum width int minWidth = m_simpleRichText->widthUsed(); m_simpleRichText->setWidth(width); @@ -673,7 +673,7 @@ bool HtmlContent::saveToFile() return basket()->saveToFile(fullPath(), html(), /*isLocalEncoding=*/true); } -QString HtmlContent::linkAt(const QPoint &pos) +TQString HtmlContent::linkAt(const TQPoint &pos) { if (m_simpleRichText) return m_simpleRichText->anchorAt(pos); @@ -682,7 +682,7 @@ QString HtmlContent::linkAt(const QPoint &pos) } -QString HtmlContent::messageWhenOpenning(OpenMessage where) +TQString HtmlContent::messageWhenOpenning(OpenMessage where) { switch (where) { case OpenOne: return i18n("Opening text..."); @@ -695,7 +695,7 @@ QString HtmlContent::messageWhenOpenning(OpenMessage where) } } -void HtmlContent::setHtml(const QString &html, bool lazyLoad) +void HtmlContent::setHtml(const TQString &html, bool lazyLoad) { m_html = html; m_textEquivalent = toText(""); //OPTIM_FILTER @@ -707,17 +707,17 @@ void HtmlContent::setHtml(const QString &html, bool lazyLoad) void HtmlContent::exportToHTML(HTMLExporter *exporter, int indent) { - QString spaces; - exporter->stream << Tools::htmlToParagraph(Tools::tagURLs(html().replace("\t", " "))) - .replace(" ", " ") - .replace("\n", "\n" + spaces.fill(' ', indent + 1)); + TQString spaces; + exporter->stream << Tools::htmlToParagraph(Tools::tagURLs(html().tqreplace("\t", " "))) + .tqreplace(" ", " ") + .tqreplace("\n", "\n" + spaces.fill(' ', indent + 1)); } /** class ImageContent: */ -ImageContent::ImageContent(Note *parent, const QString &fileName, bool lazyLoad) - : NoteContent(parent, fileName), m_format(0) +ImageContent::ImageContent(Note *tqparent, const TQString &fileName, bool lazyLoad) + : NoteContent(tqparent, fileName), m_format(0) { basket()->addWatchedFile(fullPath()); loadFromFile(lazyLoad); @@ -735,7 +735,7 @@ int ImageContent::setWidthAndGetHeight(int width) } } -void ImageContent::paint(QPainter *painter, int width, int /*height*/, const QColorGroup &/*colorGroup*/, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) +void ImageContent::paint(TQPainter *painter, int width, int /*height*/, const TQColorGroup &/*tqcolorGroup*/, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) { width -= 1; // KPixmap pixmap = m_pixmap; @@ -763,14 +763,14 @@ bool ImageContent::finishLazyLoad() { DEBUG_WIN << "Loading ImageContent From " + basket()->folderName() + fileName(); - QByteArray content; + TQByteArray content; if (basket()->loadFromFile(fullPath(), &content)) { - QBuffer buffer(content); + TQBuffer buffer(content); buffer.open(IO_ReadOnly); - m_format = (char* /* from const char* */)QImageIO::imageFormat(&buffer); // See QImageIO to know what formats can be supported. + m_format = (char* /* from const char* */)TQImageIO::imageFormat(TQT_TQIODEVICE(&buffer)); // See TQImageIO to know what formats can be supported. buffer.close(); if (m_format) { m_pixmap.loadFromData(content); @@ -785,15 +785,15 @@ bool ImageContent::finishLazyLoad() m_pixmap.fill(); m_pixmap.setMask(m_pixmap.createHeuristicMask()); setPixmap(m_pixmap); - if (!QFile::exists(fullPath())) + if (!TQFile::exists(fullPath())) saveToFile(); // Reserve the fileName so no new note will have the same name! return false; } bool ImageContent::saveToFile() { - QByteArray ba; - QBuffer buffer(ba); + TQByteArray ba; + TQBuffer buffer(ba); buffer.open(IO_WriteOnly); m_pixmap.save(&buffer, m_format); @@ -801,13 +801,13 @@ bool ImageContent::saveToFile() } -void ImageContent::toolTipInfos(QStringList *keys, QStringList *values) +void ImageContent::toolTipInfos(TQStringList *keys, TQStringList *values) { keys->append(i18n("Size")); - values->append(i18n("%1 by %2 pixels").arg(QString::number(m_pixmap.width()), QString::number(m_pixmap.height()))); + values->append(i18n("%1 by %2 pixels").tqarg(TQString::number(m_pixmap.width()), TQString::number(m_pixmap.height()))); } -QString ImageContent::messageWhenOpenning(OpenMessage where) +TQString ImageContent::messageWhenOpenning(OpenMessage where) { switch (where) { case OpenOne: return i18n("Opening image..."); @@ -820,7 +820,7 @@ QString ImageContent::messageWhenOpenning(OpenMessage where) } } -void ImageContent::setPixmap(const QPixmap &pixmap) +void ImageContent::setPixmap(const TQPixmap &pixmap) { m_pixmap = pixmap; // Since it's scalled, the height is always greater or equal to the size of the tag emblems (16) @@ -833,7 +833,7 @@ void ImageContent::exportToHTML(HTMLExporter *exporter, int /*indent*/) int height = m_pixmap.height(); int contentWidth = note()->width() - note()->contentX() - 1 - Note::NOTE_MARGIN; - QString imageName = exporter->copyFile(fullPath(), /*createIt=*/true); + TQString imageName = exporter->copyFile(fullPath(), /*createIt=*/true); if (contentWidth <= m_pixmap.width()) { // Scalled down double scale = ((double)contentWidth) / m_pixmap.width(); @@ -854,8 +854,8 @@ void ImageContent::exportToHTML(HTMLExporter *exporter, int /*indent*/) int AnimationContent::INVALID_STATUS = -100; -AnimationContent::AnimationContent(Note *parent, const QString &fileName, bool lazyLoad) - : NoteContent(parent, fileName), m_oldStatus(INVALID_STATUS) +AnimationContent::AnimationContent(Note *tqparent, const TQString &fileName, bool lazyLoad) + : NoteContent(tqparent, fileName), m_oldtqStatus(INVALID_STATUS) { basket()->addWatchedFile(fullPath()); loadFromFile(lazyLoad); @@ -867,11 +867,11 @@ int AnimationContent::setWidthAndGetHeight(int /*width*/) return m_movie.framePixmap().height() ; // TODO!!! } -void AnimationContent::paint(QPainter *painter, int width, int /*height*/, const QColorGroup &/*colorGroup*/, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) +void AnimationContent::paint(TQPainter *painter, int width, int /*height*/, const TQColorGroup &/*tqcolorGroup*/, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) { /*width -= 1*/; // DEBUG_WIN << "AnimationContent::paint()"; - const QPixmap &frame = m_movie.framePixmap(); + const TQPixmap &frame = m_movie.framePixmap(); if (width >= frame.width()) // Full size painter->drawPixmap(0, 0, frame); else // Scalled down @@ -889,14 +889,14 @@ bool AnimationContent::loadFromFile(bool lazyLoad) bool AnimationContent::finishLazyLoad() { DEBUG_WIN << "Loading MovieContent From " + basket()->folderName() + fileName(); -// return setMovie(QMovie(fullPath())); +// return setMovie(TQMovie(fullPath())); bool success = false; - QByteArray content; + TQByteArray content; if (basket()->loadFromFile(fullPath(), &content)) - success = setMovie(QMovie(content, content.size())); + success = setMovie(TQMovie(content, content.size())); if (!success) - setMovie(QMovie()); + setMovie(TQMovie()); return success; } @@ -907,7 +907,7 @@ bool AnimationContent::saveToFile() } -QString AnimationContent::messageWhenOpenning(OpenMessage where) +TQString AnimationContent::messageWhenOpenning(OpenMessage where) { switch (where) { case OpenOne: return i18n("Opening animation..."); @@ -920,79 +920,79 @@ QString AnimationContent::messageWhenOpenning(OpenMessage where) } } -bool AnimationContent::setMovie(const QMovie &movie) +bool AnimationContent::setMovie(const TQMovie &movie) { if (!m_movie.isNull()) { // Disconnect? return false; } m_movie = movie; - m_movie.connectUpdate( this, SLOT(movieUpdated(const QRect&)) ); - m_movie.connectResize( this, SLOT(movieResized(const QSize&)) ); - m_movie.connectStatus( this, SLOT(movieStatus(int)) ); + m_movie.connectUpdate( this, TQT_SLOT(movieUpdated(const TQRect&)) ); + m_movie.connectResize( this, TQT_SLOT(movieResized(const TQSize&)) ); + m_movie.connectStatus( this, TQT_SLOT(movietqStatus(int)) ); contentChanged( m_movie.framePixmap().width() + 1 ); // TODO return true; } -void AnimationContent::movieUpdated(const QRect&) +void AnimationContent::movieUpdated(const TQRect&) { note()->unbufferize(); note()->update(); } -void AnimationContent::movieResized(const QSize&) +void AnimationContent::movieResized(const TQSize&) { - note()->requestRelayout(); // ? + note()->requestRetqlayout(); // ? } /** When a user drop a .gif file, for instance, we don't know if it is an image * or an animtion (gif file contain multiple images). * To determin that, we assume this is an animation and count the number of images. - * QMovie send, in this order: - * - For a unique image: QMovie::EndOfFrame, QMovie::EndOfLoop, QMovie::EndOfMovie. - * - For animation: QMovie::EndOfFrame... (for each image), QMovie::EndOfLoop, + * TQMovie send, in this order: + * - For a unique image: TQMovie::EndOfFrame, TQMovie::EndOfLoop, TQMovie::EndOfMovie. + * - For animation: TQMovie::EndOfFrame... (for each image), TQMovie::EndOfLoop, * and it then restart that for each loop. */ -void AnimationContent::movieStatus(int status) +void AnimationContent::movietqStatus(int status) { - DEBUG_WIN << "movieStatus()"; + DEBUG_WIN << "movietqStatus()"; // At least two frames: it's an animation, everything is OK - if (m_oldStatus == QMovie::EndOfFrame && status == QMovie::EndOfFrame) { + if (m_oldtqStatus == TQMovie::EndOfFrame && status == TQMovie::EndOfFrame) { movie().disconnectStatus(this); - m_oldStatus = INVALID_STATUS; + m_oldtqStatus = INVALID_STATUS; // if (note()->isFocused()) // When inserting a new note we ensure it visble // basket()->ensureNoteVisible(note()); // But after loading it has certainly grown and if it was } // Only one image: it's an image, change note's type - else if (m_oldStatus == QMovie::EndOfFrame && status == QMovie::EndOfLoop) { + else if (m_oldtqStatus == TQMovie::EndOfFrame && status == TQMovie::EndOfLoop) { movie().disconnectStatus(this); - m_oldStatus = INVALID_STATUS; + m_oldtqStatus = INVALID_STATUS; note()->setContent(new ImageContent(note(), fileName())); basket()->save(); //delete this; // CRASH, as always !!!!!!!!! - //QTimer::singleShot(0, this, SLOT(loadContent())); // Delayed to avoid crash! - //QTimer::singleShot(100, this, SLOT(saveProperties())); // We should save it's an image and not an animation + //TQTimer::singleShot(0, this, TQT_SLOT(loadContent())); // Delayed to avoid crash! + //TQTimer::singleShot(100, this, TQT_SLOT(saveProperties())); // We should save it's an image and not an animation // if (note()->isFocused()) -// QTimer::singleShot(25, note(), SLOT(delayedEnsureVisible())); +// TQTimer::singleShot(25, note(), TQT_SLOT(delayedEnsureVisible())); } else - m_oldStatus = status; + m_oldtqStatus = status; } void AnimationContent::exportToHTML(HTMLExporter *exporter, int /*indent*/) { - exporter->stream << QString("<img src=\"%1\" width=\"%2\" height=\"%3\" alt=\"\">") - .arg( exporter->dataFolderName + exporter->copyFile(fullPath(), /*createIt=*/true), - QString::number(movie().framePixmap().size().width()), - QString::number(movie().framePixmap().size().height()) ); + exporter->stream << TQString("<img src=\"%1\" width=\"%2\" height=\"%3\" alt=\"\">") + .tqarg( exporter->dataFolderName + exporter->copyFile(fullPath(), /*createIt=*/true), + TQString::number(movie().framePixmap().size().width()), + TQString::number(movie().framePixmap().size().height()) ); } /** class FileContent: */ -FileContent::FileContent(Note *parent, const QString &fileName) - : NoteContent(parent, fileName), m_previewJob(0) +FileContent::FileContent(Note *tqparent, const TQString &fileName) + : NoteContent(tqparent, fileName), m_previewJob(0) { basket()->addWatchedFile(fullPath()); setFileName(fileName); // FIXME: TO THAT HERE BECAUSE NoteContent() constructor seems to don't be able to call virtual methods??? @@ -1004,9 +1004,9 @@ int FileContent::setWidthAndGetHeight(int width) return m_linkDisplay.height(); } -void FileContent::paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered) +void FileContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered) { - m_linkDisplay.paint(painter, 0, 0, width, height, colorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0); + m_linkDisplay.paint(painter, 0, 0, width, height, tqcolorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0); } bool FileContent::loadFromFile(bool /*lazyLoad*/) @@ -1015,11 +1015,11 @@ bool FileContent::loadFromFile(bool /*lazyLoad*/) return true; } -void FileContent::toolTipInfos(QStringList *keys, QStringList *values) +void FileContent::toolTipInfos(TQStringList *keys, TQStringList *values) { // Get the size of the file: - uint size = QFileInfo(fullPath()).size(); - QString humanFileSize = KIO::convertSize((KIO::filesize_t)size); + uint size = TQFileInfo(fullPath()).size(); + TQString humanFileSize = KIO::convertSize((KIO::filesize_t)size); keys->append(i18n("Size")); values->append(humanFileSize); @@ -1032,9 +1032,9 @@ void FileContent::toolTipInfos(QStringList *keys, QStringList *values) KFileMetaInfo infos = KFileMetaInfo(KURL(fullPath())); if (infos.isValid() && !infos.isEmpty()) { - QStringList groups = infos.preferredKeys(); + TQStringList groups = infos.preferredKeys(); int i = 0; - for (QStringList::Iterator it = groups.begin(); i < 6 && it != groups.end(); ++it) { + for (TQStringList::Iterator it = groups.begin(); i < 6 && it != groups.end(); ++it) { KFileMetaInfoItem metaInfoItem = infos.item(*it); if (!metaInfoItem.string().isEmpty()) { keys->append(metaInfoItem.translatedKey()); @@ -1045,32 +1045,32 @@ void FileContent::toolTipInfos(QStringList *keys, QStringList *values) } } -int FileContent::zoneAt(const QPoint &pos) +int FileContent::zoneAt(const TQPoint &pos) { return (m_linkDisplay.iconButtonAt(pos) ? 0 : Note::Custom0); } -QRect FileContent::zoneRect(int zone, const QPoint &/*pos*/) +TQRect FileContent::zoneRect(int zone, const TQPoint &/*pos*/) { - QRect linkRect = m_linkDisplay.iconButtonRect(); + TQRect linkRect = m_linkDisplay.iconButtonRect(); if (zone == Note::Custom0) - return QRect(linkRect.width(), 0, note()->width(), note()->height()); // Too wide and height, but it will be clipped by Note::zoneRect() + return TQRect(linkRect.width(), 0, note()->width(), note()->height()); // Too wide and height, but it will be clipped by Note::zoneRect() else if (zone == Note::Content) return linkRect; else - return QRect(); + return TQRect(); } -QString FileContent::zoneTip(int zone) +TQString FileContent::zoneTip(int zone) { - return (zone == Note::Custom0 ? i18n("Open this file") : QString()); + return (zone == Note::Custom0 ? i18n("Open this file") : TQString()); } -void FileContent::setCursor(QWidget *widget, int zone) +void FileContent::setCursor(TQWidget *widget, int zone) { if (zone == Note::Custom0) - widget->setCursor(Qt::PointingHandCursor); + widget->setCursor(TQt::PointingHandCursor); } @@ -1080,7 +1080,7 @@ int FileContent::xEditorIndent() } -QString FileContent::messageWhenOpenning(OpenMessage where) +TQString FileContent::messageWhenOpenning(OpenMessage where) { switch (where) { case OpenOne: return i18n("Opening file..."); @@ -1093,14 +1093,14 @@ QString FileContent::messageWhenOpenning(OpenMessage where) } } -void FileContent::setFileName(const QString &fileName) +void FileContent::setFileName(const TQString &fileName) { NoteContent::setFileName(fileName); KURL url = KURL(fullPath()); if (linkLook()->previewEnabled()) m_linkDisplay.setLink(fileName, NoteFactory::iconForURL(url), linkLook(), note()->font()); // FIXME: move iconForURL outside of NoteFactory !!!!! else - m_linkDisplay.setLink(fileName, NoteFactory::iconForURL(url), QPixmap(), linkLook(), note()->font()); + m_linkDisplay.setLink(fileName, NoteFactory::iconForURL(url), TQPixmap(), linkLook(), note()->font()); startFetchingUrlPreview(); contentChanged(m_linkDisplay.minWidth()); } @@ -1112,16 +1112,16 @@ void FileContent::linkLookChanged() //startFetchingUrlPreview(); } -void FileContent::newPreview(const KFileItem*, const QPixmap &preview) +void FileContent::newPreview(const KFileItem*, const TQPixmap &preview) { LinkLook *linkLook = this->linkLook(); - m_linkDisplay.setLink(fileName(), NoteFactory::iconForURL(KURL(fullPath())), (linkLook->previewEnabled() ? preview : QPixmap()), linkLook, note()->font()); + m_linkDisplay.setLink(fileName(), NoteFactory::iconForURL(KURL(fullPath())), (linkLook->previewEnabled() ? preview : TQPixmap()), linkLook, note()->font()); contentChanged(m_linkDisplay.minWidth()); } void FileContent::removePreview(const KFileItem*) { - newPreview(0, QPixmap()); + newPreview(0, TQPixmap()); } void FileContent::startFetchingUrlPreview() @@ -1135,31 +1135,31 @@ void FileContent::startFetchingUrlPreview() KURL::List urlList; urlList.append(filteredUrl); m_previewJob = KIO::filePreview(urlList, linkLook->previewSize(), linkLook->previewSize(), linkLook->iconSize()); - connect( m_previewJob, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)), this, SLOT(newPreview(const KFileItem*, const QPixmap&)) ); - connect( m_previewJob, SIGNAL(failed(const KFileItem*)), this, SLOT(removePreview(const KFileItem*)) ); + connect( m_previewJob, TQT_SIGNAL(gotPreview(const KFileItem*, const TQPixmap&)), this, TQT_SLOT(newPreview(const KFileItem*, const TQPixmap&)) ); + connect( m_previewJob, TQT_SIGNAL(failed(const KFileItem*)), this, TQT_SLOT(removePreview(const KFileItem*)) ); } } void FileContent::exportToHTML(HTMLExporter *exporter, int indent) { - QString spaces; - QString fileName = exporter->copyFile(fullPath(), true); - exporter->stream << m_linkDisplay.toHtml(exporter, KURL(exporter->dataFolderName + fileName), "").replace("\n", "\n" + spaces.fill(' ', indent + 1)); + TQString spaces; + TQString fileName = exporter->copyFile(fullPath(), true); + exporter->stream << m_linkDisplay.toHtml(exporter, KURL(exporter->dataFolderName + fileName), "").tqreplace("\n", "\n" + spaces.fill(' ', indent + 1)); } /** class SoundContent: */ -SoundContent::SoundContent(Note *parent, const QString &fileName) - : FileContent(parent, fileName) +SoundContent::SoundContent(Note *tqparent, const TQString &fileName) + : FileContent(tqparent, fileName) { setFileName(fileName); // FIXME: TO THAT HERE BECAUSE NoteContent() constructor seems to don't be able to call virtual methods??? } -QString SoundContent::zoneTip(int zone) +TQString SoundContent::zoneTip(int zone) { - return (zone == Note::Custom0 ? i18n("Open this sound") : QString()); + return (zone == Note::Custom0 ? i18n("Open this sound") : TQString()); } void SoundContent::setHoveredZone(int oldZone, int newZone) @@ -1193,7 +1193,7 @@ void SoundContent::setHoveredZone(int oldZone, int newZone) } -QString SoundContent::messageWhenOpenning(OpenMessage where) +TQString SoundContent::messageWhenOpenning(OpenMessage where) { switch (where) { case OpenOne: return i18n("Opening sound..."); @@ -1209,8 +1209,8 @@ QString SoundContent::messageWhenOpenning(OpenMessage where) /** class LinkContent: */ -LinkContent::LinkContent(Note *parent, const KURL &url, const QString &title, const QString &icon, bool autoTitle, bool autoIcon) - : NoteContent(parent), m_previewJob(0) +LinkContent::LinkContent(Note *tqparent, const KURL &url, const TQString &title, const TQString &icon, bool autoTitle, bool autoIcon) + : NoteContent(tqparent), m_previewJob(0) { setLink(url, title, icon, autoTitle, autoIcon); } @@ -1221,57 +1221,57 @@ int LinkContent::setWidthAndGetHeight(int width) return m_linkDisplay.height(); } -void LinkContent::paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered) +void LinkContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered) { - m_linkDisplay.paint(painter, 0, 0, width, height, colorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0); + m_linkDisplay.paint(painter, 0, 0, width, height, tqcolorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0); } -void LinkContent::saveToNode(QDomDocument &doc, QDomElement &content) +void LinkContent::saveToNode(TQDomDocument &doc, TQDomElement &content) { content.setAttribute("title", title() ); content.setAttribute("icon", icon() ); content.setAttribute("autoTitle", (autoTitle() ? "true" : "false")); content.setAttribute("autoIcon", (autoIcon() ? "true" : "false")); - QDomText textNode = doc.createTextNode(url().prettyURL()); + TQDomText textNode = doc.createTextNode(url().prettyURL()); content.appendChild(textNode); } -void LinkContent::toolTipInfos(QStringList *keys, QStringList *values) +void LinkContent::toolTipInfos(TQStringList *keys, TQStringList *values) { keys->append(i18n("Target")); values->append(m_url.prettyURL()); } -int LinkContent::zoneAt(const QPoint &pos) +int LinkContent::zoneAt(const TQPoint &pos) { return (m_linkDisplay.iconButtonAt(pos) ? 0 : Note::Custom0); } -QRect LinkContent::zoneRect(int zone, const QPoint &/*pos*/) +TQRect LinkContent::zoneRect(int zone, const TQPoint &/*pos*/) { - QRect linkRect = m_linkDisplay.iconButtonRect(); + TQRect linkRect = m_linkDisplay.iconButtonRect(); if (zone == Note::Custom0) - return QRect(linkRect.width(), 0, note()->width(), note()->height()); // Too wide and height, but it will be clipped by Note::zoneRect() + return TQRect(linkRect.width(), 0, note()->width(), note()->height()); // Too wide and height, but it will be clipped by Note::zoneRect() else if (zone == Note::Content) return linkRect; else - return QRect(); + return TQRect(); } -QString LinkContent::zoneTip(int zone) +TQString LinkContent::zoneTip(int zone) { - return (zone == Note::Custom0 ? i18n("Open this link") : QString()); + return (zone == Note::Custom0 ? i18n("Open this link") : TQString()); } -void LinkContent::setCursor(QWidget *widget, int zone) +void LinkContent::setCursor(TQWidget *widget, int zone) { if (zone == Note::Custom0) - widget->setCursor(Qt::PointingHandCursor); + widget->setCursor(TQt::PointingHandCursor); } -QString LinkContent::statusBarMessage(int zone) +TQString LinkContent::statusBarMessage(int zone) { if (zone == Note::Custom0 || zone == Note::Content) return m_url.prettyURL(); @@ -1285,7 +1285,7 @@ KURL LinkContent::urlToOpen(bool /*with*/) return NoteFactory::filteredURL(url());//KURIFilter::self()->filteredURI(url()); } -QString LinkContent::messageWhenOpenning(OpenMessage where) +TQString LinkContent::messageWhenOpenning(OpenMessage where) { if (url().isEmpty()) return i18n("Link have no URL to open."); @@ -1301,7 +1301,7 @@ QString LinkContent::messageWhenOpenning(OpenMessage where) } } -void LinkContent::setLink(const KURL &url, const QString &title, const QString &icon, bool autoTitle, bool autoIcon) +void LinkContent::setLink(const KURL &url, const TQString &title, const TQString &icon, bool autoTitle, bool autoIcon) { m_autoTitle = autoTitle; m_autoIcon = autoIcon; @@ -1313,7 +1313,7 @@ void LinkContent::setLink(const KURL &url, const QString &title, const QString & if (look->previewEnabled()) m_linkDisplay.setLink(m_title, m_icon, look, note()->font()); else - m_linkDisplay.setLink(m_title, m_icon, QPixmap(), look, note()->font()); + m_linkDisplay.setLink(m_title, m_icon, TQPixmap(), look, note()->font()); startFetchingUrlPreview(); contentChanged(m_linkDisplay.minWidth()); } @@ -1323,16 +1323,16 @@ void LinkContent::linkLookChanged() fontChanged(); } -void LinkContent::newPreview(const KFileItem*, const QPixmap &preview) +void LinkContent::newPreview(const KFileItem*, const TQPixmap &preview) { LinkLook *linkLook = LinkLook::lookForURL(url()); - m_linkDisplay.setLink(title(), icon(), (linkLook->previewEnabled() ? preview : QPixmap()), linkLook, note()->font()); + m_linkDisplay.setLink(title(), icon(), (linkLook->previewEnabled() ? preview : TQPixmap()), linkLook, note()->font()); contentChanged(m_linkDisplay.minWidth()); } void LinkContent::removePreview(const KFileItem*) { - newPreview(0, QPixmap()); + newPreview(0, TQPixmap()); } // Code dupicated from FileContent::startFetchingUrlPreview() @@ -1347,14 +1347,14 @@ void LinkContent::startFetchingUrlPreview() KURL::List urlList; urlList.append(filteredUrl); m_previewJob = KIO::filePreview(urlList, linkLook->previewSize(), linkLook->previewSize(), linkLook->iconSize()); - connect( m_previewJob, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)), this, SLOT(newPreview(const KFileItem*, const QPixmap&)) ); - connect( m_previewJob, SIGNAL(failed(const KFileItem*)), this, SLOT(removePreview(const KFileItem*)) ); + connect( m_previewJob, TQT_SIGNAL(gotPreview(const KFileItem*, const TQPixmap&)), this, TQT_SLOT(newPreview(const KFileItem*, const TQPixmap&)) ); + connect( m_previewJob, TQT_SIGNAL(failed(const KFileItem*)), this, TQT_SLOT(removePreview(const KFileItem*)) ); } } void LinkContent::exportToHTML(HTMLExporter *exporter, int indent) { - QString linkTitle = title(); + TQString linkTitle = title(); // TODO: // // Append address (useful for print version of the page/basket): @@ -1369,10 +1369,10 @@ void LinkContent::exportToHTML(HTMLExporter *exporter, int indent) KURL linkURL; /* - QFileInfo fInfo(url().path()); + TQFileInfo fInfo(url().path()); // DEBUG_WIN << url().path() -// << "IsFile:" + QString::number(fInfo.isFile()) -// << "IsDir:" + QString::number(fInfo.isDir()); +// << "IsFile:" + TQString::number(fInfo.isFile()) +// << "IsDir:" + TQString::number(fInfo.isDir()); if (exportData.embedLinkedFiles && fInfo.isFile()) { // DEBUG_WIN << "Embed file"; linkURL = exportData.dataFolderName + Basket::copyFile(url().path(), exportData.dataFolderPath, true); @@ -1387,15 +1387,15 @@ void LinkContent::exportToHTML(HTMLExporter *exporter, int indent) } */ - QString spaces; - exporter->stream << m_linkDisplay.toHtml(exporter, linkURL, linkTitle).replace("\n", "\n" + spaces.fill(' ', indent + 1)); + TQString spaces; + exporter->stream << m_linkDisplay.toHtml(exporter, linkURL, linkTitle).tqreplace("\n", "\n" + spaces.fill(' ', indent + 1)); } /** class LauncherContent: */ -LauncherContent::LauncherContent(Note *parent, const QString &fileName) - : NoteContent(parent, fileName) +LauncherContent::LauncherContent(Note *tqparent, const TQString &fileName) + : NoteContent(tqparent, fileName) { basket()->addWatchedFile(fullPath()); loadFromFile(/*lazyLoad=*/false); @@ -1407,9 +1407,9 @@ int LauncherContent::setWidthAndGetHeight(int width) return m_linkDisplay.height(); } -void LauncherContent::paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered) +void LauncherContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered) { - m_linkDisplay.paint(painter, 0, 0, width, height, colorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0); + m_linkDisplay.paint(painter, 0, 0, width, height, tqcolorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0); } bool LauncherContent::loadFromFile(bool /*lazyLoad*/) // TODO: saveToFile() ?? Is it possible? @@ -1421,13 +1421,13 @@ bool LauncherContent::loadFromFile(bool /*lazyLoad*/) // TODO: saveToFile() ?? I } -void LauncherContent::toolTipInfos(QStringList *keys, QStringList *values) +void LauncherContent::toolTipInfos(TQStringList *keys, TQStringList *values) { KService service(fullPath()); - QString exec = service.exec(); + TQString exec = service.exec(); if (service.terminal()) - exec = i18n("%1 <i>(run in terminal)</i>").arg(exec); + exec = i18n("%1 <i>(run in terminal)</i>").tqarg(exec); if (!service.comment().isEmpty() && service.comment() != service.name()) { keys->append(i18n("Comment")); @@ -1438,32 +1438,32 @@ void LauncherContent::toolTipInfos(QStringList *keys, QStringList *values) values->append(exec); } -int LauncherContent::zoneAt(const QPoint &pos) +int LauncherContent::zoneAt(const TQPoint &pos) { return (m_linkDisplay.iconButtonAt(pos) ? 0 : Note::Custom0); } -QRect LauncherContent::zoneRect(int zone, const QPoint &/*pos*/) +TQRect LauncherContent::zoneRect(int zone, const TQPoint &/*pos*/) { - QRect linkRect = m_linkDisplay.iconButtonRect(); + TQRect linkRect = m_linkDisplay.iconButtonRect(); if (zone == Note::Custom0) - return QRect(linkRect.width(), 0, note()->width(), note()->height()); // Too wide and height, but it will be clipped by Note::zoneRect() + return TQRect(linkRect.width(), 0, note()->width(), note()->height()); // Too wide and height, but it will be clipped by Note::zoneRect() else if (zone == Note::Content) return linkRect; else - return QRect(); + return TQRect(); } -QString LauncherContent::zoneTip(int zone) +TQString LauncherContent::zoneTip(int zone) { - return (zone == Note::Custom0 ? i18n("Launch this application") : QString()); + return (zone == Note::Custom0 ? i18n("Launch this application") : TQString()); } -void LauncherContent::setCursor(QWidget *widget, int zone) +void LauncherContent::setCursor(TQWidget *widget, int zone) { if (zone == Note::Custom0) - widget->setCursor(Qt::PointingHandCursor); + widget->setCursor(TQt::PointingHandCursor); } @@ -1475,7 +1475,7 @@ KURL LauncherContent::urlToOpen(bool with) return (with ? KURL() : KURL(fullPath())); // Can open the appliation, but not with another application :-) } -QString LauncherContent::messageWhenOpenning(OpenMessage where) +TQString LauncherContent::messageWhenOpenning(OpenMessage where) { if (KService(fullPath()).exec().isEmpty()) return i18n("The launcher have no command to run."); @@ -1491,7 +1491,7 @@ QString LauncherContent::messageWhenOpenning(OpenMessage where) } } -void LauncherContent::setLauncher(const QString &name, const QString &icon, const QString &exec) +void LauncherContent::setLauncher(const TQString &name, const TQString &icon, const TQString &exec) { m_name = name; m_icon = icon; @@ -1503,9 +1503,9 @@ void LauncherContent::setLauncher(const QString &name, const QString &icon, cons void LauncherContent::exportToHTML(HTMLExporter *exporter, int indent) { - QString spaces; - QString fileName = exporter->copyFile(fullPath(), /*createIt=*/true); - exporter->stream << m_linkDisplay.toHtml(exporter, KURL(exporter->dataFolderName + fileName), "").replace("\n", "\n" + spaces.fill(' ', indent + 1)); + TQString spaces; + TQString fileName = exporter->copyFile(fullPath(), /*createIt=*/true); + exporter->stream << m_linkDisplay.toHtml(exporter, KURL(exporter->dataFolderName + fileName), "").tqreplace("\n", "\n" + spaces.fill(' ', indent + 1)); } /** class ColorContent: @@ -1513,8 +1513,8 @@ void LauncherContent::exportToHTML(HTMLExporter *exporter, int indent) const int ColorContent::RECT_MARGIN = 2; -ColorContent::ColorContent(Note *parent, const QColor &color) - : NoteContent(parent) +ColorContent::ColorContent(Note *tqparent, const TQColor &color) + : NoteContent(tqparent) { setColor(color); } @@ -1522,15 +1522,15 @@ ColorContent::ColorContent(Note *parent, const QColor &color) int ColorContent::setWidthAndGetHeight(int /*width*/) // We do not need width because we can't word-break, and width is always >= minWidth() { // FIXME: Duplicate from setColor(): - QRect textRect = QFontMetrics(note()->font()).boundingRect(color().name()); + TQRect textRect = TQFontMetrics(note()->font()).boundingRect(color().name()); int rectHeight = (textRect.height() + 2)*3/2; return rectHeight; } -void ColorContent::paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) +void ColorContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) { // FIXME: Duplicate from setColor(): - QRect textRect = QFontMetrics(note()->font()).boundingRect(color().name()); + TQRect textRect = TQFontMetrics(note()->font()).boundingRect(color().name()); int rectHeight = (textRect.height() + 2)*3/2; int rectWidth = rectHeight * 14 / 10; // 1.4 times the height, like A4 papers. @@ -1538,7 +1538,7 @@ void ColorContent::paint(QPainter *painter, int width, int height, const QColorG // Fill: painter->fillRect(1, 1, rectWidth - 2, rectHeight - 2, color()); // Stroke: - QColor stroke = color().dark(125); + TQColor stroke = color().dark(125); painter->setPen(stroke); painter->drawLine(1, 0, rectWidth - 2, 0); painter->drawLine(0, 1, 0, rectHeight - 2); @@ -1553,29 +1553,29 @@ void ColorContent::paint(QPainter *painter, int width, int height, const QColorG // Draw the text: painter->setFont(note()->font()); - painter->setPen(colorGroup.text()); - painter->drawText(rectWidth + RECT_MARGIN, 0, width - rectWidth - RECT_MARGIN, height, Qt::AlignAuto | Qt::AlignVCenter, color().name()); + painter->setPen(tqcolorGroup.text()); + painter->drawText(rectWidth + RECT_MARGIN, 0, width - rectWidth - RECT_MARGIN, height, TQt::AlignAuto | TQt::AlignVCenter, color().name()); } -void ColorContent::saveToNode(QDomDocument &doc, QDomElement &content) +void ColorContent::saveToNode(TQDomDocument &doc, TQDomElement &content) { - QDomText textNode = doc.createTextNode(color().name()); + TQDomText textNode = doc.createTextNode(color().name()); content.appendChild(textNode); } -void ColorContent::toolTipInfos(QStringList *keys, QStringList *values) +void ColorContent::toolTipInfos(TQStringList *keys, TQStringList *values) { int hue, saturation, value; - m_color.getHsv(hue, saturation, value); + m_color.getHsv(&hue, &saturation, &value); keys->append(i18n("RGB Colorspace: Red/Green/Blue", "RGB")); - values->append(i18n("<i>Red</i>: %1, <i>Green</i>: %2, <i>Blue</i>: %3,").arg(QString::number(m_color.red()), QString::number(m_color.green()), QString::number(m_color.blue()))); + values->append(i18n("<i>Red</i>: %1, <i>Green</i>: %2, <i>Blue</i>: %3,").tqarg(TQString::number(m_color.red()), TQString::number(m_color.green()), TQString::number(m_color.blue()))); keys->append(i18n("HSV Colorspace: Hue/Saturation/Value", "HSV")); - values->append(i18n("<i>Hue</i>: %1, <i>Saturation</i>: %2, <i>Value</i>: %3,").arg(QString::number(hue), QString::number(saturation), QString::number(value))); + values->append(i18n("<i>Hue</i>: %1, <i>Saturation</i>: %2, <i>Value</i>: %3,").tqarg(TQString::number(hue), TQString::number(saturation), TQString::number(value))); - static QString cssColors[] = { + static TQString cssColors[] = { "aqua", "00ffff", "black", "000000", "blue", "0000ff", @@ -1594,7 +1594,7 @@ void ColorContent::toolTipInfos(QStringList *keys, QStringList *values) "yellow", "ffff00" }; - static QString cssExtendedColors[] = { + static TQString cssExtendedColors[] = { "aliceblue", "f0f8ff", "antiquewhite", "faebd7", "aquamarine", "7fffd4", @@ -1680,7 +1680,7 @@ void ColorContent::toolTipInfos(QStringList *keys, QStringList *values) "midnightblue", "191970", "mintcream", "f5fffa", "mistyrose", "ffe4e1", - "moccasin", "ffe4b5", + "tqmoccasin", "ffe4b5", "navajowhite", "ffdead", "oldlace", "fdf5e6", "olivedrab", "6b8e23", @@ -1721,7 +1721,7 @@ void ColorContent::toolTipInfos(QStringList *keys, QStringList *values) "yellowgreen", "9acd32" }; - QString colorHex = color().name().mid(1); // Take the hexadecimal name of the color, without the '#'. + TQString colorHex = color().name().mid(1); // Take the hexadecimal name of the color, without the '#'. bool cssColorFound = false; for (int i = 0; i < 2*16; i += 2) { @@ -1747,11 +1747,11 @@ void ColorContent::toolTipInfos(QStringList *keys, QStringList *values) } -void ColorContent::setColor(const QColor &color) +void ColorContent::setColor(const TQColor &color) { m_color = color; - QRect textRect = QFontMetrics(note()->font()).boundingRect(color.name()); + TQRect textRect = TQFontMetrics(note()->font()).boundingRect(color.name()); int rectHeight = (textRect.height() + 2)*3/2; int rectWidth = rectHeight * 14 / 10; // 1.4 times the height, like A4 papers. contentChanged(rectWidth + RECT_MARGIN + textRect.width() + RECT_MARGIN); // The second RECT_MARGIN is because textRect.width() is too short. I done a bug? Can't figure out. @@ -1759,13 +1759,13 @@ void ColorContent::setColor(const QColor &color) void ColorContent::addAlternateDragObjects(KMultipleDrag *dragObject) { - dragObject->addDragObject( new QColorDrag(color()) ); + dragObject->addDragObject( new TQColorDrag(color()) ); // addDragObject(new KColorDrag( note->color(), 0 )); -// addDragObject(new QTextDrag( note->color().name(), 0 )); +// addDragObject(new TQTextDrag( note->color().name(), 0 )); -/* // Creata and add the QDragObject: - storedDrag = new QStoredDrag("application/x-color"); +/* // Creata and add the TQDragObject: + storedDrag = new TQStoredDrag("application/x-color"); storedDrag->setEncodedData(*array); dragObject->addDragObject(storedDrag); delete array;*/ @@ -1774,16 +1774,16 @@ void ColorContent::addAlternateDragObjects(KMultipleDrag *dragObject) void ColorContent::exportToHTML(HTMLExporter *exporter, int /*indent*/) { // FIXME: Duplicate from setColor(): TODO: rectSize() - QRect textRect = QFontMetrics(note()->font()).boundingRect(color().name()); + TQRect textRect = TQFontMetrics(note()->font()).boundingRect(color().name()); int rectHeight = (textRect.height() + 2)*3/2; int rectWidth = rectHeight * 14 / 10; // 1.4 times the height, like A4 papers. - QString fileName = /*Tools::fileNameForNewFile(*/QString("color_%1.png").arg(color().name().lower().mid(1))/*, exportData.iconsFolderPath)*/; - QString fullPath = exporter->iconsFolderPath + fileName; - QPixmap colorIcon = KColorCombo2::colorRectPixmap(color(), /*isDefault=*/false, rectWidth, rectHeight); + TQString fileName = /*Tools::fileNameForNewFile(*/TQString(TQString("color_%1.png").tqarg(color().name()).lower().mid(1))/*, exportData.iconsFolderPath)*/; + TQString fullPath = exporter->iconsFolderPath + fileName; + TQPixmap colorIcon = KColorCombo2::colorRectPixmap(color(), /*isDefault=*/false, rectWidth, rectHeight); colorIcon.save(fullPath, "PNG"); - QString iconHtml = QString("<img src=\"%1\" width=\"%2\" height=\"%3\" alt=\"\">") - .arg(exporter->iconsFolderName + fileName, QString::number(colorIcon.width()), QString::number(colorIcon.height())); + TQString iconHtml = TQString("<img src=\"%1\" width=\"%2\" height=\"%3\" alt=\"\">") + .tqarg(exporter->iconsFolderName + fileName, TQString::number(colorIcon.width()), TQString::number(colorIcon.height())); exporter->stream << iconHtml + " " + color().name(); } @@ -1795,8 +1795,8 @@ void ColorContent::exportToHTML(HTMLExporter *exporter, int /*indent*/) const int UnknownContent::DECORATION_MARGIN = 2; -UnknownContent::UnknownContent(Note *parent, const QString &fileName) - : NoteContent(parent, fileName) +UnknownContent::UnknownContent(Note *tqparent, const TQString &fileName) + : NoteContent(tqparent, fileName) { basket()->addWatchedFile(fullPath()); loadFromFile(/*lazyLoad=*/false); @@ -1805,49 +1805,49 @@ UnknownContent::UnknownContent(Note *parent, const QString &fileName) int UnknownContent::setWidthAndGetHeight(int width) { width -= 1; - QRect textRect = QFontMetrics(note()->font()).boundingRect(0, 0, width, 500000, Qt::AlignAuto | Qt::AlignTop | Qt::WordBreak, m_mimeTypes); + TQRect textRect = TQFontMetrics(note()->font()).boundingRect(0, 0, width, 500000, TQt::AlignAuto | TQt::AlignTop | TQt::WordBreak, m_mimeTypes); return DECORATION_MARGIN + textRect.height() + DECORATION_MARGIN; } // TODO: Move this function from note.cpp to class Tools: -extern void drawGradient( QPainter *p, const QColor &colorTop, const QColor & colorBottom, +extern void drawGradient( TQPainter *p, const TQColor &colorTop, const TQColor & colorBottom, int x, int y, int w, int h, bool sunken, bool horz, bool flat ); /*const*/ -void UnknownContent::paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) +void UnknownContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) { width -= 1; - painter->setPen(colorGroup.text()); + painter->setPen(tqcolorGroup.text()); // FIXME: Duplicate from ColorContent::paint() and CommonColorSelector::drawColorRect: // Fill with gradient: - drawGradient(painter, colorGroup.background(), colorGroup.background().dark(110), 1, 1, width - 2, height - 2, /*sunken=*/false, /*horz=*/true, /*flat=*/false); + drawGradient(painter, tqcolorGroup.background(), tqcolorGroup.background().dark(110), 1, 1, width - 2, height - 2, /*sunken=*/false, /*horz=*/true, /*flat=*/false); // Stroke: - QColor stroke = Tools::mixColor(colorGroup.background(), colorGroup.text()); + TQColor stroke = Tools::mixColor(tqcolorGroup.background(), tqcolorGroup.text()); painter->setPen(stroke); painter->drawLine(1, 0, width - 2, 0); painter->drawLine(0, 1, 0, height - 2); painter->drawLine(1, height - 1, width - 2, height - 1); painter->drawLine(width - 1, 1, width - 1, height - 2); // Round corners: - painter->setPen(Tools::mixColor(colorGroup.background(), stroke)); + painter->setPen(Tools::mixColor(tqcolorGroup.background(), stroke)); painter->drawPoint(1, 1); painter->drawPoint(1, height - 2); painter->drawPoint(width - 2, height - 2); painter->drawPoint(width - 2, 1); - painter->setPen(colorGroup.text()); + painter->setPen(tqcolorGroup.text()); painter->drawText(DECORATION_MARGIN, DECORATION_MARGIN, width - 2*DECORATION_MARGIN, height - 2*DECORATION_MARGIN, - Qt::AlignAuto | Qt::AlignVCenter | Qt::WordBreak, m_mimeTypes); + TQt::AlignAuto | TQt::AlignVCenter | TQt::WordBreak, m_mimeTypes); } bool UnknownContent::loadFromFile(bool /*lazyLoad*/) { DEBUG_WIN << "Loading UnknownContent From " + basket()->folderName() + fileName(); - QFile file(fullPath()); + TQFile file(fullPath()); if (file.open(IO_ReadOnly)) { - QDataStream stream(&file); - QString line; + TQDataStream stream(&file); + TQString line; m_mimeTypes = ""; // Get the MIME-types names: do { @@ -1857,26 +1857,26 @@ bool UnknownContent::loadFromFile(bool /*lazyLoad*/) if (m_mimeTypes.isEmpty()) m_mimeTypes += line; else - m_mimeTypes += QString("\n") + line; + m_mimeTypes += TQString("\n") + line; } } } while (!line.isEmpty() && !stream.atEnd()); file.close(); } - QRect textRect = QFontMetrics(note()->font()).boundingRect(0, 0, /*width=*/1, 500000, Qt::AlignAuto | Qt::AlignTop | Qt::WordBreak, m_mimeTypes); + TQRect textRect = TQFontMetrics(note()->font()).boundingRect(0, 0, /*width=*/1, 500000, TQt::AlignAuto | TQt::AlignTop | TQt::WordBreak, m_mimeTypes); contentChanged(DECORATION_MARGIN + textRect.width() + DECORATION_MARGIN + 1); return true; } void UnknownContent::addAlternateDragObjects(KMultipleDrag *dragObject) { - QFile file(fullPath()); + TQFile file(fullPath()); if (file.open(IO_ReadOnly)) { - QDataStream stream(&file); + TQDataStream stream(&file); // Get the MIME types names: - QValueList<QString> mimes; - QString line; + TQValueList<TQString> mimes; + TQString line; do { if (!stream.atEnd()) { stream >> line; @@ -1885,17 +1885,17 @@ void UnknownContent::addAlternateDragObjects(KMultipleDrag *dragObject) } } while (!line.isEmpty() && !stream.atEnd()); // Add the streams: - Q_UINT64 size; // TODO: It was Q_UINT32 in version 0.5.0 ! - QByteArray *array; - QStoredDrag *storedDrag; + TQ_UINT64 size; // TODO: It was TQ_UINT32 in version 0.5.0 ! + TQByteArray *array; + TQStoredDrag *storedDrag; for (uint i = 0; i < mimes.count(); ++i) { // Get the size: stream >> size; // Allocate memory to retreive size bytes and store them: - array = new QByteArray(size); + array = new TQByteArray(size); stream.readRawBytes(array->data(), size); - // Creata and add the QDragObject: - storedDrag = new QStoredDrag(*(mimes.at(i))); + // Creata and add the TQDragObject: + storedDrag = new TQStoredDrag(*(mimes.at(i))); storedDrag->setEncodedData(*array); dragObject->addDragObject(storedDrag); delete array; // FIXME: Should we? @@ -1906,30 +1906,30 @@ void UnknownContent::addAlternateDragObjects(KMultipleDrag *dragObject) void UnknownContent::exportToHTML(HTMLExporter *exporter, int indent) { - QString spaces; - exporter->stream << "<div class=\"unknown\">" << mimeTypes().replace("\n", "\n" + spaces.fill(' ', indent + 1 + 1)) << "</div>"; + TQString spaces; + exporter->stream << "<div class=\"unknown\">" << mimeTypes().tqreplace("\n", "\n" + spaces.fill(' ', indent + 1 + 1)) << "</div>"; } -void NoteFactory__loadNode(const QDomElement &content, const QString &lowerTypeName, Note *parent, bool lazyLoad) +void NoteFactory__loadNode(const TQDomElement &content, const TQString &lowerTypeName, Note *tqparent, bool lazyLoad) { - if (lowerTypeName == "text") new TextContent( parent, content.text(), lazyLoad ); - else if (lowerTypeName == "html") new HtmlContent( parent, content.text(), lazyLoad ); - else if (lowerTypeName == "image") new ImageContent( parent, content.text(), lazyLoad ); - else if (lowerTypeName == "animation") new AnimationContent( parent, content.text(), lazyLoad ); - else if (lowerTypeName == "sound") new SoundContent( parent, content.text() ); - else if (lowerTypeName == "file") new FileContent( parent, content.text() ); + if (lowerTypeName == "text") new TextContent( tqparent, content.text(), lazyLoad ); + else if (lowerTypeName == "html") new HtmlContent( tqparent, content.text(), lazyLoad ); + else if (lowerTypeName == "image") new ImageContent( tqparent, content.text(), lazyLoad ); + else if (lowerTypeName == "animation") new AnimationContent( tqparent, content.text(), lazyLoad ); + else if (lowerTypeName == "sound") new SoundContent( tqparent, content.text() ); + else if (lowerTypeName == "file") new FileContent( tqparent, content.text() ); else if (lowerTypeName == "link") { bool autoTitle = content.attribute("title") == content.text(); bool autoIcon = content.attribute("icon") == NoteFactory::iconForURL(KURL(content.text())); autoTitle = XMLWork::trueOrFalse( content.attribute("autoTitle"), autoTitle); autoIcon = XMLWork::trueOrFalse( content.attribute("autoIcon"), autoIcon ); - new LinkContent( parent, KURL(content.text()), content.attribute("title"), content.attribute("icon"), autoTitle, autoIcon ); - } else if (lowerTypeName == "launcher") new LauncherContent( parent, content.text() ); - else if (lowerTypeName == "color") new ColorContent( parent, QColor(content.text()) ); - else if (lowerTypeName == "unknown") new UnknownContent( parent, content.text() ); + new LinkContent( tqparent, KURL(content.text()), content.attribute("title"), content.attribute("icon"), autoTitle, autoIcon ); + } else if (lowerTypeName == "launcher") new LauncherContent( tqparent, content.text() ); + else if (lowerTypeName == "color") new ColorContent( tqparent, TQColor(content.text()) ); + else if (lowerTypeName == "unknown") new UnknownContent( tqparent, content.text() ); } #include "notecontent.moc" |