summaryrefslogtreecommitdiff
path: root/LibGUI/GAction.cpp
blob: aa6e52c5dfc4bdf9756f78a33b3553beb1e01bcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <LibGUI/GAction.h>

GAction::GAction(const String& text, const String& custom_data, Function<void(const GAction&)> on_activation_callback)
    : on_activation(move(on_activation_callback))
    , m_text(text)
    , m_custom_data(custom_data)
{
}

GAction::GAction(const String& text, Function<void(const GAction&)> on_activation_callback)
    : GAction(text, String(), move(on_activation_callback))
{
}

GAction::GAction(const String& text, RetainPtr<GraphicsBitmap>&& icon, Function<void(const GAction&)> on_activation_callback)
    : on_activation(move(on_activation_callback))
    , m_text(text)
    , m_icon(move(icon))
{
}

GAction::~GAction()
{
}

void GAction::activate()
{
    if (on_activation)
        on_activation(*this);
}