Never done this, but you should find what you need to create a class in kernel/class/edit.php on line 128 - 140, but the code that handles attributes are 'a bit' specific for the view. kernel/class/copy.php might be a better starting point for the attributes.