libkcal

attachment.h
1/*
2 This file is part of libkcal.
3
4 Copyright (c) 2002 Michael Brade <brade@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21#ifndef KCAL_ATTACHMENT_H
22#define KCAL_ATTACHMENT_H
23
24#include "listbase.h"
25#include "libkcal_export.h"
26
27#include <tqstring.h>
28
29namespace KCal {
30
34class TDE_EXPORT Attachment
35{
36 public:
37 typedef ListBase<Attachment> List;
38
44 Attachment( const Attachment &attachment );
45
52 Attachment( const TQString &uri, const TQString &mime = TQString() );
53
60 Attachment( const char *base64, const TQString &mime = TQString() );
61
63
64 /* The VALUE parameter in iCal */
65 bool isUri() const;
66 TQString uri() const;
67 void setUri( const TQString &uri );
68
69 bool isBinary() const;
70 char *data() const;
71 void setData( const char *base64 );
72
73 void setDecodedData( const TQByteArray &data );
74 TQByteArray &decodedData();
75
76 uint size();
77
78 /* The optional FMTTYPE parameter in iCal */
79 TQString mimeType() const;
80 void setMimeType( const TQString &mime );
81
82 /* The custom X-CONTENT-DISPOSITION parameter, used by OGo etc. */
83 bool showInline() const;
84 void setShowInline( bool showinline );
85
86 /* The custom X-LABEL parameter to show a human-readable title */
87 TQString label() const;
88 void setLabel( const TQString &label );
89
99 void setLocal( bool local );
100
104 bool isLocal() const;
105
106 private:
107 TQByteArray mDataCache;
108 uint mSize;
109 TQString mMimeType;
110 TQString mUri;
111 char *mData;
112 TQString mLabel;
113 bool mBinary;
114 bool mLocal;
115 bool mShowInline;
116
117 class Private;
118 Private *d;
119};
120
121}
122
123#endif
Attachment(const Attachment &attachment)
Create a Reference to some URI by copying an existing Attachment.
bool isLocal() const
Returns the attachment "local" flag.
void setLocal(bool local)
Sets the attachment "local" option, which is derived from the Calendar Incidence X-KONTACT-TYPE param...
This class provides a template for lists of pointers.
Definition listbase.h:34
Namespace KCal is for global classes, objects and/or functions in libkcal.
Definition alarm.h:38