| Libfm Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | Signals | ||||
#define COL_FILE_UNSORTED FmFolderModel; struct FmFolderModelClass; enum FmFolderModelViewCol; void fm_folder_model_file_changed (FmFolderModel *model,FmFileInfo *file); void fm_folder_model_file_created (FmFolderModel *model,FmFileInfo *file); void fm_folder_model_file_deleted (FmFolderModel *model,FmFileInfo *file); gboolean fm_folder_model_find_iter_by_filename (FmFolderModel *model,GtkTreeIter *it,const char *name); FmFolder * fm_folder_model_get_folder (FmFolderModel *model); FmPath * fm_folder_model_get_folder_path (FmFolderModel *model); guint fm_folder_model_get_icon_size (FmFolderModel *model); gpointer fm_folder_model_get_item_userdata (FmFolderModel *model,GtkTreeIter *it); gboolean fm_folder_model_get_show_hidden (FmFolderModel *model); FmFolderModel * fm_folder_model_new (FmFolder *dir,gboolean show_hidden); void fm_folder_model_set_folder (FmFolderModel *model,FmFolder *dir); void fm_folder_model_set_icon_size (FmFolderModel *model,guint icon_size); void fm_folder_model_set_item_userdata (FmFolderModel *model,GtkTreeIter *it,gpointer user_data); void fm_folder_model_set_show_hidden (FmFolderModel *model,gboolean show_hidden);
FmFolderModel implements GtkTreeModel, GtkTreeSortable, GtkTreeDragSource and GtkTreeDragDest.
include: libfm/fm-folder-model.h
The FmFolderModel is used by widgets such as FmFolderView to arrange items of folder.
struct FmFolderModelClass {
GObjectClass parent;
void (*row_deleting)(FmFolderModel* model, GtkTreePath* tp,
GtkTreeIter* iter, gpointer data);
};
| the parent class | |
| the class closure for the "row-deleting" signal |
typedef enum {
COL_FILE_GICON = 0,
COL_FILE_ICON,
COL_FILE_NAME,
COL_FILE_SIZE,
COL_FILE_DESC,
COL_FILE_PERM,
COL_FILE_OWNER,
COL_FILE_MTIME,
COL_FILE_INFO,
} FmFolderModelViewCol;
Columns of folder view
| (GIcon *) icon image | |
| (FmIcon *) icon descriptor | |
| (gchar *) file name | |
| (gchar *) file size text | |
| (gchar *) file MIME description | |
| (gchar *) reserved, not implemented | |
| (gchar *) reserved, not implemented | |
| (gchar *) modification time text | |
| (FmFileInfo *) file info |
void fm_folder_model_file_changed (FmFolderModel *model,FmFileInfo *file);
Updates info for the file in the model.
|
a folder model instance |
|
a file into |
Since 0.1.0
void fm_folder_model_file_created (FmFolderModel *model,FmFileInfo *file);
Adds new created file into model.
|
the folder model instance |
|
new file into |
Since 0.1.0
void fm_folder_model_file_deleted (FmFolderModel *model,FmFileInfo *file);
Removes a file from model.
|
the folder model instance |
|
removed file into |
Since 0.1.0
gboolean fm_folder_model_find_iter_by_filename (FmFolderModel *model,GtkTreeIter *it,const char *name);
Searches model for existance of some file in it. If file was found
then sets it to match found file.
|
the folder model instance |
|
pointer to iterator to fill |
|
file name to search |
Returns : |
TRUE if file was found. |
Since 0.1.0
FmFolder * fm_folder_model_get_folder (FmFolderModel *model);
Retrieves a folder that model is created for. Returned data are owned
by the model and should not be freed by caller.
|
the folder model instance |
Returns : |
the folder descriptor. [transfer none] |
Since 1.0.0
FmPath * fm_folder_model_get_folder_path (FmFolderModel *model);
Retrieves path of folder that model is created for. Returned data
are owned by the model and should not be freed by caller.
|
the folder model instance |
Returns : |
the path of the folder of the model. [transfer none] |
Since 1.0.0
guint fm_folder_model_get_icon_size (FmFolderModel *model);
Retrieves the size of icons in model data.
|
the folder model instance |
Returns : |
size of icons in pixels. |
Since 0.1.0
gpointer fm_folder_model_get_item_userdata (FmFolderModel *model,GtkTreeIter *it);
Returns the data that was set by last call of
fm_folder_model_set_item_userdata() on that row.
|
the folder model instance |
|
iterator of row to retrieve data |
Returns : |
user data that was set on that row |
Since 1.0.0
gboolean fm_folder_model_get_show_hidden (FmFolderModel *model);
Retrieves info whether folder model includes hidden files.
|
the folder model instance |
Returns : |
TRUE if hidden files are visible within model. |
Since 0.1.0
FmFolderModel * fm_folder_model_new (FmFolder *dir,gboolean show_hidden);
Creates new folder model for the dir.
|
the folder to create model |
|
whether show hidden files initially or not |
Returns : |
a new FmFolderModel object. [transfer full] |
Since 0.1.0
void fm_folder_model_set_folder (FmFolderModel *model,FmFolder *dir);
Changes folder which model handles. This call allows reusing the model for different folder, in case, e.g. directory was changed.
|
a folder model instance |
|
a new folder for the model |
Since 0.1.0
void fm_folder_model_set_icon_size (FmFolderModel *model,guint icon_size);
Changes the size of icons in model data.
|
the folder model instance |
|
new size for icons in pixels |
Since 0.1.0
void fm_folder_model_set_item_userdata (FmFolderModel *model,GtkTreeIter *it,gpointer user_data);
Sets the data that can be retrieved by fm_folder_model_get_item_userdata().
|
the folder model instance |
|
iterator of row to set data |
|
user data that will be associated with the row |
Since 1.0.0
void fm_folder_model_set_show_hidden (FmFolderModel *model,gboolean show_hidden);
Changes visibility of hodden files within model.
|
the folder model instance |
|
whether show hidden files or not |
Since 0.1.0
"row-deleting" signalvoid user_function (FmFolderModel *model,
GtkTreePath *row,
GtkTreeIter *iter,
gpointer data,
gpointer user_data) : Run First
This signal is emitted before row is deleted.
It can be used if view has some data associated with the row so those data can be freed safely.
|
folder model instance that received the signal |
|
path to row that is about to be deleted |
|
iterator of row that is about to be deleted |
|
user data associated with the row |
|
user data set when the signal handler was connected. |
Since 1.0.0