00001 00002 // 00003 // YASA work space 00004 // 00005 // Project: Yasa 2 00006 // Author : Jan Blumenthal 00007 // Start : 2002/02/28 00008 // $Header: /sources/yasa/yasagui/workspace.h,v 1.4 2003/01/24 15:47:44 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_WORKSPACE_INCLUDE 00029 #define YASAGUI_WORKSPACE_INCLUDE 00030 00031 #include <yasagui/yasagui.h> 00032 #include <qobject.h> 00033 #include <qdatetime.h> 00034 #include <qfileinfo.h> 00035 #include "project.h" 00036 00037 00039 class YWorkSpace : public YObject 00040 { 00041 Q_OBJECT 00042 YApplication &application; 00043 QString filedir; 00044 QString filename; 00045 QString author; 00046 QDateTime creation_time; 00047 QDateTime lastchanged_time; 00048 int version; 00049 YProjectSet projectset; 00050 public: YWorkSpace(YApplication &app); 00051 void ResetProjectManager() 00052 { 00053 author=""; 00054 projectset.ClearSet(); 00055 creation_time=QDate::currentDate(); 00056 lastchanged_time=QDate::currentDate(); 00057 projectset.SetParent(this); 00058 } 00059 int InitInstance() { return 0; } 00060 int RemoveAllProjects(); 00061 int RemoveProject(YProject *project); 00062 00063 YApplication& GetApplication() const { return application; } 00064 YProjectSet& GetProjectSet() { return projectset; } 00065 const QString & GetAuthor() const { return author; } 00066 const QDateTime & GetCreationTime() const { return creation_time; } 00067 const QDateTime & GetLastChangedTime() const { return lastchanged_time; } 00068 const QString & GetAbsFilePath() const { return filedir; } 00069 const QString & GetFileName() const { return filename; } 00070 void SetAuthor(const QString &a); 00071 void SetCreationTime(const QDateTime &d); 00072 void SetLastChangedTime(const QDateTime &d); 00073 void SetFilePath(const QString &filepath); 00074 00075 00076 virtual int SetConfig(YInputParser &parser); 00077 virtual int GetConfig(YOutputParser &parser); 00078 void NewObjectCreated(YObject *object) { emit NewItem(object); } 00079 void ObjectRemoved(YObject *object) { emit ItemRemoved(object); } 00080 00081 signals: 00082 void NewItem(YObject *object); 00083 void ItemRemoved(YObject *object); 00084 }; 00085 00086 00088 #endif // ifndef YASAGUI_WORKSPACE_INCLUDE