Framework for looking up contacts directly in nepomuk in addition to going through...
[kdepim.git] / messagecomposer / textpart.cpp
blob6bf89b7bc392c4bbcc69e473ccc1e38180017540
1 /*
2 Copyright (c) 2009 Constantin Berzan <exit3219@gmail.com>
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
20 #include "textpart.h"
22 using namespace KPIMTextEdit;
23 using namespace Message;
25 class TextPart::Private
27 public:
28 bool wordWrappingEnabled;
29 bool warnBadCharset;
30 QString cleanPlainText;
31 QString wrappedPlainText;
32 QString cleanHtml;
33 ImageList embeddedImages;
36 TextPart::TextPart( QObject *parent )
37 : MessagePart( parent )
38 , d( new Private )
40 d->wordWrappingEnabled = true;
41 d->warnBadCharset = true;
44 TextPart::~TextPart()
46 delete d;
49 bool TextPart::isWordWrappingEnabled() const
51 return d->wordWrappingEnabled;
54 void TextPart::setWordWrappingEnabled( bool enabled )
56 d->wordWrappingEnabled = enabled;
59 bool TextPart::warnBadCharset() const
61 return d->warnBadCharset;
64 void TextPart::setWarnBadCharset( bool warn )
66 d->warnBadCharset = warn;
69 QString TextPart::cleanPlainText() const
71 return d->cleanPlainText;
74 void TextPart::setCleanPlainText( const QString &text )
76 d->cleanPlainText = text;
79 QString TextPart::wrappedPlainText() const
81 return d->wrappedPlainText;
84 void TextPart::setWrappedPlainText( const QString &text )
86 d->wrappedPlainText = text;
89 bool TextPart::isHtmlUsed() const
91 return !d->cleanHtml.isEmpty();
94 QString TextPart::cleanHtml() const
96 return d->cleanHtml;
99 void TextPart::setCleanHtml( const QString &text )
101 d->cleanHtml = text;
104 bool TextPart::hasEmbeddedImages() const
106 return !d->embeddedImages.isEmpty();
109 ImageList TextPart::embeddedImages() const
111 return d->embeddedImages;
114 void TextPart::setEmbeddedImages( const ImageList &images )
116 d->embeddedImages = images;
119 #include "textpart.moc"