github.com/ckxng/wakeup@v0.0.0-20190105202853-90356a5f5a15/include/capi/cef_menu_model_capi.h (about) 1 // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 // 3 // Redistribution and use in source and binary forms, with or without 4 // modification, are permitted provided that the following conditions are 5 // met: 6 // 7 // * Redistributions of source code must retain the above copyright 8 // notice, this list of conditions and the following disclaimer. 9 // * Redistributions in binary form must reproduce the above 10 // copyright notice, this list of conditions and the following disclaimer 11 // in the documentation and/or other materials provided with the 12 // distribution. 13 // * Neither the name of Google Inc. nor the name Chromium Embedded 14 // Framework nor the names of its contributors may be used to endorse 15 // or promote products derived from this software without specific prior 16 // written permission. 17 // 18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 // 30 // --------------------------------------------------------------------------- 31 // 32 // This file was generated by the CEF translator tool and should not edited 33 // by hand. See the translator.README.txt file in the tools directory for 34 // more information. 35 // 36 37 #ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_ 38 #define CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_ 39 #pragma once 40 41 #ifdef __cplusplus 42 extern "C" { 43 #endif 44 45 #include "include/capi/cef_base_capi.h" 46 47 48 /// 49 // Supports creation and modification of menus. See cef_menu_id_t for the 50 // command ids that have default implementations. All user-defined command ids 51 // should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The functions of 52 // this structure can only be accessed on the browser process the UI thread. 53 /// 54 typedef struct _cef_menu_model_t { 55 /// 56 // Base structure. 57 /// 58 cef_base_t base; 59 60 /// 61 // Clears the menu. Returns true (1) on success. 62 /// 63 int (CEF_CALLBACK *clear)(struct _cef_menu_model_t* self); 64 65 /// 66 // Returns the number of items in this menu. 67 /// 68 int (CEF_CALLBACK *get_count)(struct _cef_menu_model_t* self); 69 70 // 71 // Add a separator to the menu. Returns true (1) on success. 72 /// 73 int (CEF_CALLBACK *add_separator)(struct _cef_menu_model_t* self); 74 75 // 76 // Add an item to the menu. Returns true (1) on success. 77 /// 78 int (CEF_CALLBACK *add_item)(struct _cef_menu_model_t* self, int command_id, 79 const cef_string_t* label); 80 81 // 82 // Add a check item to the menu. Returns true (1) on success. 83 /// 84 int (CEF_CALLBACK *add_check_item)(struct _cef_menu_model_t* self, 85 int command_id, const cef_string_t* label); 86 87 // 88 // Add a radio item to the menu. Only a single item with the specified 89 // |group_id| can be checked at a time. Returns true (1) on success. 90 /// 91 int (CEF_CALLBACK *add_radio_item)(struct _cef_menu_model_t* self, 92 int command_id, const cef_string_t* label, int group_id); 93 94 // 95 // Add a sub-menu to the menu. The new sub-menu is returned. 96 /// 97 struct _cef_menu_model_t* (CEF_CALLBACK *add_sub_menu)( 98 struct _cef_menu_model_t* self, int command_id, 99 const cef_string_t* label); 100 101 // 102 // Insert a separator in the menu at the specified |index|. Returns true (1) 103 // on success. 104 /// 105 int (CEF_CALLBACK *insert_separator_at)(struct _cef_menu_model_t* self, 106 int index); 107 108 // 109 // Insert an item in the menu at the specified |index|. Returns true (1) on 110 // success. 111 /// 112 int (CEF_CALLBACK *insert_item_at)(struct _cef_menu_model_t* self, int index, 113 int command_id, const cef_string_t* label); 114 115 // 116 // Insert a check item in the menu at the specified |index|. Returns true (1) 117 // on success. 118 /// 119 int (CEF_CALLBACK *insert_check_item_at)(struct _cef_menu_model_t* self, 120 int index, int command_id, const cef_string_t* label); 121 122 // 123 // Insert a radio item in the menu at the specified |index|. Only a single 124 // item with the specified |group_id| can be checked at a time. Returns true 125 // (1) on success. 126 /// 127 int (CEF_CALLBACK *insert_radio_item_at)(struct _cef_menu_model_t* self, 128 int index, int command_id, const cef_string_t* label, int group_id); 129 130 // 131 // Insert a sub-menu in the menu at the specified |index|. The new sub-menu is 132 // returned. 133 /// 134 struct _cef_menu_model_t* (CEF_CALLBACK *insert_sub_menu_at)( 135 struct _cef_menu_model_t* self, int index, int command_id, 136 const cef_string_t* label); 137 138 /// 139 // Removes the item with the specified |command_id|. Returns true (1) on 140 // success. 141 /// 142 int (CEF_CALLBACK *remove)(struct _cef_menu_model_t* self, int command_id); 143 144 /// 145 // Removes the item at the specified |index|. Returns true (1) on success. 146 /// 147 int (CEF_CALLBACK *remove_at)(struct _cef_menu_model_t* self, int index); 148 149 /// 150 // Returns the index associated with the specified |command_id| or -1 if not 151 // found due to the command id not existing in the menu. 152 /// 153 int (CEF_CALLBACK *get_index_of)(struct _cef_menu_model_t* self, 154 int command_id); 155 156 /// 157 // Returns the command id at the specified |index| or -1 if not found due to 158 // invalid range or the index being a separator. 159 /// 160 int (CEF_CALLBACK *get_command_id_at)(struct _cef_menu_model_t* self, 161 int index); 162 163 /// 164 // Sets the command id at the specified |index|. Returns true (1) on success. 165 /// 166 int (CEF_CALLBACK *set_command_id_at)(struct _cef_menu_model_t* self, 167 int index, int command_id); 168 169 /// 170 // Returns the label for the specified |command_id| or NULL if not found. 171 /// 172 // The resulting string must be freed by calling cef_string_userfree_free(). 173 cef_string_userfree_t (CEF_CALLBACK *get_label)( 174 struct _cef_menu_model_t* self, int command_id); 175 176 /// 177 // Returns the label at the specified |index| or NULL if not found due to 178 // invalid range or the index being a separator. 179 /// 180 // The resulting string must be freed by calling cef_string_userfree_free(). 181 cef_string_userfree_t (CEF_CALLBACK *get_label_at)( 182 struct _cef_menu_model_t* self, int index); 183 184 /// 185 // Sets the label for the specified |command_id|. Returns true (1) on success. 186 /// 187 int (CEF_CALLBACK *set_label)(struct _cef_menu_model_t* self, int command_id, 188 const cef_string_t* label); 189 190 /// 191 // Set the label at the specified |index|. Returns true (1) on success. 192 /// 193 int (CEF_CALLBACK *set_label_at)(struct _cef_menu_model_t* self, int index, 194 const cef_string_t* label); 195 196 /// 197 // Returns the item type for the specified |command_id|. 198 /// 199 cef_menu_item_type_t (CEF_CALLBACK *get_type)(struct _cef_menu_model_t* self, 200 int command_id); 201 202 /// 203 // Returns the item type at the specified |index|. 204 /// 205 cef_menu_item_type_t (CEF_CALLBACK *get_type_at)( 206 struct _cef_menu_model_t* self, int index); 207 208 /// 209 // Returns the group id for the specified |command_id| or -1 if invalid. 210 /// 211 int (CEF_CALLBACK *get_group_id)(struct _cef_menu_model_t* self, 212 int command_id); 213 214 /// 215 // Returns the group id at the specified |index| or -1 if invalid. 216 /// 217 int (CEF_CALLBACK *get_group_id_at)(struct _cef_menu_model_t* self, 218 int index); 219 220 /// 221 // Sets the group id for the specified |command_id|. Returns true (1) on 222 // success. 223 /// 224 int (CEF_CALLBACK *set_group_id)(struct _cef_menu_model_t* self, 225 int command_id, int group_id); 226 227 /// 228 // Sets the group id at the specified |index|. Returns true (1) on success. 229 /// 230 int (CEF_CALLBACK *set_group_id_at)(struct _cef_menu_model_t* self, int index, 231 int group_id); 232 233 /// 234 // Returns the submenu for the specified |command_id| or NULL if invalid. 235 /// 236 struct _cef_menu_model_t* (CEF_CALLBACK *get_sub_menu)( 237 struct _cef_menu_model_t* self, int command_id); 238 239 /// 240 // Returns the submenu at the specified |index| or NULL if invalid. 241 /// 242 struct _cef_menu_model_t* (CEF_CALLBACK *get_sub_menu_at)( 243 struct _cef_menu_model_t* self, int index); 244 245 // 246 // Returns true (1) if the specified |command_id| is visible. 247 /// 248 int (CEF_CALLBACK *is_visible)(struct _cef_menu_model_t* self, 249 int command_id); 250 251 // 252 // Returns true (1) if the specified |index| is visible. 253 /// 254 int (CEF_CALLBACK *is_visible_at)(struct _cef_menu_model_t* self, int index); 255 256 // 257 // Change the visibility of the specified |command_id|. Returns true (1) on 258 // success. 259 /// 260 int (CEF_CALLBACK *set_visible)(struct _cef_menu_model_t* self, 261 int command_id, int visible); 262 263 // 264 // Change the visibility at the specified |index|. Returns true (1) on 265 // success. 266 /// 267 int (CEF_CALLBACK *set_visible_at)(struct _cef_menu_model_t* self, int index, 268 int visible); 269 270 // 271 // Returns true (1) if the specified |command_id| is enabled. 272 /// 273 int (CEF_CALLBACK *is_enabled)(struct _cef_menu_model_t* self, 274 int command_id); 275 276 // 277 // Returns true (1) if the specified |index| is enabled. 278 /// 279 int (CEF_CALLBACK *is_enabled_at)(struct _cef_menu_model_t* self, int index); 280 281 // 282 // Change the enabled status of the specified |command_id|. Returns true (1) 283 // on success. 284 /// 285 int (CEF_CALLBACK *set_enabled)(struct _cef_menu_model_t* self, 286 int command_id, int enabled); 287 288 // 289 // Change the enabled status at the specified |index|. Returns true (1) on 290 // success. 291 /// 292 int (CEF_CALLBACK *set_enabled_at)(struct _cef_menu_model_t* self, int index, 293 int enabled); 294 295 // 296 // Returns true (1) if the specified |command_id| is checked. Only applies to 297 // check and radio items. 298 /// 299 int (CEF_CALLBACK *is_checked)(struct _cef_menu_model_t* self, 300 int command_id); 301 302 // 303 // Returns true (1) if the specified |index| is checked. Only applies to check 304 // and radio items. 305 /// 306 int (CEF_CALLBACK *is_checked_at)(struct _cef_menu_model_t* self, int index); 307 308 // 309 // Check the specified |command_id|. Only applies to check and radio items. 310 // Returns true (1) on success. 311 /// 312 int (CEF_CALLBACK *set_checked)(struct _cef_menu_model_t* self, 313 int command_id, int checked); 314 315 // 316 // Check the specified |index|. Only applies to check and radio items. Returns 317 // true (1) on success. 318 /// 319 int (CEF_CALLBACK *set_checked_at)(struct _cef_menu_model_t* self, int index, 320 int checked); 321 322 // 323 // Returns true (1) if the specified |command_id| has a keyboard accelerator 324 // assigned. 325 /// 326 int (CEF_CALLBACK *has_accelerator)(struct _cef_menu_model_t* self, 327 int command_id); 328 329 // 330 // Returns true (1) if the specified |index| has a keyboard accelerator 331 // assigned. 332 /// 333 int (CEF_CALLBACK *has_accelerator_at)(struct _cef_menu_model_t* self, 334 int index); 335 336 // 337 // Set the keyboard accelerator for the specified |command_id|. |key_code| can 338 // be any virtual key or character value. Returns true (1) on success. 339 /// 340 int (CEF_CALLBACK *set_accelerator)(struct _cef_menu_model_t* self, 341 int command_id, int key_code, int shift_pressed, int ctrl_pressed, 342 int alt_pressed); 343 344 // 345 // Set the keyboard accelerator at the specified |index|. |key_code| can be 346 // any virtual key or character value. Returns true (1) on success. 347 /// 348 int (CEF_CALLBACK *set_accelerator_at)(struct _cef_menu_model_t* self, 349 int index, int key_code, int shift_pressed, int ctrl_pressed, 350 int alt_pressed); 351 352 // 353 // Remove the keyboard accelerator for the specified |command_id|. Returns 354 // true (1) on success. 355 /// 356 int (CEF_CALLBACK *remove_accelerator)(struct _cef_menu_model_t* self, 357 int command_id); 358 359 // 360 // Remove the keyboard accelerator at the specified |index|. Returns true (1) 361 // on success. 362 /// 363 int (CEF_CALLBACK *remove_accelerator_at)(struct _cef_menu_model_t* self, 364 int index); 365 366 // 367 // Retrieves the keyboard accelerator for the specified |command_id|. Returns 368 // true (1) on success. 369 /// 370 int (CEF_CALLBACK *get_accelerator)(struct _cef_menu_model_t* self, 371 int command_id, int* key_code, int* shift_pressed, int* ctrl_pressed, 372 int* alt_pressed); 373 374 // 375 // Retrieves the keyboard accelerator for the specified |index|. Returns true 376 // (1) on success. 377 /// 378 int (CEF_CALLBACK *get_accelerator_at)(struct _cef_menu_model_t* self, 379 int index, int* key_code, int* shift_pressed, int* ctrl_pressed, 380 int* alt_pressed); 381 } cef_menu_model_t; 382 383 384 #ifdef __cplusplus 385 } 386 #endif 387 388 #endif // CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_