Recent: Reverse order to "most recent first"
[nomnom.git] / src / util.h
blob2e063f112ab64340b77c99f4e8a5d38039e214c7
1 /*
2 * Copyright (C) 2010 Toni Gundogdu.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef nomnom_util_h
19 #define nomnom_util_h
21 #include <QInputDialog>
22 #include <QMessageBox>
23 #include <QStringList>
24 #include <QTranslator>
25 #include <QSettings>
26 #include <QProcess>
28 namespace NomNom
31 typedef QListIterator<QPair<QString,QString> > FeedIterator;
32 typedef QList< QPair<QString,QString> > Feed;
34 void
35 restore_size(
36 QSettings&,
37 QWidget*,
38 const QString&,
39 const QSize& defaultSize=QSize(400,350)
42 void
43 restore_pos (
44 QSettings&,
45 QWidget*,
46 const QString&,
47 const QPoint& defaultPos=QPoint(200,200)
50 void
51 save_size (
52 QSettings&,
53 QWidget*,
54 const QString&
57 void
58 save_pos (
59 QSettings&,
60 QWidget*,
61 const QString&
64 void
65 info (QWidget*, const QString&);
67 void
68 crit (QWidget*, const QString&);
70 #define DEFAULTBTNS QMessageBox::Yes|QMessageBox::No
72 QMessageBox::StandardButton
73 ask (QWidget*, const QString&, QMessageBox::StandardButtons=DEFAULTBTNS);
75 #undef DEFAULTBTNS
77 QMap<QString,QString>
78 find_qm (QStringList&);
80 bool
81 choose_lang (QWidget*, QString&);
83 QTranslator*
84 load_qm ();
86 bool
87 parse_quvi_version (const QString& path, QString& output);
89 bool
90 parse_quvi_support (const QString& path, QString& errmsg);
92 bool
93 format_filename (
94 QWidget*,
95 const QString& user_regexp,
96 const QString& title,
97 const QString& suffix,
98 const QString& host,
99 const QString& id,
100 QString& dst
103 QString
104 to_process_errmsg (QProcess::ProcessError);
106 bool
107 choose_from_feed (QWidget *, QString&);
109 QString
110 reverse_line_order(const QString&, const QString& sep="\n");
112 } // End of namespace.
114 #endif
116 // vim: set ts=2 sw=2 tw=72 expandtab: