kmarkupdirector_p.h

00001 /*
00002     This file is part of KDE.
00003 
00004     Copyright (c) 2008 Stephen Kelly <steveire@gmail.com>
00005 
00006     This library is free software; you can redistribute it and/or modify it
00007     under the terms of the GNU Library General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or (at your
00009     option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful, but WITHOUT
00012     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00013     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00014     License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to the
00018     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00019     02110-1301, USA.
00020 */
00021 
00022 #ifndef KMARKUPDIRECTOR_P_H
00023 #define KMARKUPDIRECTOR_P_H
00024 
00025 #include "kmarkupdirector.h"
00026 
00027 #include <QSet>
00028 
00029 //@cond PRIVATE
00030 
00035 class KMarkupDirector::Private
00036 {
00037 public:
00038     Private(KMarkupDirector *md)
00039             : q(md) {
00040     }
00041 
00042     void processClosingElements(QTextBlock::iterator it);
00043     void processOpeningElements(QTextBlock::iterator it);
00044     QSet< int > getElementsToClose(QTextBlock::iterator it);
00045     QList< int > getElementsToOpen(QTextBlock::iterator it);
00046     QList< int > sortOpeningOrder(QSet< int > openingOrder, QTextBlock::iterator it);
00047 
00048     KMarkupDirector *q;
00049     KAbstractMarkupBuilder *builder;
00050 
00051     enum OpenElementValues {
00052         None = 0x0,
00053         SuperScript = 0x01,
00054         SubScript = 0x02,
00055         Anchor = 0x04,
00056         SpanForeground = 0x08,
00057         SpanBackground = 0x10,
00058         SpanFontFamily = 0x20,
00059         SpanFontPointSize = 0x40,
00060         Strong = 0x80,
00061         Emph = 0x100,
00062         Underline = 0x200,
00063         StrikeOut = 0x400
00064     };
00065 //     Q_DECLARE_FLAGS(OpenElements, OpenElementValues)
00066 
00067     QString openAnchorHref;
00068     QString anchorHrefToOpen;
00069     QString openAnchorName;
00070 
00071     QBrush openForeground;
00072     QBrush foregroundToOpen;
00073     QBrush openBackground;
00074     QBrush backgroundToOpen;
00075     int openFontPointSize;
00076     int fontPointSizeToOpen;
00077     QString openFontFamily;
00078     QString fontFamilyToOpen;
00079 
00080     // An ordered list containing the order elements were opened in.
00081     QList< int > openElements;
00082 
00083     // Elements that have yet to be opened. Used while determine the order to open them.
00084     QSet< int > elementsToOpen;
00085 
00086 };
00087 // Q_DECLARE_OPERATORS_FOR_FLAGS(KMarkupDirector::Private::OpenElements)
00088 
00089 #endif
00090 //@endcond
KDE Home | KDE Accessibility Home | Description of Access Keys