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 | Public Attributes | List of all members
Glom::Field Class Reference
Inheritance diagram for Glom::Field:
[legend]
Collaboration diagram for Glom::Field:
[legend]

## Public Types
enum | sql_format { SQL_FORMAT_POSTGRES, SQL_FORMAT_SQLITE }
enum | glom_field_type { TYPE_INVALID, TYPE_NUMERIC, TYPE_TEXT, TYPE_DATE, TYPE_TIME, TYPE_BOOLEAN, TYPE_IMAGE }
typedef std::vector< Glib::ustring > | type_list_strings
typedef std::map< glom_field_type, Glib::ustring > | type_map_type_names
Public Types inherited from Glom::TranslatableItem
enum | enumTranslatableItemType { TRANSLATABLE_TYPE_INVALID, TRANSLATABLE_TYPE_FIELD, TRANSLATABLE_TYPE_RELATIONSHIP, TRANSLATABLE_TYPE_LAYOUT_ITEM, TRANSLATABLE_TYPE_CUSTOM_TITLE, TRANSLATABLE_TYPE_PRINT_LAYOUT, TRANSLATABLE_TYPE_REPORT, TRANSLATABLE_TYPE_TABLE, TRANSLATABLE_TYPE_BUTTON, TRANSLATABLE_TYPE_TEXTOBJECT, TRANSLATABLE_TYPE_IMAGEOBJECT, TRANSLATABLE_TYPE_CHOICEVALUE, TRANSLATABLE_TYPE_DATABASE_TITLE, TRANSLATABLE_TYPE_STATIC_TEXT }
typedef std::map< Glib::ustring, Glib::ustring > | type_map_locale_to_translations

## Public Member Functions
| Field ()
| Field (const Field& src)
| ~Field ()
Field& | operator= (const Field& src)
bool | operator== (const Field& src) const
bool | operator!= (const Field& src) const
Field* | clone () const
glom_field_type | get_glom_type () const
void | set_glom_type (glom_field_type fieldtype)
virtual Glib::ustring | get_name () const
| This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_name, so that we can use it in the same predicate template. More...
virtual void | set_name (const Glib::ustring& value)
| This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_name, for convenience. More...
bool | get_auto_increment () const
| This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_auto_increment. More...
void | set_auto_increment (bool val=true)
| This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_auto_increment. More...
bool | get_primary_key () const
| This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_primary_key. More...
void | set_primary_key (bool val=true)
| This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_primary_key. More...
bool | get_unique_key () const
| This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_unique_key. More...
void | set_unique_key (bool val=true)
| This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_unique_key. More...
Gnome::Gda::Value | get_default_value () const
| This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_default_value. More...
void | set_default_value (const Gnome::Gda::Value& value)
| This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_default_value. More...
Glib::RefPtr< Gnome::Gda::Column > | get_field_info ()
Glib::RefPtr< const Gnome::Gda::Column > | get_field_info () const
void | set_field_info (const Glib::RefPtr< Gnome::Gda::Column >& fieldInfo)
bool | field_info_from_database_is_equal (const Glib::RefPtr< const Gnome::Gda::Column >& field)
| Ignores any part of FieldAttributes that libgda does not properly fill. More...
bool | get_is_lookup () const
sharedptr< Relationship > | get_lookup_relationship () const
void | set_lookup_relationship (const sharedptr< Relationship >& strRelationship)
Glib::ustring | get_lookup_field () const
void | set_lookup_field (const Glib::ustring& strField)
Glib::ustring | get_sql_type () const
Glib::ustring | get_gda_type_name () const
Glib::ustring | sql (const Gnome::Gda::Value& value, const Glib::RefPtr< Gnome::Gda::Connection >& connection) const
| Escape and quote the value so that it can be used in a SQL command. More...
Glib::ustring | to_file_format (const Gnome::Gda::Value& value) const
| Get the canonical format for a file, for instance for a default value or for example data. More...
Gnome::Gda::Value | from_file_format (const Glib::ustring& str, bool& success) const
| Parse the value from the canonical file format. More...
Glib::ustring | sql_find (const Gnome::Gda::Value& value, const Glib::RefPtr< Gnome::Gda::Connection >& connection) const
| Escape the value so that it can be used in a SQL command for a find. More...
Gnome::Gda::SqlOperatorType | sql_find_operator () const
| Get a suitable operator to use when finding records. More...
Glib::ustring | get_calculation () const
void | set_calculation (const Glib::ustring& calculation)
bool | get_has_calculation () const
type_list_strings | get_calculation_relationships () const
void | set_visible (bool val=true)
bool | get_visible () const
Public Member Functions inherited from Glom::TranslatableItem
| TranslatableItem ()
| TranslatableItem (const TranslatableItem& src)
virtual | ~TranslatableItem ()
TranslatableItem& | operator= (const TranslatableItem& src)
bool | operator== (const TranslatableItem& src) const
bool | operator!= (const TranslatableItem& src) const
bool | get_name_not_empty () const
virtual Glib::ustring | get_title_or_name (const Glib::ustring& locale) const
virtual Glib::ustring | get_title (const Glib::ustring& locale) const
| Get the title's translation for the specified locale, falling back to the original text if there is no translation. More...
virtual Glib::ustring | get_title_original () const
| Get the title's original (non-translated, usually English) text. More...
Glib::ustring | get_title_translation (const Glib::ustring& locale, bool fallback=true) const
| Get the title's translation for the specified locale, optionally falling back to a locale of the same language, and then falling back to the original. More...
void | set_title (const Glib::ustring& title, const Glib::ustring& locale)
| Set the title's translation for the specified locale. More...
void | set_title_original (const Glib::ustring& title)
| Set the title's original (non-translated, usually English) text. More...
void | clear_title_in_all_locales ()
| Clear the original title and any translations of the title. More...
bool | get_has_translations () const
enumTranslatableItemType | get_translatable_item_type () const

