// File generated by CPPExt (Value)
//
//                     Copyright (C) 1991 - 2000 by  
//                      Matra Datavision SA.  All rights reserved.
//  
//                     Copyright (C) 2001 - 2004 by
//                     Open CASCADE SA.  All rights reserved.
// 
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//  
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.

#ifndef _TDocStd_XLinkTool_HeaderFile
#define _TDocStd_XLinkTool_HeaderFile

#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Handle_TDF_DataSet_HeaderFile
#include <Handle_TDF_DataSet.hxx>
#endif
#ifndef _Handle_TDF_RelocationTable_HeaderFile
#include <Handle_TDF_RelocationTable.hxx>
#endif
class TDF_DataSet;
class TDF_RelocationTable;
class TDF_Label;


#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

//! This  tool class  is  used to copy  the content of <br>
//!            source label   under  target label.   Only child <br>
//!           labels and  attributes   of  source are   copied. <br>
//!          attributes located   out of source  scope are  not <br>
//!          copied by this algorithm. <br>
//!           Depending  of   the called  method  an   external <br>
//!          reference is set  in  the the target  document  to <br>
//!          registred the externallink. <br>
//!  Warning:  Nothing is   provided  in this   class  about the <br>
//!          opportunity to  copy,   set a link or  update  it. <br>
//!          Such decisions must be under application control <br>
class TDocStd_XLinkTool  {

public:

    void* operator new(size_t,void* anAddress) 
      {
        return anAddress;
      }
    void* operator new(size_t size) 
      { 
        return Standard::Allocate(size); 
      }
    void  operator delete(void *anAddress) 
      { 
        if (anAddress) Standard::Free((Standard_Address&)anAddress); 
      }
 // Methods PUBLIC
 // 


Standard_EXPORT TDocStd_XLinkTool();

//! Copies the content of the label <fromsource> to the label <intarget>. <br>
//!  The link is registred with an XLink attribute by <intarget> <br>
//!           label.  if  the    content  of <fromsource>   is  not <br>
//!          self-contained,  and/or <intarget> has already an XLink <br>
//!          attribute, an exception is raised. <br>
Standard_EXPORT   void CopyWithLink(const TDF_Label& intarget,const TDF_Label& fromsource) ;

//! Update the external reference set   at <L>. <br>
//!    Example <br>
//! Handle(TDocStd_Document) aDoc; <br>
//! if <br>
//! (!OCAFTest::GetDocument(1,aDoc)) return 1; <br>
//! Handle(TDataStd_Reference) aRef; <br>
//! TDocStd_XLinkTool xlinktool; <br>
//! if <br>
//! (!OCAFTest::Find(aDoc,2),TDataStd_Reference::GetID(),aRef) return 1; <br>
//! xlinktool.UpdateLink(aRef->Label()); <br>
//! Exceptions <br>
//! Standard_DomainError if <L> has no XLink attribute. <br>
Standard_EXPORT   void UpdateLink(const TDF_Label& L) ;

//!   Copy    the   content     of    <fromsource>   under <br>
//!          <intarget>. Noone link is registred. noone check is done. <br>
//! Example <br>
//!  Handle(TDocStd_Document) DOC, XDOC; <br>
//!  TDF_Label L, XL; <br>
//! TDocStd_XLinkTool xlinktool; <br>
//!  xlinktool.Copy(L,XL); <br>
//! Exceptions <br>
//! Standard_DomainError if the contents of <br>
//! fromsource are not entirely in the scope of this <br>
//! label, in other words, are not self-contained. <br>
Standard_EXPORT   void Copy(const TDF_Label& intarget,const TDF_Label& fromsource) ;


Standard_EXPORT   Standard_Boolean IsDone() const;


Standard_EXPORT   Handle_TDF_DataSet DataSet() const;


Standard_EXPORT   Handle_TDF_RelocationTable RelocationTable() const;





protected:

 // Methods PROTECTED
 // 


 // Fields PROTECTED
 //


private: 

 // Methods PRIVATE
 // 


 // Fields PRIVATE
 //
Standard_Boolean isDone;
Handle_TDF_DataSet myDS;
Handle_TDF_RelocationTable myRT;


};





// other Inline functions and methods (like "C++: function call" methods)
//


#endif
