diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2011-10-27 04:55:51 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2011-10-27 04:55:51 +0000 |
| commit | 2633767789e4264b13ef91a684accf734fb4e94f (patch) | |
| tree | 0f6bc8d758b8e4bcf01d2dd393166907906c156e /src/ui/widget/unit-menu.h | |
| parent | Cleanup pass on documentation that was dumping garbage into doxygen output. (diff) | |
| download | inkscape-2633767789e4264b13ef91a684accf734fb4e94f.tar.gz inkscape-2633767789e4264b13ef91a684accf734fb4e94f.zip | |
Fixing more broken and split doc comments.
(bzr r10697)
Diffstat (limited to 'src/ui/widget/unit-menu.h')
| -rw-r--r-- | src/ui/widget/unit-menu.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/ui/widget/unit-menu.h b/src/ui/widget/unit-menu.h index cb11bbb30..61e93bd65 100644 --- a/src/ui/widget/unit-menu.h +++ b/src/ui/widget/unit-menu.h @@ -25,27 +25,98 @@ namespace Widget { class UnitMenu : public ComboText { public: + + /** + * Construct a UnitMenu + */ UnitMenu(); + virtual ~UnitMenu(); + /** + * Adds the unit type to the widget. This extracts the corresponding + * units from the unit map matching the given type, and appends them + * to the dropdown widget. It causes the primary unit for the given + * unit_type to be selected. + */ bool setUnitType(UnitType unit_type); + + /** + * Removes all unit entries, then adds the unit type to the widget. + * This extracts the corresponding + * units from the unit map matching the given type, and appends them + * to the dropdown widget. It causes the primary unit for the given + * unit_type to be selected. + */ bool resetUnitType(UnitType unit_type); + + /** + * Adds a unit, possibly user-defined, to the menu. + */ void addUnit(Unit const& u); + /** + * Sets the dropdown widget to the given unit abbreviation. + * Returns true if the unit was selectable, false if not + * (i.e., if the unit was not present in the widget). + */ bool setUnit(Glib::ustring const &unit); + /** + * Returns the Unit object corresponding to the current selection + * in the dropdown widget. + */ Unit getUnit() const; + + /** + * Returns the abbreviated unit name of the selected unit. + */ Glib::ustring getUnitAbbr() const; + + /** + * Returns the UnitType of the selected unit. + */ UnitType getUnitType() const; + + /** + * Returns the unit factor for the selected unit. + */ double getUnitFactor() const; + /** + * Returns the recommended number of digits for displaying + * numbers of this unit type. + */ int getDefaultDigits() const; + + /** + * Returns the recommended step size in spin buttons + * displaying units of this type. + */ double getDefaultStep() const; + + /** + * Returns the recommended page size (when hitting pgup/pgdn) + * in spin buttons displaying units of this type. + */ double getDefaultPage() const; + /** + * Returns the conversion factor required to convert values + * of the currently selected unit into units of type + * new_unit_abbr. + */ double getConversion(Glib::ustring const &new_unit_abbr, Glib::ustring const &old_unit_abbr = "no_unit") const; + /** + * Returns true if the selected unit is not dimensionless + * (false for %, true for px, pt, cm, etc). + */ bool isAbsolute() const; + + /** + * Returns true if the selected unit is radial (deg or rad). + */ bool isRadial() const; UnitTable &getUnitTable() {return _unit_table;} |
