Name

UiItem — Base class for the elements of the user interface.

Synopsis

class UiItem
  :  : public RefCountedWrappedObjectSernaApi::RefCountedWrappedObject
 {
public:
  // construct/copy/destruct
  UiItem(SernaApiBase * = 0);
  ~UiItem();

  // public member functions

  SString name() const;
  UiAction action() const;
  SString itemClass() const;
  SString widgetClass() const;
  QWidget * widget() const;
  PropertyNode property(const SString &) const;
  PropertyNode itemProps(bool = false) ;
  PropertyNode currActionProp() const;
  SString get(const SString &) const;
  SString getTranslated(const SString &) const;
  bool getBool(const SString &) const;
  int getInt(const SString &) const;
  double getDouble(const SString &) const;
  void set(const SString &, const SString &) ;
  void setBool(const SString &, bool) ;
  void setInt(const SString &, int) ;
  void setDouble(const SString &, double) ;
  void setVisible(bool) ;
  bool isVisible() const;
  void attach(bool = false) ;
  void detach(bool = false) ;
  void dispatch() ;
  void grabFocus() const;
  void releaseFocus() const;
  UiAction findAction(const SString &) const;
  UiItem findItemByName(const SString &) const;
  UiItem findItemByClass(const SString &) const;
  UiItem findItemByAction(const UiAction &) const;
  void showContextMenu(int, int) ;
  UiItem firstChild() const;
  UiItem lastChild() const;
  UiItem getChild(int) const;
  int countChildren() const;
  void appendChild(const UiItem &) ;
  void removeAllChildren() ;
  UiItem nextSibling() const;
  UiItem prevSibling() const;
  UiItem parent() const;
  UiItem root() const;
  void remove() ;
  void insertBefore(const UiItem &) ;
  void insertAfter(const UiItem &) ;
  void removeGroup(const UiItem &) ;
  int siblingIndex() const;
  SString getTreelocString(const UiItem & = UiItem()) const;
  UiItem getByTreelocString(const SString &) const;
  SernaDoc asSernaDoc() const;

  // public static functions

  SString translate(const char *, const SString &) ;
};

Description

UiItem construct/copy/destruct

  1. UiItem(SernaApiBase * = 0);


  2. ~UiItem();


UiItem public member functions

  1. SString name() const;

    Returns the name of item instance.


  2. UiAction action() const;

    Returns the assotiated Action.


  3. SString itemClass() const;

    Returns type of item instance.


  4. SString widgetClass() const;


  5. QWidget * widget() const;

    Returns widget made by this item.


  6. PropertyNode property(const SString & prop) const;

    Returns requested property from this item, or from its action if property does not exist in this item


  7. PropertyNode itemProps(bool update = false) ;

    Updates item properties (if asked) and returns them.


  8. PropertyNode currActionProp() const;

    For MultiAction items - returns the current subaction root property.


  9. SString get(const SString & propName) const;

    Returns string property value.


  10. SString getTranslated(const SString & propName) const;

    Returns string property value.


  11. bool getBool(const SString & propName) const;

    Returns boolean property value.


  12. int getInt(const SString & propName) const;

    Returns integer property value.


  13. double getDouble(const SString & propName) const;

    Returns double property value.


  14. void set(const SString & propName, const SString & value) ;

    Sets string property value.


  15. void setBool(const SString & propName, bool value) ;

    Sets boolean property value.


  16. void setInt(const SString & propName, int value) ;

    Sets integer property value.


  17. void setDouble(const SString & propName, double value) ;

    Sets double property value.


  18. void setVisible(bool ) ;

    Sets visible state.


  19. bool isVisible() const;

    Returns visible state.


  20. void attach(bool recursive = false) ;

    Attaches UI item.


  21. void detach(bool recursive = false) ;

    Detaches UI item.


  22. void dispatch() ;

    Dispatch Item command if any.


  23. void grabFocus() const;

    Set the focus to the widget corresponding to this UI item.


  24. void releaseFocus() const;

    Set the focus back to the document editor.


  25. UiAction findAction(const SString & name) const;

    Finds UI command by name.


  26. UiItem findItemByName(const SString & name) const;

    Finds UiItem by name.


  27. UiItem findItemByClass(const SString & name) const;

    Look up UiItem by class.


  28. UiItem findItemByAction(const UiAction & name) const;

    Finds UiItem by UiActions.


  29. void showContextMenu(int x, int y) ;

    Shows context menu for this liquid item at global pos (x,y).


  30. UiItem firstChild() const;


  31. UiItem lastChild() const;


  32. UiItem getChild(int n) const;


  33. int countChildren() const;


  34. void appendChild(const UiItem & ) ;


  35. void removeAllChildren() ;


  36. UiItem nextSibling() const;


  37. UiItem prevSibling() const;


  38. UiItem parent() const;


  39. UiItem root() const;


  40. void remove() ;


  41. void insertBefore(const UiItem & ) ;


  42. void insertAfter(const UiItem & ) ;


  43. void removeGroup(const UiItem & ) ;


  44. int siblingIndex() const;


  45. SString getTreelocString(const UiItem & = UiItem()) const;


  46. UiItem getByTreelocString(const SString & ) const;


  47. SernaDoc asSernaDoc() const;

    Downcasts UiItem to SernaDoc.


UiItem public static functions

  1. SString translate(const char * context, const SString & str) ;

    Translate string str in given context.