1 /*
2     Copyright (C)  2010  Brad Hards <bradh@frogmouth.net>
3 
4     This library is free software: you can redistribute it and/or modify
5     it under the terms of the GNU Lesser General Public License as published by
6     the Free Software Foundation, either version 2.1 of the License, or
7     (at your option) any later version.
8 
9     This library is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU Lesser General Public License for more details.
13 
14     You should have received a copy of the GNU Lesser General Public License
15     along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef RTFREADER_STYLESHEETDESTINATION_H
19 #define RTFREADER_STYLESHEETDESTINATION_H
20 
21 #include <QString>
22 #include <QColor>
23 
24 #include "Destination.h"
25 #include "styles/charstyle.h"
26 #include "styles/paragraphstyle.h"
27 namespace RtfReader
28 {
29 	class Reader;
30 
31 	class StyleSheetDestination: public Destination
32 	{
33 		public:
34 			StyleSheetDestination(Reader *reader, AbstractRtfOutput *output, const QString &name);
35 			virtual ~StyleSheetDestination();
36 			virtual void handleControlWord( const QString &controlWord, bool hasValue, const int value );
37 			virtual void handlePlainText(const QByteArray &plainText );
38 			virtual void aboutToEndDestination();
39 
40 		protected:
41 			double pixelsFromTwips(const int twips);
42 			quint32 		m_currentStyleHandleNumber;
43 			int			m_currentStyleParent;
44 			ParagraphStyle m_textStyle;
45 			QByteArray m_styleName;
46 			QHash<quint32, int> m_stylesTable;
47 			int m_charactersToSkip;
48 			int m_uc_Value;
49 	};
50 }
51 
52 #endif
53