OSDN Git Service

Add a border to the popups.
[fukui-no-namari/dialektos.git] / src / thread_window.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 THREAD_WINDOW_HXX
22 #define THREAD_WINDOW_HXX
23
24 #include <boost/scoped_ptr.hpp>
25 #include <memory>
26 #include "application_framework.hxx"
27 #include "text_view.hxx"
28 #include "scrolled_container.hxx"
29 #include "http_get.hxx"
30 #include "thread_idx.hxx"
31
32
33 namespace dialektos {
34
35
36 namespace bbs_detail {
37   class Base;
38 }
39
40
41 class ThreadWindow: public ApplicationFrameWork {
42   typedef ApplicationFrameWork SuperClass;
43 public:
44   static void create(std::auto_ptr<bbs_detail::Base> bbs);
45   bool load();
46   virtual ~ThreadWindow(){}
47   virtual void save_state() const;
48   void on_informed_from_board(int res_num);
49   const bbs_detail::Base& get_bbs_detail() const { return *bbs_; }
50 protected:
51   ThreadWindow(std::auto_ptr<bbs_detail::Base> bbs);
52
53   virtual void on_action_view_refresh();
54   virtual void on_action_view_stop();
55   virtual void on_action_edit_copy();
56   void on_action_file_delete();
57   void on_action_file_board();
58   void on_action_file_close_remove_history();
59 private:
60   void initialize_text_view();
61   virtual bool is_same(const bbs_detail::Base& bbs) const;
62   virtual std::string get_uri() const;
63
64   void on_http_get_end(bool);
65   void on_refresh_end(const http::StatusLine&, const http::Header&);
66
67   void save_content(const http::Response&);
68   void inform_to_board(const ThreadIdx& idx) const;
69
70   void on_uri_clicked(const std::string& uri) const;
71
72   boost::scoped_ptr<text_view::TextView> text_view_;
73   ScrolledContainer scrolled_;
74   boost::scoped_ptr<bbs_detail::Base> bbs_;
75   boost::scoped_ptr<http::GetInThread> http_getter_;
76   ThreadIdx idx_;
77 };
78
79
80
81 } // namespace dialektos
82
83
84 #endif