Subversion Repositories Scribus

Rev

Rev 18084 | Rev 19590 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4430 cbradney 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
364 Franz 7
/***************************************************************************
8
 *   Copyright (C) 2004 by Riku Leino                                      *
1184 tsoots 9
 *   tsoots@gmail.com                                                      *
364 Franz 10
 *                                                                         *
11
 *   This program is free software; you can redistribute it and/or modify  *
12
 *   it under the terms of the GNU General Public License as published by  *
13
 *   the Free Software Foundation; either version 2 of the License, or     *
14
 *   (at your option) any later version.                                   *
15
 *                                                                         *
16
 *   This program is distributed in the hope that it will be useful,       *
17
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
18
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
19
 *   GNU General Public License for more details.                          *
20
 *                                                                         *
21
 *   You should have received a copy of the GNU General Public License     *
22
 *   along with this program; if not, write to the                         *
23
 *   Free Software Foundation, Inc.,                                       *
18122 mrdocs 24
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.             *
364 Franz 25
 ***************************************************************************/
26
 
27
#ifndef GTWRITER_H
28
#define GTWRITER_H
29
 
2969 craig 30
#include "scribusapi.h"
364 Franz 31
#include "gtaction.h"
32
 
1702 cbradney 33
class PageItem;
34
 
364 Franz 35
/*
36
        gtWriter handles the writing to the scribus text frame.
37
*/
2969 craig 38
class SCRIBUS_API gtWriter
364 Franz 39
{
40
public:
5781 cbradney 41
//      gtWriter(bool append);
1702 cbradney 42
        gtWriter(bool append, PageItem *pageitem);
364 Franz 43
        ~gtWriter();
44
        gtFrameStyle* getDefaultStyle();
45
        void setFrameStyle(gtFrameStyle *fStyle);
46
        void setParagraphStyle(gtParagraphStyle *pStyle);
47
        void setCharacterStyle(gtStyle *cStyle);
375 Franz 48
        void unsetFrameStyle();
49
        void unsetParagraphStyle();
50
        void unsetCharacterStyle();
411 Franz 51
        double getPreferredLineSpacing(int fontSize);
52
        double getPreferredLineSpacing(double fontSize);
53
        void append(const QString& text); // Use the styles set beforehand
54
        void append(const QString& text, gtStyle *style); // Use the style provided as a parameter
55
        void append(const QString& text, gtStyle *style, bool updatePStyle);
12895 jghali 56
        void appendUnstyled(const QString& text); // Do not apply any formatting
375 Franz 57
        double getFrameWidth();
58
        QString getFrameName();
411 Franz 59
        bool getUpdateParagraphStyles();
60
        void setUpdateParagraphStyles(bool newUPS);
418 Franz 61
        bool getOverridePStyleFont();
62
        void setOverridePStyleFont(bool newOPSF);
18084 jghali 63
        bool inNote;
64
        bool inNoteBody;
65
 
364 Franz 66
private:
67
        gtAction *action;
68
        gtFrameStyle* defaultStyle;
69
        gtStyle* currentStyle;
70
 
71
/*
72
   Frame style is the default style for text. Styles will be used in order so
73
   that if no character style is found then it will try to use paragraph
74
   style if no paragraph style is found frame style will be used. Last set
75
   frame style will be left to the default style for the text frame.
76
*/
77
        gtFrameStyle* frameStyle;
78
        gtStyle* paragraphStyle;
79
        gtStyle* characterStyle;
80
        bool errorSet;
81
        bool shouldAppend;
82
        void setDefaultStyle();
83
};
84
 
85
#endif // WRITER_H