IDA C++ SDK 9.2
Loading...
Searching...
No Matches
chooser_base_t Struct Referenceabstract

Chooser object. #chooser. More...

#include <kernwin.hpp>

Inheritance diagram for chooser_base_t:
chooser_multi_t chooser_t

Public Types

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 More...

Public Member Functions

 chooser_base_t (uint32 flags_=0, int columns_=0, const int *widths_=nullptr, const char *const *header_=nullptr, const char *title_=nullptr, uint16 flags2_=0)
virtual ~chooser_base_t ()
 DEFINE_MEMORY_ALLOCATION_FUNCS () void call_destructor()
virtual voidget_chooser_obj ()
 get pointer to some custom data.
virtual const voidget_obj_id (size_t *len) const
 get the id of the chooser data.
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 stdact_idx) const
 is a standard action allowed?
bool is_status_bar_hidden () const
bool should_restore_geometry () const
bool is_modal () const
 is choose modal?
bool has_widget_lifecycle () const
 should chooser object be deleted when the widget gets destroyed?
bool is_multi () const
 is multi-selection allowed?
bool ask_item_attrs () const
 should chooser generate ui_get_chooser_item_attrs events?
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
bool has_dirtree () const
bool has_diff_capability () const
bool can_sort () const
bool can_filter () const
bool should_rename_trigger_edit () const
bool is_dirtree_persisted () const
bool is_lazy_loaded () const
bool has_inode_to_index () const
virtual bool idaapi init ()
 initialize the chooser and populate it.
virtual size_t idaapi get_count () const =0
 get the number of elements in the chooser
virtual void idaapi get_row (qstrvec_t *out, int *out_icon, chooser_item_attrs_t *out_attrs, size_t n) const =0
 get a description of an element.
virtual ea_t idaapi get_ea (size_t) const
 get the address of an element.
virtual void idaapi closed ()
 The chooser window is closed.

Public Attributes

 immutable
int x0 = -1
 screen position, Functions: generic list choosers
int y0 = -1
int x1 = -1
int y1 = -1
int width = 0
 (in chars)
int height = 0
 (in chars)
const char * title
 menu title (includes ptr to help).
int columns
 number of columns
const int * widths
 column widths
const char *const * header
 header line; contains the tooltips, and column name for each of 'columns' columns.
int icon = -1
 default icon
qstring popup_names [NSTDPOPUPS]
 array of custom labels of the standard actions.
int deflt_col = 0
 Column that will have focus.

Static Public Attributes

static constexpr ssize_t NO_SELECTION = -1
 there is no selected item
static constexpr ssize_t EMPTY_CHOOSER = -2
 the chooser has no data and cannot be displayed
static constexpr ssize_t ALREADY_EXISTS = -3
 the non-modal chooser with the same data is already open
static constexpr ssize_t NO_ATTR = -4
 reserved for IDAPython

Protected Member Functions

void init_popup_names (const char *const default_popup_names[NSTDPOPUPS])

Protected Attributes

uint8 version = 3
 version of the class
uint8 reserved = 0
uint16 flags2
 Extended chooser flags
uint32 flags
 Generic chooser flags
 mutable

Detailed Description

Chooser object. #chooser.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
POPUP_INS 
POPUP_DEL 
POPUP_EDIT 
POPUP_REFRESH 
NSTDPOPUPS 

◆ cbres_t

return value of ins(), del(), edit(), enter(), refresh() callbacks

If the chooser implements get_dirtree(), and has ins() and/or del() capabilities, the meaning of the returned index(es) combined with ALL_CHANGED and SELECTION_CHANGED must be as follows:

  • for ins(): the index (in case of a chooser_t, or first index in case of a chooser_multi_t), will be the index of the row that was inserted.
  • for del(): the index (or indexes in case of a chooser_multi_t), will be the index(es) of the row(s) that was(were) deleted.
Enumerator
NOTHING_CHANGED 
ALL_CHANGED 
SELECTION_CHANGED 

Constructor & Destructor Documentation

◆ chooser_base_t()

chooser_base_t::chooser_base_t ( uint32 flags_ = 0,
int columns_ = 0,
const int * widths_ = nullptr,
const char *const * header_ = nullptr,
const char * title_ = nullptr,
uint16 flags2_ = 0 )
inline

◆ ~chooser_base_t()

virtual chooser_base_t::~chooser_base_t ( )
inlinevirtual

Member Function Documentation

◆ DEFINE_MEMORY_ALLOCATION_FUNCS()

chooser_base_t::DEFINE_MEMORY_ALLOCATION_FUNCS ( )
inline

◆ get_chooser_obj()

virtual void * chooser_base_t::get_chooser_obj ( )
inlinevirtual

get pointer to some custom data.

Note
These data are also called "the underlying object". Now this method is used only in the ActionsInspector class and ida_kernwin.Choose IDAPython's class.

◆ get_obj_id()

virtual const void * chooser_base_t::get_obj_id ( size_t * len) const
inlinevirtual

get the id of the chooser data.

The choosers are the same if they have the same data ids.

Parameters
[out]lenlength of the id. If it is 0 then it is considered that the method returned an unique id.
Returns
address of the id or nullptr in the case len == 0

◆ is_same()

bool chooser_base_t::is_same ( const chooser_base_t * other) const
inline

do the current and the given objects hold the same data?

◆ can_ins()

bool chooser_base_t::can_ins ( ) const
inline

is an operation allowed?

◆ can_del()

bool chooser_base_t::can_del ( ) const
inline

◆ can_edit()

bool chooser_base_t::can_edit ( ) const
inline

◆ can_refresh()

bool chooser_base_t::can_refresh ( ) const
inline

◆ popup_allowed()

