| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| |
|
| | #ifndef GUI_TASKVIEW_TASKDIALOG_H
|
| | #define GUI_TASKVIEW_TASKDIALOG_H
|
| |
|
| | #include <string>
|
| | #include <vector>
|
| |
|
| | #include <QDialogButtonBox>
|
| | #include <QPointer>
|
| | #include <FCGlobal.h>
|
| |
|
| |
|
| | namespace App
|
| | {
|
| | class DocumentObject;
|
| | }
|
| |
|
| | namespace Gui
|
| | {
|
| | class MDIView;
|
| | namespace TaskView
|
| | {
|
| |
|
| | class TaskContent;
|
| | class TaskDialogAttorney;
|
| | class TaskDialogPy;
|
| | class TaskView;
|
| |
|
| |
|
| | class GuiExport TaskDialog: public QObject
|
| | {
|
| | Q_OBJECT
|
| |
|
| | public:
|
| | enum ButtonPosition
|
| | {
|
| | North,
|
| | South
|
| | };
|
| |
|
| | TaskDialog();
|
| | ~TaskDialog() override;
|
| |
|
| | QWidget* addTaskBox(QWidget* widget, bool expandable = true, QWidget* parent = nullptr);
|
| | QWidget* addTaskBox(
|
| | const QPixmap& icon,
|
| | QWidget* widget,
|
| | bool expandable = true,
|
| | QWidget* parent = nullptr
|
| | );
|
| | QWidget* addTaskBoxWithoutHeader(QWidget* widget);
|
| |
|
| | void setButtonPosition(ButtonPosition p)
|
| | {
|
| | pos = p;
|
| | }
|
| | ButtonPosition buttonPosition() const
|
| | {
|
| | return pos;
|
| | }
|
| | const std::vector<QWidget*>& getDialogContent() const;
|
| | bool canClose() const;
|
| |
|
| |
|
| | virtual QDialogButtonBox::StandardButtons getStandardButtons() const
|
| | {
|
| | return QDialogButtonBox::Ok | QDialogButtonBox::Cancel;
|
| | }
|
| | virtual void modifyStandardButtons(QDialogButtonBox*)
|
| | {}
|
| |
|
| |
|
| | void setEscapeButtonEnabled(bool on)
|
| | {
|
| | escapeButton = on;
|
| | }
|
| | bool isEscapeButtonEnabled() const
|
| | {
|
| | return escapeButton;
|
| | }
|
| |
|
| |
|
| |
|
| | void setAutoCloseOnTransactionChange(bool on)
|
| | {
|
| | autoCloseTransaction = on;
|
| | }
|
| | bool isAutoCloseOnTransactionChange() const
|
| | {
|
| | return autoCloseTransaction;
|
| | }
|
| |
|
| |
|
| |
|
| | void setAutoCloseOnDeletedDocument(bool on)
|
| | {
|
| | autoCloseDeletedDocument = on;
|
| | }
|
| | bool isAutoCloseOnDeletedDocument() const
|
| | {
|
| | return autoCloseDeletedDocument;
|
| | }
|
| |
|
| | const std::string& getDocumentName() const
|
| | {
|
| | return documentName;
|
| | }
|
| | void setDocumentName(const std::string& doc)
|
| | {
|
| | documentName = doc;
|
| | }
|
| |
|
| |
|
| |
|
| | void setAutoCloseOnClosedView(bool on)
|
| | {
|
| | autoCloseClosedView = on;
|
| | }
|
| | bool isAutoCloseOnClosedView() const
|
| | {
|
| | return autoCloseClosedView;
|
| | }
|
| | void associateToObject3dView(App::DocumentObject* obj);
|
| |
|
| | const Gui::MDIView* getAssociatedView() const
|
| | {
|
| | return associatedView;
|
| | }
|
| | void setAssociatedView(const Gui::MDIView* view)
|
| | {
|
| | associatedView = view;
|
| | }
|
| |
|
| | |
| | |
| | |
| |
|
| | virtual bool isAllowedAlterDocument() const
|
| | {
|
| | return false;
|
| | }
|
| | |
| | |
| | |
| |
|
| | virtual bool isAllowedAlterView() const
|
| | {
|
| | return true;
|
| | }
|
| | |
| | |
| | |
| |
|
| | virtual bool isAllowedAlterSelection() const
|
| | {
|
| | return true;
|
| | }
|
| | virtual bool needsFullSpace() const
|
| | {
|
| | return false;
|
| | }
|
| |
|
| | public:
|
| |
|
| | virtual void open();
|
| |
|
| | virtual void closed();
|
| |
|
| |
|
| | virtual void autoClosedOnTransactionChange();
|
| |
|
| |
|
| | virtual void autoClosedOnDeletedDocument();
|
| |
|
| |
|
| | virtual void autoClosedOnClosedView();
|
| |
|
| | virtual void clicked(int);
|
| |
|
| | virtual bool accept();
|
| |
|
| | virtual bool reject();
|
| |
|
| | virtual void helpRequested();
|
| |
|
| | virtual void onUndo();
|
| |
|
| | virtual void onRedo();
|
| |
|
| | void emitDestructionSignal()
|
| | {
|
| | Q_EMIT aboutToBeDestroyed();
|
| | }
|
| |
|
| | Q_SIGNALS:
|
| | void aboutToBeDestroyed();
|
| |
|
| | protected:
|
| | QPointer<QDialogButtonBox> buttonBox;
|
| |
|
| | std::vector<QWidget*> Content;
|
| | ButtonPosition pos;
|
| |
|
| | private:
|
| | std::string documentName;
|
| | const Gui::MDIView* associatedView;
|
| | bool escapeButton;
|
| | bool autoCloseTransaction;
|
| | bool autoCloseDeletedDocument;
|
| | bool autoCloseClosedView;
|
| |
|
| | friend class TaskDialogAttorney;
|
| | };
|
| |
|
| | class TaskDialogAttorney
|
| | {
|
| | private:
|
| | static void setButtonBox(TaskDialog* dlg, QDialogButtonBox* box)
|
| | {
|
| | dlg->buttonBox = box;
|
| | }
|
| | static QDialogButtonBox* getButtonBox(TaskDialog* dlg)
|
| | {
|
| | return dlg->buttonBox;
|
| | }
|
| |
|
| | friend class TaskDialogPy;
|
| | friend class TaskView;
|
| | };
|
| |
|
| | }
|
| | }
|
| |
|
| | #endif
|
| |
|