LibreOffice Module sc (master)  1
drwtrans.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_DRWTRANS_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_DRWTRANS_HXX
22 
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <vcl/transfer.hxx>
25 
26 #include <sfx2/objsh.hxx>
27 #include <charthelper.hxx>
28 
29 class SdrModel;
30 class ScDocShell;
31 class INetBookmark;
32 class SdrObject;
33 class SdrView;
34 class ScDrawView;
35 class SdrOle2Obj;
36 enum class ScDragSrc;
37 
39 {
40 private:
41  std::unique_ptr<SdrModel> m_pModel;
46 
47  // extracted from model in ctor:
49  std::unique_ptr<INetBookmark> m_pBookmark;
50  bool m_bGraphic;
51  bool m_bGrIsBit;
52  bool m_bOleObj;
53  // source information for drag&drop:
54  // (view is needed to handle drawing objects)
55  std::unique_ptr<SdrView> m_pDragSourceView;
58 
60 
61  OUString maShellID;
62 
63  void InitDocShell();
65 
66  void CreateOLEData();
67 
68 public:
69  ScDrawTransferObj( std::unique_ptr<SdrModel> pClipModel, ScDocShell* pContainerShell,
70  const TransferableObjectDescriptor& rDesc );
71  virtual ~ScDrawTransferObj() override;
72 
73  virtual void AddSupportedFormats() override;
74  virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
75  virtual bool WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
76  const css::datatransfer::DataFlavor& rFlavor ) override;
77  virtual void DragFinished( sal_Int8 nDropAction ) override;
78 
79  SdrModel* GetModel() const { return m_pModel.get(); }
80 
81  void SetDrawPersist( const SfxObjectShellRef& rRef );
82  void SetDragSource( const ScDrawView* pView );
83  void SetDragSourceObj( SdrObject& rObj, SCTAB nTab );
84  void SetDragSourceFlags( ScDragSrc nFlags );
85  void SetDragWasInternal();
86 
87  const OUString& GetShellID() const;
88 
89  SdrView* GetDragSourceView() { return m_pDragSourceView.get(); }
91 
92  static ScDrawTransferObj* GetOwnClipboard(const css::uno::Reference<css::datatransfer::XTransferable2>&);
93 
94  virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rId ) override;
95  static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
96 
98 };
99 
100 #endif
101 
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool WriteObject(tools::SvRef< SotStorageStream > &rxOStm, void *pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor &rFlavor) override
Definition: drwtrans.cxx:431
ScDragSrc m_nDragSourceFlags
Definition: drwtrans.hxx:56
static ScDrawTransferObj * GetOwnClipboard(const css::uno::Reference< css::datatransfer::XTransferable2 > &)
Definition: drwtrans.cxx:230
signed char sal_Int8
SdrModel * GetModel() const
Definition: drwtrans.hxx:79
TransferableDataHelper m_aOleData
Definition: drwtrans.hxx:42
virtual void AddSupportedFormats() override
Definition: drwtrans.cxx:277
ScRangeListVector m_aProtectedChartRangesVector
Definition: drwtrans.hxx:59
void SetDragWasInternal()
Definition: drwtrans.cxx:636
bool m_bDragWasInternal
Definition: drwtrans.hxx:57
void SetDragSourceFlags(ScDragSrc nFlags)
Definition: drwtrans.cxx:631
virtual void DragFinished(sal_Int8 nDropAction) override
Definition: drwtrans.cxx:572
virtual bool GetData(const css::datatransfer::DataFlavor &rFlavor, const OUString &rDestDoc) override
Definition: drwtrans.cxx:346
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rId) override
Definition: drwtrans.cxx:751
ScDragSrc
Definition: viewdata.hxx:92
ScDragSrc GetDragSourceFlags() const
Definition: drwtrans.hxx:90
OUString maShellID
Definition: drwtrans.hxx:61
std::unique_ptr< SdrModel > m_pModel
Definition: drwtrans.hxx:41
void CreateOLEData()
Definition: drwtrans.cxx:664
ScDrawTransferObj(std::unique_ptr< SdrModel > pClipModel, ScDocShell *pContainerShell, const TransferableObjectDescriptor &rDesc)
Definition: drwtrans.cxx:67
::std::vector< ScRangeList > ScRangeListVector
Definition: charthelper.hxx:30
std::unique_ptr< SdrView > m_pDragSourceView
Definition: drwtrans.hxx:55
const OUString & GetShellID() const
Definition: drwtrans.cxx:641
void SetDragSourceObj(SdrObject &rObj, SCTAB nTab)
Definition: drwtrans.cxx:621
std::unique_ptr< INetBookmark > m_pBookmark
Definition: drwtrans.hxx:49
SdrView * GetDragSourceView()
Definition: drwtrans.hxx:89
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: drwtrans.cxx:746
SfxObjectShellRef m_aDocShellRef
Definition: drwtrans.hxx:44
void SetDrawPersist(const SfxObjectShellRef &rRef)
Definition: drwtrans.cxx:591
TransferableObjectDescriptor m_aObjDesc
Definition: drwtrans.hxx:43
void SetDragSource(const ScDrawView *pView)
Definition: drwtrans.cxx:613
SfxObjectShellRef m_aDrawPersistRef
Definition: drwtrans.hxx:45
sal_Int16 SCTAB
Definition: types.hxx:23
const ScRangeListVector & GetProtectedChartRangesVector() const
Definition: drwtrans.hxx:97
virtual ~ScDrawTransferObj() override
Definition: drwtrans.cxx:209
SdrOle2Obj * GetSingleObject()
Definition: drwtrans.cxx:646