1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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  */
9 
10 #ifndef INCLUDED_VCL_INC_MESSAGEDIALOG_HXX
11 #define INCLUDED_VCL_INC_MESSAGEDIALOG_HXX
12 
13 #include <vcl/dialog.hxx>
14 #include <vcl/layout.hxx>
15 #include <vcl/fixed.hxx>
16 
17 class MessageDialog : public Dialog
18 {
19 private:
20     VclButtonsType m_eButtonsType;
21     VclMessageType m_eMessageType;
22     VclPtr<VclBox> m_pOwnedContentArea;
23     VclPtr<VclButtonBox> m_pOwnedActionArea;
24     VclPtr<VclGrid> m_pGrid;
25     VclPtr<VclVBox> m_pMessageBox;
26     VclPtr<FixedImage> m_pImage;
27     VclPtr<VclMultiLineEdit> m_pPrimaryMessage;
28     VclPtr<VclMultiLineEdit> m_pSecondaryMessage;
29     OUString m_sPrimaryString;
30     OUString m_sSecondaryString;
31     void create_owned_areas();
32 
33     static void SetMessagesWidths(vcl::Window const* pParent, VclMultiLineEdit* pPrimaryMessage,
34                                   VclMultiLineEdit* pSecondaryMessage);
35 
36     friend class VclPtr<MessageDialog>;
37     MessageDialog(vcl::Window* pParent, WinBits nStyle);
38 
39     virtual void StateChanged(StateChangedType nType) override;
40 
41 public:
42     MessageDialog(vcl::Window* pParent, const OUString& rMessage, VclMessageType eMessageType,
43                   VclButtonsType eButtonsType);
44     virtual bool set_property(const OString& rKey, const OUString& rValue) override;
45     OUString const& get_primary_text() const;
46     OUString const& get_secondary_text() const;
47     void set_primary_text(const OUString& rPrimaryString);
48     void set_secondary_text(const OUString& rSecondaryString);
49     virtual ~MessageDialog() override;
50     virtual void dispose() override;
51 
52     void create_message_area();
get_message_area() const53     VclContainer* get_message_area() const { return m_pMessageBox.get(); }
54 };
55 
56 #endif
57 
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
59