LibreOffice Module toolkit (master) 1
msgbox.hxx
Go to the documentation of this file.
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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
21#include <helper/btndlg.hxx>
22#include <vcl/toolkit/fixed.hxx>
24
25// Window-Bits for MessageBoxen
26enum class MessBoxStyle
27{
28 NONE = 0x0000,
29 Ok = 0x0001,
30 OkCancel = 0x0002,
31 YesNo = 0x0004,
32 YesNoCancel = 0x0008,
33 RetryCancel = 0x0010,
34 DefaultOk = 0x0020,
35 DefaultCancel = 0x0040,
36 DefaultRetry = 0x0080,
37 DefaultYes = 0x0100,
38 DefaultNo = 0x0200,
39 AbortRetryIgnore = 0x1000,
40 DefaultIgnore = 0x2000,
41};
42namespace o3tl
43{
44template <> struct typed_flags<MessBoxStyle> : is_typed_flags<MessBoxStyle, 0x33ff>
45{
46};
47}
48
49class MessBox : public ButtonDialog
50{
56 OUString maMessText;
57
58protected:
59 void ImplInitButtons();
60 void ImplPosControls();
61
62public:
63 MessBox(vcl::Window* pParent, MessBoxStyle nMessBoxStyle, WinBits n, const OUString& rTitle,
64 OUString rMessage);
65 virtual ~MessBox() override;
66 virtual void dispose() override;
67
68 virtual void StateChanged(StateChangedType nStateChange) override;
69
70 void SetMessText(const OUString& rText) { maMessText = rText; }
71 const OUString& GetMessText() const { return maMessText; }
72
73 void SetImage(const Image& rImage) { maImage = rImage; }
74
75 virtual Size GetOptimalSize() const override;
76};
77
78/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void ImplPosControls()
const OUString & GetMessText() const
Definition: msgbox.hxx:71
bool mbHelpBtn
Definition: msgbox.hxx:54
OUString maMessText
Definition: msgbox.hxx:56
virtual void dispose() override
virtual ~MessBox() override
virtual Size GetOptimalSize() const override
VclPtr< FixedImage > mpFixedImage
Definition: msgbox.hxx:52
MessBoxStyle mnMessBoxStyle
Definition: msgbox.hxx:55
virtual void StateChanged(StateChangedType nStateChange) override
void SetMessText(const OUString &rText)
Definition: msgbox.hxx:70
void SetImage(const Image &rImage)
Definition: msgbox.hxx:73
void ImplInitButtons()
VclPtr< VclMultiLineEdit > mpVCLMultiLineEdit
Definition: msgbox.hxx:51
Image maImage
Definition: msgbox.hxx:53
friend friend class MessBox
NONE
MessBoxStyle
StateChangedType
sal_Int64 WinBits