Debian Codegraph @

src/album/controller/commandline.h

raw
1 /*
2 * Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co., Ltd.
3 *
4 * Author: ZhangYong <[email protected]>
5 *
6 * Maintainer: ZhangYong <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21 #ifndef COMMANDLINE_H
22 #define COMMANDLINE_H
23
24 #include "imageengine/imageengineapi.h"
25
26 #include <QObject>
27 #include <QCommandLineParser>
28 #include <QWidget>
29 #include <QHBoxLayout>
30
31 struct CMOption;
32 class MainWidget;
33 class CommandLine : public QWidget
34 {
35 Q_OBJECT
36 public:
37 static CommandLine *instance();
38 bool processOption(QStringList &paslist);
39 ~CommandLine() override;
40 //设置管理线程的对象
41 void setThreads(ImageEngineImportObject *obj);
42 void viewImage(const QString &path, const QStringList &paths);
43 QWidget *m_pwidget;
44 private:
45 void addOption(const CMOption *option);
46 void showHelp();
47
48 // void checkFileType(QStringList pas, QStringList &paslist);
49
50 explicit CommandLine();
51
52 void resizeEvent(QResizeEvent *e) override;
53
54 private:
55 static CommandLine *m_commandLine;
56 QCommandLineParser m_cmdParser;
57 ImageEngineImportObject *m_obj;
58
59 QHBoxLayout *m_layout = nullptr;
60 MainWidget *m_mainWidget = nullptr;
61 };
62
63 #endif // COMMANDLINE_H