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

« back to all changes in this revision

Viewing changes to glom/mode_data/box_data_list.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:
23
23
 
24
24
#include "config.h" // GLOM_ENABLE_CLIENT_ONLY
25
25
 
26
 
#include "box_data.h"
 
26
#include "box_data_manyrecords.h"
27
27
#include "../utility_widgets/db_adddel/db_adddel_withbuttons.h"
28
28
 
29
29
namespace Glom
30
30
{
31
31
 
32
 
class Box_Data_List : public Box_Data
 
32
class Box_Data_List : public Box_Data_ManyRecords
33
33
{
34
34
public: 
35
35
  Box_Data_List();
37
37
 
38
38
  void refresh_data_from_database_blank();
39
39
 
40
 
  virtual Gnome::Gda::Value get_primary_key_value(const Gtk::TreeModel::iterator& row);
41
 
  virtual Gnome::Gda::Value get_primary_key_value_selected();
42
 
  Gnome::Gda::Value get_primary_key_value_first();
 
40
  Gnome::Gda::Value get_primary_key_value_first() const;
43
41
 
44
 
  ///This allows Box_Data::record_new() to set the generated/entered primary key value, needed by Box_Data_List:
 
42
  //Implementations of pure virtual methods from Base_DB_Table_Data:
 
43
  virtual Gnome::Gda::Value get_primary_key_value_selected() const;
45
44
  virtual void set_primary_key_value(const Gtk::TreeModel::iterator& row, const Gnome::Gda::Value& value);
46
45
 
47
46
  virtual Gnome::Gda::Value get_entered_field_data(const sharedptr<const LayoutItem_Field>& field) const;
58
57
  ///Highlight and scroll to the specified record, with primary key value @primary_key_value.
59
58
  void set_primary_key_value_selected(const Gnome::Gda::Value& primary_key_value);
60
59
 
61
 
  //Primary Key value:
62
 
  typedef sigc::signal<void, const Gnome::Gda::Value&> type_signal_user_requested_details;
63
 
  type_signal_user_requested_details signal_user_requested_details();
64
60
 
65
61
  //Signal Handlers:
66
62
  virtual void on_details_nav_first();
75
71
  virtual void on_dialog_layout_hide(); //override
76
72
  #endif //GLOM_ENABLE_CLIENT_ONLY
77
73
 
 
74
 
78
75
protected:
 
76
 
 
77
  //Implementations of pure virtual methods from Base_DB_Table_Data:
 
78
  virtual Gnome::Gda::Value get_primary_key_value(const Gtk::TreeModel::iterator& row) const;
 
79
 
 
80
  //Overrides of functions from Box_Data:
79
81
  virtual void create_layout(); //override
80
 
  virtual Document_Glom::type_mapLayoutGroupSequence create_layout_get_layout(); //overriden in Box_Data_List_Related.
 
82
  virtual Document_Glom::type_list_layout_groups create_layout_get_layout();
81
83
  void create_layout_add_group(const sharedptr<LayoutGroup>& layout_group);
 
84
    
82
85
  virtual bool fill_from_database(); //override.
83
86
  virtual void enable_buttons();
84
87
 
85
 
  virtual bool get_field_primary_key_index(guint& field_column) const; //TODO: visible 
86
88
  virtual sharedptr<Field> get_field_primary_key() const;
87
89
 
88
90
  //Signal handlers:
89
 
  virtual void on_adddel_user_requested_add();
90
 
  virtual void on_adddel_user_requested_edit(const Gtk::TreeModel::iterator& row);
91
 
  virtual void on_adddel_user_requested_delete(const Gtk::TreeModel::iterator& rowStart, const Gtk::TreeModel::iterator& rowEnd);
92
 
  virtual void on_adddel_user_added(const Gtk::TreeModel::iterator& row, guint col_with_first_value);
93
 
  virtual void on_adddel_user_reordered_columns();
 
91
  void on_adddel_user_requested_edit(const Gtk::TreeModel::iterator& row);
 
92
  void on_adddel_user_requested_delete(const Gtk::TreeModel::iterator& rowStart, const Gtk::TreeModel::iterator& rowEnd);
 
93
  void on_adddel_user_reordered_columns();
 
94
  void on_adddel_user_sort_clause_changed();
94
95
 
95
96
#ifndef GLOM_ENABLE_CLIENT_ONLY
96
 
  virtual void on_adddel_user_requested_layout();
 
97
  void on_adddel_user_requested_layout();
97
98
#endif // !GLOM_ENABLE_CLIENT_ONLY
98
99
 
99
 
  virtual void on_adddel_user_changed(const Gtk::TreeModel::iterator& row, guint col);
100
 
  virtual void on_adddel_script_button_clicked(const sharedptr<const LayoutItem_Button>& layout_item, const Gtk::TreeModel::iterator& row);
 
100
  void on_adddel_script_button_clicked(const sharedptr<const LayoutItem_Button>& layout_item, const Gtk::TreeModel::iterator& row);
101
101
  virtual bool on_script_button_idle(const Gnome::Gda::Value& primary_key_value);
102
102
 
103
 
  virtual void on_record_added(const Gnome::Gda::Value& primary_key_value, const Gtk::TreeModel::iterator& row); //Not a signal handler. To be overridden.
104
 
  virtual void on_record_deleted(const Gnome::Gda::Value& primary_key_value);
105
 
 
106
103
  virtual void print_layout();
107
104
  virtual void print_layout_group(xmlpp::Element* node_parent, const sharedptr<const LayoutGroup>& group);
108
105
 
109
 
  //Member widgers:
 
106
#ifndef GLOM_ENABLE_CLIENT_ONLY
 
107
  virtual Dialog_Layout* create_layout_dialog() const; // override.
 
108
  virtual void prepare_layout_dialog(Dialog_Layout* dialog); // override.
 
109
#endif // !GLOM_ENABLE_CLIENT_ONLY
 
110
 
 
111
  //Member widgets:
110
112
  mutable DbAddDel_WithButtons m_AddDel; //mutable because its get_ methods aren't const.
111
113
 
112
114
  bool m_has_one_or_more_records;
113
115
  bool m_read_only;
114
 
 
115
 
  bool m_reset_column_widths; //create_layout() sets these to 0 when this is set.
116
 
 
117
 
  type_signal_user_requested_details m_signal_user_requested_details;
118
116
};
119
117
 
120
118
} //namespace Glom