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
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::{Annot, AnnotCalloutLine, AnnotFreeTextQuadding, AnnotMarkup};
use glib::translate::*;
use std::fmt;

glib::wrapper! {
    ///
    ///
    /// # Implements
    ///
    /// [`AnnotMarkupExt`][trait@crate::prelude::AnnotMarkupExt], [`AnnotExt`][trait@crate::prelude::AnnotExt]
    #[doc(alias = "PopplerAnnotFreeText")]
    pub struct AnnotFreeText(Object<ffi::PopplerAnnotFreeText>) @extends AnnotMarkup, Annot;

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

impl AnnotFreeText {
    /// Retrieves a [`AnnotCalloutLine`][crate::AnnotCalloutLine] of four or six numbers specifying a callout
    /// line attached to the `self`.
    ///
    /// # Returns
    ///
    /// a new allocated [`AnnotCalloutLine`][crate::AnnotCalloutLine] if the annot has a callout
    ///  line, [`None`] in other case. It must be freed with `g_free()` when
    ///  done.
    #[doc(alias = "poppler_annot_free_text_get_callout_line")]
    #[doc(alias = "get_callout_line")]
    pub fn callout_line(&self) -> Option<AnnotCalloutLine> {
        unsafe {
            from_glib_full(ffi::poppler_annot_free_text_get_callout_line(
                self.to_glib_none().0,
            ))
        }
    }

    /// Retrieves the justification of the text of `self`.
    ///
    /// # Returns
    ///
    /// [`AnnotFreeTextQuadding`][crate::AnnotFreeTextQuadding] of `self`.
    #[doc(alias = "poppler_annot_free_text_get_quadding")]
    #[doc(alias = "get_quadding")]
    pub fn quadding(&self) -> AnnotFreeTextQuadding {
        unsafe {
            from_glib(ffi::poppler_annot_free_text_get_quadding(
                self.to_glib_none().0,
            ))
        }
    }
}

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