// CanMove bool BPartition::CanMove(BObjectList<BPartition>* unmovableDescendants, BObjectList<BPartition>* movableOnlyIfUnmounted) const { BPartition* parent = Parent(); if (!parent || !fDelegate) return false; if (!parent->_SupportsChildOperation(this, B_DISK_SYSTEM_SUPPORTS_MOVING_CHILD)) { return false; } bool whileMounted; bool movable = _SupportsOperation(B_DISK_SYSTEM_SUPPORTS_MOVING, B_DISK_SYSTEM_SUPPORTS_MOVING_WHILE_MOUNTED, &whileMounted); if (!movable) return false; if (!whileMounted) movableOnlyIfUnmounted->AddItem(const_cast<BPartition*>(this)); // collect descendent partitions // TODO: ... // TODO: Currently there's no interface for asking descendents. They'll still // have the same offset (relative to their parent) after moving. The only thing // we really have to ask is whether they need to be unmounted. return true; }
// CanSetName bool BPartition::CanSetName() const { BPartition* parent = Parent(); if (!parent || !fDelegate) return false; return parent->_SupportsChildOperation(this, B_DISK_SYSTEM_SUPPORTS_SETTING_NAME); }
// CanEditParameters bool BPartition::CanEditParameters() const { BPartition* parent = Parent(); if (!parent) return false; return parent->_SupportsChildOperation(this, B_DISK_SYSTEM_SUPPORTS_SETTING_PARAMETERS); }
// CanSetType bool BPartition::CanSetType() const { BPartition* parent = Parent(); if (!parent) return false; return parent->_SupportsChildOperation(this, B_DISK_SYSTEM_SUPPORTS_SETTING_TYPE); }
// CanResize bool BPartition::CanResize(bool* canResizeContents, bool* whileMounted) const { BPartition* parent = Parent(); if (!parent) return false; if (!parent->_SupportsChildOperation(this, B_DISK_SYSTEM_SUPPORTS_RESIZING_CHILD)) { return false; } if (!_HasContent()) return true; return _SupportsOperation(B_DISK_SYSTEM_SUPPORTS_RESIZING, B_DISK_SYSTEM_SUPPORTS_RESIZING_WHILE_MOUNTED, whileMounted); }