2 * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #include "clipboard.h"
23 #define LOG_TAG "ISE_DEFAULT"
30 static cbhm_h cbhm_handle = NULL;
33 static sclu32 cbhm_sel_type = 0;
34 static sclboolean g_set_mime_type = FALSE;
39 cbhm_open_service(&cbhm_handle);
43 void clipboard_shutdown()
46 cbhm_close_service(cbhm_handle);
57 ret = cbhm_selection_type_set(cbhm_handle, static_cast<cbhm_sel_type_e>(cbhm_sel_type));
59 ret = cbhm_selection_type_set(cbhm_handle, CBHM_SEL_TYPE_TEXT);
61 if (ret != CBHM_ERROR_NONE)
62 LOGW("Failed to set selection type in cbhm. error : %d\n", ret);
64 ret = cbhm_show(cbhm_handle);
65 if (ret != CBHM_ERROR_NONE) {
66 LOGW("cbhm show error : %d\n", ret);
78 void clipboard_set_mime_type(bool mime_type)
80 g_set_mime_type = mime_type;
83 void clipboard_init_sel_type()
88 void clipboard_add_sel_type(CLIPBOARD_SEL_TYPE sel_type)
93 case CLIPBOARD_SEL_TEXT:
94 cbhm_sel_type |= CBHM_SEL_TYPE_TEXT;
96 case CLIPBOARD_SEL_IMAGE:
97 cbhm_sel_type |= CBHM_SEL_TYPE_IMAGE;