JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_ApplicationCommandTarget.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
29//==============================================================================
47{
48public:
49 //==============================================================================
52
55
56 //==============================================================================
60 struct JUCE_API InvocationInfo
61 {
62 //==============================================================================
63 InvocationInfo (CommandID commandID);
64
65 //==============================================================================
68
73
74 //==============================================================================
77 {
78 direct = 0,
81 fromButton
82 };
83
86
87 //==============================================================================
94
95 //==============================================================================
102
109
116 };
117
118 //==============================================================================
133
139 virtual void getAllCommands (Array<CommandID>& commands) = 0;
140
165 virtual void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result) = 0;
166
177 virtual bool perform (const InvocationInfo& info) = 0;
178
179 //==============================================================================
197 bool invoke (const InvocationInfo& invocationInfo,
198 bool asynchronously);
199
205 bool invokeDirectly (CommandID commandID,
206 bool asynchronously);
207
208 //==============================================================================
215 ApplicationCommandTarget* getTargetForCommand (CommandID commandID);
216
222 bool isCommandActive (CommandID commandID);
223
231 ApplicationCommandTarget* findFirstTargetParentComponent();
232
233private:
234 //==============================================================================
235 class CommandMessage;
236 friend class CommandMessage;
237
238 bool tryToInvoke (const InvocationInfo&, bool async);
239
242};
243
244} // namespace juce
A command target publishes a list of command IDs that it can perform.
virtual ApplicationCommandTarget * getNextCommandTarget()=0
This must return the next target to try after this one.
virtual void getCommandInfo(CommandID commandID, ApplicationCommandInfo &result)=0
This must provide details about one of the commands that this target can perform.
virtual void getAllCommands(Array< CommandID > &commands)=0
This must return a complete list of commands that this target can handle.
virtual bool perform(const InvocationInfo &info)=0
This must actually perform the specified command.
Holds a resizable array of primitive or copy-by-value objects.
Definition juce_Array.h:56
The base class for all JUCE user-interface objects.
Represents a key press, including any modifier keys that are needed.
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
This is a shorthand way of writing both a JUCE_DECLARE_NON_COPYABLE and JUCE_LEAK_DETECTOR macro for ...
#define JUCE_DECLARE_WEAK_REFERENCEABLE(Class)
Macro to easily allow a class to be made weak-referenceable.
JUCE Namespace.
int CommandID
A type used to hold the unique ID for an application command.
Holds information describing an application command.
Contains contextual details about the invocation of a command.
KeyPress keyPress
The keypress that was used to invoke it.
InvocationMethod invocationMethod
The type of event that triggered this command.
Component * originatingComponent
If triggered by a keypress or menu, this will be the component that had the keyboard focus at the tim...
bool isKeyDown
True if the callback is being invoked when the key is pressed, false if the key is being released.
InvocationMethod
The types of context in which the command might be called.
@ fromKeyPress
The command is being invoked by a key-press.
@ fromMenu
The command is being invoked by a menu selection.
CommandID commandID
The UID of the command that should be performed.
int millisecsSinceKeyPressed
If the key is being released, this indicates how long it had been held down for.