• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 //
5 // ---------------------------------------------------------------------------
6 //
7 // This file was generated by the CEF translator tool. If making changes by
8 // hand only do so within the body of existing method and function
9 // implementations. See the translator.README.txt file in the tools directory
10 // for more information.
11 //
12 // $hash=4cb6a46bc1c8fa0d912c04d58a07afddd250d9b9$
13 //
14 
15 #ifndef CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_CTOCPP_H_
16 #define CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_CTOCPP_H_
17 #pragma once
18 
19 #if !defined(WRAPPING_CEF_SHARED)
20 #error This file can be included wrapper-side only
21 #endif
22 
23 #include "include/capi/cef_menu_model_capi.h"
24 #include "include/cef_menu_model.h"
25 #include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
26 
27 // Wrap a C structure with a C++ class.
28 // This class may be instantiated and accessed wrapper-side only.
29 class CefMenuModelCToCpp : public CefCToCppRefCounted<CefMenuModelCToCpp,
30                                                       CefMenuModel,
31                                                       cef_menu_model_t> {
32  public:
33   CefMenuModelCToCpp();
34   virtual ~CefMenuModelCToCpp();
35 
36   // CefMenuModel methods.
37   bool IsSubMenu() override;
38   bool Clear() override;
39   int GetCount() override;
40   bool AddSeparator() override;
41   bool AddItem(int command_id, const CefString& label) override;
42   bool AddCheckItem(int command_id, const CefString& label) override;
43   bool AddRadioItem(int command_id,
44                     const CefString& label,
45                     int group_id) override;
46   CefRefPtr<CefMenuModel> AddSubMenu(int command_id,
47                                      const CefString& label) override;
48   bool InsertSeparatorAt(int index) override;
49   bool InsertItemAt(int index, int command_id, const CefString& label) override;
50   bool InsertCheckItemAt(int index,
51                          int command_id,
52                          const CefString& label) override;
53   bool InsertRadioItemAt(int index,
54                          int command_id,
55                          const CefString& label,
56                          int group_id) override;
57   CefRefPtr<CefMenuModel> InsertSubMenuAt(int index,
58                                           int command_id,
59                                           const CefString& label) override;
60   bool Remove(int command_id) override;
61   bool RemoveAt(int index) override;
62   int GetIndexOf(int command_id) override;
63   int GetCommandIdAt(int index) override;
64   bool SetCommandIdAt(int index, int command_id) override;
65   CefString GetLabel(int command_id) override;
66   CefString GetLabelAt(int index) override;
67   bool SetLabel(int command_id, const CefString& label) override;
68   bool SetLabelAt(int index, const CefString& label) override;
69   MenuItemType GetType(int command_id) override;
70   MenuItemType GetTypeAt(int index) override;
71   int GetGroupId(int command_id) override;
72   int GetGroupIdAt(int index) override;
73   bool SetGroupId(int command_id, int group_id) override;
74   bool SetGroupIdAt(int index, int group_id) override;
75   CefRefPtr<CefMenuModel> GetSubMenu(int command_id) override;
76   CefRefPtr<CefMenuModel> GetSubMenuAt(int index) override;
77   bool IsVisible(int command_id) override;
78   bool IsVisibleAt(int index) override;
79   bool SetVisible(int command_id, bool visible) override;
80   bool SetVisibleAt(int index, bool visible) override;
81   bool IsEnabled(int command_id) override;
82   bool IsEnabledAt(int index) override;
83   bool SetEnabled(int command_id, bool enabled) override;
84   bool SetEnabledAt(int index, bool enabled) override;
85   bool IsChecked(int command_id) override;
86   bool IsCheckedAt(int index) override;
87   bool SetChecked(int command_id, bool checked) override;
88   bool SetCheckedAt(int index, bool checked) override;
89   bool HasAccelerator(int command_id) override;
90   bool HasAcceleratorAt(int index) override;
91   bool SetAccelerator(int command_id,
92                       int key_code,
93                       bool shift_pressed,
94                       bool ctrl_pressed,
95                       bool alt_pressed) override;
96   bool SetAcceleratorAt(int index,
97                         int key_code,
98                         bool shift_pressed,
99                         bool ctrl_pressed,
100                         bool alt_pressed) override;
101   bool RemoveAccelerator(int command_id) override;
102   bool RemoveAcceleratorAt(int index) override;
103   bool GetAccelerator(int command_id,
104                       int& key_code,
105                       bool& shift_pressed,
106                       bool& ctrl_pressed,
107                       bool& alt_pressed) override;
108   bool GetAcceleratorAt(int index,
109                         int& key_code,
110                         bool& shift_pressed,
111                         bool& ctrl_pressed,
112                         bool& alt_pressed) override;
113   bool SetColor(int command_id,
114                 cef_menu_color_type_t color_type,
115                 cef_color_t color) override;
116   bool SetColorAt(int index,
117                   cef_menu_color_type_t color_type,
118                   cef_color_t color) override;
119   bool GetColor(int command_id,
120                 cef_menu_color_type_t color_type,
121                 cef_color_t& color) override;
122   bool GetColorAt(int index,
123                   cef_menu_color_type_t color_type,
124                   cef_color_t& color) override;
125   bool SetFontList(int command_id, const CefString& font_list) override;
126   bool SetFontListAt(int index, const CefString& font_list) override;
127 };
128 
129 #endif  // CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_CTOCPP_H_
130