libglom-1.26 1.28.5

- Main Page
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions | List of all members
Glom::Document Class Reference
Inheritance diagram for Glom::Document:
[legend]
Collaboration diagram for Glom::Document:
[legend]

## Public Types
enum | HostingMode { HOSTING_MODE_POSTGRES_CENTRAL, HOSTING_MODE_POSTGRES_SELF, HOSTING_MODE_SQLITE, HOSTING_MODE_MYSQL_CENTRAL, HOSTING_MODE_MYSQL_SELF, HOSTING_MODE_DEFAULT = HOSTING_MODE_POSTGRES_SELF }
| How the database is hosted. More...
enum | userLevelReason { USER_LEVEL_REASON_UNKNOWN, USER_LEVEL_REASON_FILE_READ_ONLY, USER_LEVEL_REASON_DATABASE_ACCESS_LEVEL, USER_LEVEL_REASON_OPENED_FROM_BROWSE }
enum | load_failure_codes { LOAD_FAILURE_CODE_FILE_VERSION_TOO_NEW = LOAD_FAILURE_CODE_LAST + 1 }
| Failure codes that could be returned by load_after() More...
typedef std::vector< sharedptr< Relationship > > | type_vec_relationships
typedef std::vector< sharedptr< Field > > | type_vec_fields
typedef std::pair< sharedptr< LayoutItem_Field >, sharedptr< Relationship > > | type_pairFieldTrigger
typedef std::vector< type_pairFieldTrigger > | type_list_lookups
typedef std::vector< sharedptr< LayoutGroup > > | type_list_layout_groups
typedef std::pair< sharedptr< TranslatableItem >, Glib::ustring > | pair_translatable_item_and_hint
| The translatable item and a hint about what it is. More...
typedef std::vector< pair_translatable_item_and_hint > | type_list_translatables
typedef std::vector< sharedptr< TableInfo > > | type_listTableInfo
typedef std::vector< sharedptr< const TableInfo > > | type_listConstTableInfo
typedef std::vector< Gnome::Gda::Value > | type_row_data
typedef std::vector< type_row_data > | type_example_rows
typedef std::vector< GroupInfo > | type_list_groups
| These are only used when recreating a database from an example file. The actualy access-control is on the server, of course. More...
typedef sigc::signal< void, AppState::userlevels > | type_signal_userlevel_changed
typedef sigc::slot< void > | SlotProgress
| This callback should show UI to indicate that work is still happening. More...
Public Types inherited from GlomBakery::Document
enum | LoadFailureCodes { LOAD_FAILURE_CODE_NONE = 0, LOAD_FAILURE_CODE_NOT_FOUND = 1, LOAD_FAILURE_CODE_LAST = 20 }
typedef sigc::signal< void, bool > | type_signal_modified
| For instance, void on_document_modified(bool modified);. More...
typedef sigc::signal< void > | type_signal_forget

