kmail
TemplateParser Class Reference
List of all members.Detailed Description
Definition at line 32 of file templateparser.h.
Public Types | |
enum | Mode { NewMessage, Reply, ReplyAll, Forward } |
Public Member Functions | |
TemplateParser (KMMessage *amsg, const Mode amode, const QString aselection, bool aSmartQuote, bool anoQuote, bool aallowDecryption, bool aselectionIsBody) | |
~TemplateParser () | |
virtual void | process (KMMessage *aorig_msg, KMFolder *afolder=0, bool append=false) |
virtual void | process (const QString &tmplName, KMMessage *aorig_msg, KMFolder *afolder=0, bool append=false) |
virtual void | processWithTemplate (const QString &tmpl) |
virtual QString | findTemplate () |
virtual QString | findCustomTemplate (const QString &tmpl) |
virtual QString | pipe (const QString &cmd, const QString &buf) |
virtual QString | getFName (const QString &str) |
virtual QString | getLName (const QString &str) |
Static Public Attributes | |
static const int | PipeTimeout = 15 |
Protected Slots | |
void | onProcessExited (KProcess *proc) |
void | onReceivedStdout (KProcess *proc, char *buffer, int buflen) |
void | onReceivedStderr (KProcess *proc, char *buffer, int buflen) |
void | onWroteStdin (KProcess *proc) |
Protected Member Functions | |
QString | messageText (bool allowSelectionOnly) |
partNode * | parsedObjectTree () |
void | addProcessedBodyToMessage (const QString &body) |
int | parseQuotes (const QString &prefix, const QString &str, QString "e) const |
Protected Attributes | |
Mode | mMode |
KMFolder * | mFolder |
uint | mIdentity |
KMMessage * | mMsg |
KMMessage * | mOrigMsg |
QString | mSelection |
bool | mSmartQuote |
bool | mNoQuote |
bool | mAllowDecryption |
bool | mSelectionIsBody |
int | mPipeRc |
QString | mPipeOut |
QString | mPipeErr |
bool | mDebug |
QString | mQuoteString |
bool | mAppend |
QString | mTo |
QString | mCC |
partNode * | mOrigRoot |
Member Function Documentation
QString TemplateParser::findTemplate | ( | ) | [virtual] |
This finds the template to use.
Either the one from the folder, identity or finally the global template. This also reads the To and CC address of the template
- Returns:
- the contents of the template
Definition at line 961 of file templateparser.cpp.
QString TemplateParser::findCustomTemplate | ( | const QString & | tmpl | ) | [virtual] |
Finds the template with the given name.
This also reads the To and CC address of the template
- Returns:
- the contents of the template
Definition at line 948 of file templateparser.cpp.
QString TemplateParser::messageText | ( | bool | allowSelectionOnly | ) | [protected] |
If there was a text selection set in the constructor, that will be returned.
Otherwise, returns the plain text of the original message, as in KMMessage::asPlainText(). The only difference is that this uses the cached object tree from parsedObjectTree()
- Parameters:
-
allowSelectionOnly if false, it will always return the complete mail text
Definition at line 857 of file templateparser.cpp.
partNode * TemplateParser::parsedObjectTree | ( | ) | [protected] |
Returns the parsed object tree of the original message.
The result is cached in mOrigRoot, therefore calling this multiple times will only parse the tree once.
Definition at line 867 of file templateparser.cpp.
void TemplateParser::addProcessedBodyToMessage | ( | const QString & | body | ) | [protected] |
Called by processWithTemplate().
This adds the completely processed body to the message.
In append mode, this will simply append the text to the body.
Otherwise, the content of the old message is deleted and replaced with body
. Attachments of the original message are also added back to the new message.
Definition at line 878 of file templateparser.cpp.
The documentation for this class was generated from the following files: