4 * Copyright 2012 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.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
10 * http://floralicense.org/license/
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.
20 #ifndef __PRINT_SERVICE_H__
21 #define __PRINT_SERVICE_H__
23 #include <cups/cups.h>
28 #define CUPS_161_UPGRADE
30 #define MAX_URI_SIZE (512)
33 char product_ui_name[PT_MAX_LENGTH]; /* product display name in UI */
34 char device_info[PT_MAX_LENGTH]; /* printer info used as key of hashtable*/
35 char device_uri[PT_MAX_LENGTH]; /* url */
36 char model_name[PT_MAX_LENGTH]; /* mdl name */
37 char manufacturer[PT_MAX_LENGTH]; /* mfg name */
38 char ppd_file_path[PT_MAX_LENGTH]; /** ppd file name (with full path) */
39 // int color; /* 0-F, 1-T, 2-U */
40 // int duplex; /* 0-F, 1-T, 2-U */
45 pt_printer_info_t *printer_info;
46 pt_printer_status_t *printer_status;
50 } pt_printer_status_t;
53 pts_printing_data_t *data;
55 pt_notification_t *notification_plugin;
56 pt_print_option_t *option;
67 int copies; /** the number of copies */
68 int orientation; /** 0- portrait mode,
71 pt_paper_size_e papersize; /** reserved, paper size */
73 #if 0 // copied from pt_printer_mgr_t
74 int copies; /** print copy number */
75 int size; /** paper size */
76 pt_orientation_e landscape; /** orientation */
77 pt_scaling_e scaling; /** scaling mode */
78 pt_image_size_option_e imagesize; /** image size */
79 pt_range_e range; /** printing range */
80 // pt_grayscale_t grayscale; /** colour mode */
81 // pt_quality_t quality; /** quality */
82 // pt_paper_t paper; /** paper type */
88 int priority; /** priority (1-100) */
92 pt_job_state_e status; /** job status */
93 char title[PT_MAX_LENGTH]; /** title/job name */
94 char user[PT_MAX_LENGTH]; /** reserved, username who submitted the job */
95 pt_printer_mgr_t *printer; /** the pointer to the associated printer object */
100 Eina_List *pt_local_list;
101 pt_response_data_t response_data;
102 get_printers_cb user_cb;
107 PT_SEARCH_IN_PROGRESS,
110 } pt_searching_state_e;
116 PT_PRINT_IN_PROGRESS,
121 } pt_printing_state_e;
126 Ecore_Thread *printing_thd_hdl;
127 pt_job_info_t *job; /** job info */
128 pt_printing_state_e printing_state;
129 Ecore_Timer *job_noti_timer;
134 pt_connection_type_e connect_type; /** assigned connection type */
135 pt_printer_mgr_t *active_printer; /** active printer info */
136 pt_print_option_t *option; /** print option */
137 pt_search_data_t *search;
139 cups_option_t *job_options;
140 int num_options; /** print job option */
142 int ueventsocket; /* hotplug event socket */
143 int avahi_pid; /* avahi pid */
144 int cups_pid; /* cups pid */
146 Ecore_Timer *cups_checking_timer;
147 Ecore_Thread *searching_thd_hdl;
148 pt_searching_state_e searching_state;
149 Eina_List *printing_thd_list;
155 extern pt_info_t *g_pt_info; /** print info maintained globally */
158 void pt_parse_options(ppd_file_t *ppd);
159 ppd_choice_t *pt_selected_choice(int op);
160 ppd_size_t *pt_utils_paper_size_pts(const char *name);
162 #endif /* __PRINT_SERVICE_H__ */