summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-write/qstylesheet.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-write/qstylesheet.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-write/qstylesheet.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/noncore/apps/opie-write/qstylesheet.cpp b/noncore/apps/opie-write/qstylesheet.cpp
index 67cd828..ca634f7 100644
--- a/noncore/apps/opie-write/qstylesheet.cpp
+++ b/noncore/apps/opie-write/qstylesheet.cpp
@@ -1,234 +1,232 @@
/****************************************************************************
** $Id$
**
** Implementation of the QStyleSheet class
**
** Created : 990101
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of the kernel module of the Qt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "qstylesheet.h"
#include "qrichtext_p.h"
-#include "qlayout.h"
-#include "qpainter.h"
#include "qcleanuphandler.h"
#include <stdio.h>
using namespace Qt3;
namespace Qt3 {
class QStyleSheetItemData
{
public:
QStyleSheetItem::DisplayMode disp;
int fontitalic;
int fontunderline;
int fontstrikeout;
int fontweight;
int fontsize;
int fontsizelog;
int fontsizestep;
int lineSpacing;
QString fontfamily;
QStyleSheetItem *parentstyle;
QString stylename;
int ncolumns;
QColor col;
bool anchor;
int align;
QStyleSheetItem::VerticalAlignment valign;
int margin[5];
QStyleSheetItem::ListStyle list;
QStyleSheetItem::WhiteSpaceMode whitespacemode;
QString contxt;
bool selfnest;
QStyleSheet* sheet;
};
}
/*!
\class QStyleSheetItem qstylesheet.h
\brief The QStyleSheetItem class provides an encapsulation of a set of text styles.
\ingroup text
A style sheet item consists of a name and a set of attributes that
specifiy its font, color, etc. When used in a \link QStyleSheet
style sheet\endlink (see styleSheet()), items define the name() of
a rich text tag and the display property changes associated with
it.
The \link QStyleSheetItem::DisplayMode display mode\endlink
attribute indicates whether the item is a block, an inline element
or a list element; see setDisplayMode(). The treatment of
whitespace is controlled by the \link
QStyleSheetItem::WhiteSpaceMode white space mode\endlink; see
setWhiteSpaceMode(). An item's margins are set with setMargin(),
In the case of list items, the list style is set with
setListStyle(). An item may be a hypertext link anchor; see
setAnchor(). Other attributes are set with setAlignment(),
setVerticalAlignment(), setFontFamily(), setFontSize(),
setFontWeight(), setFontItalic(), setFontUnderline(),
setFontStrikeOut and setColor().
*/
/*! \enum QStyleSheetItem::AdditionalStyleValues
\internal
*/
/*!
\enum QStyleSheetItem::WhiteSpaceMode
This enum defines the ways in which QStyleSheet can treat
whitespace.
\value WhiteSpaceNormal any sequence of whitespace (including
line-breaks) is equivalent to a single space.
\value WhiteSpacePre whitespace must be output exactly as given
in the input.
\value WhiteSpaceNoWrap multiple spaces are collapsed as with
WhiteSpaceNormal, but no automatic line-breaks occur. To break
lines manually, use the \c{<br>} tag.
*/
/*!
\enum QStyleSheetItem::Margin
\value MarginLeft left margin
\value MarginRight right margin
\value MarginTop top margin
\value MarginBottom bottom margin
\value MarginAll all margins (left, right, top and bottom)
\value MarginVertical top and bottom margins
\value MarginHorizontal left and right margins
\value MarginFirstLine margin (indentation) of the first line of
a paragarph (in addition to the MarginLeft of the paragraph)
*/
/*!
Constructs a new style called \a name for the stylesheet \a
parent.
All properties in QStyleSheetItem are initially in the "do not
change" state, except \link QStyleSheetItem::DisplayMode display
mode\endlink, which defaults to \c DisplayInline.
*/
QStyleSheetItem::QStyleSheetItem( QStyleSheet* parent, const QString& name )
{
d = new QStyleSheetItemData;
d->stylename = name.lower();
d->sheet = parent;
init();
if (parent)
parent->insert( this );
}
/*!
Copy constructor. Constructs a copy of \a other that is not bound
to any style sheet.
*/
QStyleSheetItem::QStyleSheetItem( const QStyleSheetItem & other )
{
d = new QStyleSheetItemData;
*d = *other.d;
}
/*!
Destroys the style. Note that QStyleSheetItem objects become
owned by QStyleSheet when they are created.
*/
QStyleSheetItem::~QStyleSheetItem()
{
delete d;
}
/*!
Returns the style sheet this item is in.
*/
QStyleSheet* QStyleSheetItem::styleSheet()
{
return d->sheet;
}
/*!
\overload
Returns the style sheet this item is in.
*/
const QStyleSheet* QStyleSheetItem::styleSheet() const
{
return d->sheet;
}
/*!
\internal
Internal initialization
*/
void QStyleSheetItem::init()
{
d->disp = DisplayInline;
d->fontitalic = Undefined;
d->fontunderline = Undefined;
d->fontstrikeout = Undefined;
d->fontweight = Undefined;
d->fontsize = Undefined;
d->fontsizelog = Undefined;
d->fontsizestep = 0;
d->ncolumns = Undefined;
d->col = QColor(); // !isValid()
d->anchor = FALSE;
d->align = Undefined;
d->valign = VAlignBaseline;
d->margin[0] = Undefined;
d->margin[1] = Undefined;
d->margin[2] = Undefined;
d->margin[3] = Undefined;
d->margin[4] = Undefined;
d->list = (ListStyle) Undefined;
d->whitespacemode = (WhiteSpaceMode) Undefined;
d->selfnest = TRUE;
d->lineSpacing = Undefined;
}
/*!
Returns the name of the style item.
*/