AppStream.ComponentBox¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/co |
Component box flags |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
cpts |
[ |
r |
|
parent_instance |
r |
Class Details¶
- class AppStream.ComponentBox(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(flags)¶
- Parameters:
flags (
AppStream.ComponentBoxFlags) –- Returns:
- Return type:
Creates a new
AppStream.ComponentBox.New in version 1.0.
- classmethod new_simple()¶
- Returns:
- Return type:
Creates a new
AppStream.ComponentBoxwith the simplest parameters, so it is basically an array storage without overhead.Only the most basic checks on inserted components will be performed, and it is assumed that the inserted components have been checked already prior to insertion.
- add(cpt)¶
- Parameters:
cpt (
AppStream.Component) –- Raises:
- Returns:
Trueon success.- Return type:
Add a component to the box. Returns an error if we could not add it (most likely due to component box constraints).
- as_array()¶
- Returns:
an array of
AppStream.Componentinstances.- Return type:
Get the contents of this component box as
GLib.PtrArray.
- clear()¶
Remove all contents of this component box.
- get_flags()¶
- Returns:
The
AppStream.ComponentBoxFlagsthat are in effect.- Return type:
Get the flags this component box was constructed with.
- get_size()¶
- Returns:
Amount of components.
- Return type:
Get the amount of components in this box.
- index_safe(index)¶
- Parameters:
index (
int) – The component index.- Returns:
An
AppStream.ComponentorNone- Return type:
Retrieve a component at the respective index from the internal component array.
- is_empty()¶
-
Check if there are any components present.
- remove_at(index)¶
- Parameters:
index (
int) – the index of the component to remove.
Remove a component at the specified index. Please ensure that the index is not larger than
AppStream.ComponentBox.get_size() - 1
- sort()¶
Sort components to bring them into a deterministic order.
- sort_by_score()¶
Sort components by their (search) match score.
Property Details¶
- AppStream.ComponentBox.props.flags¶
- Name:
flags- Type:
- Default Value:
0- Flags:
Component box flags