libkcal

attachment.h

Go to the documentation of this file.
00001 /*
00002     This file is part of libkcal.
00003 
00004     Copyright (c) 2002 Michael Brade <brade@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 #ifndef KCAL_ATTACHMENT_H
00022 #define KCAL_ATTACHMENT_H
00023 
00024 #include "listbase.h"
00025 #include "libkcal_export.h"
00026 
00027 #include <qstring.h>
00028 
00029 namespace KCal {
00030 
00034 class KDE_EXPORT Attachment
00035 {
00036   public:
00037     typedef ListBase<Attachment> List;
00038 
00044     Attachment( const Attachment &attachment );
00045 
00052     Attachment( const QString &uri, const QString &mime = QString::null );
00053 
00060     Attachment( const char *base64, const QString &mime = QString::null );
00061 
00062     /* The VALUE parameter in iCal */
00063     bool isUri() const;
00064     QString uri() const;
00065     void setUri( const QString &uri );
00066     
00067     bool isBinary() const;
00068     char *data() const;
00069     void setData( const char *base64 );
00070 
00071     /* The optional FMTTYPE parameter in iCal */
00072     QString mimeType() const;
00073     void setMimeType( const QString &mime );
00074         
00075         /* The custom X-CONTENT-DISPOSITION parameter, used by OGo etc. */
00076         bool showInline() const;
00077         void setShowInline( bool showinline );
00078         
00079         /* The custom X-LABEL parameter to show a human-readable title */
00080         QString label() const;
00081         void setLabel( const QString &label );
00082 
00083   private:
00084     QString mMimeType;
00085     QString mData;
00086     bool mBinary;
00087         bool mShowInline;
00088         QString mLabel;
00089 
00090     class Private;
00091     Private *d;
00092 };
00093 
00094 }
00095 
00096 #endif