810bfb54c7a14b288b84bfc1b787ece85538f8d0
[apps/home/mobileprint.git] / mobileprint / include / preview_model.h
1 /*
2 *  Mobileprint
3 *
4 * Copyright 2012  Samsung Electronics Co., Ltd
5
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
9
10 * http://floralicense.org/license/
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 */
19
20 #ifndef _PREVIEW_MODEL_H_INCLUDED_
21 #define _PREVIEW_MODEL_H_INCLUDED_
22
23 struct preview_model;
24
25 #include <paper_size.h>
26 #include <pdfgen.h>
27
28 #include "preview_task_model.h"
29
30
31 enum preview_page_state {
32         PREVIEW_PAGE_STATE_NA = 0,
33         PREVIEW_PAGE_STATE_PROCESSING,
34         /*PREVIEW_PAGE_STATE_SIZE_READY,*/ /* TODO */
35         PREVIEW_PAGE_STATE_READY,
36         PREVIEW_PAGE_STATE_ERROR
37 };
38
39 #if 0
40 struct preview_page_info {
41         enum preview_page_state page_state;
42         /* TODO: page data */
43 };
44 #endif
45
46 struct preview_engine;
47
48 struct preview_conf {
49         int pages_count;
50         char *initial_fname;
51         char *fname;
52         char *ppd; /*PPD file name*/
53         //int is_original_size;
54         struct page_scale scale;
55         int n_up;
56         enum page_orientation orientation;
57         struct paper_size_pts paper_size;
58         struct size_px max_available_size_px;
59         int is_grayscale;
60 };
61
62 struct preview_model {
63         //int pages_count;
64         enum preview_page_state *pages_state;
65         struct preview_conf conf;
66         //struct preview_task_model *task_model;
67         struct preview_engine *engine;
68 };
69
70 #include "preview_engine.h"
71
72
73 int init_preview_model(struct preview_model *model,
74                                            const struct preview_conf *conf,
75                                            struct preview_engine *engine);
76 void destroy_preview_model(struct preview_model *model);
77 int preview_model_request_page(struct preview_model *model, int page);
78 int preview_model_page_available(struct preview_model *model,
79                                                                  enum preview_engine_event_status status, int page);
80
81
82 #endif /* _PREVIEW_MODEL_H_INCLUDED_ */
83