25 #ifndef YPartitionSplitter_h 26 #define YPartitionSplitter_h 96 const std::string & usedLabel,
97 const std::string & freeLabel,
98 const std::string & newPartLabel,
99 const std::string & freeFieldLabel,
100 const std::string & newPartFieldLabel );
113 virtual const char *
widgetClass()
const {
return "YPartitionSplitter"; }
120 virtual int value() = 0;
127 virtual void setValue(
int newValue ) = 0;
132 int usedSize()
const;
133 int totalFreeSize()
const;
134 int minFreeSize()
const;
135 int maxFreeSize()
const {
return totalFreeSize() - minNewPartSize(); }
136 int freeSize() {
return totalFreeSize() - newPartSize(); }
137 int newPartSize() {
return value(); }
138 int minNewPartSize()
const;
139 int maxNewPartSize()
const {
return totalFreeSize() - minFreeSize(); }
141 std::string usedLabel()
const;
142 std::string freeLabel()
const;
143 std::string newPartLabel()
const;
144 std::string freeFieldLabel()
const;
145 std::string newPartFieldLabel()
const;
157 virtual bool setProperty(
const std::string & propertyName,
190 #endif // YPartitionSplitter_h Transport class for the value of simple properties.
virtual YPropertyValue getProperty(const std::string &propertyName)
Get a property.
PartitionSplitter: A (very custom) widget for easily splitting one existing partition into two...
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Set a property.
A set of properties to check names and types against.
const char * userInputProperty()
The name of the widget property that will return user input.
YPartitionSplitter(YWidget *parent, int usedSize, int totalFreeSize, int newPartSize, int minNewPartSize, int minFreeSize, const std::string &usedLabel, const std::string &freeLabel, const std::string &newPartLabel, const std::string &freeFieldLabel, const std::string &newPartFieldLabel)
Constructor.
virtual const char * widgetClass() const
Returns a descriptive name of this widget class for logging, debugging etc.
virtual const YPropertySet & propertySet()
Return this class's property set.
virtual void setValue(int newValue)=0
Set the value (the size of the new partition).
virtual int value()=0
The value of this PartitionSplitter: The size of the new partition.
virtual ~YPartitionSplitter()
Destructor.