AutoCatGnome/gtkpp/Dialog.h

38 lines
891 B
C++

//
// Created by selim on 17.05.2022.
//
#ifndef AUTOCAT_GNOME_DIALOG_H
#define AUTOCAT_GNOME_DIALOG_H
#include "Window.h"
#include "Box.h"
#include <sigc++/sigc++.h>
#include <concurrencpp/concurrencpp.h>
namespace cc = concurrencpp;
namespace gtkpp {
class Dialog: public Window {
private:
GtkResponseType _response = GTK_RESPONSE_NONE;
gulong _responseHandlerId;
sigc::signal<void(GtkResponseType)> _signalResponse;
friend void responseCallback(GtkDialog*, GtkResponseType responseId, void* data);
public:
void onResponse(const std::function<void(GtkResponseType)>& callback);
public:
explicit Dialog(Window* parent);
~Dialog();
cc::result<GtkResponseType> responseAsync();
GtkResponseType currentResponse() const;
Box contentWidget() const;
};
}
#endif //AUTOCAT_GNOME_DIALOG_H