libglom-1.32: Glom::Formatting Class Reference

libglom-1.32 1.31.6

- Main Page
- Namespaces
- Classes

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

Public Types | Public Member Functions | Public Attributes | List of all members
Glom::Formatting Class Reference

This specifies how to display data for fields or static text items. More...

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

## Public Types
enum | HorizontalAlignment { HorizontalAlignment::AUTO, HorizontalAlignment::LEFT, HorizontalAlignment::RIGHT }
typedef std::vector< std::shared_ptr< ChoiceValue > > | type_list_values
typedef std::pair< std::shared_ptr< const LayoutItem_Field >, bool > | type_pair_sort_field
typedef std::vector< type_pair_sort_field > | type_list_sort_fields

## Public Member Functions
| Formatting ()
| Formatting (const Formatting& src)
| Formatting (Formatting&& src)=delete
Formatting& | operator= (const Formatting& src)
Formatting& | operator= (Formatting&& src)=delete
bool | operator== (const Formatting& src) const
bool | get_has_choices () const
bool | get_has_related_choices () const
bool | get_has_related_choices (bool& show_all, bool& with_second) const
void | set_has_related_choices (bool val=true)
bool | get_has_custom_choices () const
void | set_has_custom_choices (bool val=true)
type_list_values | get_choices_custom () const
void | set_choices_custom (const type_list_values& choices)
Glib::ustring | get_custom_choice_original_for_translated_text (const Glib::ustring& text, const Glib::ustring& locale=Glib::ustring()) const
| Get the original text that corresponds to the translated choice for the current locale. More...
Glib::ustring | get_custom_choice_translated (const Glib::ustring& original_text, const Glib::ustring& locale=Glib::ustring()) const
| Get the translated choice text, for the current locale, that corresponds to the original text . More...
bool | get_choices_restricted (bool& as_radio_buttons) const
| Discover whether the entered data should only be one of the available choices. More...
void | set_choices_restricted (bool val=true, bool as_radio_buttons=false)
| See get_choices_restricted(). More...
void | get_choices_related (std::shared_ptr< const Relationship >& relationship, std::shared_ptr< LayoutItem_Field >& field, std::shared_ptr< LayoutGroup >& extra_layout, type_list_sort_fields& sort_fields, bool& show_all)
void | get_choices_related (std::shared_ptr< const Relationship >& relationship, std::shared_ptr< const LayoutItem_Field >& field, std::shared_ptr< const LayoutGroup >& extra_layout, type_list_sort_fields& sort_fields, bool& show_all) const
void | set_choices_related (const std::shared_ptr< const Relationship >& relationship_name, const std::shared_ptr< LayoutItem_Field >& field, const std::shared_ptr< LayoutGroup >& extra_layout, const type_list_sort_fields& sort_fields, bool show_all)
std::shared_ptr< const Relationship > | get_choices_related_relationship (bool& show_all) const
bool | get_text_format_multiline () const
| Get whether the text should be displayed with multiple lines in the details view. More...
void | set_text_format_multiline (bool value=true)
| Set whether the text should be displayed with multiple lines in the details view. More...
guint | get_text_format_multiline_height_lines () const
| Get the number of lines of text that should be displayed. More...
void | set_text_format_multiline_height_lines (guint value)
| Get the number of lines of text that should be displayed. More...
void | set_text_format_font (const Glib::ustring& font_desc)
| Set the font description, as returned from Gtk::FontButton::get_font_name(), which may include the size and style. More...
Glib::ustring | get_text_format_font () const
| Get the font description, as returned from Gtk::FontButton::get_font_name(), which may include the size and style. More...
void | set_text_format_color_foreground (const Glib::ustring& color)
| Set the foreground color to use for text when displaying a field value. More...
Glib::ustring | get_text_format_color_foreground_to_use (const Gnome::Gda::Value& value) const
| Get the foreground color to use for text for the specified value, taking the negative-color into account, if specified. More...
Glib::ustring | get_text_format_color_foreground () const
| Get the foreground color to use for text when displaying a field value. More...
void | set_text_format_color_background (const Glib::ustring& color)
| Set the background color to use for text when displaying a field value. More...
Glib::ustring | get_text_format_color_background () const
| Get the background color to use for text when displaying a field value. More...
void | set_horizontal_alignment (HorizontalAlignment alignment)
HorizontalAlignment | get_horizontal_alignment () const
bool | change_field_item_name (const Glib::ustring& table_name, const Glib::ustring& field_name_old, const Glib::ustring& field_name_new)
| Adapt to a change of field name, so this Formatting does not refer to any field that no longer exists. More...
Public Member Functions inherited from Glom::UsesRelationship
| UsesRelationship ()
| UsesRelationship (const UsesRelationship& src)
| UsesRelationship (UsesRelationship&& src)=delete
UsesRelationship& | operator= (const UsesRelationship& src)
UsesRelationship& | operator= (UsesRelationship&& src)=delete
bool | operator== (const UsesRelationship& src) const
bool | get_has_relationship_name () const
bool | get_has_related_relationship_name () const
Glib::ustring | get_relationship_name () const
| Convenience function, equivalent to get_relationship()->get_name(). More...
Glib::ustring | get_related_relationship_name () const
| Convenience function, equivalent to get_relationship()->get_name(). More...
std::shared_ptr< const Relationship > | get_relationship () const
| Return the relationship used by this item, if any, or a null std::shared_ptr. More...
void | set_relationship (const std::shared_ptr< const Relationship >& relationship)
std::shared_ptr< const Relationship > | get_related_relationship () const
| Return the related relationship used by this item, if any, or a null std::shared_ptr. More...
void | set_related_relationship (const std::shared_ptr< const Relationship >& relationship)
Glib::ustring | get_table_used (const Glib::ustring& parent_table) const
| Returns either the parent_table, related to table, or doubly-related to-table. More...
Glib::ustring | get_title_used (const Glib::ustring& parent_table_title, const Glib::ustring& locale) const
| Get the title of the relationship that is actually used, falling back to the relationship's name. More...
Glib::ustring | get_title_singular_used (const Glib::ustring& parent_table_title, const Glib::ustring& locale) const
| Get the singular title of the relationship that is actually used, falling back to the regular (plural) title, and then to the relationship's name. More...
Glib::ustring | get_to_field_used () const
Glib::ustring | get_relationship_name_used () const
| Get the name of the related relationship used, if any, or the relationship if there is no related relationship, or an empty string if neither are used by this item. More...
bool | get_relationship_used_allows_edit () const
| Discover whether the relationship used allows the user to edit values in its to table. More...
Glib::ustring | get_sql_join_alias_name () const
| Get a name to use as an alias in SQL statements. More...
Glib::ustring | get_sql_table_or_join_alias_name (const Glib::ustring& parent_table) const
| Get the item's alias name, if it uses a relationship, or just get its table name. More...
Glib::ustring | get_relationship_display_name () const
| Get a human-readable representation of th relationship. More...

