3
* Copyright (C) 2001-2009 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 DOCUMENT_GLOM_H
22
#define DOCUMENT_GLOM_H
24
#include <libglom/libglom_config.h>
26
#include <libglom/document/bakery/document_xml.h>
27
#include <libglom/data_structure/relationship.h>
28
#include <libglom/data_structure/field.h>
29
#include <libglom/data_structure/layout/layoutgroup.h>
30
#include <libglom/data_structure/layout/layoutitem_notebook.h>
31
#include <libglom/data_structure/layout/layoutitem_portal.h>
32
#include <libglom/data_structure/layout/layoutitem_button.h>
33
#include <libglom/data_structure/layout/layoutitem_text.h>
34
#include <libglom/data_structure/layout/layoutitem_image.h>
35
#include <libglom/data_structure/tableinfo.h>
36
#include <libglom/data_structure/groupinfo.h>
37
#include <libglom/data_structure/report.h>
38
#include <libglom/data_structure/print_layout.h>
39
#include <libglom/data_structure/foundset.h>
40
#include <libglom/appstate.h>
43
#include <limits> // for numeric_limits
53
class Document : public GlomBakery::Document_XML
59
virtual void set_modified(bool value = true);
61
virtual void set_file_uri(const Glib::ustring& file_uri, bool bEnforceFileExtension = false);
63
/* Loads data from disk, using the URI (set with set_file_uri()) then asks the View to update itself.
64
* bool indicates success.
65
* This is just here so the SWIG Java API generator does not need to wrap methods from the base classes.
67
bool load(int& failure_code);
70
/** Whether the document was opened from another networked glom instance,
71
* instead of via a URI.
73
void set_opened_from_browse(bool val = true);
74
bool get_opened_from_browse() const;
76
/** The document usually saves itself when you call set_modified().
77
* Pass false to this function to prevent that temporarily.
78
* The document will be saved, if necessary, after you call this function with true.
80
void set_allow_autosave(bool value = true);
82
bool get_is_example_file() const;
83
void set_is_example_file(bool value = true);
85
/* Get version of the document format used for this document.
86
* This can increase when the file has been re-saved.
87
* See get_latest_known_document_format_version().
88
* Old versions of the application cannot open documents with a newer document format,
89
* so saving with a version of the application that has a newer document format will
90
* make it impossible to open the document in a version of the application with an older document format.
92
guint get_document_format_version();
94
static guint get_latest_known_document_format_version();
96
/// How the database is hosted.
99
HOSTING_MODE_POSTGRES_CENTRAL, /*!< The database is hosted on an external postgresql server. */
100
HOSTING_MODE_POSTGRES_SELF, /*!< A new postgres database process is spawned that hosts the data. */
101
HOSTING_MODE_SQLITE, /*!< A sqlite database file is used. */
102
HOSTING_MODE_DEFAULT = HOSTING_MODE_POSTGRES_SELF /*!- Arbitrary default. */
105
/** Set the hosting mode of the database.
107
void set_hosting_mode(HostingMode mode);
109
/** This returns how the database is hosted.
111
HostingMode get_hosting_mode() const;
113
/** Whether the database (and document) is shared over the network.
114
* This setting is saved in the file, allowing the database to be
115
* shared immediately after opening the document.
116
* @param shared true if the database should be shared.
118
void set_network_shared(bool shared = true);
120
/** See set_network_shared().
121
* @result true if the database is (or should be) shared over the network.
123
bool get_network_shared() const;
125
void set_connection_server(const Glib::ustring& strVal);
126
void set_connection_database(const Glib::ustring& strVal);
127
void set_connection_port(int port_number);
128
void set_connection_try_other_ports(bool val);
130
/** Temporarily set a username in the document.
131
* Note that this is not saved in the document's file.
133
* TODO: Remove this, and just store it in ConnectionPool?
135
void set_connection_user(const Glib::ustring& strVal);
137
/** If the database should be hosted, this provides the
138
* path to the directory that contains all the files needed to do that.
139
* This is usually a specifically-named directory at the same level as the .glom file.
140
* If the database is a sqlite database, this specifies the directory in
141
* which the database file is in.
143
std::string get_connection_self_hosted_directory_uri() const;
145
Glib::ustring get_connection_server() const;
146
Glib::ustring get_connection_database() const;
147
int get_connection_port() const;
148
bool get_connection_try_other_ports() const;
150
/** Retrieve a username previously set in the document.
151
* Note that this is not saved in the document's file.
153
* TODO: Remove this, and just store it in ConnectionPool?
155
Glib::ustring get_connection_user() const;
157
/** Set the language/locale used by original titles.
158
* Title translations are translations of the text in this language.
159
* @param locale: For instance, "en_US.UTF-8".
161
void set_translation_original_locale(const Glib::ustring& locale);
163
/** Get the language/locale used by original titles.
164
* Title translations are translations of the text in this language.
166
Glib::ustring get_translation_original_locale() const;
168
typedef std::vector< sharedptr<Relationship> > type_vec_relationships;
169
type_vec_relationships get_relationships(const Glib::ustring& table_name, bool plus_system_prefs = false) const;
170
void set_relationships(const Glib::ustring& table_name, const type_vec_relationships& vecRelationships);
172
sharedptr<Relationship> get_relationship(const Glib::ustring& table_name, const Glib::ustring& relationship_name) const;
173
void set_relationship(const Glib::ustring& table_name, const sharedptr<Relationship>& relationship);
175
void remove_relationship(const sharedptr<const Relationship>& relationship);
177
/** Returns whether the relationship's to-field is a primary key or unique field, meaning
178
* that there can be only one related record for each value of the from-field.
180
bool get_relationship_is_to_one(const Glib::ustring& table_name, const Glib::ustring& relationship_name) const;
182
/** Returns whether the field is the from-field in a to-one relationship.
183
* @see get_relationship_is_to_one(). Ignores hidden tables.
185
sharedptr<Relationship> get_field_used_in_relationship_to_one(const Glib::ustring& table_name, const sharedptr<const LayoutItem_Field>& layout_field) const;
187
typedef std::vector< sharedptr<Field> > type_vec_fields;
188
type_vec_fields get_table_fields(const Glib::ustring& table_name) const;
189
void set_table_fields(const Glib::ustring& table_name, const type_vec_fields& vecFields);
191
sharedptr<Field> get_field(const Glib::ustring& table_name, const Glib::ustring& strFieldName) const;
193
/** Use this after removing a field from a table,
194
* so that it is not used anymore in relationships, layouts, reports, etc.
196
void remove_field(const Glib::ustring& table_name, const Glib::ustring& field_name);
199
typedef std::vector< sharedptr<LayoutGroup> > type_list_layout_groups;
201
/** Get the layout groups for a layout.
202
* @param layout_name The name of the layout, such as list or details.
203
* @param parent_table_name The name of the table for which this layout should appear.
204
* @param layout_platform The platform for which this layout should be used. Possible values are an empty string (meaning normal platforms) or "maemo" meaning "normal".
205
* @result A list of layout groups at the top-level of the requested layout.
207
type_list_layout_groups get_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const Glib::ustring& layout_platform = Glib::ustring()) const;
209
/** Discover whether there are any fields in the layout.
210
* @param layout_name The name of the layout, such as list or details.
211
* @param parent_table_name The name of the table for which this layout should appear.
212
* @param layout_platform The platform for which this layout should be used. Possible values are an empty string (meaning normal platforms) or "maemo" meaning "normal".
213
* @result true if there is at least one field in the layout group or its sub groups.
215
bool get_data_layout_groups_have_any_fields(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const Glib::ustring& layout_platform = Glib::ustring()) const;
217
/** Set the layout groups for a layout.
218
* @param layout_name The name of the layout, such as list or details.
219
* @param parent_table_name The name of the table for which this layout should appear.
220
* @param layout_platform The platform for which this layout should be used. Possible values are an empty string (meaning normal platforms) or "maemo" meaning "normal".
221
* @param groups A list of layout groups at the top-level of the requested layout.
223
void set_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const Glib::ustring& layout_platform, const type_list_layout_groups& groups);
226
* @para The layout_name, such as "details", "list".
227
* @para parent_table_name The name of the table on whose layout the layout appears.
228
* @param layout_platform The platform for which this layout should be used. Possible values are an empty string (meaning normal platforms) or "maemo" meaning "normal".
230
type_list_layout_groups get_data_layout_groups_plus_new_fields(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const Glib::ustring& layout_platform = Glib::ustring()) const;
232
type_list_layout_groups get_data_layout_groups_default(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const Glib::ustring& layout_platform = Glib::ustring()) const;
234
typedef std::list< sharedptr<TranslatableItem> > type_list_translatables;
235
type_list_translatables get_translatable_layout_items(const Glib::ustring& table_name);
236
type_list_translatables get_translatable_report_items(const Glib::ustring& table_name, const Glib::ustring& report_title);
238
void fill_layout_field_details(const Glib::ustring& parent_table_name, const sharedptr<LayoutGroup>& layout_group) const;
239
void fill_layout_field_details(const Glib::ustring& parent_table_name, type_list_layout_groups& groups) const;
243
///When a field name is changed, change it in the relationships, layouts, reports, and fields data:
244
void change_field_name(const Glib::ustring& table_name, const Glib::ustring& strFieldNameOld, const Glib::ustring& strFieldNameNew);
246
///When a table name is changed, change it in the relationships and tables data:
247
void change_table_name(const Glib::ustring& table_name_old, const Glib::ustring& table_name_new);
249
///When a relationship name is changed, change it in layouts and reports:
250
void change_relationship_name(const Glib::ustring& table_name, const Glib::ustring& name, const Glib::ustring& name_new);
252
typedef std::list< sharedptr<TableInfo> > type_listTableInfo;
253
type_listTableInfo get_tables(bool plus_system_prefs = false) const;
254
std::vector<Glib::ustring> get_table_names(bool plus_system_prefs = false) const;
256
void set_tables(const type_listTableInfo& tables);
258
sharedptr<TableInfo> get_table(const Glib::ustring& table_name) const;
259
void add_table(const sharedptr<TableInfo>& table_name);
261
/** Use this after DROPing the table.
262
* It removes information about the table, including fields and layouts,
263
* and any place that parts of the table are used.
265
void remove_table(const Glib::ustring& table_name);
267
bool get_table_is_known(const Glib::ustring& table_name) const;
268
bool get_table_is_hidden(const Glib::ustring& table_name) const;
270
Glib::ustring get_table_title(const Glib::ustring& table_name) const;
271
void set_table_title(const Glib::ustring& table_name, const Glib::ustring& value);
273
typedef std::vector< Gnome::Gda::Value > type_row_data;
274
typedef std::vector< type_row_data > type_example_rows;
276
/** Save example data into the document, for use when creating the example database on the server.
277
* Don't use this for large amounts of data.
278
* @param table_name The table that should contain this example data.
279
* @param rows Each row is separated by a newline. Each line has comma-separated field values, in SQL format.
281
void set_table_example_data(const Glib::ustring& table_name, const type_example_rows& rows);
283
type_example_rows get_table_example_data(const Glib::ustring& table_name) const;
285
virtual Glib::ustring get_name() const; //override.
287
Glib::ustring get_default_table() const;
288
Glib::ustring get_first_table() const;
290
Glib::ustring get_database_title() const;
291
void set_database_title(const Glib::ustring& title);
293
std::vector<Glib::ustring> get_library_module_names() const;
294
void set_library_module(const Glib::ustring& name, const Glib::ustring& script);
295
Glib::ustring get_library_module(const Glib::ustring& name) const;
296
void remove_library_module(const Glib::ustring& name);
298
/// These are only used when recreating a database from an example file. The actualy access-control is on the server, of course.
299
typedef std::list<GroupInfo> type_list_groups;
300
type_list_groups get_groups() const;
302
/// This adds the group if necessary.
303
void set_group(GroupInfo& group);
305
void remove_group(const Glib::ustring& group_name);
308
typedef std::list<Glib::ustring> type_listReports;
309
type_listReports get_report_names(const Glib::ustring& table_name) const;
310
void remove_all_reports(const Glib::ustring& table_name);
312
void set_report(const Glib::ustring& table_name, const sharedptr<Report>& report);
313
sharedptr<Report> get_report(const Glib::ustring& table_name, const Glib::ustring& report_name) const;
314
void remove_report(const Glib::ustring& table_name, const Glib::ustring& report_name);
316
//Print Layouts are precisely positioned layouts for printing to a printer:
317
typedef std::list<Glib::ustring> type_listPrintLayouts;
318
type_listPrintLayouts get_print_layout_names(const Glib::ustring& table_name) const;
319
void remove_all_print_layouts(const Glib::ustring& table_name);
320
void set_print_layout(const Glib::ustring& table_name, const sharedptr<PrintLayout>& print_layout);
321
sharedptr<PrintLayout> get_print_layout(const Glib::ustring& table_name, const Glib::ustring& print_layout_name) const;
322
void remove_print_layout(const Glib::ustring& table_name, const Glib::ustring& print_layout_name);
324
void set_layout_record_viewed(const Glib::ustring& table_name, const Glib::ustring& layout_name, const Gnome::Gda::Value& primary_key_value);
325
void forget_layout_record_viewed(const Glib::ustring& table_name);
326
Gnome::Gda::Value get_layout_record_viewed(const Glib::ustring& table_name, const Glib::ustring& layout_name) const;
328
//TODO: Rename set_layout_current() and set_criteria_current().
330
/** Temporarily save (but not in the document) the last-viewed layout for the table,
331
* so we can show the same layout when navigating back to this table later.
333
* @param table_name The table.
334
* @param layout_name The layout name, such as "list" or "details".
336
void set_layout_current(const Glib::ustring& table_name, const Glib::ustring& layout_name);
338
/** Temporarily save (but not in the document) the last-viewed criteria for the table,
339
* so we can show the same criteria (sort order, where clause) when navigating back to this table later.
341
* @param table_name The table.
342
* @param found_set Additional information about the last use of that layout, such as the sort order or where clause.
344
void set_criteria_current(const Glib::ustring& table_name,const FoundSet& found_set);
346
Glib::ustring get_layout_current(const Glib::ustring& table_name) const;
348
FoundSet get_criteria_current(const Glib::ustring& table_name) const;
350
#ifndef SWIG //Hide this API from swig.
351
// Used by Relationship Overview dialog to preserve table locations accross instantiations:
353
/** Retrieve the x and y coordinates for the given table position in the relationship overview dialog.
355
* @param table_name The name of the table to query.
356
* @param x The x coordinate of the table position.
357
* @param y The y coordinate of the table position.
358
* @return false if the table does not have any position for this table.
360
bool get_table_overview_position( const Glib::ustring& table_name, float &x, float &y ) const;
362
/** Set the position of a table in the relationship overview dialog.
364
* @param table_name The name of the table to modify.
365
* @param x The x coordinate of the table position.
366
* @param y The y coordinate of the table position.
368
void set_table_overview_position( const Glib::ustring& utable_name, float x, float y );
372
USER_LEVEL_REASON_UNKNOWN,
373
USER_LEVEL_REASON_FILE_READ_ONLY,
374
USER_LEVEL_REASON_DATABASE_ACCESS_LEVEL,
375
USER_LEVEL_REASON_OPENED_FROM_BROWSE
379
* @param reason The reason that the user is not a developer, if he is not.
380
* @result Whether the user is a developer.
382
AppState::userlevels get_userlevel(userLevelReason& reason) const;
384
AppState::userlevels get_userlevel() const;
386
/** This is transitory information, not saved to disk.
388
bool set_userlevel(AppState::userlevels userlevel);
390
typedef sigc::signal<void, AppState::userlevels> type_signal_userlevel_changed;
391
type_signal_userlevel_changed signal_userlevel_changed();
393
//TODO: This is a rather indirect way for application.cc to request the UI to update for the userlevel.
394
void emit_userlevel_changed();
397
/** This is transitory information, not saved to disk.
399
Glib::ustring get_active_layout_platform() const;
401
/** This is transitory information, not saved to disk.
403
void set_active_layout_platform(const Glib::ustring& layout_platform = Glib::ustring());
405
/** Change any non-maemo layouts so their groups never have multiple columns,
406
* because this could never be displayed on the Maemo screen.
407
* This allows layouts to be shown fairly sanely on Maemo even if no custom
408
* maemo layout was defined.
409
* This does not save the change to disk.
411
void maemo_restrict_layouts_to_single_column();
413
#ifndef SWIG //Hide this API from swig.
414
Glib::ustring build_and_get_contents() const;
420
friend class ReportBuilder;
422
///If value is equal to the default then no attribute will be set, to save text space in the XML file.
423
static void set_node_attribute_value_as_decimal(xmlpp::Element* node, const Glib::ustring& strAttributeName, guint value, guint value_default = 0);
425
// This is required by the report builder, so it cannot be disabled
426
// in client only mode
427
static void set_node_attribute_value_as_decimal_double(xmlpp::Element* node, const Glib::ustring& strAttributeName, double value);
432
static sharedptr<TableInfo> create_table_system_preferences();
433
static sharedptr<TableInfo> create_table_system_preferences(type_vec_fields& fields);
434
static sharedptr<Relationship> create_relationship_system_preferences(const Glib::ustring& table_name);
435
static bool get_relationship_is_system_properties(const sharedptr<const Relationship>& relationship);
438
/// Failure codes that could be returned by load_after()
439
enum load_failure_codes
441
// The error codes must start at 1, so do that here:
442
LOAD_FAILURE_CODE_FILE_VERSION_TOO_NEW = 1
448
virtual bool save_before();
449
void save_before_layout_group(xmlpp::Element* node, const sharedptr<const LayoutGroup>& group, bool with_print_layout_positions = false);
450
void save_before_sort_by(xmlpp::Element* node, const LayoutItem_GroupBy::type_list_sort_fields& list_fields);
451
void save_before_layout_item_usesrelationship(xmlpp::Element* nodeItem, const sharedptr<const UsesRelationship>& item);
452
void save_before_layout_item_field(xmlpp::Element* nodeItem, const sharedptr<const LayoutItem_Field>& item);
453
void save_before_layout_item_formatting(xmlpp::Element* nodeItem, const FieldFormatting& format, Field::glom_field_type field_type = Field::TYPE_INVALID);
455
void save_before_translations(xmlpp::Element* nodeItem, const TranslatableItem& item);
456
void save_before_print_layout_position(xmlpp::Element* nodeItem, const sharedptr<const LayoutItem>& item);
460
virtual bool load_after(int& failure_code);
461
void load_after_layout_group(const xmlpp::Element* node, const Glib::ustring& table_name, const sharedptr<LayoutGroup>& group, bool with_print_layout_positions = false);
462
void load_after_sort_by(const xmlpp::Element* node, const Glib::ustring& table_name, LayoutItem_GroupBy::type_list_sort_fields& list_fields);
463
void load_after_layout_item_usesrelationship(const xmlpp::Element* element, const Glib::ustring& table_name, const sharedptr<UsesRelationship>& item);
464
void load_after_layout_item_field(const xmlpp::Element* element, const Glib::ustring& table_name, const sharedptr<LayoutItem_Field>& item);
465
void load_after_layout_item_formatting(const xmlpp::Element* element, FieldFormatting& format, Field::glom_field_type field_type = Field::TYPE_INVALID, const Glib::ustring& table_name = Glib::ustring(), const Glib::ustring& field_name = Glib::ustring());
467
void load_after_translations(const xmlpp::Element* element, TranslatableItem& item);
468
void load_after_print_layout_position(const xmlpp::Element* nodeItem, const sharedptr<LayoutItem>& item);
470
void on_app_state_userlevel_changed(AppState::userlevels userlevel);
472
void fill_translatable_layout_items(const sharedptr<LayoutGroup>& group, type_list_translatables& the_list);
475
/// If the attribute is not there, then the default will be returned.
476
static bool get_node_attribute_value_as_bool(const xmlpp::Element* node, const Glib::ustring& strAttributeName, bool value_default = false);
477
static guint get_node_attribute_value_as_decimal(const xmlpp::Element* node, const Glib::ustring& strAttributeName, guint value_default = 0);
478
static double get_node_attribute_value_as_decimal_double(const xmlpp::Element* node, const Glib::ustring& strAttributeName);
479
static float get_node_attribute_value_as_float(const xmlpp::Element* node, const Glib::ustring& strAttributeName);
481
static void set_node_attribute_value_as_bool(xmlpp::Element* node, const Glib::ustring& strAttributeName, bool value = true, bool value_default = false);
482
static void set_node_attribute_value_as_float( xmlpp::Element* node, const Glib::ustring& strAttributeName, float value );
483
static void set_node_attribute_value_as_value(xmlpp::Element* node, const Glib::ustring& strAttributeName, const Gnome::Gda::Value& value, Field::glom_field_type field_type);
484
static void set_node_text_child_as_value(xmlpp::Element* node, const Gnome::Gda::Value& value, Field::glom_field_type field_type);
486
static Gnome::Gda::Value get_node_attribute_value_as_value(const xmlpp::Element* node, const Glib::ustring& strAttributeName, Field::glom_field_type field_type);
487
static Gnome::Gda::Value get_node_text_child_as_value(const xmlpp::Element* node, Field::glom_field_type field_type);
489
Glib::ustring get_child_text_node(const xmlpp::Element* node, const Glib::ustring& child_node_name) const;
490
void set_child_text_node(xmlpp::Element* node, const Glib::ustring& child_node_name, const Glib::ustring& text);
492
///A recursive helper function.
493
static void maemo_restrict_layouts_to_single_column_group(const sharedptr<LayoutGroup>& layout_group);
495
AppState m_app_state;
496
type_signal_userlevel_changed m_signal_userlevel_changed;
498
HostingMode m_hosting_mode;
499
bool m_network_shared;
501
Glib::ustring m_connection_server, m_connection_database;
502
Glib::ustring m_connection_user; //Don't save the user.
503
int m_connection_port; //0 means any port. Ignored when self-hosting (which may use a different port each time).
504
bool m_connection_try_other_ports; //Set to false for self-hosted or browsed-from-network documents.
509
Glib::ustring m_layout_name;
510
Glib::ustring m_layout_platform; //Empty string (meaning normal platforms), or "maemo", or something else.
511
Glib::ustring m_parent_table;
513
type_list_layout_groups m_layout_groups;
516
class DocumentTableInfo
520
: m_overviewx ( std::numeric_limits<float>::infinity () ),
521
m_overviewy ( std::numeric_limits<float>::infinity () )
523
m_info = sharedptr<TableInfo>(new TableInfo()); //Avoid a null sharedptr.
526
//TODO: Avoid the use of this:
527
DocumentTableInfo(const DocumentTableInfo& src)
528
: m_info(src.m_info),
529
m_fields(src.m_fields),
530
m_relationships(src.m_relationships),
531
m_layouts(src.m_layouts),
532
m_reports(src.m_reports),
533
m_print_layouts(src.m_print_layouts),
534
m_example_rows(src.m_example_rows),
535
m_map_current_record(src.m_map_current_record),
536
m_layout_current(src.m_layout_current),
537
m_foundset_current(src.m_foundset_current),
538
m_overviewx(src.m_overviewx),
539
m_overviewy(src.m_overviewy)
543
//TODO: Avoid the use of this:
544
DocumentTableInfo& operator=(const DocumentTableInfo& src)
547
m_fields = src.m_fields;
548
m_relationships = src.m_relationships;
549
m_layouts = src.m_layouts;
550
m_reports = src.m_reports;
551
m_print_layouts = src.m_print_layouts;
552
m_example_rows = src.m_example_rows;
553
m_map_current_record = src.m_map_current_record;
554
m_layout_current = src.m_layout_current;
555
m_foundset_current = src.m_foundset_current;
556
m_overviewx = src.m_overviewx;
557
m_overviewy = src.m_overviewy;
562
sharedptr<TableInfo> m_info;
564
type_vec_fields m_fields;
565
type_vec_relationships m_relationships;
567
typedef std::list< LayoutInfo > type_layouts;
568
type_layouts m_layouts;
570
typedef std::map< Glib::ustring, sharedptr<Report> > type_reports; //map of report names to reports
571
type_reports m_reports;
573
typedef std::map< Glib::ustring, sharedptr<PrintLayout> > type_print_layouts; //map of print layout names to print layouts
574
type_print_layouts m_print_layouts;
576
//Example data, used when creating a database from an example.
577
type_example_rows m_example_rows;
579
//Per-session, not saved in document:
580
typedef std::map<Glib::ustring, Gnome::Gda::Value> type_map_layout_primarykeys;
581
type_map_layout_primarykeys m_map_current_record; //The record last viewed in each layout.
582
Glib::ustring m_layout_current;
583
FoundSet m_foundset_current;
585
float m_overviewx, m_overviewy;
588
DocumentTableInfo& get_table_info_with_add(const Glib::ustring& table_name);
590
typedef std::map<Glib::ustring, DocumentTableInfo> type_tables;
591
type_tables m_tables;
595
typedef std::map<Glib::ustring, GroupInfo> type_map_groups;
596
type_map_groups m_groups;
598
Glib::ustring m_database_title;
599
Glib::ustring m_translation_original_locale;
601
typedef std::map<Glib::ustring, Glib::ustring> type_map_library_scripts;
602
type_map_library_scripts m_map_library_scripts;
604
bool m_block_cache_update; //For efficiency.
605
bool m_block_modified_set;
606
bool m_allow_auto_save;
608
guint m_document_format_version;
610
bool m_opened_from_browse;
612
Glib::ustring m_active_layout_platform; //empty (means normal), or "maemo".
617
#endif //DOCUMENT_GLOM_H