libglom-1.20: Glom::Document Class Reference

libglom-1.20 1.19.10

- Main Page
- Namespaces
- Classes

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

Public Types | Public Member Functions | Static Public Member Functions | Static Protected Member Functions

# Glom::Document Class Reference

Inheritance diagram for Glom::Document:
[legend]
Collaboration diagram for Glom::Document:
[legend]

List of all members.

## Public Types
enum | HostingMode { HOSTING_MODE_POSTGRES_CENTRAL, HOSTING_MODE_POSTGRES_SELF, HOSTING_MODE_SQLITE, 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::vector< sharedptr < LayoutGroup > > | type_list_layout_groups
typedef std::list< sharedptr < TranslatableItem > > | type_list_translatables
typedef std::list< sharedptr < TableInfo > > | type_listTableInfo
typedef std::vector < Gnome::Gda::Value > | type_row_data
typedef std::vector < type_row_data > | type_example_rows
typedef std::list< 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.
typedef std::list< Glib::ustring > | type_listReports
typedef std::list< Glib::ustring > | type_listPrintLayouts
typedef sigc::signal< void, AppState::userlevels > | type_signal_userlevel_changed
## 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)
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.
bool | get_opened_from_browse () const
void | set_allow_autosave (bool value=true)
| The document usually saves itself when you call set_modified().
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.
HostingMode | get_hosting_mode () const
| This returns how the database is hosted.
void | set_network_shared (bool shared=true)
| Whether the database (and document) is shared over the network.
bool | get_network_shared () const
| See set_network_shared().
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.
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.
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.
void | set_translation_original_locale (const Glib::ustring& locale)
| Set the language/locale used by original titles.
Glib::ustring | get_translation_original_locale () const
| Get the language/locale used by original titles.
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.
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.
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
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.
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.
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.
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.
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
| The layout_name, such as "details", "list".
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_layout_items (const Glib::ustring& table_name)
type_list_translatables | get_translatable_report_items (const Glib::ustring& table_name, const Glib::ustring& report_title)
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:
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:
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:
type_listTableInfo | 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.
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
void | set_table_title (const Glib::ustring& table_name, const Glib::ustring&value)
Glib::ustring | get_table_title_singular (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.
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'.
Glib::ustring | get_default_table () const
Glib::ustring | get_first_table () const
Glib::ustring | get_database_title () const
void | set_database_title (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.
void | set_startup_script (const Glib::ustring& script)
| See get_startup_script().
type_list_groups | get_groups () const
void | set_group (GroupInfo& group)
| This adds the group if necessary.
void | remove_group (const Glib::ustring& group_name)
type_listReports | 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)
type_listPrintLayouts | 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.
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.
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.
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.
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.
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.
void | set_active_layout_platform (const Glib::ustring& layout_platform=Glib::ustring())
| This is transitory information, not saved to disk.
Glib::ustring | build_and_get_contents () const
## Static Public Member Functions
static guint | get_latest_known_document_format_version ()
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 Protected Member Functions
static void | set_node_attribute_value_as_decimal (xmlpp::Element* node, const Glib::ustring& strAttributeName, guint value, guint value_default=0)
| If value is equal to the default then no attribute will be set, to save text space in the XML file.
static void | set_node_attribute_value_as_decimal_double (xmlpp::Element* node, const Glib::ustring& strAttributeName, double value)

## Member Typedef Documentation

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

typedef std::list<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::list< sharedptr<TranslatableItem> > Glom::Document::type_list_translatables

typedef std::list<Glib::ustring> Glom::Document::type_listPrintLayouts

typedef std::list<Glib::ustring> Glom::Document::type_listReports

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

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 postgres database process is spawned that hosts the data.
  HOSTING_MODE_SQLITE | A sqlite database file is used.
  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 | ( |  | ) |

Reimplemented from GlomBakery::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 | ( |  | ) |

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

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

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.

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

The layout_name, such as "details", "list".

parent_table_name The name of the table on whose layout the layout appears.

Parameters:

  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 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<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

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

type_listPrintLayouts 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

type_listReports 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 Glom::Document::get_table_title_singular | ( | const Glib::ustring & | table_name | ) | const

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

type_list_translatables Glom::Document::get_translatable_layout_items | ( | const Glib::ustring & | table_name | ) |

type_list_translatables Glom::Document::get_translatable_report_items | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | report_title
| ) |  |

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 | ) |

Reimplemented from GlomBakery::Document.

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.

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

This is transitory information, not saved to disk.

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 | ( | const Glib::ustring & | title | ) |

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

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.

static void Glom::Document::set_node_attribute_value_as_decimal | ( | xmlpp::Element * | node,
|  | const Glib::ustring & | strAttributeName,
|  | guint | value,
|  | guint | value_default = `0`
| ) |  | `[static, protected]`

If value is equal to the default then no attribute will be set, to save text space in the XML file.

static void Glom::Document::set_node_attribute_value_as_decimal_double | ( | xmlpp::Element * | node,
|  | const Glib::ustring & | strAttributeName,
|  | double | value
| ) |  | `[static, protected]`

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
| ) |  |

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