## Static Public Member Functions
static Glib::ustring | to_file_format (const Gnome::Gda::Value& value, glom_field_type glom_type)
| See to_file_format(const Gnome::Gda::Value& value). More...
static Gnome::Gda::Value | from_file_format (const Glib::ustring& str, glom_field_type glom_type, bool& success, bool old_image_format=false)
static type_map_type_names | get_type_names ()
| Get canonical type names for internal use, such as in the XML of the document. More...
static type_map_type_names | get_type_names_ui ()
| Get translated type names. More...
static type_map_type_names | get_usable_type_names ()
| Get translated type names of types that should be offered to the user. More...
static Glib::ustring | get_type_name_ui (glom_field_type glom_type)
| Get the translated name for a glom type. More...
static glom_field_type | get_type_for_ui_name (const Glib::ustring& glom_type)
| Get the type from a translated name. More...
static glom_field_type | get_glom_type_for_gda_type (GType gda_type)
static GType | get_gda_type_for_glom_type (Field::glom_field_type glom_type)
static bool | get_conversion_possible (glom_field_type field_type_src, glom_field_type field_type_dest)
Static Public Member Functions inherited from Glom::TranslatableItem
static Glib::ustring | get_translatable_type_name (enumTranslatableItemType item_type)
static Glib::ustring | get_translatable_type_name_nontranslated (enumTranslatableItemType item_type)
| The non-translated name is used for the context in gettext .po files. More...

## Public Attributes
Formatting | m_default_formatting

## Additional Inherited Members
Protected Attributes inherited from Glom::TranslatableItem
enumTranslatableItemType | m_translatable_item_type

## Member Typedef Documentation

typedef std::vector<Glib::ustring> Glom::Field::type_list_strings

typedef std::map<glom_field_type, Glib::ustring> Glom::Field::type_map_type_names

## Member Enumeration Documentation

enum Glom::Field::glom_field_type

Enumerator
TYPE_INVALID |
TYPE_NUMERIC |
TYPE_TEXT |
TYPE_DATE |
TYPE_TIME |
TYPE_BOOLEAN |
TYPE_IMAGE |

enum Glom::Field::sql_format

Enumerator
SQL_FORMAT_POSTGRES |
SQL_FORMAT_SQLITE |

## Constructor & Destructor Documentation

Glom::Field::Field | ( |  | ) |

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

Glom::Field::~Field | ( |  | ) |

## Member Function Documentation

Field* Glom::Field::clone | ( |  | ) | const

bool Glom::Field::field_info_from_database_is_equal | ( | const Glib::RefPtr< const Gnome::Gda::Column > & | field | ) |

Ignores any part of FieldAttributes that libgda does not properly fill.

Gnome::Gda::Value Glom::Field::from_file_format | ( | const Glib::ustring & | str,
|  | bool & | success
| ) |  | const

Parse the value from the canonical file format.

See to_file_format() This does note remove quotes from text values so the caller may need to do that.

static Gnome::Gda::Value Glom::Field::from_file_format | ( | const Glib::ustring & | str,
|  | glom_field_type | glom_type,
|  | bool & | success,
|  | bool | old_image_format = `false`
| ) |  |
| static

bool Glom::Field::get_auto_increment | ( |  | ) | const

This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_auto_increment.

Glib::ustring Glom::Field::get_calculation | ( |  | ) | const

type_list_strings Glom::Field::get_calculation_relationships | ( |  | ) | const

static bool Glom::Field::get_conversion_possible | ( | glom_field_type | field_type_src,
|  | glom_field_type | field_type_dest
| ) |  |
| static

