26 #ifndef TBX_COMPONENT_H_
27 #define TBX_COMPONENT_H_
36 class UserEventListener;
std::string string_property(int property_id) const
Get a string property from the toolbox object.
Definition: component.cc:261
void add_listener(int action, Listener *listener, RawToolboxEventHandler handler)
Helper function to add listeners to this component.
Definition: component.cc:117
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
int ComponentId
Type for underlying toolbox component id.
Definition: handles.h:33
ObjectId handle() const
Return the object handle for his component.
Definition: component.h:95
int int_property(int property_id) const
Get an integer property from the toolbox Component.
Definition: component.cc:165
Base class for components in an object.
Definition: component.h:42
ObjectId _handle
Underlying toolbox handle.
Definition: component.h:45
ComponentId id() const
Get the component ID of this component.
Definition: component.h:103
void remove_all_listeners()
Remove all the listeners on this component.
Definition: component.cc:104
Component()
Construct an uninitialised component.
Definition: component.h:55
Object object() const
Return the object his component belongs to.
Definition: component.h:90
const ObjectId NULL_ObjectId
NULL object id.
Definition: handles.h:42
void remove_command(int command_id, Command *command)
Remove a command from this component.
Definition: component.cc:61
Component & operator=(const Component &other)
Assign the Component to refer to the same underlying toolbox component.
Definition: component.h:108
void add_command(int command_id, Command *command)
Add a command to this Component.
Definition: component.cc:47
void add_window_listener(int event_code, Listener *listener)
Helper function to add a listener for a WIMP window event.
Definition: component.cc:137
void remove_window_listener(int event_code, Listener *listener)
Helper function to remove a listener for a WIMP window event.
Definition: component.cc:147
void(* RawToolboxEventHandler)(IdBlock &id_block, PollBlock &data, Listener *listener)
Function type for handlers of raw (unprocessed) Toolbox events.
Definition: pollinfo.h:86
void add_user_event_listener(int event_id, UserEventListener *listener)
Add a user event listener.
Definition: component.cc:78
bool operator!=(const Component &other) const
Check if this component refers to the same underlying toolbox gadget.
Definition: component.h:122
bool bool_property(int property_id) const
Get a boolean property from the toolbox Component.
Definition: component.cc:214
Class to manipulate a toolbox object.
Definition: object.h:51
Base class for all toolbox event listeners.
Definition: listener.h:34
Base class for commands in tbx.
Definition: command.h:37
Component(ObjectId handle, ComponentId id)
Construct a component from an object handle and component id.
Definition: component.h:73
void remove_listener(int action, Listener *listener)
Helper function to remove listeners from this component.
Definition: component.cc:127
int _id
Underlying toolbox component id.
Definition: component.h:46
int string_property_length(int property_id) const
Get a the length of a string property from the toolbox object.
Definition: component.cc:302
Component(Object obj, ComponentId id)
Construct a component from an object and component id.
Definition: component.h:64
unsigned int ObjectId
Type for underlying toolbox object id.
Definition: handles.h:31
const ComponentId NULL_ComponentId
NULL component id.
Definition: handles.h:46
bool flag_property(int property_id, int flag) const
Check if a particular flag is set in a property.
Definition: component.cc:351
void remove_user_event_listener(int event_id, UserEventListener *listener)
Remove a user event listener from this component.
Definition: component.cc:92
A UserEventListener can be used to capture any event on an object or component.
Definition: usereventlistener.h:62
Object object()
Return the object his component belongs to.
Definition: component.h:85
bool operator==(const Component &other) const
Check if this component refers to the same underlying toolbox component.
Definition: component.h:115