00001 /* -*- c++ -*- (for Emacs) 00002 * 00003 * mvcdiagram.h 00004 * Digest 00005 * 00006 * Created by Aidan Lane on Thu Aug 26 2005. 00007 * Copyright (c) 2005 Optimisation and Constraint Solving Group, 00008 * Monash University. All rights reserved. 00009 * 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 */ 00024 00025 #ifndef MVCDIAGRAM_H 00026 #define MVCDIAGRAM_H 00027 00028 00029 #include "MvcCore/mvccore.h" 00030 00031 00032 /* Enable QPolygonF to be used in QVariant, as Qt does not do this for us. 00033 * The registration is actually performed by DiagramElementPolygon, but 00034 * don't want to include its header explicitly everywhere. 00035 */ 00036 #include <QPolygonF> 00037 Q_DECLARE_METATYPE( QPolygonF ); 00038 00039 00040 class MvcDiagram : public MvcCore { 00041 00042 public: 00043 enum ElementType { 00044 DE_Gesture = MvcCore::UserElement, 00045 DE_Polygon, 00046 DE_Polyline, 00047 DE_Shape, 00048 DE_Text, 00049 UserElement = MvcCore::UserElement + 1000 00050 }; 00051 00052 enum ElementAttributeType { 00053 DEA_CiderInfo = MvcCore::UserElementAttribute,//TODO: move me to Digest -> it's application specific! 00054 DEA_Comment, 00055 DEA_Ink, 00056 DEA_Label, 00057 DEA_Origin, 00058 DEA_Polygon, 00059 DEA_Pos, 00060 DEA_Rect, 00061 DEA_Shape, 00062 DEA_Size, 00063 UserElementAttribute = MvcCore::UserElementAttribute + 1000 00064 }; 00065 00066 inline static MvcModuleId_t id() { 00067 static MvcModuleId_t s_id = generateNewId(); 00068 return s_id; 00069 } 00070 }; 00071 00072 00073 #endif // ! MVCDIAGRAM_H
1.5.2