2019-12-30 20:53:11 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
2021-03-29 21:41:11 -04:00
|
|
|
#include "CoreDefs.h"
|
2019-12-30 20:53:11 -05:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
struct Dialog;
|
2020-02-02 01:38:38 -05:00
|
|
|
struct DialogTextSubstitutions;
|
2020-06-06 02:25:10 -04:00
|
|
|
struct Rect;
|
2019-12-30 20:53:11 -05:00
|
|
|
struct Window;
|
2020-01-01 20:24:46 -05:00
|
|
|
struct TimeTaggedVOSEvent;
|
2020-06-06 02:25:10 -04:00
|
|
|
class PLPasStr;
|
2019-12-30 20:53:11 -05:00
|
|
|
|
|
|
|
|
namespace PortabilityLayer
|
|
|
|
|
{
|
2020-03-01 17:01:35 -05:00
|
|
|
class DialogImpl;
|
2020-01-01 20:24:46 -05:00
|
|
|
class Widget;
|
|
|
|
|
|
2019-12-30 20:53:11 -05:00
|
|
|
class DialogManager
|
|
|
|
|
{
|
|
|
|
|
public:
|
2020-02-02 01:38:38 -05:00
|
|
|
virtual Dialog *LoadDialog(int16_t resID, Window *behindWindow, const DialogTextSubstitutions *substitutions) = 0;
|
2020-06-06 02:25:10 -04:00
|
|
|
virtual Dialog *LoadDialogFromTemplate(int16_t templateResID, const Rect &rect, bool visible, bool hasCloseBox, uint32_t referenceConstant, uint16_t positionSpec, Window *behindWindow, const PLPasStr &title, const DialogTextSubstitutions *substitutions) = 0;
|
2021-03-29 21:41:11 -04:00
|
|
|
GP_ASYNCIFY_PARANOID_VIRTUAL int16_t DisplayAlert(int16_t alertResID, const DialogTextSubstitutions *substitutions) GP_ASYNCIFY_PARANOID_PURE;
|
2020-06-06 02:25:10 -04:00
|
|
|
virtual void PositionWindow(Window *window, const Rect &rect) const = 0;
|
2019-12-30 20:53:11 -05:00
|
|
|
|
|
|
|
|
static DialogManager *GetInstance();
|
|
|
|
|
};
|
2020-01-01 20:24:46 -05:00
|
|
|
|
2020-03-01 17:01:35 -05:00
|
|
|
class DialogItem final
|
2020-01-01 20:24:46 -05:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit DialogItem(Widget *widget);
|
|
|
|
|
~DialogItem();
|
|
|
|
|
|
|
|
|
|
Widget *GetWidget() const;
|
|
|
|
|
|
|
|
|
|
private:
|
2020-03-01 17:01:35 -05:00
|
|
|
friend class DialogImpl;
|
|
|
|
|
|
2020-01-01 20:24:46 -05:00
|
|
|
Widget *m_widget;
|
|
|
|
|
};
|
2019-12-30 20:53:11 -05:00
|
|
|
}
|