summaryrefslogtreecommitdiffstats
path: root/ppapi/api/private/ppb_flash_menu.idl
blob: 253d8bd722f1261f3fba60638e6d15ef3197d62c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

/**
 * This file defines the <code>PPB_Flash_Menu</code> interface.
 */
label Chrome {
  M14 = 0.2
};

/* Menu item type.
 *
 * TODO(viettrungluu): Radio items not supported yet. Will also probably want
 * special menu items tied to clipboard access.
 */
[assert_size(4)]
enum PP_Flash_MenuItem_Type {
  PP_FLASH_MENUITEM_TYPE_NORMAL = 0,
  PP_FLASH_MENUITEM_TYPE_CHECKBOX = 1,
  PP_FLASH_MENUITEM_TYPE_SEPARATOR = 2,
  PP_FLASH_MENUITEM_TYPE_SUBMENU = 3
};

struct PP_Flash_MenuItem {
  PP_Flash_MenuItem_Type type;
  str_t name;
  int32_t id;
  PP_Bool enabled;
  PP_Bool checked;
  [ref] PP_Flash_Menu submenu;
};

struct PP_Flash_Menu {
  uint32_t count;
  [size_is(count)] PP_Flash_MenuItem[] items;
};

interface PPB_Flash_Menu {
  PP_Resource Create([in] PP_Instance instance_id,
                     [in] PP_Flash_Menu menu_data);
  PP_Bool IsFlashMenu(PP_Resource resource_id);
  /* Display a context menu at the given location. If the user selects an item,
   * |selected_id| will be set to its |id| and the callback called with |PP_OK|.
   * If the user dismisses the menu without selecting an item,
   * |PP_ERROR_USERCANCEL| will be indicated.
   */
  int32_t Show([in] PP_Resource menu_id,
               [in] PP_Point location,
               [out] int32_t selected_id,
               [in] PP_CompletionCallback callback);
};