LMMS
Loading...
Searching...
No Matches
juce_MessageBoxOptions.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
41
42//==============================================================================
63{
64public:
65 MessageBoxOptions() = default;
67 MessageBoxOptions& operator= (const MessageBoxOptions&) = default;
68
69 //==============================================================================
72
74 JUCE_NODISCARD MessageBoxOptions withTitle (const String& boxTitle) const { return with (*this, &MessageBoxOptions::title, boxTitle); }
75
77 JUCE_NODISCARD MessageBoxOptions withMessage (const String& boxMessage) const { return with (*this, &MessageBoxOptions::message, boxMessage); }
78
85 JUCE_NODISCARD MessageBoxOptions withButton (const String& text) const { auto copy = *this; copy.buttons.add (text); return copy; }
86
89
90 //==============================================================================
96
101 String getTitle() const { return title; }
102
107 String getMessage() const { return message; }
108
113 int getNumButtons() const noexcept { return buttons.size(); }
114
119 String getButtonText (int buttonIndex) const { return buttons[buttonIndex]; }
120
126
127private:
128 //==============================================================================
129 template <typename Member, typename Item>
130 static MessageBoxOptions with (MessageBoxOptions options, Member&& member, Item&& item)
131 {
132 options.*member = std::forward<Item> (item);
133 return options;
134 }
135
136 //==============================================================================
141};
142
143} // namespace juce
#define copy(x)
Definition ADnoteParameters.cpp:1011
#define noexcept
Definition DistrhoDefines.h:72
CAdPlugDatabase::CRecord::RecordType type
Definition adplugdb.cpp:93
Definition juce_Component.h:36
MessageBoxIconType getIconType() const noexcept
Definition juce_MessageBoxOptions.h:95
WeakReference< Component > associatedComponent
Definition juce_MessageBoxOptions.h:140
MessageBoxOptions(const MessageBoxOptions &)=default
JUCE_NODISCARD MessageBoxOptions withTitle(const String &boxTitle) const
Definition juce_MessageBoxOptions.h:74
String title
Definition juce_MessageBoxOptions.h:138
JUCE_NODISCARD MessageBoxOptions withAssociatedComponent(Component *component) const
Definition juce_MessageBoxOptions.h:88
String message
Definition juce_MessageBoxOptions.h:138
Component * getAssociatedComponent() const noexcept
Definition juce_MessageBoxOptions.h:125
int getNumButtons() const noexcept
Definition juce_MessageBoxOptions.h:113
JUCE_NODISCARD MessageBoxOptions withIconType(MessageBoxIconType type) const
Definition juce_MessageBoxOptions.h:71
String getTitle() const
Definition juce_MessageBoxOptions.h:101
String getMessage() const
Definition juce_MessageBoxOptions.h:107
static MessageBoxOptions with(MessageBoxOptions options, Member &&member, Item &&item)
Definition juce_MessageBoxOptions.h:130
String getButtonText(int buttonIndex) const
Definition juce_MessageBoxOptions.h:119
JUCE_NODISCARD MessageBoxOptions withMessage(const String &boxMessage) const
Definition juce_MessageBoxOptions.h:77
MessageBoxIconType iconType
Definition juce_MessageBoxOptions.h:137
JUCE_NODISCARD MessageBoxOptions withButton(const String &text) const
Definition juce_MessageBoxOptions.h:85
StringArray buttons
Definition juce_MessageBoxOptions.h:139
Definition juce_StringArray.h:35
Definition juce_String.h:53
Definition juce_WeakReference.h:78
#define JUCE_NODISCARD
Definition juce_CompilerSupport.h:108
#define JUCE_API
Definition juce_StandardHeader.h:152
Definition carla_juce.cpp:31
MessageBoxIconType
Definition juce_MessageBoxOptions.h:31
@ WarningIcon
Definition juce_MessageBoxOptions.h:35
@ QuestionIcon
Definition juce_MessageBoxOptions.h:33
@ NoIcon
Definition juce_MessageBoxOptions.h:32
@ InfoIcon
Definition juce_MessageBoxOptions.h:37
const char * text
Definition swell-functions.h:167
#define const
Definition zconf.h:137