libappstream/auto/
component.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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
// 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, Agreement, AgreementKind, Branding, Bundle, BundleKind, Category, ComponentKind,
    ComponentScope, ContentRating, Context, FormatKind, Icon, Launchable, LaunchableKind,
    MergeKind, Provided, ProvidedKind, Relation, Release, ReleaseList, Review, Screenshot,
    Suggested, Translation, UrlKind,
};
use glib::{
    prelude::*,
    signal::{connect_raw, SignalHandlerId},
    translate::*,
};
use std::boxed::Box as Box_;

glib::wrapper! {
    ///
    ///
    /// ## Properties
    ///
    ///
    /// #### `categories`
    ///  string array of categories
    ///
    /// Readable
    ///
    ///
    /// #### `description`
    ///  the description
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `icons`
    ///  hash map of icon urls and sizes
    ///
    /// Readable
    ///
    ///
    /// #### `id`
    ///  the unique identifier
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `keywords`
    ///  string array of keywords
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `kind`
    ///  the [`ComponentKind`][crate::ComponentKind] of this component
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `name`
    ///  the name
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `pkgnames`
    ///  string array of packages name
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `project-group`
    ///  the project group
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `project-license`
    ///  the project license
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `screenshots`
    ///  An array of [`Screenshot`][crate::Screenshot] instances
    ///
    /// Readable
    ///
    ///
    /// #### `summary`
    ///  the summary
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `urls`
    ///  the urls associated with this component
    ///
    /// Readable
    ///
    /// # Implements
    ///
    /// [`ComponentExt`][trait@crate::prelude::ComponentExt]
    #[doc(alias = "AsComponent")]
    pub struct Component(Object<ffi::AsComponent, ffi::AsComponentClass>);

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

impl Component {
    pub const NONE: Option<&'static Component> = None;

    /// Creates a new [`Component`][crate::Component].
    ///
    /// # Returns
    ///
    /// a new [`Component`][crate::Component]
    #[doc(alias = "as_component_new")]
    pub fn new() -> Component {
        assert_initialized_main_thread!();
        unsafe { from_glib_full(ffi::as_component_new()) }
    }
}

impl Default for Component {
    fn default() -> Self {
        Self::new()
    }
}

impl std::fmt::Display for Component {
    #[inline]
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        f.write_str(&ComponentExt::to_str(self))
    }
}

mod sealed {
    pub trait Sealed {}
    impl<T: super::IsA<super::Component>> Sealed for T {}
}

