]> SALOME platform Git repositories - modules/gui.git/blob - src/SUIT/SUIT_DataObject.cxx
Salome HOME
7f4f1db88d9a37548efc39583db083c5e10f7ad2
[modules/gui.git] / src / SUIT / SUIT_DataObject.cxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // File   : SUIT_DataObject.cxx
23 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
24 //
25 #include "SUIT_DataObject.h"
26 #include "SUIT_DataObjectKey.h"
27
28 SUIT_DataObject::Signal* SUIT_DataObject::mySignal = 0;
29
30 /*!
31   \class SUIT_DataObject
32   \brief Data object representing the data instance in the tree-like hierarchy.
33
34   Data object represents uniform data tree structure recommended to use in the
35   SUIT-based applications.
36 */
37
38 /*!
39   \brief Constructor.
40
41   Creates the data object with the specified parent.
42   To create the top-level object, pass 0 as parameter.
43
44   \param p parent object
45 */
46 SUIT_DataObject::SUIT_DataObject( SUIT_DataObject* p )
47 : myParent( 0 ),
48   myOpen( false ),
49   myCheck( false ),
50   myAutoDel( true )
51 {
52   setParent( p );
53   signal()->emitCreated( this );
54 }
55
56 /*!
57   \brief Destructor.
58
59   Destroys all the children if "auto-delete children" flag is set.
60 */
61 SUIT_DataObject::~SUIT_DataObject()
62 {
63   SUIT_DataObject* p = myParent;
64
65   myParent = 0;
66
67   if ( p )
68     p->removeChild( this );
69
70   signal()->emitDestroyed( this );
71
72   for ( DataObjectList::iterator it = myChildren.begin(); it != myChildren.end(); ++it )
73     (*it)->myParent = 0;
74
75   if ( autoDeleteChildren() )
76   {
77     for ( DataObjectList::iterator itr = myChildren.begin(); itr != myChildren.end(); ++itr )
78       delete *itr;
79   }
80 }
81
82 /*!
83   \brief Get the root object.
84   \return root object of the data tree
85 */
86 SUIT_DataObject* SUIT_DataObject::root() const
87 {
88   return parent() ? parent()->root() : (SUIT_DataObject*)this;
89 }
90
91 /*!
92   \brief Get the first child object.
93   \return first child object or 0 if there are no children
94   \sa lastChild()
95 */
96 SUIT_DataObject* SUIT_DataObject::firstChild() const
97 {
98   SUIT_DataObject* child = 0;
99   if ( !myChildren.isEmpty() )
100     child = myChildren.first();
101   return child;
102 }
103
104 /*!
105   \brief Get the last child object.
106   \return last child object or 0 if there are no children
107   \sa firstChild()
108 */
109 SUIT_DataObject* SUIT_DataObject::lastChild() const
110 {
111   SUIT_DataObject* child = 0;
112   if ( !myChildren.isEmpty() )
113     child = myChildren.last();
114   return child;
115 }
116
117 /*!
118   \brief Get the number of the child objects.
119   \return number of the children
120 */
121 int SUIT_DataObject::childCount() const
122 {
123   return myChildren.count();
124 }
125
126 /*!
127   \brief Get the index of the specified object in the child list.
128   \param obj child object
129   \return subobject position or -1 if it does not belong to this object
130 */
131 int SUIT_DataObject::childPos( const SUIT_DataObject* obj ) const
132 {
133   return myChildren.indexOf( (SUIT_DataObject*)obj );
134 }
135
136 /*!
137   \brief Get child object by the specified index.
138   \param idx child object index
139   \return child object or 0 if index is out of range
140 */
141 SUIT_DataObject* SUIT_DataObject::childObject( const int idx ) const
142 {
143   SUIT_DataObject* child = 0;
144
145   if ( idx >= 0 && idx < myChildren.count() )
146     child = myChildren.at( idx );
147
148   return child;
149 }
150
151 /*!
152   \brief Get the object level in the tree structure.
153
154   Root object has level 0.
155
156   \return object level.
157 */
158 int SUIT_DataObject::level() const
159 {
160   int lev = 0;
161   SUIT_DataObject* p = parent();
162   while ( p ) {
163     p = p->parent();
164     lev++;
165   }
166   return lev;
167 }
168
169 /*!
170   \brief Get the position of the data object in its parent's children list
171   \return data object position
172 */
173 int SUIT_DataObject::position() const
174 {
175   return myParent ? myParent->childPos( this ) : 0;
176 }
177
178 /*!
179   \brief Get the next sibling data object in the children list.
180   \return child object or 0 if there is no next sibling
181   \sa prevBrother()
182 */
183 SUIT_DataObject* SUIT_DataObject::nextBrother() const
184 {
185   return myParent ? myParent->childObject( myParent->childPos( this ) + 1 ) : 0;
186 }
187
188 /*!
189   \brief Get the previous sibling data object in the children list.
190   \return child object or 0 if there is no previous sibling
191   \sa nextBrother()
192 */
193 SUIT_DataObject* SUIT_DataObject::prevBrother() const
194 {
195   return myParent ? myParent->childObject( myParent->childPos( this ) - 1 ) : 0;
196 }
197
198 /*!
199   \brief Get "auto-delete children" flag.
200   \return \c true if the object should delete all its children on destroying
201   \sa setAutoDeleteChildren()
202 */
203 bool SUIT_DataObject::autoDeleteChildren() const
204 {
205   return myAutoDel;
206 }
207
208 /*!
209   \brief Set "auto-delete children" flag.
210
211   If this flag is on (default), the object will delete
212   all its children on destroying.
213
214   \param on new flag value
215   \sa autoDeleteChildren()
216 */
217 void SUIT_DataObject::setAutoDeleteChildren( const bool on )
218 {
219   myAutoDel = on;
220 }
221
222 /*!
223   \brief Get all children.
224
225   If parameter \a rec is \c true then function collects all
226   the children recursively.
227
228   \param lst returning list of children
229   \param rec if \c true collect all children recursively
230 */
231 void SUIT_DataObject::children( DataObjectList& lst, const bool rec ) const
232 {
233   for ( DataObjectList::const_iterator it = myChildren.begin(); it != myChildren.end(); ++it )
234   {
235     lst.append( *it );
236     if ( rec )
237       (*it)->children( lst, rec );
238   }
239 }
240
241 /*!
242   \brief Get all children.
243   \override
244
245   If parameter \a rec is \c true then function collects all
246   the children recursively.
247
248   \param rec if \c true collect all children recursively
249   \return list of children
250 */
251 DataObjectList SUIT_DataObject::children( const bool rec )
252 {
253   DataObjectList lst;
254   children( lst, rec );
255   return lst;
256 }
257
258 /*!
259   \brief Add new child object to the end of the children list.
260   \param obj child object being added
261 */
262 void SUIT_DataObject::appendChild( SUIT_DataObject* obj )
263 {
264   insertChild( obj, myChildren.count() );
265 }
266
267 /*!
268   \brief Insert new child object to the list of the children.
269   \param obj child object being added
270   \param position child position
271 */
272 void SUIT_DataObject::insertChild( SUIT_DataObject* obj, int position )
273 {
274   if ( !obj || myChildren.contains( obj ) )
275     return;
276
277   int pos = position < 0 ? myChildren.count() : position;
278   myChildren.insert( qMin( pos, (int)myChildren.count() ), obj );
279   obj->setParent( this );
280   signal()->emitInserted( obj, this );
281 }
282
283 /*!
284   \brief Remove the specified child object reference.
285   \param obj child object being removed
286   \param del if \c true, the child object is destroyed
287 */
288 void SUIT_DataObject::removeChild( SUIT_DataObject* obj, const bool del )
289 {
290   if ( !obj )
291     return;
292
293   if ( myChildren.removeAll( obj ) ) {
294     signal()->emitRemoved( obj, this );
295     obj->setParent( 0 );
296
297     if ( del )
298       obj->deleteLater();
299   }
300 }
301
302 /*!
303   \brief Replace the specified child object by another object.
304   \param src child object being replaced
305   \param trg new child object
306   \param del if \c true, the previous object is destroyed
307   \return \c true if the object has been replaced
308 */
309 bool SUIT_DataObject::replaceChild( SUIT_DataObject* src, SUIT_DataObject* trg, const bool del )
310 {
311   if ( !src || !trg )
312     return false;
313
314   int idx = childPos( trg );
315   removeChild( trg );
316
317   int pos = childPos( src );
318   if ( pos < 0 )
319   {
320     if ( idx >= 0 )
321       insertChild( trg, idx );
322     return false;
323   }
324
325   insertChild( trg, pos );
326   removeChild( src );
327
328   if ( del )
329     src->deleteLater();
330
331   return true;
332 }
333
334 /*!
335   \brief Change the parent for all children from specified object to this one.
336   \param obj object which children to be reparented
337 */
338 void SUIT_DataObject::reparentChildren( const SUIT_DataObject* obj )
339 {
340   if ( !obj )
341     return;
342
343   DataObjectList lst;
344   obj->children( lst );
345   for ( DataObjectList::iterator it = lst.begin(); it != lst.end(); ++it )
346     (*it)->setParent( this );
347 }
348
349 /*!
350   \brief Get the parent object.
351   \return parent object or 0 if this is top-level item
352 */
353 SUIT_DataObject* SUIT_DataObject::parent() const
354 {
355   return myParent;
356 }
357
358 /*!
359   \brief Change the parent object.
360   \param p new parent object
361 */
362 void SUIT_DataObject::setParent( SUIT_DataObject* p )
363 {
364   if ( p == parent() )
365     return;
366
367   if ( parent() )
368     parent()->removeChild( this );
369
370   myParent = p;
371
372   if ( parent() )
373     parent()->appendChild( this );
374 }
375
376 /*!
377   \brief Get data object name.
378
379   This method should be re-implemented in the subclasses.
380   Default implementation returns null string.
381
382   \return object name
383 */
384 QString SUIT_DataObject::name() const
385 {
386   return QString();
387 }
388
389 /*!
390   \brief Get object text data for the specified column.
391
392   This method can be re-implemented in the subclasses.
393   Default implementation returns null string.
394
395   Column with \a id = 0 (NameId) is supposed to be used
396   to get the object name (as it does the default implementation).
397
398   \param id column id
399   \return object text data
400 */
401 QString SUIT_DataObject::text( const int id ) const
402 {
403   return id == NameId ? name() : QString();
404 }
405
406 /*!
407   \brief Get data object icon for the specified column.
408
409   This method can be re-implemented in the subclasses.
410   Default implementation returns null pixmap.
411
412   The parameter \a id specifies the column identificator
413
414   \param id column id
415   \return object icon for the specified column
416 */
417 QPixmap SUIT_DataObject::icon( const int /*id*/ ) const
418 {
419   return QPixmap();
420 }
421
422 /*!
423   \brief Get data object color for the specified column.
424
425   This method can be re-implemented in the subclasses.
426   Default implementation returns null color.
427
428   The parameter \a id specifies the column identificator
429
430   \param role color role
431   \param id column id
432   \return object color for the specified column
433 */
434 QColor SUIT_DataObject::color( const ColorRole /*role*/, const int /*id*/ ) const
435 {
436   return QColor();
437 }
438
439 /*!
440   \brief Get data object tooltip for the specified column.
441
442   This method can be re-implemented in the subclasses.
443   Default implementation returns null string.
444
445   The parameter \a id specifies the column identificator
446   (to display, for example, in the tree view widget).
447
448   \param id column id
449   \return object tooltip for the specified column
450 */
451 QString SUIT_DataObject::toolTip( const int /*id*/ ) const
452 {
453   return QString();
454 }
455
456 /*!
457   \brief Get data object status tip for the specified column.
458
459   This method can be re-implemented in the subclasses.
460   Default implementation returns null string.
461
462   The parameter \a id specifies the column identificator
463
464   \param id column id
465   \return object status tip for the specified column
466 */
467 QString SUIT_DataObject::statusTip( const int /*id*/ ) const
468 {
469   return QString();
470 }
471
472 /*!
473   \brief Get data object "what's this" information for the
474          specified column.
475
476   This method can be re-implemented in the subclasses.
477   Default implementation returns null string.
478
479   The parameter \a id specifies the column identificator
480
481   \param id column id
482   \return object "what's this" information for the specified column
483 */
484 QString SUIT_DataObject::whatsThis( const int /*id*/ ) const
485 {
486   return QString();
487 }
488
489 /*!
490   \brief Get data object font for the specified column.
491
492   This method can be re-implemented in the subclasses.
493   Default implementation returns application default font.
494
495   The parameter \a id specifies the column identificator
496
497   \param id column id
498   \return object font for the specified column
499 */
500 QFont SUIT_DataObject::font( const int /*id*/ ) const
501 {
502   return QFont();
503 }
504
505 /*!
506   \brief Get data object text alignment for the specified column.
507
508   This method can be re-implemented in the subclasses.
509   Default implementation returns default alignment which
510   is Qt:AlignLeft.
511
512   The parameter \a id specifies the column identificator
513   (to display, for example, in the tree view widget).
514
515   \param id column id
516   \return object text alignment flags for the specified column
517 */
518 int SUIT_DataObject::alignment( const int /*id*/ ) const
519 {
520   return Qt::AlignLeft;
521 }
522
523 /*!
524   \brief Check if the object is draggable.
525
526   This method can be re-implemented in the subclasses.
527   Default implementation returns \c false (all objects could not be dragged).
528
529   \return \c true if it is possible to drag this object
530 */
531 bool SUIT_DataObject::isDragable() const
532 {
533   return false;
534 }
535
536 /*!
537   \brief Check if the drop operation fo this object is possible.
538
539   This method can be re-implemented in the subclasses.
540   Default implementation returns \c false (drop operation is not allowed).
541
542   \param obj object being dropped
543   \return \c true if it is possible to drop an object \c obj
544           to this object
545 */
546
547 bool SUIT_DataObject::isDropAccepted( SUIT_DataObject* /*obj*/ )
548 {
549   return false;
550 }
551
552 /*!
553   \brief Check if this object is enabled.
554
555   This method can be re-implemented in the subclasses.
556   Default implementation returns \c true (all objects are enabled).
557
558   \return \c true if the user can interact with the item
559 */
560 bool SUIT_DataObject::isEnabled() const
561 {
562   return true;
563 }
564
565 /*!
566   \brief Check if this object is selectable.
567
568   This method can be re-implemented in the subclasses.
569   Default implementation returns \c true (all objects are selectable).
570
571   \return \c true if the item can be selected
572 */
573 bool SUIT_DataObject::isSelectable() const
574 {
575   return true;
576 }
577
578 /*!
579   \brief Check if this object is checkable for the specified column.
580
581   This method can be re-implemented in the subclasses.
582   Default implementation returns \c false (all objects are not checkable).
583
584   \param id column id
585   \return \c true if the item can be checked or unchecked by the user
586   \sa isOn(), setOn()
587 */
588 bool SUIT_DataObject::isCheckable( const int /*id*/ ) const
589 {
590   return false;
591 }
592
593 /*!
594   \brief Get the checked state of the object (if it is checkable)
595   for the specified column.
596
597   Default implementation supports the checked state for the first
598   ("Name") column only.
599
600   \param id column id
601   \return checked state of the object for the specified column
602   \sa setOn(), isCheckable()
603 */
604 bool SUIT_DataObject::isOn( const int id ) const
605 {
606   return id == NameId && myCheck;
607 }
608
609 /*!
610   \brief Set the checked state of the object (if it is checkable)
611   for the specified column.
612
613   Default implementation supports the checked state for the first
614   ("Name") column only.
615
616   \param on new checked state of the object for the specified column
617   \param id column id
618   \sa isOn(), isCheckable()
619 */
620 void SUIT_DataObject::setOn( const bool on, const int id )
621 {
622   if( id == NameId )
623     myCheck = on;
624 }
625
626 /*!
627   \brief Get the "opened" state of the object.
628   \return "opened" state of the object
629   \sa setOpen()
630 */
631 bool SUIT_DataObject::isOpen() const
632 {
633   return myOpen;
634 }
635
636 /*!
637   \brief Set the "opened" state of the object.
638   \param on new "opened" state of the object
639   \sa isOpen()
640 */
641 void SUIT_DataObject::setOpen( const bool on )
642 {
643   myOpen = on;
644 }
645
646 /*!
647   \brief Check if the specified column supports custom sorting.
648
649   This method can be re-implemented in the subclasses.
650   Default implementation returns false ("Name" column does not require
651   custom sorting).
652
653   \param id column id
654   \return \c true if column sorting should be customized
655   \sa compare()
656 */
657 bool SUIT_DataObject::customSorting( const int /*id*/ ) const
658 {
659   return false;
660 }
661
662 /*!
663   \brief Compares data from two items for sorting purposes.
664
665   This method can be re-implemented in the subclasses.
666   Default implementation returns false ("Name" column does not require
667   custom sorting).
668
669   This method is called only for those columns for which customSorting()
670   method returns \c true.
671
672   \param left first data to compare
673   \param right second data to compare
674   \param id column id
675   \return result of the comparison
676   \sa customSorting()
677 */
678 bool SUIT_DataObject::compare( const QVariant& /*left*/, const QVariant& /*right*/,
679                                const int /*id*/ ) const
680 {
681   return false;
682 }
683
684 /*!
685   \brief Get the object unique indentification key.
686
687   This method can be re-implemented in the subclasses.
688   Default implementation returns 0.
689
690   \return object key
691 */
692 SUIT_DataObjectKey* SUIT_DataObject::key() const
693 {
694   return 0;
695 }
696
697 /*!
698   \brief Get global signal handler.
699   \return the only instance of the signal handler
700 */
701 SUIT_DataObject::Signal* SUIT_DataObject::signal()
702 {
703   if ( !mySignal )
704     mySignal = new Signal();
705   return mySignal;
706 }
707
708 /*!
709   \brief Connect to the signal handlerx
710   \param sig signal name
711   \param reciever signal receiver object
712   \param slot slot name
713   \return \c true if connection is successfull
714 */
715 bool SUIT_DataObject::connect( const char* sig, QObject* reciever, const char* slot )
716 {
717   if ( !reciever || !slot )
718     return false;
719
720   signal()->disconnect( signal(), sig, reciever, slot );
721   return signal()->connect( signal(), sig, reciever, slot );
722 }
723
724 /*!
725   \brief Disconnect from the signal handler
726   \param sig signal name
727   \param reciever signal receiver object
728   \param slot slot name
729   \return \c true if disconnection is successfull
730 */
731 bool SUIT_DataObject::disconnect( const char* sig, QObject* reciever, const char* slot )
732 {
733   if ( !reciever || !slot )
734     return false;
735   return signal()->disconnect( signal(), sig, reciever, slot );
736 }
737
738 /*!
739   \brief Schedule this object for the late deleting.
740
741   The object will be deleted when control returns to the event loop.
742   Note that entering and leaving a new event loop (e.g., by opening
743   a modal dialog) will not perform the deferred deletion; for the object
744   to be deleted, the control must return to the event loop from which
745   deleteLater() was called.
746 */
747 void SUIT_DataObject::deleteLater()
748 {
749   if ( parent() )
750     parent()->removeChild( this, false ); // to avoid infinite loop!
751   signal()->deleteLater( this );
752 }
753
754 /*!
755   \brief Dump the object tree recursively to the standard output.
756   \param indent current indentation level
757 */
758 void SUIT_DataObject::dump( const int indent ) const
759 {
760   QString strIndent = QString().fill( ' ', indent ); // indentation string
761   printf( "%s%s\n", strIndent.toLatin1().data(), name().toLatin1().data() );
762   for ( DataObjectList::const_iterator it = myChildren.begin(); it != myChildren.end(); ++it )
763     (*it)->dump( indent + 2 );
764 }
765
766 /*!
767   \class SUIT_DataObject::Signal
768   \brief Watcher class, responsible for the emitting signals on behalf of
769   the data objects.
770
771   SUIT_DataObject class does not inherit from QObject for the performance
772   reasons, so it can not use signals/slots mechanism directly.
773   Instead it uses the only Signal object to emit the signals when the data
774   object is created, destroyed, inserted to the parent object or removed
775   from it.
776
777   If some object needs to handle, for example, data object destroying, it can
778   use SUIT_DataObject::signal() method to connect the signal:
779   \code
780   MyHandler* h = new MyHandler();
781   h->connect( SUIT_DataObject::signal(), SIGNAL(destroyed(SUIT_DataObject*)),
782               h, SLOT(onDestroyed(SUIT_DataObject*)) );
783   \endcode
784   The same can be done by using static method SUIT_DataObject::connect().
785   For example,
786   \code
787   MyHandler* h = new MyHandler();
788   SUIT_DataObject::connect( SIGNAL(destroyed(SUIT_DataObject*)),
789                             h, SLOT(onDestroyed(SUIT_DataObject*)));
790   \endcode
791 */
792
793 /*!
794   \brief Constructor.
795 */
796 SUIT_DataObject::Signal::Signal()
797 : QObject()
798 {
799 }
800
801 /*!
802   \brief Destructor.
803
804   Destroys data object which are scheduled for the deleting with the deleteLater().
805 */
806 SUIT_DataObject::Signal::~Signal()
807 {
808   for ( DataObjectList::Iterator it = myDelLaterObjects.begin();
809         it != myDelLaterObjects.end(); ++it ) {
810     delete *it;
811   }
812   myDelLaterObjects.clear();
813 }
814
815 /*!
816   \brief Emit signal about data object creation.
817   \param object data object being created
818 */
819 void SUIT_DataObject::Signal::emitCreated( SUIT_DataObject* object )
820 {
821   if ( object )
822     emit created( object );
823 }
824
825 /*!
826   \brief Emit signal about data object destroying.
827   \param object data object being destroyed
828 */
829 void SUIT_DataObject::Signal::emitDestroyed( SUIT_DataObject* object )
830 {
831   if ( object ) {
832     if ( myDelLaterObjects.contains( object ) )
833       // object is being destroyed after calling deleteLater():
834       // the signal has been already emitted from deleteLater()
835       // we should avoid repeating of the object destroying from
836       // the Signal destructor
837       myDelLaterObjects.removeAll( object );
838     else
839       // object is being destroyed directly or via deleteLater()
840       emit destroyed( object );
841   }
842 }
843
844 /*!
845   \brief Emit signal about data object adding to the parent data object.
846   \param object data object being added
847   \param parent parent data object
848 */
849 void SUIT_DataObject::Signal::emitInserted( SUIT_DataObject* object, SUIT_DataObject* parent )
850 {
851   emit( inserted( object, parent ) );
852 }
853
854 /*!
855   \brief Emit signal about data object removed from the parent data object.
856   \param object data object being removed
857   \param parent parent data object
858 */
859 void SUIT_DataObject::Signal::emitRemoved( SUIT_DataObject* object, SUIT_DataObject* parent )
860 {
861   emit( removed( object, parent ) );
862 }
863
864 /*!
865   \brief Schedule data object for the late deleting.
866   \param object data object to be deleted later
867 */
868 void SUIT_DataObject::Signal::deleteLater( SUIT_DataObject* object )
869 {
870   if ( !myDelLaterObjects.contains( object ) ) {
871     emitDestroyed( object );
872     myDelLaterObjects.append( object );
873   }
874 }
875
876 /*!
877   \brief Updates necessary internal fields of data object
878 */
879 void SUIT_DataObject::update()
880 {
881 }
882
883 /*!
884   \brief return unique group identificator
885
886   Groups of data objects are used for column information search.
887   Each column of data model has one or several registered group id
888   If object has the same group id as one of registered, the information
889   will be shown; the custom id of column will be passed into data() method
890   in order to identify column from point of view of data object
891
892  */
893 int SUIT_DataObject::groupId() const
894 {
895   return 0;
896 }
897
898 /*!
899   \fn void SUIT_DataObject::Signal::created( SUIT_DataObject* object );
900   \brief Emitted when data object is created.
901   \param object data object being created
902 */
903
904 /*!
905   \fn void SUIT_DataObject::Signal::destroyed( SUIT_DataObject* object );
906   \brief Emitted when data object is destroyed.
907   \param object data object being destroyed
908 */
909
910 /*!
911   \fn void SUIT_DataObject::Signal::inserted( SUIT_DataObject* object, SUIT_DataObject* parent );
912   \brief Emitted when data object is inserted to the parent data object.
913   \param object data object being created
914   \param parent parent data object
915 */
916
917 /*!
918   \fn void SUIT_DataObject::Signal::removed( SUIT_DataObject* object, SUIT_DataObject* parent );
919   \brief Emitted when data object is removed from the parent data object.
920   \param object data object being removed
921   \param parent parent data object
922 */