## Public Member Functions
| Document ()
virtual | ~Document ()
virtual void | set_modified (bool value=true)
virtual void | set_file_uri (const Glib::ustring& file_uri, bool bEnforceFileExtension=false)
| Set the file URI that will be used in future calls to load() and save(). More...
bool | load (int& failure_code)
void | set_opened_from_browse (bool val=true)
| Whether the document was opened from another networked glom instance, instead of via a URI. More...
bool | get_opened_from_browse () const
void | set_allow_autosave (bool value=true)
| The document usually saves itself when you call set_modified(). More...
bool | get_is_example_file () const
void | set_is_example_file (bool value=true)
bool | get_is_backup_file () const
void | set_is_backup_file (bool value=true)
guint | get_document_format_version ()
void | set_hosting_mode (HostingMode mode)
| Set the hosting mode of the database. More...
HostingMode | get_hosting_mode () const
| This returns how the database is hosted. More...
void | set_network_shared (bool shared=true)
| Whether the database (and document) is shared over the network. More...
bool | get_network_shared () const
| See set_network_shared(). More...
void | set_connection_server (const Glib::ustring& strVal)
void | set_connection_database (const Glib::ustring& strVal)
void | set_connection_port (unsigned int port_number)
void | set_connection_try_other_ports (bool val)
void | set_connection_user (const Glib::ustring& strVal)
| Temporarily set a username in the document. More...
std::string | get_connection_self_hosted_directory_uri () const
| If the database should be hosted, this provides the path to the directory that contains all the files needed to do that. More...
Glib::ustring | get_connection_server () const
Glib::ustring | get_connection_database () const
unsigned int | get_connection_port () const
bool | get_connection_try_other_ports () const
Glib::ustring | get_connection_user () const
| Retrieve a username previously set in the document. More...
void | set_translation_original_locale (const Glib::ustring& locale)
| Set the language/locale used by original titles. More...
Glib::ustring | get_translation_original_locale () const
| Get the language/locale used by original titles. More...
std::vector< Glib::ustring > | get_translation_available_locales () const
| Get a list of locales for which at least one string is translated. More...
type_vec_relationships | get_relationships (const Glib::ustring& table_name, bool plus_system_prefs=false) const
void | set_relationships (const Glib::ustring& table_name, const type_vec_relationships& vecRelationships)
sharedptr< Relationship > | get_relationship (const Glib::ustring& table_name, const Glib::ustring& relationship_name) const
void | set_relationship (const Glib::ustring& table_name, const sharedptr< Relationship >& relationship)
void | remove_relationship (const sharedptr< const Relationship >& relationship)
bool | get_relationship_is_to_one (const Glib::ustring& table_name, const Glib::ustring& relationship_name) const
| Returns whether the relationship's to-field is a primary key or unique field, meaning that there can be only one related record for each value of the from-field. More...
sharedptr< const Relationship > | get_field_used_in_relationship_to_one (const Glib::ustring& table_name, const sharedptr< const LayoutItem_Field >& layout_field) const
| Returns whether the field is the from-field in a to-one relationship. More...
type_vec_fields | get_table_fields (const Glib::ustring& table_name) const
void | set_table_fields (const Glib::ustring& table_name, const type_vec_fields& vecFields)
sharedptr< Field > | get_field (const Glib::ustring& table_name, const Glib::ustring& strFieldName) const
sharedptr< Field > | get_field_primary_key (const Glib::ustring& table_name) const
void | remove_field (const Glib::ustring& table_name, const Glib::ustring& field_name)
| Use this after removing a field from a table, so that it is not used anymore in relationships, layouts, reports, etc. More...
type_list_lookups | get_lookup_fields (const Glib::ustring& table_name, const Glib::ustring& field_name) const
| Get the fields whose values should be looked up when field_name changes, with the relationship used to lookup the value. More...
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
| Get the layout groups for a layout. More...
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
| Discover whether there are any fields in the layout. More...
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)
| Set the layout groups for a layout. More...
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
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
type_list_translatables | get_translatable_items ()
void | fill_layout_field_details (const Glib::ustring& parent_table_name, const sharedptr< LayoutGroup >& layout_group) const
void | fill_layout_field_details (const Glib::ustring& parent_table_name, type_list_layout_groups& groups) const
void | change_field_name (const Glib::ustring& table_name, const Glib::ustring& strFieldNameOld, const Glib::ustring& strFieldNameNew)
| When a field name is changed, change it in the relationships, layouts, reports, and fields data: More...
void | change_table_name (const Glib::ustring& table_name_old, const Glib::ustring& table_name_new)
| When a table name is changed, change it in the relationships and tables data: More...
void | change_relationship_name (const Glib::ustring& table_name, const Glib::ustring& name, const Glib::ustring& name_new)
| When a relationship name is changed, change it in layouts and reports: More...
type_listTableInfo | get_tables (bool plus_system_prefs=false)
type_listConstTableInfo | get_tables (bool plus_system_prefs=false) const
std::vector< Glib::ustring > | get_table_names (bool plus_system_prefs=false) const
void | set_tables (const type_listTableInfo& tables)
sharedptr< TableInfo > | get_table (const Glib::ustring& table_name) const
void | add_table (const sharedptr< TableInfo >& table_name)
void | remove_table (const Glib::ustring& table_name)
| Use this after DROPing the table. More...
bool | get_table_is_known (const Glib::ustring& table_name) const
bool | get_table_is_hidden (const Glib::ustring& table_name) const
Glib::ustring | get_table_title (const Glib::ustring& table_name, const Glib::ustring& locale) const
Glib::ustring | get_table_title_original (const Glib::ustring& table_name) const
void | set_table_title (const Glib::ustring& table_name, const Glib::ustring& value, const Glib::ustring& locale)
Glib::ustring | get_table_title_singular (const Glib::ustring& table_name, const Glib::ustring& locale) const
Glib::ustring | get_table_title_singular_original (const Glib::ustring& table_name) const
void | set_table_example_data (const Glib::ustring& table_name, const type_example_rows& rows)
| Save example data into the document, for use when creating the example database on the server. More...
type_example_rows | get_table_example_data (const Glib::ustring& table_name) const
virtual Glib::ustring | get_name () const
| Gets filename part of file_uri, or 'untitled'. More...
Glib::ustring | get_default_table () const
Glib::ustring | get_first_table () const
Glib::ustring | get_database_title_original () const
Glib::ustring | get_database_title (const Glib::ustring& locale) const
void | set_database_title_original (const Glib::ustring& title)
std::vector< Glib::ustring > | get_library_module_names () const
void | set_library_module (const Glib::ustring& name, const Glib::ustring& script)
Glib::ustring | get_library_module (const Glib::ustring& name) const
void | remove_library_module (const Glib::ustring& name)
Glib::ustring | get_startup_script () const
| Get a Python script that should be run when the document is opened. More...
void | set_startup_script (const Glib::ustring& script)
| See get_startup_script(). More...
type_list_groups | get_groups () const
void | set_group (GroupInfo&group)
| This adds the group if necessary. More...
void | remove_group (const Glib::ustring& group_name)
std::vector< Glib::ustring > | get_report_names (const Glib::ustring& table_name) const
void | set_report (const Glib::ustring& table_name, const sharedptr< Report >& report)
sharedptr< Report > | get_report (const Glib::ustring& table_name, const Glib::ustring& report_name) const
void | remove_report (const Glib::ustring& table_name, const Glib::ustring& report_name)
std::vector< Glib::ustring > | get_print_layout_names (const Glib::ustring& table_name) const
void | set_print_layout (const Glib::ustring& table_name, const sharedptr< PrintLayout >& print_layout)
sharedptr< PrintLayout > | get_print_layout (const Glib::ustring& table_name, const Glib::ustring& print_layout_name) const
void | remove_print_layout (const Glib::ustring& table_name, const Glib::ustring& print_layout_name)
void | set_layout_record_viewed (const Glib::ustring& table_name, const Glib::ustring& layout_name, const Gnome::Gda::Value& primary_key_value)
void | forget_layout_record_viewed (const Glib::ustring& table_name)
Gnome::Gda::Value | get_layout_record_viewed (const Glib::ustring& table_name, const Glib::ustring& layout_name) const
void | set_layout_current (const Glib::ustring& table_name, const Glib::ustring& layout_name)
| Temporarily save (but not in the document) the last-viewed layout for the table, so we can show the same layout when navigating back to this table later. More...
void | set_criteria_current (const Glib::ustring& table_name, const FoundSet& found_set)
| Temporarily save (but not in the document) the last-viewed criteria for the table, so we can show the same criteria (sort order, where clause) when navigating back to this table later. More...
Glib::ustring | get_layout_current (const Glib::ustring& table_name) const
FoundSet | get_criteria_current (const Glib::ustring& table_name) const
bool | get_table_overview_position (const Glib::ustring& table_name, float& x, float& y) const
| Retrieve the x and y coordinates for the given table position in the relationship overview dialog. More...
void | set_table_overview_position (const Glib::ustring& utable_name, float x, float y)
| Set the position of a table in the relationship overview dialog. More...
AppState::userlevels | get_userlevel (userLevelReason& reason) const
AppState::userlevels | get_userlevel () const
bool | set_userlevel (AppState::userlevels userlevel)
| This is transitory information, not saved to disk. More...
type_signal_userlevel_changed | signal_userlevel_changed ()
void | emit_userlevel_changed ()
Glib::ustring | get_active_layout_platform () const
| This is transitory information, not saved to disk. More...
void | set_active_layout_platform (const Glib::ustring& layout_platform=Glib::ustring())
| This is transitory information, not saved to disk. More...
Glib::ustring | build_and_get_contents () const
Glib::ustring | save_backup_file (const Glib::ustring& uri, const SlotProgress& slot_progress)
| Save a copy of the document as a backup. More...
Public Member Functions inherited from GlomBakery::Document_XML
| Document_XML ()
virtual | ~Document_XML ()
void | set_dtd_name (const std::string& strVal)
std::string | get_dtd_name () const
void | set_dtd_root_node_name (const Glib::ustring& strVal, const Glib::ustring& xmlns=Glib::ustring())
| Set the root node name and (optionally) the xmlns ID to be written when writing the document. More...
Glib::ustring | get_dtd_root_node_name () const
Glib::ustring | get_xml () const
Public Member Functions inherited from GlomBakery::Document
| Document ()
bool | save ()
bool | load (int& failure_code)
bool | load_from_data (const guchar* data, std::size_t length, int& failure_code)
bool | get_modified () const
bool | get_is_new () const
| Whether this just a default document. More...
void | set_is_new (bool bVal)
| Called by AppWindow_WithDoc::init_create_document(). More...
Glib::ustring | get_contents () const
Glib::ustring | get_file_uri_with_extension (const Glib::ustring& uri)
Glib::ustring | get_file_uri () const
bool | get_read_only () const
void | set_read_only (bool bVal)
void | set_view (ViewBase* pView)
| If you don't want to use a View, then don't use set_view(). More...
ViewBase* | get_view ()
void | set_file_extension (const Glib::ustring& strVal)
Glib::ustring | get_file_extension () const
type_signal_modified& | signal_modified ()
| This signal is emitted when the document has been modified. More...
type_signal_forget& | signal_forget ()
| This signal is emitted when the view should forget the document. More...

