umbrello API Documentation

enumliteral.cpp

00001 /***************************************************************************
00002  *                                                                         *
00003  *   This program is free software; you can redistribute it and/or modify  *
00004  *   it under the terms of the GNU General Public License as published by  *
00005  *   the Free Software Foundation; either version 2 of the License, or     *
00006  *   (at your option) any later version.                                   *
00007  *                                                                         *
00008  *   copyright (C) 2003-2006                                               *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 #include "enumliteral.h"
00013 
00014 #include <kinputdialog.h>
00015 #include <kdebug.h>
00016 #include <klocale.h>
00017 
00018 UMLEnumLiteral::UMLEnumLiteral(const UMLObject *parent,
00019                                const QString& name, Uml::IDType id)
00020         : UMLClassifierListItem(parent, name, id) {
00021     m_BaseType = Uml::ot_EnumLiteral;
00022 }
00023 
00024 UMLEnumLiteral::UMLEnumLiteral(const UMLObject *parent) : UMLClassifierListItem(parent) {
00025     m_BaseType = Uml::ot_EnumLiteral;
00026 }
00027 
00028 UMLEnumLiteral::~UMLEnumLiteral() { }
00029 
00030 bool UMLEnumLiteral::operator==(UMLEnumLiteral& rhs) {
00031     if ( this == &rhs )  {
00032         return true;
00033     }
00034     if ( !UMLObject::operator==( rhs ) )  {
00035         return false;
00036     }
00037     return true;
00038 }
00039 
00040 void UMLEnumLiteral::copyInto(UMLEnumLiteral *rhs) const
00041 {
00042     UMLClassifierListItem::copyInto(rhs);
00043 }
00044 
00045 UMLObject* UMLEnumLiteral::clone() const
00046 {
00047     UMLEnumLiteral *clone = new UMLEnumLiteral((UMLObject *) parent());
00048     copyInto(clone);
00049 
00050     return clone;
00051 }
00052 
00053 
00054 void UMLEnumLiteral::saveToXMI(QDomDocument& qDoc, QDomElement& qElement) {
00055     QDomElement attributeElement = UMLObject::save("UML:EnumerationLiteral", qDoc);
00056     qElement.appendChild( attributeElement );
00057 }
00058 
00059 bool UMLEnumLiteral::load(QDomElement& ) {
00060     return true;
00061 }
00062 
00063 bool UMLEnumLiteral::showPropertiesDialog(QWidget* parent) {
00064     bool ok;
00065     QString name = KInputDialog::getText(i18n("Name"), i18n("Enter name:"), getName(), &ok, parent);
00066     if ( ok && !name.isEmpty() )  {
00067         setName(name);
00068         return true;
00069     } else {
00070         return false;
00071     }
00072 }
00073 
00074 
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:07:57 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003