diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 47d455dd55be855e4cc691c32f687f723d9247ee (patch) | |
tree | 52e236aaa2576bdb3840ebede26619692fed6d7d /kpovmodeler/pmdeclare.h | |
download | tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.tar.gz tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpovmodeler/pmdeclare.h')
-rw-r--r-- | kpovmodeler/pmdeclare.h | 147 |
1 files changed, 147 insertions, 0 deletions
diff --git a/kpovmodeler/pmdeclare.h b/kpovmodeler/pmdeclare.h new file mode 100644 index 00000000..d466e60e --- /dev/null +++ b/kpovmodeler/pmdeclare.h @@ -0,0 +1,147 @@ +//-*-C++-*- +/* +************************************************************************** + description + -------------------- + copyright : (C) 2000-2002 by Andreas Zehender + email : [email protected] +************************************************************************** + +************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +**************************************************************************/ + +#ifndef PMDECLARE_H +#define PMDECLARE_H + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include "pmcompositeobject.h" +#include "pmsymboltable.h" + +/** + * Class for all povray declares + */ +class PMDeclare : public PMCompositeObject +{ + typedef PMCompositeObject Base; +public: + /** + * Constructor + */ + PMDeclare( PMPart* part ); + /** + * Copy constructor + */ + PMDeclare( const PMDeclare& d ); + /** + * Deletes the object + */ + ~PMDeclare( ); + + /** */ + virtual PMObject* copy( ) const { return new PMDeclare( *this ); } + + /** */ + virtual QString description( ) const; + /** */ + virtual QString pixmap( ) const; + + /** */ + virtual PMMetaObject* metaObject( ) const; + /** */ + virtual void cleanUp( ) const; + + /** */ + virtual bool dataChangeOnInsertRemove( ) const { return true; } + /** */ + virtual void serialize( QDomElement& e, QDomDocument& doc ) const; + /** */ + virtual void readAttributes( const PMXMLHelper& h ); + + /** + * Returns a new @ref PMDeclareEdit + */ + virtual PMDialogEditBase* editWidget( QWidget* parent ) const; + /** + * Returns the id of the declare + */ + virtual QString name( ) const { return m_id; } + /** + * Returns the id of the declare + */ + QString id( ) const { return m_id; } + /** + * Returns the declare type + */ + QString declareType( ) const; + + /** + * Sets the id of the object. + */ + void setID( const QString& id ); + /** */ + virtual bool canHaveName( ) const { return true; } + + /** */ + virtual void restoreMemento( PMMemento* s ); + /** + * Returns an iterator to the list of objects, that are linked to that + * declare + */ + PMObjectListIterator linkedObjects( ) const + { + return PMObjectListIterator( m_linkedObjects ); + } + /** + * Adds the object to the list of linked objects + */ + void addLinkedObject( PMObject* o ); + /** + * Removes the object from the list of linked objects + */ + void removeLinkedObject( PMObject* o ); + + /** */ + virtual void childAdded( PMObject* o ); + /** */ + virtual void childRemoved( PMObject* o ); + +private: + /** + * Sets the declare type + */ + void setDeclareType( PMMetaObject* o ); + /** + * Recalculates the declaration type + */ + void updateDeclareType( ); + /** + * IDs for @ref PMMementoData + */ + enum PMDeclareMementoID { PMIDID }; + + /** + * id of the declare + */ + QString m_id; + /** + * The linked objects + */ + PMObjectList m_linkedObjects; + /** + * The declare type + */ + PMMetaObject* m_pDeclareType; + + static PMMetaObject* s_pMetaObject; +}; + +#endif |