| Top |
XfceItemListModelXfceItemListModel — Model for XfceItemListView |
| gint | xfce_item_list_model_get_list_n_columns () |
| GType | xfce_item_list_model_get_list_column_type () |
| XfceItemListModelFlags | xfce_item_list_model_get_list_flags () |
| gint | xfce_item_list_model_get_n_items () |
| void | xfce_item_list_model_get_item_value () |
| void | xfce_item_list_model_move () |
| void | xfce_item_list_model_set_activity () |
| gboolean | xfce_item_list_model_remove () |
| void | xfce_item_list_model_reset () |
| void | xfce_item_list_model_set_index () |
| gint | xfce_item_list_model_get_index () |
| gboolean | xfce_item_list_model_test () |
| gboolean | xfce_item_list_model_test_any () |
| gboolean | xfce_item_list_model_test_all () |
| void | xfce_item_list_model_changed () |
| void | xfce_item_list_model_reloaded () |
| void | after-move-item | Run Last |
| void | after-remove-item | Run Last |
| void | before-move-item | Run Last |
| void | before-remove-item | Run Last |
| void | reloaded | Run Last |
GEnum ╰── XfceItemListModelColumn GFlags ╰── XfceItemListModelFlags GObject ╰── XfceItemListModel ╰── XfceItemListStore
XfceItemListModel implements GtkTreeModel, GtkTreeDragSource and GtkTreeDragDest.
A model that already implements the complex parts of the GtkTreeModel, and allows you to focus on your data.
You don't need to implement the GtkTreeModel, GtkTreeDragSource, GtkTreeDragDest methods yourself. You also shouldn't call signals from GtkTreeModel from overridden methods. However, if you define your new methods in a descendant class, then you must call the GtkTreeView signals yourself.
Not all virtual functions need to be implemented, depending on the value of the “list-flags” property.
gint
xfce_item_list_model_get_list_n_columns
(XfceItemListModel *model);
Since: 4.21.3
GType xfce_item_list_model_get_list_column_type (XfceItemListModel *model,gint column);
model |
||
column |
Columns from XfceItemListModelColumn, or custom columns after XFCE_ITEM_LIST_MODEL_COLUMN_USER |
Since: 4.21.3
XfceItemListModelFlags
xfce_item_list_model_get_list_flags (XfceItemListModel *model);
Since: 4.21.3
gint
xfce_item_list_model_get_n_items (XfceItemListModel *model);
Since: 4.21.3
void xfce_item_list_model_get_item_value (XfceItemListModel *model,gint index,gint column,GValue *value);
model |
||
index |
Item index |
|
column |
Columns from XfceItemListModelColumn, or custom columns after XFCE_ITEM_LIST_MODEL_COLUMN_USER |
|
value |
an empty GValue to set. |
[out][transfer none] |
Since: 4.21.3
void xfce_item_list_model_move (XfceItemListModel *model,gint source_index,gint dest_index);
Moves one item from the source_index
position to the dest_index
position
model |
||
source_index |
Index where the item will be taken from |
|
dest_index |
Index where the item will be inserted |
Since: 4.21.3
void xfce_item_list_model_set_activity (XfceItemListModel *model,gint index,gboolean value);
Since: 4.21.3
gboolean xfce_item_list_model_remove (XfceItemListModel *model,gint index);
Since: 4.21.3
void
xfce_item_list_model_reset (XfceItemListModel *model);
Since: 4.21.3
void xfce_item_list_model_set_index (XfceItemListModel *model,GtkTreeIter *iter,gint index);
model |
||
iter |
Iterator that will be set to the specified index |
|
index |
The index that will be set to the iterator |
Since: 4.21.3
gint xfce_item_list_model_get_index (XfceItemListModel *model,GtkTreeIter *iter);
Since: 4.21.3
gboolean xfce_item_list_model_test (XfceItemListModel *model,gint index,gint column);
Returns TRUE if the column value is TRUE.
Since: 4.21.3
gboolean xfce_item_list_model_test_any (XfceItemListModel *model,const gint *indexes,gint n_indexes,gint column);
Returns TRUE if there is at least one item with a column value of TRUE.
model |
||
indexes |
Item indexes |
|
n_indexes |
Number of indexes |
|
column |
Column with type boolean for test |
Since: 4.21.3
gboolean xfce_item_list_model_test_all (XfceItemListModel *model,const gint *indexes,gint n_indexes,gint column);
Returns TRUE if all columns of all items are TRUE, or n_indexes
is 0.
model |
||
indexes |
Item indexes |
|
n_indexes |
Number of indexes |
|
column |
Column with type boolean for test |
Since: 4.21.3
void
xfce_item_list_model_changed (XfceItemListModel *model);
Makes GtkTreeView think that all items have changed their value.
Since: 4.21.3
void
xfce_item_list_model_reloaded (XfceItemListModel *model);
Synchronizes GtkTreeView with the new state of the model after it has been reloaded.
Since: 4.21.3
struct XfceItemListModelClass {
gint (*get_list_n_columns) (XfceItemListModel *model);
GType (*get_list_column_type) (XfceItemListModel *model,
gint column);
gint (*get_n_items) (XfceItemListModel *model);
void (*get_item_value) (XfceItemListModel *model,
gint index,
gint column,
GValue *value);
void (*move) (XfceItemListModel *model,
gint source_index,
gint dest_index);
void (*set_activity) (XfceItemListModel *model,
gint index,
gboolean value);
gboolean (*remove) (XfceItemListModel *model,
gint index);
void (*reset) (XfceItemListModel *model);
};
You can override this method to add more columns |
||
You can override this method to add your own columns |
||
Required for implementation |
||
Required for implementation |
||
Method must be implemented if the XFCE_ITEM_LIST_MODEL_REORDERABLE flag is set |
||
Method must be implemented if there is at least one item with column XFCE_ITEM_LIST_MODEL_COLUMN_ACTIVABLE that is TRUE |
||
Method must be implemented if the XFCE_ITEM_LIST_MODEL_REMOVABLE flag is set |
||
Method must be implemented if the XFCE_ITEM_LIST_MODEL_RESETTABLE flag is set |
Since: 4.21.3
|
boolean, required. |
||
|
boolean, required. |
||
|
GIcon, required. |
||
|
string, markup, required. |
||
|
string, required. |
||
|
boolean, required if the XFCE_ITEM_LIST_MODEL_EDITABLE flag is set. |
||
|
boolean, required if the XFCE_ITEM_LIST_MODEL_REMOVABLE flag is set. |
||
|
If you need to add your own columns, then your first column should have this value. |
Since: 4.21.3
Specifies the model's capabilities
|
No additional features. |
||
|
The order of items can be changed. |
||
|
Items can be added. |
||
|
Items can be removed. |
||
|
An edit dialog can be opened for each item. |
||
|
A button "reset to default" will be offered. |
Since: 4.21.3
“list-flags” property“list-flags” XfceItemListModelFlags
Model feature flags, XfceItemListView automatically responds to their changes.
Owner: XfceItemListModel
Flags: Read / Write
Since: 4.21.3
“after-move-item” signalvoid user_function (XfceItemListModel *xfceitemlistmodel, int arg1, int arg2, gpointer user_data)
Flags: Run Last
“after-remove-item” signalvoid user_function (XfceItemListModel *xfceitemlistmodel, int arg1, gpointer user_data)
Flags: Run Last
“before-move-item” signalvoid user_function (XfceItemListModel *xfceitemlistmodel, int arg1, int arg2, gpointer user_data)
Flags: Run Last
“before-remove-item” signalvoid user_function (XfceItemListModel *xfceitemlistmodel, int arg1, gpointer user_data)
Flags: Run Last
“reloaded” signalvoid user_function (XfceItemListModel *xfceitemlistmodel, gpointer user_data)
Flags: Run Last