00001 /* 00002 Modular Psi - A graph tracker of the Parapsychologcal scientific development 00003 Copyright (C) 2005 Leonardo Stern 00004 00005 This program is free software; you can redistribute it and/or modify it under 00006 the terms of the Common Public License Version 1.0 or (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 00009 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00010 See the Common Public License for more details. 00011 00012 You should have received a copy of the Common Public License along with this program; 00013 */ 00014 00015 00016 #ifndef PROPOSITIONGRAPH_HPP 00017 #define PROPOSITIONGRAPH_HPP 00018 00019 #include <qptrstack.h> 00020 #include "core/graph.hpp" 00021 #include "core/categorylist.hpp" 00022 00023 class PropositionGraph : public Graph 00024 { 00025 public: 00026 PropositionGraph() ; 00027 ~PropositionGraph(); 00031 QString newProposition(); 00032 void newProposition(QString pname); 00033 void newProposition (Proposition* father); 00034 00035 Edge* connect(QString source, QString target); 00036 Edge* connect(Proposition* source, Proposition* target); 00037 Edge* connect(QString source, QString target, QString trust); 00041 void load(); 00045 void save(QString dir); 00046 00047 void update(); 00048 void edgeUpdate(); 00049 void loadCats(); 00050 void useDot(); 00051 void init(); 00052 void initComboCat(); 00053 00054 00055 Proposition* propositionSelected() { return p_selected; }; 00056 Edge* edgeSelected() { return e_selected; }; 00057 short int info() { return p_info; }; 00058 void setPropositionSelected(Proposition* sel); 00059 void setEdgeSelected (Edge* sel); 00060 void setInfo (short int inf); 00061 void setStatus(int newstatus); 00062 void deleteEdge(Edge* delEdge); 00063 void deleteProp(Proposition* delProp); 00064 00065 CategoryList* categories; 00066 QPtrStack<Proposition> addStack; 00067 QPtrStack<Proposition> delStack; 00068 00069 protected : 00070 Proposition* p_selected; 00071 Edge* e_selected; 00072 short int p_info; 00073 }; 00074 00075 #endif // PROPOSITIONGRAPH_HPP