File: MainWindow.h

package info (click to toggle)
calligra 1%3A25.04.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 309,164 kB
  • sloc: cpp: 667,890; xml: 126,105; perl: 2,724; python: 2,497; yacc: 1,817; ansic: 1,326; sh: 1,223; lex: 1,107; javascript: 495; makefile: 24
file content (96 lines) | stat: -rw-r--r-- 2,795 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/* This file is part of the KDE project
 * SPDX-FileCopyrightText: 2012 Arjen Hiemstra <ahiemstra@heimr.nl>
 * SPDX-FileCopyrightText: 2013 Dan Leinir Turthra Jensen <admin@leinir.dk>
 *
 * SPDX-License-Identifier: LGPL-2.0-or-later
 */

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

class MainWindow : public QMainWindow
{
    Q_OBJECT
    Q_PROPERTY(bool allowClose READ allowClose WRITE setAllowClose)
    Q_PROPERTY(bool slateMode READ slateMode NOTIFY slateModeChanged)
    Q_PROPERTY(QString applicationName READ applicationName CONSTANT)
    Q_PROPERTY(QString currentTouchPage READ currentTouchPage WRITE setCurrentTouchPage NOTIFY currentTouchPageChanged)
    Q_PROPERTY(bool temporaryFile READ temporaryFile WRITE setTemporaryFile NOTIFY temporaryFileChanged)
    Q_PROPERTY(bool fullScreen READ fullScreen WRITE setFullScreen NOTIFY fullScreenChanged)
    Q_PROPERTY(QObject *desktopKoView READ desktopKoView NOTIFY desktopKoViewChanged)

public:
    explicit MainWindow(QStringList fileNames, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
    ~MainWindow() override;

    bool allowClose() const;
    void setAllowClose(bool allow);

    bool slateMode() const;

    QString applicationName() const
    {
        return QLatin1String("CALLIGRA GEMINI");
    }

    QString currentTouchPage() const;
    void setCurrentTouchPage(QString newPage);

    bool temporaryFile() const;
    void setTemporaryFile(bool newValue);

    bool fullScreen() const;
    void setFullScreen(bool newValue);

    QObject *desktopKoView() const;
    Q_INVOKABLE int lastScreen() const;

    Q_INVOKABLE void setAlternativeSaveAction(QAction *altAction);

    void closeEvent(QCloseEvent *event) override;

    Q_INVOKABLE void setDocAndPart(QObject *document, QObject *part);

public Q_SLOTS:
    void minimize();
    void closeWindow();

    void switchToTouch();
    void switchToDesktop();
    void documentChanged();
    void resetWindowTitle();
    void resourceChanged(int key, const QVariant &v);
    void resourceChangedTouch(int key, const QVariant &v);
    /**
     * Used to open an arbitrary file from the welcome screen,
     * not from the normal UI (desktopproxy does that)
     */
    void openFile();
Q_SIGNALS:
    void closeRequested();
    void switchedToTouch();
    void slateModeChanged();
    void currentTouchPageChanged();
    void temporaryFileChanged();
    void fullScreenChanged();
    void desktopKoViewChanged();
    void documentSaved();

private Q_SLOTS:
    void switchDesktopForced();
    void switchTouchForced();
    void touchChange();
    void enableAltSaveAction();

private:
    class Private;
    Private *const d;

#ifdef Q_OS_WIN
    bool winEvent(MSG *message, long *result);
#endif
};

#endif // MAINWINDOW_H