1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
6 /* From private/ppb_flash_menu.idl modified Tue Dec 11 13:47:09 2012. */
8 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_MENU_H_
9 #define PPAPI_C_PRIVATE_PPB_FLASH_MENU_H_
11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_completion_callback.h"
13 #include "ppapi/c/pp_instance.h"
14 #include "ppapi/c/pp_macros.h"
15 #include "ppapi/c/pp_point.h"
16 #include "ppapi/c/pp_resource.h"
17 #include "ppapi/c/pp_stdint.h"
19 /* Struct prototypes */
22 #define PPB_FLASH_MENU_INTERFACE_0_2 "PPB_Flash_Menu;0.2"
23 #define PPB_FLASH_MENU_INTERFACE PPB_FLASH_MENU_INTERFACE_0_2
27 * This file defines the <code>PPB_Flash_Menu</code> interface.
37 * TODO(viettrungluu): Radio items not supported yet. Will also probably want
38 * special menu items tied to clipboard access.
41 PP_FLASH_MENUITEM_TYPE_NORMAL
= 0,
42 PP_FLASH_MENUITEM_TYPE_CHECKBOX
= 1,
43 PP_FLASH_MENUITEM_TYPE_SEPARATOR
= 2,
44 PP_FLASH_MENUITEM_TYPE_SUBMENU
= 3
45 } PP_Flash_MenuItem_Type
;
46 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_MenuItem_Type
, 4);
55 struct PP_Flash_MenuItem
{
56 PP_Flash_MenuItem_Type type
;
61 struct PP_Flash_Menu
* submenu
;
64 struct PP_Flash_Menu
{
66 struct PP_Flash_MenuItem
*items
;
73 * @addtogroup Interfaces
76 struct PPB_Flash_Menu_0_2
{
77 PP_Resource (*Create
)(PP_Instance instance_id
,
78 const struct PP_Flash_Menu
* menu_data
);
79 PP_Bool (*IsFlashMenu
)(PP_Resource resource_id
);
80 /* Display a context menu at the given location. If the user selects an item,
81 * |selected_id| will be set to its |id| and the callback called with |PP_OK|.
82 * If the user dismisses the menu without selecting an item,
83 * |PP_ERROR_USERCANCEL| will be indicated.
85 int32_t (*Show
)(PP_Resource menu_id
,
86 const struct PP_Point
* location
,
88 struct PP_CompletionCallback callback
);
91 typedef struct PPB_Flash_Menu_0_2 PPB_Flash_Menu
;
96 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_MENU_H_ */