## Static Public Member Functions
static guint | get_latest_known_document_format_version ()
static void | fill_translatable_custom_choices (Formatting& formatting, type_list_translatables& the_list, const Glib::ustring& hint)
static Glib::ustring | extract_backup_file (const Glib::ustring& backup_uri, std::string& backup_path, const SlotProgress& slot_progress)
| Extract the .glom file and backup data from a .tar.gz archive. More...
static sharedptr< TableInfo > | create_table_system_preferences ()
static sharedptr< TableInfo > | create_table_system_preferences (type_vec_fields& fields)
static sharedptr< Relationship > | create_relationship_system_preferences (const Glib::ustring& table_name)
static bool | get_relationship_is_system_properties (const sharedptr< const Relationship >& relationship)
Static Public Member Functions inherited from GlomBakery::Document
static Glib::ustring | util_file_uri_get_name (const Glib::ustring& file_uri, const Glib::ustring& file_extension)

## Additional Inherited Members
Protected Types inherited from GlomBakery::Document_XML
typedef GlomBakery::Document | type_base
Protected Member Functions inherited from GlomBakery::Document_XML
const xmlpp::Element* | get_node_document () const
xmlpp::Element* | get_node_document ()
void | Util_DOM_Write (Glib::ustring& refstrXML) const
void | add_indenting_white_space_to_node (xmlpp::Node* node=0, const Glib::ustring& start_indent=Glib::ustring())
| Put each node on its own line and add white space for indenting, even if there are child text nodes. More...
Protected Member Functions inherited from GlomBakery::Document
bool | read_from_disk (int& failure_code)
bool | write_to_disk ()
Protected Attributes inherited from GlomBakery::Document_XML
xmlpp::DomParser | m_DOM_Parser
xmlpp::Document* | m_pDOM_Document
std::string | m_strDTD_Name
Glib::ustring | m_strRootNodeName
Glib::ustring | m_root_xmlns
bool | m_write_formatted
Protected Attributes inherited from GlomBakery::Document
Glib::ustring | m_strContents
Glib::ustring | m_file_uri
Glib::ustring | m_file_extension
ViewBase* | m_pView
type_signal_modified | signal_modified_
type_signal_forget | signal_forget_
bool | m_bModified
bool | m_bIsNew
bool | m_bReadOnly

