GUI window callback functions.
Functions to handle control callbacks from Kodi  
More...
 | 
| virtual bool  | kodi::gui::CWindow::OnInit () | 
|   | OnInit method.  
  | 
|   | 
| virtual bool  | kodi::gui::CWindow::OnFocus (int controlId) | 
|   | OnFocus method.  
  | 
|   | 
| virtual bool  | kodi::gui::CWindow::OnClick (int controlId) | 
|   | OnClick method.  
  | 
|   | 
| virtual bool  | kodi::gui::CWindow::OnAction (ADDON_ACTION actionId) | 
|   | OnAction method.  
  | 
|   | 
| virtual void  | kodi::gui::CWindow::GetContextButtons (int itemNumber, std::vector< std::pair< unsigned int, std::string > > &buttons) | 
|   | Get context menu buttons for list entry.  
  | 
|   | 
| virtual bool  | kodi::gui::CWindow::OnContextButton (int itemNumber, unsigned int button) | 
|   | Called after selection in context menu.  
  | 
|   | 
| void  | kodi::gui::CWindow::SetIndependentCallbacks (kodi::gui::ClientHandle cbhdl, bool(*CBOnInit)(kodi::gui::ClientHandle cbhdl), bool(*CBOnFocus)(kodi::gui::ClientHandle cbhdl, int controlId), bool(*CBOnClick)(kodi::gui::ClientHandle cbhdl, int controlId), bool(*CBOnAction)(kodi::gui::ClientHandle cbhdl, ADDON_ACTION actionId), void(*CBGetContextButtons)(kodi::gui::ClientHandle cbhdl, int itemNumber, gui_context_menu_pair *buttons, unsigned int *size)=nullptr, bool(*CBOnContextButton)(kodi::gui::ClientHandle cbhdl, int itemNumber, unsigned int button)=nullptr) | 
|   | Set independent callbacks  
  | 
|   | 
GUI window callback functions.
Functions to handle control callbacks from Kodi 
Go back to normal functions from CWindow 
◆ GetContextButtons()
  
  
      
        
          | virtual void kodi::gui::CWindow::GetContextButtons  | 
          ( | 
          int |           itemNumber,  | 
         
        
           | 
           | 
          std::vector< std::pair< unsigned int, std::string > > & |           buttons ) | 
         
       
   | 
  
inlinevirtual   | 
  
 
Get context menu buttons for list entry. 
- Parameters
 - 
  
    | [in] | itemNumber | Selected list item entry  | 
    | [in] | buttons | List where context menus becomes added with his identifier and name  | 
  
   
 
 
◆ OnAction()
OnAction method. 
- Parameters
 - 
  
    | [in] | actionId | The action id to perform, see Action Id's to get list of them  | 
  
   
- Returns
 - Return true if action was handled there or false to handle them by Kodi itself
 
This method will receive all actions that the main program will send to this window.
- Note
 
- By default, only the 
ADDON_ACTION_PREVIOUS_MENU and ADDON_ACTION_NAV_BACK actions are handled. 
- Overwrite this method to let your code handle all actions.
 
- Don't forget to capture ADDON_ACTION_PREVIOUS_MENU or ADDON_ACTION_NAV_BACK, else the user can't close this window.
 
Example: 
..
{
  switch (action)
  {
      printf("action received: previous");
      return true;
      printf("action received: show info");
      break;
      printf("action received: stop");
      break;
      printf("action received: pause");
      break;
    default:
      break;
  }
  return false;
}
..
ADDON_ACTION
Definition action_ids.h:19
 
@ ADDON_ACTION_PREVIOUS_MENU
10: Previous menu.
Definition action_ids.h:54
 
@ ADDON_ACTION_NAV_BACK
90: Nav back.
Definition action_ids.h:286
 
@ ADDON_ACTION_SHOW_INFO
11: Show info.
Definition action_ids.h:57
 
@ ADDON_ACTION_STOP
13: Stop.
Definition action_ids.h:63
 
@ ADDON_ACTION_PAUSE
12: Pause.
Definition action_ids.h:60
 
void Close()
Closes this window.
Definition addons/kodi-dev-kit/include/kodi/gui/Window.h:182
 
  
 
 
◆ OnClick()
  
  
      
        
          | virtual bool kodi::gui::CWindow::OnClick  | 
          ( | 
          int |           controlId | ) | 
           | 
         
       
   | 
  
