00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef SYNDICATION_ATOM_CONTENT_H
00024 #define SYNDICATION_ATOM_CONTENT_H
00025
00026 #include <syndication/elementwrapper.h>
00027
00028 #include <QtCore/QString>
00029
00030 #include <boost/shared_ptr.hpp>
00031
00032 class QByteArray;
00033 class QDomElement;
00034
00035 namespace Syndication {
00036 namespace Atom {
00037
00046 class SYNDICATION_EXPORT Content : public ElementWrapper
00047 {
00048 public:
00049
00053 enum Format
00054 {
00055 PlainText,
00058 EscapedHTML,
00060 XML,
00061 Binary
00062 };
00063
00072 static Format mapTypeToFormat(const QString& type,
00073 const QString& src=QString());
00074
00078 Content();
00079
00086 explicit Content(const QDomElement& element);
00087
00093 Content(const Content& other);
00094
00098 ~Content();
00099
00105 Content& operator=(const Content& other);
00106
00114 QString type() const;
00115
00127 QString src() const;
00128
00139 QString asString() const;
00140
00147 QByteArray asByteArray() const;
00148
00152 Format format() const;
00153
00159 bool isContained() const;
00160
00166 bool isXML() const;
00167
00172 bool isBinary() const;
00173
00178 bool isPlainText() const;
00179
00184 bool isEscapedHTML() const;
00185
00192 QString debugInfo() const;
00193
00194 private:
00195 class ContentPrivate;
00196 boost::shared_ptr<ContentPrivate> d;
00197 };
00198
00199 }
00200 }
00201
00202 #endif // SYNDICATION_ATOM_CONTENT_H