• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdesdk
  • Sitemap
  • Contact Us
 

umbrello/umbrello

classifier.h

Go to the documentation of this file.
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) 2002-2007                                               *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 #ifndef CLASSIFIER__H
00013 #define CLASSIFIER__H
00014 
00015 #include "package.h"
00016 #include "umlattributelist.h"
00017 #include "umloperationlist.h"
00018 #include "umlclassifierlistitemlist.h"
00019 #include "classifierlistitem.h"
00020 #include "umltemplatelist.h"
00021 #include "model_utils.h"
00022 
00023 // forward declarations
00024 class UMLAssociation;
00025 class IDChangeLog;
00026 
00041 class UMLClassifier : public UMLPackage
00042 {
00043     Q_OBJECT
00044 public:
00045 
00049     enum ClassifierType { ALL = 0, CLASS, INTERFACE, DATATYPE };
00050 
00051 
00058     explicit UMLClassifier(const QString & name = QString(), Uml::IDType id = Uml::id_None);
00059 
00063     virtual ~UMLClassifier();
00064 
00068     bool operator==(const UMLClassifier & rhs );
00069 
00074     virtual void copyInto(UMLObject *lhs) const;
00075 
00079     UMLObject* clone() const;
00080 
00090     virtual UMLAttribute* createAttribute(const QString &name = QString(),
00091                                           UMLObject *type = 0,
00092                                           Uml::Visibility vis = Uml::Visibility::Private,
00093                                           const QString &init = QString());
00094 
00107     UMLAttribute* addAttribute(const QString &name, Uml::IDType id = Uml::id_None);
00108 
00109     UMLAttribute* addAttribute(const QString &name, UMLObject *type, Uml::Visibility scope);
00110 
00123     bool addAttribute(UMLAttribute* Att, IDChangeLog* Log = 0,
00124                       int position = -1);
00125 
00133     int removeAttribute(UMLAttribute *a);
00134 
00140     int attributes() ;
00141 
00149     UMLAttributeList getAttributeList() const;
00150 
00157     UMLAttributeList getAttributeList(Uml::Visibility scope) const;
00158 
00165     UMLAttributeList getAttributeListStatic(Uml::Visibility scope) const;
00166 
00188     UMLOperation* createOperation( const QString &name = QString(),
00189                                    bool *isExistingOp = NULL,
00190                                    Model_Utils::NameAndType_List *params = NULL);
00191 
00203     bool addOperation(UMLOperation* Op, int position = -1);
00204 
00214     bool addOperation(UMLOperation* Op, IDChangeLog* Log);
00215 
00227     UMLOperation * checkOperationSignature( const QString& name,
00228                                             UMLAttributeList opParams,
00229                                             UMLOperation *exemptOp = NULL);
00230 
00240     int removeOperation(UMLOperation *op);
00241 
00247     int operations() ;
00248 
00255     UMLOperationList getOpList(bool includeInherited = false);
00256 
00262     UMLObject* createTemplate(const QString& name = QString());
00263 
00271     UMLTemplate* addTemplate(const QString &name, Uml::IDType id = Uml::id_None);
00272 
00281     bool addTemplate(UMLTemplate* newTemplate, IDChangeLog* log = 0);
00282 
00292     //TODO: if the param IDChangeLog from the method above is not being used,
00293     // give position a default value of -1 and the method can replace the above one
00294     bool addTemplate(UMLTemplate* Template, int position);
00295 
00303     int removeTemplate(UMLTemplate* umltemplate);
00304 
00308     UMLTemplate *findTemplate(const QString& name);
00309 
00315     int templates();
00316 
00324     UMLTemplateList getTemplateList() const;
00325 
00334     int takeItem(UMLClassifierListItem* item);
00335 
00343     virtual UMLClassifierListItemList getFilteredList(Uml::Object_Type ot) const;
00344 
00353     virtual bool resolveRef();
00354 
00361     UMLOperationList findOperations(const QString &n);
00362 
00371     virtual UMLObject* findChildObjectById(Uml::IDType id, bool considerAncestors = false);
00372 
00381     UMLOperation* findOperation(const QString& name,
00382                                 Model_Utils::NameAndType_List params);
00383 
00390     UMLClassifierList findSuperClassConcepts(ClassifierType type = ALL);
00391 
00398     UMLClassifierList findSubClassConcepts(ClassifierType type = ALL);
00399 
00401     virtual bool acceptAssociationType(Uml::Association_Type);
00402 
00407     void setClassAssoc(UMLAssociation *assoc);
00408 
00414     UMLAssociation *getClassAssoc() const;
00415 
00420     void setBaseType(Uml::Object_Type ot);
00421 
00425     bool isInterface() const;
00426 
00430     bool isDatatype() const;
00431 
00435     void setOriginType(UMLClassifier *origType);
00436 
00440     UMLClassifier * originType() const;
00441 
00445     void setIsReference(bool isRef = true);
00446 
00450     bool isReference() const;
00451 
00455     bool hasAbstractOps();
00456 
00460     bool hasAssociations();
00461 
00465     bool hasAttributes();
00466 
00470     bool hasStaticAttributes();
00471 
00475     bool hasMethods();
00476 
00480     bool hasAccessorMethods();
00481 
00485     bool hasOperationMethods();
00486 
00490     bool hasVectorFields();
00491 
00497 //    UMLClassifierList getPlainAssocChildClassifierList();
00498 //    UMLClassifierList getAggregateChildClassifierList();
00499 //    UMLClassifierList getCompositionChildClassifierList();
00500 
00508     UMLClassifierListItem* makeChildObject(const QString& xmiTag);
00509 
00513     virtual UMLAssociationList  getUniAssociationToBeImplemented();
00514 
00515 signals:
00518     void operationAdded(UMLClassifierListItem *);
00519 
00522     void operationRemoved(UMLClassifierListItem *);
00523 
00524     void templateAdded(UMLClassifierListItem*);
00525     void templateRemoved(UMLClassifierListItem*);
00526 
00527     // only applies when (m_Type == ot_Class)
00528     void attributeAdded(UMLClassifierListItem*);
00529     void attributeRemoved(UMLClassifierListItem*);
00530 
00531 private:
00532 
00533     UMLAssociation *m_pClassAssoc;
00534 
00535     bool m_isRef;
00536 
00543 //    UMLClassifierList findAssocClassifierObjsInRoles (UMLAssociationList * list);
00544 
00545 protected:
00546 
00551     void saveToXMI(QDomDocument& qDoc, QDomElement& qElement);
00552 
00560     virtual bool load(QDomElement& element);
00561 
00562 };
00563 
00564 #endif // CONCEPT_H

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdesdk

Skip menu "kdesdk"
  • kate
  •     kate
  • umbrello
  •   umbrello
Generated for kdesdk by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal