diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /libkcal/htmlexport.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkcal/htmlexport.cpp')
-rw-r--r-- | libkcal/htmlexport.cpp | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/libkcal/htmlexport.cpp b/libkcal/htmlexport.cpp index 8d1570159..fd994fca2 100644 --- a/libkcal/htmlexport.cpp +++ b/libkcal/htmlexport.cpp @@ -20,11 +20,11 @@ Boston, MA 02110-1301, USA. */ -#include <qapplication.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qtextcodec.h> -#include <qregexp.h> +#include <tqapplication.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqtextcodec.h> +#include <tqregexp.h> #include <kcharsets.h> #include <kglobal.h> @@ -49,29 +49,29 @@ HtmlExport::HtmlExport( Calendar *calendar, HTMLExportSettings *settings ) : { } -bool HtmlExport::save( const QString &fileName ) +bool HtmlExport::save( const TQString &fileName ) { - QString fn( fileName ); + TQString fn( fileName ); if ( fn.isEmpty() && mSettings ) { fn = mSettings->outputFile(); } if ( !mSettings || fn.isEmpty() ) { return false; } - QFile f( fileName ); + TQFile f( fileName ); if ( !f.open(IO_WriteOnly)) { return false; } - QTextStream ts(&f); + TQTextStream ts(&f); bool success = save(&ts); f.close(); return success; } -bool HtmlExport::save(QTextStream *ts) +bool HtmlExport::save(TQTextStream *ts) { if ( !mSettings ) return false; - ts->setEncoding( QTextStream::UnicodeUTF8 ); + ts->setEncoding( TQTextStream::UnicodeUTF8 ); // Write HTML header *ts << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" "; @@ -134,12 +134,12 @@ bool HtmlExport::save(QTextStream *ts) return true; } -void HtmlExport::createMonthView(QTextStream *ts) +void HtmlExport::createMonthView(TQTextStream *ts) { - QDate start = fromDate(); + TQDate start = fromDate(); start.setYMD( start.year(), start.month(), 1 ); // go back to first day in month - QDate end( start.year(), start.month(), start.daysInMonth() ); + TQDate end( start.year(), start.month(), start.daysInMonth() ); int startmonth = start.month(); int startyear = start.year(); @@ -176,7 +176,7 @@ void HtmlExport::createMonthView(QTextStream *ts) } else { *ts << "class=\"date\""; } - *ts << ">" << QString::number(start.day()); + *ts << ">" << TQString::number(start.day()); if (mHolidayMap.contains(start)) { *ts << " <em>" << mHolidayMap[start] << "</em>"; @@ -216,7 +216,7 @@ void HtmlExport::createMonthView(QTextStream *ts) } } -void HtmlExport::createEventList (QTextStream *ts) +void HtmlExport::createEventList (TQTextStream *ts) { int columns = 3; *ts << "<table border=\"0\" cellpadding=\"3\" cellspacing=\"3\">\n"; @@ -239,7 +239,7 @@ void HtmlExport::createEventList (QTextStream *ts) *ts << " </tr>\n"; - for ( QDate dt = fromDate(); dt <= toDate(); dt = dt.addDays(1) ) { + for ( TQDate dt = fromDate(); dt <= toDate(); dt = dt.addDays(1) ) { kdDebug(5850) << "Getting events for " << dt.toString() << endl; Event::List events = mCalendar->events(dt, EventSortStartDate, @@ -250,7 +250,7 @@ void HtmlExport::createEventList (QTextStream *ts) for( it = events.begin(); it != events.end(); ++it ) { if ( checkSecrecy( *it ) ) { if ( first ) { - *ts << " <tr><td colspan=\"" << QString::number(columns) + *ts << " <tr><td colspan=\"" << TQString::number(columns) << "\" class=\"datehead\"><i>" << KGlobal::locale()->formatDate(dt) << "</i></td></tr>\n"; @@ -265,8 +265,8 @@ void HtmlExport::createEventList (QTextStream *ts) *ts << "</table>\n"; } -void HtmlExport::createEvent (QTextStream *ts, Event *event, - QDate date,bool withDescription) +void HtmlExport::createEvent (TQTextStream *ts, Event *event, + TQDate date,bool withDescription) { kdDebug(5850) << "HtmlExport::createEvent(): " << event->summary() << endl; *ts << " <tr>\n"; @@ -314,7 +314,7 @@ void HtmlExport::createEvent (QTextStream *ts, Event *event, *ts << " </tr>\n"; } -void HtmlExport::createTodoList ( QTextStream *ts ) +void HtmlExport::createTodoList ( TQTextStream *ts ) { Todo::List rawTodoList = mCalendar->todos(); @@ -386,7 +386,7 @@ void HtmlExport::createTodoList ( QTextStream *ts ) // Generate sub-task list of event ev *ts << " <tr>\n"; *ts << " <td class=\"subhead\" colspan="; - *ts << "\"" << QString::number(columns) << "\""; + *ts << "\"" << TQString::number(columns) << "\""; *ts << "><a name=\"sub" << (*it)->uid() << "\"></a>" << i18n("Sub-Tasks of: ") << "<a href=\"#" << (*it)->uid() << "\"><b>" << cleanChars( (*it)->summary()) @@ -419,7 +419,7 @@ void HtmlExport::createTodoList ( QTextStream *ts ) *ts << "</table>\n"; } -void HtmlExport::createTodo (QTextStream *ts,Todo *todo) +void HtmlExport::createTodo (TQTextStream *ts,Todo *todo) { kdDebug(5850) << "HtmlExport::createTodo()" << endl; @@ -493,18 +493,18 @@ void HtmlExport::createTodo (QTextStream *ts,Todo *todo) *ts << "</tr>\n"; } -void HtmlExport::createWeekView( QTextStream */*ts*/ ) +void HtmlExport::createWeekView( TQTextStream */*ts*/ ) { // FIXME: Implement this! } -void HtmlExport::createJournalView( QTextStream */*ts*/ ) +void HtmlExport::createJournalView( TQTextStream */*ts*/ ) { // Journal::List rawJournalList = mCalendar->journals(); // FIXME: Implement this! } -void HtmlExport::createFreeBusyView( QTextStream */*ts*/ ) +void HtmlExport::createFreeBusyView( TQTextStream */*ts*/ ) { // FIXME: Implement this! } @@ -525,7 +525,7 @@ bool HtmlExport::checkSecrecy( Incidence *incidence ) return false; } -void HtmlExport::formatLocation (QTextStream *ts,Incidence *event) +void HtmlExport::formatLocation (TQTextStream *ts,Incidence *event) { if (!event->location().isEmpty()) { *ts << " " << cleanChars(event->location()) << "\n"; @@ -534,7 +534,7 @@ void HtmlExport::formatLocation (QTextStream *ts,Incidence *event) } } -void HtmlExport::formatCategories (QTextStream *ts,Incidence *event) +void HtmlExport::formatCategories (TQTextStream *ts,Incidence *event) { if (!event->categoriesStr().isEmpty()) { *ts << " " << cleanChars(event->categoriesStr()) << "\n"; @@ -543,7 +543,7 @@ void HtmlExport::formatCategories (QTextStream *ts,Incidence *event) } } -void HtmlExport::formatAttendees( QTextStream *ts, Incidence *event ) +void HtmlExport::formatAttendees( TQTextStream *ts, Incidence *event ) { Attendee::List attendees = event->attendees(); if (attendees.count()) { @@ -579,16 +579,16 @@ void HtmlExport::formatAttendees( QTextStream *ts, Incidence *event ) } } -QString HtmlExport::breakString(const QString &text) +TQString HtmlExport::breakString(const TQString &text) { int number = text.contains("\n"); if(number < 0) { return text; } else { - QString out; - QString tmpText = text; + TQString out; + TQString tmpText = text; int pos = 0; - QString tmp; + TQString tmp; for(int i=0;i<=number;i++) { pos = tmpText.find("\n"); tmp = tmpText.left(pos); @@ -599,15 +599,15 @@ QString HtmlExport::breakString(const QString &text) } } -void HtmlExport::createFooter( QTextStream *ts ) +void HtmlExport::createFooter( TQTextStream *ts ) { // FIXME: Implement this in a translatable way! - QString trailer = i18n("This page was created "); + TQString trailer = i18n("This page was created "); /* bool hasPerson = false; bool hasCredit = false; bool hasCreditURL = false; - QString mail, name, credit, creditURL;*/ + TQString mail, name, credit, creditURL;*/ if (!mSettings->eMail().isEmpty()) { if (!mSettings->name().isEmpty()) trailer += i18n("by <a href=\"mailto:%1\">%2</a> ").arg( mSettings->eMail() ).arg( mSettings->name() ); @@ -629,43 +629,43 @@ void HtmlExport::createFooter( QTextStream *ts ) } -QString HtmlExport::cleanChars(const QString &text) +TQString HtmlExport::cleanChars(const TQString &text) { - QString txt = text; + TQString txt = text; txt = txt.replace( "&", "&" ); txt = txt.replace( "<", "<" ); txt = txt.replace( ">", ">" ); txt = txt.replace( "\"", """ ); - txt = txt.replace( QString::fromUtf8("ä"), "ä" ); - txt = txt.replace( QString::fromUtf8("á"), "á" ); - txt = txt.replace( QString::fromUtf8("à"), "à" ); - txt = txt.replace( QString::fromUtf8("â"), "â" ); - txt = txt.replace( QString::fromUtf8("Ä"), "Ä" ); - txt = txt.replace( QString::fromUtf8("ó"), "ó" ); - txt = txt.replace( QString::fromUtf8("ô"), "ô" ); - txt = txt.replace( QString::fromUtf8("ö"), "ö" ); - txt = txt.replace( QString::fromUtf8("Ö"), "Ö" ); - txt = txt.replace( QString::fromUtf8("ü"), "ü" ); - txt = txt.replace( QString::fromUtf8("Ü"), "Ü" ); - txt = txt.replace( QString::fromUtf8("ß"), "ß" ); - txt = txt.replace( QString::fromUtf8("€"), "€" ); - txt = txt.replace( QString::fromUtf8("é"), "é" ); - txt = txt.replace( QString::fromUtf8("ë"), "ë" ); - txt = txt.replace( QString::fromUtf8("è"), "è" ); - txt = txt.replace( QString::fromUtf8("ñ"), "ñ" ); - txt = txt.replace( QString::fromUtf8("ç"), "ç" ); + txt = txt.replace( TQString::fromUtf8("ä"), "ä" ); + txt = txt.replace( TQString::fromUtf8("á"), "á" ); + txt = txt.replace( TQString::fromUtf8("à"), "à" ); + txt = txt.replace( TQString::fromUtf8("â"), "â" ); + txt = txt.replace( TQString::fromUtf8("Ä"), "Ä" ); + txt = txt.replace( TQString::fromUtf8("ó"), "ó" ); + txt = txt.replace( TQString::fromUtf8("ô"), "ô" ); + txt = txt.replace( TQString::fromUtf8("ö"), "ö" ); + txt = txt.replace( TQString::fromUtf8("Ö"), "Ö" ); + txt = txt.replace( TQString::fromUtf8("ü"), "ü" ); + txt = txt.replace( TQString::fromUtf8("Ü"), "Ü" ); + txt = txt.replace( TQString::fromUtf8("ß"), "ß" ); + txt = txt.replace( TQString::fromUtf8("€"), "€" ); + txt = txt.replace( TQString::fromUtf8("é"), "é" ); + txt = txt.replace( TQString::fromUtf8("ë"), "ë" ); + txt = txt.replace( TQString::fromUtf8("è"), "è" ); + txt = txt.replace( TQString::fromUtf8("ñ"), "ñ" ); + txt = txt.replace( TQString::fromUtf8("ç"), "ç" ); return txt; } -QString HtmlExport::styleSheet() const +TQString HtmlExport::styleSheet() const { if ( !mSettings->styleSheet().isEmpty() ) return mSettings->styleSheet(); - QString css; + TQString css; - if ( QApplication::reverseLayout() ) { + if ( TQApplication::reverseLayout() ) { css += " body { background-color:white; color:black; direction: rtl }\n"; css += " td { text-align:center; background-color:#eee }\n"; css += " th { text-align:center; background-color:#228; color:white }\n"; @@ -693,7 +693,7 @@ QString HtmlExport::styleSheet() const } -void HtmlExport::addHoliday( const QDate &date, const QString &name) +void HtmlExport::addHoliday( const TQDate &date, const TQString &name) { if ( mHolidayMap[date].isEmpty() ) { mHolidayMap[date] = name; @@ -702,12 +702,12 @@ void HtmlExport::addHoliday( const QDate &date, const QString &name) } } -QDate HtmlExport::fromDate() const +TQDate HtmlExport::fromDate() const { return mSettings->dateStart().date(); } -QDate HtmlExport::toDate() const +TQDate HtmlExport::toDate() const { return mSettings->dateEnd().date(); } |