Debian Codegraph @

src/backend/commandLine/CommandLine.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2019 Damir Porobic <[email protected]>
3 *
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 2 of the License, or
7 * (at your option) any later version.
8 *
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.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20 #ifndef KSNIP_COMMANDLINE_H
21 #define KSNIP_COMMANDLINE_H
22
23 #include <QCommandLineParser>
24 #include <QCommandLineOption>
25 #include <QCoreApplication>
26 #include <QHash>
27
28 #include "src/common/enum/CaptureModes.h"
29
30 class CommandLine : public QCommandLineParser
31 {
32 public:
33 CommandLine(const QCoreApplication &app, const QList<CaptureModes> &captureModes);
34 ~CommandLine();
35 bool isRectAreaSet() const;
36 bool isLastRectAreaSet() const;
37 bool isFullScreenSet() const;
38 bool isCurrentScreenSet() const;
39 bool isActiveWindowSet() const;
40 bool isWindowsUnderCursorSet() const;
41 bool isPortalSet() const;
42 bool isDelaySet() const;
43 bool isCursorSet() const;
44 bool isEditSet() const;
45 bool isSaveSet() const;
46 bool isVersionSet() const;
47 bool isCaptureModeSet() const;
48 bool isUploadSet() const;
49 int delay() const;
50 QString imagePath() const;
51 QString saveToPath() const;
52 CaptureModes captureMode() const;
53
54 private:
55 QCommandLineOption *mRectAreaOption = nullptr;
56 QCommandLineOption *mLastRectAreaOption = nullptr;
57 QCommandLineOption *mFullScreenOption = nullptr;
58 QCommandLineOption *mCurrentScreenOption = nullptr;
59 QCommandLineOption *mActiveWindowOption = nullptr;
60 QCommandLineOption *mWindowUnderCursorOption = nullptr;
61 QCommandLineOption *mPortalOption = nullptr;
62 QCommandLineOption *mDelayOption = nullptr;
63 QCommandLineOption *mCursorOption = nullptr;
64 QCommandLineOption *mEditOption = nullptr;
65 QCommandLineOption *mSaveOption = nullptr;
66 QCommandLineOption *mSaveToOption = nullptr;
67 QCommandLineOption *mVersionOption = nullptr;
68 QCommandLineOption *mUploadOption = nullptr;
69
70 void addImageGrabberOptions(const QList<CaptureModes> &captureModes);
71 void addDefaultOptions();
72 void addVersionOptions();
73 QString translateText(const QString &text);
74 QCommandLineOption* addOption(const QString &shortName, const QString &longName, const QString &description);
75 QCommandLineOption* addParameterOption(const QString &shortName, const QString &longName, const QString &description, const QString &parameter);
76 void addPositionalArguments();
77 };
78
79 #endif //KSNIP_COMMANDLINE_H