## Member Typedef Documentation

typedef std::pair< sharedptr<TranslatableItem>, Glib::ustring> Glom::Document::pair_translatable_item_and_hint

The translatable item and a hint about what it is.

typedef sigc::slot<void> Glom::Document::SlotProgress

This callback should show UI to indicate that work is still happening.

For instance, a pulsing ProgressBar.

typedef std::vector< type_row_data > Glom::Document::type_example_rows

typedef std::vector<GroupInfo> Glom::Document::type_list_groups

These are only used when recreating a database from an example file. The actualy access-control is on the server, of course.

typedef std::vector< sharedptr<LayoutGroup> > Glom::Document::type_list_layout_groups

typedef std::vector<type_pairFieldTrigger> Glom::Document::type_list_lookups

typedef std::vector<pair_translatable_item_and_hint> Glom::Document::type_list_translatables

typedef std::vector< sharedptr<const TableInfo> > Glom::Document::type_listConstTableInfo

typedef std::vector< sharedptr<TableInfo> > Glom::Document::type_listTableInfo

typedef std::pair< sharedptr<LayoutItem_Field>, sharedptr<Relationship> > Glom::Document::type_pairFieldTrigger

typedef std::vector< Gnome::Gda::Value > Glom::Document::type_row_data

typedef sigc::signal<void, AppState::userlevels> Glom::Document::type_signal_userlevel_changed

typedef std::vector< sharedptr<Field> > Glom::Document::type_vec_fields

typedef std::vector< sharedptr<Relationship> > Glom::Document::type_vec_relationships

## Member Enumeration Documentation

enum Glom::Document::HostingMode

How the database is hosted.

Enumerator
HOSTING_MODE_POSTGRES_CENTRAL | The database is hosted on an external PostgreSQL server.
HOSTING_MODE_POSTGRES_SELF | A new PostgreSQL database process is spawned that hosts the data.
HOSTING_MODE_SQLITE | A sqlite database file is used.
HOSTING_MODE_MYSQL_CENTRAL | The database is hosted on an external MySQL server.
HOSTING_MODE_MYSQL_SELF | A new MySQL database process is spawned that hosts the data.
HOSTING_MODE_DEFAULT |

enum Glom::Document::load_failure_codes

Failure codes that could be returned by load_after()

Enumerator
LOAD_FAILURE_CODE_FILE_VERSION_TOO_NEW |

enum Glom::Document::userLevelReason

Enumerator
USER_LEVEL_REASON_UNKNOWN |
USER_LEVEL_REASON_FILE_READ_ONLY |
USER_LEVEL_REASON_DATABASE_ACCESS_LEVEL |
USER_LEVEL_REASON_OPENED_FROM_BROWSE |

## Constructor & Destructor Documentation

Glom::Document::Document | ( |  | ) |

virtual Glom::Document::~Document | ( |  | ) |
| virtual

Reimplemented from GlomBakery::Document.

## Member Function Documentation

void Glom::Document::add_table | ( | const sharedptr< TableInfo >& | table_name | ) |

Glib::ustring Glom::Document::build_and_get_contents | ( |  | ) | const

void Glom::Document::change_field_name | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | strFieldNameOld,
|  | const Glib::ustring & | strFieldNameNew
| ) |  |

When a field name is changed, change it in the relationships, layouts, reports, and fields data:

void Glom::Document::change_relationship_name | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | name,
|  | const Glib::ustring & | name_new
| ) |  |

When a relationship name is changed, change it in layouts and reports:

void Glom::Document::change_table_name | ( | const Glib::ustring & | table_name_old,
|  | const Glib::ustring & | table_name_new
| ) |  |

When a table name is changed, change it in the relationships and tables data:

static sharedptr<Relationship> Glom::Document::create_relationship_system_preferences | ( | const Glib::ustring & | table_name | ) |
| static

static sharedptr<TableInfo> Glom::Document::create_table_system_preferences | ( |  | ) |
| static

static sharedptr<TableInfo> Glom::Document::create_table_system_preferences | ( | type_vec_fields& | fields | ) |
| static

void Glom::Document::emit_userlevel_changed | ( |  | ) |

static Glib::ustring Glom::Document::extract_backup_file | ( | const Glib::ustring & | backup_uri,
|  | std::string & | backup_path,
|  | const SlotProgress& | slot_progress
| ) |  |
| static

Extract the .glom file and backup data from a .tar.gz archive.

The backup data must be stored temporarily on disk because pg_restore requires a file on disk.

Parameters

  backup_uri | The URI of a .tar.gz backup file.
  backup_path | This will be set to the path of a temporary file for use with pg_restore.

Returns
  The contents of the .glom file from the .tar.gz file.

void Glom::Document::fill_layout_field_details | ( | const Glib::ustring & | parent_table_name,
|  | const sharedptr< LayoutGroup >& | layout_group
| ) |  | const

void Glom::Document::fill_layout_field_details | ( | const Glib::ustring & | parent_table_name,
|  | type_list_layout_groups& | groups
| ) |  | const

static void Glom::Document::fill_translatable_custom_choices | ( | Formatting& | formatting,
|  | type_list_translatables& | the_list,
|  | const Glib::ustring & | hint
| ) |  |
| static

void Glom::Document::forget_layout_record_viewed | ( | const Glib::ustring & | table_name | ) |

Glib::ustring Glom::Document::get_active_layout_platform | ( |  | ) | const

This is transitory information, not saved to disk.

Returns
  the active platform name - see get_data_layout_groups().

Glib::ustring Glom::Document::get_connection_database | ( |  | ) | const

unsigned int Glom::Document::get_connection_port | ( |  | ) | const

std::string Glom::Document::get_connection_self_hosted_directory_uri | ( |  | ) | const

If the database should be hosted, this provides the path to the directory that contains all the files needed to do that.

This is usually a specifically-named directory at the same level as the .glom file. If the database is a sqlite database, this specifies the directory in which the database file is in.

Glib::ustring Glom::Document::get_connection_server | ( |  | ) | const

bool Glom::Document::get_connection_try_other_ports | ( |  | ) | const

Glib::ustring Glom::Document::get_connection_user | ( |  | ) | const

Retrieve a username previously set in the document.

Note that this is not saved in the document's file.

TODO: Remove this, and just store it in ConnectionPool?

FoundSet Glom::Document::get_criteria_current | ( | const Glib::ustring & | table_name | ) | const

type_list_layout_groups Glom::Document::get_data_layout_groups | ( | const Glib::ustring & | layout_name,
|  | const Glib::ustring & | parent_table_name,
|  | const Glib::ustring & | layout_platform = `Glib::ustring()`
| ) |  | const

Get the layout groups for a layout.

Parameters

  layout_name | The name of the layout, such as list or details.
  parent_table_name | The name of the table for which this layout should appear.
  layout_platform | The platform for which this layout should be used. Possible values are an empty string (meaning normal platforms) or "maemo" meaning "normal".

Returns
  A list of layout groups at the top-level of the requested layout.

type_list_layout_groups Glom::Document::get_data_layout_groups_default | ( | const Glib::ustring & | layout_name,
|  | const Glib::ustring & | parent_table_name,
|  | const Glib::ustring & | layout_platform = `Glib::ustring()`
| ) |  | const

bool Glom::Document::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

Discover whether there are any fields in the layout.

Parameters

  layout_name | The name of the layout, such as list or details.
  parent_table_name | The name of the table for which this layout should appear.
  layout_platform | The platform for which this layout should be used. Possible values are an empty string (meaning normal platforms) or "maemo" meaning "normal".

Returns
  true if there is at least one field in the layout group or its sub groups.

type_list_layout_groups Glom::Document::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

Parameters

  The | layout_name, such as "details", "list".
  parent_table_name | The name of the table on whose layout the layout appears.
  layout_platform | The platform for which this layout should be used. Possible values are an empty string (meaning normal platforms) or "maemo" meaning "normal".

Glib::ustring Glom::Document::get_database_title | ( | const Glib::ustring & | locale | ) | const

Glib::ustring Glom::Document::get_database_title_original | ( |  | ) | const

Glib::ustring Glom::Document::get_default_table | ( |  | ) | const

guint Glom::Document::get_document_format_version | ( |  | ) |

sharedptr<Field> Glom::Document::get_field | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | strFieldName
| ) |  | const

sharedptr<Field> Glom::Document::get_field_primary_key | ( | const Glib::ustring & | table_name | ) | const

sharedptr<const Relationship> Glom::Document::get_field_used_in_relationship_to_one | ( | const Glib::ustring & | table_name,
|  | const sharedptr< const LayoutItem_Field >& | layout_field
| ) |  | const

Returns whether the field is the from-field in a to-one relationship.

See also
  get_relationship_is_to_one(). Ignores hidden tables.

Glib::ustring Glom::Document::get_first_table | ( |  | ) | const

type_list_groups Glom::Document::get_groups | ( |  | ) | const

HostingMode Glom::Document::get_hosting_mode | ( |  | ) | const

This returns how the database is hosted.

bool Glom::Document::get_is_backup_file | ( |  | ) | const

bool Glom::Document::get_is_example_file | ( |  | ) | const

static guint Glom::Document::get_latest_known_document_format_version | ( |  | ) |
| static

Glib::ustring Glom::Document::get_layout_current | ( | const Glib::ustring & | table_name | ) | const

Gnome::Gda::Value Glom::Document::get_layout_record_viewed | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | layout_name
| ) |  | const

Glib::ustring Glom::Document::get_library_module | ( | const Glib::ustring & | name | ) | const

std::vector<Glib::ustring> Glom::Document::get_library_module_names | ( |  | ) | const

type_list_lookups Glom::Document::get_lookup_fields | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | field_name
| ) |  | const

Get the fields whose values should be looked up when field_name changes, with the relationship used to lookup the value.

virtual Glib::ustring Glom::Document::get_name | ( |  | ) | const
| virtual

Gets filename part of file_uri, or 'untitled'.

Reimplemented from GlomBakery::Document.

bool Glom::Document::get_network_shared | ( |  | ) | const

See set_network_shared().

Returns
  true if the database is (or should be) shared over the network.

bool Glom::Document::get_opened_from_browse | ( |  | ) | const

sharedptr<PrintLayout> Glom::Document::get_print_layout | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | print_layout_name
| ) |  | const

std::vector<Glib::ustring> Glom::Document::get_print_layout_names | ( | const Glib::ustring & | table_name | ) | const

sharedptr<Relationship> Glom::Document::get_relationship | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | relationship_name
| ) |  | const

static bool Glom::Document::get_relationship_is_system_properties | ( | const sharedptr< const Relationship >& | relationship | ) |
| static

bool Glom::Document::get_relationship_is_to_one | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | relationship_name
| ) |  | const

Returns whether the relationship's to-field is a primary key or unique field, meaning that there can be only one related record for each value of the from-field.

type_vec_relationships Glom::Document::get_relationships | ( | const Glib::ustring & | table_name,
|  | bool | plus_system_prefs = `false`
| ) |  | const

sharedptr<Report> Glom::Document::get_report | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | report_name
| ) |  | const

std::vector<Glib::ustring> Glom::Document::get_report_names | ( | const Glib::ustring & | table_name | ) | const

Glib::ustring Glom::Document::get_startup_script | ( |  | ) | const

Get a Python script that should be run when the document is opened.

sharedptr<TableInfo> Glom::Document::get_table | ( | const Glib::ustring & | table_name | ) | const

type_example_rows Glom::Document::get_table_example_data | ( | const Glib::ustring & | table_name | ) | const

