1//---------------------------------------------------------------------- 2// This software is part of the OpenBeOS distribution and is covered 3// by the OpenBeOS license. 4//--------------------------------------------------------------------- 5 6#include <DiskScannerAddOn.h> 7#include <String.h> 8 9// BDiskScannerPartitionAddOn 10 11// constructor 12/*! \brief Creates a partition disk scanner add-on. 13*/ 14BDiskScannerPartitionAddOn::BDiskScannerPartitionAddOn() 15{ 16} 17 18 19// destructor 20/*! \brief Frees all resources associated with this object. 21*/ 22BDiskScannerPartitionAddOn::~BDiskScannerPartitionAddOn() 23{ 24} 25 26/*! \fn virtual const char *BDiskScannerPartitionAddOn::ShortName() = 0; 27 \brief Returns a short name for the add-on. 28 29 To be implemented by derived classes. 30 31 The returned string identifies the respective partition kernel module is 32 passed to partition_session(). 33 34 \return A short name for the add-on. 35*/ 36 37/*! \fn virtual const char *BDiskScannerPartitionAddOn::LongName() = 0; 38 \brief Returns a user-readable long name for the add-on. 39 40 To be implemented by derived classes. 41 42 \return A long name for the add-on. 43*/ 44 45/*! \fn virtual BDiskScannerPartitionAddOn::BDiskScannerParameterEditor * 46 CreateEditor(const BSession *session, const char *parameters) = 0; 47 \brief Creates and returns an editor for editing partitioning parameters 48 for a specified session. 49 50 To be implemented by derived classes. 51 52 \param session The session to be partitioned. 53 \param parameters Parameters retrieved from the partition module. Should 54 initially be presented to the user. 55 \return The newly created editor. \c NULL, if an error occurred. 56*/ 57 58// FBC 59void BDiskScannerPartitionAddOn::_ReservedDiskScannerPartitionAddOn1() {} 60void BDiskScannerPartitionAddOn::_ReservedDiskScannerPartitionAddOn2() {} 61void BDiskScannerPartitionAddOn::_ReservedDiskScannerPartitionAddOn3() {} 62void BDiskScannerPartitionAddOn::_ReservedDiskScannerPartitionAddOn4() {} 63void BDiskScannerPartitionAddOn::_ReservedDiskScannerPartitionAddOn5() {} 64 65 66// BDiskScannerFSAddOn 67 68// constructor 69/*! \brief Creates a FS disk scanner add-on. 70*/ 71BDiskScannerFSAddOn::BDiskScannerFSAddOn() 72{ 73} 74 75 76// destructor 77/*! \brief Frees all resources associated with this object. 78*/ 79BDiskScannerFSAddOn::~BDiskScannerFSAddOn() 80{ 81} 82 83/*! \fn virtual const char *BDiskScannerFSAddOn::ShortName() = 0; 84 \brief Returns a short name for the add-on. 85 86 To be implemented by derived classes. 87 88 The returned name identifies the file system (the kernel add-on) and is 89 passed to initialize_volume(). 90 91 \return A short name for the add-on. 92*/ 93 94/*! \fn virtual const char *BDiskScannerFSAddOn::LongName() = 0; 95 \brief Returns a user-readable long name for the add-on. 96 97 To be implemented by derived classes. 98 99 \return A long name for the add-on. 100*/ 101 102/*! \fn virtual BDiskScannerFSAddOn::BDiskScannerParameterEditor *CreateEditor( 103 const BPartition *partition, const char *parameters) = 0; 104 \brief Creates and returns an editor for editing initialization parameters 105 for a specified partition. 106 107 To be implemented by derived classes. 108 109 \param partition The partition to be initialized. 110 \param parameters Parameters retrieved from the kernel FS add-on. Should 111 initially be presented to the user. 112 \return The newly created editor. \c NULL, if the FS doesn't need any 113 further parameters. 114*/ 115 116// FBC 117void BDiskScannerFSAddOn::_ReservedDiskScannerFSAddOn1() {} 118void BDiskScannerFSAddOn::_ReservedDiskScannerFSAddOn2() {} 119void BDiskScannerFSAddOn::_ReservedDiskScannerFSAddOn3() {} 120void BDiskScannerFSAddOn::_ReservedDiskScannerFSAddOn4() {} 121void BDiskScannerFSAddOn::_ReservedDiskScannerFSAddOn5() {} 122 123 124// BDiskScannerParameterEditor 125 126// constructor 127/*! \brief Creates a disk scanner parameter editor. 128*/ 129BDiskScannerParameterEditor::BDiskScannerParameterEditor() 130{ 131} 132 133 134// destructor 135/*! \brief Frees all resources associated with this object. 136*/ 137BDiskScannerParameterEditor::~BDiskScannerParameterEditor() 138{ 139} 140 141 142/*! \brief Returns a view containing the controls needed for editing the 143 parameters. 144 145 To be overridden by derived classes. 146 The base class version returns \c NULL. 147 148 The returned BView is added to a window occasionally and removed, when 149 editing is done. The view belongs to the editor and needs to be deleted 150 by it. Subsequent calls to this method may return the same view, or each 151 time delete the old one and return a new one. 152 153 \return A view containing the controls needed for editing the parameters. 154 \c NULL can be returned, if no parameters are needed. 155*/ 156BView * 157BDiskScannerParameterEditor::View() 158{ 159 return NULL; 160} 161 162 163// EditingDone 164/*! \brief Called when the user finishes editing the parameters. 165 166 To be overridden by derived classes. 167 The base class version returns \c true. 168 169 The method is supposed to check whether the parameters the user set, 170 are valid, and, if so, return \c true. Otherwise an BAlert shall be 171 shown, explaining the problem to the user and \c false being returned 172 -- then the parameter dialog will not be closed. 173 174 \return \c true, if the current parameters are valid, \c false otherwise. 175*/ 176bool 177BDiskScannerParameterEditor::EditingDone() 178{ 179 return true; 180} 181 182 183/*! \brief Returns the edited parameters. 184 185 To be overridden by derived classes. 186 The base class version returns an empty string. 187 188 \param parameters A BString to be set to the edited parameters. 189 190 \return \c B_OK, if everything went fine, another error code otherwise. 191*/ 192status_t 193BDiskScannerParameterEditor::GetParameters(BString *parameters) 194{ 195 status_t error = (parameters ? B_OK : B_BAD_VALUE); 196 if (error == B_OK) 197 parameters->SetTo(""); 198 return error; 199} 200 201// FBC 202void BDiskScannerParameterEditor::_ReservedDiskScannerParameterEditor1() {} 203void BDiskScannerParameterEditor::_ReservedDiskScannerParameterEditor2() {} 204void BDiskScannerParameterEditor::_ReservedDiskScannerParameterEditor3() {} 205void BDiskScannerParameterEditor::_ReservedDiskScannerParameterEditor4() {} 206void BDiskScannerParameterEditor::_ReservedDiskScannerParameterEditor5() {} 207 208 209/*! \fn BDiskScannerPartitionAddOn *create_ds_partition_add_on(); 210 \brief To be provided by partition add-ons to create an add-on object. 211 \return A newly created BDiskScannerPartitionAddOn for this add-on. 212*/ 213 214/*! \fn BDiskScannerFSAddOn *create_ds_fs_add_on(); 215 \brief To be provided by FS add-ons to create an add-on object. 216 \return A newly created BDiskScannerFSAddOn for this add-on. 217*/ 218 219