OSDN Git Service

Add open all menu and open all and close others menu in History.
[fukui-no-namari/dialektos.git] / src / application_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 APPLICATION_WINDOW_HXX
22 #define APPLICATION_WINDOW_HXX
23
24 #include <gtkmm/window.h>
25 #include <boost/ptr_container/ptr_vector.hpp>
26 #include <vector>
27 #include "history_data.hxx"
28
29
30 namespace dialektos {
31
32 namespace bbs_detail {
33   class Base;
34 }
35
36
37 class ApplicationWindow: public Gtk::Window {
38 public:
39   virtual ~ApplicationWindow();
40   static ApplicationWindow* find(const bbs_detail::Base& bbs);
41   static void load();
42   virtual void save_state() const = 0;
43 protected:
44   ApplicationWindow();
45   static void regist(ApplicationWindow* window);
46   static void save();
47   static void close_windows(const std::vector<ApplicationWindow*>&);
48   virtual bool on_delete_event(GdkEventAny*);
49 private:
50   virtual bool is_same(const bbs_detail::Base& bbs) const = 0;
51 public:
52   virtual std::string get_uri() const = 0;
53 protected:
54   static boost::ptr_vector<ApplicationWindow> windows;
55   static history::Data histories;
56 };
57
58
59 } // namespace dialektos
60
61
62 #endif