type_vec_fields Glom::Document::get_table_fields | ( | const Glib::ustring & | table_name | ) | const

bool Glom::Document::get_table_is_hidden | ( | const Glib::ustring & | table_name | ) | const

bool Glom::Document::get_table_is_known | ( | const Glib::ustring & | table_name | ) | const

std::vector<Glib::ustring> Glom::Document::get_table_names | ( | bool | plus_system_prefs = `false` | ) | const

bool Glom::Document::get_table_overview_position | ( | const Glib::ustring & | table_name,
|  | float & | x,
|  | float & | y
| ) |  | const

Retrieve the x and y coordinates for the given table position in the relationship overview dialog.

Parameters

  table_name | The name of the table to query.
  x | The x coordinate of the table position.
  y | The y coordinate of the table position.

Returns
  false if the table does not have any position for this table.

Glib::ustring Glom::Document::get_table_title | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | locale
| ) |  | const

Glib::ustring Glom::Document::get_table_title_original | ( | const Glib::ustring & | table_name | ) | const

Glib::ustring Glom::Document::get_table_title_singular | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | locale
| ) |  | const

Glib::ustring Glom::Document::get_table_title_singular_original | ( | const Glib::ustring & | table_name | ) | const

type_listTableInfo Glom::Document::get_tables | ( | bool | plus_system_prefs = `false` | ) |

type_listConstTableInfo Glom::Document::get_tables | ( | bool | plus_system_prefs = `false` | ) | const

type_list_translatables Glom::Document::get_translatable_items | ( |  | ) |

std::vector<Glib::ustring> Glom::Document::get_translation_available_locales | ( |  | ) | const

Get a list of locales for which at least one string is translated.

The result will include the original, from get_translation_original_locale().

Glib::ustring Glom::Document::get_translation_original_locale | ( |  | ) | const

Get the language/locale used by original titles.

Title translations are translations of the text in this language.

AppState::userlevels Glom::Document::get_userlevel | ( | userLevelReason& | reason | ) | const

Parameters

  reason | The reason that the user is not a developer, if he is not.

Returns
  Whether the user is a developer.

AppState::userlevels Glom::Document::get_userlevel | ( |  | ) | const

bool Glom::Document::load | ( | int & | failure_code | ) |

void Glom::Document::remove_field | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | field_name
| ) |  |

Use this after removing a field from a table, so that it is not used anymore in relationships, layouts, reports, etc.

void Glom::Document::remove_group | ( | const Glib::ustring & | group_name | ) |

void Glom::Document::remove_library_module | ( | const Glib::ustring & | name | ) |

void Glom::Document::remove_print_layout | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | print_layout_name
| ) |  |

void Glom::Document::remove_relationship | ( | const sharedptr< const Relationship >& | relationship | ) |

void Glom::Document::remove_report | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | report_name
| ) |  |

void Glom::Document::remove_table | ( | const Glib::ustring & | table_name | ) |

Use this after DROPing the table.

It removes information about the table, including fields and layouts, and any place that parts of the table are used.

Glib::ustring Glom::Document::save_backup_file | ( | const Glib::ustring & | uri,
|  | const SlotProgress& | slot_progress
| ) |  |

Save a copy of the document as a backup.

This document (and its URI) will not be changed.

Parameters

  The | location at which to save the backup Glom file.

Returns
  The URI of the .tar.gz tarball.

void Glom::Document::set_active_layout_platform | ( | const Glib::ustring & | layout_platform = `Glib::ustring()` | ) |

This is transitory information, not saved to disk.

the active platform name - see get_data_layout_groups().

void Glom::Document::set_allow_autosave | ( | bool | value = `true` | ) |

The document usually saves itself when you call set_modified().

Pass false to this function to prevent that temporarily. The document will be saved, if necessary, after you call this function with true.

void Glom::Document::set_connection_database | ( | const Glib::ustring & | strVal | ) |

void Glom::Document::set_connection_port | ( | unsigned int | port_number | ) |

void Glom::Document::set_connection_server | ( | const Glib::ustring & | strVal | ) |

void Glom::Document::set_connection_try_other_ports | ( | bool | val | ) |

void Glom::Document::set_connection_user | ( | const Glib::ustring & | strVal | ) |

Temporarily set a username in the document.

Note that this is not saved in the document's file.

TODO: Remove this, and just store it in ConnectionPool?

void Glom::Document::set_criteria_current | ( | const Glib::ustring & | table_name,
|  | const FoundSet& | found_set
| ) |  |

Temporarily save (but not in the document) the last-viewed criteria for the table, so we can show the same criteria (sort order, where clause) when navigating back to this table later.

Parameters

  table_name | The table.
  found_set | Additional information about the last use of that layout, such as the sort order or where clause.

