MySQL Workbench  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
hypertext.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; version 2 of the
7  * License.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17  * 02110-1301 USA
18  */
19 
20 
21 #ifndef _MFORMS_HYPERTEXT_H_
22 #define _MFORMS_HYPERTEXT_H_
23 
24 #include <mforms/view.h>
25 #include <boost/signals2.hpp>
26 
27 namespace mforms {
28 
29  class HyperText;
30 
31 #ifndef DOXYGEN_SHOULD_SKIP_THIS
32 #ifndef SWIG
33  struct HyperTextImplPtrs
34  {
35  bool (*create)(HyperText *ht);
36  void (*set_markup_text)(HyperText *ht, const std::string &text);
37  };
38 #endif
39 #endif
40 
41  class MFORMS_EXPORT HyperText : public View
42  {
43  HyperTextImplPtrs *_hypertext_impl;
44 
45  //std::map<std::string, std::string> _tag_styles;
46 
47  boost::signals2::signal<void (const std::string&)> _url_click_signal;
48  public:
49  HyperText();
50 
51  void set_markup_text(const std::string &text);
52  // background color is implemented in mforms::View.
53  //void add_style(const std::string &tag, const std::string &span_equiv);
54 
55  virtual void set_padding(int left, int top, int right, int bottom);
56 
57  #ifndef SWIG
58  boost::signals2::signal<void (const std::string&)> *signal_link_click() { return &_url_click_signal; }
59  #endif
60  public:
61  void handle_url_click(const std::string &url);
62  };
63 };
64 
65 #endif
#define MFORMS_EXPORT
Definition: base.h:33
HyperTextImplPtrs * _hypertext_impl
Definition: hypertext.h:43
boost::signals2::signal< void(const std::string &)> * signal_link_click()
Definition: hypertext.h:58
boost::signals2::signal< void(const std::string &)> _url_click_signal
Definition: hypertext.h:47
MySQL Workbench 6.1 documentation