KDEUI
kfontutils.h
Go to the documentation of this file.
00001 /********************************************************************************* 00002 * * 00003 * Copyright (C) 2005, 2009 by Albert Astals Cid <aacid@kde.org> * 00004 * * 00005 * This library is free software; you can redistribute it and/or * 00006 * modify it under the terms of the GNU Lesser General Public * 00007 * License as published by the Free Software Foundation; either * 00008 * version 2.1 of the License, or (at your option) version 3, or any * 00009 * later version accepted by the membership of KDE e.V. (or its * 00010 * successor approved by the membership of KDE e.V.), which shall * 00011 * act as a proxy defined in Section 6 of version 3 of the license. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public * 00019 * License along with this library. If not, see <http://www.gnu.org/licenses/>. * 00020 * * 00021 *********************************************************************************/ 00022 00023 #ifndef KFONTMETRICS_H 00024 #define KFONTMETRICS_H 00025 00026 #include "kdeui_export.h" 00027 00028 class QPainter; 00029 class QSizeF; 00030 class QString; 00031 00032 namespace KFontUtils 00033 { 00035 enum AdaptFontSizeOption { 00036 NoFlags = 0x01 , 00037 DoNotAllowWordWrap = 0x02 00038 }; 00039 Q_DECLARE_FLAGS(AdaptFontSizeOptions, AdaptFontSizeOption) 00040 00041 00058 qreal KDEUI_EXPORT adaptFontSize(QPainter &painter, 00059 const QString &text, 00060 qreal width, 00061 qreal height, 00062 qreal maxFontSize = 28.0, 00063 qreal minFontSize = 1.0, 00064 AdaptFontSizeOptions flags = NoFlags); 00065 00069 qreal KDEUI_EXPORT adaptFontSize(QPainter &painter, 00070 const QString &text, 00071 const QSizeF &availableSize, 00072 qreal maxFontSize = 28.0, 00073 qreal minFontSize = 1.0, 00074 AdaptFontSizeOptions flags = NoFlags); 00075 } 00076 00077 Q_DECLARE_OPERATORS_FOR_FLAGS(KFontUtils::AdaptFontSizeOptions) 00078 00079 #endif 00080
KDE 4.7 API Reference