add import/export list items under Edit menu.
[abby.git] / src / util.h
bloba8021fd996fb1fb463288c693f2c9fc4c6577cec
1 /*
2 * abby Copyright (C) 2009 Toni Gundogdu.
3 * This file is part of abby.
5 * abby is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * abby is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef util_h
20 #define util_h
22 class QTreeWidget;
23 class QTextEdit;
24 class QListWidget;
26 class Util {
27 public:
28 static void detectCclive(
29 QString& path,
30 QString& version,
31 QString& libVersion,
32 QString& libName,
33 bool *isCcliveFlag
35 static void verifyCclivePath(
36 const QString& path,
37 QString& version,
38 QString& libVersion,
39 QString& libName,
40 bool *isCcliveFlag=NULL
42 static void checkAllItems(
43 const QTreeWidget *w,
44 const Qt::CheckState& st,
45 const int column=0
47 static void invertAllCheckableItems(
48 const QTreeWidget *w,
49 const int column=0
51 static void appendLog(const QTextEdit *w, const QString& s);
52 static int countItems(const QTreeWidget *w);
53 static void addItem(const QListWidget *w, QString lnk);
54 static void removeSelectedItems(const QWidget *parent, const QListWidget *w);
55 static void clearItems(const QWidget *parent, const QListWidget *w);
56 static void paste(const QListWidget *w);
57 static bool importItems(const QWidget *parent,
58 QStringList& lst, const QString& path);
59 static bool exportItems(const QWidget *parent,
60 const QListWidget *w, const QString& path, const bool& append);
63 class NoCcliveException {
64 public:
65 NoCcliveException(const QString& errmsg);
66 NoCcliveException(const QString& path, const QString& errmsg);
67 NoCcliveException(const QString& path,
68 const int& exitCode, const QString& output);
69 public:
70 const QString& what() const;
71 private:
72 QString errmsg;
75 #endif