LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
util.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include "utilconfig.h"
12#include <QString>
13
14class QTranslator;
15class QLocale;
16class QAction;
17class QImage;
18class QObject;
19
20template<typename T>
21class QList;
22
23class QModelIndex;
24
25namespace LC::Util
26{
29 Q_DECL_IMPORT extern const QString LCLowercase;
30
40 UTIL_API QString GetAsBase64Src (const QImage& image);
41
52 UTIL_API QString MakePrettySize (qint64 sourceSize);
53
68 UTIL_API QString MakePrettySizeShort (qint64 size);
69
79 UTIL_API QString MakeTimeFromLong (ulong time);
80
81 UTIL_API QTranslator* LoadTranslator (const QString& base,
82 const QString& locale,
83 const QString& prefix = LCLowercase,
84 const QString& appname = LCLowercase);
85
104 UTIL_API QTranslator* InstallTranslator (const QString& base,
105 const QString& prefix = LCLowercase,
106 const QString& appname = LCLowercase);
107
126 UTIL_API QString GetLocaleName ();
127
128 UTIL_API QString GetInternetLocaleName (const QLocale&);
129
139 UTIL_API QString GetLanguage ();
140
141 UTIL_API QList<QModelIndex> GetSummarySelectedRows (QObject *sender);
142
150 UTIL_API QAction* CreateSeparator (QObject *parent);
151}
QString MakePrettySizeShort(qint64 sourcesize)
Converts a bytes count to a string representation with appropriately chosen units.
Definition util.cpp:66
QString GetLocaleName()
Returns the current locale name, like en_US.
Definition util.cpp:151
QTranslator * LoadTranslator(const QString &baseName, const QString &localeName, const QString &prefix, const QString &appName)
Definition util.cpp:91
QString MakeTimeFromLong(ulong time)
Makes a formatted time from number.
Definition util.cpp:79
QModelIndexList GetSummarySelectedRows(QObject *sender)
Definition util.cpp:197
QString GetAsBase64Src(const QImage &pix)
Returns the given image in a Base64-encoded form.
Definition util.cpp:30
QString GetLanguage()
Returns the current language name.
Definition util.cpp:192
QAction * CreateSeparator(QObject *parent)
Returns the action that is set to act as a separator.
Definition util.cpp:214
const QString LCLowercase
The "leechcraft" literal, with no run-time overhead.
Definition util.cpp:28
QString MakePrettySize(qint64 sourcesize)
Makes a formatted size from number.
Definition util.cpp:53
QTranslator * InstallTranslator(const QString &baseName, const QString &prefix, const QString &appName)
Loads and installs a translator.
Definition util.cpp:131
QString GetInternetLocaleName(const QLocale &locale)
Definition util.cpp:182
#define UTIL_API
Definition utilconfig.h:16