1 /*
2  * Copyright (C) 2016 The Android Open Source Project
3  * Copyright (C) 2016 Mopria Alliance, Inc.
4  * Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #ifndef __IFC_PRINTER_CAPABILITIES_H__
19 #define __IFC_PRINTER_CAPABILITIES_H__
20 
21 #include "printer_capabilities_types.h"
22 
23 /*
24  * Interface for handling printer capabilities
25  */
26 typedef struct ifc_printer_capabilities_st {
27     /*
28      * Initialize capabilities handle with conn params
29      */
30     void (*init)(const struct ifc_printer_capabilities_st *this_p,
31             const wprint_connect_info_t *connect_info);
32 
33     /*
34      * Fetch printer capabilities and load them into supplied capabilities structure
35      */
36     status_t (*get_capabilities)(const struct ifc_printer_capabilities_st *this_p,
37             printer_capabilities_t *capabilities);
38 
39     /*
40      * Gets margin info for given paper size
41      */
42     status_t (*get_margins)(const struct ifc_printer_capabilities_st *this_p,
43             const media_size_t paper_size, unsigned char borderless, unsigned char duplex,
44             float *top_margin, float *left_margin, float *right_margin, float *bottom_margin);
45 
46     /*
47      * Destroys printer capabilities handle
48      */
49     void (*destroy)(const struct ifc_printer_capabilities_st *this_p);
50 } ifc_printer_capabilities_t;
51 
52 #endif // __IFC_PRINTER_CAPABILITIES_H__