aboutsummaryrefslogtreecommitdiffstats
path: root/examples/EmbeddedWindow/QmlApp/mainwindow.h
blob: 4d81ed0ff956f061c3a1ace8184b1b623d5c120a (plain)
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
/***************************************************************************************************
 Copyright (C) 2023 The Qt Company Ltd.
 SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
***************************************************************************************************/

#pragma once

#include <QObject>
#include <QDotNetObject>

class MainWindowPrivate;

class MainWindow : public QObject, public QDotNetObject
{
    Q_OBJECT
    Q_PROPERTY(double hostWidth READ hostWidth NOTIFY hostWidthChanged)
    Q_PROPERTY(double hostHeight READ hostHeight NOTIFY hostHeightChanged)
    Q_PROPERTY(double cameraPositionX READ cameraPositionX NOTIFY cameraPositionXChanged)
    Q_PROPERTY(double cameraPositionY READ cameraPositionY NOTIFY cameraPositionYChanged)
    Q_PROPERTY(double cameraPositionZ READ cameraPositionZ NOTIFY cameraPositionZChanged)
    Q_PROPERTY(double cameraRotationX READ cameraRotationX NOTIFY cameraRotationXChanged)
    Q_PROPERTY(double cameraRotationY READ cameraRotationY NOTIFY cameraRotationYChanged)
    Q_PROPERTY(double cameraRotationZ READ cameraRotationZ NOTIFY cameraRotationZChanged)
    Q_PROPERTY(double animationDuration READ animationDuration NOTIFY animationDurationChanged)
    Q_PROPERTY(QString backgroundColor READ backgroundColor NOTIFY backgroundColorChanged)
    Q_PROPERTY(double framesPerSecond READ framesPerSecond WRITE setFramesPerSecond)
public:
    Q_DOTNET_OBJECT(MainWindow, "WpfApp.MainWindow, WpfApp");
    MainWindow();
    ~MainWindow();
    void init();
    void *hostHandle();
    int hostWidth();
    int hostHeight();
    double cameraPositionX();
    double cameraPositionY();
    double cameraPositionZ();
    double cameraRotationX();
    double cameraRotationY();
    double cameraRotationZ();
    double animationDuration();
    double framesPerSecond();
    QString backgroundColor();
signals:
    void contentRendered();
    void hostWidthChanged();
    void hostHeightChanged();
    void cameraPositionXChanged();
    void cameraPositionYChanged();
    void cameraPositionZChanged();
    void cameraRotationXChanged();
    void cameraRotationYChanged();
    void cameraRotationZChanged();
    void animationDurationChanged();
    void backgroundColorChanged();
    void closed();
public slots:
    void setFramesPerSecond(double fps);
private:
    MainWindowPrivate *d;
};