bool chooser_base_t::popup_allowed ( int stdact_idx) const
inline

is a standard action allowed?

◆ is_status_bar_hidden()

bool chooser_base_t::is_status_bar_hidden ( ) const
inline

◆ should_restore_geometry()

bool chooser_base_t::should_restore_geometry ( ) const
inline

◆ is_modal()

bool chooser_base_t::is_modal ( ) const
inline

is choose modal?

◆ has_widget_lifecycle()

bool chooser_base_t::has_widget_lifecycle ( ) const
inline

should chooser object be deleted when the widget gets destroyed?

◆ is_multi()

bool chooser_base_t::is_multi ( ) const
inline

is multi-selection allowed?

◆ ask_item_attrs()

bool chooser_base_t::ask_item_attrs ( ) const
inline

should chooser generate ui_get_chooser_item_attrs events?

◆ is_force_default()

bool chooser_base_t::is_force_default ( ) const
inline

should selection of the already opened non-modal chooser be changed?

◆ get_builtin_number()

uint chooser_base_t::get_builtin_number ( ) const
inline

get number of the built-in chooser

◆ set_ask_item_attrs()

void chooser_base_t::set_ask_item_attrs ( bool enable)
inline

enable or disable generation of ui_get_chooser_item_attrs events

◆ check_version()

void chooser_base_t::check_version ( uint32 ver) const
inline

◆ is_quick_filter_visible_initially()

bool chooser_base_t::is_quick_filter_visible_initially ( ) const
inline

◆ get_quick_filter_initial_mode()

int chooser_base_t::get_quick_filter_initial_mode ( ) const
inline

◆ has_dirtree()

bool chooser_base_t::has_dirtree ( ) const
inline

◆ has_diff_capability()

bool chooser_base_t::has_diff_capability ( ) const
inline

◆ can_sort()

bool chooser_base_t::can_sort ( ) const
inline

◆ can_filter()

bool chooser_base_t::can_filter ( ) const
inline

◆ should_rename_trigger_edit()

bool chooser_base_t::should_rename_trigger_edit ( ) const
inline

◆ is_dirtree_persisted()

bool chooser_base_t::is_dirtree_persisted ( ) const
inline

◆ is_lazy_loaded()

bool chooser_base_t::is_lazy_loaded ( ) const
inline

◆ has_inode_to_index()

bool chooser_base_t::has_inode_to_index ( ) const
inline

◆ init()

virtual bool idaapi chooser_base_t::init ( )
inlinevirtual

initialize the chooser and populate it.

Return values
falsethe chooser is empty, do not display it

◆ get_count()

virtual size_t idaapi chooser_base_t::get_count ( ) const
pure virtual

get the number of elements in the chooser

◆ get_row()

virtual void idaapi chooser_base_t::get_row ( qstrvec_t * out,
int * out_icon,
chooser_item_attrs_t * out_attrs,
size_t n ) const
pure virtual

get a description of an element.

Parameters
[out]outvector of strings.
will receive the contents of each column
[out]out_iconelement's icon id, -1 - no icon
[out]out_attrselement attributes
nelement number (0..get_count()-1)

◆ get_ea()

virtual ea_t idaapi chooser_base_t::get_ea ( size_t ) const
inlinevirtual

get the address of an element.

When this function returns valid addresses:

  • If any column has the CHCOL_FNAME flag, rows will be colored according to the attributes of the functions who own those addresses (extern, library function, Lumina, ... - similar to what the "Functions" widget does)
  • When a selection is present and the user presses <Enter> (<Shift+Enter> if the chooser is modal), IDA will jump to that address (through jumpto())
    Parameters
    nelement number (0-based)
    Returns
    the effective address, BADADDR if the element has no address

◆ closed()

virtual void idaapi chooser_base_t::closed ( )
inlinevirtual

The chooser window is closed.

◆ init_popup_names()

void chooser_base_t::init_popup_names ( const char *const default_popup_names[NSTDPOPUPS])
inlineprotected

Member Data Documentation

◆ immutable

chooser_base_t::immutable

◆ version

uint8 chooser_base_t::version = 3
protected

version of the class

◆ reserved

uint8 chooser_base_t::reserved = 0
protected

◆ flags2

uint16 chooser_base_t::flags2
protected

◆ flags

uint32 chooser_base_t::flags
protected

◆ x0

int chooser_base_t::x0 = -1

◆ y0

int chooser_base_t::y0 = -1

◆ x1

int chooser_base_t::x1 = -1

◆ y1

int chooser_base_t::y1 = -1

◆ width

int chooser_base_t::width = 0

(in chars)

◆ height

int chooser_base_t::height = 0

(in chars)

◆ title

const char* chooser_base_t::title

menu title (includes ptr to help).

May have chooser title prefixes (see "Chooser title" above).

◆ columns

int chooser_base_t::columns

number of columns

◆ widths

const int* chooser_base_t::widths

column widths

◆ header

const char* const* chooser_base_t::header

header line; contains the tooltips, and column name for each of 'columns' columns.

When tooltips need to be provided, the syntax should be: "#tooltip#column-name". (Otherwise, the syntax is simply "column-name".)

◆ icon

int chooser_base_t::icon = -1

default icon

◆ popup_names

qstring chooser_base_t::popup_names[NSTDPOPUPS]

array of custom labels of the standard actions.

Used to replace labels for these actions.
An empty name means that the default name will be used.

Note
Availability of these actions is determined by the CH_CAN_... flags. The label, icon and other action attributes can be overwritten in the action description returned by get_stdact_descs()

◆ deflt_col

int chooser_base_t::deflt_col = 0

Column that will have focus.

◆ mutable

chooser_base_t::mutable
protected

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