inlinevirtual   | 
  
 
OnClick method. 
- Parameters
 - 
  
    | [in] | controlId | GUI control identifier  | 
  
   
- Returns
 - Return true if click was handled there or false to handle them by Kodi itself 
 
 
 
◆ OnContextButton()
  
  
      
        
          | virtual bool kodi::gui::CWindow::OnContextButton  | 
          ( | 
          int |           itemNumber,  | 
         
        
           | 
           | 
          unsigned int |           button ) | 
         
       
   | 
  
inlinevirtual   | 
  
 
Called after selection in context menu. 
- Parameters
 - 
  
    | [in] | itemNumber | Selected list item entry  | 
    | [in] | button | The pressed button id  | 
  
   
- Returns
 - true if handled, otherwise false 
 
 
 
◆ OnFocus()
  
  
      
        
          | virtual bool kodi::gui::CWindow::OnFocus  | 
          ( | 
          int |           controlId | ) | 
           | 
         
       
   | 
  
inlinevirtual   | 
  
 
OnFocus method. 
- Parameters
 - 
  
    | [in] | controlId | GUI control identifier  | 
  
   
- Returns
 - Return true if focus condition was handled there or false to handle them by Kodi itself 
 
 
 
◆ OnInit()
  
  
      
        
          | virtual bool kodi::gui::CWindow::OnInit  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlinevirtual   | 
  
 
OnInit method. 
- Returns
 - Return true if initialize was done successful 
 
 
 
◆ SetIndependentCallbacks()
  
  
      
        
          | void kodi::gui::CWindow::SetIndependentCallbacks  | 
          ( | 
          kodi::gui::ClientHandle |           cbhdl,  | 
         
        
           | 
           | 
          bool(* |           CBOnInit )(kodi::gui::ClientHandle cbhdl),  | 
         
        
           | 
           | 
          bool(* |           CBOnFocus )(kodi::gui::ClientHandle cbhdl, int controlId),  | 
         
        
           | 
           | 
          bool(* |           CBOnClick )(kodi::gui::ClientHandle cbhdl, int controlId),  | 
         
        
           | 
           | 
          bool(* |           CBOnAction )(kodi::gui::ClientHandle cbhdl, ADDON_ACTION actionId),  | 
         
        
           | 
           | 
          void(* |           CBGetContextButtons )(kodi::gui::ClientHandle cbhdl, int itemNumber, gui_context_menu_pair *buttons, unsigned int *size) = nullptr,  | 
         
        
           | 
           | 
          bool(* |           CBOnContextButton )(kodi::gui::ClientHandle cbhdl, int itemNumber, unsigned int button) = nullptr ) | 
         
       
   | 
  
inline   | 
  
 
Set independent callbacks 
If the class is used independent (with "new CWindow") and not as parent (with "cCLASS_own : public kodi::gui::CWindow") from own must be the callback from Kodi to add-on overdriven with own functions!
- Parameters
 - 
  
    | [in] | cbhdl | The pointer to own handle data structure / class  | 
    | [in] | CBOnInit | Own defined window init function  | 
    | [in] | CBOnFocus | Own defined focus function  | 
    | [in] | CBOnClick | Own defined click function  | 
    | [in] | CBOnAction | Own defined action function  | 
    | [in] | CBGetContextButtons | [opt] To get context menu entries for lists function  | 
    | [in] | CBOnContextButton | [opt] Used context menu entry function | 
  
   
Example: 
...
 
{
  ...
  return true;
}
 
{
  ...
  return true;
}
 
{
  ...
  return true;
}
 
{
  ...
  return true;
}
 
...
...
friend class CWindow
Definition addons/kodi-dev-kit/include/kodi/gui/ListItem.h:40
 
KODI_GUI_CLIENT_HANDLE ClientHandle
Handler for addon-sided processing class If the callback functions used by the window are not used di...
Definition addons/kodi-dev-kit/include/kodi/gui/Window.h:43
 
virtual bool OnClick(int controlId)
OnClick method.
Definition addons/kodi-dev-kit/include/kodi/gui/Window.h:683
 
virtual bool OnAction(ADDON_ACTION actionId)
OnAction method.
Definition addons/kodi-dev-kit/include/kodi/gui/Window.h:738
 
virtual bool OnInit()
OnInit method.
Definition addons/kodi-dev-kit/include/kodi/gui/Window.h:659
 
virtual bool OnFocus(int controlId)
OnFocus method.
Definition addons/kodi-dev-kit/include/kodi/gui/Window.h:671