1. Changed license year
[apps/home/mobileprint.git] / mobileprint / preview_engine / include / preview_model.h
1 /*
2 *  Mobileprint
3 *
4 * Copyright 2013  Samsung Electronics Co., Ltd
5
6 * Licensed under the Flora License, Version 1.1 (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 #include <preview_coords.h>
28
29 #include "preview_task_model.h"
30
31
32 enum preview_page_state {
33         PREVIEW_PAGE_STATE_NA = 0,
34         PREVIEW_PAGE_STATE_PROCESSING,
35         /*PREVIEW_PAGE_STATE_SIZE_READY,*/ /* TODO */
36         PREVIEW_PAGE_STATE_READY,
37         PREVIEW_PAGE_STATE_ERROR
38 };
39
40 #if 0
41 struct preview_page_info {
42         enum preview_page_state page_state;
43         /* TODO: page data */
44 };
45 #endif
46
47 struct preview_engine;
48
49 struct preview_conf {
50         int pages_count;
51         char **initial_fnames;
52         int files_count;
53         char *fname;
54         char *ppd; /*PPD file name*/
55         //int is_original_size;
56         struct page_scale scale;
57         int n_up;
58         struct preview_page_req settings_req;
59         enum page_orientation orientation;
60         struct paper_size_pts paper_size;
61         /*struct size_px max_available_size_px;
62         int is_grayscale;*/
63 };
64
65 struct preview_model {
66         //int pages_count;
67         enum preview_page_state *pages_state;
68         struct preview_conf conf;
69         enum preview_page_state empty_page_state;
70         //struct preview_task_model *task_model;
71         struct preview_engine *engine;
72 };
73
74 #include "preview_engine.h"
75
76
77 void destroy_preview_conf(struct preview_conf *conf);
78 int copy_preview_conf(struct preview_conf *dest,
79                 const struct preview_conf *src);
80
81 int init_preview_model(struct preview_model *model,
82                                            const struct preview_conf *conf,
83                                            struct preview_engine *engine);
84 void destroy_preview_model(struct preview_model *model);
85 int preview_model_request_empty_page(struct preview_model *model);
86 int preview_model_request_page(struct preview_model *model, int page);
87 int preview_model_page_available(struct preview_model *model,
88                                                                  enum preview_engine_event_status status, int page);
89
90
91 #endif /* _PREVIEW_MODEL_H_INCLUDED_ */
92