/usr/include/ktnef/ktnefwriter.h is in kdepimlibs5-dev 4:4.13.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | /*
ktnefwriter.cpp
Copyright (C) 2002 Bo Thorsen <bo@sonofthor.dk>
This file is part of KTNEF, the KDE TNEF support library/program.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
/**
* @file
* This file is part of the API for handling TNEF data and
* defines the KTNEFWriter class.
*
* @author Bo Thorsen
*/
#ifndef KTNEFWRITER_H
#define KTNEFWRITER_H
class QString;
class QVariant;
class QIODevice;
class QDataStream;
class QDateTime;
class QStringList;
#include "ktnef_export.h"
#include <qglobal.h>
namespace KTnef {
/**
* @brief
* Manages the writing of @acronym TNEF attachments.
*/
class KTNEF_EXPORT KTNEFWriter
{
public:
/**
* The different types of messages.
*/
enum MessageType {
Appointment, /**< Appointment */
MeetingCancelled,/**< The meeting is cancelled */
MeetingRequest, /**< Meeting request */
MeetingNo, /**< Negative response to a meeting request */
MeetingYes, /**< Affirmative response to a meeting request */
MeetingTent /**< Tentative affirmative to a meeting request */
};
/**
* The different types of message statuses.
*/
enum Method {
PublishNew, /**< Publish new */
Obsolete, /**< Replace the message */
RequestNew, /**< Request a new message */
RequestUpdate, /**< Request an update */
Unknown /**< Unknown */
};
/**
* The different types of meeting roles.
*/
enum Role {
ReqParticipant, /**< Required participant */
OptParticipant, /**< Optional participant */
NonParticipant, /**< Non-participant */
Chair /**< Meeting chairperson */
};
/**
* The different types of participant statuses.
*/
enum PartStat {
NeedsAction, /**< No information about the task/invitation received */
Accepted, /**< Accepted the task/invitation */
Declined, /**< Declined the task/invitation */
Tentative, /**< Tentatively accepted the task/invitation */
Delegated, /**< Delegated the task to another */
Completed, /**< Completed the task */
InProcess /**< Work on the task is in-progress */
};
/**
* The different priorities.
*/
enum Priority {
High = 2, /**< High priority task */
Normal = 3, /**< Normal priority task */
Low = 1 /**< Low priority task */
};
/**
* The different alarm actions.
*/
enum AlarmAction {
Display /**< Display the alarm */
};
/**
* Constructs a @acronym TNEF writer object.
*/
KTNEFWriter();
/**
* Destroys the @acronym TNEF writer object.
*/
~KTNEFWriter();
/**
* Adds a @acronym TNEF property.
*
* @param tag is the @acronym TNEF tag
* @param type is the property type
* @param value is the property value
*/
void addProperty( int tag, int type, const QVariant &value );
/**
* Writes a @acronym TNEF property to the #QDataStream specified by @p stream.
*
* A @acronym 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.
*
* @param stream is the #QDataStream to write
* @param bytes is a pointer to an int type that will contain
* the number of bytes written to the @p stream
* @param tag is the @acronym TNEF tag
*
* @return false if an invalid @acronym TNEF tag was specified by @p tag or
* if there are no properties to write; else true.
*/
bool writeProperty( QDataStream &stream, int &bytes, int tag ) const;
/**
* Writes the attachment to the #QIODevice specified by @p file.
*
* @param file is the #QIODevice to write.
* @return true if the write was successful; otherwise false.
*/
bool writeFile( QIODevice &file ) const;
/**
* Writes the attachment to the #QDataStream specified by @p stream.
*
* @param stream is the #QDataStream to write.
* @return true if the write was successful; otherwise false.
*/
bool writeFile( QDataStream &stream ) const;
/**
* Sets the sender's @p name and @p email address.
*
* @param name is the sender's name.
* @param email is the sender's email address.
*/
void setSender( const QString &name, const QString &email );
/**
* Sets the #MessageType to @p methodType.
*
* @param methodType is the #MessageType.
*/
void setMessageType( MessageType methodType );
/**
* Sets the #Method to @p method.
*
* @param method is the #Method.
*/
void setMethod( Method method );
/**
* Clears the attendees list.
*/
void clearAttendees();
/**
* Adds a meeting participant (attendee).
*
* @param name is the name of the attendee
* @param role is the #Role of the attendee
* @param partstat is the status #PartStat of the attendee
* @param rsvp is true if the attendee will attend the meeting; else false
* @param email is the email address of the attendee
*/
void addAttendee( const QString &name, Role role, PartStat partstat,
bool rsvp, const QString &email );
/**
* Sets the name of the organizer to @p organizer.
* The organizer is any string identifier; it could be the name
* of a person, or the application that sent the invitation, for example.
*
* @param organizer is the organizer identifier.
*/
void setOrganizer( const QString &organizer );
/**
* Sets the Starting Date and Time to @p dtStart.
*
* @param dtStart is the starting date/time.
*/
void setDtStart( const QDateTime &dtStart );
/**
* Sets the Ending Date and Time to @p dtEnd.
*
* @param dtEnd is the ending date/time.
*/
void setDtEnd( const QDateTime &dtEnd );
/**
* Sets the Location to @p location.
*
* @param location is the location.
*/
void setLocation( const QString &location );
/**
* Sets the @acronym UID to @p uid.
*
* @param uid is the @acronym UID.
*/
void setUID( const QString &uid );
/**
* Sets the timestamp to @p dtStamp.
*
* @param dtStamp is the timestamp.
*/
void setDtStamp( const QDateTime &dtStamp );
/**
* Sets the category list to @p categories.
*
* @param categories is the list categories.
*/
void setCategories( const QStringList &categories );
/**
* Sets the description to @p description.
*
* @param description is the description.
*/
void setDescription( const QString &description );
/**
* Sets the summary to @p summary.
*
* @param summary is the summary.
*/
void setSummary( const QString &summary );
/**
* Sets the priority to @p priority.
*
* @param priority is the #Priority.
*/
void setPriority( Priority priority );
/**
* Sets the alarm.
*
* @param description is the alarm description
* @param action is the alaram #AlarmAction
* @param wakeBefore is the alarm Date/Time
*/
void setAlarm( const QString &description, AlarmAction action,
const QDateTime &wakeBefore );
private:
//@cond PRIVATE
class PrivateData;
PrivateData *const d;
//@endcond
Q_DISABLE_COPY( KTNEFWriter )
};
}
#endif // KTNEFWRITER_H
|