libglom-1.16 1.16.3
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes

Glom::Field Class Reference

Inheritance diagram for Glom::Field:
Inheritance graph
[legend]
Collaboration diagram for Glom::Field:
Collaboration graph
[legend]

List of all members.

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::list< Glib::ustringtype_list_strings
typedef std::map
< glom_field_type,
Glib::ustring
type_map_type_names

Public Member Functions

 Field ()
 Field (const Field& src)
 ~Field ()
Fieldoperator= (const Field& src)
bool operator== (const Field& src) const
bool operator!= (const Field& src) const
Fieldclone () 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.
virtual void set_name (const Glib::ustring&value)
 This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_name, for convenience.
bool get_auto_increment () const
 This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_auto_increment.
void set_auto_increment (bool val=true)
 This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_auto_increment.
bool get_primary_key () const
 This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_primary_key.
void set_primary_key (bool val=true)
 This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_primary_key.
bool get_unique_key () const
 This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_unique_key.
void set_unique_key (bool val=true)
 This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_unique_key.
Gnome::Gda::Value get_default_value () const
 This forwards to the Glib::RefPtr<Gnome::Gda::Column>::get_default_value.
void set_default_value (const Gnome::Gda::Value&value)
 This forwards to the Glib::RefPtr<Gnome::Gda::Column>::set_default_value.
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.
bool get_is_lookup () const
sharedptr< Relationshipget_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::RefPtr< Gnome::Gda::Holder > get_holder (const Gnome::Gda::Value&value, const Glib::ustring& name=Glib::ustring()) const
 A convenience when using parameters with a libgda SQL query.
Glib::ustring get_gda_holder_string (const Glib::ustring& name=Glib::ustring()) const
 TODO: Documentation.
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.
Glib::ustring sql (const Gnome::Gda::Value&value) const
 Escape and quote the value so that it can be used in a SQL command.
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.
Gnome::Gda::Value from_file_format (const Glib::ustring& str, bool& success) const
 Parse the value from the canonical file format.
Glib::ustring sql_find (const Gnome::Gda::Value&value) const
 Escape the value so that it can be used in a SQL command for a find.
Gnome::Gda::SqlOperatorType sql_find_operator () const
 Get a suitable operator to use when finding records.
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

Static Public Member Functions

static Glib::ustring to_file_format (const Gnome::Gda::Value&value, glom_field_type glom_type)
static Gnome::Gda::Value from_file_format (const Glib::ustring& str, glom_field_type glom_type, bool& success)
static type_map_type_names get_type_names ()
 Get canonical type names for internal use, such as in the XML of the document.
static type_map_type_names get_type_names_ui ()
 Get translated type names.
static type_map_type_names get_usable_type_names ()
 Get translated type names of types that should be offered to the user.
static Glib::ustring get_type_name_ui (glom_field_type glom_type)
 Get the translated name for a glom type.
static glom_field_type get_type_for_ui_name (const Glib::ustring& glom_type)
 Get the type from a translated name.
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)

Public Attributes

FieldFormatting m_default_formatting

Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
TYPE_INVALID 
TYPE_NUMERIC 
TYPE_TEXT 
TYPE_DATE 
TYPE_TIME 
TYPE_BOOLEAN 
TYPE_IMAGE 
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 
) [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
Glib::ustring Glom::Field::get_gda_holder_string ( const Glib::ustring name = Glib::ustring()) const

TODO: Documentation.

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
Glib::RefPtr<Gnome::Gda::Holder> Glom::Field::get_holder ( const Gnome::Gda::Value &  value,
const Glib::ustring name = Glib::ustring() 
) const

A convenience when using parameters with a libgda SQL query.

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

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

Uses the sql_format of the current connectionpool backend.

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

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.

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

Member Data Documentation


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