OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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. |
| 4 |
| 5 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_MENU_H_ |
| 6 #define PPAPI_C_PRIVATE_PPB_FLASH_MENU_H_ |
| 7 |
| 8 #include "ppapi/c/pp_bool.h" |
| 9 #include "ppapi/c/pp_instance.h" |
| 10 #include "ppapi/c/pp_point.h" |
| 11 #include "ppapi/c/pp_resource.h" |
| 12 |
| 13 // PPB_Flash ------------------------------------------------------------------- |
| 14 |
| 15 #define PPB_FLASH_MENU_INTERFACE "PPB_Flash_Menu;1" |
| 16 |
| 17 struct PP_CompletionCallback; |
| 18 |
| 19 typedef enum { |
| 20 // TODO(viettrungluu): Radio items not supported yet. Will also probably want |
| 21 // special menu items tied to clipboard access. |
| 22 PP_FLASH_MENUITEM_TYPE_NORMAL = 0, |
| 23 PP_FLASH_MENUITEM_TYPE_CHECKBOX, |
| 24 PP_FLASH_MENUITEM_TYPE_SEPARATOR, |
| 25 PP_FLASH_MENUITEM_TYPE_SUBMENU |
| 26 } PP_Flash_MenuItem_Type; |
| 27 |
| 28 struct PP_Flash_MenuItem { |
| 29 PP_Flash_MenuItem_Type type; |
| 30 char* name; |
| 31 int32_t id; |
| 32 PP_Bool enabled; |
| 33 PP_Bool checked; |
| 34 struct PP_Flash_Menu* submenu; |
| 35 }; |
| 36 |
| 37 struct PP_Flash_Menu { |
| 38 uint32_t count; |
| 39 struct PP_Flash_MenuItem* items; |
| 40 }; |
| 41 |
| 42 struct PPB_Flash_Menu { |
| 43 PP_Resource (*Create)(PP_Instance instance_id, |
| 44 const struct PP_Flash_Menu* menu_data); |
| 45 PP_Bool (*IsFlashMenu)(PP_Resource resource_id); |
| 46 |
| 47 // Display a context menu at the given location. If the user selects an item, |
| 48 // |selected_id| will be set to its |id| and the callback called with |PP_OK|. |
| 49 // If the user dismisses the menu without selecting an item, |
| 50 // |PP_ERROR_USERCANCEL| will be indicated. |
| 51 int32_t (*Show)(PP_Resource menu_id, |
| 52 const struct PP_Point* location, |
| 53 int32_t* selected_id, |
| 54 PP_CompletionCallback callback); |
| 55 }; |
| 56 |
| 57 #endif // PPAPI_C_PRIVATE_PPB_FLASH_MENU_H_ |
OLD | NEW |