From 7be55ffa061c026e35e2d6a0effe1161ddb0d41f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:53:50 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmail/kmmessage.h | 276 +++++++++++++++++++++++++++--------------------------- 1 file changed, 138 insertions(+), 138 deletions(-) (limited to 'kmail/kmmessage.h') diff --git a/kmail/kmmessage.h b/kmail/kmmessage.h index a19c9d510..f4353b836 100644 --- a/kmail/kmmessage.h +++ b/kmail/kmmessage.h @@ -40,8 +40,8 @@ namespace KMime { namespace Types { class AddrSpec; class Address; - typedef QValueList
AddressList; - typedef QValueList AddrSpecList; + typedef TQValueList
AddressList; + typedef TQValueList AddrSpecList; } } @@ -161,9 +161,9 @@ public: required header fields with the proper values. The returned message is not stored in any folder. Marks this message as replied. */ KMMessage* createReply( KMail::ReplyStrategy replyStrategy = KMail::ReplySmart, - QString selection=QString::null, bool noQuote=false, + TQString selection=TQString::null, bool noQuote=false, bool allowDecryption=true, bool selectionIsBody=false, - const QString &tmpl = QString::null ); + const TQString &tmpl = TQString::null ); /** Create a new message that is a redirect to this message, filling all required header fields with the proper values. The returned message @@ -172,15 +172,15 @@ public: user, mail is not changed and the reply-to field is set to the email address of the original sender */ - KMMessage* createRedirect( const QString &toStr ); + KMMessage* createRedirect( const TQString &toStr ); /** Create the forwarded body for the message. */ - QCString createForwardBody(); + TQCString createForwardBody(); /** Create a new message that is a forward of this message, filling all required header fields with the proper values. The returned message is not stored in any folder. Marks this message as forwarded. */ - KMMessage* createForward( const QString &tmpl = QString::null ); + KMMessage* createForward( const TQString &tmpl = TQString::null ); /** Create a new message that is a delivery receipt of this message, filling required header fileds with the proper values. The @@ -203,15 +203,15 @@ public: KMMessage* createMDN( KMime::MDN::ActionMode a, KMime::MDN::DispositionType d, bool allowGUI=false, - QValueList m=QValueList() ); + TQValueList m=TQValueList() ); /** Remove all headers but the content description ones, and those in the white list. */ - void sanitizeHeaders( const QStringList& whiteList = QStringList() ); + void sanitizeHeaders( const TQStringList& whiteList = TQStringList() ); /** Parse the string and create this message from it. */ void fromDwString(const DwString& str, bool setStatus=false); - void fromString(const QCString& str, bool setStatus=false); - void fromByteArray(const QByteArray & ba, bool setStatus=false); + void fromString(const TQCString& str, bool setStatus=false); + void fromByteArray(const TQByteArray & ba, bool setStatus=false); /** Return the entire message contents in the DwString. This function is *fast* even for large message since it does *not* involve a @@ -227,19 +227,19 @@ public: underlying mimelib, then you should use the asDwString function. @see asDwString */ - QCString asString() const; + TQCString asString() const; /** * Return the message contents with the headers that should not be * sent stripped off. */ - QByteArray asSendableString() const; + TQByteArray asSendableString() const; /** * Return the message header with the headers that should not be * sent stripped off. */ - QCString headerAsSendableString() const; + TQCString headerAsSendableString() const; /** * Remove all private header fields: *Status: and X-KMail-* @@ -250,15 +250,15 @@ public: DwMediaType& dwContentType(); /** Return header as string. */ - QString headerAsString() const; + TQString headerAsString() const; /** Returns a decoded body part string to be further processed by function asQuotedString(). THIS FUNCTION WILL BE REPLACED ONCE KMime IS FULLY INTEGRATED (khz, June 05 2002)*/ void parseTextStringFromDwPart( partNode * root, - QCString& parsedString, - const QTextCodec*& codec, + TQCString& parsedString, + const TQTextCodec*& codec, bool& isHTML ) const; /** Initialize header fields. Should be called on new messages @@ -293,78 +293,78 @@ public: void setAutomaticFields(bool isMultipart=false); /** Get or set the 'Date' header field */ - QString dateStr() const; + TQString dateStr() const; /** Returns the message date in asctime format or an empty string if the message lacks a Date header. */ - QCString dateShortStr() const; - QString dateIsoStr() const; + TQCString dateShortStr() const; + TQString dateIsoStr() const; time_t date() const; - void setDate(const QCString& str); + void setDate(const TQCString& str); void setDate(time_t aUnixTime); /** Set the 'Date' header field to the current date. */ void setDateToday(); /** Get or set the 'To' header field */ - QString to() const; - void setTo(const QString& aStr); - QString toStrip() const; + TQString to() const; + void setTo(const TQString& aStr); + TQString toStrip() const; /** Get or set the 'ReplyTo' header field */ - QString replyTo() const; - void setReplyTo( const QString &aStr ); + TQString replyTo() const; + void setReplyTo( const TQString &aStr ); void setReplyTo(KMMessage*); /** Get or set the 'Cc' header field */ - QString cc() const; - void setCc( const QString &aStr ); - QString ccStrip() const; + TQString cc() const; + void setCc( const TQString &aStr ); + TQString ccStrip() const; /** Get or set the 'Bcc' header field */ - QString bcc() const; - void setBcc( const QString &aStr ); + TQString bcc() const; + void setBcc( const TQString &aStr ); /** Get or set the 'Fcc' header field */ - QString fcc() const; - void setFcc( const QString &aStr ); + TQString fcc() const; + void setFcc( const TQString &aStr ); /** Get or set the 'Drafts' folder */ - QString drafts() const { return mDrafts; } - void setDrafts( const QString &aStr ); + TQString drafts() const { return mDrafts; } + void setDrafts( const TQString &aStr ); /** Get or set the 'Templates' folder */ - QString templates() const { return mTemplates; } - void setTemplates( const QString &aStr ); + TQString templates() const { return mTemplates; } + void setTemplates( const TQString &aStr ); /** Get or set the 'From' header field */ - QString from() const; - void setFrom(const QString& aStr); - QString fromStrip() const; + TQString from() const; + void setFrom(const TQString& aStr); + TQString fromStrip() const; /** @return The addr-spec of either the Sender: (if one is given) or * the first addr-spec in From: */ - QString sender() const; + TQString sender() const; /** Get or set the 'Who' header field. The actual field that is returned depends on the contents of the owning folders whoField(). Usually this is 'From', but it can also contain 'To'. */ - QString who() const; + TQString who() const; /** Get or set the 'Subject' header field */ - QString subject() const; - void setSubject(const QString& aStr); + TQString subject() const; + void setSubject(const TQString& aStr); /** Calculate strippedSubject */ void initStrippedSubjectMD5() {}; /** Get or set the 'X-Mark' header field */ - QString xmark() const; - void setXMark(const QString& aStr); + TQString xmark() const; + void setXMark(const TQString& aStr); /** Get or set the 'In-Reply-To' header field */ - QString replyToId() const; - void setReplyToId(const QString& aStr); - QString replyToIdMD5() const; + TQString replyToId() const; + void setReplyToId(const TQString& aStr); + TQString replyToIdMD5() const; /** Get the second to last id from the References header field. If outgoing messages are not kept in the same @@ -380,13 +380,13 @@ public: using replyToAuxIdMD5 */ - QString replyToAuxIdMD5() const; + TQString replyToAuxIdMD5() const; /** Get a hash of the subject with all prefixes such as Re: removed. Used for threading. */ - QString strippedSubjectMD5() const; + TQString strippedSubjectMD5() const; /** Validate a list of email addresses, and also allow @@ -398,29 +398,29 @@ public: requires moving expandAliases and all that it brings */ - static KPIM::EmailParseResult isValidEmailAddressList( const QString& aStr, - QString& brokenAddress ); + static KPIM::EmailParseResult isValidEmailAddressList( const TQString& aStr, + TQString& brokenAddress ); /** Get a hash of the subject. Used for threading. */ - QString subjectMD5() const; + TQString subjectMD5() const; /** Is the subject prefixed by Re: or similar? */ bool subjectIsPrefixed() const; /** Get or set the 'Message-Id' header field */ - QString msgId() const; - void setMsgId(const QString& aStr); - QString msgIdMD5() const; + TQString msgId() const; + void setMsgId(const TQString& aStr); + TQString msgIdMD5() const; /** Get or set the references for this message */ - QString references() const; - void setReferences(const QCString& aStr); + TQString references() const; + void setReferences(const TQCString& aStr); /** Returns the message ID, useful for followups */ - QCString id() const; + TQCString id() const; /** Sets the message serial number. If defaulted to zero, the serial number will be assigned using the dictionary. Note that @@ -432,7 +432,7 @@ public: header fields with the given name might exist then you should use headerFields() instead. */ - QString headerField(const QCString& name) const; + TQString headerField(const TQCString& name) const; enum HeaderFieldType { Unstructured, Structured, Address }; @@ -440,57 +440,57 @@ public: If prepend is set to true, the header is inserted at the beginning and does not overwrite an existing header field with the same name. */ - void setHeaderField( const QCString& name, const QString& value, + void setHeaderField( const TQCString& name, const TQString& value, HeaderFieldType type = Unstructured, bool prepend = false ); /** Returns a list of the values of all header fields with the given name. */ - QStringList headerFields( const QCString& name ) const; + TQStringList headerFields( const TQCString& name ) const; /** Returns the raw value of a header field with the given name. If multiple header fields with the given name might exist then you should use rawHeaderFields() instead. */ - QCString rawHeaderField( const QCString & name ) const; + TQCString rawHeaderField( const TQCString & name ) const; /** Returns a list of the raw values of all header fields with the given name. */ - QValueList rawHeaderFields( const QCString & field ) const; + TQValueList rawHeaderFields( const TQCString & field ) const; /** Splits the given address list into separate addresses. */ - static KMime::Types::AddressList splitAddrField( const QCString & str ); + static KMime::Types::AddressList splitAddrField( const TQCString & str ); /** Returns header address list as string list. Valid for the following fields: To, Bcc, Cc, ReplyTo, ResentBcc, ResentCc, ResentReplyTo, ResentTo */ - KMime::Types::AddressList headerAddrField(const QCString& name) const; - KMime::Types::AddrSpecList extractAddrSpecs( const QCString & headerNames ) const; + KMime::Types::AddressList headerAddrField(const TQCString& name) const; + KMime::Types::AddrSpecList extractAddrSpecs( const TQCString & headerNames ) const; /** Remove header field with given name */ - void removeHeaderField(const QCString& name); + void removeHeaderField(const TQCString& name); /** Remove all header fields with given name */ - void removeHeaderFields(const QCString& name); + void removeHeaderFields(const TQCString& name); /** Get or set the 'Content-Type' header field The member functions that involve enumerated types (ints) will work only for well-known types or subtypes. */ - QCString typeStr() const; + TQCString typeStr() const; int type() const; - void setTypeStr(const QCString& aStr); + void setTypeStr(const TQCString& aStr); void setType(int aType); /** Subtype */ - QCString subtypeStr() const; + TQCString subtypeStr() const; int subtype() const; - void setSubtypeStr(const QCString& aStr); + void setSubtypeStr(const TQCString& aStr); void setSubtype(int aSubtype); /** add or change a parameter of a DwMediaType field */ static void setDwMediaTypeParam( DwMediaType &mType, - const QCString& attr, - const QCString& val ); + const TQCString& attr, + const TQCString& val ); /** add or change a parameter of the Content-Type field */ - void setContentTypeParam(const QCString& attr, const QCString& val); + void setContentTypeParam(const TQCString& attr, const TQCString& val); /** get the DwHeaders (make sure to call setNeedsAssembly() function after directly @@ -506,48 +506,48 @@ public: /** Get or set the 'Content-Transfer-Encoding' header field The member functions that involve enumerated types (ints) will work only for well-known encodings. */ - QCString contentTransferEncodingStr() const; + TQCString contentTransferEncodingStr() const; int contentTransferEncoding() const; - void setContentTransferEncodingStr(const QCString& aStr); + void setContentTransferEncodingStr(const TQCString& aStr); void setContentTransferEncoding(int aCte); /** Cte is short for ContentTransferEncoding. These functions are an alternative to the ones with longer names. */ - QCString cteStr() const { return contentTransferEncodingStr(); } + TQCString cteStr() const { return contentTransferEncodingStr(); } int cte() const { return contentTransferEncoding(); } - void setCteStr(const QCString& aStr) { setContentTransferEncodingStr(aStr); } + void setCteStr(const TQCString& aStr) { setContentTransferEncodingStr(aStr); } void setCte(int aCte) { setContentTransferEncoding(aCte); } /** Sets this body part's content to @p str. @p str is subject to automatic charset and CTE detection. **/ - void setBodyFromUnicode( const QString & str ); + void setBodyFromUnicode( const TQString & str ); /** Returns the body part decoded to unicode. **/ - QString bodyToUnicode(const QTextCodec* codec=0) const; + TQString bodyToUnicode(const TQTextCodec* codec=0) const; /** Get the message body. Does not decode the body. */ - QCString body() const; + TQCString body() const; /** Set the message body. Does not encode the body. */ - void setBody(const QCString& aStr); + void setBody(const TQCString& aStr); void setBody(const DwString& aStr); void setBody(const char* aStr); // avoid ambiguous calls /** Hack to enable structured body parts to be set as flat text... */ - void setMultiPartBody( const QCString & aStr ); + void setMultiPartBody( const TQCString & aStr ); /** Set the message body, encoding it according to the current content transfer encoding. The first method for null terminated strings, the second for binary data */ - void setBodyEncoded(const QCString& aStr); - void setBodyEncodedBinary(const QByteArray& aStr); + void setBodyEncoded(const TQCString& aStr); + void setBodyEncodedBinary(const TQByteArray& aStr); /** Returns a list of content-transfer-encodings that can be used with the given result of the character frequency analysis of a message or message part under the given restrictions. */ - static QValueList determineAllowedCtes( const KMime::CharFreq& cf, + static TQValueList determineAllowedCtes( const KMime::CharFreq& cf, bool allow8Bit, bool willBeSigned ); @@ -560,20 +560,20 @@ public: @param allow8Bit whether "8bit" is allowed as cte. @param willBeSigned whether "7bit"/"8bit" is allowed as cte according to RFC 3156 */ - void setBodyAndGuessCte( const QByteArray& aBuf, - QValueList& allowedCte, + void setBodyAndGuessCte( const TQByteArray& aBuf, + TQValueList& allowedCte, bool allow8Bit = false, bool willBeSigned = false ); - void setBodyAndGuessCte( const QCString& aBuf, - QValueList& allowedCte, + void setBodyAndGuessCte( const TQCString& aBuf, + TQValueList& allowedCte, bool allow8Bit = false, bool willBeSigned = false ); /** Returns a decoded version of the body from the current content transfer encoding. The first method returns a null terminated string, the second method is meant for binary data, not null is appended */ - QCString bodyDecoded() const; - QByteArray bodyDecodedBinary() const; + TQCString bodyDecoded() const; + TQByteArray bodyDecodedBinary() const; /** Number of body parts the message has. This is one for plain messages without any attachment. */ @@ -585,11 +585,11 @@ public: /** Return the first DwBodyPart matching a given Content-Type or zero, if no found. */ - DwBodyPart * findDwBodyPart( const QCString& type, const QCString& subtype ) const; + DwBodyPart * findDwBodyPart( const TQCString& type, const TQCString& subtype ) const; /** Return the first DwBodyPart matching a given partSpecifier or zero, if no found. */ - DwBodyPart* findDwBodyPart( DwBodyPart* part, const QString & partSpecifier ); + DwBodyPart* findDwBodyPart( DwBodyPart* part, const TQString & partSpecifier ); /** Get the DwBodyPart at position in aIdx. Indexing starts at 0. If there is no body part at that index, return value will be zero. */ @@ -635,22 +635,22 @@ public: * defined by the user or the given email address as suffix. The address * must be given as addr-spec as defined in RFC 2822. */ - static QString generateMessageId( const QString& addr ); + static TQString generateMessageId( const TQString& addr ); /** Convert '<' into "<" resp. '>' into ">" in order to * prevent their interpretation by KHTML. * Does *not* use the Qt replace function but runs a very fast C code * the same way as lf2crlf() does. */ - static QCString html2source( const QCString & src ); + static TQCString html2source( const TQCString & src ); /** Encodes an email address as mailto URL */ - static QString encodeMailtoUrl( const QString& str ); + static TQString encodeMailtoUrl( const TQString& str ); /** Decodes a mailto URL */ - static QString decodeMailtoUrl( const QString& url ); + static TQString decodeMailtoUrl( const TQString& url ); /** This function generates a displayable string from a list of email addresses. @@ -658,52 +658,52 @@ public: Output: comma separated list of display name resp. comment resp. address */ - static QCString stripEmailAddr(const QCString& emailAddr); + static TQCString stripEmailAddr(const TQCString& emailAddr); /** Does the same as the above function. Shouldn't be used. */ - static QString stripEmailAddr(const QString& emailAddr); + static TQString stripEmailAddr(const TQString& emailAddr); /** Quotes the following characters which have a special meaning in HTML: * '<' '>' '&' '"'. Additionally '\\n' is converted to "
" if * @p removeLineBreaks is false. If @p removeLineBreaks is true, then * '\\n' is removed. Last but not least '\\r' is removed. */ - static QString quoteHtmlChars( const QString& str, + static TQString quoteHtmlChars( const TQString& str, bool removeLineBreaks = false ); /** Converts the email address(es) to (a) nice HTML mailto: anchor(s). * If stripped is TRUE then the visible part of the anchor contains * only the name part and not the given emailAddr. */ - static QString emailAddrAsAnchor(const QString& emailAddr, - bool stripped=true, const QString& cssStyle = QString::null, bool link = true); + static TQString emailAddrAsAnchor(const TQString& emailAddr, + bool stripped=true, const TQString& cssStyle = TQString::null, bool link = true); /** Strips an address from an address list. This is for example used when replying to all. */ - static QStringList stripAddressFromAddressList( const QString& address, - const QStringList& addresses ); + static TQStringList stripAddressFromAddressList( const TQString& address, + const TQStringList& addresses ); /** Strips all the user's addresses from an address list. This is used when replying. */ - static QStringList stripMyAddressesFromAddressList( const QStringList& list ); + static TQStringList stripMyAddressesFromAddressList( const TQStringList& list ); /** Returns true if the given address is contained in the given address list. */ - static bool addressIsInAddressList( const QString& address, - const QStringList& addresses ); + static bool addressIsInAddressList( const TQString& address, + const TQStringList& addresses ); /** Expands aliases (distribution lists and nick names) and appends a domain part to all email addresses which are missing the domain part. */ - static QString expandAliases( const QString& recipients ); + static TQString expandAliases( const TQString& recipients ); /** Uses the hostname as domain part and tries to determine the real name from the entries in the password file. */ - static QString guessEmailAddressFromLoginName( const QString& userName ); + static TQString guessEmailAddressFromLoginName( const TQString& userName ); /** * Given argument msg add quoting characters and relayout for max width maxLength @@ -711,28 +711,28 @@ public: * @param maxLineLength reformat text to be this amount of columns at maximum, adding * linefeeds at word boundaries to make it fit. */ - static QString smartQuote( const QString &msg, int maxLineLength ); + static TQString smartQuote( const TQString &msg, int maxLineLength ); /** Get the default message charset.*/ - static QCString defaultCharset(); + static TQCString defaultCharset(); /** Get a list of preferred message charsets.*/ - static const QStringList &preferredCharsets(); + static const TQStringList &preferredCharsets(); /** Replaces every occurrence of "${foo}" in @p s with headerField("foo") */ - QString replaceHeadersInString( const QString & s ) const; + TQString replaceHeadersInString( const TQString & s ) const; /** Get the message charset.*/ - QCString charset() const; + TQCString charset() const; /** Set the message charset. */ - void setCharset(const QCString& aStr); + void setCharset(const TQCString& aStr); - /** Get a QTextCodec suitable for this message part */ - const QTextCodec * codec() const; + /** Get a TQTextCodec suitable for this message part */ + const TQTextCodec * codec() const; /** Set the charset the user selected for the message to display */ - void setOverrideCodec( const QTextCodec* codec ) { mOverrideCodec = codec; } + void setOverrideCodec( const TQTextCodec* codec ) { mOverrideCodec = codec; } /** Allow decoding of HTML for quoting */ void setDecodeHTML(bool aDecodeHTML) @@ -745,15 +745,15 @@ public: /** Creates reference string for reply to messages. * reference = original first reference + original last reference + original msg-id */ - QCString getRefStr() const; + TQCString getRefStr() const; /** Get/set offset in mail folder. */ off_t folderOffset() const { return mFolderOffset; } void setFolderOffset(off_t offs) { if(mFolderOffset != offs) { mFolderOffset=offs; setDirty(true); } } /** Get/set filename in mail folder. */ - QString fileName() const { return mFileName; } - void setFileName(const QString& file) { if(mFileName != file) { mFileName=file; setDirty(true); } } + TQString fileName() const { return mFileName; } + void setFileName(const TQString& file) { if(mFileName != file) { mFileName=file; setDirty(true); } } /** Get/set size of message in the folder including the whole header in bytes. Can be 0, if the message is not in a folder. @@ -804,10 +804,10 @@ public: void getLink(int n, ulong *retMsgSerNum, KMMsgStatus *retStatus) const; /** Convert wildcards into normal string */ - QString formatString(const QString&) const; + TQString formatString(const TQString&) const; /** Sets the body of the specified part */ - void updateBodyPart(const QString partSpecifier, const QByteArray & data); + void updateBodyPart(const TQString partSpecifier, const TQByteArray & data); /** Returns the last DwBodyPart that was updated */ DwBodyPart* lastUpdatedPart() { return mLastUpdated; } @@ -833,7 +833,7 @@ public: string of the form "From local@domain.invalid Sat Jun 12 14:00:00 2004\n". */ - QCString mboxMessageSeparator(); + TQCString mboxMessageSeparator(); /** Returns message body with quoting header and indented by the given indentation string. This is suitable for including the message @@ -850,15 +850,15 @@ public: The signature is stripped if aStripSignature is true and smart quoting is turned on. Signed or encrypted texts get converted to plain text when allowDecryption is true. */ - QString asQuotedString( const QString & headerStr, - const QString & indentStr, - const QString & selection=QString::null, + TQString asQuotedString( const TQString & headerStr, + const TQString & indentStr, + const TQString & selection=TQString::null, bool aStripSignature=true, bool allowDecryption=true) const; /** Return the textual content of the message as plain text, converting HTML to plain text if necessary. */ - QString asPlainText( bool stripSignature, bool allowDecryption ) const; + TQString asPlainText( bool stripSignature, bool allowDecryption ) const; /** Get stored cursor position */ int getCursorPos() { return mCursorPos; }; @@ -886,8 +886,8 @@ private: /** Assign the values of @param other to this message. Used in the copy c'tor. */ void assign( const KMMessage& other ); - QString mDrafts; - QString mTemplates; + TQString mDrafts; + TQString mTemplates; mutable DwMessage* mMsg; mutable bool mNeedsAssembly :1; bool mDecodeHTML :1; @@ -895,10 +895,10 @@ private: bool mComplete :1; bool mIsParsed : 1; static const KMail::HeaderStrategy * sHeaderStrategy; - static QString sForwardStr; - const QTextCodec * mOverrideCodec; + static TQString sForwardStr; + const TQTextCodec * mOverrideCodec; - QString mFileName; + TQString mFileName; off_t mFolderOffset; size_t mMsgSize, mMsgLength; time_t mDate; @@ -909,7 +909,7 @@ private: DwBodyPart* mLastUpdated; int mCursorPos; KMMsgInfo* mMsgInfo; // used to remember the KMMsgInfo object this KMMessage replaced in the KMMsgList - static QValueList sPendingDeletes; + static TQValueList sPendingDeletes; }; -- cgit v1.2.1