Loading...
Searching...
No Matches
DialogRequest.h
Go to the documentation of this file.
1// Copyright (c) 2025 Dave R. Smith.
2// Malena Framework — Licensed under PolyForm Noncommercial 1.0.0; commercial use requires a paid license. See LICENSE.
3
4#ifndef MALENA_DIALOGREQUEST_H
5#define MALENA_DIALOGREQUEST_H
6
7#pragma once
8
10#include <functional>
11#include <string>
12
13namespace ml
14{
15 class Core;
41 {
42 enum class Hook { SHOW };
43
44 virtual const std::string& getMessage() = 0;
45 virtual const std::string& getConfirmLabel() = 0;
46 virtual const std::string& getCancelLabel() = 0;
47 virtual std::function<void()> getOnConfirm() = 0;
48 virtual std::function<void()> getOnReject() = 0;
49
50 // Optional overrides — existing subclasses need no changes
51 virtual std::string getTitle() { return {}; }
52 virtual ml::Core* getContent() { return nullptr; }
53
54 virtual ~DialogRequest() = default;
55 };
56
57} // namespace ml
58
59#endif // MALENA_DIALOGREQUEST_H
Virtual base class for all Malena framework objects.
Definition Core.h:97
#define MALENA_API
Definition Component.h:22
Interface for components that want the root shell to present a confirm/cancel dialog on their behalf.
virtual const std::string & getMessage()=0
virtual const std::string & getCancelLabel()=0
virtual std::string getTitle()
virtual std::function< void()> getOnConfirm()=0
virtual ~DialogRequest()=default
virtual std::function< void()> getOnReject()=0
virtual ml::Core * getContent()
virtual const std::string & getConfirmLabel()=0