1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files.git)
// DO NOT EDIT

use crate::FuzzyIndex;
use glib::{prelude::*, translate::*};
use std::fmt;

glib::wrapper! {
    ///
    ///
    /// ## Properties
    ///
    ///
    /// #### `case-sensitive`
    ///  Readable | Writeable | Construct Only
    ///
    ///
    /// #### `index`
    ///  Writeable | Construct Only
    ///
    ///
    /// #### `max-matches`
    ///  Readable | Writeable | Construct Only
    ///
    ///
    /// #### `query`
    ///  Readable | Writeable | Construct Only
    ///
    ///
    /// #### `tables`
    ///  Writeable | Construct Only
    ///
    /// # Implements
    ///
    /// [`trait@glib::ObjectExt`], [`trait@gio::prelude::ListModelExt`]
    #[doc(alias = "DzlFuzzyIndexCursor")]
    pub struct FuzzyIndexCursor(Object<ffi::DzlFuzzyIndexCursor, ffi::DzlFuzzyIndexCursorClass>) @implements gio::ListModel;

    match fn {
        type_ => || ffi::dzl_fuzzy_index_cursor_get_type(),
    }
}

impl FuzzyIndexCursor {
    /// Gets the index the cursor is iterating.
    ///
    /// # Returns
    ///
    /// A [`FuzzyIndex`][crate::FuzzyIndex].
    #[doc(alias = "dzl_fuzzy_index_cursor_get_index")]
    #[doc(alias = "get_index")]
    pub fn index(&self) -> Option<FuzzyIndex> {
        unsafe { from_glib_none(ffi::dzl_fuzzy_index_cursor_get_index(self.to_glib_none().0)) }
    }

    #[doc(alias = "case-sensitive")]
    pub fn is_case_sensitive(&self) -> bool {
        ObjectExt::property(self, "case-sensitive")
    }

    #[doc(alias = "max-matches")]
    pub fn max_matches(&self) -> u32 {
        ObjectExt::property(self, "max-matches")
    }

    pub fn query(&self) -> Option<glib::GString> {
        ObjectExt::property(self, "query")
    }
}

impl fmt::Display for FuzzyIndexCursor {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str("FuzzyIndexCursor")
    }
}