Gda.Set¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Description |
||
w/co |
|
||
r/w |
Id |
||
r/w |
Name |
||
r/w |
Defines if the validate-set signal is emitted |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Gets emitted when an attribute for any of the |
|
Gets emitted when holder in set has its type finally set, in case it was #GDA_TYPE_NULL |
|
Gets emitted when set's public data ( |
|
Gets emitted when the data model in source has changed |
|
Gets emitted when a |
|
Gets emitted when |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
groups_list |
r |
list of |
|
holders |
r |
list of |
|
nodes_list |
r |
list of |
|
object |
r |
||
sources_list |
r |
list of |
Class Details¶
- class Gda.Set(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(holders)¶
- Parameters:
holders ([
Gda.Holder
]) – a list ofGda.Holder
objects- Returns:
a new
Gda.Set
object- Return type:
Creates a new
Gda.Set
object, and populates it with the list given as argument. The list can then be freed as it is copied. All the value holders in holders are referenced counted and modified, so they should not be used anymore afterwards.
- classmethod new_from_spec_node(xml_spec)¶
- Parameters:
xml_spec (
libxml2.NodePtr
) – alibxml2.NodePtr
for a <parameters> tag- Raises:
- Returns:
a new object, or
None
if an error occurred- Return type:
Creates a new
Gda.Set
object from the xml_spec specifications
- classmethod new_from_spec_string(xml_spec)¶
- Parameters:
xml_spec (
str
) – a string- Raises:
- Returns:
a new object, or
None
if an error occurred- Return type:
Creates a new
Gda.Set
object from the xml_spec specifications
- classmethod new_read_only(holders)¶
- Parameters:
holders ([
Gda.Holder
]) – a list ofGda.Holder
objects- Returns:
a new
Gda.Set
object- Return type:
Creates a new
Gda.Set
likeGda.Set.new
(), but does not allow modifications to any of theGda.Holder
object in holders. This function is used for Libgda’s database providers’ implementation.New in version 4.2.
- add_holder(holder)¶
- Parameters:
holder (
Gda.Holder
) – aGda.Holder
object- Returns:
True
if holder has been added to self (andFalse
if it has not been added because there is anotherGda.Holder
with the same ID)- Return type:
Adds holder to the list of holders managed within self.
NOTE: if self already has a
Gda.Holder
with the same ID as holder, then holder will not be added to the set (even if holder's type or value is not the same as the one already in self).
- get_group(holder)¶
- Parameters:
holder (
Gda.Holder
) – aGda.Holder
object- Returns:
the requested
Gda.SetGroup
orNone
- Return type:
Finds a
Gda.SetGroup
which lists aGda.SetNode
containing holder, don’t modify the returned structure.
- get_holder(holder_id)¶
- Parameters:
holder_id (
str
) – the ID of the requested value holder- Returns:
the requested
Gda.Holder
orNone
- Return type:
Finds a
Gda.Holder
using its ID
- get_holder_value(holder_id)¶
- Parameters:
holder_id (
str
) – the ID of the holder to set the value- Returns:
the requested
GObject.Value
, orNone
(seeGda.Holder.get_value
())- Return type:
Get the value of the
Gda.Holder
which ID is holder_id
- get_node(holder)¶
- Parameters:
holder (
Gda.Holder
) – aGda.Holder
object- Returns:
the requested
Gda.SetNode
orNone
- Return type:
Finds a
Gda.SetNode
holding information for holder, don’t modify the returned structure
- get_nth_holder(pos)¶
- Parameters:
pos (
int
) – the position of the requestedGda.Holder
, starting at %0- Returns:
the requested
Gda.Holder
orNone
- Return type:
Finds a
Gda.Holder
using its positionNew in version 4.2.
- get_source(holder)¶
- Parameters:
holder (
Gda.Holder
) – aGda.Holder
object- Returns:
the requested
Gda.SetSource
orNone
- Return type:
Finds a
Gda.SetSource
which contains theGda.DataModel
restricting the possible values of holder, don’t modify the returned structure.
- get_source_for_model(model)¶
- Parameters:
model (
Gda.DataModel
) – aGda.DataModel
object- Returns:
the requested
Gda.SetSource
pointer orNone
.- Return type:
Finds the
Gda.SetSource
structure used in self for which model is a the data model (the returned structure should not be modified).
- is_valid()¶
- Raises:
- Returns:
True
if the set is valid- Return type:
This method tells if all self's
Gda.Holder
objects are valid, and if they represent a valid combination of values, as defined by rules external to Libgda: the “validate-set” signal is emitted and if none of the signal handlers return an error, then the returned value isTrue
, otherwise the return value isFalse
as soon as a signal handler returns an error.
- merge_with_set(set_to_merge)¶
-
Add to self all the holders of set_to_merge. Note1: only the
Gda.Holder
of set_to_merge for which no holder in self has the same ID are merged Note2: all theGda.Holder
merged in self are still used by set_to_merge.
- remove_holder(holder)¶
- Parameters:
holder (
Gda.Holder
) – theGda.Holder
to remove from self
Removes a
Gda.Holder
from the list of holders managed by self
- replace_source_model(source, model)¶
- Parameters:
source (
Gda.SetSource
) – a pointer to aGda.SetSource
in selfmodel (
Gda.DataModel
) – aGda.DataModel
Replaces source->data_model with model, which must have the same characteristics as source->data_model (same column types)
Also for each
Gda.Holder
for which source->data_model is a source model, this method callsGda.Holder.set_source_model
() with model to replace the source by the new modelNew in version 4.2.
- do_holder_attr_changed(holder, attr_name, attr_value) virtual¶
- Parameters:
holder (
Gda.Holder
) –attr_name (
str
) –attr_value (
GObject.Value
) –
- do_holder_changed(holder) virtual¶
- Parameters:
holder (
Gda.Holder
) –
- do_holder_type_set(holder) virtual¶
- Parameters:
holder (
Gda.Holder
) –
- do_public_data_changed() virtual¶
- do_source_model_changed(source) virtual¶
- Parameters:
source (
Gda.SetSource
) –
- do_validate_holder_change(holder, new_value) virtual¶
- Parameters:
holder (
Gda.Holder
) –new_value (
GObject.Value
) –
- Return type:
- do_validate_set() virtual¶
- Return type:
Signal Details¶
- Gda.Set.signals.holder_attr_changed(set, holder, attr_name, attr_value)¶
- Signal Name:
holder-attr-changed
- Flags:
- Parameters:
set (
Gda.Set
) – The object which received the signalholder (
Gda.Holder
) – theGda.Holder
for which an attribute changedattr_name (
str
) – attribute’s nameattr_value (
GObject.Value
) – attribute’s value
Gets emitted when an attribute for any of the
Gda.Holder
objects managed by set has changed
- Gda.Set.signals.holder_changed(set, object)¶
- Signal Name:
holder-changed
- Flags:
- Parameters:
set (
Gda.Set
) – The object which received the signalobject (
Gda.Holder
) –
- Gda.Set.signals.holder_type_set(set, holder)¶
- Signal Name:
holder-type-set
- Flags:
- Parameters:
set (
Gda.Set
) – The object which received the signalholder (
Gda.Holder
) – theGda.Holder
for which theGObject.GType
has been set
Gets emitted when holder in set has its type finally set, in case it was #GDA_TYPE_NULL
New in version 4.2.
- Gda.Set.signals.public_data_changed(set)¶
- Signal Name:
public-data-changed
- Flags:
- Parameters:
set (
Gda.Set
) – The object which received the signal
Gets emitted when set's public data (
Gda.SetNode
,Gda.SetGroup
orGda.SetSource
values) have changed
- Gda.Set.signals.source_model_changed(set, source)¶
- Signal Name:
source-model-changed
- Flags:
- Parameters:
set (
Gda.Set
) – The object which received the signalsource (
object
orNone
) – theGda.SetSource
for which the data_model attribute has changed
Gets emitted when the data model in source has changed
New in version 4.2.
- Gda.Set.signals.validate_holder_change(set, holder, new_value)¶
- Signal Name:
validate-holder-change
- Flags:
- Parameters:
set (
Gda.Set
) – The object which received the signalholder (
Gda.Holder
) – theGda.Holder
which is going to changenew_value (
GObject.Value
) – the proposed new value for holder
- Returns:
None
if holder is allowed to change its value to new_value, or aGLib.Error
otherwise.- Return type:
Gets emitted when a
Gda.Holder
's in set is going to change its value. One can connect to this signal to control which values holder can have (for example to implement some business rules)
- Gda.Set.signals.validate_set(set)¶
- Signal Name:
validate-set
- Flags:
- Parameters:
set (
Gda.Set
) – The object which received the signal- Returns:
None
if set's contents has been validated, or aGLib.Error
otherwise.- Return type:
Gets emitted when
Gda.Set.is_valid
() is called, use this signal to control which combination of values set's holder can have (for example to implement some business rules)
Property Details¶
- Gda.Set.props.description¶
-
Description
- Gda.Set.props.holders¶
- Name:
holders
- Type:
- Default Value:
- Flags:
Gda.Holder
objects the set should contain
- Gda.Set.props.validate_changes¶
-
Defines if the “validate-set” signal gets emitted when any holder in the data set changes. This property also affects the
Gda.Holder
:validate-changes
property.New in version 5.2.0.