3
* This file is part of BibleTime's source code, http://www.bibletime.info/.
5
* Copyright 1999-2006 by the BibleTime developers.
6
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
15
#include <qtextstream.h>
22
class CSwordModuleInfo;
26
* Provides some useful functions which would be normally global.
28
* Some methods,that would be normaly global, but I hate global functions :-)
29
* (the function locateHTML is from Sandy Meier (KDevelop))
31
* @short A class which contains static members to do small things.
32
* @author Joachim Ansorg <info@bibletime.info>
37
* @return The path of the HTML file "filename". This function searches only in $KDEDIR.
38
* @author Sandy Meier of the KDevelop team.
40
static QString locatehtml(const QString &filename);
42
* Converts HTML text to plain text.
43
* This function converts some HTML tags in text (e.g. <BR> to \n)
44
* @return The text withput HTML tags and with converted <BR> to \n
45
* @author Joachim Ansorg
47
static QString htmlToText(const QString&);
49
* Converts text to HTML converting some text commands into HTML tags (e.g. \n to <BR>)
50
* @return The HTML formatted text we got after changing \n to <BR>
51
* @author Joachim Ansorg
53
static QString textToHTML(const QString&);
55
* Creates the file filename and put the text of parameter "text" into the file.
56
* @return True if saving was sucessful, otherwise false
57
* @author Joachim Ansorg
59
static bool savePlainFile( const QString& filename, const QString& text, const bool& forceOverwrite = false, const QTextStream::Encoding& fileEncoding = QTextStream::Locale);
61
* Returns the icon used for the module given as aparameter.
63
static QPixmap getIconForModule( CSwordModuleInfo* );
64
/** Returns a label to explain difficult things of dialogs.
65
* This function returns a label with heading "heading" and explanation "text". This label should be used to
66
* explain difficult things of the GUI, e.g. in the optionsdialog.
68
static QLabel* explanationLabel(QWidget* parent, const QString& heading, const QString& text );
70
* Returns true if the character at position "pos" of text is inside an HTML tag. Returns false if it's not inside an HTML tag.
72
static bool inHTMLTag(int pos, QString & text);
73
/** Return the module's tooltip text
74
* @param module The module required for the toolip
75
* @return The tooltip text for the passed module
77
static QString moduleToolTip(CSwordModuleInfo* module);