00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Katri Kaikkonen - katri.kaikkonen@ixonos.com 00006 Jussi Laitinen - jussi.laitinen@ixonos.com 00007 00008 Situare is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU General Public License 00010 version 2 as published by the Free Software Foundation. 00011 00012 Situare is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with Situare; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00020 USA. 00021 */ 00022 00023 #ifndef TEXTMODIFIER_H 00024 #define TEXTMODIFIER_H 00025 00026 #include <QObject> 00027 00028 class QFontMetrics; 00029 00033 class TextModifier : public QObject 00034 { 00035 Q_OBJECT 00036 public: 00046 static QString shortenText(const QFontMetrics fontMetrics, const QString &text, 00047 int textMaxWidth); 00048 00059 static QString splitWord(const QFontMetrics fontMetrics, const QString &word, int textMaxWidth); 00060 00071 static QString splitLongWords(const QFontMetrics fontMetrics, const QString &text, 00072 int textMaxWidth); 00073 }; 00074 00075 #endif // TEXTMODIFIER_H