diff options
Diffstat (limited to 'sd/source/ui/slidesorter/inc/controller')
-rwxr-xr-x | sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx | 23 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/inc/controller/SlsInsertionIndicatorHandler.hxx | 4 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx (renamed from sd/source/ui/slidesorter/inc/controller/SlsTransferable.hxx) | 33 |
3 files changed, 46 insertions, 14 deletions
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx b/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx index 1bf5b8eae177..622bed457464 100755 --- a/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx @@ -30,6 +30,8 @@ #include "ViewClipboard.hxx" #include "controller/SlsSelectionObserver.hxx" +#include "sdxfer.hxx" + #include <sal/types.h> #include <tools/solar.h> #include <svx/svdpage.hxx> @@ -58,6 +60,8 @@ namespace sd { namespace slidesorter { namespace model { class PageDescriptor; } } } +namespace { class NavigatorDropEvent; } + namespace sd { namespace slidesorter { namespace controller { class SlideSorterController; @@ -69,6 +73,12 @@ public: Clipboard (SlideSorter& rSlideSorter); ~Clipboard (void); + /** Create a slide sorter transferable from the given sd + transferable. The returned transferable is set up with all + information necessary so that it can be dropped on a slide sorter. + */ + ::boost::shared_ptr<SdTransferable::UserData> CreateTransferableUserData (SdTransferable* pTransferable); + void HandleSlotCall (SfxRequest& rRequest); void DoCut (::Window* pWindow = 0); @@ -189,8 +199,8 @@ private: transferable is not accepted. The reason is the missing implementation of proper handling master pages copy-and-paste. */ - enum DropType { DT_PAGE, DT_SHAPE, DT_NONE }; - DropType IsDropAccepted (void) const; + enum DropType { DT_PAGE, DT_PAGE_FROM_NAVIGATOR, DT_SHAPE, DT_NONE }; + DropType IsDropAccepted (DropTargetHelper& rTargetHelper) const; /** This method contains the code for AcceptDrop() and ExecuteDrop() shapes. There are only minor differences for the two cases at this level. @@ -221,10 +231,19 @@ private: sal_uInt16 nPage, sal_uInt16 nLayer); + /** Return whether the insertion defined by the transferable is + trivial, ie would not change either source nor target document. + */ + bool IsInsertionTrivial ( + SdTransferable* pTransferable, + const sal_Int8 nDndAction) const; + /** Asynchronous part of DragFinished. The argument is the sal_Int8 nDropAction, disguised as void*. */ DECL_LINK(ProcessDragFinished, void*); + + DECL_LINK(ExecuteNavigatorDrop, NavigatorDropEvent*); }; } } } // end of namespace ::sd::slidesorter::controller diff --git a/sd/source/ui/slidesorter/inc/controller/SlsInsertionIndicatorHandler.hxx b/sd/source/ui/slidesorter/inc/controller/SlsInsertionIndicatorHandler.hxx index e257c5729b10..1492e707d42d 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlsInsertionIndicatorHandler.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlsInsertionIndicatorHandler.hxx @@ -31,6 +31,8 @@ #include "view/SlsInsertAnimator.hxx" #include "view/SlsLayouter.hxx" +#include "sdxfer.hxx" + namespace sd { namespace slidesorter { class SlideSorter; } } namespace sd { namespace slidesorter { namespace model { @@ -83,7 +85,7 @@ public: /** Update the indicator icon from the current transferable (from the clipboard or an active drag and drop operation.) */ - void UpdateIndicatorIcon (const Transferable* pTransferable); + void UpdateIndicatorIcon (const SdTransferable* pTransferable); /** Set the position of the insertion marker to the given coordinates. */ diff --git a/sd/source/ui/slidesorter/inc/controller/SlsTransferable.hxx b/sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx index c0a09e73bfe9..775e759f891a 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlsTransferable.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx @@ -25,10 +25,12 @@ * ************************************************************************/ -#ifndef SD_SLIDESORTER_TRANSFERABLE_HXX -#define SD_SLIDESORTER_TRANSFERABLE_HXX +#ifndef SD_SLIDESORTER_TRANSFERABLE_DATA_HXX +#define SD_SLIDESORTER_TRANSFERABLE_DATA_HXX #include "sdxfer.hxx" +#include <boost/function.hpp> +#include <vector> class SdDrawDocument; namespace sd { namespace slidesorter { @@ -37,12 +39,12 @@ class SlideSorterViewShell; namespace sd { namespace slidesorter { namespace controller { - -/** This class exists to have DragFinished call the correct object: the - SlideSorterViewShell instead of the old SlideView. +/** Represent previews and other information so that they can be + attached to an existing transferable. */ -class Transferable - : public SdTransferable +class TransferableData + : public SdTransferable::UserData, + public SfxListener { public: class Representative @@ -61,23 +63,32 @@ public: bool mbIsExcluded; }; - - Transferable ( + static SdTransferable* CreateTransferable ( SdDrawDocument* pSrcDoc, ::sd::View* pWorkView, sal_Bool bInitOnGetData, SlideSorterViewShell* pViewShell, - const ::std::vector<Representative>& rRepresentatives); + const ::std::vector<TransferableData::Representative>& rRepresentatives); - virtual ~Transferable (void); + static ::boost::shared_ptr<TransferableData> GetFromTransferable (const SdTransferable* pTransferable); + + TransferableData ( + SlideSorterViewShell* pViewShell, + const ::std::vector<TransferableData::Representative>& rRepresentatives); + ~TransferableData (void); virtual void DragFinished (sal_Int8 nDropAction); const ::std::vector<Representative>& GetRepresentatives (void) const; + /** Return the view shell for which the transferable was created. + */ + SlideSorterViewShell* GetSourceViewShell (void) const; + private: SlideSorterViewShell* mpViewShell; const ::std::vector<Representative> maRepresentatives; + typedef ::std::vector<boost::function<void(sal_uInt8)> > CallbackContainer; virtual void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint); }; |