Kaydet (Commit) 3df221c8 authored tarafından Kai Ahrens's avatar Kai Ahrens

#80266#: added D&D functionality for slide view

üst 1d2cb239
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: sdxfer.cxx,v $ * $RCSfile: sdxfer.cxx,v $
* *
* $Revision: 1.17 $ * $Revision: 1.18 $
* *
* last change: $Author: ka $ $Date: 2001-09-13 11:04:32 $ * last change: $Author: ka $ $Date: 2001-09-24 13:17:13 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -167,6 +167,7 @@ using namespace ::com::sun::star::datatransfer::clipboard; ...@@ -167,6 +167,7 @@ using namespace ::com::sun::star::datatransfer::clipboard;
SdTransferable::SdTransferable( SdDrawDocument* pSrcDoc, SdView* pWorkView, BOOL bInitOnGetData ) : SdTransferable::SdTransferable( SdDrawDocument* pSrcDoc, SdView* pWorkView, BOOL bInitOnGetData ) :
pObjDesc( NULL ), pObjDesc( NULL ),
pPageDocShell( NULL ),
pSourceDoc( pSrcDoc ), pSourceDoc( pSrcDoc ),
pSdViewIntern( pWorkView ), pSdViewIntern( pWorkView ),
pSdView( pWorkView ), pSdView( pWorkView ),
...@@ -180,7 +181,9 @@ SdTransferable::SdTransferable( SdDrawDocument* pSrcDoc, SdView* pWorkView, BOOL ...@@ -180,7 +181,9 @@ SdTransferable::SdTransferable( SdDrawDocument* pSrcDoc, SdView* pWorkView, BOOL
pBookmark( NULL ), pBookmark( NULL ),
pGraphic( NULL ), pGraphic( NULL ),
pImageMap( NULL ), pImageMap( NULL ),
bLateInit( bInitOnGetData ) bLateInit( bInitOnGetData ),
bPageTransferable( FALSE ),
bPageTransferablePersistent( FALSE )
{ {
if( !bLateInit ) if( !bLateInit )
CreateData(); CreateData();
...@@ -194,6 +197,9 @@ SdTransferable::~SdTransferable() ...@@ -194,6 +197,9 @@ SdTransferable::~SdTransferable()
ObjectReleased(); ObjectReleased();
for( void* p = aPageBookmarks.First(); p; p = aPageBookmarks.Next() )
delete static_cast< String* >( p );
if( bOwnView ) if( bOwnView )
delete pSdViewIntern; delete pSdViewIntern;
...@@ -389,48 +395,51 @@ void SdTransferable::CreateData() ...@@ -389,48 +395,51 @@ void SdTransferable::CreateData()
void SdTransferable::AddSupportedFormats() void SdTransferable::AddSupportedFormats()
{ {
if( pOLEDataHelper ) if( !bPageTransferable || bPageTransferablePersistent )
{ {
AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ); if( pOLEDataHelper )
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); {
AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE );
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
DataFlavorExVector aVector( pOLEDataHelper->GetDataFlavorExVector() ); DataFlavorExVector aVector( pOLEDataHelper->GetDataFlavorExVector() );
DataFlavorExVector::iterator aIter( aVector.begin() ), aEnd( aVector.end() ); DataFlavorExVector::iterator aIter( aVector.begin() ), aEnd( aVector.end() );
while( aIter != aEnd ) while( aIter != aEnd )
AddFormat( *aIter++ ); AddFormat( *aIter++ );
} }
else if( pGraphic ) else if( pGraphic )
{ {
AddFormat( SOT_FORMATSTR_ID_SVXB ); AddFormat( SOT_FORMATSTR_ID_SVXB );
if( pGraphic->GetType() == GRAPHIC_BITMAP ) if( pGraphic->GetType() == GRAPHIC_BITMAP )
{
AddFormat( SOT_FORMAT_BITMAP );
AddFormat( SOT_FORMAT_GDIMETAFILE );
}
else
{
AddFormat( SOT_FORMAT_GDIMETAFILE );
AddFormat( SOT_FORMAT_BITMAP );
}
}
else if( pBookmark )
{ {
AddFormat( SOT_FORMAT_BITMAP ); AddFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK );
AddFormat( SOT_FORMAT_GDIMETAFILE ); AddFormat( FORMAT_STRING );
} }
else else
{ {
AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE );
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
AddFormat( SOT_FORMATSTR_ID_DRAWING );
AddFormat( SOT_FORMAT_GDIMETAFILE ); AddFormat( SOT_FORMAT_GDIMETAFILE );
AddFormat( SOT_FORMAT_BITMAP ); AddFormat( SOT_FORMAT_BITMAP );
} }
}
else if( pBookmark )
{
AddFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK );
AddFormat( FORMAT_STRING );
}
else
{
AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE );
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
AddFormat( SOT_FORMATSTR_ID_DRAWING );
AddFormat( SOT_FORMAT_GDIMETAFILE );
AddFormat( SOT_FORMAT_BITMAP );
}
if( pImageMap ) if( pImageMap )
AddFormat( SOT_FORMATSTR_ID_SVIM ); AddFormat( SOT_FORMATSTR_ID_SVIM );
}
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
...@@ -617,22 +626,46 @@ void SdTransferable::SetObjectDescriptor( const TransferableObjectDescriptor& rO ...@@ -617,22 +626,46 @@ void SdTransferable::SetObjectDescriptor( const TransferableObjectDescriptor& rO
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void SdTransferable::ResetPageView() void SdTransferable::SetPageBookmarks( const List& rPageBookmarks, BOOL bPersistent )
{ {
if( pSdViewIntern ) if( pSourceDoc )
pSdViewIntern->HideAllPages(); {
} if( pSdViewIntern )
pSdViewIntern->HideAllPages();
// ----------------------------------------------------------------------------- pSdDrawDocument->Clear();
pPageDocShell = NULL;
void SdTransferable::UpdatePageView() for( void* p = aPageBookmarks.First(); p; p = aPageBookmarks.Next() )
{ delete static_cast< String* >( p );
if( pSdViewIntern && pSdDrawDocument )
{ if( bPersistent )
SdPage* pPage = pSdDrawDocument->GetSdPage( 0, PK_STANDARD ); {
pSdDrawDocument->CreateFirstPages();
pSdDrawDocument->InsertBookmarkAsPage( const_cast< List* >( &rPageBookmarks ), NULL, FALSE, TRUE, 1, TRUE, pSourceDoc->GetDocSh(), TRUE, TRUE );
}
else
{
pPageDocShell = pSourceDoc->GetDocSh();
for( ULONG i = 0; i < rPageBookmarks.Count(); i++ )
aPageBookmarks.Insert( new String( *static_cast< String* >( rPageBookmarks.GetObject( i ) ) ), LIST_APPEND );
}
if( pSdViewIntern && pSdDrawDocument )
{
SdPage* pPage = pSdDrawDocument->GetSdPage( 0, PK_STANDARD );
if( pPage )
{
( (SdrMarkView*) pSdViewIntern )->MarkAll( (SdrPageView*) pSdViewIntern->ShowPage( pPage, Point() ) );
}
}
if( pPage ) // set flags for page transferable; if ( bPageTransferablePersistent == FALSE ),
( (SdrMarkView*) pSdViewIntern )->MarkAll( (SdrPageView*) pSdViewIntern->ShowPage( pPage, Point() ) ); // don't offer any formats => it's just for internal puposes
bPageTransferable = TRUE;
bPageTransferablePersistent = bPersistent;
} }
} }
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: bmcache.hxx,v $ * $RCSfile: bmcache.hxx,v $
* *
* $Revision: 1.1.1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: hr $ $Date: 2000-09-18 16:48:37 $ * last change: $Author: ka $ $Date: 2001-09-24 13:18:14 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -68,24 +68,22 @@ ...@@ -68,24 +68,22 @@
class SdPage; class SdPage;
class Bitmap; class GraphicObject;
class BitmapCache class BitmapCache
{ {
ULONG nMaxSize; ULONG nMaxSize;
ULONG nCurSize; ULONG nCurSize;
List aEntries; List aEntries;
public: public:
BitmapCache(ULONG nMaxSizeKB) BitmapCache(ULONG nMaxSizeKB)
: nMaxSize(nMaxSizeKB), : nMaxSize(nMaxSizeKB), nCurSize(0) {}
nCurSize(0) {} virtual ~BitmapCache();
virtual ~BitmapCache();
void Add(const SdPage* pPage, Bitmap* pBitmap, long nZoomPercent); void Add(const SdPage* pPage, const Bitmap& rBmp, long nZoomPercent);
const Bitmap* Get(const SdPage* pPage, long& rZoomPercent, const GraphicObject* Get(const SdPage* pPage, long& rZoomPercent, long nZoomTolerancePercent);
long nZoomTolerancePercent); void Remove(const SdPage* pPage);
void Remove(const SdPage* pPage);
}; };
#endif // _SD_BMCACHE_HXX #endif // _SD_BMCACHE_HXX
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: fudraw.hxx,v $ * $RCSfile: fudraw.hxx,v $
* *
* $Revision: 1.1.1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: hr $ $Date: 2000-09-18 16:48:38 $ * last change: $Author: ka $ $Date: 2001-09-24 13:20:01 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -101,7 +101,6 @@ class FuDraw : public FuPoor ...@@ -101,7 +101,6 @@ class FuDraw : public FuPoor
virtual BOOL MouseMove(const MouseEvent& rMEvt); virtual BOOL MouseMove(const MouseEvent& rMEvt);
virtual BOOL MouseButtonUp(const MouseEvent& rMEvt); virtual BOOL MouseButtonUp(const MouseEvent& rMEvt);
virtual BOOL MouseButtonDown(const MouseEvent& rMEvt); virtual BOOL MouseButtonDown(const MouseEvent& rMEvt);
virtual BOOL Command(const CommandEvent& rCEvt);
virtual BOOL RequestHelp(const HelpEvent& rHEvt); virtual BOOL RequestHelp(const HelpEvent& rHEvt);
virtual void ScrollStart(); virtual void ScrollStart();
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: fuslsel.hxx,v $ * $RCSfile: fuslsel.hxx,v $
* *
* $Revision: 1.1.1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: hr $ $Date: 2000-09-18 16:48:39 $ * last change: $Author: ka $ $Date: 2001-09-24 13:20:01 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -80,58 +80,57 @@ struct FSS_IsShowingEffectInfo ...@@ -80,58 +80,57 @@ struct FSS_IsShowingEffectInfo
class FuSlideSelection : public FuSlide class FuSlideSelection : public FuSlide
{ {
BOOL bSubstShown; private:
BOOL bPageHit;
List aSubstList; // Liste mit Ertsatzdarstellungen BOOL bSubstShown;
Point aDragPos; // hier wird die Seite angefasst BOOL bPageHit;
List aSubstList; // Liste mit Ertsatzdarstellungen
BOOL bDragSelection; Point aDragPos; // hier wird die Seite angefasst
Point aDragSelRectAnchor; // fester Punkt des Selektionsrechtecks BOOL bDragSelection;
Rectangle aDragSelRect; Point aDragSelRectAnchor; // fester Punkt des Selektionsrechtecks
Rectangle aDragSelRect;
Point aPosOfInsertMarker; Point aPosOfInsertMarker;
Sound* pSound;
Sound* pSound;
FSS_IsShowingEffectInfo* pIsShowingEffectInfo; FSS_IsShowingEffectInfo* pIsShowingEffectInfo;
void DrawInsertMarker(BOOL bShow); void DrawInsertMarker(BOOL bShow);
Point CalcPosOfInsertMarker(const Point& rPoint); Point CalcPosOfInsertMarker(const Point& rPoint);
USHORT GetTargetPage(const Point& rPoint) const; USHORT GetTargetPage(const Point& rPoint) const;
BOOL MovePages(USHORT nTargetPage) const; BOOL MovePages(USHORT nTargetPage) const;
void CreateSubst(); void CreateSubst();
void DeleteSubst(); void DeleteSubst();
void DrawSubst() const; void DrawSubst() const;
void ChangeSubstPos(const Point& rVector); void ChangeSubstPos(const Point& rVector);
void DrawDragSelectionRect() const;
void ShowEffect(USHORT nPageNo);
void DrawDragSelectionRect() const; DECL_LINK( DragSlideHdl, Timer* );
void ShowEffect(USHORT nPageNo); public:
public: TYPEINFO();
TYPEINFO();
FuSlideSelection(SdSlideViewShell* pViewSh, SdWindow* pWin, FuSlideSelection( SdSlideViewShell* pViewSh, SdWindow* pWin,
SdSlideView* pView, SdDrawDocument* pDoc, SdSlideView* pView, SdDrawDocument* pDoc,
SfxRequest& rReq); SfxRequest& rReq );
virtual ~FuSlideSelection(); virtual ~FuSlideSelection();
// Mouse- & Key-Events // Mouse- & Key-Events
virtual BOOL KeyInput(const KeyEvent& rKEvt); virtual BOOL KeyInput(const KeyEvent& rKEvt);
virtual BOOL MouseMove(const MouseEvent& rMEvt); virtual BOOL MouseMove(const MouseEvent& rMEvt);
virtual BOOL MouseButtonUp(const MouseEvent& rMEvt); virtual BOOL MouseButtonUp(const MouseEvent& rMEvt);
virtual BOOL MouseButtonDown(const MouseEvent& rMEvt); virtual BOOL MouseButtonDown(const MouseEvent& rMEvt);
virtual void Paint(const Rectangle& rRect, SdWindow* pWin); virtual void Paint(const Rectangle& rRect, SdWindow* pWin);
virtual void Activate(); // Function aktivieren virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren virtual void Deactivate(); // Function deaktivieren
virtual void ScrollStart(); virtual void ScrollStart();
virtual void ScrollEnd(); virtual void ScrollEnd();
BOOL IsShowingEffect() const { return pIsShowingEffectInfo && pIsShowingEffectInfo->bIsShowingEffect; } BOOL IsShowingEffect() const { return pIsShowingEffectInfo && pIsShowingEffectInfo->bIsShowingEffect; }
}; };
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: sdxfer.hxx,v $ * $RCSfile: sdxfer.hxx,v $
* *
* $Revision: 1.8 $ * $Revision: 1.9 $
* *
* last change: $Author: ka $ $Date: 2001-08-29 12:22:35 $ * last change: $Author: ka $ $Date: 2001-09-24 13:15:58 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -81,12 +81,15 @@ class SdDrawDocument; ...@@ -81,12 +81,15 @@ class SdDrawDocument;
class INetBookmark; class INetBookmark;
class ImageMap; class ImageMap;
class VirtualDevice; class VirtualDevice;
class SdDrawDocShell;
class SdTransferable : public TransferableHelper class SdTransferable : public TransferableHelper
{ {
private: private:
SvEmbeddedObjectRef aDocShellRef; SvEmbeddedObjectRef aDocShellRef;
SdDrawDocShell* pPageDocShell;
List aPageBookmarks;
TransferableDataHelper* pOLEDataHelper; TransferableDataHelper* pOLEDataHelper;
TransferableObjectDescriptor* pObjDesc; TransferableObjectDescriptor* pObjDesc;
const SdView* pSdView; const SdView* pSdView;
...@@ -100,10 +103,12 @@ private: ...@@ -100,10 +103,12 @@ private:
ImageMap* pImageMap; ImageMap* pImageMap;
Rectangle aVisArea; Rectangle aVisArea;
Point aStartPos; Point aStartPos;
BOOL bInternalMove : 1; BOOL bInternalMove : 1;
BOOL bOwnDocument : 1; BOOL bOwnDocument : 1;
BOOL bOwnView : 1; BOOL bOwnView : 1;
BOOL bLateInit : 1; BOOL bLateInit : 1;
BOOL bPageTransferable : 1;
BOOL bPageTransferablePersistent : 1;
// not available // not available
SdTransferable(); SdTransferable();
...@@ -137,9 +142,6 @@ public: ...@@ -137,9 +142,6 @@ public:
void SetObjectDescriptor( const TransferableObjectDescriptor& rObjDesc ); void SetObjectDescriptor( const TransferableObjectDescriptor& rObjDesc );
void ResetPageView();
void UpdatePageView();
void SetStartPos( const Point& rStartPos ) { aStartPos = rStartPos; } void SetStartPos( const Point& rStartPos ) { aStartPos = rStartPos; }
const Point& GetStartPos() const { return aStartPos; } const Point& GetStartPos() const { return aStartPos; }
...@@ -148,6 +150,12 @@ public: ...@@ -148,6 +150,12 @@ public:
BOOL HasSourceDoc( const SdDrawDocument* pDoc ) const { return( pSourceDoc == pDoc ); } BOOL HasSourceDoc( const SdDrawDocument* pDoc ) const { return( pSourceDoc == pDoc ); }
void SetPageBookmarks( const List& rPageBookmarks, BOOL bPersistent );
BOOL IsPageTransferable() const { return bPageTransferable; }
BOOL HasPageBookmarks() const { return( pPageDocShell && ( aPageBookmarks.Count() > 0 ) ); }
const List& GetPageBookmarks() const { return aPageBookmarks; }
SdDrawDocShell* GetPageDocShell() const { return pPageDocShell; }
public: public:
static SdTransferable* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxData ) throw(); static SdTransferable* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxData ) throw();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment