| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 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 ¶meter); |
| 76 |
void addPositionalArguments(); |
| 77 |
}; |
| 78 |
|
| 79 |
#endif |