#include <PropertyContainer.h>
Inherited by Layer, Preferences, and ViewPropertyContainer.
Inheritance diagram for PropertyContainer:

Definition at line 28 of file PropertyContainer.h.
Public Types | |
| enum | PropertyType { ToggleProperty, RangeProperty, ValueProperty, ColourProperty, UnitsProperty, InvalidProperty } |
| typedef QString | PropertyName |
| typedef std::vector< PropertyName > | PropertyList |
Public Slots | |
| virtual void | setProperty (const PropertyName &, int value) |
| Set a property. | |
| virtual void | setPropertyWithCommand (const PropertyName &, int value) |
| Set a property using a command, supporting undo and redo. | |
| virtual void | setProperty (QString nameString, QString valueString) |
| Set a property using a fuzzy match. | |
| virtual void | setPropertyWithCommand (QString nameString, QString valueString) |
| As above, but using a command. | |
Signals | |
| void | propertyChanged (PropertyContainer::PropertyName) |
Public Member Functions | |
| virtual | ~PropertyContainer () |
| virtual PropertyList | getProperties () const |
| Get a list of the names of all the supported properties on this container. | |
| virtual QString | getPropertyLabel (const PropertyName &) const =0 |
| Return the human-readable (and i18n'ised) name of a property. | |
| virtual PropertyType | getPropertyType (const PropertyName &) const |
| Return the type of the given property, or InvalidProperty if the property is not supported on this container. | |
| virtual QString | getPropertyIconName (const PropertyName &) const |
| Return an icon for the property, if any. | |
| virtual QString | getPropertyGroupName (const PropertyName &) const |
| If this property has something in common with other properties on this container, return a name that can be used to group them (in order to save screen space, for example). | |
| virtual int | getPropertyRangeAndValue (const PropertyName &, int *min, int *max, int *deflt) const |
| Return the minimum and maximum values for the given property and its current value in this container. | |
| virtual QString | getPropertyValueLabel (const PropertyName &, int value) const |
| If the given property is a ValueProperty, return the display label to be used for the given value for that property. | |
| virtual RangeMapper * | getNewPropertyRangeMapper (const PropertyName &) const |
| If the given property is a RangeProperty, return a new RangeMapper object mapping its integer range onto an underlying floating point value range for human-intelligible display, if appropriate. | |
| virtual QString | getPropertyContainerName () const=0 |
| virtual QString | getPropertyContainerIconName () const=0 |
| virtual PlayParameters * | getPlayParameters () |
Protected Member Functions | |
| virtual bool | convertPropertyStrings (QString nameString, QString valueString, PropertyName &name, int &value) |
Classes | |
| class | SetPropertyCommand |
| typedef QString PropertyContainer::PropertyName |
Definition at line 35 of file PropertyContainer.h.
| typedef std::vector<PropertyName> PropertyContainer::PropertyList |
Definition at line 36 of file PropertyContainer.h.
Definition at line 38 of file PropertyContainer.h.
| virtual PropertyContainer::~PropertyContainer | ( | ) | [inline, virtual] |
Definition at line 33 of file PropertyContainer.h.
| PropertyContainer::PropertyList PropertyContainer::getProperties | ( | ) | const [virtual] |
Get a list of the names of all the supported properties on this container.
These should be fixed (i.e. not internationalized).
Reimplemented in Preferences, Colour3DPlotLayer, ImageLayer, NoteLayer, SingleColourLayer, SliceLayer, SpectrogramLayer, SpectrumLayer, TextLayer, TimeInstantLayer, TimeValueLayer, WaveformLayer, and ViewPropertyContainer.
Definition at line 27 of file PropertyContainer.cpp.
Referenced by PropertyBox::colourDatabaseChanged(), convertPropertyStrings(), SingleColourLayer::getProperties(), ImageLayer::getProperties(), PropertyBox::PropertyBox(), PropertyBox::propertyContainerPropertyChanged(), PropertyBox::propertyContainerPropertyRangeChanged(), and PropertyBox::unitDatabaseChanged().
| virtual QString PropertyContainer::getPropertyLabel | ( | const PropertyName & | ) | const [pure virtual] |
Return the human-readable (and i18n'ised) name of a property.
Referenced by convertPropertyStrings(), and PropertyBox::updatePropertyEditor().
| PropertyContainer::PropertyType PropertyContainer::getPropertyType | ( | const PropertyName & | ) | const [virtual] |
Return the type of the given property, or InvalidProperty if the property is not supported on this container.
Definition at line 33 of file PropertyContainer.cpp.
References InvalidProperty.
Referenced by PropertyBox::colourDatabaseChanged(), convertPropertyStrings(), ImageLayer::getPropertyType(), getPropertyValueLabel(), PropertyBox::propertyControllerChanged(), PropertyBox::unitDatabaseChanged(), and PropertyBox::updatePropertyEditor().
| QString PropertyContainer::getPropertyIconName | ( | const PropertyName & | ) | const [virtual] |
Return an icon for the property, if any.
Definition at line 39 of file PropertyContainer.cpp.
Referenced by PropertyBox::updatePropertyEditor().
| QString PropertyContainer::getPropertyGroupName | ( | const PropertyName & | ) | const [virtual] |
If this property has something in common with other properties on this container, return a name that can be used to group them (in order to save screen space, for example).
e.g. "Window Type" and "Window Size" might both have a group name of "Window". If this property is not groupable, return the empty string.
Definition at line 45 of file PropertyContainer.cpp.
Referenced by PropertyBox::updatePropertyEditor().
| int PropertyContainer::getPropertyRangeAndValue | ( | const PropertyName & | , | |
| int * | min, | |||
| int * | max, | |||
| int * | deflt | |||
| ) | const [virtual] |
Return the minimum and maximum values for the given property and its current value in this container.
Min and/or max may be passed as NULL if their values are not required.
Definition at line 51 of file PropertyContainer.cpp.
Referenced by convertPropertyStrings(), PropertyContainer::SetPropertyCommand::execute(), SpectrogramLayer::getPropertyRangeAndValue(), SingleColourLayer::getPropertyRangeAndValue(), ImageLayer::getPropertyRangeAndValue(), Colour3DPlotLayer::getPropertyRangeAndValue(), setPropertyWithCommand(), and PropertyBox::updatePropertyEditor().
| QString PropertyContainer::getPropertyValueLabel | ( | const PropertyName & | , | |
| int | value | |||
| ) | const [virtual] |
If the given property is a ValueProperty, return the display label to be used for the given value for that property.
Definition at line 61 of file PropertyContainer.cpp.
References ColourProperty, ColourDatabase::getColourCount(), ColourDatabase::getColourName(), ColourDatabase::getInstance(), and getPropertyType().
Referenced by convertPropertyStrings(), SingleColourLayer::getPropertyValueLabel(), ImageLayer::getPropertyValueLabel(), and PropertyBox::updatePropertyEditor().
| RangeMapper * PropertyContainer::getNewPropertyRangeMapper | ( | const PropertyName & | ) | const [virtual] |
If the given property is a RangeProperty, return a new RangeMapper object mapping its integer range onto an underlying floating point value range for human-intelligible display, if appropriate.
The RangeMapper should be allocated with new, and the caller takes responsibility for deleting it. Return NULL (as in the default implementation) if there is no such mapping.
Definition at line 74 of file PropertyContainer.cpp.
Referenced by convertPropertyStrings(), and PropertyBox::updatePropertyEditor().
| virtual QString PropertyContainer::getPropertyContainerName | ( | ) | const [pure virtual] |
Implemented in Preferences, Layer, and ViewPropertyContainer.
Referenced by PropertyBox::populateViewPlayFrame(), PropertyBox::PropertyBox(), PropertyStack::repopulate(), setProperty(), PropertyBox::updateContextHelp(), and PropertyBox::updatePropertyEditor().
| virtual QString PropertyContainer::getPropertyContainerIconName | ( | ) | const [pure virtual] |
Implemented in Preferences, Layer, and ViewPropertyContainer.
| virtual PlayParameters* PropertyContainer::getPlayParameters | ( | ) | [inline, virtual] |
Reimplemented in Layer.
Definition at line 106 of file PropertyContainer.h.
Referenced by PropertyBox::editPlugin(), PropertyBox::pluginConfigurationChanged(), and PropertyBox::populateViewPlayFrame().
| void PropertyContainer::propertyChanged | ( | PropertyContainer::PropertyName | ) | [signal] |
Referenced by Preferences::setBackgroundMode(), Preferences::setOmitTempsFromRecentFiles(), Preferences::setPropertyBoxLayout(), Preferences::setResampleOnLoad(), Preferences::setResampleQuality(), Preferences::setShowSplash(), Preferences::setSpectrogramSmoothing(), Preferences::setTemporaryDirectoryRoot(), Preferences::setTuningFrequency(), Preferences::setViewFontSize(), Preferences::setWindowType(), SpectrogramLayer::SpectrogramLayer(), SpectrumLayer::SpectrumLayer(), and ViewPropertyContainer::ViewPropertyContainer().
| void PropertyContainer::setProperty | ( | const PropertyName & | , | |
| int | value | |||
| ) | [virtual, slot] |
Set a property.
This is used for all property types. For boolean properties, zero is false and non-zero true; for colours, the integer value is an index into the colours in the global ColourDatabase.
Definition at line 80 of file PropertyContainer.cpp.
References getPropertyContainerName().
Referenced by PropertyContainer::SetPropertyCommand::execute(), setProperty(), ImageLayer::setProperty(), and PropertyContainer::SetPropertyCommand::unexecute().
| void PropertyContainer::setPropertyWithCommand | ( | const PropertyName & | , | |
| int | value | |||
| ) | [virtual, slot] |
Set a property using a command, supporting undo and redo.
The default implementation should work for most subclasses.
Definition at line 86 of file PropertyContainer.cpp.
References CommandHistory::addCommand(), CommandHistory::getInstance(), and getPropertyRangeAndValue().
Referenced by MainWindow::handleOSCMessage(), PropertyBox::propertyControllerChanged(), and setPropertyWithCommand().
| void PropertyContainer::setProperty | ( | QString | nameString, | |
| QString | valueString | |||
| ) | [virtual, slot] |
Set a property using a fuzzy match.
Compare nameString with the property labels and underlying names, and if it matches one (with preference given to labels), try to convert valueString appropriately and set it. The valueString should contain a value label for value properties, a mapped value for range properties, "on" or "off" for toggle properties, a colour or unit name, or the underlying integer value for the property.
Note that as property and value labels may be translatable, the results of this function may vary by locale. It is intended for handling user-originated strings, _not_ persistent storage.
The default implementation should work for most subclasses.
Definition at line 96 of file PropertyContainer.cpp.
References convertPropertyStrings(), and setProperty().
| void PropertyContainer::setPropertyWithCommand | ( | QString | nameString, | |
| QString | valueString | |||
| ) | [virtual, slot] |
As above, but using a command.
Definition at line 111 of file PropertyContainer.cpp.
References convertPropertyStrings(), and setPropertyWithCommand().
| bool PropertyContainer::convertPropertyStrings | ( | QString | nameString, | |
| QString | valueString, | |||
| PropertyName & | name, | |||
| int & | value | |||
| ) | [protected, virtual] |
Definition at line 126 of file PropertyContainer.cpp.
References ColourProperty, ColourDatabase::getColourIndex(), UnitDatabase::getInstance(), ColourDatabase::getInstance(), getNewPropertyRangeMapper(), RangeMapper::getPositionForValue(), getProperties(), getPropertyLabel(), getPropertyRangeAndValue(), getPropertyType(), getPropertyValueLabel(), UnitDatabase::getUnitId(), InvalidProperty, RangeProperty, ToggleProperty, UnitsProperty, and ValueProperty.
Referenced by setProperty(), and setPropertyWithCommand().
1.5.1