Fix GNU C++ version check
[LibreOffice.git] / vcl / inc / qt5 / QtInstanceDialog.hxx
blob82acf2d6c1dd82e8a4944c4d6f9e5910e081b96c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #pragma once
12 #include "QtInstanceWindow.hxx"
14 #include <QtWidgets/QAbstractButton>
16 class QtInstanceDialog : public QtInstanceWindow, public virtual weld::Dialog
18 Q_OBJECT
20 std::unique_ptr<QDialog> m_pDialog;
21 QWidget* m_pContentArea;
23 // the DialogController/Dialog/function passed to the runAsync variants
24 std::shared_ptr<weld::DialogController> m_xRunAsyncDialogController;
25 std::shared_ptr<weld::Dialog> m_xRunAsyncDialog;
26 std::function<void(sal_Int32)> m_aRunAsyncFunc;
28 public:
29 QtInstanceDialog(QDialog* pDialog);
30 ~QtInstanceDialog();
32 virtual bool runAsync(const std::shared_ptr<weld::DialogController>& rxOwner,
33 const std::function<void(sal_Int32)>& func) override;
35 virtual bool runAsync(std::shared_ptr<Dialog> const& rxSelf,
36 const std::function<void(sal_Int32)>& func) override;
38 virtual void collapse(weld::Widget*, weld::Widget*) override;
40 virtual void undo_collapse() override;
42 virtual void
43 SetInstallLOKNotifierHdl(const Link<void*, vcl::ILibreOfficeKitNotifier*>&) override;
45 virtual int run() override;
47 virtual void response(int nResponse) override;
49 virtual void add_button(const OUString&, int, const OUString& rHelpId = {}) override;
51 virtual void set_modal(bool bModal) override;
53 virtual bool get_modal() const override;
55 virtual void set_centered_on_parent(bool bTrackGeometryRequests) override;
57 virtual std::unique_ptr<weld::Button> weld_button_for_response(int) override;
59 virtual void set_default_response(int) override;
61 virtual std::unique_ptr<weld::Container> weld_content_area() override;
63 static void handleButtonClick(QDialog& rDialog, QAbstractButton& rButton);
65 /**
66 * Name of the property to set on a QPushButton that holds the
67 * int VCL response code of that button.
69 static const char* const PROPERTY_VCL_RESPONSE_CODE;
71 protected slots:
72 virtual void dialogFinished(int nResult);
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */