[TEMP] donot resize twice
[apps/core/preloaded/ug-image-viewer-efl.git] / main / src / include / ivug-crop-view.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *        http://www.tizenopensource.org/license
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __IVUG_CROP_VIEW_H__
18 #define __IVUG_CROP_VIEW_H__
19
20 #include "ivug-define.h"
21
22
23 typedef enum {
24         CROP_ERROR_TYPE_NONE,
25         CROP_ERROR_TYPE_UNKNOWN_FORMAT,
26         CROP_ERROR_TYPE_PERMISSION_DENIED,
27         CROP_ERROR_TYPE_INVALID_FILE,
28         CROP_ERROR_TYPE_GENERAL,
29 } Crop_Error;
30
31 typedef struct {
32         Evas_Object *layout;
33         Evas_Object *notify;
34
35         Evas_Object *photocam;
36         Evas_Object *cropbox;
37
38         Evas_Object *gesture;
39
40         Evas_Object *btn_back;
41
42         Evas_Object *contents_area;
43         Evas_Object *notify_area;
44         Evas_Object *btn_ok;
45
46         bool bShowMenu;
47         char *file_path;
48         char *result_path;
49
50         char *dest_dir;
51         char *dest_name;
52
53         int w;
54         int h;
55
56         int prev_x;
57         int prev_y;
58         int prev_w;
59         int prev_h;
60
61         Ecore_Timer *box_timer;
62
63         int PrevRotate;
64 } IvugCropView;
65
66 /*
67         signals
68                 "loaded" with error code
69                 "ok,clicked"            - Button "OK" clicked with filepath
70                 "cancel,clicked"        - Button "Cancel" clicked
71                 "destroyed"
72 */
73
74 #ifdef __cplusplus
75 extern "C" {
76 #endif
77
78 /* this api is for trasition */
79 void _ivug_crop_view_box_delete(IvugCropView *pCropView);
80
81 IvugCropView *ivug_crop_view_create(Evas_Object *parent);
82
83 bool ivug_crop_view_box_size_set(IvugCropView *pCropView, int w, int h);
84
85 bool ivug_crop_view_box_ratio_fix(IvugCropView *pCropView, bool bFix);
86
87 bool ivug_crop_view_file_set(IvugCropView *pCropView, const char *file);
88
89 bool ivug_crop_view_destination_set(IvugCropView *pCropView, const char *dir, const char *name);
90
91 void ivug_crop_view_destroy(IvugCropView *pCropView);
92
93 Evas_Object *ivug_crop_view_get_object(IvugCropView *pCropView);
94
95 void ivug_crop_view_create_menu(IvugCropView *pCropView, Evas_Object *navi_bar);
96
97 #ifdef __cplusplus
98 }
99 #endif
100
101 #endif          // __IVUG_CROP_VIEW_H__
102