summaryrefslogtreecommitdiffstats
path: root/ktnef/ktnef/ktnefwriter.h
blob: ab04c0b37cb10be79e9f809cee52317a47825f66 (plain)
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
/*
    ktnefwriter.cpp

    Copyright (C) 2002 Bo Thorsen  <bo@sonofthor.dk>

    This file is part of KTNEF, the KDE TNEF support library/program.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 */

#ifndef KTNEFWRITER_H
#define KTNEFWRITER_H

class QString;
class QVariant;
class QIODevice;
class QDataStream;
class QDateTime;
class QStringList;

class KTNEFWriter {
public:
  KTNEFWriter();
  ~KTNEFWriter();

  void addProperty( int tag, int type, const QVariant& value );

  bool writeFile( QIODevice &file );
  bool writeFile( QDataStream &stream );

  bool writeProperty( QDataStream &stream, int &bytes, int type);

  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
  };

  // This set of functions sets all properties on the file you want to save
  void setSender(const QString &name, const QString &email);
  void setMessageType(MessageType m);
  void setMethod( Method m );
  void clearAttendees();
  void addAttendee( const QString& cn, Role r, PartStat p, bool rsvp,
                    const QString& mailto );
  void setOrganizer( const QString& organizer ); // Is that the same as sender???
  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& );
  void setDescription( const QString& );
  void setSummary( const QString& );
  void setPriority( Priority p );
  void setAlarm( const QString& description, AlarmAction action,
                 const QDateTime& wakeBefore );

private:
  class PrivateData;
  PrivateData *mData;
};


#endif // KTNEFWRITER_H