PropertyFile.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   (c) Jürgen Riegel (juergen.riegel@web.de) 2008                        *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This library is free software; you can redistribute it and/or         *
00007  *   modify it under the terms of the GNU Library General Public           *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2 of the License, or (at your option) any later version.      *
00010  *                                                                         *
00011  *   This library  is distributed in the hope that it will be useful,      *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Library General Public License for more details.                  *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Library General Public     *
00017  *   License along with this library; see the file COPYING.LIB. If not,    *
00018  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00019  *   Suite 330, Boston, MA  02111-1307, USA                                *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 
00024 #ifndef APP_PROPERTFILE_H
00025 #define APP_PROPERTFILE_H
00026 
00027 // Std. configurations
00028 
00029 
00030 #include <string>
00031 #include <list>
00032 #include <vector>
00033 #include <boost/filesystem/path.hpp>
00034 
00035 #include "PropertyStandard.h"
00036 
00037 
00038 namespace Base {
00039 class Writer;
00040 }
00041 
00042 namespace App
00043 {
00044 
00048 class AppExport PropertyFile : public PropertyString
00049 {
00050     TYPESYSTEM_HEADER();
00051 
00052 public:
00053     PropertyFile(void);
00054     virtual ~PropertyFile();
00055     
00056     virtual const char* getEditorName(void) const
00057     { return "Gui::PropertyEditor::PropertyFileItem"; }
00058 };
00059 
00074 class AppExport PropertyFileIncluded : public Property
00075 {
00076     TYPESYSTEM_HEADER();
00077 
00078 public:
00079     PropertyFileIncluded(void);
00080     virtual ~PropertyFileIncluded();
00081 
00082     void setValue(const char* sFile, const char* sName=0);
00083     const char* getValue(void) const;
00084 
00085     virtual const char* getEditorName(void) const
00086     { return "Gui::PropertyEditor::PropertyTransientFileItem"; }
00087     virtual PyObject *getPyObject(void);
00088     virtual void setPyObject(PyObject *);
00089     
00090     virtual void Save (Base::Writer &writer) const;
00091     virtual void Restore(Base::XMLReader &reader);
00092 
00093     virtual void SaveDocFile (Base::Writer &writer) const;
00094     virtual void RestoreDocFile(Base::Reader &reader);
00095 
00096     virtual Property *Copy(void) const;
00097     virtual void Paste(const Property &from);
00098 
00099     // get the transient path if the property is in a DocumentObject
00100     std::string getDocTransientPath(void) const;
00101 
00107     std::string getExchangeTempFile(void) const;
00108 
00109 protected:
00110     std::string _cValue;
00111     std::string _BaseFileName;
00112 };
00113 
00114 
00115 } // namespace App
00116 
00117 #endif // APP_PROPERTFILE_H

Generated on Wed Nov 23 19:00:30 2011 for FreeCAD by  doxygen 1.6.1