## RBQueryCreator RBQueryCreator — database query creator widget |

## Functions

GtkWidget * | rb_query_creator_new ()
GtkWidget * | rb_query_creator_new_from_query ()
GPtrArray * | rb_query_creator_get_query ()
void | rb_query_creator_get_limit ()
void | rb_query_creator_get_sort_order ()

## Properties

gboolean | creating | Read / Write / Construct Only
RhythmDB * | db | Read / Write / Construct Only

## Types and Values

struct | RBQueryCreator
struct | RBQueryCreatorClass

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBin
                        ╰── GtkWindow
                            ╰── GtkDialog
                                ╰── RBQueryCreator

## Implemented Interfaces

RBQueryCreator implements AtkImplementorIface and GtkBuildable.

## Description

The query creator is used to create and edit automatic playlists. It is only capable of constructing queries that consist of a flat list of criteria. It cannot nested criteria or represent full boolean logic expressions.

In addition to query criteria, the query creator also allows the user to specify limits on the size of the result set, in terms of the number of entries, the total duration, or the total file size; and also the order in which the results are to be sorted.

The structure of the query creator is defined in the builder file create-playlist.ui.

## Functions

### rb_query_creator_new ()

    GtkWidget *
    rb_query_creator_new (RhythmDB *db);

Creates a new query creator widget.

#### Parameters

db | the RhythmDB instance |

#### Returns

new query creator widget

### rb_query_creator_new_from_query ()

    GtkWidget *
    rb_query_creator_new_from_query (RhythmDB *db,
                                     GPtrArray *query,
                                     RhythmDBQueryModelLimitType limit_type,
                                     GVariant *limit_value,
                                     const char *sort_column,
                                     gint sort_direction);

Constructs a new query creator with an existing query and limit and sort settings.

#### Parameters

db | the RhythmDB instance |
query | an existing query to start from |
limit_type | the type of result set limit |
limit_value | the result set limit value |
sort_column | the column on which to sort query results |
sort_direction | the direction in which to sort query results |

#### Returns

new query creator widget

### rb_query_creator_get_query ()

    GPtrArray *
    rb_query_creator_get_query (RBQueryCreator *creator);

Constructs a database query that represents the criteria in the query creator.

#### Parameters

creator | RBQueryCreator instance |

#### Returns

database query array.

[transfer full]

### rb_query_creator_get_limit ()

    void
    rb_query_creator_get_limit (RBQueryCreator *creator,
                                RhythmDBQueryModelLimitType *type,
                                GVariant **limit);

Retrieves the limit type and value from the query creator.

#### Parameters

creator | RBQueryCreator instance |
type | used to return the limit type. | [out]
limit | used to return the limit value. | [out]

### rb_query_creator_get_sort_order ()

    void
    rb_query_creator_get_sort_order (RBQueryCreator *creator,
                                     const char **sort_key,
                                     gint *sort_direction);

Retrieves the sort settings from the query creator. The sort direction is returned as a GtkSortType value.

#### Parameters

creator | RBQueryCreator instance |
sort_key | returns the sort key name. | [out][allow-none]
sort_direction | returns the sort direction. | [out][allow-none]

## Types and Values

### struct RBQueryCreator

    struct RBQueryCreator;

### struct RBQueryCreatorClass

    struct RBQueryCreatorClass {
    	GtkDialogClass parent_class;
    };

## Property Details

### The `“creating”` property

      “creating”                 gboolean

TRUE if a new playlist is being created.

Flags: Read / Write / Construct Only

Default value: TRUE

### The `“db”` property

      “db”                       RhythmDB *

The RhythmDB instance

Flags: Read / Write / Construct Only