Gnome::Gda::Value Glom::Field::get_default_value | ( |  | ) | const

This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_default_value.

Glib::RefPtr<Gnome::Gda::Column> Glom::Field::get_field_info | ( |  | ) |

Glib::RefPtr<const Gnome::Gda::Column> Glom::Field::get_field_info | ( |  | ) | const

static GType Glom::Field::get_gda_type_for_glom_type | ( | Field::glom_field_type | glom_type | ) |
| static

Glib::ustring Glom::Field::get_gda_type_name | ( |  | ) | const

glom_field_type Glom::Field::get_glom_type | ( |  | ) | const

static glom_field_type Glom::Field::get_glom_type_for_gda_type | ( | GType | gda_type | ) |
| static

bool Glom::Field::get_has_calculation | ( |  | ) | const

bool Glom::Field::get_is_lookup | ( |  | ) | const

Glib::ustring Glom::Field::get_lookup_field | ( |  | ) | const

sharedptr<Relationship> Glom::Field::get_lookup_relationship | ( |  | ) | const

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

This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_name, so that we can use it in the same predicate template.

Reimplemented from Glom::TranslatableItem.

bool Glom::Field::get_primary_key | ( |  | ) | const

This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_primary_key.

Glib::ustring Glom::Field::get_sql_type | ( |  | ) | const

static glom_field_type Glom::Field::get_type_for_ui_name | ( | const Glib::ustring & | glom_type | ) |
| static

Get the type from a translated name.

static Glib::ustring Glom::Field::get_type_name_ui | ( | glom_field_type | glom_type | ) |
| static

Get the translated name for a glom type.

static type_map_type_names Glom::Field::get_type_names | ( |  | ) |
| static

Get canonical type names for internal use, such as in the XML of the document.

static type_map_type_names Glom::Field::get_type_names_ui | ( |  | ) |
| static

Get translated type names.

bool Glom::Field::get_unique_key | ( |  | ) | const

This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_unique_key.

static type_map_type_names Glom::Field::get_usable_type_names | ( |  | ) |
| static

Get translated type names of types that should be offered to the user.

bool Glom::Field::get_visible | ( |  | ) | const

bool Glom::Field::operator!= | ( | const Field& | src | ) | const

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

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

void Glom::Field::set_auto_increment | ( | bool | val = `true` | ) |

This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_auto_increment.

void Glom::Field::set_calculation | ( | const Glib::ustring & | calculation | ) |

void Glom::Field::set_default_value | ( | const Gnome::Gda::Value & | value | ) |

This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_default_value.

void Glom::Field::set_field_info | ( | const Glib::RefPtr< Gnome::Gda::Column > & | fieldInfo | ) |

void Glom::Field::set_glom_type | ( | glom_field_type | fieldtype | ) |

void Glom::Field::set_lookup_field | ( | const Glib::ustring & | strField | ) |

void Glom::Field::set_lookup_relationship | ( | const sharedptr< Relationship >& | strRelationship | ) |

virtual void Glom::Field::set_name | ( | const Glib::ustring & | value | ) |
| virtual

This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_name, for convenience.

Reimplemented from Glom::TranslatableItem.

void Glom::Field::set_primary_key | ( | bool | val = `true` | ) |

This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_primary_key.

void Glom::Field::set_unique_key | ( | bool | val = `true` | ) |

This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_unique_key.

void Glom::Field::set_visible | ( | bool | val = `true` | ) |

Glib::ustring Glom::Field::sql | ( | const Gnome::Gda::Value & | value,
|  | const Glib::RefPtr< Gnome::Gda::Connection > & | connection
| ) |  | const

Escape and quote the value so that it can be used in a SQL command.

Glib::ustring Glom::Field::sql_find | ( | const Gnome::Gda::Value & | value,
|  | const Glib::RefPtr< Gnome::Gda::Connection > & | connection
| ) |  | const

Escape the value so that it can be used in a SQL command for a find.

Gnome::Gda::SqlOperatorType Glom::Field::sql_find_operator | ( |  | ) | const

Get a suitable operator to use when finding records.

For instance, == for numbers, or LIKE for text.

Glib::ustring Glom::Field::to_file_format | ( | const Gnome::Gda::Value & | value | ) | const

Get the canonical format for a file, for instance for a default value or for example data.

This does not add quotes for text fields so the caller may need to do that. Note that this does not do any extra escaping such as an XML file might need. However, this will escape data as per the CSV RFC.

static Glib::ustring Glom::Field::to_file_format | ( | const Gnome::Gda::Value & | value,
|  | glom_field_type | glom_type
| ) |  |
| static

See to_file_format(const Gnome::Gda::Value& value).

## Member Data Documentation

Formatting Glom::Field::m_default_formatting

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

- libglom/data_structure/field.h