1 #pragma once
2 
3 #ifndef CAMERASETTINGSPOPUP_H
4 #define CAMERASETTINGSPOPUP_H
5 
6 #include "tgeometry.h"
7 #include "toonz/tstageobject.h"
8 #include "toonzqt/dvdialog.h"
9 
10 // forward declaration
11 class QLabel;
12 class QComboBox;
13 class QPushButton;
14 class QLineEdit;
15 class QRadioButton;
16 class TStageObject;
17 class TCamera;
18 class CameraSettingsWidget;
19 class TXshLevel;
20 
21 namespace DVGui {
22 class LineEdit;
23 class DoubleLineEdit;
24 class CheckBox;
25 class ValueField;
26 class MeasuredDoubleLineEdit;
27 }
28 
29 //=============================================================================
30 // CameraSettingsPopup
31 //-----------------------------------------------------------------------------
32 
33 class CameraSettingsPopup final : public QDialog {
34   Q_OBJECT
35   static std::map<TStageObjectId, CameraSettingsPopup *> m_popups;
36 
37   DVGui::LineEdit *m_nameFld;
38   CameraSettingsWidget *m_cameraSettingsWidget;
39   TStageObjectId m_cameraId;  // if == NoneId then use the current camera
40 
41   TStageObject *getCameraObject();
42   TCamera *getCamera();
43   void updateWindowTitle();
44 
45 public:
46   CameraSettingsPopup();
47 
attachToCamera(const TStageObjectId & id)48   void attachToCamera(const TStageObjectId &id) { m_cameraId = id; }
49 
50   // create a popup attached to camera id (or return the already existent one)
51   static CameraSettingsPopup *createPopup(const TStageObjectId &id);
52 
53 protected:
54   void showEvent(QShowEvent *e) override;
55   void hideEvent(QHideEvent *e) override;
56   void moveEvent(QMoveEvent *e) override;
57 
58 protected slots:
59 
60   void onChanged();
61   void onNameChanged();
62   void updateFields();
updateFields(bool)63   void updateFields(bool) {
64     updateFields();
65   }  // to be connected to objectChanged(bool)
66   void onLevelSwitched(TXshLevel *);
67 
68 signals:
69   void changed();
70 };
71 
72 #endif  // CAMERASETTINGSPOPUP_H
73