ohos-basic-services-kit-sys 0.1.0

Raw bindings to the BasicServicesKit NDK of OpenHarmony
Documentation
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
// automatically generated by rust-bindgen 0.71.1

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl Print_ErrorCode {
    /// The operation is successful.
    pub const PRINT_ERROR_NONE: Print_ErrorCode = Print_ErrorCode(0);
    /// Permission verification failed.
    pub const PRINT_ERROR_NO_PERMISSION: Print_ErrorCode = Print_ErrorCode(201);
    /// Invalid parameter.
    pub const PRINT_ERROR_INVALID_PARAMETER: Print_ErrorCode = Print_ErrorCode(401);
    /// General internal error.
    pub const PRINT_ERROR_GENERIC_FAILURE: Print_ErrorCode = Print_ErrorCode(24300001);
    /// RPC communication error.
    pub const PRINT_ERROR_RPC_FAILURE: Print_ErrorCode = Print_ErrorCode(24300002);
    /// Server error.
    pub const PRINT_ERROR_SERVER_FAILURE: Print_ErrorCode = Print_ErrorCode(24300003);
    /// Invalid extension.
    pub const PRINT_ERROR_INVALID_EXTENSION: Print_ErrorCode = Print_ErrorCode(24300004);
    /// Invalid printer.
    pub const PRINT_ERROR_INVALID_PRINTER: Print_ErrorCode = Print_ErrorCode(24300005);
    /// Invalid print job.
    pub const PRINT_ERROR_INVALID_PRINT_JOB: Print_ErrorCode = Print_ErrorCode(24300006);
    /// Failed to read or write files.
    pub const PRINT_ERROR_FILE_IO: Print_ErrorCode = Print_ErrorCode(24300007);
    /// Unknown error.
    pub const PRINT_ERROR_UNKNOWN: Print_ErrorCode = Print_ErrorCode(24300255);
}
#[repr(transparent)]
/// Defines error codes.
///
///
/// Available since API-level: 12
///
/// Version: 1.0
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Print_ErrorCode(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl Print_PrinterState {
    /// Printer idle.
    pub const PRINTER_IDLE: Print_PrinterState = Print_PrinterState(0);
    /// Printer busy.
    pub const PRINTER_BUSY: Print_PrinterState = Print_PrinterState(1);
    /// Printer not available.
    pub const PRINTER_UNAVAILABLE: Print_PrinterState = Print_PrinterState(2);
}
#[repr(transparent)]
/// Indicates printer states.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Print_PrinterState(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl Print_DiscoveryEvent {
    /// Printer discovered.
    pub const PRINTER_DISCOVERED: Print_DiscoveryEvent = Print_DiscoveryEvent(0);
    /// Printer lost.
    pub const PRINTER_LOST: Print_DiscoveryEvent = Print_DiscoveryEvent(1);
    /// Printer connecting.
    pub const PRINTER_CONNECTING: Print_DiscoveryEvent = Print_DiscoveryEvent(2);
    /// Printer connected.
    pub const PRINTER_CONNECTED: Print_DiscoveryEvent = Print_DiscoveryEvent(3);
}
#[repr(transparent)]
/// Indicate printer discovery events.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Print_DiscoveryEvent(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl Print_PrinterEvent {
    /// Printer added.
    pub const PRINTER_ADDED: Print_PrinterEvent = Print_PrinterEvent(0);
    /// Printer deleted.
    pub const PRINTER_DELETED: Print_PrinterEvent = Print_PrinterEvent(1);
    /// Printer state changed.
    pub const PRINTER_STATE_CHANGED: Print_PrinterEvent = Print_PrinterEvent(2);
    /// Printer info changed.
    pub const PRINTER_INFO_CHANGED: Print_PrinterEvent = Print_PrinterEvent(3);
}
#[repr(transparent)]
/// Indicate printer change events.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Print_PrinterEvent(pub ::core::ffi::c_uint);
/// Indicates string list.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Print_StringList {
    /// Number of string.
    pub count: u32,
    /// String pointer array.
    pub list: *mut *mut ::core::ffi::c_char,
}
/// Indicates printer property.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Print_Property {
    /// Property keyword.
    pub key: *mut ::core::ffi::c_char,
    /// Property value.
    pub value: *mut ::core::ffi::c_char,
}
/// List of printer properties.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Print_PropertyList {
    /// Number of properties.
    pub count: u32,
    /// Property pointer array.
    pub list: *mut Print_Property,
}
/// Indicates print resolution in dpi unit.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Print_Resolution {
    pub horizontalDpi: u32,
    pub verticalDpi: u32,
}
/// Indicates printing margin
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Print_Margin {
    /// Left margin.
    pub leftMargin: u32,
    /// Top margin.
    pub topMargin: u32,
    /// Right margin.
    pub rightMargin: u32,
    /// Bottom margin.
    pub bottomMargin: u32,
}
/// Indicates paper size info.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Print_PageSize {
    /// Paper id.
    pub id: *mut ::core::ffi::c_char,
    /// Paper name.
    pub name: *mut ::core::ffi::c_char,
    /// Paper width.
    pub width: u32,
    /// Paper height.
    pub height: u32,
}
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl Print_DuplexMode {
    /// One sided duplex mode.
    pub const DUPLEX_MODE_ONE_SIDED: Print_DuplexMode = Print_DuplexMode(0);
    /// Long edge two sided duplex mode.
    pub const DUPLEX_MODE_TWO_SIDED_LONG_EDGE: Print_DuplexMode = Print_DuplexMode(1);
    /// Short edge two sided duplex mode.
    pub const DUPLEX_MODE_TWO_SIDED_SHORT_EDGE: Print_DuplexMode = Print_DuplexMode(2);
}
#[repr(transparent)]
/// Indicates DuplexMode
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Print_DuplexMode(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl Print_ColorMode {
    /// Monochrome mode.
    pub const COLOR_MODE_MONOCHROME: Print_ColorMode = Print_ColorMode(0);
    /// Color mode.
    pub const COLOR_MODE_COLOR: Print_ColorMode = Print_ColorMode(1);
    /// Auto mode.
    pub const COLOR_MODE_AUTO: Print_ColorMode = Print_ColorMode(2);
}
#[repr(transparent)]
/// Indicates ColorMode
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Print_ColorMode(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl Print_OrientationMode {
    /// Portrait mode.
    pub const ORIENTATION_MODE_PORTRAIT: Print_OrientationMode = Print_OrientationMode(0);
    /// Landscape mode.
    pub const ORIENTATION_MODE_LANDSCAPE: Print_OrientationMode = Print_OrientationMode(1);
    /// Reverse landscape mode.
    pub const ORIENTATION_MODE_REVERSE_LANDSCAPE: Print_OrientationMode = Print_OrientationMode(2);
    /// Reverse portrait mode.
    pub const ORIENTATION_MODE_REVERSE_PORTRAIT: Print_OrientationMode = Print_OrientationMode(3);
    /// Not specified.
    pub const ORIENTATION_MODE_NONE: Print_OrientationMode = Print_OrientationMode(4);
}
#[repr(transparent)]
/// Indicates OrientationMode
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Print_OrientationMode(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl Print_Quality {
    /// Draft quality mode
    pub const PRINT_QUALITY_DRAFT: Print_Quality = Print_Quality(3);
    /// Normal quality mode
    pub const PRINT_QUALITY_NORMAL: Print_Quality = Print_Quality(4);
    /// High quality mode
    pub const PRINT_QUALITY_HIGH: Print_Quality = Print_Quality(5);
}
#[repr(transparent)]
/// Indicates printing qulity
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Print_Quality(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl Print_DocumentFormat {
    /// MIME: application/octet-stream.
    pub const DOCUMENT_FORMAT_AUTO: Print_DocumentFormat = Print_DocumentFormat(0);
    /// MIME: image/jpeg.
    pub const DOCUMENT_FORMAT_JPEG: Print_DocumentFormat = Print_DocumentFormat(1);
    /// MIME: application/pdf.
    pub const DOCUMENT_FORMAT_PDF: Print_DocumentFormat = Print_DocumentFormat(2);
    /// MIME: application/postscript.
    pub const DOCUMENT_FORMAT_POSTSCRIPT: Print_DocumentFormat = Print_DocumentFormat(3);
    /// MIME: text/plain.
    pub const DOCUMENT_FORMAT_TEXT: Print_DocumentFormat = Print_DocumentFormat(4);
}
#[repr(transparent)]
/// Indicates the MIME media type of the document.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Print_DocumentFormat(pub ::core::ffi::c_uint);
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
impl Print_JobDocAdapterState {
    /// Print job preview ability destroy.
    pub const PRINT_DOC_ADAPTER_PREVIEW_ABILITY_DESTROY: Print_JobDocAdapterState =
        Print_JobDocAdapterState(0);
    /// Print job task succeed.
    pub const PRINT_DOC_ADAPTER_PRINT_TASK_SUCCEED: Print_JobDocAdapterState =
        Print_JobDocAdapterState(1);
    /// Print job task failed.
    pub const PRINT_DOC_ADAPTER_PRINT_TASK_FAIL: Print_JobDocAdapterState =
        Print_JobDocAdapterState(2);
    /// Print job task cancel.
    pub const PRINT_DOC_ADAPTER_PRINT_TASK_CANCEL: Print_JobDocAdapterState =
        Print_JobDocAdapterState(3);
    /// Print job task block.
    pub const PRINT_DOC_ADAPTER_PRINT_TASK_BLOCK: Print_JobDocAdapterState =
        Print_JobDocAdapterState(4);
    /// Print job task preview ability destroy for cancel.
    pub const PRINT_DOC_ADAPTER_PREVIEW_ABILITY_DESTROY_FOR_CANCELED: Print_JobDocAdapterState =
        Print_JobDocAdapterState(5);
    /// Print job task preview ability destroy for started.
    pub const PRINT_DOC_ADAPTER_PREVIEW_ABILITY_DESTROY_FOR_STARTED: Print_JobDocAdapterState =
        Print_JobDocAdapterState(6);
}
#[repr(transparent)]
/// Indicates the print job doc adapter state.
///
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Print_JobDocAdapterState(pub ::core::ffi::c_uint);
/// Indicates printer capabilities.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Print_PrinterCapability {
    /// Array of supported color mode.
    pub supportedColorModes: *mut Print_ColorMode,
    /// Number of supported color mode.
    pub supportedColorModesCount: u32,
    /// Array of supported duplex printing modes.
    pub supportedDuplexModes: *mut Print_DuplexMode,
    /// Number of supported duplex printing mode.
    pub supportedDuplexModesCount: u32,
    /// Array of supported print paper sizes.
    pub supportedPageSizes: *mut Print_PageSize,
    /// Number of supported print paper sizes.
    pub supportedPageSizesCount: u32,
    /// Supported print media types in json string array format.
    pub supportedMediaTypes: *mut ::core::ffi::c_char,
    /// Array of supported print qulities.
    pub supportedQualities: *mut Print_Quality,
    /// Number of supported print qulities.
    pub supportedQualitiesCount: u32,
    /// Supported paper sources in json string array format.
    pub supportedPaperSources: *mut ::core::ffi::c_char,
    /// Supported copies.
    pub supportedCopies: u32,
    /// Array of supported printer resolutions.
    pub supportedResolutions: *mut Print_Resolution,
    /// Number of supported printer resolutions.
    pub supportedResolutionsCount: u32,
    /// Array of supported orientation.
    pub supportedOrientations: *mut Print_OrientationMode,
    /// Number of supported orientation.
    pub supportedOrientationsCount: u32,
    /// Advanced capability in json format.
    pub advancedCapability: *mut ::core::ffi::c_char,
}
/// Indicates current properties
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Print_DefaultValue {
    /// Default color mode.
    pub defaultColorMode: Print_ColorMode,
    /// Default duplex mode.
    pub defaultDuplexMode: Print_DuplexMode,
    /// Default media type.
    pub defaultMediaType: *mut ::core::ffi::c_char,
    /// Default page size id.
    pub defaultPageSizeId: *mut ::core::ffi::c_char,
    /// Default margin.
    pub defaultMargin: Print_Margin,
    /// Default paper source.
    pub defaultPaperSource: *mut ::core::ffi::c_char,
    /// Default print quality
    pub defaultPrintQuality: Print_Quality,
    /// Default copies.
    pub defaultCopies: u32,
    /// Default printer resolution.
    pub defaultResolution: Print_Resolution,
    /// Default orientation.
    pub defaultOrientation: Print_OrientationMode,
    /// Other default values in json format.
    pub otherDefaultValues: *mut ::core::ffi::c_char,
}
/// Indicates printer information.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Print_PrinterInfo {
    /// Printer state.
    pub printerState: Print_PrinterState,
    /// Printer capabilities.
    pub capability: Print_PrinterCapability,
    /// Printer current properties.
    pub defaultValue: Print_DefaultValue,
    /// Default printer.
    pub isDefaultPrinter: bool,
    /// Printer id.
    pub printerId: *mut ::core::ffi::c_char,
    /// Printer name.
    pub printerName: *mut ::core::ffi::c_char,
    /// Printer description.
    pub description: *mut ::core::ffi::c_char,
    /// Printer location.
    pub location: *mut ::core::ffi::c_char,
    /// Printer make and model information.
    pub makeAndModel: *mut ::core::ffi::c_char,
    /// Printer Uri.
    pub printerUri: *mut ::core::ffi::c_char,
    /// Detail information in json format.
    pub detailInfo: *mut ::core::ffi::c_char,
}
/// Indicates PrintJob Structure.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Print_PrintJob {
    /// Job name.
    pub jobName: *mut ::core::ffi::c_char,
    /// Array of file descriptors to print.
    pub fdList: *mut u32,
    /// Number of file descriptors to print.
    pub fdListCount: u32,
    /// Printer id.
    pub printerId: *mut ::core::ffi::c_char,
    /// Number of copies printed.
    pub copyNumber: u32,
    /// Paper source.
    pub paperSource: *mut ::core::ffi::c_char,
    /// Media type.
    pub mediaType: *mut ::core::ffi::c_char,
    /// Paper size id.
    pub pageSizeId: *mut ::core::ffi::c_char,
    /// Color mode.
    pub colorMode: Print_ColorMode,
    /// Duplex source.
    pub duplexMode: Print_DuplexMode,
    /// Print resolution in dpi.
    pub resolution: Print_Resolution,
    /// Print margin.
    pub printMargin: Print_Margin,
    /// Borderless.
    pub borderless: bool,
    /// Orientation mode.
    pub orientationMode: Print_OrientationMode,
    /// Print quality.
    pub printQuality: Print_Quality,
    /// Document format.
    pub documentFormat: Print_DocumentFormat,
    /// Advanced options in json format.
    pub advancedOptions: *mut ::core::ffi::c_char,
}
/// Indicates print range structure.
///
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Print_Range {
    /// Print start page.
    pub startPage: u32,
    /// Print end page.
    pub endPage: u32,
    /// Print page array length.
    pub pagesArrayLen: u32,
    /// Print page array.
    pub pagesArray: *mut u32,
}
/// Indicates print attributes structure.
///
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Print_PrintAttributes {
    /// Print ranges.
    pub pageRange: Print_Range,
    /// Print page size.
    pub pageSize: Print_PageSize,
    /// Print margin.
    pub pageMargin: Print_Margin,
    /// Copy numbers.
    pub copyNumber: u32,
    /// Duplex mode.
    pub duplexMode: u32,
    /// color mode.
    pub colorMode: u32,
    /// Print sequential.
    pub isSequential: bool,
    /// Print orient.
    pub isLandscape: bool,
    /// Print option flag.
    pub hasOption: bool,
    /// Print options.
    pub options: [::core::ffi::c_char; 256usize],
}
/// Write files result callback.
///
/// # Arguments
///
/// * `jobId` - The print job id of one print task.
///
/// * `code` - The result of write files.
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub type Print_WriteResultCallback =
    ::core::option::Option<unsafe extern "C" fn(jobId: *const ::core::ffi::c_char, code: u32)>;
/// Print start layout callback.
///
/// # Arguments
///
/// * `jobId` - The print job id of one print task.
///
/// * `fd` - The file descriptor to be written.
///
/// * `oldAttrs` - The attribute of last.
///
/// * `newAttrs` - The attribute of current.
///
/// * `writeCallback` - The Write files result callback.
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub type Print_OnStartLayoutWrite = ::core::option::Option<
    unsafe extern "C" fn(
        jobId: *const ::core::ffi::c_char,
        fd: u32,
        oldAttrs: *const Print_PrintAttributes,
        newAttrs: *const Print_PrintAttributes,
        writeCallback: Print_WriteResultCallback,
    ),
>;
/// Print job state callback.
///
/// # Arguments
///
/// * `jobId` - The print job id of one print task.
///
/// * `state` - The state of current print job.
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
pub type Print_OnJobStateChanged =
    ::core::option::Option<unsafe extern "C" fn(jobId: *const ::core::ffi::c_char, state: u32)>;
/// Indicates print doc state callback structure.
///
///
/// Available since API-level: 13
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Print_PrintDocCallback {
    /// Print start layout callback.
    pub startLayoutWriteCb: Print_OnStartLayoutWrite,
    /// Print job state callback.
    pub jobStateChangedCb: Print_OnJobStateChanged,
}
/// Printer discovery callback.
///
/// # Arguments
///
/// * `event` - The printer discovery event during printer discovery.
///
/// * `printerInfo` - The printer infomation at the time of the discovery event.
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub type Print_PrinterDiscoveryCallback = ::core::option::Option<
    unsafe extern "C" fn(event: Print_DiscoveryEvent, printerInfo: *const Print_PrinterInfo),
>;
/// Printer change callback.
///
/// # Arguments
///
/// * `event` - The printer change event while the printer service is running.
///
/// * `printerInfo` - The printer infomation at the time of the change event.
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub type Print_PrinterChangeCallback = ::core::option::Option<
    unsafe extern "C" fn(event: Print_PrinterEvent, printerInfo: *const Print_PrinterInfo),
>;
extern "C" {
    /// This API checks and pulls up the print service, initializes the print client,
    /// and establishes a connection to the print service.
    ///
    /// `ohos.permission.PRINT`
    ///
    /// # Returns
    ///
    /// * Returns [`Print_ErrorCode#PRINT_ERROR_NONE`] if the execution is successful.
    /// [`PRINT_ERROR_NO_PERMISSION`] The permission `ohos.permission.PRINT` is needed.
    /// [`PRINT_ERROR_RPC_FAILURE`] Unable to connect to the print service.
    /// [`PRINT_ERROR_SERVER_FAILURE`] The cups service cannot be started.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_Init() -> Print_ErrorCode;
    /// This API closes the connection from the print service, dissolves the previous callback,
    /// and releases the print client resources.
    ///
    ///
    /// # Returns
    ///
    /// * Returns [`Print_ErrorCode#PRINT_ERROR_NONE`] if the execution is successful.
    /// Currently no other error codes will be returned.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_Release() -> Print_ErrorCode;
    /// This API starts discovering printers.
    ///
    /// `ohos.permission.PRINT`
    /// # Arguments
    ///
    /// * `callback` - The [`Print_PrinterDiscoveryCallback`] of printer discovery event.
    ///
    /// # Returns
    ///
    /// * Returns [`Print_ErrorCode#PRINT_ERROR_NONE`] if the execution is successful.
    /// [`PRINT_ERROR_NO_PERMISSION`] The permission `ohos.permission.PRINT` is needed.
    /// [`PRINT_ERROR_RPC_FAILURE`] Unable to connect to the print service ability.
    /// [`PRINT_ERROR_SERVER_FAILURE`] Failed to query print extension list from BMS.
    /// [`PRINT_ERROR_INVALID_EXTENSION`] No available print extensions found.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_StartPrinterDiscovery(
        callback: Print_PrinterDiscoveryCallback,
    ) -> Print_ErrorCode;
    /// This API stops discovering printers.
    ///
    /// `ohos.permission.PRINT`
    ///
    /// # Returns
    ///
    /// * Returns [`Print_ErrorCode#PRINT_ERROR_NONE`] if the execution is successful.
    /// [`PRINT_ERROR_NO_PERMISSION`] The permission `ohos.permission.PRINT` is needed.
    /// [`PRINT_ERROR_RPC_FAILURE`] Unable to connect to the print service.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_StopPrinterDiscovery() -> Print_ErrorCode;
    /// This API connects to the printer using the printer id.
    ///
    /// `ohos.permission.PRINT`
    /// # Arguments
    ///
    /// * `printerId` - The id of the printer to be connected.
    ///
    /// # Returns
    ///
    /// * Returns [`Print_ErrorCode#PRINT_ERROR_NONE`] if the execution is successful.
    /// [`PRINT_ERROR_NO_PERMISSION`] The permission `ohos.permission.PRINT` is needed.
    /// [`PRINT_ERROR_RPC_FAILURE`] Unable to connect to the print service.
    /// [`PRINT_ERROR_INVALID_PRINTER`] The printer should be in the list of discovered printers.
    /// [`PRINT_ERROR_SERVER_FAILURE`] Unable to find an extension responsible for the printer.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_ConnectPrinter(printerId: *const ::core::ffi::c_char) -> Print_ErrorCode;
    /// This API starts initiating a print job.
    ///
    /// `ohos.permission.PRINT`
    /// # Arguments
    ///
    /// * `printJob` - A pointer to a [`Print_PrintJob`] instance that specifies the information for the print job.
    ///
    /// # Returns
    ///
    /// * Returns [`Print_ErrorCode#PRINT_ERROR_NONE`] if the execution is successful.
    /// [`PRINT_ERROR_NO_PERMISSION`] The permission `ohos.permission.PRINT` is needed.
    /// [`PRINT_ERROR_RPC_FAILURE`] Unable to connect to the print service.
    /// [`PRINT_ERROR_INVALID_PRINTER`] The printer should be in the list of connected printers.
    /// [`PRINT_ERROR_SERVER_FAILURE`] Unable to create print job in the print service.
    /// [`PRINT_ERROR_INVALID_PRINT_JOB`] Unable to find the job int the job queue.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_StartPrintJob(printJob: *const Print_PrintJob) -> Print_ErrorCode;
    /// This API registers the callback for printer changes.
    ///
    /// `ohos.permission.PRINT`
    /// # Arguments
    ///
    /// * `callback` - The [`Print_PrinterChangeCallback`] to be registered.
    ///
    /// # Returns
    ///
    /// * Returns [`Print_ErrorCode#PRINT_ERROR_NONE`] if the execution is successful.
    /// [`PRINT_ERROR_NO_PERMISSION`] The permission `ohos.permission.PRINT` is needed.
    /// [`PRINT_ERROR_RPC_FAILURE`] Unable to connect to the print service ability.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_RegisterPrinterChangeListener(
        callback: Print_PrinterChangeCallback,
    ) -> Print_ErrorCode;
    /// This API unregisters the callback for printer changes.
    ///
    /// `ohos.permission.PRINT`
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_UnregisterPrinterChangeListener();
    /// This API queries for a list of added printers.
    ///
    /// `ohos.permission.PRINT`
    /// # Arguments
    ///
    /// * `printerIdList` - A pointer to a [`Print_StringList`] instance to store the queried printer id list.
    ///
    /// # Returns
    ///
    /// * Returns [`Print_ErrorCode#PRINT_ERROR_NONE`] if the execution is successful.
    /// [`PRINT_ERROR_NO_PERMISSION`] The permission `ohos.permission.PRINT` is needed.
    /// [`PRINT_ERROR_INVALID_PARAMETER`] printerIdList is NULL.
    /// [`PRINT_ERROR_INVALID_PRINTER`] Unable to query any connected printers.
    /// [`PRINT_ERROR_GENERIC_FAILURE`] Unable to copy the printer id list.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_QueryPrinterList(printerIdList: *mut Print_StringList) -> Print_ErrorCode;
    /// This API frees up the printer list memory for the query.
    ///
    /// # Arguments
    ///
    /// * `printerIdList` - The queried printer id list to be released.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_ReleasePrinterList(printerIdList: *mut Print_StringList);
    /// This API queries printer information based on the printer id.
    ///
    /// `ohos.permission.PRINT`
    /// # Arguments
    ///
    /// * `printerId` - The id of the printer to be queried.
    ///
    /// * `printerInfo` - A pointer to a [`Print_PrinterInfo`] pointer to store the printer infomation.
    ///
    /// # Returns
    ///
    /// * Returns [`Print_ErrorCode#PRINT_ERROR_NONE`] if the execution is successful.
    /// [`PRINT_ERROR_NO_PERMISSION`] The permission `ohos.permission.PRINT` is needed.
    /// [`PRINT_ERROR_RPC_FAILURE`] Unable to connect to the print service.
    /// [`PRINT_ERROR_INVALID_PARAMETER`] printerId is NULL or printerInfo is NULL.
    /// [`PRINT_ERROR_INVALID_PRINTER`] Unable to find the printer in the connected printer list.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_QueryPrinterInfo(
        printerId: *const ::core::ffi::c_char,
        printerInfo: *mut *mut Print_PrinterInfo,
    ) -> Print_ErrorCode;
    /// This API frees up the printer infomation memory for the query.
    ///
    /// # Arguments
    ///
    /// * `printerInfo` - The pointer of the queried printer infomation to be released.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_ReleasePrinterInfo(printerInfo: *mut Print_PrinterInfo);
    /// This API launches the system's printer management window.
    ///
    ///
    /// # Returns
    ///
    /// * Returns [`Print_ErrorCode#PRINT_ERROR_NONE`] if the execution is successful.
    /// [`PRINT_ERROR_GENERIC_FAILURE`] Unable to launch the printer manager window.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_LaunchPrinterManager() -> Print_ErrorCode;
    /// This API queries the corresponding printer property values based on the list of property keywords.
    ///
    /// `ohos.permission.PRINT`
    /// # Arguments
    ///
    /// * `printerId` - The id of the printer to be queried.
    ///
    /// * `propertyKeyList` - The list of property keywords to be queried
    ///
    /// * `propertyList` - The list of printer property values queried.
    ///
    /// # Returns
    ///
    /// * Returns [`Print_ErrorCode#PRINT_ERROR_NONE`] if the execution is successful.
    /// [`PRINT_ERROR_NO_PERMISSION`] The permission `ohos.permission.PRINT` is needed.
    /// [`PRINT_ERROR_INVALID_PARAMETER`] One of the params is NULL or the keyword list is empty.
    /// [`PRINT_ERROR_INVALID_PRINTER`] The printer properties for the specified printer could not be found.
    /// [`PRINT_ERROR_GENERIC_FAILURE`] Unable to copy the printer properties.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_QueryPrinterProperties(
        printerId: *const ::core::ffi::c_char,
        propertyKeyList: *const Print_StringList,
        propertyList: *mut Print_PropertyList,
    ) -> Print_ErrorCode;
    /// This API frees up the property list memory for the query.
    ///
    /// # Arguments
    ///
    /// * `propertyList` - The pointer of the queried printer property values to be released.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_ReleasePrinterProperties(propertyList: *mut Print_PropertyList);
    /// This API sets printer properties based on a list of property key-value pairs.
    ///
    /// `ohos.permission.PRINT`
    /// # Arguments
    ///
    /// * `printerId` - The id of the printer to be set.
    ///
    /// * `propertyList` - The list of printer property values to be set.
    ///
    /// # Returns
    ///
    /// * Returns [`Print_ErrorCode#PRINT_ERROR_NONE`] if the execution is successful.
    /// [`PRINT_ERROR_NO_PERMISSION`] The permission `ohos.permission.PRINT` is needed.
    /// [`PRINT_ERROR_RPC_FAILURE`] Unable to connect to the print service.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_UpdatePrinterProperties(
        printerId: *const ::core::ffi::c_char,
        propertyList: *const Print_PropertyList,
    ) -> Print_ErrorCode;
    /// This API restores printer properties to default settings based on the list of property keywords.
    ///
    /// `ohos.permission.PRINT`
    /// # Arguments
    ///
    /// * `printerId` - The id of the printer to be restored.
    ///
    /// * `propertyKeyList` - The list of property keywords to be restored.
    ///
    /// # Returns
    ///
    /// * Returns [`Print_ErrorCode#PRINT_ERROR_NONE`] if the execution is successful.
    /// [`PRINT_ERROR_NO_PERMISSION`] The permission `ohos.permission.PRINT` is needed.
    /// [`PRINT_ERROR_RPC_FAILURE`] Unable to connect to the print service.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_Print_RestorePrinterProperties(
        printerId: *const ::core::ffi::c_char,
        propertyKeyList: *const Print_StringList,
    ) -> Print_ErrorCode;
    /// This API provide capacity to start print dialog.
    ///
    /// `ohos.permission.PRINT`
    /// # Arguments
    ///
    /// * `printJobName` - The name of this print job.
    ///
    /// * `printDocCallback` - The print doc state callback.
    ///
    /// * `context` - The context of caller app.
    ///
    /// # Returns
    ///
    /// * Returns [`Print_ErrorCode#PRINT_ERROR_NONE`] if the execution is successful.
    /// [`PRINT_ERROR_NO_PERMISSION`] The permission `ohos.permission.PRINT` is needed.
    /// [`PRINT_ERROR_RPC_FAILURE`] Unable to connect to the print service.
    ///
    /// Required System Capabilities: SystemCapability.Print.PrintFramework
    ///
    /// Available since API-level: 13
    #[cfg(feature = "api-13")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
    pub fn OH_Print_StartPrintByNative(
        printJobName: *const ::core::ffi::c_char,
        printDocCallback: Print_PrintDocCallback,
        context: *mut ::core::ffi::c_void,
    ) -> Print_ErrorCode;
}