IDA SDK
Public Member Functions | Protected Member Functions | Classes | List of all members
chooser_t Struct Reference

Detailed Description

The chooser object without multi-selection.

Inherits chooser_base_t.

Public Member Functions

 chooser_t (uint32 flags_=0, int columns_=0, const int *widths_=NULL, const char *const *header_=NULL, const char *title_=NULL)
 
ssize_t choose (ssize_t deflt=0)
 Display a generic list chooser and allow the user to select an item. More...
 
virtual ssize_t idaapi get_item_index (const void *item_data) const
 Get the position (index) of the item. More...
 
typedef cbret_t (idaapi chooser_t::*cb_t)(size_t n)
 Type of ins(), del(), edit(), enter(), refresh() callbacks.
 
virtual cbret_t idaapi ins (ssize_t)
 User asked to insert an element.
 
virtual cbret_t idaapi del (size_t)
 User deleted an element. More...
 
virtual cbret_t idaapi edit (size_t)
 User asked to edit an element. More...
 
virtual cbret_t idaapi enter (size_t n)
 User pressed the enter key. More...
 
virtual cbret_t idaapi refresh (ssize_t n)
 The chooser needs to be refreshed. More...
 
virtual void idaapi select (ssize_t) const
 Selection changed (cursor moved). More...
 
- Public Member Functions inherited from chooser_base_t
 chooser_base_t (uint32 flags_=0, int columns_=0, const int *widths_=NULL, const char *const *header_=NULL, const char *title_=NULL)
 
void call_destructor ()
 
virtual void * get_chooser_obj ()
 get pointer to some custom data. More...
 
virtual const void * get_obj_id (size_t *len) const
 get the id of the chooser data. More...
 
bool is_same (const chooser_base_t *other) const
 do the current and the given objects hold the same data?
 
bool can_ins () const
 is an operation allowed?
 
bool can_del () const
 
bool can_edit () const
 
bool can_refresh () const
 
bool popup_allowed (int i) const
 is a popup action allowed?
 
bool is_modal () const
 is choose modal?
 
bool is_multi () const
 is multi-selection allowed?
 
bool ask_item_attrs () const
 should chooser generate ui_get_chooser_item_attrs events?
 
bool is_noidb () const
 can use the chooser before opening the database?
 
bool is_force_default () const
 should selection of the already opened non-modal chooser be changed?
 
uint get_builtin_number () const
 get number of the built-in chooser
 
void set_ask_item_attrs (bool enable)
 enable or disable generation of ui_get_chooser_item_attrs events
 
void check_version (uint32 ver) const
 
bool is_quick_filter_visible_initially () const
 
int get_quick_filter_initial_mode () const
 
virtual bool idaapi init ()
 initialize the chooser and populate it. More...
 
virtual size_t idaapi get_count () const =0
 get the number of elements in the chooser
 
virtual void idaapi get_row (qstrvec_t *cols, int *icon_, chooser_item_attrs_t *attrs, size_t n) const =0
 get a description of an element. More...
 
virtual ea_t idaapi get_ea (size_t) const
 get an address of an element. More...
 
virtual void idaapi closed ()
 The chooser window is closed.
 

Protected Member Functions

ssize_t new_sel_after_del (size_t n) const
 
ssize_t adjust_last_item (size_t n) const
 
- Protected Member Functions inherited from chooser_base_t
void init_popup_names (const char *const default_popup_names[NSTDPOPUPS])
 

Classes

struct  cbret_t
 Return value of ins(), del(), edit(), enter(), refresh() callbacks. More...
 

Additional Inherited Members

- Public Attributes inherited from chooser_base_t
int x0
 screen position, Functions: generic list choosers
 
int y0
 
int x1
 
int y1
 
int width
 (in chars)
 
int height
 (in chars)
 
const char * title
 menu title (includes ptr to help). More...
 
int columns
 number of columns
 
const int * widths
 column widths More...
 
const char *const * header
 header line; contains the tooltips, and column name for each of 'columns' columns. More...
 
int icon
 default icon
 
qstring popup_names [NSTDPOPUPS]
 array of custom popup menu names. More...
 
int deflt_col
 Column that will have focus.
 
- Public Types inherited from chooser_base_t
enum  { NO_SELECTION = -1, EMPTY_CHOOSER = -2, ALREADY_EXISTS = -3, NO_ATTR = -4 }
 
enum  {
  POPUP_INS, POPUP_DEL, POPUP_EDIT, POPUP_REFRESH,
  NSTDPOPUPS
}
 
enum  cbres_t { NOTHING_CHANGED, ALL_CHANGED, SELECTION_CHANGED }
 return value of ins(), del(), edit(), enter(), refresh() callbacks
 
- Protected Attributes inherited from chooser_base_t
uint32 version
 version of the class
 
uint32 flags
 Generic chooser flags
 

Member Function Documentation

virtual ssize_t idaapi chooser_t::get_item_index ( const void *  item_data) const
inlinevirtual

Get the position (index) of the item.

A simple chooser considers `item_data` as an index.

Parameters
item_datapointer to some data that indentifies the item
Returns
idx item index, NO_SELECTION - there is no item with such data
virtual cbret_t idaapi chooser_t::del ( size_t  )
inlinevirtual

User deleted an element.

Parameters
nindex of the element to delete
Returns
idx index of the selected item (cursor) changed what is changed
virtual cbret_t idaapi chooser_t::edit ( size_t  )
inlinevirtual

User asked to edit an element.

Parameters
nindex of the element to edit
Returns
idx index of the selected item (cursor) changed what is changed
virtual cbret_t idaapi chooser_t::enter ( size_t  n)
inlinevirtual

User pressed the enter key.

Parameters
nindex of the element where <Enter> was pressed
Return values
falsenothing changed
Returns
idx index of the selected item (cursor) changed what is changed
virtual cbret_t idaapi chooser_t::refresh ( ssize_t  n)
inlinevirtual

The chooser needs to be refreshed.

Parameters
nindex of the selected (current) item
Returns
idx new index of the current item (as it may change during refresh) changed what is changed
virtual void idaapi chooser_t::select ( ssize_t  ) const
inlinevirtual

Selection changed (cursor moved).

Note
This callback is not supported in the txt-version.
Parameters
nindex of the new selected item

The documentation for this struct was generated from the following file: