KTNEF Library
KTnef::KTNEFWriter Class Reference
#include <ktnefwriter.h>
Detailed Description
Manages the writing of TNEF attachments.Definition at line 49 of file ktnefwriter.h.
Public Types | |
enum | MessageType { Appointment, MeetingCancelled, MeetingRequest, MeetingNo, MeetingYes, MeetingTent } |
enum | Method { PublishNew, Obsolete, RequestNew, RequestUpdate, Unknown } |
enum | Role { ReqParticipant, OptParticipant, NonParticipant, Chair } |
enum | PartStat { NeedsAction, Accepted, Declined, Tentative, Delegated, Completed, InProcess } |
enum | Priority { High = 2, Normal = 3, Low = 1 } |
enum | AlarmAction { Display } |
Public Member Functions | |
KTNEFWriter () | |
~KTNEFWriter () | |
void | addProperty (int tag, int type, const QVariant &value) |
bool | writeProperty (QDataStream &stream, int &bytes, int tag) const |
bool | writeFile (QIODevice &file) const |
bool | writeFile (QDataStream &stream) const |
void | setSender (const QString &name, const QString &email) |
void | setMessageType (MessageType methodType) |
void | setMethod (Method method) |
void | clearAttendees () |
void | addAttendee (const QString &name, Role role, PartStat partstat, bool rsvp, const QString &email) |
void | setOrganizer (const QString &organizer) |
void | setDtStart (const QDateTime &dtStart) |
void | setDtEnd (const QDateTime &dtEnd) |
void | setLocation (const QString &location) |
void | setUID (const QString &uid) |
void | setDtStamp (const QDateTime &dtStamp) |
void | setCategories (const QStringList &categories) |
void | setDescription (const QString &description) |
void | setSummary (const QString &summary) |
void | setPriority (Priority priority) |
void | setAlarm (const QString &description, AlarmAction action, const QDateTime &wakeBefore) |
Member Enumeration Documentation
The different types of messages.
- Enumerator:
Definition at line 54 of file ktnefwriter.h.
The different types of message statuses.
- Enumerator:
-
PublishNew Publish new. Obsolete Replace the message. RequestNew Request a new message. RequestUpdate Request an update. Unknown Unknown.
Definition at line 66 of file ktnefwriter.h.
The different types of meeting roles.
- Enumerator:
-
ReqParticipant Required participant. OptParticipant Optional participant. NonParticipant Non-participant. Chair Meeting chairperson.
Definition at line 77 of file ktnefwriter.h.
The different types of participant statuses.
- Enumerator:
Definition at line 87 of file ktnefwriter.h.
Constructor & Destructor Documentation
KTNEFWriter::KTNEFWriter | ( | ) |
Constructs a TNEF writer object.
Private class that helps to provide binary compatibility between releases.
Definition at line 62 of file ktnefwriter.cpp.
KTNEFWriter::~KTNEFWriter | ( | ) |
Member Function Documentation
void KTNEFWriter::addProperty | ( | int | tag, | |
int | type, | |||
const QVariant & | value | |||
) |
Adds a TNEF property.
- Parameters:
-
tag is the TNEF tag type is the property type value is the property value
Definition at line 85 of file ktnefwriter.cpp.
bool KTNEFWriter::writeProperty | ( | QDataStream & | stream, | |
int & | bytes, | |||
int | tag | |||
) | const |
Writes a TNEF property to the QDataStream specified by stream
.
A TNEF property has a 1 byte type (LVL_MESSAGE or LVL_ATTACHMENT), a 4 byte type/tag, a 4 byte length, the data and finally the checksum.
The checksum is a 16 byte int with all bytes in the data added.
- Parameters:
-
stream is the QDataStream to write bytes is a pointer to an int type that will contain the number of bytes written to the stream
tag is the TNEF tag
- Returns:
- false if an invalid TNEF tag was specified by
tag
or if there are no properties to write; else true.
Definition at line 126 of file ktnefwriter.cpp.
bool KTNEFWriter::writeFile | ( | QIODevice & | file | ) | const |
Writes the attachment to the QIODevice specified by file
.
- Parameters:
-
file is the QIODevice to write.
- Returns:
- true if the write was successful; otherwise false.
Definition at line 330 of file ktnefwriter.cpp.
bool KTNEFWriter::writeFile | ( | QDataStream & | stream | ) | const |
Writes the attachment to the QDataStream specified by stream
.
- Parameters:
-
stream is the QDataStream to write.
- Returns:
- true if the write was successful; otherwise false.
Definition at line 340 of file ktnefwriter.cpp.
void KTNEFWriter::setSender | ( | const QString & | name, | |
const QString & | ||||
) |
Sets the sender's name
and email
address.
- Parameters:
-
name is the sender's name. email is the sender's email address.
Definition at line 372 of file ktnefwriter.cpp.
void KTNEFWriter::setMessageType | ( | MessageType | methodType | ) |
Sets the MessageType to methodType
.
- Parameters:
-
methodType is the MessageType.
Definition at line 388 of file ktnefwriter.cpp.
void KTNEFWriter::setMethod | ( | Method | method | ) |
Sets the Method to method
.
- Parameters:
-
method is the Method.
Definition at line 428 of file ktnefwriter.cpp.
void KTNEFWriter::clearAttendees | ( | ) |
void KTNEFWriter::addAttendee | ( | const QString & | name, | |
Role | role, | |||
PartStat | partstat, | |||
bool | rsvp, | |||
const QString & | ||||
) |
Adds a meeting participant (attendee).
- Parameters:
-
name is the name of the attendee role is the Role of the attendee partstat is the status PartStat of the attendee rsvp is true if the attendee will attend the meeting; else false email is the email address of the attendee
Definition at line 440 of file ktnefwriter.cpp.
void KTNEFWriter::setOrganizer | ( | const QString & | organizer | ) |
Sets the name of the organizer to organizer
.
The organizer is any string identifier; it could be the name of a person, or the application that sent the invitation, for example.
- Parameters:
-
organizer is the organizer identifier.
Definition at line 450 of file ktnefwriter.cpp.
void KTNEFWriter::setDtStart | ( | const QDateTime & | dtStart | ) |
Sets the Starting Date and Time to dtStart
.
- Parameters:
-
dtStart is the starting date/time.
Definition at line 468 of file ktnefwriter.cpp.
void KTNEFWriter::setDtEnd | ( | const QDateTime & | dtEnd | ) |
Sets the Ending Date and Time to dtEnd
.
- Parameters:
-
dtEnd is the ending date/time.
Definition at line 474 of file ktnefwriter.cpp.
void KTNEFWriter::setLocation | ( | const QString & | location | ) |
Sets the Location to location
.
- Parameters:
-
location is the location.
Definition at line 480 of file ktnefwriter.cpp.
void KTNEFWriter::setUID | ( | const QString & | uid | ) |
void KTNEFWriter::setDtStamp | ( | const QDateTime & | dtStamp | ) |
Sets the timestamp to dtStamp
.
- Parameters:
-
dtStamp is the timestamp.
Definition at line 492 of file ktnefwriter.cpp.
void KTNEFWriter::setCategories | ( | const QStringList & | categories | ) |
Sets the category list to categories
.
- Parameters:
-
categories is the list categories.
Definition at line 498 of file ktnefwriter.cpp.
void KTNEFWriter::setDescription | ( | const QString & | description | ) |
Sets the description to description
.
- Parameters:
-
description is the description.
Definition at line 504 of file ktnefwriter.cpp.
void KTNEFWriter::setSummary | ( | const QString & | summary | ) |
Sets the summary to summary
.
- Parameters:
-
summary is the summary.
Definition at line 510 of file ktnefwriter.cpp.
void KTNEFWriter::setPriority | ( | Priority | priority | ) |
Sets the priority to priority
.
- Parameters:
-
priority is the Priority.
Definition at line 518 of file ktnefwriter.cpp.
void KTNEFWriter::setAlarm | ( | const QString & | description, | |
AlarmAction | action, | |||
const QDateTime & | wakeBefore | |||
) |
Sets the alarm.
- Parameters:
-
description is the alarm description action is the alaram AlarmAction wakeBefore is the alarm Date/Time
Definition at line 524 of file ktnefwriter.cpp.
The documentation for this class was generated from the following files: