1 /*
2  * %kadu copyright begin%
3  * Copyright 2014 Rafał Przemysław Malinowski (rafal.przemyslaw.malinowski@gmail.com)
4  * %kadu copyright end%
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program 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
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #pragma once
21 
22 #include <QtCore/QString>
23 
24 #include "formatted-string/formatted-string-visitor.h"
25 #include "exports.h"
26 
27 /**
28  * @addtogroup FormattedString
29  * @{
30  */
31 
32 /**
33  * @class FormattedStringIsPlainTextVisitor
34  * @short This visitor check if formatted string is plain text number of items.
35  * @author Rafał 'Vogel' Malinowski
36  */
37 class KADUAPI FormattedStringIsPlainTextVisitor : public FormattedStringVisitor
38 {
39 	Q_DISABLE_COPY(FormattedStringIsPlainTextVisitor);
40 
41 public:
42 	FormattedStringIsPlainTextVisitor();
43 	virtual ~FormattedStringIsPlainTextVisitor();
44 
45 	virtual void beginVisit(const CompositeFormattedString * const compositeFormattedString) override;
46 	virtual void endVisit(const CompositeFormattedString * const compositeFormattedString) override;
47 	virtual void visit(const FormattedStringImageBlock * const formattedStringImageBlock) override;
48 	virtual void visit(const FormattedStringTextBlock * const formattedStringTextBlock) override;
49 
50 	bool isPlainText() const;
51 
52 private:
53 	bool m_first;
54 	bool m_isPlain;
55 
56 };
57 
58 /**
59  * @}
60  */
61