umbrello API Documentation

petalnode.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) 2006                                                    *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 // own header
00013 #include "petalnode.h"
00014 
00015 PetalNode::PetalNode(NodeType nt) {
00016     m_type = nt;
00017 }
00018 
00019 PetalNode::~PetalNode() {
00020 }
00021 
00022 PetalNode::NodeType PetalNode::type() const {
00023     return m_type;
00024 }
00025 
00026 QStringList PetalNode::initialArgs() const {
00027     return m_initialArgs;
00028 }
00029 
00030 QString PetalNode::name() const {
00031     if (m_initialArgs.count() == 0)
00032         return QString();
00033     return m_initialArgs.first();
00034 }
00035 
00036 PetalNode::NameValueList PetalNode::attributes() const {
00037     return m_attributes;
00038 }
00039 
00040 /*
00041 void PetalNode::setType(PetalNode::NodeType t) {
00042     m_type = t;
00043 }
00044  */
00045 
00046 void PetalNode::setInitialArgs(const QStringList& args) {
00047     m_initialArgs = args;
00048 }
00049 
00050 void PetalNode::setAttributes(PetalNode::NameValueList vl) {
00051     m_attributes = vl;
00052 }
00053 
00054 PetalNode::StringOrNode PetalNode::findAttribute(const QString& name) const {
00055     for (uint i = 0; i < m_attributes.count(); i++) {
00056         if (m_attributes[i].first == name)
00057             return m_attributes[i].second;
00058     }
00059     return StringOrNode();
00060 }
00061 
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:59 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003