3
* Copyright (C) 2001-2004 Murray Cumming
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License as
7
* published by the Free Software Foundation; either version 2 of the
8
* License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* General Public License for more details.
15
* You should have received a copy of the GNU General Public
16
* License along with this program; if not, write to the
17
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
* Boston, MA 02111-1307, USA.
21
#ifndef GLOM_UTILITYWIDGETS_FLOWTABLE_DND_H
22
#define GLOM_UTILITYWIDGETS_FLOWTABLE_DND_H
25
#include "flowtable.h"
26
#include "layoutwidgetutils.h"
28
#ifdef GLOM_ENABLE_CLIENT_ONLY
29
#error FlowTableDnd does not work in Client-only mode
37
public LayoutWidgetUtils
44
virtual bool on_drag_motion(const Glib::RefPtr<Gdk::DragContext>& drag_context, int x, int y, guint time);
45
virtual void on_drag_leave(const Glib::RefPtr<Gdk::DragContext>& drag_context, guint time);
46
virtual void on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& drag_context, int, int, const Gtk::SelectionData& selection_data, guint, guint time);
48
bool on_child_drag_motion(const Glib::RefPtr<Gdk::DragContext>& drag_context, int x, int y, guint time, Gtk::Widget* child);
49
void on_child_drag_leave(const Glib::RefPtr<Gdk::DragContext>& drag_context, guint time);
50
void on_child_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& drag_context, int, int,
51
const Gtk::SelectionData& selection_data, guint, guint time, Gtk::Widget* child);
52
void on_child_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& drag_context,
53
Gtk::SelectionData& selection_data, guint, guint time, Gtk::Widget* child);
54
void on_child_drag_data_delete(const Glib::RefPtr<Gdk::DragContext>& drag_context, Gtk::Widget* child);
55
void on_child_drag_begin(const Glib::RefPtr<Gdk::DragContext>& drag_context, Gtk::Widget* child);
56
void on_child_drag_end(const Glib::RefPtr<Gdk::DragContext>& drag_context, Gtk::Widget* child);
58
void start_dnd(Gtk::Widget& child);
59
void stop_dnd(Gtk::Widget& child);
61
virtual void set_design_mode(bool value = true);
63
// Methods for the different layout object,
64
// to be implemented in the derived class.
65
virtual void on_dnd_add_layout_item_field(LayoutWidgetBase* above) = 0;
66
virtual void on_dnd_add_layout_group(LayoutWidgetBase* above) = 0;
67
virtual void on_dnd_add_layout_item_button(LayoutWidgetBase* above) = 0;
68
virtual void on_dnd_add_layout_item_text(LayoutWidgetBase* above) = 0;
69
virtual void on_dnd_add_layout_item_image(LayoutWidgetBase* above) = 0;
70
virtual void on_dnd_add_layout_notebook(LayoutWidgetBase* above) = 0;
71
virtual void on_dnd_add_layout_portal(LayoutWidgetBase* above) = 0;
72
virtual void on_dnd_add_layout_item(LayoutWidgetBase* above,
73
sharedptr<LayoutItem>& item) = 0;
75
virtual void on_dnd_add_placeholder(LayoutWidgetBase* above) = 0;
76
virtual void on_dnd_remove_placeholder() = 0;
78
void dnd_remove_placeholder_idle();
79
bool dnd_remove_placeholder_real();
81
FlowTableItem* dnd_item_at_position(int x, int y);
82
LayoutWidgetBase* dnd_datawidget_from_item(FlowTableItem* item);
85
FlowTableItem* find_current_dnd_item (Gtk::Widget* child, int x = -1, int y = -1);
86
FlowTableItem* m_current_dnd_item;
93
#endif // GLOM_UTILITYWIDGETS_FLOWTABLE_DND_H