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

« back to all changes in this revision

Viewing changes to glom/mode_data/box_data.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_db_table.h"
 
26
#include <glom/box_withbuttons.h>
 
27
#include <glom/base_db_table_data.h>
27
28
#include "dialog_layout.h"
28
29
 
29
30
namespace Glom
30
31
{
31
32
 
32
 
/** Call init_db_details() to create the layout and fill it with data from the database.
 
33
/** A Box for viewing and editing the data in a database table.
 
34
 *
 
35
 * Call init_db_details() to create the layout and fill it with data from the database.
33
36
 * Call refresh_data_from_database() to fill the existing layout with up-to-date data from the database.
34
37
 *
35
38
 * Derived classes should implement create_layout() to create/arrange the widgets for the groups, fields, portals, etc.
36
39
 * Derived classes should implement fill_from_database() to get the data from the database and fill the widgets created by create_layout().
37
40
 */
38
 
class Box_Data : public Box_DB_Table
 
41
class Box_Data
 
42
: public Box_WithButtons,
 
43
  public Base_DB_Table_Data
39
44
{
40
45
public: 
41
46
  Box_Data();
42
47
  virtual ~Box_Data();
43
48
 
 
49
  //TODO: Put this in Base_DB_Table_Data?
44
50
  ///Create the layout for the database structure, and fill it with data from the database.
45
51
  virtual bool init_db_details(const FoundSet& found_set);
46
52
 
60
66
  virtual bool confirm_discard_unstored_data() const;
61
67
 
62
68
#ifndef GLOM_ENABLE_CLIENT_ONLY
63
 
  virtual void show_layout_dialog();
 
69
  void show_layout_dialog();
64
70
#endif // !GLOM_ENABLE_CLIENT_ONLY
65
71
  Glib::ustring get_layout_name() const;
66
72
 
94
100
 
95
101
  virtual type_vecLayoutFields get_fields_to_show() const;
96
102
 
97
 
  virtual bool get_related_record_exists(const sharedptr<const Relationship>& relationship, const sharedptr<const Field>& key_field, const Gnome::Gda::Value& key_value);
98
 
  virtual bool add_related_record_for_field(const sharedptr<const LayoutItem_Field>& layout_item_parent, const sharedptr<const Relationship>& relationship, const sharedptr<const Field>& primary_key_field, const Gnome::Gda::Value& primary_key_value_provided, Gnome::Gda::Value& primary_key_value_used);
99
 
 
100
103
  type_vecLayoutFields get_table_fields_to_show(const Glib::ustring& table_name) const;
101
104
 
102
105
  /** Get the layout groups, with the Field information filled in.
103
106
   */
104
 
  Document_Glom::type_mapLayoutGroupSequence get_data_layout_groups(const Glib::ustring& layout);
 
107
  Document_Glom::type_list_layout_groups get_data_layout_groups(const Glib::ustring& layout_name);
105
108
  void fill_layout_group_field_info(const sharedptr<LayoutGroup>& group, const Privileges& table_privs);
106
109
 
107
110
 
109
112
  */
110
113
  type_vecLayoutFields get_related_fields(const sharedptr<const LayoutItem_Field>& field) const;
111
114
 
112
 
  bool record_delete(const Gnome::Gda::Value& primary_key_value);
113
 
 
114
 
  ///This allows record_new() to set the generated/entered primary key value, needed by Box_Data_List:
115
 
  virtual void set_primary_key_value(const Gtk::TreeModel::iterator& row, const Gnome::Gda::Value& value);
116
 
 
117
 
  ///New record with all entered field values.
118
 
  Glib::RefPtr<Gnome::Gda::DataModel> record_new(bool use_entered_data = true, const Gnome::Gda::Value& primary_key_value = Gnome::Gda::Value()); 
119
 
  Glib::RefPtr<Gnome::Gda::DataModel> record_new(bool use_entered_data, const Gnome::Gda::Value& primary_key_value, const Gtk::TreeModel::iterator& row);
120
 
 
121
 
  Gnome::Gda::Value generate_next_auto_increment(const Glib::ustring& table_name, const Glib::ustring field_name);
122
 
 
123
 
  virtual sharedptr<Field> get_field_primary_key() const = 0;
124
 
  virtual Gnome::Gda::Value get_primary_key_value_selected() = 0;
125
 
  //virtual bool get_field(const Glib::ustring& name, sharedptr<Field>& field) const;
126
 
 
127
 
  bool confirm_delete_record();
128
 
 
129
115
  void execute_button_script(const sharedptr<const LayoutItem_Button>& layout_item, const Gnome::Gda::Value& primary_key_value);
130
116
 
131
117
  //Signal handlers:
133
119
 
134
120
  static Glib::ustring xslt_process(const xmlpp::Document& xml_document, const std::string& filepath_xslt);
135
121
 
 
122
#ifndef GLOM_ENABLE_CLIENT_ONLY
 
123
  virtual Dialog_Layout* create_layout_dialog() const = 0;
 
124
  virtual void prepare_layout_dialog(Dialog_Layout* dialog) = 0;
 
125
#endif // !GLOM_ENABLE_CLIENT_ONLY
 
126
 
136
127
  Gtk::Button m_Button_Find; //only used by _Find sub-classes. Should be MI.
137
128
  Gtk::Label m_Label_FindStatus;
138
129
 
142
133
  Dialog_Layout* m_pDialogLayout;
143
134
#endif // !GLOM_ENABLE_CLIENT_ONLY
144
135
  Glib::ustring m_layout_name;
145
 
 
146
 
  FoundSet m_found_set;
147
 
 
148
 
  type_vecFields m_TableFields; //A cache, so we don't have to repeatedly get them from the Document.
149
 
  type_vecLayoutFields m_FieldsShown; //And any extra keys needed by shown fields.
150
136
};
151
137
 
152
138
} //namespace Glom