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

« back to all changes in this revision

Viewing changes to src/app/docviewer-application.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) 2012 Canonical Ltd
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 version 3 as
6
 
 * published by the Free Software Foundation.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful,
9
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
 * GNU General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU General Public License
14
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 *
16
 
 * Authors:
17
 
 * Charles Lindsay <chaz@yorba.org>
18
 
 */
19
 
 
20
 
#ifndef DOCVIEWERAPPLICATION_H
21
 
#define DOCVIEWERAPPLICATION_H
22
 
 
23
 
#include <QApplication>
24
 
#include <QElapsedTimer>
25
 
#include <QFileInfo>
26
 
#include <QTimer>
27
 
 
28
 
class CommandLineParser;
29
 
class UrlHandler;
30
 
class ContentCommunicator;
31
 
 
32
 
class QQuickView;
33
 
 
34
 
/*!
35
 
 * \brief The DocViewerApplication class
36
 
 */
37
 
class DocViewerApplication : public QApplication
38
 
{
39
 
    Q_OBJECT
40
 
    Q_PROPERTY(bool desktopMode READ isDesktopMode CONSTANT)
41
 
    Q_PROPERTY(bool fullScreen READ isFullScreen WRITE setFullScreen NOTIFY fullScreenChanged)
42
 
    Q_PROPERTY(QString documentFile READ getDocumentFile WRITE setDocumentFile NOTIFY documentFileChanged)
43
 
    Q_PROPERTY(QString documentsDir READ getDocumentsDir CONSTANT)
44
 
 
45
 
public:
46
 
    explicit DocViewerApplication(int& argc, char** argv);
47
 
    virtual ~DocViewerApplication();
48
 
 
49
 
    bool init();
50
 
    int exec();
51
 
 
52
 
    bool isDesktopMode() const;
53
 
    bool isFullScreen() const;
54
 
    const QString &getDocumentFile() const;
55
 
    const QString &getDocumentsDir() const;
56
 
 
57
 
    Q_INVOKABLE void parseUri(const QString &arg);
58
 
    Q_INVOKABLE void releaseResources();
59
 
 
60
 
signals:
61
 
    void fullScreenChanged();
62
 
    void documentFileChanged();
63
 
 
64
 
private slots:
65
 
    void setFullScreen(bool fullScreen);
66
 
    void setDocumentFile(const QString &documentFile);
67
 
 
68
 
private:
69
 
    void registerQML();
70
 
    void createView();
71
 
 
72
 
    QQuickView *m_view;
73
 
    CommandLineParser* m_cmdLineParser;
74
 
    UrlHandler *m_urlHandler;
75
 
 
76
 
    QString m_documentFile;
77
 
    bool m_documentLoaded;
78
 
};
79
 
 
80
 
#endif // DOCVIEWERAPPLICATION_H