## TrackerIndexingTree TrackerIndexingTree — Indexing tree handling |

## Synopsis

    struct              TrackerIndexingTree;
                        TrackerIndexingTreeClass;
    void                tracker_indexing_tree_add           (TrackerIndexingTree *tree,
                                                             GFile *directory,
                                                             TrackerDirectoryFlags flags);
    void                tracker_indexing_tree_add_filter    (TrackerIndexingTree *tree,
                                                             TrackerFilterType filter,
                                                             const gchar *glob_string);
    void                tracker_indexing_tree_clear_filters (TrackerIndexingTree *tree,
                                                             TrackerFilterType type);
    gboolean            tracker_indexing_tree_file_is_indexable
                                                            (TrackerIndexingTree *tree,
                                                             GFile *file,
                                                             GFileType file_type);
    gboolean            tracker_indexing_tree_file_is_root  (TrackerIndexingTree *tree,
                                                             GFile *file);
    gboolean            tracker_indexing_tree_file_matches_filter
                                                            (TrackerIndexingTree *tree,
                                                             TrackerFilterType type,
                                                             GFile *file);
    TrackerFilterPolicy tracker_indexing_tree_get_default_policy
                                                            (TrackerIndexingTree *tree,
                                                             TrackerFilterType filter);
    gboolean            tracker_indexing_tree_get_filter_hidden
                                                            (TrackerIndexingTree *tree);
    GFile *             tracker_indexing_tree_get_root      (TrackerIndexingTree *tree,
                                                             GFile *file,
                                                             TrackerDirectoryFlags *directory_flags);
    GList *             tracker_indexing_tree_list_roots    (TrackerIndexingTree *tree);
    TrackerIndexingTree * tracker_indexing_tree_new         (void);
    gboolean            tracker_indexing_tree_parent_is_indexable
                                                            (TrackerIndexingTree *tree,
                                                             GFile *parent,
                                                             GList *children);
    void                tracker_indexing_tree_remove        (TrackerIndexingTree *tree,
                                                             GFile *directory);
    void                tracker_indexing_tree_set_default_policy
                                                            (TrackerIndexingTree *tree,
                                                             TrackerFilterType filter,
                                                             TrackerFilterPolicy policy);
    void                tracker_indexing_tree_set_filter_hidden
                                                            (TrackerIndexingTree *tree,
                                                             gboolean filter_hidden);

## Object Hierarchy

      GObject
       +----TrackerIndexingTree

## Properties

      "filter-hidden"            gboolean              : Read / Write

## Signals

      "directory-added"                                : Run Last
      "directory-removed"                              : Run Last
      "directory-updated"                              : Run Last

## Description

TrackerIndexingTree handles the tree of directories configured to be indexed by the TrackerMinerFS.

## Details

### struct TrackerIndexingTree

    struct TrackerIndexingTree;

Base object used to configure indexing within TrackerMinerFS items.

### TrackerIndexingTreeClass

    typedef struct {
    	GObjectClass parent_class;

    	void (* directory_added)   (TrackerIndexingTree *indexing_tree,
    	                            GFile               *directory);
    	void (* directory_removed) (TrackerIndexingTree *indexing_tree,
    	                            GFile               *directory);
    	void (* directory_updated) (TrackerIndexingTree *indexing_tree,
    	                            GFile               *directory);
    } TrackerIndexingTreeClass;

Class for the TrackerIndexingTree.

GObjectClass `parent_class`; | parent object class
`directory_added` () | Called when a directory is added.
`directory_removed` () | Called when a directory is removed.
`directory_updated` () | Called when a directory is updated.

### tracker_indexing_tree_add ()

    void                tracker_indexing_tree_add           (TrackerIndexingTree *tree,
                                                             GFile *directory,
                                                             TrackerDirectoryFlags flags);

Adds a directory to the indexing tree with the given configuration flags.

`tree` : | a TrackerIndexingTree
`directory` : | GFile pointing to a directory
`flags` : | Configuration flags for the directory

### tracker_indexing_tree_add_filter ()

    void                tracker_indexing_tree_add_filter    (TrackerIndexingTree *tree,
                                                             TrackerFilterType filter,
                                                             const gchar *glob_string);

Adds a new filter for basenames.

`tree` : | a TrackerIndexingTree
`filter` : | filter type
`glob_string` : | glob-style string for the filter

### tracker_indexing_tree_clear_filters ()

    void                tracker_indexing_tree_clear_filters (TrackerIndexingTree *tree,
                                                             TrackerFilterType type);

Clears all filters of a given type.

`tree` : | a TrackerIndexingTree
`type` : | filter type to clear

### tracker_indexing_tree_file_is_indexable ()

    gboolean            tracker_indexing_tree_file_is_indexable
                                                            (TrackerIndexingTree *tree,
                                                             GFile *file,
                                                             GFileType file_type);

returns `TRUE` if `file` should be indexed according to the parameters given through `tracker_indexing_tree_add()` and `tracker_indexing_tree_add_filter()`.

If `file_type` is G_FILE_TYPE_UNKNOWN, file type will be queried to the file system.

`tree` : | a TrackerIndexingTree
`file` : | a GFile
`file_type` : | a GFileType
Returns : | `TRUE` if `file` should be indexed.

### tracker_indexing_tree_file_is_root ()

    gboolean            tracker_indexing_tree_file_is_root  (TrackerIndexingTree *tree,
                                                             GFile *file);

### tracker_indexing_tree_file_matches_filter ()

    gboolean            tracker_indexing_tree_file_matches_filter
                                                            (TrackerIndexingTree *tree,
                                                             TrackerFilterType type,
                                                             GFile *file);

Returns `TRUE` if `file` matches any filter of the given filter type.

`tree` : | a TrackerIndexingTree
`type` : | filter type
`file` : | a GFile
Returns : | `TRUE` if `file` is filtered

### tracker_indexing_tree_get_default_policy ()

    TrackerFilterPolicy tracker_indexing_tree_get_default_policy
                                                            (TrackerIndexingTree *tree,
                                                             TrackerFilterType filter);

### tracker_indexing_tree_get_filter_hidden ()

    gboolean            tracker_indexing_tree_get_filter_hidden
                                                            (TrackerIndexingTree *tree);

### tracker_indexing_tree_get_root ()

    GFile *             tracker_indexing_tree_get_root      (TrackerIndexingTree *tree,
                                                             GFile *file,
                                                             TrackerDirectoryFlags *directory_flags);

Returns the GFile that was previously added through `tracker_indexing_tree_add()` and would equal or contain `file`, or `NULL` if none applies.

If the return value is non-`NULL`, `directory_flags` would contain the TrackerDirectoryFlags applying to `file`.

`tree` : | a TrackerIndexingTree
`file` : | a GFile
`directory_flags` : | return location for the applying TrackerDirectoryFlags. [out]
Returns : | the effective parent in `tree`, or `NULL`. [transfer none]

### tracker_indexing_tree_list_roots ()

    GList *             tracker_indexing_tree_list_roots    (TrackerIndexingTree *tree);

Returns the list of indexing roots in `tree`

`tree` : | a TrackerIndexingTree
Returns : | The list of roots, the list itself must be freed with `g_list_free()`, the list elements are owned by `tree` and should not be freed. [transfer container][element-type GFile]

### tracker_indexing_tree_new ()

    TrackerIndexingTree * tracker_indexing_tree_new         (void);

Returns a newly created TrackerIndexingTree

Returns : | a newly allocated TrackerIndexingTree

### tracker_indexing_tree_parent_is_indexable ()

    gboolean            tracker_indexing_tree_parent_is_indexable
                                                            (TrackerIndexingTree *tree,
                                                             GFile *parent,
                                                             GList *children);

returns `TRUE` if `parent` should be indexed based on its contents.

`tree` : | a TrackerIndexingTree
`parent` : | parent directory
`children` : | children within `parent`. [element-type GFile]
Returns : | `TRUE` if `parent` should be indexed.

### tracker_indexing_tree_remove ()

    void                tracker_indexing_tree_remove        (TrackerIndexingTree *tree,
                                                             GFile *directory);

Removes `directory` from the indexing tree, note that only directories previously added with `tracker_indexing_tree_add()` can be effectively removed.

`tree` : | a TrackerIndexingTree
`directory` : | GFile pointing to a directory

### tracker_indexing_tree_set_default_policy ()

    void                tracker_indexing_tree_set_default_policy
                                                            (TrackerIndexingTree *tree,
                                                             TrackerFilterType filter,
                                                             TrackerFilterPolicy policy);

### tracker_indexing_tree_set_filter_hidden ()

    void                tracker_indexing_tree_set_filter_hidden
                                                            (TrackerIndexingTree *tree,
                                                             gboolean filter_hidden);

## Property Details

### The `"filter-hidden"` property

      "filter-hidden"            gboolean              : Read / Write

Whether hidden resources are filtered.

Default value: FALSE

## Signal Details

### The `"directory-added"` signal

    void                user_function                      (TrackerIndexingTree *trackerindexingtree,
                                                            GFile               *arg1,
                                                            gpointer             user_data)                : Run Last

`trackerindexingtree` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"directory-removed"` signal

    void                user_function                      (TrackerIndexingTree *trackerindexingtree,
                                                            GFile               *arg1,
                                                            gpointer             user_data)                : Run Last

`trackerindexingtree` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"directory-updated"` signal

    void                user_function                      (TrackerIndexingTree *trackerindexingtree,
                                                            GFile               *arg1,
                                                            gpointer             user_data)                : Run Last

`trackerindexingtree` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.