22#include "attachment.h"
29 mSize = attachment.mSize;
30 mMimeType = attachment.mMimeType;
31 mUri = attachment.mUri;
32 mData = tqstrdup( attachment.mData );
33 mLabel = attachment.mLabel;
34 mBinary = attachment.mBinary;
35 mLocal = attachment.mLocal;
36 mShowInline = attachment.mShowInline;
54 mData = tqstrdup( base64 );
60Attachment::~Attachment()
65bool Attachment::isUri()
const
70TQString Attachment::uri()
const
79void Attachment::setUri(
const TQString &uri )
85bool Attachment::isBinary()
const
90char *Attachment::data()
const
99TQByteArray &Attachment::decodedData()
101 if ( mDataCache.isNull() && mData ) {
105 encoded.duplicate( mData, strlen( mData ) );
107 KCodecs::base64Decode( encoded, decoded );
108 mDataCache = decoded;
114void Attachment::setDecodedData(
const TQByteArray &data )
117 KCodecs::base64Encode( data, encoded );
119 encoded.resize( encoded.count() + 1 );
120 encoded[encoded.count()-1] =
'\0';
122 setData( encoded.data() );
124 mSize = mDataCache.size();
127void Attachment::setData(
const char *base64 )
130 mData = tqstrdup( base64 );
132 mDataCache = TQByteArray();
136uint Attachment::size()
142 mSize = decodedData().size();
148TQString Attachment::mimeType()
const
153void Attachment::setMimeType(
const TQString& mime)
158bool Attachment::showInline()
const
163void Attachment::setShowInline(
bool showinline )
165 mShowInline = showinline;
168TQString Attachment::label()
const
173void Attachment::setLabel(
const TQString& label )
This class represents information related to an attachment.
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...
Namespace KCal is for global classes, objects and/or functions in libkcal.