Salome HOME
Updated copyright comment
[modules/gui.git] / src / SUIT / SUIT_DataObject.h
old mode 100755 (executable)
new mode 100644 (file)
index 8e06fad..68c6e50
@@ -1,32 +1,35 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SUIT_DataObject.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
 #ifndef SUIT_DATAOBJECT_H
 #define SUIT_DATAOBJECT_H
 
 #include "SUIT.h"
 
+#include <Qtx.h>
+
 #include <QList>
 #include <QObject>
 #include <QString>
@@ -42,13 +45,13 @@ typedef QList<SUIT_DataObject*> DataObjectList;
 #pragma warning( disable:4251 )
 #endif
 
-class SUIT_EXPORT SUIT_DataObject  
+class SUIT_EXPORT SUIT_DataObject
 {
 public:
   class Signal;
 
   //! Color role
-  typedef enum { 
+  typedef enum {
     Text,              //!< editor foreground (text) color
     Base,              //!< editor background color
     Foreground,        //!< foreground (text) color
@@ -59,8 +62,9 @@ public:
 
   //! Column id
   enum
-  { 
-    NameId            //!< name column
+  {
+    NameId,          //!< name column
+    VisibilityId     //!< visibility state column
   };
 
   SUIT_DataObject( SUIT_DataObject* = 0 );
@@ -72,9 +76,11 @@ public:
 
   int                         childCount() const;
   int                         childPos( const SUIT_DataObject* ) const;
+  void                        moveChildPos( SUIT_DataObject*, int );
   SUIT_DataObject*            childObject( const int ) const;
   int                         level() const;
   int                         position() const;
+  void                        setPosition(int);
 
   SUIT_DataObject*            nextBrother() const;
   SUIT_DataObject*            prevBrother() const;
@@ -84,7 +90,7 @@ public:
 
   virtual void                children( DataObjectList&, const bool = false ) const;
   virtual DataObjectList      children( const bool = false );
-  
+
   void                        appendChild( SUIT_DataObject* );
   virtual void                insertChild( SUIT_DataObject*, int );
   virtual void                removeChild( SUIT_DataObject*, const bool = false );
@@ -94,6 +100,10 @@ public:
 
   virtual SUIT_DataObject*    parent() const;
   virtual void                setParent( SUIT_DataObject* );
+  virtual void                assignParent( SUIT_DataObject* );
+  void                        insertChildAtPos( SUIT_DataObject* obj, int position );
+  bool                        modified(){return _modified;};
+  virtual void                setModified(bool modified);
 
   virtual QString             name() const;
   virtual QString             text( const int = NameId ) const;
@@ -105,12 +115,16 @@ public:
   virtual QFont               font( const int = NameId ) const;
   virtual int                 alignment( const int = NameId ) const;
 
-  virtual bool                isDragable() const;
-  virtual bool                isDropAccepted( SUIT_DataObject* obj );
+  virtual bool                expandable() const;
+  virtual bool                isVisible() const;
+  virtual bool                isDraggable() const;
+  virtual bool                isDropAccepted() const;
 
   virtual bool                isEnabled() const;
   virtual bool                isSelectable() const;
   virtual bool                isCheckable( const int = NameId ) const;
+  virtual bool                renameAllowed( const int = NameId ) const;
+  virtual bool                setName(const QString& name);
 
   virtual bool                isOn( const int = NameId ) const;
   virtual void                setOn( const bool, const int = NameId );
@@ -123,7 +137,8 @@ public:
   virtual bool                compare( const QVariant&, const QVariant&, const int = NameId ) const;
 
   virtual SUIT_DataObjectKey* key() const;
-  virtual int groupId() const;
+  virtual int                 groupId() const;
+  virtual QVariant            customData(Qtx::CustomDataType /*type*/);
 
   static Signal*              signal();
   static bool                 connect( const char*, QObject*, const char* );
@@ -139,6 +154,7 @@ private:
   bool                        myCheck;
   bool                        myAutoDel;
   DataObjectList              myChildren;
+  bool                        _modified;
 
   static Signal*              mySignal;
 
@@ -159,6 +175,7 @@ private:
   void emitDestroyed( SUIT_DataObject* );
   void emitInserted( SUIT_DataObject*, SUIT_DataObject* );
   void emitRemoved( SUIT_DataObject*, SUIT_DataObject* );
+  void emitModified( SUIT_DataObject* );
 
   void deleteLater( SUIT_DataObject* );
 
@@ -167,6 +184,7 @@ signals:
   void destroyed( SUIT_DataObject* );
   void inserted( SUIT_DataObject*, SUIT_DataObject* );
   void removed( SUIT_DataObject*, SUIT_DataObject* );
+  void modified( SUIT_DataObject* );
 
   friend class SUIT_DataObject;