2010-10-27 12:53:26 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-27 16:10:40 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2001-01-19 18:09:07 +00:00
|
|
|
|
2013-10-23 22:38:46 +02:00
|
|
|
#ifndef INCLUDED_SD_SOURCE_UI_INC_SDXFER_HXX
|
|
|
|
#define INCLUDED_SD_SOURCE_UI_INC_SDXFER_HXX
|
2001-01-19 18:09:07 +00:00
|
|
|
|
|
|
|
#include <svtools/transfer.hxx>
|
|
|
|
#include <vcl/graph.hxx>
|
2004-10-04 17:37:15 +00:00
|
|
|
#include <sfx2/objsh.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/lstner.hxx>
|
2001-01-19 18:09:07 +00:00
|
|
|
|
|
|
|
|
2014-02-25 23:45:44 +01:00
|
|
|
// SdTransferable
|
2001-01-19 18:09:07 +00:00
|
|
|
class SdDrawDocument;
|
2004-07-13 13:06:47 +00:00
|
|
|
class SdrObject;
|
2001-01-19 18:09:07 +00:00
|
|
|
class INetBookmark;
|
|
|
|
class ImageMap;
|
|
|
|
class VirtualDevice;
|
2004-01-20 11:26:22 +00:00
|
|
|
|
|
|
|
namespace sd {
|
|
|
|
class DrawDocShell;
|
|
|
|
class View;
|
|
|
|
}
|
2001-01-19 18:09:07 +00:00
|
|
|
|
2005-11-08 08:04:48 +00:00
|
|
|
class SdTransferable : public TransferableHelper, public SfxListener
|
2001-01-19 18:09:07 +00:00
|
|
|
{
|
2004-01-20 11:26:22 +00:00
|
|
|
public:
|
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
SdTransferable( SdDrawDocument* pSrcDoc, ::sd::View* pWorkView, sal_Bool bInitOnGetData );
|
2014-04-01 19:18:35 +02:00
|
|
|
virtual ~SdTransferable();
|
2004-01-20 11:26:22 +00:00
|
|
|
|
2006-12-12 16:48:39 +00:00
|
|
|
void SetDocShell( const SfxObjectShellRef& rRef ) { maDocShellRef = rRef; }
|
|
|
|
const SfxObjectShellRef& GetDocShell() const { return maDocShellRef; }
|
2004-01-20 11:26:22 +00:00
|
|
|
|
2006-12-12 16:48:39 +00:00
|
|
|
void SetWorkDocument( const SdDrawDocument* pWorkDoc ) { mpSdDrawDocument = mpSdDrawDocumentIntern = (SdDrawDocument*) pWorkDoc; }
|
|
|
|
const SdDrawDocument* GetWorkDocument() const { return mpSdDrawDocument; }
|
2004-01-20 11:26:22 +00:00
|
|
|
|
2006-12-12 16:48:39 +00:00
|
|
|
void SetView( const ::sd::View* pView ) { mpSdView = pView; }
|
|
|
|
const ::sd::View* GetView() const { return mpSdView; }
|
2004-01-20 11:26:22 +00:00
|
|
|
|
|
|
|
void SetObjectDescriptor( const TransferableObjectDescriptor& rObjDesc );
|
|
|
|
|
2006-12-12 16:48:39 +00:00
|
|
|
void SetStartPos( const Point& rStartPos ) { maStartPos = rStartPos; }
|
|
|
|
const Point& GetStartPos() const { return maStartPos; }
|
2004-01-20 11:26:22 +00:00
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
void SetInternalMove( sal_Bool bSet ) { mbInternalMove = bSet; }
|
|
|
|
sal_Bool IsInternalMove() const { return mbInternalMove; }
|
2004-01-20 11:26:22 +00:00
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_Bool HasSourceDoc( const SdDrawDocument* pDoc ) const { return( mpSourceDoc == pDoc ); }
|
2004-01-20 11:26:22 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
void SetPageBookmarks( const std::vector<OUString>& rPageBookmarks, sal_Bool bPersistent );
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_Bool IsPageTransferable() const { return mbPageTransferable; }
|
2012-03-28 19:38:11 -04:30
|
|
|
sal_Bool HasPageBookmarks() const { return( mpPageDocShell && ( !maPageBookmarks.empty() ) ); }
|
2013-04-07 12:06:47 +02:00
|
|
|
const std::vector<OUString>& GetPageBookmarks() const { return maPageBookmarks; }
|
2006-12-12 16:48:39 +00:00
|
|
|
::sd::DrawDocShell* GetPageDocShell() const { return mpPageDocShell; }
|
2004-01-20 11:26:22 +00:00
|
|
|
|
2008-03-12 10:44:50 +00:00
|
|
|
sal_Bool SetTableRTF( SdDrawDocument*, const ::com::sun::star::datatransfer::DataFlavor& );
|
2004-01-20 11:26:22 +00:00
|
|
|
|
|
|
|
static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
|
|
|
|
static SdTransferable* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxData ) throw();
|
|
|
|
|
2005-11-08 08:04:48 +00:00
|
|
|
// SfxListener
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
|
2005-11-08 08:04:48 +00:00
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void DragFinished( sal_Int8 nDropAction ) SAL_OVERRIDE;
|
2011-03-08 17:22:13 +01:00
|
|
|
SdDrawDocument* GetSourceDoc (void) const;
|
|
|
|
|
|
|
|
/** User data objects can be used to store information temporarily
|
|
|
|
at the transferable. The slide sorter uses this to store
|
|
|
|
previews of the slides that are referenced by the
|
|
|
|
transferable.
|
|
|
|
*/
|
|
|
|
class UserData {public:virtual~UserData(){}};
|
|
|
|
|
|
|
|
/** Add a user data object. When it was added before (and not
|
|
|
|
removed) then this call is ignored.
|
|
|
|
*/
|
|
|
|
void AddUserData (const ::boost::shared_ptr<UserData>& rpData);
|
|
|
|
|
|
|
|
/** Return the number of user data objects.
|
|
|
|
*/
|
|
|
|
sal_Int32 GetUserDataCount (void) const;
|
|
|
|
|
|
|
|
/** Return the specified user data object. When the index is not
|
|
|
|
valid, ie not in the range [0,count) then an empty pointer is
|
|
|
|
returned.
|
|
|
|
*/
|
|
|
|
::boost::shared_ptr<UserData> GetUserData (const sal_Int32 nIndex) const;
|
|
|
|
|
2004-01-20 11:26:22 +00:00
|
|
|
protected:
|
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
|
|
|
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
|
|
|
virtual bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
|
|
|
virtual void ObjectReleased() SAL_OVERRIDE;
|
2004-01-20 11:26:22 +00:00
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2004-01-20 11:26:22 +00:00
|
|
|
|
2001-01-19 18:09:07 +00:00
|
|
|
private:
|
|
|
|
|
2006-12-12 16:48:39 +00:00
|
|
|
SfxObjectShellRef maDocShellRef;
|
|
|
|
::sd::DrawDocShell* mpPageDocShell;
|
2013-04-07 12:06:47 +02:00
|
|
|
std::vector<OUString> maPageBookmarks;
|
2006-12-12 16:48:39 +00:00
|
|
|
TransferableDataHelper* mpOLEDataHelper;
|
|
|
|
TransferableObjectDescriptor* mpObjDesc;
|
|
|
|
const ::sd::View* mpSdView;
|
|
|
|
::sd::View* mpSdViewIntern;
|
|
|
|
SdDrawDocument* mpSdDrawDocument;
|
|
|
|
SdDrawDocument* mpSdDrawDocumentIntern;
|
|
|
|
SdDrawDocument* mpSourceDoc;
|
|
|
|
VirtualDevice* mpVDev;
|
|
|
|
INetBookmark* mpBookmark;
|
|
|
|
Graphic* mpGraphic;
|
|
|
|
ImageMap* mpImageMap;
|
|
|
|
Rectangle maVisArea;
|
|
|
|
Point maStartPos;
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_Bool mbInternalMove : 1;
|
|
|
|
sal_Bool mbOwnDocument : 1;
|
|
|
|
sal_Bool mbOwnView : 1;
|
|
|
|
sal_Bool mbLateInit : 1;
|
|
|
|
sal_Bool mbPageTransferable : 1;
|
|
|
|
sal_Bool mbPageTransferablePersistent : 1;
|
2002-11-19 16:22:22 +00:00
|
|
|
bool mbIsUnoObj : 1;
|
2011-03-08 17:22:13 +01:00
|
|
|
::std::vector<boost::shared_ptr<UserData> > maUserData;
|
2001-01-19 18:09:07 +00:00
|
|
|
|
|
|
|
// not available
|
|
|
|
SdTransferable();
|
|
|
|
SdTransferable( const SdTransferable& );
|
|
|
|
SdTransferable& operator=( const SdTransferable& );
|
|
|
|
|
|
|
|
void CreateObjectReplacement( SdrObject* pObj );
|
|
|
|
void CreateData();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2013-10-23 22:38:46 +02:00
|
|
|
#endif // INCLUDED_SD_SOURCE_UI_INC_SDXFER_HXX
|
2010-10-27 12:53:26 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|