~ubuntu-branches/ubuntu/quantal/glom/quantal

« back to all changes in this revision

Viewing changes to glom/utility_widgets/flowtable_dnd.h

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane
  • Date: 2009-01-11 17:12:01 UTC
  • mfrom: (1.1.39 upstream)
  • Revision ID: james.westby@ubuntu.com-20090111171201-0ov9zh1fxfueshxc
Tags: 1.8.5-0ubuntu1
* New upstream release (LP: #256701), fixes LP bugs: 
  + Clear the text in property dialogs for text items (LP: #309147)
  + Don't crash when showing and then hiding the grid (LP: #303453)
  + Temporarily remember the sort order so it is the same when navigating 
    away and back (LP: #303422)
  + Use the list's sort order for the top-level records in the report 
    (LP: #303425)
  + Users/Groups: Disable drag-and-drop for the treeview, because it is
    useless and confusing (LP: #299573)
  + Import: Sort the fields list alphabetically (LP: #306593)
  + delete primary key make unusuable the database (LP: #299549)
  + Spanish translate incomplete (LP: #299556)
  + import date format error (LP: #299591)
  + can't delete data from table list view (LP: #299853)
  + Field definition: default value not saved (LP: #299896)
  + reports crashing (LP: #300054)
  + Year error with date fields (LP: #300057)
  + list view: 2 records added instead of 1 (LP: #300819)
* debian/control: Refreshed dependencies for libglom-dev.
* debian/control: Updated build-deps to match configure checks. goocavnasmm
  build-dep bumped to version without .la files.
* debian/rules: Don't delete the directory containing the templates.
* debian/control, debian/rules, debian/glom-doc.*: Split out
  arch-independent manual and examples into separate package glom-doc, which
  is now recommended by glom (glom will still work if they're not available)
* debian/copyright: Rewritten to new machine-readable format. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Glom
 
2
 *
 
3
 * Copyright (C) 2001-2004 Murray Cumming
 
4
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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.
 
19
 */
 
20
 
 
21
#ifndef GLOM_UTILITYWIDGETS_FLOWTABLE_DND_H
 
22
#define GLOM_UTILITYWIDGETS_FLOWTABLE_DND_H
 
23
 
 
24
#include <gtkmm.h>
 
25
#include "flowtable.h"
 
26
#include "layoutwidgetutils.h"
 
27
 
 
28
#ifdef GLOM_ENABLE_CLIENT_ONLY
 
29
#error FlowTableDnd does not work in Client-only mode
 
30
#endif
 
31
 
 
32
namespace Glom
 
33
{
 
34
 
 
35
class FlowTableDnd : 
 
36
  public FlowTable,
 
37
  public LayoutWidgetUtils
 
38
{
 
39
public:
 
40
  FlowTableDnd();
 
41
  ~FlowTableDnd();
 
42
  
 
43
protected:
 
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);
 
47
 
 
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);    
 
57
    
 
58
  void start_dnd(Gtk::Widget& child);
 
59
  void stop_dnd(Gtk::Widget& child);
 
60
 
 
61
  virtual void set_design_mode(bool value = true);
 
62
    
 
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;
 
74
  
 
75
  virtual void on_dnd_add_placeholder(LayoutWidgetBase* above) = 0;
 
76
  virtual void on_dnd_remove_placeholder() = 0;    
 
77
  
 
78
  void dnd_remove_placeholder_idle();
 
79
  bool dnd_remove_placeholder_real();
 
80
  
 
81
  FlowTableItem* dnd_item_at_position(int x, int y);
 
82
  LayoutWidgetBase* dnd_datawidget_from_item(FlowTableItem* item);
 
83
    
 
84
private:
 
85
  FlowTableItem* find_current_dnd_item (Gtk::Widget* child, int x = -1, int y = -1);
 
86
  FlowTableItem* m_current_dnd_item;
 
87
    
 
88
  bool m_internal_drag;
 
89
};
 
90
 
 
91
} // namespace Glom
 
92
 
 
93
#endif // GLOM_UTILITYWIDGETS_FLOWTABLE_DND_H