File indexing completed on 2024-04-21 14:57:40

0001 /*
0002  * This file is part of the CSS implementation for KDE.
0003  *
0004  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Library General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Library General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Library General Public License
0017  * along with this library; see the file COPYING.LIB.  If not, write to
0018  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0019  * Boston, MA 02110-1301, USA.
0020  *
0021  */
0022 #ifndef html_helper_h
0023 #define html_helper_h
0024 
0025 #include <QColor>
0026 class QPainter;
0027 #include <QFontMetrics>
0028 #include <QFont>
0029 
0030 namespace khtml
0031 {
0032 class RenderObject;
0033 const QRgb transparentColor = 0x00000000;
0034 const QRgb invertedColor    = 0x00000002;
0035 
0036 extern QPainter *printpainter;
0037 void setPrintPainter(QPainter *printer);
0038 
0039 bool hasSufficientContrast(const QColor &c1, const QColor &c2);
0040 QColor retrieveBackgroundColor(const RenderObject *obj);
0041 QRgb qRgbaFromHsla(double h, double s, double l, double a);
0042 QColor colorForCSSValue(int css_value);
0043 
0044 void findWordBoundary(QChar *chars, int len, int position, int *start, int *end);
0045 
0046 //enumerator for findSelectionNode
0047 enum FindSelectionResult { SelectionPointBefore,
0048                            SelectionPointAfter,
0049                            SelectionPointInside,
0050                            // the next two are only used inside one line in RenderText
0051                            // to get BiDi contexts right.
0052                            SelectionPointBeforeInLine,
0053                            SelectionPointAfterInLine
0054                          };
0055 }
0056 
0057 #endif