00001 00002 // 00003 // YASA sources support (managing source and header files) 00004 // 00005 // Project: Yasa 2 00006 // Author : Jan Blumenthal 00007 // Start : 2002/02/28 00008 // $Header: /sources/yasa/yasagui/sources.h,v 1.4 2003/01/24 15:47:42 bj Exp $ 00009 // 00011 // 00012 // This program is free software; you can redistribute it and/or modify 00013 // it under the terms of the GNU General Public License as published by 00014 // the Free Software Foundation; either version 2 of the License, or 00015 // (at your option) any later version. 00016 // 00017 // This program is distributed in the hope that it will be useful, 00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 // GNU General Public License for more details. 00021 // 00022 // You should have received a copy of the GNU General Public License 00023 // along with this program (See the included file COPYING); 00024 // if not, write to the Free Software Foundation, Inc., 00025 // 675 Mass Ave, Cambridge, MA 02139, USA. 00026 // 00028 #ifndef YASAGUI_SOURCES_INCLUDE 00029 #define YASAGUI_SOURCES_INCLUDE 00030 00031 #include <yasagui/yasagui.h> 00032 #include <qobject.h> 00033 #include <qlist.h> 00034 #include "list.h" 00035 #include "actionhandler.h" 00036 00037 00039 class YInputParser; 00040 class YOutputParser; 00041 00042 00045 class YFilePath : public YObject 00046 { 00047 Q_OBJECT 00048 QString path; 00049 public: 00050 YFilePath(const YObjectArgs &i); 00051 const QString& GetPath() { return path; } 00052 void SetPath(const QString &p) { path=p; } 00053 QString GetAbsPath(); 00054 virtual int SetConfig(YInputParser &parser); 00055 virtual int GetConfig(YOutputParser &parser); 00056 }; 00057 00058 00061 class YFilePathSet : public YSet 00062 { 00063 bool checkdouble; 00064 public: YFilePathSet(const CONFIG_STRING sectionkey, const QString &name, YActions *a, YObject *p=0 ) : 00065 YSet(sectionkey, MSGP_DEFAULT_PROJECTNAME, YObjectArgs(name,a), p), 00066 checkdouble(true) 00067 { } 00068 protected: 00069 virtual YObject* AllocNewItem(const YObjectArgs &i); 00070 virtual YActions* GetItemActions() const 00071 { return YActionHandler::GetActions(YActionHandler::FILEPATH_ACTIONS); } 00072 }; 00073 00074 00076 class YSourceSet : public YFilePathSet 00077 { 00078 public: YSourceSet(); 00079 }; 00081 class YHeaderSet : public YFilePathSet 00082 { 00083 public: YHeaderSet(); 00084 }; 00085 00086 00087 00088 00090 #endif // ifndef YASAGUI_SOURCES_INCLUDE