/// Trait containing all [`struct@Component`] methods.
///
/// # Implementors
///
/// [`Component`][struct@crate::Component]
pub trait ComponentExt: IsA<Component> + sealed::Sealed + 'static {
    /// Add a reference to the addon that is enhancing this component.
    /// ## `addon`
    /// The [`Component`][crate::Component] that extends `self`
    #[doc(alias = "as_component_add_addon")]
    fn add_addon(&self, addon: &impl IsA<Component>) {
        unsafe {
            ffi::as_component_add_addon(
                self.as_ref().to_glib_none().0,
                addon.as_ref().to_glib_none().0,
            );
        }
    }

    /// Adds an agreement to the software component.
    /// ## `agreement`
    /// an [`Agreement`][crate::Agreement] instance.
    #[doc(alias = "as_component_add_agreement")]
    fn add_agreement(&self, agreement: &impl IsA<Agreement>) {
        unsafe {
            ffi::as_component_add_agreement(
                self.as_ref().to_glib_none().0,
                agreement.as_ref().to_glib_none().0,
            );
        }
    }

    /// Adds a bundle to the component.
    /// ## `bundle`
    /// The [`Bundle`][crate::Bundle] to add.
    #[doc(alias = "as_component_add_bundle")]
    fn add_bundle(&self, bundle: &impl IsA<Bundle>) {
        unsafe {
            ffi::as_component_add_bundle(
                self.as_ref().to_glib_none().0,
                bundle.as_ref().to_glib_none().0,
            );
        }
    }

    /// Add a category.
    /// ## `category`
    /// the categories name to add.
    #[doc(alias = "as_component_add_category")]
    fn add_category(&self, category: &str) {
        unsafe {
            ffi::as_component_add_category(
                self.as_ref().to_glib_none().0,
                category.to_glib_none().0,
            );
        }
    }

    /// Adds a content rating to this component.
    /// ## `content_rating`
    /// a [`ContentRating`][crate::ContentRating] instance.
    #[doc(alias = "as_component_add_content_rating")]
    fn add_content_rating(&self, content_rating: &impl IsA<ContentRating>) {
        unsafe {
            ffi::as_component_add_content_rating(
                self.as_ref().to_glib_none().0,
                content_rating.as_ref().to_glib_none().0,
            );
        }
    }

    /// Add a reference to the extended component
    /// ## `cpt_id`
    /// The id of a component which is extended by this component
    #[doc(alias = "as_component_add_extends")]
    fn add_extends(&self, cpt_id: &str) {
        unsafe {
            ffi::as_component_add_extends(self.as_ref().to_glib_none().0, cpt_id.to_glib_none().0);
        }
    }

    /// Add an icon to this component.
    /// ## `icon`
    /// the valid [`Icon`][crate::Icon] instance to add.
    #[doc(alias = "as_component_add_icon")]
    fn add_icon(&self, icon: &impl IsA<Icon>) {
        unsafe {
            ffi::as_component_add_icon(
                self.as_ref().to_glib_none().0,
                icon.as_ref().to_glib_none().0,
            );
        }
    }

    /// Add a new keyword to the keywords list for the given locale. This function does not
    /// check for duplicate keywords.
    /// ## `keyword`
    /// The new keyword to add.
    /// ## `locale`
    /// BCP47 locale of the values, or [`None`] to use current locale.
    #[doc(alias = "as_component_add_keyword")]
    fn add_keyword(&self, keyword: &str, locale: Option<&str>) {
        unsafe {
            ffi::as_component_add_keyword(
                self.as_ref().to_glib_none().0,
                keyword.to_glib_none().0,
                locale.to_glib_none().0,
            );
        }
    }

    /// Adds a language to the component.
    /// ## `locale`
    /// the BCP47 locale, or [`None`]. e.g. "en-GB"
    /// ## `percentage`
    /// the percentage completion of the translation, 0 for locales with unknown amount of translation
    #[doc(alias = "as_component_add_language")]
    fn add_language(&self, locale: Option<&str>, percentage: i32) {
        unsafe {
            ffi::as_component_add_language(
                self.as_ref().to_glib_none().0,
                locale.to_glib_none().0,
                percentage,
            );
        }
    }

    /// Adds a [`Launchable`][crate::Launchable] containing launchables entries for this component.
    /// ## `launchable`
    /// a [`Launchable`][crate::Launchable] instance.
    #[doc(alias = "as_component_add_launchable")]
    fn add_launchable(&self, launchable: &impl IsA<Launchable>) {
        unsafe {
            ffi::as_component_add_launchable(
                self.as_ref().to_glib_none().0,
                launchable.as_ref().to_glib_none().0,
            );
        }
    }

    /// Add a set of provided items to this component.
    /// ## `prov`
    /// a [`Provided`][crate::Provided] instance.
    #[doc(alias = "as_component_add_provided")]
    fn add_provided(&self, prov: &impl IsA<Provided>) {
        unsafe {
            ffi::as_component_add_provided(
                self.as_ref().to_glib_none().0,
                prov.as_ref().to_glib_none().0,
            );
        }
    }

    /// Adds a provided item to the component with the given `kind`, creating a new
    /// [`Provided`][crate::Provided] for this kind internally if necessary.
    /// ## `kind`
    /// the kind of the provided item (e.g. [`ProvidedKind::Mediatype`][crate::ProvidedKind::Mediatype])
    /// ## `item`
    /// the item to add.
    #[doc(alias = "as_component_add_provided_item")]
    fn add_provided_item(&self, kind: ProvidedKind, item: &str) {
        unsafe {
            ffi::as_component_add_provided_item(
                self.as_ref().to_glib_none().0,
                kind.into_glib(),
                item.to_glib_none().0,
            );
        }
    }

    //#[doc(alias = "as_component_add_reference")]
    //fn add_reference(&self, reference: /*Ignored*/&Reference) {
    //    unsafe { TODO: call ffi:as_component_add_reference() }
    //}

    /// Adds a [`Relation`][crate::Relation] to set a recommends or requires relation of
    /// component `self` on the item mentioned in the [`Relation`][crate::Relation].
    /// ## `relation`
    /// a [`Relation`][crate::Relation] instance.
    #[doc(alias = "as_component_add_relation")]
    fn add_relation(&self, relation: &impl IsA<Relation>) {
        unsafe {
            ffi::as_component_add_relation(
                self.as_ref().to_glib_none().0,
                relation.as_ref().to_glib_none().0,
            );
        }
    }

    /// Add an [`Release`][crate::Release] to this component.
    /// ## `release`
    /// The [`Release`][crate::Release] to add
    #[doc(alias = "as_component_add_release")]
    fn add_release(&self, release: &impl IsA<Release>) {
        unsafe {
            ffi::as_component_add_release(
                self.as_ref().to_glib_none().0,
                release.as_ref().to_glib_none().0,
            );
        }
    }

    /// Add the component ID of a component that gets replaced by the current component.
    /// ## `cid`
    /// an AppStream component ID
    #[doc(alias = "as_component_add_replaces")]
    fn add_replaces(&self, cid: &str) {
        unsafe {
            ffi::as_component_add_replaces(self.as_ref().to_glib_none().0, cid.to_glib_none().0);
        }
    }

    /// Adds a user review to a software component.
    /// ## `review`
    /// a [`Review`][crate::Review] instance.
    #[doc(alias = "as_component_add_review")]
    fn add_review(&self, review: &impl IsA<Review>) {
        unsafe {
            ffi::as_component_add_review(
                self.as_ref().to_glib_none().0,
                review.as_ref().to_glib_none().0,
            );
        }
    }

    /// Add an [`Screenshot`][crate::Screenshot] to this component.
    /// ## `sshot`
    /// The [`Screenshot`][crate::Screenshot] to add
    #[doc(alias = "as_component_add_screenshot")]
    fn add_screenshot(&self, sshot: &impl IsA<Screenshot>) {
        unsafe {
            ffi::as_component_add_screenshot(
                self.as_ref().to_glib_none().0,
                sshot.as_ref().to_glib_none().0,
            );
        }
    }

    /// Add an [`Suggested`][crate::Suggested] to this component.
    /// ## `suggested`
    /// The [`Suggested`][crate::Suggested]
    #[doc(alias = "as_component_add_suggested")]
    fn add_suggested(&self, suggested: &impl IsA<Suggested>) {
        unsafe {
            ffi::as_component_add_suggested(
                self.as_ref().to_glib_none().0,
                suggested.as_ref().to_glib_none().0,
            );
        }
    }

    /// Add a tag to this component.
    /// ## `ns`
    /// The namespace the tag belongs to
    /// ## `tag`
    /// The tag name
    ///
    /// # Returns
    ///
    /// [`true`] if the tag was added.
    #[doc(alias = "as_component_add_tag")]
    fn add_tag(&self, ns: &str, tag: &str) -> bool {
        unsafe {
            from_glib(ffi::as_component_add_tag(
                self.as_ref().to_glib_none().0,
                ns.to_glib_none().0,
                tag.to_glib_none().0,
            ))
        }
    }

    /// Assign an [`Translation`][crate::Translation] object describing the translation system used
    /// by this component.
    /// ## `tr`
    /// an [`Translation`][crate::Translation] instance.
    #[doc(alias = "as_component_add_translation")]
    fn add_translation(&self, tr: &impl IsA<Translation>) {
        unsafe {
            ffi::as_component_add_translation(
                self.as_ref().to_glib_none().0,
                tr.as_ref().to_glib_none().0,
            );
        }
    }

    /// Adds some URL data to the component.
    /// ## `url_kind`
    /// the URL kind, e.g. [`UrlKind::Homepage`][crate::UrlKind::Homepage]
    /// ## `url`
    /// the full URL.
    #[doc(alias = "as_component_add_url")]
    fn add_url(&self, url_kind: UrlKind, url: &str) {
        unsafe {
            ffi::as_component_add_url(
                self.as_ref().to_glib_none().0,
                url_kind.into_glib(),
                url.to_glib_none().0,
            );
        }
    }

    //#[doc(alias = "as_component_check_relations")]
    //fn check_relations(&self, sysinfo: /*Ignored*/Option<&SystemInfo>, pool: Option<&impl IsA<Pool>>, rel_kind: RelationKind) -> /*Ignored*/Vec<RelationCheckResult> {
    //    unsafe { TODO: call ffi:as_component_check_relations() }
    //}

    /// Remove all keywords for the given locale.
    /// ## `locale`
    /// BCP47 locale of the values, or [`None`] to use current locale.
    #[doc(alias = "as_component_clear_keywords")]
    fn clear_keywords(&self, locale: Option<&str>) {
        unsafe {
            ffi::as_component_clear_keywords(
                self.as_ref().to_glib_none().0,
                locale.to_glib_none().0,
            );
        }
    }

    /// Remove all registered language translation information.
    #[doc(alias = "as_component_clear_languages")]
    fn clear_languages(&self) {
        unsafe {
            ffi::as_component_clear_languages(self.as_ref().to_glib_none().0);
        }
    }

    /// Remove all tags associated with this component.
    #[doc(alias = "as_component_clear_tags")]
    fn clear_tags(&self) {
        unsafe {
            ffi::as_component_clear_tags(self.as_ref().to_glib_none().0);
        }
    }

    /// Returns a list of [`Component`][crate::Component] objects which
    /// are addons extending this component in functionality.
    ///
    /// This is the reverse of [`extends()`][Self::extends()]
    ///
    /// # Returns
    ///
    /// An array of [`Component`][crate::Component].
    #[doc(alias = "as_component_get_addons")]
    #[doc(alias = "get_addons")]
    fn addons(&self) -> Vec<Component> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_addons(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Gets an agreement the component has specified for the particular kind.
    /// ## `kind`
    /// an agreement kind, e.g. [`AgreementKind::Eula`][crate::AgreementKind::Eula]
    ///
    /// # Returns
    ///
    /// a [`Agreement`][crate::Agreement] or [`None`] for not found
    #[doc(alias = "as_component_get_agreement_by_kind")]
    #[doc(alias = "get_agreement_by_kind")]
    fn agreement_by_kind(&self, kind: AgreementKind) -> Option<Agreement> {
        unsafe {
            from_glib_none(ffi::as_component_get_agreement_by_kind(
                self.as_ref().to_glib_none().0,
                kind.into_glib(),
            ))
        }
    }

    /// Get a list of all agreements registered with this software component.
    ///
    /// # Returns
    ///
    /// An array of [`Agreement`][crate::Agreement].
    #[doc(alias = "as_component_get_agreements")]
    #[doc(alias = "get_agreements")]
    fn agreements(&self) -> Vec<Agreement> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_agreements(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Gets the branch for the application.
    ///
    /// # Returns
    ///
    /// string, or [`None`] if unset
    #[doc(alias = "as_component_get_branch")]
    #[doc(alias = "get_branch")]
    fn branch(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::as_component_get_branch(self.as_ref().to_glib_none().0)) }
    }

    /// Get the branding associated with this component, or [`None`]
    /// in case this component has no special branding.
    ///
    /// # Returns
    ///
    /// An [`Branding`][crate::Branding].
    #[doc(alias = "as_component_get_branding")]
    #[doc(alias = "get_branding")]
    fn branding(&self) -> Option<Branding> {
        unsafe {
            from_glib_none(ffi::as_component_get_branding(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Gets a bundle identifier string.
    /// ## `bundle_kind`
    /// the bundle kind, e.g. [`BundleKind::Limba`][crate::BundleKind::Limba].
    ///
    /// # Returns
    ///
    /// An [`Bundle`][crate::Bundle], or [`None`] if not set.
    #[doc(alias = "as_component_get_bundle")]
    #[doc(alias = "get_bundle")]
    fn bundle(&self, bundle_kind: BundleKind) -> Option<Bundle> {
        unsafe {
            from_glib_none(ffi::as_component_get_bundle(
                self.as_ref().to_glib_none().0,
                bundle_kind.into_glib(),
            ))
        }
    }

    /// Get a list of all software bundles associated with this component.
    ///
    /// # Returns
    ///
    /// A list of [`Bundle`][crate::Bundle].
    #[doc(alias = "as_component_get_bundles")]
    #[doc(alias = "get_bundles")]
    fn bundles(&self) -> Vec<Bundle> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_bundles(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    ///
    /// # Returns
    ///
    /// String array of categories
    #[doc(alias = "as_component_get_categories")]
    #[doc(alias = "get_categories")]
    fn categories(&self) -> Vec<glib::GString> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_categories(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    ///
    /// # Returns
    ///
    /// A list of desktops where this component is compulsory
    #[doc(alias = "as_component_get_compulsory_for_desktops")]
    #[doc(alias = "get_compulsory_for_desktops")]
    fn compulsory_for_desktops(&self) -> Vec<glib::GString> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_compulsory_for_desktops(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Gets a content ratings of a specific type that are defined for this component.
    /// ## `kind`
    /// a ratings kind, e.g. "oars-1.0"
    ///
    /// # Returns
    ///
    /// a [`ContentRating`][crate::ContentRating] or [`None`] if not found
    #[doc(alias = "as_component_get_content_rating")]
    #[doc(alias = "get_content_rating")]
    fn content_rating(&self, kind: &str) -> Option<ContentRating> {
        unsafe {
            from_glib_none(ffi::as_component_get_content_rating(
                self.as_ref().to_glib_none().0,
                kind.to_glib_none().0,
            ))
        }
    }

    /// Gets all content ratings defined for this software.
    ///
    /// # Returns
    ///
    /// an array
    #[doc(alias = "as_component_get_content_ratings")]
    #[doc(alias = "get_content_ratings")]
    fn content_ratings(&self) -> Vec<ContentRating> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_content_ratings(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Get the [`Context`][crate::Context] associated with this component.
    /// This function may return [`None`] if no context is set
    /// (which will be the case if the component was not loaded from
    /// a file or cache but constructed in memory).
    ///
    /// # Returns
    ///
    /// the associated [`Context`][crate::Context] or [`None`]
    #[doc(alias = "as_component_get_context")]
    #[doc(alias = "get_context")]
    fn context(&self) -> Option<Context> {
        unsafe {
            from_glib_none(ffi::as_component_get_context(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    //#[doc(alias = "as_component_get_custom")]
    //#[doc(alias = "get_custom")]
    //fn custom(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 } {
    //    unsafe { TODO: call ffi:as_component_get_custom() }
    //}

    /// Retrieve value for a custom data entry with the given key.
    /// ## `key`
    /// Field name.
    #[doc(alias = "as_component_get_custom_value")]
    #[doc(alias = "get_custom_value")]
    fn custom_value(&self, key: &str) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::as_component_get_custom_value(
                self.as_ref().to_glib_none().0,
                key.to_glib_none().0,
            ))
        }
    }

    /// Get a unique identifier for this metadata set.
    /// This unique ID is only valid for the current session,
    /// as opposed to the AppStream ID which uniquely identifies
    /// a software component.
    ///
    /// The format of the unique id usually is:
    /// %{scope}/%{origin}/%{distribution_system}/%{appstream_id}
    ///
    /// For example:
    /// system/os/package/org.example.FooBar
    ///
    /// # Returns
    ///
    /// the unique session-specific identifier.
    #[doc(alias = "as_component_get_data_id")]
    #[doc(alias = "get_data_id")]
    fn data_id(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::as_component_get_data_id(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Gets the end-of-life date for the entire component.
    ///
    /// # Returns
    ///
    /// The EOL date as string in ISO8601 format.
    #[doc(alias = "as_component_get_date_eol")]
    #[doc(alias = "get_date_eol")]
    fn date_eol(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::as_component_get_date_eol(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Get the localized long description of this component.
    ///
    /// # Returns
    ///
    /// the description.
    #[doc(alias = "as_component_get_description")]
    #[doc(alias = "get_description")]
    fn description(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::as_component_get_description(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    //#[doc(alias = "as_component_get_developer")]
    //#[doc(alias = "get_developer")]
    //fn developer(&self) -> /*Ignored*/Option<Developer> {
    //    unsafe { TODO: call ffi:as_component_get_developer() }
    //}

    /// Returns a string list of IDs of components which
    /// are extended by this addon.
    ///
    /// See [`extends()`][Self::extends()] for the reverse.
    ///
    /// # Returns
    ///
    /// A `GPtrArray` or [`None`] if not set.
    #[doc(alias = "as_component_get_extends")]
    #[doc(alias = "get_extends")]
    fn extends(&self) -> Vec<glib::GString> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_extends(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Gets an icon matching the size constraints.
    /// The icons are not filtered by type, and the first icon
    /// which matches the size is returned.
    /// If you want more control over which icons you use for displaying,
    /// use the [`icons()`][Self::icons()] function to get a list of all icons.
    ///
    /// Note that this function is not HiDPI aware! It will never return an icon with
    /// a scaling factor > 1.
    /// ## `width`
    /// The icon width in pixels.
    /// ## `height`
    /// the icon height in pixels.
    ///
    /// # Returns
    ///
    /// An icon matching the given width/height, or [`None`] if not found.
    #[doc(alias = "as_component_get_icon_by_size")]
    #[doc(alias = "get_icon_by_size")]
    fn icon_by_size(&self, width: u32, height: u32) -> Option<Icon> {
        unsafe {
            from_glib_none(ffi::as_component_get_icon_by_size(
                self.as_ref().to_glib_none().0,
                width,
                height,
            ))
        }
    }

    /// Gets a stock icon for this component if one is associated with it.
    /// Will return [`None`] otherwise.
    ///
    /// # Returns
    ///
    /// An stock icon, or [`None`] if none found.
    #[doc(alias = "as_component_get_icon_stock")]
    #[doc(alias = "get_icon_stock")]
    fn icon_stock(&self) -> Option<Icon> {
        unsafe {
            from_glib_none(ffi::as_component_get_icon_stock(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    ///
    /// # Returns
    ///
    /// A `GPtrArray` of all icons for this component.
    #[doc(alias = "as_component_get_icons")]
    #[doc(alias = "get_icons")]
    fn icons(&self) -> Vec<Icon> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_icons(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Get the unique AppStream identifier for this component.
    /// This ID is unique for the described component, but does
    /// not uniquely identify the metadata set.
    ///
    /// For a unique ID for this metadata set in the current
    /// session, use [`data_id()`][Self::data_id()]
    ///
    /// # Returns
    ///
    /// the unique AppStream identifier.
    #[doc(alias = "as_component_get_id")]
    #[doc(alias = "get_id")]
    fn id(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::as_component_get_id(self.as_ref().to_glib_none().0)) }
    }

    ///
    /// # Returns
    ///
    /// String array of keywords
    #[doc(alias = "as_component_get_keywords")]
    #[doc(alias = "get_keywords")]
    fn keywords(&self) -> Vec<glib::GString> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_keywords(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    //#[doc(alias = "as_component_get_keywords_table")]
    //#[doc(alias = "get_keywords_table")]
    //fn keywords_table(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 } {
    //    unsafe { TODO: call ffi:as_component_get_keywords_table() }
    //}

    /// Returns the [`ComponentKind`][crate::ComponentKind] of this component.
    ///
    /// # Returns
    ///
    /// the kind of `this`.
    #[doc(alias = "as_component_get_kind")]
    #[doc(alias = "get_kind")]
    fn kind(&self) -> ComponentKind {
        unsafe { from_glib(ffi::as_component_get_kind(self.as_ref().to_glib_none().0)) }
    }

    /// Gets the translation coverage in percent for a specific locale
    /// ## `locale`
    /// the BCP47 locale, or [`None`]. e.g. "en-GB"
    ///
    /// # Returns
    ///
    /// a percentage value, -1 if locale was not found
    #[doc(alias = "as_component_get_language")]
    #[doc(alias = "get_language")]
    fn language(&self, locale: Option<&str>) -> i32 {
        unsafe {
            ffi::as_component_get_language(self.as_ref().to_glib_none().0, locale.to_glib_none().0)
        }
    }

    /// Get a list of all languages.
    ///
    /// # Returns
    ///
    /// list of locales
    #[doc(alias = "as_component_get_languages")]
    #[doc(alias = "get_languages")]
    fn languages(&self) -> Vec<glib::GString> {
        unsafe {
            FromGlibPtrContainer::from_glib_container(ffi::as_component_get_languages(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Gets a [`Launchable`][crate::Launchable] of a specific type that contains launchable entries for
    /// this component.
    /// ## `kind`
    /// a launch kind, e.g. [`LaunchableKind::DesktopId`][crate::LaunchableKind::DesktopId]
    ///
    /// # Returns
    ///
    /// a [`Launchable`][crate::Launchable] or [`None`] if not found
    #[doc(alias = "as_component_get_launchable")]
    #[doc(alias = "get_launchable")]
    fn launchable(&self, kind: LaunchableKind) -> Option<Launchable> {
        unsafe {
            from_glib_none(ffi::as_component_get_launchable(
                self.as_ref().to_glib_none().0,
                kind.into_glib(),
            ))
        }
    }

    ///
    /// # Returns
    ///
    /// an array
    #[doc(alias = "as_component_get_launchables")]
    #[doc(alias = "get_launchables")]
    fn launchables(&self) -> Vec<Launchable> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_launchables(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Get the merge method which should apply to duplicate components
    /// with this ID.
    ///
    /// # Returns
    ///
    /// the [`MergeKind`][crate::MergeKind] of this component.
    #[doc(alias = "as_component_get_merge_kind")]
    #[doc(alias = "get_merge_kind")]
    fn merge_kind(&self) -> MergeKind {
        unsafe {
            from_glib(ffi::as_component_get_merge_kind(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// The license the metadata iself is subjected to.
    ///
    /// # Returns
    ///
    /// the license.
    #[doc(alias = "as_component_get_metadata_license")]
    #[doc(alias = "get_metadata_license")]
    fn metadata_license(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::as_component_get_metadata_license(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// A human-readable name for this component.
    ///
    /// # Returns
    ///
    /// the name.
    #[doc(alias = "as_component_get_name")]
    #[doc(alias = "get_name")]
    fn name(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::as_component_get_name(self.as_ref().to_glib_none().0)) }
    }

    //#[doc(alias = "as_component_get_name_table")]
    //#[doc(alias = "get_name_table")]
    //fn name_table(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 } {
    //    unsafe { TODO: call ffi:as_component_get_name_table() }
    //}

    /// Get variant suffix for the component name
    /// (only to be displayed if two components have the same name).
    ///
    /// # Returns
    ///
    /// the variant suffix
    #[doc(alias = "as_component_get_name_variant_suffix")]
    #[doc(alias = "get_name_variant_suffix")]
    fn name_variant_suffix(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::as_component_get_name_variant_suffix(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "as_component_get_origin")]
    #[doc(alias = "get_origin")]
    fn origin(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::as_component_get_origin(self.as_ref().to_glib_none().0)) }
    }

    /// Get the first package name of the list of packages that need to be installed
    /// for this component to be present on the system.
    /// Since most components consist of only one package, this is safe to use for
    /// about 90% of all cases.
    ///
    /// However, to support a component fully, please use [`pkgnames()`][Self::pkgnames()] for
    /// getting all packages that need to be installed, and use this method only to
    /// e.g. get the main package to perform a quick "is it installed?" check.
    ///
    /// # Returns
    ///
    /// String array of package names
    #[doc(alias = "as_component_get_pkgname")]
    #[doc(alias = "get_pkgname")]
    fn pkgname(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::as_component_get_pkgname(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Get a list of package names which this component consists of.
    /// This usually is just one package name.
    ///
    /// # Returns
    ///
    /// String array of package names
    #[doc(alias = "as_component_get_pkgnames")]
    #[doc(alias = "get_pkgnames")]
    fn pkgnames(&self) -> Vec<glib::GString> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_pkgnames(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns the priority of this component.
    /// This method is used internally.
    #[doc(alias = "as_component_get_priority")]
    #[doc(alias = "get_priority")]
    fn priority(&self) -> i32 {
        unsafe { ffi::as_component_get_priority(self.as_ref().to_glib_none().0) }
    }

    /// Get the component's project group.
    ///
    /// # Returns
    ///
    /// the project group.
    #[doc(alias = "as_component_get_project_group")]
    #[doc(alias = "get_project_group")]
    #[doc(alias = "project-group")]
    fn project_group(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::as_component_get_project_group(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Get the license of the project this component belongs to.
    ///
    /// # Returns
    ///
    /// the license.
    #[doc(alias = "as_component_get_project_license")]
    #[doc(alias = "get_project_license")]
    #[doc(alias = "project-license")]
    fn project_license(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::as_component_get_project_license(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Get a list of [`Provided`][crate::Provided] objects associated with this component.
    ///
    /// # Returns
    ///
    /// A list of [`Provided`][crate::Provided] objects.
    #[doc(alias = "as_component_get_provided")]
    #[doc(alias = "get_provided")]
    fn provided(&self) -> Vec<Provided> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_provided(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Get an [`Provided`][crate::Provided] object for the given interface type,
    /// containing information about the public interfaces (mimetypes, firmware, DBus services, ...)
    /// this component provides.
    /// ## `kind`
    /// kind of the provided item, e.g. [`ProvidedKind::Mediatype`][crate::ProvidedKind::Mediatype]
    ///
    /// # Returns
    ///
    /// [`Provided`][crate::Provided] containing the items this component provides, or [`None`].
    #[doc(alias = "as_component_get_provided_for_kind")]
    #[doc(alias = "get_provided_for_kind")]
    fn provided_for_kind(&self, kind: ProvidedKind) -> Option<Provided> {
        unsafe {
            from_glib_none(ffi::as_component_get_provided_for_kind(
                self.as_ref().to_glib_none().0,
                kind.into_glib(),
            ))
        }
    }

    /// Get an array of items that are recommended by this component.
    ///
    /// # Returns
    ///
    /// an array
    #[doc(alias = "as_component_get_recommends")]
    #[doc(alias = "get_recommends")]
    fn recommends(&self) -> Vec<Relation> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_recommends(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    //#[doc(alias = "as_component_get_references")]
    //#[doc(alias = "get_references")]
    //fn references(&self) -> /*Ignored*/Vec<Reference> {
    //    unsafe { TODO: call ffi:as_component_get_references() }
    //}

    /// Get release information for this component,
    /// without downloading or loading any data from external sources.
    ///
    /// # Returns
    ///
    /// Release information as [`ReleaseList`][crate::ReleaseList]
    #[doc(alias = "as_component_get_releases_plain")]
    #[doc(alias = "get_releases_plain")]
    fn releases_plain(&self) -> Option<ReleaseList> {
        unsafe {
            from_glib_none(ffi::as_component_get_releases_plain(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Get a list of component IDs of components that this software replaces entirely.
    ///
    /// # Returns
    ///
    /// an array of component-IDs
    #[doc(alias = "as_component_get_replaces")]
    #[doc(alias = "get_replaces")]
    fn replaces(&self) -> Vec<glib::GString> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_replaces(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Get an array of items that are required by this component.
    ///
    /// # Returns
    ///
    /// an array
    #[doc(alias = "as_component_get_requires")]
    #[doc(alias = "get_requires")]
    fn requires(&self) -> Vec<Relation> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_requires(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Gets any reviews associated with the component.
    ///
    /// # Returns
    ///
    /// an array
    #[doc(alias = "as_component_get_reviews")]
    #[doc(alias = "get_reviews")]
    fn reviews(&self) -> Vec<Review> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_reviews(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    ///
    /// # Returns
    ///
    /// the [`ComponentScope`][crate::ComponentScope] of this component.
    #[doc(alias = "as_component_get_scope")]
    #[doc(alias = "get_scope")]
    fn scope(&self) -> ComponentScope {
        unsafe { from_glib(ffi::as_component_get_scope(self.as_ref().to_glib_none().0)) }
    }

    /// Get a list of all associated screenshots, for all environments.
    ///
    /// # Returns
    ///
    /// an array of [`Screenshot`][crate::Screenshot] instances
    #[doc(alias = "as_component_get_screenshots_all")]
    #[doc(alias = "get_screenshots_all")]
    fn screenshots_all(&self) -> Vec<Screenshot> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_screenshots_all(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns all search tokens for this component.
    ///
    /// # Returns
    ///
    /// The string search tokens
    #[doc(alias = "as_component_get_search_tokens")]
    #[doc(alias = "get_search_tokens")]
    fn search_tokens(&self) -> Vec<glib::GString> {
        unsafe {
            FromGlibPtrContainer::from_glib_container(ffi::as_component_get_search_tokens(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns the sorting priority of this component.
    ///
    /// This will only return a valid value if this component
    /// was the result of or involved in a search operation which
    /// returned sorted results.
    /// In most cases you will not need to access this value explicitly,
    /// as all results of search operations in AppStream are already sorted
    /// from best match to worst.
    ///
    /// The returned value is an arbitrary integer value, valid only for
    /// the search terms involved in the search operation that yielded
    /// this component as a result.
    #[doc(alias = "as_component_get_sort_score")]
    #[doc(alias = "get_sort_score")]
    fn sort_score(&self) -> u32 {
        unsafe { ffi::as_component_get_sort_score(self.as_ref().to_glib_none().0) }
    }

    ///
    /// # Returns
    ///
    /// the source package name.
    #[doc(alias = "as_component_get_source_pkgname")]
    #[doc(alias = "get_source_pkgname")]
    fn source_pkgname(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::as_component_get_source_pkgname(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Get a list of associated suggestions.
    ///
    /// # Returns
    ///
    /// an array of [`Suggested`][crate::Suggested] instances
    #[doc(alias = "as_component_get_suggested")]
    #[doc(alias = "get_suggested")]
    fn suggested(&self) -> Vec<Suggested> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_suggested(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Get a short description of this component.
    ///
    /// # Returns
    ///
    /// the summary.
    #[doc(alias = "as_component_get_summary")]
    #[doc(alias = "get_summary")]
    fn summary(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::as_component_get_summary(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    //#[doc(alias = "as_component_get_summary_table")]
    //#[doc(alias = "get_summary_table")]
    //fn summary_table(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 } {
    //    unsafe { TODO: call ffi:as_component_get_summary_table() }
    //}

    /// Get an array of items that are supported by this component,
    /// e.g. to indicate support for a specific piece of hardware.
    ///
    /// # Returns
    ///
    /// an array
    #[doc(alias = "as_component_get_supports")]
    #[doc(alias = "get_supports")]
    fn supports(&self) -> Vec<Relation> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_supports(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    //#[doc(alias = "as_component_get_system_compatibility_score")]
    //#[doc(alias = "get_system_compatibility_score")]
    //fn system_compatibility_score(&self, sysinfo: /*Ignored*/&SystemInfo, is_template: bool, results: /*Ignored*/Vec<RelationCheckResult>) -> i32 {
    //    unsafe { TODO: call ffi:as_component_get_system_compatibility_score() }
    //}

    /// Gets the UNIX timestamp for the date when this component
    /// is out of support (end-of-life) and will receive no more
    /// updates, not even security fixes.
    ///
    /// # Returns
    ///
    /// UNIX timestamp, or 0 for unset or invalid.
    #[doc(alias = "as_component_get_timestamp_eol")]
    #[doc(alias = "get_timestamp_eol")]
    fn timestamp_eol(&self) -> u64 {
        unsafe { ffi::as_component_get_timestamp_eol(self.as_ref().to_glib_none().0) }
    }

    /// Get a `GPtrArray` of [`Translation`][crate::Translation] objects describing the
    /// translation systems and translation-ids (e.g. Gettext domains) used
    /// by this software component.
    ///
    /// Only set for metainfo files.
    ///
    /// # Returns
    ///
    /// An array of [`Translation`][crate::Translation] objects.
    #[doc(alias = "as_component_get_translations")]
    #[doc(alias = "get_translations")]
    fn translations(&self) -> Vec<Translation> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::as_component_get_translations(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Gets a URL.
    /// ## `url_kind`
    /// the URL kind, e.g. [`UrlKind::Homepage`][crate::UrlKind::Homepage].
    ///
    /// # Returns
    ///
    /// string, or [`None`] if unset
    #[doc(alias = "as_component_get_url")]
    #[doc(alias = "get_url")]
    fn url(&self, url_kind: UrlKind) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::as_component_get_url(
                self.as_ref().to_glib_none().0,
                url_kind.into_glib(),
            ))
        }
    }

    ///
    /// # Returns
    ///
    /// [`true`] if this component has a bundle associated.
    #[doc(alias = "as_component_has_bundle")]
    fn has_bundle(&self) -> bool {
        unsafe { from_glib(ffi::as_component_has_bundle(self.as_ref().to_glib_none().0)) }
    }

    /// Check if component is in the specified category.
    /// ## `category`
    /// the specified category to check
    ///
    /// # Returns
    ///
    /// [`true`] if the component is in the specified category.
    #[doc(alias = "as_component_has_category")]
    fn has_category(&self, category: &str) -> bool {
        unsafe {
            from_glib(ffi::as_component_has_category(
                self.as_ref().to_glib_none().0,
                category.to_glib_none().0,
            ))
        }
    }

    /// Test if the component is tagged with the selected
    /// tag.
    /// ## `ns`
    /// The namespace the tag belongs to
    /// ## `tag`
    /// The tag name
    ///
    /// # Returns
    ///
    /// [`true`] if tag exists.
    #[doc(alias = "as_component_has_tag")]
    fn has_tag(&self, ns: &str, tag: &str) -> bool {
        unsafe {
            from_glib(ffi::as_component_has_tag(
                self.as_ref().to_glib_none().0,
                ns.to_glib_none().0,
                tag.to_glib_none().0,
            ))
        }
    }

    /// Add a key and value pair to the custom data table.
    /// ## `key`
    /// Key name.
    /// ## `value`
    /// A string value.
    ///
    /// # Returns
    ///
    /// [`true`] if the key did not exist yet.
    #[doc(alias = "as_component_insert_custom_value")]
    fn insert_custom_value(&self, key: &str, value: &str) -> bool {
        unsafe {
            from_glib(ffi::as_component_insert_custom_value(
                self.as_ref().to_glib_none().0,
                key.to_glib_none().0,
                value.to_glib_none().0,
            ))
        }
    }

    /// Check if this component is compulsory for the given desktop.
    /// ## `desktop`
    /// the desktop-id to test for
    ///
    /// # Returns
    ///
    /// [`true`] if compulsory, [`false`] otherwise.
    #[doc(alias = "as_component_is_compulsory_for_desktop")]
    fn is_compulsory_for_desktop(&self, desktop: &str) -> bool {
        unsafe {
            from_glib(ffi::as_component_is_compulsory_for_desktop(
                self.as_ref().to_glib_none().0,
                desktop.to_glib_none().0,
            ))
        }
    }

    /// Returns [`true`] if this component is free and open source software.
    /// To determine this status, this function will check if it comes
    /// from a vetted free-software-only source or whether its licenses
    /// are only free software licenses.
    ///
    /// # Returns
    ///
    /// [`true`] if this component is free software.
    #[doc(alias = "as_component_is_floss")]
    fn is_floss(&self) -> bool {
        unsafe { from_glib(ffi::as_component_is_floss(self.as_ref().to_glib_none().0)) }
    }

    ///
    /// # Returns
    ///
    /// Whether this component's metadata should be ignored.
    #[doc(alias = "as_component_is_ignored")]
    fn is_ignored(&self) -> bool {
        unsafe { from_glib(ffi::as_component_is_ignored(self.as_ref().to_glib_none().0)) }
    }

    /// Test if the component `self` is a member of category `category`.
    /// ## `category`
    /// The category to test.
    #[doc(alias = "as_component_is_member_of_category")]
    fn is_member_of_category(&self, category: &impl IsA<Category>) -> bool {
        unsafe {
            from_glib(ffi::as_component_is_member_of_category(
                self.as_ref().to_glib_none().0,
                category.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Check if the essential properties of this Component are
    /// populated with useful data.
    ///
    /// # Returns
    ///
    /// TRUE if the component data was validated successfully.
    #[doc(alias = "as_component_is_valid")]
    fn is_valid(&self) -> bool {
        unsafe { from_glib(ffi::as_component_is_valid(self.as_ref().to_glib_none().0)) }
    }

    /// Load metadata for this component from an XML string.
    /// You normally do not want to use this method directly and instead use the more
    /// convenient API of [`Metadata`][crate::Metadata] to create and update components.
    ///
    /// If this function returns [`true`], a valid component is returned unless the selected
    /// format was [`FormatKind::DesktopEntry`][crate::FormatKind::DesktopEntry], in which case a component ID will have to
    /// be set explicitly by the caller in order to make the component valid.
    /// ## `context`
    /// an [`Context`][crate::Context] instance.
    /// ## `format`
    /// the format of the data to load, e.g. [`FormatKind::Xml`][crate::FormatKind::Xml]
    /// ## `bytes`
    /// the data to load.
    ///
    /// # Returns
    ///
    /// [`true`] on success.
    #[doc(alias = "as_component_load_from_bytes")]
    fn load_from_bytes(
        &self,
        context: &impl IsA<Context>,
        format: FormatKind,
        bytes: &glib::Bytes,
    ) -> Result<(), glib::Error> {
        unsafe {
            let mut error = std::ptr::null_mut();
            let is_ok = ffi::as_component_load_from_bytes(
                self.as_ref().to_glib_none().0,
                context.as_ref().to_glib_none().0,
                format.into_glib(),
                bytes.to_glib_none().0,
                &mut error,
            );
            debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
            if error.is_null() {
                Ok(())
            } else {
                Err(from_glib_full(error))
            }
        }
    }

    /// Get release information for this component, download it
    /// if necessary.
    ///
    /// # Returns
    ///
    /// Release information as [`ReleaseList`][crate::ReleaseList], or [`None`] if loading failed.
    #[doc(alias = "as_component_load_releases")]
    fn load_releases(&self, allow_net: bool) -> Result<Option<ReleaseList>, glib::Error> {
        unsafe {
            let mut error = std::ptr::null_mut();
            let ret = ffi::as_component_load_releases(
                self.as_ref().to_glib_none().0,
                allow_net.into_glib(),
                &mut error,
            );
            if error.is_null() {
                Ok(from_glib_none(ret))
            } else {
                Err(from_glib_full(error))
            }
        }
    }

    /// Remove a tag from this component
    /// ## `ns`
    /// The namespace the tag belongs to
    /// ## `tag`
    /// The tag name
    ///
    /// # Returns
    ///
    /// [`true`] if the tag was removed.
    #[doc(alias = "as_component_remove_tag")]
    fn remove_tag(&self, ns: &str, tag: &str) -> bool {
        unsafe {
            from_glib(ffi::as_component_remove_tag(
                self.as_ref().to_glib_none().0,
                ns.to_glib_none().0,
                tag.to_glib_none().0,
            ))
        }
    }

    /// Searches component data for a specific keyword.
    /// ## `term`
    /// the search term.
    ///
    /// # Returns
    ///
    /// a match scrore, where 0 is no match and 100 is the best match.
    #[doc(alias = "as_component_search_matches")]
    fn search_matches(&self, term: &str) -> u32 {
        unsafe {
            ffi::as_component_search_matches(self.as_ref().to_glib_none().0, term.to_glib_none().0)
        }
    }

    /// Set the branch that the component instance was sourced from.
    /// ## `branch`
    /// the branch, e.g. "master" or "3-16".
    #[doc(alias = "as_component_set_branch")]
    fn set_branch(&self, branch: &str) {
        unsafe {
            ffi::as_component_set_branch(self.as_ref().to_glib_none().0, branch.to_glib_none().0);
        }
    }

    /// Set branding for this component.
    /// ## `branding`
    /// an [`Branding`][crate::Branding] instance.
    #[doc(alias = "as_component_set_branding")]
    fn set_branding(&self, branding: &impl IsA<Branding>) {
        unsafe {
            ffi::as_component_set_branding(
                self.as_ref().to_glib_none().0,
                branding.as_ref().to_glib_none().0,
            );
        }
    }

    /// Mark this component to be compulsory for the specified desktop environment.
    /// ## `desktop`
    /// The name of the desktop.
    #[doc(alias = "as_component_set_compulsory_for_desktop")]
    fn set_compulsory_for_desktop(&self, desktop: &str) {
        unsafe {
            ffi::as_component_set_compulsory_for_desktop(
                self.as_ref().to_glib_none().0,
                desktop.to_glib_none().0,
            );
        }
    }

    /// Sets the document context this component is associated
    /// with.
    /// ## `context`
    /// the [`Context`][crate::Context].
    #[doc(alias = "as_component_set_context")]
    fn set_context(&self, context: &impl IsA<Context>) {
        unsafe {
            ffi::as_component_set_context(
                self.as_ref().to_glib_none().0,
                context.as_ref().to_glib_none().0,
            );
        }
    }

    /// Set the active locale on the context assoaiacted with this component,
    /// creating a new context for the component if none exists yet.
    ///
    /// Please not that this will flip the locale of all other components and
    /// entities that use the same context as well!
    /// This function is just a convenience method, and does not replace
    /// proper [`Context`][crate::Context] management.
    /// ## `locale`
    /// the new locale.
    #[doc(alias = "as_component_set_context_locale")]
    fn set_context_locale(&self, locale: &str) {
        unsafe {
            ffi::as_component_set_context_locale(
                self.as_ref().to_glib_none().0,
                locale.to_glib_none().0,
            );
        }
    }

    /// Set the session-specific unique metadata identifier for this
    /// component.
    /// If two components have a different data_id but the same ID,
    /// they will be treated as independent sets of metadata describing
    /// the same component type.
    /// ## `value`
    /// the unique session-specific identifier.
    #[doc(alias = "as_component_set_data_id")]
    fn set_data_id(&self, value: &str) {
        unsafe {
            ffi::as_component_set_data_id(self.as_ref().to_glib_none().0, value.to_glib_none().0);
        }
    }

    /// Sets an end-of-life date for this component.
    /// ## `date`
    /// the EOL date in ISO8601 format.
    #[doc(alias = "as_component_set_date_eol")]
    fn set_date_eol(&self, date: &str) {
        unsafe {
            ffi::as_component_set_date_eol(self.as_ref().to_glib_none().0, date.to_glib_none().0);
        }
    }

    /// Set long description for this component.
    /// ## `value`
    /// The long description
    /// ## `locale`
    /// The BCP47 locale for this value, or [`None`] to use the current active one.
    #[doc(alias = "as_component_set_description")]
    #[doc(alias = "description")]
    fn set_description(&self, value: &str, locale: Option<&str>) {
        unsafe {
            ffi::as_component_set_description(
                self.as_ref().to_glib_none().0,
                value.to_glib_none().0,
                locale.to_glib_none().0,
            );
        }
    }

    //#[doc(alias = "as_component_set_developer")]
    //fn set_developer(&self, developer: /*Ignored*/&Developer) {
    //    unsafe { TODO: call ffi:as_component_set_developer() }
    //}

    /// Set the AppStream identifier for this component.
    /// ## `value`
    /// the unique identifier.
    #[doc(alias = "as_component_set_id")]
    #[doc(alias = "id")]
    fn set_id(&self, value: &str) {
        unsafe {
            ffi::as_component_set_id(self.as_ref().to_glib_none().0, value.to_glib_none().0);
        }
    }

    /// Set keywords for this component, replacing all existing ones for the selected locale.
    /// ## `new_keywords`
    /// Array of keywords
    /// ## `locale`
    /// BCP47 locale of the values, or [`None`] to use current locale.
    /// ## `deep_copy`
    /// Set to [`true`] if the keywords array should be copied, [`false`] to set by reference.
    #[doc(alias = "as_component_set_keywords")]
    #[doc(alias = "keywords")]
    fn set_keywords(&self, new_keywords: &[&str], locale: Option<&str>, deep_copy: bool) {
        unsafe {
            ffi::as_component_set_keywords(
                self.as_ref().to_glib_none().0,
                new_keywords.to_glib_none().0,
                locale.to_glib_none().0,
                deep_copy.into_glib(),
            );
        }
    }

    /// Sets the [`ComponentKind`][crate::ComponentKind] of this component.
    /// ## `value`
    /// the [`ComponentKind`][crate::ComponentKind].
    #[doc(alias = "as_component_set_kind")]
    #[doc(alias = "kind")]
    fn set_kind(&self, value: ComponentKind) {
        unsafe {
            ffi::as_component_set_kind(self.as_ref().to_glib_none().0, value.into_glib());
        }
    }

    /// Sets the [`MergeKind`][crate::MergeKind] for this component.
    /// ## `kind`
    /// the [`MergeKind`][crate::MergeKind].
    #[doc(alias = "as_component_set_merge_kind")]
    fn set_merge_kind(&self, kind: MergeKind) {
        unsafe {
            ffi::as_component_set_merge_kind(self.as_ref().to_glib_none().0, kind.into_glib());
        }
    }

    /// Set the license this metadata is licensed under.
    /// ## `value`
    /// the metadata license.
    #[doc(alias = "as_component_set_metadata_license")]
    fn set_metadata_license(&self, value: &str) {
        unsafe {
            ffi::as_component_set_metadata_license(
                self.as_ref().to_glib_none().0,
                value.to_glib_none().0,
            );
        }
    }

    /// Set a human-readable name for this component.
    /// ## `value`
    /// The name
    /// ## `locale`
    /// The BCP47 locale for this value, or [`None`] to use the current active one.
    #[doc(alias = "as_component_set_name")]
    #[doc(alias = "name")]
    fn set_name(&self, value: &str, locale: Option<&str>) {
        unsafe {
            ffi::as_component_set_name(
                self.as_ref().to_glib_none().0,
                value.to_glib_none().0,
                locale.to_glib_none().0,
            );
        }
    }

    /// Set a variant suffix for the component name
    /// (only to be displayed if components have the same name).
    /// ## `value`
    /// the developer or developer team name
    /// ## `locale`
    /// the BCP47 locale, or [`None`]. e.g. "en-GB"
    #[doc(alias = "as_component_set_name_variant_suffix")]
    fn set_name_variant_suffix(&self, value: &str, locale: Option<&str>) {
        unsafe {
            ffi::as_component_set_name_variant_suffix(
                self.as_ref().to_glib_none().0,
                value.to_glib_none().0,
                locale.to_glib_none().0,
            );
        }
    }

    /// ## `origin`
    /// the origin.
    #[doc(alias = "as_component_set_origin")]
    fn set_origin(&self, origin: &str) {
        unsafe {
            ffi::as_component_set_origin(self.as_ref().to_glib_none().0, origin.to_glib_none().0);
        }
    }

    /// Set the package name that provides this component.
    /// ## `pkgname`
    /// the package name
    #[doc(alias = "as_component_set_pkgname")]
    fn set_pkgname(&self, pkgname: &str) {
        unsafe {
            ffi::as_component_set_pkgname(self.as_ref().to_glib_none().0, pkgname.to_glib_none().0);
        }
    }

    /// Set a list of package names this component consists of.
    /// (This should usually be just one package name)
    #[doc(alias = "as_component_set_pkgnames")]
    #[doc(alias = "pkgnames")]
    fn set_pkgnames(&self, packages: &[&str]) {
        unsafe {
            ffi::as_component_set_pkgnames(
                self.as_ref().to_glib_none().0,
                packages.to_glib_none().0,
            );
        }
    }

    /// Sets the priority of this component.
    /// This method is used internally.
    /// ## `priority`
    /// the given priority
    #[doc(alias = "as_component_set_priority")]
    fn set_priority(&self, priority: i32) {
        unsafe {
            ffi::as_component_set_priority(self.as_ref().to_glib_none().0, priority);
        }
    }

    /// Set the component's project group.
    /// ## `value`
    /// the project group.
    #[doc(alias = "as_component_set_project_group")]
    #[doc(alias = "project-group")]
    fn set_project_group(&self, value: &str) {
        unsafe {
            ffi::as_component_set_project_group(
                self.as_ref().to_glib_none().0,
                value.to_glib_none().0,
            );
        }
    }

    /// Set the project license.
    /// ## `value`
    /// the project license.
    #[doc(alias = "as_component_set_project_license")]
    #[doc(alias = "project-license")]
    fn set_project_license(&self, value: &str) {
        unsafe {
            ffi::as_component_set_project_license(
                self.as_ref().to_glib_none().0,
                value.to_glib_none().0,
            );
        }
    }

    /// Set a new set of releases for this component.
    /// ## `releases`
    /// the [`ReleaseList`][crate::ReleaseList] to use.
    #[doc(alias = "as_component_set_releases")]
    fn set_releases(&self, releases: &impl IsA<ReleaseList>) {
        unsafe {
            ffi::as_component_set_releases(
                self.as_ref().to_glib_none().0,
                releases.as_ref().to_glib_none().0,
            );
        }
    }

    /// Sets the [`ComponentScope`][crate::ComponentScope] of this component.
    /// ## `scope`
    /// the [`ComponentKind`][crate::ComponentKind].
    #[doc(alias = "as_component_set_scope")]
    fn set_scope(&self, scope: ComponentScope) {
        unsafe {
            ffi::as_component_set_scope(self.as_ref().to_glib_none().0, scope.into_glib());
        }
    }

    /// Sets the sorting score of this component.
    /// ## `score`
    /// the given sorting score
    #[doc(alias = "as_component_set_sort_score")]
    fn set_sort_score(&self, score: u32) {
        unsafe {
            ffi::as_component_set_sort_score(self.as_ref().to_glib_none().0, score);
        }
    }

    /// ## `spkgname`
    /// the source package name.
    #[doc(alias = "as_component_set_source_pkgname")]
    fn set_source_pkgname(&self, spkgname: &str) {
        unsafe {
            ffi::as_component_set_source_pkgname(
                self.as_ref().to_glib_none().0,
                spkgname.to_glib_none().0,
            );
        }
    }

    /// Set a short description for this component.
    /// ## `value`
    /// The summary
    /// ## `locale`
    /// The BCP47 locale for this value, or [`None`] to use the current active one.
    #[doc(alias = "as_component_set_summary")]
    #[doc(alias = "summary")]
    fn set_summary(&self, value: &str, locale: Option<&str>) {
        unsafe {
            ffi::as_component_set_summary(
                self.as_ref().to_glib_none().0,
                value.to_glib_none().0,
                locale.to_glib_none().0,
            );
        }
    }

    /// Reorder the screenshots to prioritize a certain environment or style, instead of using the default
    /// screenshot order.
    ///
    /// If both "environment" and "style" are [`None`], the previous default order is restored.
    /// ## `environment`
    /// a GUI environment string, e.g. "plasma" or "gnome"
    /// ## `style`
    /// and environment style string, e.g. "light" or "dark"
    /// ## `prioritize_style`
    /// if [`true`], order screenshots of the given style earlier than ones of the given environment.
    #[doc(alias = "as_component_sort_screenshots")]
    fn sort_screenshots(
        &self,
        environment: Option<&str>,
        style: Option<&str>,
        prioritize_style: bool,
    ) {
        unsafe {
            ffi::as_component_sort_screenshots(
                self.as_ref().to_glib_none().0,
                environment.to_glib_none().0,
                style.to_glib_none().0,
                prioritize_style.into_glib(),
            );
        }
    }

    /// Returns a string identifying this component.
    /// (useful for debugging)
    ///
    /// # Returns
    ///
    /// A descriptive string
    #[doc(alias = "as_component_to_string")]
    #[doc(alias = "to_string")]
    fn to_str(&self) -> glib::GString {
        unsafe { from_glib_full(ffi::as_component_to_string(self.as_ref().to_glib_none().0)) }
    }

    /// Serialize this component into an XML string.
    /// You normally do not want to use this method directly and instead use the more
    /// convenient API of [`Metadata`][crate::Metadata] to serialize components.
    /// ## `context`
    /// an [`Context`][crate::Context] instance.
    ///
    /// # Returns
    ///
    /// [`true`] on success.
    #[doc(alias = "as_component_to_xml_data")]
    fn to_xml_data(&self, context: &impl IsA<Context>) -> Result<glib::GString, glib::Error> {
        unsafe {
            let mut error = std::ptr::null_mut();
            let ret = ffi::as_component_to_xml_data(
                self.as_ref().to_glib_none().0,
                context.as_ref().to_glib_none().0,
                &mut error,
            );
            if error.is_null() {
                Ok(from_glib_full(ret))
            } else {
                Err(from_glib_full(error))
            }
        }
    }

    //fn urls(&self) -> /*Unimplemented*/HashTable TypeId { ns_id: 1, id: 39 }/TypeId { ns_id: 0, id: 28 } {
    //    ObjectExt::property(self.as_ref(), "urls")
    //}

    #[doc(alias = "categories")]
    fn connect_categories_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_categories_trampoline<
            P: IsA<Component>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::AsComponent,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Component::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::categories\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_categories_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "description")]
    fn connect_description_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_description_trampoline<
            P: IsA<Component>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::AsComponent,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Component::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::description\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_description_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "icons")]
    fn connect_icons_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_icons_trampoline<P: IsA<Component>, F: Fn(&P) + 'static>(
            this: *mut ffi::AsComponent,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Component::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::icons\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_icons_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "id")]
    fn connect_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_id_trampoline<P: IsA<Component>, F: Fn(&P) + 'static>(
            this: *mut ffi::AsComponent,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Component::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::id\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_id_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "keywords")]
    fn connect_keywords_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_keywords_trampoline<P: IsA<Component>, F: Fn(&P) + 'static>(
            this: *mut ffi::AsComponent,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Component::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::keywords\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_keywords_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "kind")]
    fn connect_kind_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_kind_trampoline<P: IsA<Component>, F: Fn(&P) + 'static>(
            this: *mut ffi::AsComponent,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Component::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::kind\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_kind_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "name")]
    fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_name_trampoline<P: IsA<Component>, F: Fn(&P) + 'static>(
            this: *mut ffi::AsComponent,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Component::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::name\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_name_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "pkgnames")]
    fn connect_pkgnames_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_pkgnames_trampoline<P: IsA<Component>, F: Fn(&P) + 'static>(
            this: *mut ffi::AsComponent,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Component::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::pkgnames\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_pkgnames_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "project-group")]
    fn connect_project_group_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_project_group_trampoline<
            P: IsA<Component>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::AsComponent,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Component::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::project-group\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_project_group_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "project-license")]
    fn connect_project_license_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_project_license_trampoline<
            P: IsA<Component>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::AsComponent,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Component::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::project-license\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_project_license_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "screenshots")]
    fn connect_screenshots_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_screenshots_trampoline<
            P: IsA<Component>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::AsComponent,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Component::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::screenshots\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_screenshots_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "summary")]
    fn connect_summary_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_summary_trampoline<P: IsA<Component>, F: Fn(&P) + 'static>(
            this: *mut ffi::AsComponent,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Component::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::summary\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_summary_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "urls")]
    fn connect_urls_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_urls_trampoline<P: IsA<Component>, F: Fn(&P) + 'static>(
            this: *mut ffi::AsComponent,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Component::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::urls\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_urls_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }
}

impl<O: IsA<Component>> ComponentExt for O {}