00001 /* 00002 * The information in this file is 00003 * Copyright(c) 2007 Ball Aerospace & Technologies Corporation 00004 * and is subject to the terms and conditions of the 00005 * GNU Lesser General Public License Version 2.1 00006 * The license text is available from 00007 * http://www.gnu.org/licenses/lgpl.html 00008 */ 00009 00010 #ifndef IMPORTDESCRIPTOR_H 00011 #define IMPORTDESCRIPTOR_H 00012 00013 #include "DataDescriptor.h" 00014 00015 /** 00016 * Specifies parameters for importing a single DataElement. 00017 * 00018 * The import descriptor contains all parameters necessary to import a single 00019 * DataElement, including a DataDescriptor and a flag that specifies whether 00020 * the data should be included or ignored on import. 00021 * 00022 * Importers should create an import descriptor by calling 00023 * ModelServices::createImportDescriptor() from within the 00024 * Importer::getImportDescriptors() method. 00025 * 00026 * @see DataDescriptor 00027 */ 00028 class ImportDescriptor 00029 { 00030 public: 00031 /** 00032 * Sets the data set to import. 00033 * 00034 * This method sets a new underlying data descriptor for import and deletes 00035 * the previous data descriptor. The import descriptor assumes ownership 00036 * of the given data descriptor and will delete it when the import 00037 * descriptor is destroyed or on the next call to setDataDescriptor(). 00038 * 00039 * @param pDescriptor 00040 * The data descriptor to import. Ownership is transferred to the 00041 * import descriptor. 00042 */ 00043 virtual void setDataDescriptor(DataDescriptor* pDescriptor) = 0; 00044 00045 /** 00046 * Returns the data set for import. 00047 * 00048 * @return A pointer to the underlying data descriptor to import. 00049 */ 00050 virtual DataDescriptor* getDataDescriptor() const = 0; 00051 00052 /** 00053 * Sets whether the data element represented by the underlying data 00054 * descriptor should be imported. 00055 * 00056 * This method provides a means by which the underlying data descriptor can 00057 * be ignored on import. Importers can call this method to default the 00058 * data to load on import or to ignore loading the data on import. In 00059 * interactive mode the application will call this method to set the value 00060 * based the user selects in the import dialog. 00061 * 00062 * By default when an ImportDescriptor is created, the import flag is set 00063 * to \c true. 00064 * 00065 * @param bImport 00066 * Set this value to \c true to import the given data element or 00067 * to \c false to ignore the data element when importing. 00068 */ 00069 virtual void setImported(bool bImport) = 0; 00070 00071 /** 00072 * Queries whether the data element represented by the underlying data 00073 * descriptor should be imported. 00074 * 00075 * By default when an ImportDescriptor is created, this method returns 00076 * \c true. 00077 * 00078 * @return Returns \c true if the data represented by the underlying data 00079 * descriptor should be imported, or \c false if the data should 00080 * be ignored on import. 00081 * 00082 * @see setImported() 00083 */ 00084 virtual bool isImported() const = 0; 00085 00086 protected: 00087 /** 00088 * This object should be destroyed by calling 00089 * ModelServices::destroyImportDescriptor(). 00090 */ 00091 virtual ~ImportDescriptor() {} 00092 }; 00093 00094 #endif