-
Notifications
You must be signed in to change notification settings - Fork 10
/
imageadmin.h
130 lines (98 loc) · 3.89 KB
/
imageadmin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// ライセンス: GPL2
//
// 板の管理クラス
//
#ifndef _IMAGEADMIN_H
#define _IMAGEADMIN_H
#include "skeleton/admin.h"
#include <string>
namespace IMAGE
{
// スクロール方向
enum{
SCROLL_NO,
SCROLL_LEFT,
SCROLL_RIGHT
};
class ImageAdmin : public SKELETON::Admin
{
Gtk::HBox m_tab;
Gtk::HBox m_iconbox;
Gtk::ScrolledWindow m_scrwin;
Gtk::Button m_left, m_right;
Gtk::EventBox m_view;
// Gtk::manageで作ってるので view は deleteしなくても良い
std::list< SKELETON::View* > m_list_view;
int m_scroll;
int m_counter_scroll;
public:
ImageAdmin( const std::string& url );
~ImageAdmin();
virtual void save_session();
Gtk::HBox& tab() { return m_tab; }
virtual Gtk::Widget* get_widget() { return &m_view; }
virtual bool empty();
virtual void clock_in();
// タブの数
virtual int get_tab_nums();
// 含まれているページのURLのリスト取得
virtual const std::list< std::string > get_URLs();
// 現在表示してるページ番号
virtual int get_current_page();
protected:
virtual void command_local( const COMMAND_ARGS& command );
virtual void restore( const bool only_locked );
virtual COMMAND_ARGS url_to_openarg( const std::string& url, const bool tab, const bool lock );
virtual void switch_admin();
virtual void open_view( const COMMAND_ARGS& command );
virtual void tab_left( const bool updated );
virtual void tab_right( const bool updatd );
virtual void tab_head();
virtual void tab_tail();
virtual void redraw_view( const std::string& url );
virtual void redraw_current_view();
virtual void close_view( const std::string& url );
virtual void close_other_views( const std::string& url );
virtual void restore_lasttab();
virtual void focus_view( int page );
virtual void focus_current_view();
virtual void open_window();
virtual void close_window();
virtual SKELETON::View* get_view( const std::string& url );
virtual SKELETON::View* get_current_view();
// ページがロックされているかリストで取得
virtual std::list< bool > get_locked();
// タブのロック/アンロック
virtual const bool is_lockable( const int page );
virtual const bool is_locked( const int page );
virtual void lock( const int page );
virtual void unlock( const int page );
// タブの D&D 処理は SKELETON::Admin とは違うロジックでおこなう
virtual void slot_drag_data_get( Gtk::SelectionData& selection_data, const int page ){}
private:
void close_left_views( const std::string& url );
void close_right_views( const std::string& url );
void close_error_views( const std::string mode );
void close_noerror_views();
void reorder( const std::string& url_from, const std::string& url_to );
void update_status_of_all_views();
void focus_out_all();
void switch_img( const std::string& url );
SKELETON::View* get_icon( const std::string& url, int& pos );
SKELETON::View* get_icon( const std::string& url );
SKELETON::View* get_nth_icon( const unsigned int n );
SKELETON::View* get_current_icon();
// スクロール
void scroll_tab( int scroll );
// スクロールボタン
void slot_press_left();
void slot_press_right();
void slot_release_left();
void slot_release_right();
bool copy_file( const std::string& url, const std::string& path_from, const std::string& path_to );
void save_all();
};
IMAGE::ImageAdmin* get_admin();
void delete_admin();
}
#endif