libappstream/auto/validator_issue.rs
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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
// 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::{ffi, IssueSeverity};
use glib::{prelude::*, translate::*};
glib::wrapper! {
///
///
/// # Implements
///
/// [`ValidatorIssueExt`][trait@crate::prelude::ValidatorIssueExt]
#[doc(alias = "AsValidatorIssue")]
pub struct ValidatorIssue(Object<ffi::AsValidatorIssue, ffi::AsValidatorIssueClass>);
match fn {
type_ => || ffi::as_validator_issue_get_type(),
}
}
impl ValidatorIssue {
pub const NONE: Option<&'static ValidatorIssue> = None;
/// Creates a new [`ValidatorIssue`][crate::ValidatorIssue].
///
/// # Returns
///
/// a [`ValidatorIssue`][crate::ValidatorIssue]
#[doc(alias = "as_validator_issue_new")]
pub fn new() -> ValidatorIssue {
assert_initialized_main_thread!();
unsafe { from_glib_full(ffi::as_validator_issue_new()) }
}
}
impl Default for ValidatorIssue {
fn default() -> Self {
Self::new()
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::IsA<super::ValidatorIssue>> Sealed for T {}
}
/// Trait containing all [`struct@ValidatorIssue`] methods.
///
/// # Implementors
///
/// [`ValidatorIssue`][struct@crate::ValidatorIssue]
pub trait ValidatorIssueExt: IsA<ValidatorIssue> + sealed::Sealed + 'static {
/// The component-id this issue is about.
///
/// # Returns
///
/// a component-id.
#[doc(alias = "as_validator_issue_get_cid")]
#[doc(alias = "get_cid")]
fn cid(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::as_validator_issue_get_cid(
self.as_ref().to_glib_none().0,
))
}
}
/// Get an extended explanation on this issue, or return [`None`]
/// if none is available.
///
/// # Returns
///
/// the explanation
#[doc(alias = "as_validator_issue_get_explanation")]
#[doc(alias = "get_explanation")]
fn explanation(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::as_validator_issue_get_explanation(
self.as_ref().to_glib_none().0,
))
}
}
/// The name of the file this issue was found in.
///
/// # Returns
///
/// the filename
#[doc(alias = "as_validator_issue_get_filename")]
#[doc(alias = "get_filename")]
fn filename(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::as_validator_issue_get_filename(
self.as_ref().to_glib_none().0,
))
}
}
/// Get a short context hint for this issue.
///
/// # Returns
///
/// the hint
#[doc(alias = "as_validator_issue_get_hint")]
#[doc(alias = "get_hint")]
fn hint(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::as_validator_issue_get_hint(
self.as_ref().to_glib_none().0,
))
}
}
/// Gets the line number where this issue was found.
///
/// # Returns
///
/// the line number where this issue occured, or -1 if unknown.
#[doc(alias = "as_validator_issue_get_line")]
#[doc(alias = "get_line")]
fn line(&self) -> libc::c_long {
unsafe { ffi::as_validator_issue_get_line(self.as_ref().to_glib_none().0) }
}
/// Builds a string containing all information about the location
/// where this issue occured that we know about.
///
/// # Returns
///
/// the location hint as string.
#[doc(alias = "as_validator_issue_get_location")]
#[doc(alias = "get_location")]
fn location(&self) -> Option<glib::GString> {
unsafe {
from_glib_full(ffi::as_validator_issue_get_location(
self.as_ref().to_glib_none().0,
))
}
}
/// Gets the severity of this issue.
///
/// # Returns
///
/// a [`IssueSeverity`][crate::IssueSeverity]
#[doc(alias = "as_validator_issue_get_severity")]
#[doc(alias = "get_severity")]
fn severity(&self) -> IssueSeverity {
unsafe {
from_glib(ffi::as_validator_issue_get_severity(
self.as_ref().to_glib_none().0,
))
}
}
/// Gets the issue tag string for this issue.
///
/// # Returns
///
/// the tag
#[doc(alias = "as_validator_issue_get_tag")]
#[doc(alias = "get_tag")]
fn tag(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::as_validator_issue_get_tag(
self.as_ref().to_glib_none().0,
))
}
}
/// Sets the component-id this issue is about.
/// ## `cid`
/// a component-id.
#[doc(alias = "as_validator_issue_set_cid")]
fn set_cid(&self, cid: &str) {
unsafe {
ffi::as_validator_issue_set_cid(self.as_ref().to_glib_none().0, cid.to_glib_none().0);
}
}
/// Set explanatory text for this issue.
/// ## `explanation`
/// the explanation.
#[doc(alias = "as_validator_issue_set_explanation")]
fn set_explanation(&self, explanation: &str) {
unsafe {
ffi::as_validator_issue_set_explanation(
self.as_ref().to_glib_none().0,
explanation.to_glib_none().0,
);
}
}
/// Sets the name of the file the issue was found in.
/// ## `fname`
/// the filename.
#[doc(alias = "as_validator_issue_set_filename")]
fn set_filename(&self, fname: &str) {
unsafe {
ffi::as_validator_issue_set_filename(
self.as_ref().to_glib_none().0,
fname.to_glib_none().0,
);
}
}
/// Sets short issue hint.
/// ## `hint`
/// the hint.
#[doc(alias = "as_validator_issue_set_hint")]
fn set_hint(&self, hint: &str) {
unsafe {
ffi::as_validator_issue_set_hint(self.as_ref().to_glib_none().0, hint.to_glib_none().0);
}
}
/// Sets the line number where this issue was found.
/// ## `line`
/// the line number.
#[doc(alias = "as_validator_issue_set_line")]
fn set_line(&self, line: libc::c_long) {
unsafe {
ffi::as_validator_issue_set_line(self.as_ref().to_glib_none().0, line);
}
}
/// Sets the severity for this issue.
/// ## `severity`
/// the [`IssueSeverity`][crate::IssueSeverity].
#[doc(alias = "as_validator_issue_set_severity")]
fn set_severity(&self, severity: IssueSeverity) {
unsafe {
ffi::as_validator_issue_set_severity(
self.as_ref().to_glib_none().0,
severity.into_glib(),
);
}
}
/// Sets the issue tag.
/// ## `tag`
/// the tag.
#[doc(alias = "as_validator_issue_set_tag")]
fn set_tag(&self, tag: &str) {
unsafe {
ffi::as_validator_issue_set_tag(self.as_ref().to_glib_none().0, tag.to_glib_none().0);
}
}
}
impl<O: IsA<ValidatorIssue>> ValidatorIssueExt for O {}