void Glom::Document::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
| ) |  |

Set the layout groups for a layout.

Parameters

  layout_name | The name of the layout, such as list or details.
  parent_table_name | The name of the table for which this layout should appear.
  layout_platform | The platform for which this layout should be used. Possible values are an empty string (meaning normal platforms) or "maemo" meaning "normal".
  groups | A list of layout groups at the top-level of the requested layout.

void Glom::Document::set_database_title_original | ( | const Glib::ustring & | title | ) |

virtual void Glom::Document::set_file_uri | ( | const Glib::ustring & | file_uri,
|  | bool | bEnforceFileExtension = `false`
| ) |  |
| virtual

Set the file URI that will be used in future calls to load() and save().

Note that the document will not be saved immediately to the new URI. It will be saved either after the next change (if using autosave) or when calling save() explicitly. Likewise, the document at the URI will not be loaded until load() is called explicitly. That is unlike in the base class's implementation.

Reimplemented from GlomBakery::Document.

void Glom::Document::set_group | ( | GroupInfo& | group | ) |

This adds the group if necessary.

void Glom::Document::set_hosting_mode | ( | HostingMode | mode | ) |

Set the hosting mode of the database.

void Glom::Document::set_is_backup_file | ( | bool | value = `true` | ) |

void Glom::Document::set_is_example_file | ( | bool | value = `true` | ) |

void Glom::Document::set_layout_current | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | layout_name
| ) |  |

Temporarily save (but not in the document) the last-viewed layout for the table, so we can show the same layout when navigating back to this table later.

Parameters

  table_name | The table.
  layout_name | The layout name, such as "list" or "details".

void Glom::Document::set_layout_record_viewed | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | layout_name,
|  | const Gnome::Gda::Value & | primary_key_value
| ) |  |

void Glom::Document::set_library_module | ( | const Glib::ustring & | name,
|  | const Glib::ustring & | script
| ) |  |

virtual void Glom::Document::set_modified | ( | bool | value = `true` | ) |
| virtual

Reimplemented from GlomBakery::Document.

void Glom::Document::set_network_shared | ( | bool | shared = `true` | ) |

Whether the database (and document) is shared over the network.

This setting is saved in the file, allowing the database to be shared immediately after opening the document.

Parameters

  shared | true if the database should be shared.

void Glom::Document::set_opened_from_browse | ( | bool | val = `true` | ) |

Whether the document was opened from another networked glom instance, instead of via a URI.

void Glom::Document::set_print_layout | ( | const Glib::ustring & | table_name,
|  | const sharedptr< PrintLayout >& | print_layout
| ) |  |

void Glom::Document::set_relationship | ( | const Glib::ustring & | table_name,
|  | const sharedptr< Relationship >& | relationship
| ) |  |

void Glom::Document::set_relationships | ( | const Glib::ustring & | table_name,
|  | const type_vec_relationships& | vecRelationships
| ) |  |

void Glom::Document::set_report | ( | const Glib::ustring & | table_name,
|  | const sharedptr< Report >& | report
| ) |  |

void Glom::Document::set_startup_script | ( | const Glib::ustring & | script | ) |

See get_startup_script().

void Glom::Document::set_table_example_data | ( | const Glib::ustring & | table_name,
|  | const type_example_rows& | rows
| ) |  |

Save example data into the document, for use when creating the example database on the server.

Don't use this for large amounts of data.

Parameters

  table_name | The table that should contain this example data.
  rows | Each row is separated by a newline. Each line has comma-separated field values, in SQL format.

void Glom::Document::set_table_fields | ( | const Glib::ustring & | table_name,
|  | const type_vec_fields& | vecFields
| ) |  |

void Glom::Document::set_table_overview_position | ( | const Glib::ustring & | utable_name,
|  | float | x,
|  | float | y
| ) |  |

Set the position of a table in the relationship overview dialog.

Parameters

  table_name | The name of the table to modify.
  x | The x coordinate of the table position.
  y | The y coordinate of the table position.

void Glom::Document::set_table_title | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | value,
|  | const Glib::ustring & | locale
| ) |  |

void Glom::Document::set_tables | ( | const type_listTableInfo& | tables | ) |

void Glom::Document::set_translation_original_locale | ( | const Glib::ustring & | locale | ) |

Set the language/locale used by original titles.

Title translations are translations of the text in this language.

Parameters

  locale | For instance, "en_US.UTF-8".

bool Glom::Document::set_userlevel | ( | AppState::userlevels | userlevel | ) |

This is transitory information, not saved to disk.

type_signal_userlevel_changed Glom::Document::signal_userlevel_changed | ( |  | ) |

The documentation for this class was generated from the following file:

- libglom/document/document.h