public:
TextModifier(QObject *parent = 0);
+ /**
+ * @brief Shortens text to fit.
+ *
+ * Text shortening is defined by text maximum width.
+ *
+ * @param fontMetrics font metrics to use
+ * @param text text to shorten
+ * @param textMaxWidth maximum width for text
+ */
static QString shortenText(const QFontMetrics fontMetrics, const QString &text,
int textMaxWidth);
+ /**
+ * @brief Splits too long word.
+ *
+ * Splits long word to several by adding extra spaces
+ *
+ * @param fontMetrics font metrics to use
+ * @param word long word to be splitted
+ * @param textMaxWidth maximum width for word
+ * @returns splitted word
+ */
static QString splitWord(const QFontMetrics fontMetrics, const QString &word, int textMaxWidth);
+ /**
+ * @brief Splits long words from text.
+ *
+ * Splits long words to several by adding extra spaces
+ *
+ * @param fontMetrics font metrics to use
+ * @param text text to be splitted
+ * @param textMaxWidth maximum width for word
+ * @returns text with long words splitted
+ */
static QString splitLongWords(const QFontMetrics fontMetrics, const QString &text,
int textMaxWidth);
};