00001 /* 00002 * The information in this file is 00003 * Copyright(c) 2011 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 NITFPROPERTIES_H__ 00011 #define NITFPROPERTIES_H__ 00012 00013 #include "Properties.h" 00014 class QWidget; 00015 00016 namespace Nitf 00017 { 00018 /** 00019 * A plug-in interface used to specify a GUI for displaying and (optionally) editing TRE and DES data. 00020 * 00021 * Data can be viewed and edited using the normal metadata editor but some data benefit 00022 * from a more taylored GUI. Implementers of this interface will not need to write a second 00023 * plug-in to attach the GUI to a specific DataElement. Any DataElement with an associated TRE or DES 00024 * will be automatically displayed in that element's properties dialog. 00025 */ 00026 class Properties : public ::Properties 00027 { 00028 public: 00029 /** 00030 * The type that should be returned from PlugIn::getSubtype() 00031 * for properties plug-ins. This subtype is needed to automatically 00032 * attach this property widget to a DataElement. 00033 * 00034 * @return Returns the type used for properties plug-ins. 00035 */ 00036 static std::string SubType() 00037 { 00038 return "NITF"; 00039 } 00040 00041 /** 00042 * The name of the TRE or DES this plug-in displays. 00043 * 00044 * @return The name of the TRE or DES. This must exactly match the TRE or DES name 00045 * as it appears in the DataElement metadata. 00046 */ 00047 virtual std::string getTypeName() const = 0; 00048 00049 /** 00050 * Determine if this plug-in can display and/or edit the specified metadata. 00051 * 00052 * @param metadata 00053 * The element metadata sub-tree for the named TRE or DES. This will be rooted at 00054 * the metadata TRE or DES node with the same name as SubType(). 00055 * @return \c True if the metadata can be displayed and/or edited, otherwise \c false. 00056 */ 00057 virtual bool canDisplayMetadata(const DynamicObject& metadata) = 0; 00058 00059 protected: 00060 /** 00061 * Since the Properties interface is usually used in conjunction with the 00062 * PlugIn interface, this should be destroyed by casting to the PlugIn 00063 * interface and calling PlugInManagerServices::destroyPlugIn(). 00064 */ 00065 virtual ~Properties() {} 00066 }; 00067 } 00068 00069 #endif