Initialize Tizen 2.3
[apps/home/ug-camera-efl.git] / include / cam_error.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.1 (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://floralicense.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
18
19 #include <glib.h>
20 #include <errno.h>
21
22 #ifndef CAMERROR_H_
23 #define CAMERROR_H_
24
25 #define CAM_ERROR_CLASS_COMMON                                                  0x90000000
26 #define CAM_ERROR_CLASS_SYSTEM                                                  0x90000100
27 #define CAM_ERROR_CLASS_FILE                                                            0x90000200
28 #define CAM_ERROR_CLASS_MMCAMCORDER                                             0x90000400
29 #define CAM_ERROR_CLASS_MMPLAYER                                                        0x90000800
30 #define CAM_ERROR_CLASS_MISC                                                            0x90001600
31
32 enum {
33         CAM_ERROR_NONE = 0,
34
35         CAM_ERROR_BATTERY_NOT_ENOUGH = CAM_ERROR_CLASS_SYSTEM,
36         CAM_ERROR_MULTIPLE_INSTANCE,
37         CAM_ERROR_ENTER_REJECTED,
38         CAM_ERROR_DEVICE,
39         CAM_ERROR_STORAGE_UNAVAILABLE,
40         CAM_ERROR_STORAGE_INSUFFICIENT,
41
42         CAM_ERROR_FILE = CAM_ERROR_CLASS_FILE,
43         CAM_ERROR_FILE_MANAGER,
44         CAM_ERROR_FILE_MOVE_FAILED,
45         CAM_ERROR_FILE_REGISTER_FAILED,
46         CAM_ERROR_FILE_NOT_EXISTS,
47         CAM_ERROR_FILE_RENAME_FAILED,
48         CAM_ERROR_FILE_DELETE_FAILED,
49
50         CAM_ERROR_MM_CAMCORDER = CAM_ERROR_CLASS_MMCAMCORDER,
51         CAM_ERROR_AUTO_FOCUSING,
52         CAM_ERROR_MISC = CAM_ERROR_CLASS_MISC,
53         CAM_ERROR_QUERY_DB,
54         CAM_ERROR_PANORAMA_LIB,
55         CAM_ERROR_NCR_LIB,
56         CAM_ERROR_NORMAL,
57         CAM_ERROR_DEVICE_OFF,
58         CAM_ERROR_MEMORY,
59         CAM_ERROR_UNKNOWN,
60 };
61
62 #define CAMERA_ERROR_QUARK                                              g_quark_from_static_string("camera-error-quark")
63
64 #define cam_error_new(code, fmt, arg...)                        g_error_new(CAMERA_ERROR_QUARK, code, fmt, ##arg)
65 #define cam_error_new_literal(code, msg)                        g_error_new_literal(CAMERA_ERROR_QUARK, code, msg)
66 #define cam_set_error(error, code, fmt, arg...) g_set_error(error, CAMERA_ERROR_QUARK, code, fmt, ##arg)
67
68 #endif                          /* CAMERROR_H_ */