OSDN Git Service

HTTP GET method is used in ThreadWindow.
[fukui-no-namari/dialektos.git] / src / text_view_popupable.hxx
1 /*
2  * Copyright (C) 2009 by Aiwota Programmer
3  * aiwotaprog@tetteke.tk
4  *
5  * This file is part of Dialektos.
6  *
7  * Dialektos is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * Dialektos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with Dialektos.  If not, see <http://www.gnu.org/licenses/>.
19  */
20
21 #ifndef TEXT_VIEW_POPUPABLE_HXX
22 #define TEXT_VIEW_POPUPABLE_HXX
23
24 #include <boost/unordered_set.hpp>
25 #include <boost/scoped_ptr.hpp>
26 #include "text_view_drawable.hxx"
27
28
29 namespace dialektos {
30
31 namespace text_element {
32   class Anchor;
33   class ID;
34   class ResNum;
35 }
36
37 namespace text_view {
38
39 class Popup;
40
41 class Popupable: public dialektos::text_view::Drawable {
42 public:
43   Popupable();
44   virtual ~Popupable();
45
46   bool on_timeout();
47   bool is_pointer_on_the_element() const;
48   bool is_pointer_on_the_popup() const;
49 protected:
50   virtual void on_anchor_hovered_event(const text_element::Anchor&);
51   void do_popup(const text_element::Anchor&, const LineListType& line);
52
53 private:
54   virtual const LineListType& get_original_line_list() const;
55   void do_id_hovered_event(const text_element::ID&);
56   void do_res_num_hovered_event(const text_element::ResNum&);
57   void do_anchor_hovered_event(const text_element::Anchor&);
58   void build_line_list_for_popup(
59       const boost::unordered_set<int>& res_nums, LineListType& target) const;
60
61   boost::scoped_ptr<Popup> popup_;
62 };
63
64
65 } // namespace text_view
66
67 } // namespce dialektos
68
69 #endif