DATAKIT API  V2025.1
dtk_oleobject.hpp
Go to the documentation of this file.
1 #ifndef __UTIL_DTK_OLE_OBJECT_HPP__
2 #define __UTIL_DTK_OLE_OBJECT_HPP__
3 
4 #include "def/define.h"
8 #include "util/error_dtk.hpp"
9 #include "util/util_ptr_dtk.hpp"
10 
11 class Dtk_Oriented2dBBox;
12 
13 #define DTK_OLE_OBJECT_INFO_KEY_FROM_OLE_OBJECT "Dtk_FromOLEObject"
14 
19 
20 class Dtk_OLEObject : public Dtk_Object
21 {
22 public:
24  {
27  // OLE_ASPECT_DOCPRINT,
29  // OLE_ASPECT_THUMBNAIL
30  };
31 
33  {
34  switch( inEnum )
35  {
36  case OLE_ASPECT_CONTENT: return L"OLE_ASPECT_CONTENT";
37  //case OLE_ASPECT_DOCPRINT: return L"OLE_ASPECT_DOCPRINT";
38  case OLE_ASPECT_ICON: return L"OLE_ASPECT_ICON";
39  //case OLE_ASPECT_THUMBNAIL: return L"OLE_ASPECT_THUMBNAIL";
40  default:
41  case OLE_ASPECT_UNKNOWN: return L"OLE_ASPECT_UNKNOWN";
42  }
43  }
44 
45 protected:
46  struct Dtk_Handle; // Not defined here
47  Dtk_Handle *_Private; // Handle
48  enum
49  {
51  };
53  Dtk_OLEObject( const Dtk_Char8 *const binaryContent,
54  const Dtk_Size_t & binaryContentSize,
55  const Dtk_Oriented2dBBox & placement,
56  const Dtk_OLEObjectViewingAspect viewingAspect,
57  const Dtk_Double64 & scale = 1 );
58 
61 
64 
65  inline virtual Dtk_Object* Clone()
66  {
67  return new Dtk_OLEObject( *this );
68  }
69 
70 private:
71  void _Init();
72  void _Copy( const Dtk_OLEObject &o );
73  void _Reset();
74  friend class Dtk_SmartPtr<Dtk_OLEObject>;
75 public:
76 
79 
82 
90  static Dtk_OLEObjectPtr Create( const Dtk_Char8 *const binaryContent,
91  const Dtk_Size_t & binaryContentSize,
92  const Dtk_Oriented2dBBox & positioning,
93  const Dtk_OLEObjectViewingAspect viewingAspect,
94  const Dtk_Double64 & scale = 1 );
95 
97  static Dtk_OLEObjectPtr Create( const Dtk_OLEObject &inToBeCopied );
98 
100  {
101  return DTK_TYPE_OLE_OBJECT;
102  }
103 
105  Dtk_OLEObject& operator=( const Dtk_OLEObject& inToBeAssigned );
106 
109 
113  const Dtk_Char8 *const GetBinaryContent() const;
114 
117 
122 
125 
129  void SetBinaryContent( const Dtk_Char8 *const inNewContent,
130  const Dtk_Size_t inNewContentSize );
131 
133  void SetViewingAspect( const Dtk_OLEObjectViewingAspect & inNewAspect );
134 
136  void SetPlacement( const Dtk_Oriented2dBBox & inNewPlacement );
137 
139  void SetScale( const Dtk_Double64 & inNewScale );
140 
144 };
145 
146 #endif
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Dtk_OLEObject::_typeID
@ _typeID
Definition: dtk_oleobject.hpp:50
Dtk_OLEObject::Dtk_OLEObject
Dtk_OLEObject(const Dtk_OLEObject &o)
Copy Constructor.
Dtk_OLEObject::SetViewingAspect
void SetViewingAspect(const Dtk_OLEObjectViewingAspect &inNewAspect)
Set the way the OLE Object should be displayed at screen.
catiav5w::inTransfo
const Dtk_string const Dtk_transfo & inTransfo
Definition: catiav5w.hpp:619
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:58
Dtk_Size_t
size_t Dtk_Size_t
Definition: define.h:712
Dtk_OLEObject::~Dtk_OLEObject
~Dtk_OLEObject()
Destructor.
Dtk_OLEObject::OLE_ASPECT_CONTENT
@ OLE_ASPECT_CONTENT
Definition: dtk_oleobject.hpp:26
Dtk_Double64
double Dtk_Double64
Definition: define.h:699
Dtk_OLEObject::operator=
Dtk_OLEObject & operator=(const Dtk_OLEObject &inToBeAssigned)
Assignment Operator.
Dtk_OLEObject::GetPlacement
Dtk_Oriented2dBBox & GetPlacement()
Returns the position and orientation of the OLE Object in space.
Dtk_OLEObject::Dtk_OLEObjectViewingAspectToString
static Dtk_string Dtk_OLEObjectViewingAspectToString(const Dtk_OLEObjectViewingAspect &inEnum)
Definition: dtk_oleobject.hpp:32
Dtk_OLEObject::Dtk_OLEObjectViewingAspect
Dtk_OLEObjectViewingAspect
Definition: dtk_oleobject.hpp:24
Dtk_OLEObject::Create
static Dtk_OLEObjectPtr Create(const Dtk_OLEObject &inToBeCopied)
Copy constructor.
Dtk_OLEObject
This is the Dtk_OLEObject Class. The Dtk_OLEObject object is used to store any informations about Obj...
Definition: dtk_oleobject.hpp:21
Dtk_OLEObject::Clone
virtual Dtk_Object * Clone()
Definition: dtk_oleobject.hpp:65
Dtk_OLEObject::_Private
Dtk_Handle * _Private
Definition: dtk_oleobject.hpp:46
Dtk_OLEObject::SetScale
void SetScale(const Dtk_Double64 &inNewScale)
Set the scale that is applied to the OLE Object.
Dtk_Int32
int32_t Dtk_Int32
Definition: define.h:687
Dtk_OLEObject::GetBinaryContent
const Dtk_Char8 *const GetBinaryContent() const
Returns the OLE Object data size.
Dtk_OLEObject::SetPlacement
void SetPlacement(const Dtk_Oriented2dBBox &inNewPlacement)
Set the position and orientation of the OLE Object in space.
Dtk_OLEObject::DtkDynamicType
Dtk_Int32 DtkDynamicType(const Dtk_Int32 &inId)
Retrieves the dynamic entity type.
Dtk_Char8
char Dtk_Char8
Definition: define.h:697
error_dtk.hpp
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
Dtk_OLEObject::ExtractPreviewPicture
Dtk_ErrorStatus ExtractPreviewPicture(Dtk_picturePtr &outPreviewPicture) const
Extract the currently displayed picture from the OLE Object.
Dtk_OLEObject::Create
static Dtk_OLEObjectPtr Create(const Dtk_Char8 *const binaryContent, const Dtk_Size_t &binaryContentSize, const Dtk_Oriented2dBBox &positioning, const Dtk_OLEObjectViewingAspect viewingAspect, const Dtk_Double64 &scale=1)
Create a Dtk_OLEObjectPtr.
Dtk_OLEObject::OLE_ASPECT_ICON
@ OLE_ASPECT_ICON
Definition: dtk_oleobject.hpp:28
dtk_transfo.hpp
type_detk
type_detk
Definition: define.h:32
Dtk_OLEObject::DtkDynamicCast
static Dtk_OLEObject * DtkDynamicCast(Dtk_Object *o)
Performs a dynamic cast - doesn't need RTTI -.
DTK_TYPE_OLE_OBJECT
@ DTK_TYPE_OLE_OBJECT
Definition: define.h:617
util_ptr_dtk.hpp
define.h
Dtk_OLEObject::OLE_ASPECT_UNKNOWN
@ OLE_ASPECT_UNKNOWN
Definition: dtk_oleobject.hpp:25
Dtk_OLEObject::GetScale
Dtk_Double64 GetScale() const
Returns the scale that is applied to the OLE Object.
Dtk_OLEObject::GetBinaryContentSize
const Dtk_Size_t GetBinaryContentSize() const
Returns the OLE Object data.
Dtk_OLEObject::get_type_detk
type_detk get_type_detk() const
Definition: dtk_oleobject.hpp:99
Dtk_Object
Definition: dtk_object.hpp:8
Dtk_OLEObject::GetViewingAspect
Dtk_OLEObjectViewingAspect GetViewingAspect() const
Returns the way the OLE Object should be displayed at screen.
dtk_string.hpp
Dtk_OLEObject::Dtk_OLEObject
Dtk_OLEObject(const Dtk_Char8 *const binaryContent, const Dtk_Size_t &binaryContentSize, const Dtk_Oriented2dBBox &placement, const Dtk_OLEObjectViewingAspect viewingAspect, const Dtk_Double64 &scale=1)
Base Constructor.
Dtk_OLEObject::SetBinaryContent
void SetBinaryContent(const Dtk_Char8 *const inNewContent, const Dtk_Size_t inNewContentSize)
Set the OLE Object data.
Dtk_Oriented2dBBox
This is the base bounding box class. It's used into a lot of 2D Entities This class represents the ba...
Definition: util_draw_dtk.hpp:479
Dtk_OLEObject::Transform
Dtk_ErrorStatus Transform(const Dtk_transfo &inTransfo)
Applies a transformation matrix to the entity. //!
dtk_object.hpp
Dtk_OLEObject::GetPlacement
const Dtk_Oriented2dBBox & GetPlacement() const
Returns the position and orientation of the OLE Object in space.