summaryrefslogtreecommitdiffstats
path: root/ktnef/lib/ktnefwriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ktnef/lib/ktnefwriter.cpp')
-rw-r--r--ktnef/lib/ktnefwriter.cpp122
1 files changed, 61 insertions, 61 deletions
diff --git a/ktnef/lib/ktnefwriter.cpp b/ktnef/lib/ktnefwriter.cpp
index ce35dbd20..48734bebd 100644
--- a/ktnef/lib/ktnefwriter.cpp
+++ b/ktnef/lib/ktnefwriter.cpp
@@ -23,9 +23,9 @@
#include "ktnef/ktnefproperty.h"
#include "ktnef/ktnefpropertyset.h"
-#include <qfile.h>
-#include <qdatetime.h>
-#include <qdatastream.h>
+#include <tqfile.h>
+#include <tqdatetime.h>
+#include <tqdatastream.h>
#include <kdebug.h>
#include <assert.h>
@@ -34,7 +34,7 @@
class KTNEFWriter::PrivateData {
public:
- PrivateData() { mFirstAttachNum = QDateTime::currentDateTime().toTime_t(); }
+ PrivateData() { mFirstAttachNum = TQDateTime::currentDateTime().toTime_t(); }
KTNEFPropertySet properties;
Q_UINT16 mFirstAttachNum;
@@ -46,16 +46,16 @@ KTNEFWriter::KTNEFWriter() {
// This is not something the user should fiddle with
// First set the TNEF version
- QVariant v(0x00010000);
+ TQVariant v(0x00010000);
addProperty( attTNEFVERSION, atpDWORD, v );
// Now set the code page to something reasonable. TODO: Use the right one
- QVariant v1( (Q_UINT32)0x4e4 );
- QVariant v2( (Q_UINT32)0x0 );
- QValueList<QVariant> list;
+ TQVariant v1( (Q_UINT32)0x4e4 );
+ TQVariant v2( (Q_UINT32)0x0 );
+ TQValueList<TQVariant> list;
list << v1;
list << v2;
- v = QVariant( list );
+ v = TQVariant( list );
addProperty( attOEMCODEPAGE, atpBYTE, list );
}
@@ -64,7 +64,7 @@ KTNEFWriter::~KTNEFWriter() {
}
-void KTNEFWriter::addProperty( int tag, int type, const QVariant& value ) {
+void KTNEFWriter::addProperty( int tag, int type, const TQVariant& value ) {
mData->properties.addProperty( tag, type, value );
}
@@ -76,13 +76,13 @@ void addToChecksum( Q_UINT32 i, Q_UINT16 &checksum ) {
checksum += (i >> 24) & 0xff;
}
-void addToChecksum( QCString &cs, Q_UINT16 &checksum ) {
+void addToChecksum( TQCString &cs, Q_UINT16 &checksum ) {
int len = cs.length();
for (int i=0; i<len; i++)
checksum += (Q_UINT8)cs[i];
}
-void writeCString( QDataStream &stream, QCString &str ) {
+void writeCString( TQDataStream &stream, TQCString &str ) {
stream.writeRawBytes( str.data(), str.length() );
stream << (Q_UINT8)0;
}
@@ -98,9 +98,9 @@ Q_UINT32 mergeTagAndType( Q_UINT32 tag, Q_UINT32 type ) {
*
* The checksum is a 16 byte int with all bytes in the data added.
*/
-bool KTNEFWriter::writeProperty( QDataStream &stream, int &bytes, int tag) {
- QMap<int,KTNEFProperty*>& properties = mData->properties.properties();
- QMap<int,KTNEFProperty*>::Iterator it = properties.find( tag );
+bool KTNEFWriter::writeProperty( TQDataStream &stream, int &bytes, int tag) {
+ TQMap<int,KTNEFProperty*>& properties = mData->properties.properties();
+ TQMap<int,KTNEFProperty*>::Iterator it = properties.find( tag );
if ( it == properties.end() )
return false;
@@ -109,12 +109,12 @@ bool KTNEFWriter::writeProperty( QDataStream &stream, int &bytes, int tag) {
Q_UINT32 i;
Q_UINT16 checksum = 0;
- QValueList<QVariant> list;
- QString s;
- QCString cs, cs2;
- QDateTime dt;
- QDate date;
- QTime time;
+ TQValueList<TQVariant> list;
+ TQString s;
+ TQCString cs, cs2;
+ TQDateTime dt;
+ TQDate date;
+ TQTime time;
switch( tag ) {
case attMSGSTATUS:
// Q_UINT8
@@ -192,12 +192,12 @@ bool KTNEFWriter::writeProperty( QDataStream &stream, int &bytes, int tag) {
break;
case attFROM:
- // 2 QString encoded to a TRP structure
+ // 2 TQString encoded to a TRP structure
list = property->value().toList();
assert( list.count() == 2 );
cs = list[0].toString().local8Bit(); // Name
- cs2 = (QString("smtp:") + list[1].toString()).local8Bit(); // Email address
+ cs2 = (TQString("smtp:") + list[1].toString()).local8Bit(); // Email address
i = 18 + cs.length() + cs2.length(); // 2 * sizof(TRP) + strings + 2x'\0'
stream << (Q_UINT8)LVL_MESSAGE;
@@ -301,17 +301,17 @@ bool KTNEFWriter::writeProperty( QDataStream &stream, int &bytes, int tag) {
}
-bool KTNEFWriter::writeFile( QIODevice &file ) {
+bool KTNEFWriter::writeFile( TQIODevice &file ) {
if ( !file.open( IO_WriteOnly ) )
return false;
- QDataStream stream( &file );
+ TQDataStream stream( &file );
return writeFile( stream );
}
-bool KTNEFWriter::writeFile( QDataStream &stream ) {
- stream.setByteOrder( QDataStream::LittleEndian );
+bool KTNEFWriter::writeFile( TQDataStream &stream ) {
+ stream.setByteOrder( TQDataStream::LittleEndian );
// Start by writing the opening TNEF stuff
stream << TNEF_SIGNATURE;
@@ -341,18 +341,18 @@ bool KTNEFWriter::writeFile( QDataStream &stream ) {
}
-void KTNEFWriter::setSender(const QString &name, const QString &email) {
+void KTNEFWriter::setSender(const TQString &name, const TQString &email) {
assert( !name.isEmpty() );
assert( !email.isEmpty() );
- QVariant v1( name );
- QVariant v2( email );
+ TQVariant v1( name );
+ TQVariant v2( email );
- QValueList<QVariant> list;
+ TQValueList<TQVariant> list;
list << v1;
list << v2;
- QVariant v( list );
+ TQVariant v( list );
addProperty( attFROM, 0, list ); // What's up with the 0 here ??
}
@@ -360,31 +360,31 @@ void KTNEFWriter::setMessageType(MessageType m) {
// Note that the MessageType list here is probably not long enough,
// more entries are most likely needed later
- QVariant v;
+ TQVariant v;
switch( m ) {
case Appointment:
- v = QVariant( QString( "IPM.Appointment" ) );
+ v = TQVariant( TQString( "IPM.Appointment" ) );
break;
case MeetingCancelled:
- v = QVariant( QString( "IPM.Schedule.Meeting.Cancelled" ) );
+ v = TQVariant( TQString( "IPM.Schedule.Meeting.Cancelled" ) );
break;
case MeetingRequest:
- v = QVariant( QString( "IPM.Schedule.Meeting.Request" ) );
+ v = TQVariant( TQString( "IPM.Schedule.Meeting.Request" ) );
break;
case MeetingNo:
- v = QVariant( QString( "IPM.Schedule.Meeting.Resp.Neg" ) );
+ v = TQVariant( TQString( "IPM.Schedule.Meeting.Resp.Neg" ) );
break;
case MeetingYes:
- v = QVariant( QString( "IPM.Schedule.Meeting.Resp.Pos" ) );
+ v = TQVariant( TQString( "IPM.Schedule.Meeting.Resp.Pos" ) );
break;
case MeetingTent:
// Tent?
- v = QVariant( QString( "IPM.Schedule.Meeting.Resp.Tent" ) );
+ v = TQVariant( TQString( "IPM.Schedule.Meeting.Resp.Tent" ) );
break;
default:
@@ -407,8 +407,8 @@ void KTNEFWriter::clearAttendees()
}
-void KTNEFWriter::addAttendee( const QString& /*cn*/, Role /*r*/, PartStat /*p*/,
- bool /*rsvp*/, const QString& /*mailto*/ )
+void KTNEFWriter::addAttendee( const TQString& /*cn*/, Role /*r*/, PartStat /*p*/,
+ bool /*rsvp*/, const TQString& /*mailto*/ )
{
}
@@ -416,16 +416,16 @@ void KTNEFWriter::addAttendee( const QString& /*cn*/, Role /*r*/, PartStat /*p*/
// I assume this is the same as the sender?
// U also assume that this is like "Name <address>"
-void KTNEFWriter::setOrganizer( const QString& organizer ) {
+void KTNEFWriter::setOrganizer( const TQString& organizer ) {
int i = organizer.find( '<' );
if ( i == -1 )
return;
- QString name = organizer.left( i );
+ TQString name = organizer.left( i );
name.stripWhiteSpace();
- QString email = organizer.right( i+1 );
+ TQString email = organizer.right( i+1 );
email = email.left( email.length()-1 );
email.stripWhiteSpace();
@@ -433,65 +433,65 @@ void KTNEFWriter::setOrganizer( const QString& organizer ) {
}
-void KTNEFWriter::setDtStart( const QDateTime& dtStart ) {
- QVariant v( dtStart );
+void KTNEFWriter::setDtStart( const TQDateTime& dtStart ) {
+ TQVariant v( dtStart );
addProperty( attDATESTART, atpDATE, v );
}
-void KTNEFWriter::setDtEnd( const QDateTime& dtEnd ) {
- QVariant v( dtEnd );
+void KTNEFWriter::setDtEnd( const TQDateTime& dtEnd ) {
+ TQVariant v( dtEnd );
addProperty( attDATEEND, atpDATE, v );
}
-void KTNEFWriter::setLocation( const QString& /*location*/ )
+void KTNEFWriter::setLocation( const TQString& /*location*/ )
{
}
-void KTNEFWriter::setUID( const QString& uid ) {
- QVariant v( uid );
+void KTNEFWriter::setUID( const TQString& uid ) {
+ TQVariant v( uid );
addProperty( attMSGID, atpSTRING, v );
}
// Date sent
-void KTNEFWriter::setDtStamp( const QDateTime& dtStamp ) {
- QVariant v( dtStamp );
+void KTNEFWriter::setDtStamp( const TQDateTime& dtStamp ) {
+ TQVariant v( dtStamp );
addProperty( attDATESENT, atpDATE, v );
}
-void KTNEFWriter::setCategories( const QStringList& )
+void KTNEFWriter::setCategories( const TQStringList& )
{
}
// I hope this is the body
-void KTNEFWriter::setDescription( const QString &body ) {
- QVariant v( body );
+void KTNEFWriter::setDescription( const TQString &body ) {
+ TQVariant v( body );
addProperty( attBODY, atpTEXT, v );
}
-void KTNEFWriter::setSummary( const QString &s ) {
- QVariant v( s );
+void KTNEFWriter::setSummary( const TQString &s ) {
+ TQVariant v( s );
addProperty( attSUBJECT, atpSTRING, v );
}
// TNEF encoding: Normal = 3, high = 2, low = 1
// MAPI encoding: Normal = -1, high = 0, low = 1
void KTNEFWriter::setPriority( Priority p ) {
- QVariant v( (Q_UINT32)p );
+ TQVariant v( (Q_UINT32)p );
addProperty( attMSGPRIORITY, atpSHORT, v );
}
-void KTNEFWriter::setAlarm( const QString& /*description*/, AlarmAction /*action*/,
- const QDateTime& /*wakeBefore*/ )
+void KTNEFWriter::setAlarm( const TQString& /*description*/, AlarmAction /*action*/,
+ const TQDateTime& /*wakeBefore*/ )
{
}