2 * Copyright (c) 2014 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.
17 #include <Elementary.h>
26 #include <MediaContentDbListener.h>
27 #include <UsbConnectionListener.h>
28 #include "SourceCtxPopup.h"
30 const char *srcbtnids[] = {
36 const char *sourcetext[] = {
42 void CSourceCtxPopup::t_OnConfiguration(void)
44 int size = ARRAY_SIZE(sourcetext);
46 CUsbConnectionListener usb;
48 if (!usb.FlagConnected())
52 t_SetList(sourcetext, size, (int)CInfo::SourceType(),
53 CCtxPopup::TOPBTN_SOURCE, srcbtnids,
54 POSITION_SOURCE_POPUP_X, POSITION_SOURCE_POPUP_Y);
58 void CSourceCtxPopup::t_OnBtnClicked(Evas_Object* obj, void* ev)
64 const char *id = (const char*)evas_object_data_get(obj, FBR_BTN_ID);
71 int arrsize = ARRAY_SIZE(srcbtnids);
72 for (i = 0; i < arrsize; i++) {
73 if (srcbtnids[i] && !strcmp(srcbtnids[i], id)) {
78 if (index == -1 || index == CInfo::SourceType())
81 CInfo::SetSourceType(index);
82 CCtxPopup::t_OnBtnClicked(obj, ev);
87 const char* CSourceCtxPopup::SourceText(int index)
89 return sourcetext[index];