1 /*
2   CommandLine.h
3 
4   This file is part of Charm, a task-based time tracking application.
5 
6   Copyright (C) 2008-2018 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
7 
8   Author: Mirko Boehm <mirko.boehm@kdab.com>
9 
10   This program is free software; you can redistribute it and/or modify
11   it under the terms of the GNU General Public License as published by
12   the Free Software Foundation, either version 2 of the License, or
13   (at your option) any later version.
14 
15   This program is distributed in the hope that it will be useful,
16   but WITHOUT ANY WARRANTY; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18   GNU General Public License for more details.
19 
20   You should have received a copy of the GNU General Public License
21   along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 */
23 
24 #ifndef COMMANDLINE_H
25 #define COMMANDLINE_H
26 
27 #include <QString>
28 
29 class CommandLine
30 {
31 public:
32     CommandLine(int argc, char **argv);
33     CommandLine(const QString file, const int userId);
34     CommandLine(const int userId, const int index);
35 
36     enum Mode {
37         Mode_None,
38         Mode_InitializeDatabase,
39         Mode_CheckOrCreateUser,
40         Mode_DescribeUsage,
41         Mode_PrintVersion,
42         Mode_AddTimesheet,
43         Mode_RemoveTimesheet,
44         Mode_ExportProjectcodes,
45         Mode_NumberOfModes
46     };
47 
48     Mode mode() const;
49 
50     QString filename() const;
51 
52     QString userComment() const;
53 
54     QString exportFilename() const;
55 
56     QString userName() const;
57 
58     int userid() const;
59 
60     int index() const;
61 
62     /** Dump command line option reference. */
63     static void usage();
64 
65 private:
66     QString m_filename;
67     QString m_userComment;
68     QString m_userName;
69     QString m_exportFilename;
70     Mode m_mode;
71     int m_index;
72     int m_userid;
73 };
74 
75 #endif /*COMMANDLINE_H*/
76