Subversion Repositories Scribus

Rev

Rev 9797 | Rev 12895 | 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.,                                       *
24
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
25
 ***************************************************************************/
26
 
27
#ifndef GTPARAGRAPHSTYLE_H
28
#define GTPARAGRAPHSTYLE_H
29
 
2969 craig 30
#include "scribusapi.h"
364 Franz 31
#include "gtstyle.h"
5184 avox 32
#include "sctextstruct.h"
364 Franz 33
 
34
enum Alignment {
35
        LEFT,
36
        CENTER,
37
        RIGHT,
38
        BLOCK,
39
        FORCED,
40
        AlignmentMAX
41
};
42
 
375 Franz 43
enum TabType {
44
        LEFT_T,
45
        RIGHT_T,
46
        FULL_STOP_T,
47
        COMMA_T,
48
        CENTER_T
49
};
50
 
2969 craig 51
class SCRIBUS_API gtParagraphStyle : public gtStyle
364 Franz 52
{
53
private:
54
        void init();
55
protected:
10111 jghali 56
        bool   defaultStyle;
364 Franz 57
        double lineSpacing;
58
        int    alignment;
59
        double indent;
60
        double firstLineIndent;
61
        double spaceAbove;
62
        double spaceBelow;
9797 avox 63
        QList<ParagraphStyle::TabRecord> tabValues;
364 Franz 64
        bool dropCap;
65
        int  dropCapHeight;
66
        bool adjToBaseline;
411 Franz 67
        bool autoLineSpacing;
68
        bool isVisible;
364 Franz 69
public:
10111 jghali 70
        bool   isDefaultStyle();
71
        void   setDefaultStyle(bool defStyle);
364 Franz 72
        double getLineSpacing();
73
        void   setLineSpacing(double newLineSpacing);
411 Franz 74
        bool   getAutoLineSpacing();
75
        void   setAutoLineSpacing(bool newALS);
364 Franz 76
        int    getAlignment();
77
        void   setAlignment(Alignment newAlignment);
78
        void   setAlignment(int newAlignment);
79
        double getIndent();
80
        void   setIndent(double newIndent);
81
        double getFirstLineIndent();
82
        void   setFirstLineIndent(double newFirstLineIndent);
83
        double getSpaceAbove();
84
        void   setSpaceAbove(double newSpaceAbove);
85
        double getSpaceBelow();
86
        void   setSpaceBelow(double newSpaceBelow);
9797 avox 87
        QList<ParagraphStyle::TabRecord>* getTabValues();
375 Franz 88
        void   setTabValue(double newTabValue, TabType ttype = LEFT_T);
364 Franz 89
        bool   hasDropCap();
90
        void   setDropCap(bool newDropCap);
91
        void   setDropCap(int newHeight);
92
        int    getDropCapHeight();
93
        void   setDropCapHeight(int newHeight);
94
        bool   isAdjToBaseline();
95
        void   setAdjToBaseline(bool newAdjToBaseline);
96
        void   getStyle(gtStyle* style);
97
        gtParagraphStyle(QString name);
98
        gtParagraphStyle(const gtParagraphStyle& p);
99
        gtParagraphStyle(const gtStyle& s);
100
        ~gtParagraphStyle();
101
        QString target();
102
};
103
 
104
#endif // GTPARAGRAPHSTYLE_H