Audacity 3.2.0
URLSchemesRegistry.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 URLSchemesRegistry.h
7
8 Dmitry Vedenko
9
10**********************************************************************/
11
12#pragma once
13
14#include <string_view>
15#include <functional>
16
17#include "Observer.h"
18
21{
22 std::string_view url;
23};
24
27class URL_SCHEMES_API URLSchemesRegistry final :
28 public Observer::Publisher<URLschemeHandlerMessage>
29{
30 URLSchemesRegistry() = default;
33
34public:
36 static URLSchemesRegistry& Get();
37
39 bool IsURLHandlingSupported() const noexcept;
40
42
52 bool RegisterScheme(std::string_view scheme);
53
58 void HandleURL(std::string_view url);
59};
An object that sends messages to an open-ended list of subscribed callbacks.
Definition: Observer.h:108
URLSchemesRegistry(const URLSchemesRegistry &)=delete
URLSchemesRegistry & operator=(const URLSchemesRegistry &)=delete
URLSchemesRegistry()=default
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
Definition: BasicUI.cpp:201
STL namespace.
A message that is invoked when a custom-scheme URL is passed to Audacity.