1 | // Aseprite UI Library |
2 | // Copyright (C) 2001-2017 David Capello |
3 | // |
4 | // This file is released under the terms of the MIT license. |
5 | // Read LICENSE.txt for more information. |
6 | |
7 | #ifndef UI_LINK_LABEL_H_INCLUDED |
8 | #define UI_LINK_LABEL_H_INCLUDED |
9 | #pragma once |
10 | |
11 | #include "obs/signal.h" |
12 | #include "ui/label.h" |
13 | |
14 | #include <string> |
15 | |
16 | namespace ui { |
17 | |
18 | class LinkLabel : public Label { |
19 | public: |
20 | LinkLabel(const std::string& urlOrText = "" ); |
21 | LinkLabel(const std::string& url, const std::string& text); |
22 | |
23 | const std::string& url() const { return m_url; } |
24 | void setUrl(const std::string& url); |
25 | |
26 | obs::signal<void()> Click; |
27 | |
28 | protected: |
29 | bool onProcessMessage(Message* msg) override; |
30 | virtual void onClick(); |
31 | |
32 | std::string m_url; |
33 | }; |
34 | |
35 | } // namespace ui |
36 | |
37 | #endif |
38 | |