home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / libkcal / attachment.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-09-10  |  2.6 KB  |  97 lines

  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 <qstring.h>
  28.  
  29. namespace KCal {
  30.  
  31. /**
  32.   This class represents information related to an attachment.
  33. */
  34. class KDE_EXPORT Attachment
  35. {
  36.   public:
  37.     typedef ListBase<Attachment> List;
  38.  
  39.     /**
  40.       Create a Reference to some URI by copying an existing Attachment.
  41.       
  42.       @param attachment the attachment to be duplicated
  43.     */
  44.     Attachment( const Attachment &attachment );
  45.  
  46.     /**
  47.       Create a Reference to some URI.
  48.       
  49.       @param uri the uri this attachment refers to
  50.       @param mime the mime type of the resource being linked to
  51.     */
  52.     Attachment( const QString &uri, const QString &mime = QString::null );
  53.  
  54.     /**
  55.       Create a binary attachment.
  56.      
  57.       @param base64 the attachment in base64 format
  58.       @param mime the mime type of the attachment
  59.     */
  60.     Attachment( const char *base64, const QString &mime = QString::null );
  61.  
  62.     /* The VALUE parameter in iCal */
  63.     bool isUri() const;
  64.     QString uri() const;
  65.     void setUri( const QString &uri );
  66.     
  67.     bool isBinary() const;
  68.     char *data() const;
  69.     void setData( const char *base64 );
  70.  
  71.     /* The optional FMTTYPE parameter in iCal */
  72.     QString mimeType() const;
  73.     void setMimeType( const QString &mime );
  74.         
  75.         /* The custom X-CONTENT-DISPOSITION parameter, used by OGo etc. */
  76.         bool showInline() const;
  77.         void setShowInline( bool showinline );
  78.         
  79.         /* The custom X-LABEL parameter to show a human-readable title */
  80.         QString label() const;
  81.         void setLabel( const QString &label );
  82.  
  83.   private:
  84.     QString mMimeType;
  85.     QString mData;
  86.     bool mBinary;
  87.         bool mShowInline;
  88.         QString mLabel;
  89.  
  90.     class Private;
  91.     Private *d;
  92. };
  93.  
  94. }
  95.  
  96. #endif
  97.