~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12

« back to all changes in this revision

Viewing changes to src/app/command-line-parser.h

  • Committer: Stefano Verzegnassi
  • Date: 2015-10-20 18:21:17 UTC
  • mfrom: (183.1.7 lo-viewer)
  • Revision ID: stefano92.100@gmail.com-20151020182117-qza2vl31ilu2cvvj
Merged 'reboot' branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2013 Canonical, Ltd.
3
 
 *
4
 
 * Authors:
5
 
 *  Nicolas d'Offay <nicolas.doffay@canonical.com>
6
 
 *
7
 
 * This program is free software; you can redistribute it and/or modify
8
 
 * it under the terms of the GNU General Public License as published by
9
 
 * the Free Software Foundation; version 3.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
 
 *
19
 
 */
20
 
 
21
 
#ifndef COMMANDLINEPARSER_H
22
 
#define COMMANDLINEPARSER_H
23
 
 
24
 
#include <QHash>
25
 
#include <QSize>
26
 
#include <QString>
27
 
 
28
 
class UrlHandler;
29
 
 
30
 
/*!
31
 
 * @brief The CommandLineParser is used to parse our commandline inputs and set
32
 
 * parameters accordingly.
33
 
 */
34
 
class CommandLineParser
35
 
{
36
 
public:
37
 
    CommandLineParser();
38
 
 
39
 
    bool processArguments(const QStringList& args);
40
 
 
41
 
    bool isFullscreen() const { return m_isFullscreen; }
42
 
    const QString &documentsDir() const { return m_documentsDir; }
43
 
    bool pickModeEnabled() const { return m_pickMode; }
44
 
    bool testability() const { return m_testability; }
45
 
    const QString &documentFile() const { return m_documentFile; }
46
 
 
47
 
private:
48
 
    bool invalidArg(QString arg);
49
 
    void usage();
50
 
 
51
 
    UrlHandler *m_urlHandler;
52
 
 
53
 
    bool m_isFullscreen;
54
 
    bool m_pickMode;
55
 
    bool m_testability;
56
 
    QString m_documentFile;
57
 
    QString m_documentsDir;
58
 
};
59
 
 
60
 
#endif // COMMANDLINEPARSER_H