/* * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __BUS_H__ #define __BUS_H__ #include #include struct bus; struct client_bus; enum bus_op { BUS_OP_ADD_LABEL, BUS_OP_ADD_ALBUM, BUS_OP_ADD_CONTENT, BUS_OP_ADD_PIN, BUS_OP_MAX }; enum bus_data_action_op { BUS_DATA_ACTION_LAUNCH_NONE, BUS_DATA_ACTION_LAUNCH_APP, BUS_DATA_ACTION_LAUNCH_SERVICE, BUS_DATA_ACTION_MAX }; enum bus_data_content_type { BUS_DATA_CONTENT_IMAGE, BUS_DATA_CONTENT_VIDEO, BUS_DATA_CONTENT_MUSIC, BUS_DATA_CONTENT_BROADCAST, BUS_DATA_CONTENT_APP, BUS_DATA_CONTENT_SOURCE, BUS_DATA_CONTENT_NOTIFICATION_NOTI, BUS_DATA_CONTENT_NOTIFICATION_ONGOING, BUS_DATA_CONTENT_HISTORY, BUS_DATA_CONTENT_MAX }; enum bus_data_pin_type { BUS_DATA_PIN_CHANNEL, BUS_DATA_PIN_PACKAGE, BUS_DATA_PIN_MAX }; #define BUS_DATA_ALBUM_CONTENT_MAX 6 struct bus_data_label { const char *svcid; const char *title; enum bus_data_action_op action; const char *actor; const char *args; }; struct bus_data_content { const char *svcid; enum bus_data_content_type type; const char *title; const char *subtitle; const char *description; const char *detail; const char *thumbnail; const char *icon; }; struct bus_data_pin { const char *svcid; enum bus_data_pin_type type; const char *title; const char *icon; const char *pinid; }; struct bus_data_album { const char *svcid; const char *title; struct bus_data_content contents[BUS_DATA_ALBUM_CONTENT_MAX]; int content_cnt; }; struct bus_data_action { enum bus_data_action_op action; const char *actor; const char *args; }; struct bus_cbs { void (*ready)(struct bus *bus, void *data); int (*add_ctnt)(struct bus *bus, enum bus_op op, void *opdata, struct bus_data_action *act, void *data); int (*del_ctnt)(struct bus *bus, const char *svcid, int ctnt_id, void *data); int (*del_all)(struct bus *bus, const char *svcid, bool reload, void *data); void (*end)(struct bus *bus, void *data); }; struct bus *bus_init(struct bus_cbs *cbs, void *data); void bus_fini(struct bus *bus); int bus_send_signal(struct bus *bus, const char *sig); struct client_bus *bus_client_init(const char *bus_name, const char *object_path, const char *svcid); void bus_client_fini(struct client_bus *cbusinfo); void bus_client_send_svcid(struct client_bus *cbus); #endif /* __BUS_H__ */