Back to index

scribus-ng  1.3.4.dfsg+svn20071115
gtparagraphstyle.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008  *   Copyright (C) 2004 by Riku Leino                                      *
00009  *   tsoots@gmail.com                                                      *
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  *   This program is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00019  *   GNU General Public License for more details.                          *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU General Public License     *
00022  *   along with this program; if not, write to the                         *
00023  *   Free Software Foundation, Inc.,                                       *
00024  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00025  ***************************************************************************/
00026 
00027 #ifndef GTPARAGRAPHSTYLE_H
00028 #define GTPARAGRAPHSTYLE_H
00029 
00030 #include <qvaluelist.h>
00031 #include "scribusapi.h"
00032 #include "gtstyle.h"
00033 #include "sctextstruct.h"
00034 
00035 enum Alignment {
00036        LEFT,
00037        CENTER,
00038        RIGHT,
00039        BLOCK,
00040        FORCED,
00041        AlignmentMAX
00042 };
00043 
00044 enum TabType {
00045        LEFT_T,
00046        RIGHT_T,
00047        FULL_STOP_T,
00048        COMMA_T,
00049        CENTER_T
00050 };
00051 
00052 class SCRIBUS_API gtParagraphStyle : public gtStyle
00053 {
00054 private:
00055        void init();
00056 protected:
00057        double lineSpacing;
00058        int    alignment;
00059        double indent;
00060        double firstLineIndent;
00061        double spaceAbove;
00062        double spaceBelow;
00063        QValueList<ParagraphStyle::TabRecord> tabValues;
00064        bool dropCap;
00065        int  dropCapHeight;
00066        bool adjToBaseline;
00067        bool autoLineSpacing;
00068        bool isVisible;
00069 public:
00070        double getLineSpacing();
00071        void   setLineSpacing(double newLineSpacing);
00072        bool   getAutoLineSpacing();
00073        void   setAutoLineSpacing(bool newALS);
00074        int    getAlignment();
00075        void   setAlignment(Alignment newAlignment);
00076        void   setAlignment(int newAlignment);
00077        double getIndent();
00078        void   setIndent(double newIndent);
00079        double getFirstLineIndent();
00080        void   setFirstLineIndent(double newFirstLineIndent);
00081        double getSpaceAbove();
00082        void   setSpaceAbove(double newSpaceAbove);
00083        double getSpaceBelow();
00084        void   setSpaceBelow(double newSpaceBelow);
00085        QValueList<ParagraphStyle::TabRecord>* getTabValues();
00086        void   setTabValue(double newTabValue, TabType ttype = LEFT_T);
00087        bool   hasDropCap();
00088        void   setDropCap(bool newDropCap);
00089        void   setDropCap(int newHeight);
00090        int    getDropCapHeight();
00091        void   setDropCapHeight(int newHeight);
00092        bool   isAdjToBaseline();
00093        void   setAdjToBaseline(bool newAdjToBaseline);
00094        void   getStyle(gtStyle* style);
00095        gtParagraphStyle(QString name);
00096        gtParagraphStyle(const gtParagraphStyle& p);
00097        gtParagraphStyle(const gtStyle& s);
00098        ~gtParagraphStyle();
00099        QString target();
00100 };
00101 
00102 #endif // GTPARAGRAPHSTYLE_H