Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 6442 → Rev 6443

/branches/Version13x/Scribus/scribus/styles/charstyle.cpp
0,0 → 1,183
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
 
 
#include <qvaluelist.h>
#include <qobject.h>
#include "sctextstruct.h"
#include "scfonts.h"
 
 
 
StyleFlag& operator&= (StyleFlag& left, StyleFlag right){
int result = static_cast<int>(left) & static_cast<int>(right);
left = static_cast<StyleFlag>(result);
return left;
}
 
StyleFlag& operator|= (StyleFlag& left, StyleFlag right)
{
int result = static_cast<int>(left) | static_cast<int>(right);
left = static_cast<StyleFlag>(result);
return left;
}
 
StyleFlag operator& (StyleFlag left, StyleFlag right)
{
int result = static_cast<int>(left) & static_cast<int>(right);
return static_cast<StyleFlag>(result);
}
 
StyleFlag operator| (StyleFlag left, StyleFlag right)
{
int result = static_cast<int>(left) | static_cast<int>(right);
return static_cast<StyleFlag>(result);
}
 
StyleFlag operator^ (StyleFlag left, StyleFlag right){
int result = static_cast<int>(left) ^ static_cast<int>(right);
return static_cast<StyleFlag>(result);
}
 
StyleFlag operator~ (StyleFlag arg)
{
int result = ~ static_cast<int>(arg);
return static_cast<StyleFlag>(result);
}
 
 
void CharStyle::applyCharStyle(const CharStyle & other)
{
Style::applyStyle(other);
#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
if (! other.inh_##attr_NAME) \
set##attr_NAME(other.m_##attr_NAME);
#include "charstyle.attrdefs.cxx"
#undef ATTRDEF
}
 
 
void CharStyle::eraseCharStyle(const CharStyle & other)
{
Style::eraseStyle(other);
#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
if (!inh_##attr_NAME && m_##attr_NAME == other.##attr_GETTER()) \
reset##attr_NAME();
#include "charstyle.attrdefs.cxx"
#undef ATTRDEF
}
 
bool CharStyle::equiv(const Style & other) const
{
const CharStyle * oth = dynamic_cast<const CharStyle*> ( & other );
return oth &&
parent == oth->parent() &&
#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
inh_##attr_NAME == oth->inh_##attr_NAME &&\
(inh_##attr_NAME || m_##attr_NAME == oth->m_##attr_NAME) &&
#include "charstyle.attrdefs.cxx"
#undef ATTRDEF
;
}
 
 
QString CharStyle::displayName() const
{
if ( hasName() || !hasParent() || ! m_base)
return name();
// else if ( inheritsAll() )
// return parent()->displayName();
else
return parentStyle()->displayName() + "+";
}
 
 
 
QString CharStyle::asString() const
{
QString result;
if ( !inh_Font )
result += QObject::tr("font %1 ").arg(font().scName());
if ( !inh_FontSize )
result += QObject::tr("size %1 ").arg(fontSize());
if ( !inh_Effects )
result += QObject::tr("+style ");
if ( !inh_StrokeColor || !inh_StrokeShade || !inh_FillColor || !inh_FillShade )
result += QObject::tr("+color ");
if ( !inh_UnderlineWidth || !inh_UnderlineOffset )
result += underlineWidth() > 0 ? QObject::tr("+underline ") : QObject::tr("-underline ");
if ( !inh_StrikethruWidth || !inh_StrikethruPos )
result += strikethruWidth() > 0 ? QObject::tr("+strikeout ") : QObject::tr("-strikeout ");
if ( !inh_ShadowXOffset || !inh_ShadowYOffset )
result += shadowXOffset() != 0 || shadowYOffset != 0 ? QObject::tr("+shadow ") : QObject::tr("-shadow ");
if ( !inh_OutlineWidth )
result += outlineWidth() > 0 ? QObject::tr("+outline ") : QObject::tr("-outline ");
if ( !inh_Tracking )
result += tracking() > 0 ? QObject::tr("+tracking %1 ").arg(tracking()) : QObject::tr("-tracking ");
if ( !inh_BaselineOffset )
result += QObject::tr("+baseline %1 ").arg(baselineOffset());
if ( !inh_ScaleH || !inh_ScaleV )
result += QObject::tr("+stretch ");
if ( hasParent() )
result += QObject::tr("parent= %1").arg(parent());
return result.stripWhiteSpace();
}
 
 
void CharStyle::update(StyleBase* base)
{
Style::update(base);
const CharStyle * oth = dynamic_cast<const CharStyle*> ( parentStyle() );
if (oth) {
#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
if (inh_##attr_NAME) \
m_##attr_NAME = oth->##attr_GETTER;
#include "charstyle.attrdefs.cxx"
#undef ATTRDEF
}
}
 
 
 
 
/*
bool CharStyle::definesAll() const
{
return definesLineSpacing() &&
definesLeftMargin() &&
definesRightMargin() &&
definesFirstIndent() &&
definesAlignment() &&
definesGapBefore() &&
definesLineSpacingMode() &&
definesGapAfter() &&
definesHasDropCap() &&
definesDropCapOffset() &&
definesDropCapLines() &&
definesUseBaselineGrid() &&
charStyle().definesAll() ;
}
 
bool CharStyle::inheritsAll() const
{
return inheritsLineSpacing() &&
inheritsLeftMargin() &&
inheritsRightMargin() &&
inheritsFirstIndent() &&
inheritsAlignment() &&
inheritsGapBefore() &&
inheritsLineSpacingMode() &&
inheritsGapAfter() &&
inheritsHasDropCap() &&
inheritsDropCapOffset() &&
inheritsDropCapLines() &&
inheritsUseBaselineGrid() &&
charStyle().inheritsAll() ;
}
*/
 
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: branches/Version13x/Scribus/scribus/styles/paragraphstyle.attrdefs.cxx
===================================================================
--- branches/Version13x/Scribus/scribus/styles/paragraphstyle.attrdefs.cxx (nonexistent)
+++ branches/Version13x/Scribus/scribus/styles/paragraphstyle.attrdefs.cxx (revision 6443)
@@ -0,0 +1,16 @@
+
+//Syntax: ATTRDEF( datatype, gettername, name, defaultvalue)
+
+ATTRDEF(ParagraphStyle::LineSpacingMode, lineSpacingMode, LineSpacingMode, ParagraphStyle::FixedLineSpacing)
+ATTRDEF(double, lineSpacing, LineSpacing, 0.0)
+ATTRDEF(ParagraphStyle::AlignmentType, alignment, Alignment, Leftaligned)
+ATTRDEF(double, leftMargin, LeftMargin, 0.0)
+ATTRDEF(double, rightMargin, RightMargin, 0.0)
+ATTRDEF(double, firstIndent, FirstIndent, 0.0)
+ATTRDEF(double, gapBefore, GapBefore, 0.0)
+ATTRDEF(double, gapAfter, GapAfter, 0.0)
+ATTRDEF(QValueList<TabRecord>, tabValues, TabValues, QValueList<TabRecord>())
+ATTRDEF(int, dropCapLines, DropCapLines, 0)
+ATTRDEF(bool, hasDropCap, HasDropCap, false)
+ATTRDEF(double, dropCapOffset, DropCapOffset, 0.0)
+ATTRDEF(bool, useBaselineGrid, UseBaselineGrid, false)
\ No newline at end of file
/branches/Version13x/Scribus/scribus/styles/paragraphstyle.attrdefs.cxx
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: branches/Version13x/Scribus/scribus/styles/charstyle.h
===================================================================
--- branches/Version13x/Scribus/scribus/styles/charstyle.h (nonexistent)
+++ branches/Version13x/Scribus/scribus/styles/charstyle.h (revision 6443)
@@ -0,0 +1,154 @@
+/*
+ For general Scribus (>=1.3.2) copyright and licensing information please refer
+ to the COPYING file provided with the program. Following this notice may exist
+ a copyright and/or license notice that predates the release of Scribus 1.3.2
+ for which a new license (GPL+exception) is in place.
+ */
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+
+// DONT INCLUDE this file directly, include "style.h" instead!
+
+
+enum StyleFlag {
+ ScStyle_Default = 0,
+ ScStyle_Superscript = 1,
+ ScStyle_Subscript = 2,
+ ScStyle_Outline = 4,
+ ScStyle_Underline = 8,
+ ScStyle_Strikethrough = 16,
+ ScStyle_AllCaps = 32,
+ ScStyle_SmallCaps = 64,
+ ScStyle_HyphenationPossible=128, //Hyphenation possible here (Smart Hyphen)
+ ScStyle_Shadowed = 256,
+ ScStyle_UnderlineWords= 512,
+ ScStyle_Reserved01 = 1024, //free, not used in the moment
+ ScStyle_DropCap = 2048,
+ ScStyle_SuppressSpace = 4096,//internal use in PageItem (Suppresses spaces when in Block alignment)
+ ScStyle_SmartHyphenVisible=8192, //Smart Hyphen visible at line end
+ ScStyle_StartOfLine = 16384,
+ ScStyle_UserStyles = 2047, // 1919, // == 1024 + 512 + 256 + 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1
+ ScStyle_None = 65535
+};
+
+SCRIBUS_API StyleFlag& operator&= (StyleFlag& left, StyleFlag right);
+
+SCRIBUS_API StyleFlag& operator|= (StyleFlag& left, StyleFlag right);
+
+SCRIBUS_API StyleFlag operator& (StyleFlag left, StyleFlag right);
+
+SCRIBUS_API StyleFlag operator| (StyleFlag left, StyleFlag right);
+
+SCRIBUS_API StyleFlag operator^ (StyleFlag left, StyleFlag right);
+
+SCRIBUS_API StyleFlag operator~ (StyleFlag arg);
+
+
+
+
+class SCRIBUS_API CharStyle : public virtual Style {
+public:
+
+
+ CharStyle() : Style() {
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ m_##attr_NAME = attr_DEFAULT; \
+ inh_##attr_NAME = true;
+#include "charstyle.attrdefs.cxx"
+#undef ATTRDEF
+ };
+
+ CharStyle(const ScFace& font, int size, StyleFlag style = ScStyle_Default) : Style() {
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ m_##attr_NAME = attr_DEFAULT; \
+ inh_##attr_NAME = true;
+#include "charstyle.attrdefs.cxx"
+#undef ATTRDEF
+ m_Font = font;
+ m_FontSize = size;
+ m_Effects = style;
+ };
+
+ CharStyle(const CharStyle & other);
+
+ CharStyle & operator=(const CharStyle & other);
+
+ QString displayName() const;
+
+ void update(StyleBase * b);
+
+ bool equiv(const Style& other) const;
+
+ void applyCharStyle(const CharStyle & other);
+ void eraseCharStyle(const CharStyle & other);
+ void erase() { eraseCharStyle(*this); }
+
+ QString asString() const;
+
+ /** getter: validates and returns the attribute's value */
+
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ const attr_TYPE attr_GETTER() const { validate(); return m_##attr_NAME; }
+#include "charstyle.attrdefs.cxx"
+#undef ATTRDEF
+
+ /** setter: sets the attribute's value and clears inherited flag */
+
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ void set##attr_NAME(attr_TYPE v) { m_##attr_NAME = v; inh_##attr_NAME = false; }
+#include "charstyle.attrdefs.cxx"
+#undef ATTRDEF
+
+ /** setter: resets the attribute's value and sets inherited flag */
+
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ void reset##attr_NAME() { m_##attr_NAME = attr_DEFAULT; inh_##attr_NAME = true; }
+#include "charstyle.attrdefs.cxx"
+#undef ATTRDEF
+
+ /** isInherited: returns true if the attriute is inherited */
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ bool isInh##attr_NAME() { return inh_##attr_NAME; }
+#include "charstyle.attrdefs.cxx"
+#undef ATTRDEF
+
+
+private:
+
+ // member declarations:
+
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ attr_TYPE m_##attr_NAME; \
+ bool inh_##attr_NAME;
+#include "charstyle.attrdefs.cxx"
+#undef ATTRDEF
+};
+
+
+inline CharStyle & CharStyle::operator=(const CharStyle & other)
+{
+ static_cast<Style&>(*this) = static_cast<const Style&>(other);
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ m_##attr_NAME = other.m_##attr_NAME; \
+ inh_##attr_NAME = other.inh_##attr_NAME;
+#include "charstyle.attrdefs.cxx"
+#undef ATTRDEF
+ return *this;
+}
+
+inline CharStyle::CharStyle(const CharStyle & other) : Style(other)
+{
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ m_##attr_NAME = other.m_##attr_NAME; \
+ inh_##attr_NAME = other.inh_##attr_NAME;
+#include "charstyle.attrdefs.cxx"
+#undef ATTRDEF
+}
+
/branches/Version13x/Scribus/scribus/styles/charstyle.h
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: branches/Version13x/Scribus/scribus/styles/paragraphstyle.cpp
===================================================================
--- branches/Version13x/Scribus/scribus/styles/paragraphstyle.cpp (nonexistent)
+++ branches/Version13x/Scribus/scribus/styles/paragraphstyle.cpp (revision 6443)
@@ -0,0 +1,134 @@
+
+
+ParagraphStyle::ParagraphStyle() : Style(), cstyle()
+{
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ m_##attr_NAME = attr_DEFAULT; \
+ inh_##attr_NAME = true;
+#include "paragraphstyle.attrdefs.cxx"
+#undef ATTRDEF
+}
+
+
+ParagraphStyle::ParagraphStyle(const ParagraphStyle& other) : Style(other), cstyle(other.charStyle())
+{
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ m_##attr_NAME = other.m_##attr_NAME; \
+ inh_##attr_NAME = other.inh_##attr_NAME;
+#include "paragraphstyle.attrdefs.cxx"
+#undef ATTRDEF
+}
+
+
+QString ParagraphStyle::displayName() const
+{
+ if ( hasName() || !hasParent() || !m_base)
+ return name();
+ // else if ( inheritsAll() )
+ // return parent()->displayName();
+ else
+ return (parentStyle())->displayName() + "+";
+}
+
+namespace {
+bool operator==(const QValueList<ParagraphStyle::TabRecord>& tabs, const QValueList<ParagraphStyle::TabRecord>& other)
+{
+ ParagraphStyle::TabRecord tb;
+ bool tabEQ = false;
+ if ((other.count() == 0) && (tabs.count() == 0))
+ tabEQ = true;
+ else
+ {
+ for (uint t1 = 0; t1 < other.count(); t1++)
+ {
+ tb.tabPosition = other[t1].tabPosition;
+ tb.tabType = other[t1].tabType;
+ tb.tabFillChar = other[t1].tabFillChar;
+ for (uint t2 = 0; t2 < tabs.count(); t2++)
+ {
+ ParagraphStyle::TabRecord tb2;
+ tb2.tabPosition = tabs[t2].tabPosition;
+ tb2.tabType = tabs[t2].tabType;
+ tb2.tabFillChar = tabs[t2].tabFillChar;
+ if ((tb2.tabFillChar == tb.tabFillChar) && (tb2.tabPosition == tb.tabPosition) && (tb2.tabType == tb.tabType))
+ {
+ tabEQ = true;
+ break;
+ }
+ }
+ if (tabEQ)
+ break;
+ }
+ }
+ return tabEQ;
+}
+
+} // namespace
+
+bool ParagraphStyle::equiv(const Style& other) const
+{
+ const ParagraphStyle* oth = dynamic_cast<const ParagraphStyle*> ( & other );
+ return oth &&
+ parent == oth->parent() &&
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ inh_##attr_NAME == oth->inh_##attr_NAME &&\
+ (inh_##attr_NAME || m_##attr_NAME == oth->m_##attr_NAME) &&
+#include "paragraphstyle.attrdefs.cxx"
+#undef ATTRDEF
+ ;
+}
+
+
+
+ParagraphStyle& ParagraphStyle::operator=(const ParagraphStyle& other)
+{
+ static_cast<Style&>(*this) = static_cast<const Style&>(other);
+ cstyle = other.charStyle();
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ m_##attr_NAME = oth->m_##attr_NAME; \
+ inh_##attr_NAME = oth->inh_##attr_NAME);
+#include "paragraphstyle.attrdefs.cxx"
+#undef ATTRDEF
+ return *this;
+}
+
+
+
+void ParagraphStyle::update(StyleBase* base)
+{
+ Style::update(base);
+ const ParagraphStyle * oth = dynamic_cast<const ParagraphStyle*> ( parentStyle() );
+ if (oth) {
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ if (inh_##attr_NAME) \
+ m_##attr_NAME = oth->##attr_GETTER;
+#include "paragraphstyle.attrdefs.cxx"
+#undef ATTRDEF
+ }
+}
+
+
+
+void ParagraphStyle::applyStyle(const ParagraphStyle& other)
+{
+ Style::applyStyle(other);
+ cstyle.applyCharStyle(other.charStyle());
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ if (! other.inh_##attr_NAME) \
+ set##attr_NAME(other.m_##attr_NAME);
+#include "paragraphstyle.attrdefs.cxx"
+#undef ATTRDEF
+}
+
+
+void ParagraphStyle::eraseStyle(const ParagraphStyle& other)
+{
+ Style::eraseStyle(other);
+ cstyle.eraseCharStyle(other.charStyle());
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ if (!inh_##attr_NAME && m_##attr_NAME == other.##attr_GETTER()) \
+ reset##attr_NAME();
+#include "paragraphstyle.attrdefs.cxx"
+#undef ATTRDEF
+}
+
/branches/Version13x/Scribus/scribus/styles/paragraphstyle.cpp
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: branches/Version13x/Scribus/scribus/styles/charstyle.attrdefs.cxx
===================================================================
--- branches/Version13x/Scribus/scribus/styles/charstyle.attrdefs.cxx (nonexistent)
+++ branches/Version13x/Scribus/scribus/styles/charstyle.attrdefs.cxx (revision 6443)
@@ -0,0 +1,22 @@
+
+//Syntax: ATTRDEF( datatype, gettername, name, defaultvalue)
+
+ATTRDEF(int, fontSize, FontSize, 10)
+ATTRDEF(int, fillShade, FillShade, 100)
+ATTRDEF(int, strokeShade, StrokeShade, 100)
+ATTRDEF(StyleFlag, effects, Effects, ScStyle_Default)
+ATTRDEF(int, scaleH, ScaleH, 1000)
+ATTRDEF(int, scaleV, ScaleV, 1000)
+ATTRDEF(int, baselineOffset, BaselineOffset, 0)
+ATTRDEF(int, shadowXOffset, ShadowXOffset, 0)
+ATTRDEF(int, shadowYOffset, ShadowYOffset, 0)
+ATTRDEF(int, outlineWidth, OutlineWidth, 0)
+ATTRDEF(int, underlineOffset, UnderlineOffset, 0)
+ATTRDEF(int, underlineWidth, UnderlineWidth, 0)
+ATTRDEF(int, strikethruOffset, StrikethruOffset, 0)
+ATTRDEF(int, strikethruWidth, StrikethruWidth, 0)
+ATTRDEF(int, tracking, Tracking, 0)
+ATTRDEF(QString, fillColor, FillColor, "black")
+ATTRDEF(QString, strokeColor, StrokeColor, "black")
+ATTRDEF(QString, language, Language, "")
+ATTRDEF(ScFace, font, Font, ScFace::none())
/branches/Version13x/Scribus/scribus/styles/charstyle.attrdefs.cxx
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: branches/Version13x/Scribus/scribus/styles/paragraphstyle.h
===================================================================
--- branches/Version13x/Scribus/scribus/styles/paragraphstyle.h (nonexistent)
+++ branches/Version13x/Scribus/scribus/styles/paragraphstyle.h (revision 6443)
@@ -0,0 +1,99 @@
+/*
+ For general Scribus (>=1.3.2) copyright and licensing information please refer
+ to the COPYING file provided with the program. Following this notice may exist
+ a copyright and/or license notice that predates the release of Scribus 1.3.2
+ for which a new license (GPL+exception) is in place.
+ */
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+
+// DONT INCLUDE this file directly, include "style.h" instead!
+
+class SCRIBUS_API ParagraphStyle : public virtual Style
+{
+public:
+ enum LineSpacingMode {
+ FixedLineSpacing = 0,
+ AutomaticLineSpacing = 1,
+ BaselineGridLineSpacing = 2
+ };
+ enum AlignmentType {
+ Leftaligned = 0,
+ Centered = 1,
+ Rightaligned = 2,
+ Justified = 3,
+ Extended = 4
+ };
+ struct TabRecord
+ {
+ double tabPosition;
+ int tabType;
+ QChar tabFillChar;
+ };
+
+ ParagraphStyle();
+ ParagraphStyle(const ParagraphStyle& other);
+ ParagraphStyle& operator=(const ParagraphStyle& other);
+
+ QString displayName() const;
+
+ void update(StyleBase*);
+
+ bool equiv(const Style& other) const;
+
+ void applyStyle(const ParagraphStyle& other);
+ void eraseStyle(const ParagraphStyle& other);
+ void erase() { eraseStyle(*this); }
+
+ CharStyle & charStyle() { return cstyle; }
+ const CharStyle& charStyle() const { return cstyle; }
+
+
+ /** getter: validates and returns the attribute's value */
+
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ const attr_TYPE attr_GETTER() const { validate(); return m_##attr_NAME; }
+#include "paragraphstyle.attrdefs.cxx"
+#undef ATTRDEF
+
+ /** setter: sets the attribute's value and clears inherited flag */
+
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ void set##attr_NAME(attr_TYPE v) { m_##attr_NAME = v; inh_##attr_NAME = false; }
+#include "paragraphstyle.attrdefs.cxx"
+#undef ATTRDEF
+
+ /** setter: resets the attribute's value and sets inherited flag */
+
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ void reset##attr_NAME() { m_##attr_NAME = attr_DEFAULT; inh_##attr_NAME = true; }
+#include "paragraphstyle.attrdefs.cxx"
+#undef ATTRDEF
+
+ /** isInherited: returns true if the attriute is inherited */
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ bool isInh##attr_NAME() { return inh_##attr_NAME; }
+#include "paragraphstyle.attrdefs.cxx"
+#undef ATTRDEF
+
+
+private:
+
+ // member declarations:
+
+ CharStyle cstyle;
+
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+ attr_TYPE m_##attr_NAME; \
+ bool inh_##attr_NAME;
+#include "paragraphstyle.attrdefs.cxx"
+#undef ATTRDEF
+
+};
/branches/Version13x/Scribus/scribus/styles/paragraphstyle.h
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property