## Public Attributes
NumericFormat | m_numeric_format

## Detailed Description

This specifies how to display data for fields or static text items.

## Member Typedef Documentation

typedef std::vector<type_pair_sort_field> Glom::Formatting::type_list_sort_fields

typedef std::vector< std::shared_ptr<ChoiceValue> > Glom::Formatting::type_list_values

typedef std::pair< std::shared_ptr<const LayoutItem_Field>, bool > Glom::Formatting::type_pair_sort_field

## Member Enumeration Documentation

enum Glom::Formatting::HorizontalAlignment
| strong

Enumerator
AUTO |
LEFT |
RIGHT |

## Constructor & Destructor Documentation

Glom::Formatting::Formatting | ( |  | ) |

Glom::Formatting::Formatting | ( | const Formatting& | src | ) |

Glom::Formatting::Formatting | ( | Formatting&& | src | ) |
| delete

## Member Function Documentation

bool Glom::Formatting::change_field_item_name | ( | const Glib::ustring & | table_name,
|  | const Glib::ustring & | field_name_old,
|  | const Glib::ustring & | field_name_new
| ) |  |

Adapt to a change of field name, so this Formatting does not refer to any field that no longer exists.

Returns
  true if something was changed.

type_list_values Glom::Formatting::get_choices_custom | ( |  | ) | const

void Glom::Formatting::get_choices_related | ( | std::shared_ptr< const Relationship >& | relationship,
|  | std::shared_ptr< LayoutItem_Field >& | field,
|  | std::shared_ptr< LayoutGroup >& | extra_layout,
|  | type_list_sort_fields& | sort_fields,
|  | bool & | show_all
| ) |  |

void Glom::Formatting::get_choices_related | ( | std::shared_ptr< const Relationship >& | relationship,
|  | std::shared_ptr< const LayoutItem_Field >& | field,
|  | std::shared_ptr< const LayoutGroup >& | extra_layout,
|  | type_list_sort_fields& | sort_fields,
|  | bool & | show_all
| ) |  | const

std::shared_ptr<const Relationship> Glom::Formatting::get_choices_related_relationship | ( | bool & | show_all | ) | const

bool Glom::Formatting::get_choices_restricted | ( | bool & | as_radio_buttons | ) | const

Discover whether the entered data should only be one of the available choices.

Parameters

  [out] | as_radio_buttons | Whether the choices should be displayed as radio buttons instead of a combo box.

