1 #ifndef CUILINKTEXTBLOCK_H
2 #define CUILINKTEXTBLOCK_H
3 
4 #include <GG/RichText/BlockControl.h>
5 #include <GG/RichText/RichText.h>
6 #include "LinkText.h"
7 
8 class CUILinkTextMultiEdit;
9 
10 class CUILinkTextBlock : public GG::BlockControl {
11 public:
12     CUILinkTextBlock(const std::string& str,
13                      const std::shared_ptr<GG::Font>& font,
14                      GG::Flags<GG::TextFormat> format,
15                      const GG::Clr& color,
16                      GG::Flags< GG::WndFlag > flags);
17 
18     void CompleteConstruction() override;
19     GG::Pt SetMaxWidth(GG::X width) override;
20 
Render()21     void Render() override
22     {}
23 
24     CUILinkTextMultiEdit& Text();
25 
26     class Factory: public GG::RichText::IBlockControlFactory {
27     public:
28         //! Creates a control from the tag (with unparsed parameters) and the content between the tags.
29         //! You own the returned control.
30         std::shared_ptr<GG::BlockControl> CreateFromTag(const std::string& tag,
31                                                         const GG::RichText::TAG_PARAMS& params,
32                                                         const std::string& content,
33                                                         const std::shared_ptr<GG::Font>& font,
34                                                         const GG::Clr& color,
35                                                         GG::Flags<GG::TextFormat> format) override;
36 
37         ///< link clicked signals: first string is the link type, second string is the specific item clicked
38         mutable boost::signals2::signal<void (const std::string&, const std::string&)> LinkClickedSignal;
39         mutable boost::signals2::signal<void (const std::string&, const std::string&)> LinkDoubleClickedSignal;
40         mutable boost::signals2::signal<void (const std::string&, const std::string&)> LinkRightClickedSignal;
41     };
42 
43 private:
44     std::shared_ptr<CUILinkTextMultiEdit> m_link_text;
45 };
46 
47 #endif // CUILINKTEXTBLOCK_H
48