Glib::ustring Glom::Formatting::get_custom_choice_original_for_translated_text | ( | const Glib::ustring & | text,
|  | const Glib::ustring & | locale = `Glib::ustring()`
| ) |  | const

Get the original text that corresponds to the translated choice for the current locale.

Glib::ustring Glom::Formatting::get_custom_choice_translated | ( | const Glib::ustring & | original_text,
|  | const Glib::ustring & | locale = `Glib::ustring()`
| ) |  | const

Get the translated choice text, for the current locale, that corresponds to the original text .

bool Glom::Formatting::get_has_choices | ( |  | ) | const

bool Glom::Formatting::get_has_custom_choices | ( |  | ) | const

bool Glom::Formatting::get_has_related_choices | ( |  | ) | const

bool Glom::Formatting::get_has_related_choices | ( | bool & | show_all,
|  | bool & | with_second
| ) |  | const

HorizontalAlignment Glom::Formatting::get_horizontal_alignment | ( |  | ) | const

Glib::ustring Glom::Formatting::get_text_format_color_background | ( |  | ) | const

Get the background color to use for text when displaying a field value.

Returns
  the text background color, in a format recognised by XParseColor

Glib::ustring Glom::Formatting::get_text_format_color_foreground | ( |  | ) | const

Get the foreground color to use for text when displaying a field value.

This should be overriden by m_numeric_formatting.m_foreground_color_for_negatives if that is active.

Returns
  the text foreground color, in a format recognised by XParseColor

Glib::ustring Glom::Formatting::get_text_format_color_foreground_to_use | ( | const Gnome::Gda::Value & | value | ) | const

Get the foreground color to use for text for the specified value, taking the negative-color into account, if specified.

Returns
  the text foreground color, in a format recognised by XParseColor

Glib::ustring Glom::Formatting::get_text_format_font | ( |  | ) | const

Get the font description, as returned from Gtk::FontButton::get_font_name(), which may include the size and style.

Returns
  a Pango font description string

bool Glom::Formatting::get_text_format_multiline | ( |  | ) | const

Get whether the text should be displayed with multiple lines in the details view.

Text is displayed with a single line in the list view.

Returns
  whether the text should be displayed with multiple lines

guint Glom::Formatting::get_text_format_multiline_height_lines | ( |  | ) | const

Get the number of lines of text that should be displayed.

See also
  get_text_format_multiline()

Returns
  the number of lines of text

Formatting& Glom::Formatting::operator= | ( | const Formatting& | src | ) |

Formatting& Glom::Formatting::operator= | ( | Formatting&& | src | ) |
| delete

bool Glom::Formatting::operator== | ( | const Formatting& | src | ) | const

void Glom::Formatting::set_choices_custom | ( | const type_list_values& | choices | ) |

void Glom::Formatting::set_choices_related | ( | const std::shared_ptr< const Relationship >& | relationship_name,
|  | const std::shared_ptr< LayoutItem_Field >& | field,
|  | const std::shared_ptr< LayoutGroup >& | extra_layout,
|  | const type_list_sort_fields& | sort_fields,
|  | bool | show_all
| ) |  |

void Glom::Formatting::set_choices_restricted | ( | bool | val = `true`,
|  | bool | as_radio_buttons = `false`
| ) |  |

See get_choices_restricted().

void Glom::Formatting::set_has_custom_choices | ( | bool | val = `true` | ) |

void Glom::Formatting::set_has_related_choices | ( | bool | val = `true` | ) |

void Glom::Formatting::set_horizontal_alignment | ( | HorizontalAlignment | alignment | ) |

void Glom::Formatting::set_text_format_color_background | ( | const Glib::ustring & | color | ) |

Set the background color to use for text when displaying a field value.

Parameters

  [in] | color | a text background color, in a format recognised by XParseColor

void Glom::Formatting::set_text_format_color_foreground | ( | const Glib::ustring & | color | ) |

Set the foreground color to use for text when displaying a field value.

Parameters

  [in] | color | the text foreground color, in a format recognised by XParseColor

void Glom::Formatting::set_text_format_font | ( | const Glib::ustring & | font_desc | ) |

Set the font description, as returned from Gtk::FontButton::get_font_name(), which may include the size and style.

Parameters

  font_desc | a Pango font description string

void Glom::Formatting::set_text_format_multiline | ( | bool | value = `true` | ) |

Set whether the text should be displayed with multiple lines in the details view.

Text is displayed with a single line in the list view.

Parameters

  [in] | value | whether the text should be displayed with multiple lines

void Glom::Formatting::set_text_format_multiline_height_lines | ( | guint | value | ) |

Get the number of lines of text that should be displayed.

Returns
  the number of lines of text

## Member Data Documentation

NumericFormat Glom::Formatting::m_numeric_format

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

- libglom/data_structure/layout/formatting.h