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 @@
*
* $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
* either of the following licenses
......@@ -167,6 +167,7 @@ using namespace ::com::sun::star::datatransfer::clipboard;
SdTransferable::SdTransferable( SdDrawDocument* pSrcDoc, SdView* pWorkView, BOOL bInitOnGetData ) :
pObjDesc( NULL ),
pPageDocShell( NULL ),
pSourceDoc( pSrcDoc ),
pSdViewIntern( pWorkView ),
pSdView( pWorkView ),
......@@ -180,7 +181,9 @@ SdTransferable::SdTransferable( SdDrawDocument* pSrcDoc, SdView* pWorkView, BOOL
pBookmark( NULL ),
pGraphic( NULL ),
pImageMap( NULL ),
bLateInit( bInitOnGetData )
bLateInit( bInitOnGetData ),
bPageTransferable( FALSE ),
bPageTransferablePersistent( FALSE )
{
if( !bLateInit )
CreateData();
......@@ -194,6 +197,9 @@ SdTransferable::~SdTransferable()
ObjectReleased();
for( void* p = aPageBookmarks.First(); p; p = aPageBookmarks.Next() )
delete static_cast< String* >( p );
if( bOwnView )
delete pSdViewIntern;
......@@ -389,48 +395,51 @@ void SdTransferable::CreateData()
void SdTransferable::AddSupportedFormats()
{
if( pOLEDataHelper )
if( !bPageTransferable || bPageTransferablePersistent )
{
AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE );
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
if( pOLEDataHelper )
{
AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE );
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
DataFlavorExVector aVector( pOLEDataHelper->GetDataFlavorExVector() );
DataFlavorExVector::iterator aIter( aVector.begin() ), aEnd( aVector.end() );
DataFlavorExVector aVector( pOLEDataHelper->GetDataFlavorExVector() );
DataFlavorExVector::iterator aIter( aVector.begin() ), aEnd( aVector.end() );
while( aIter != aEnd )
AddFormat( *aIter++ );
}
else if( pGraphic )
{
AddFormat( SOT_FORMATSTR_ID_SVXB );
while( aIter != aEnd )
AddFormat( *aIter++ );
}
else if( pGraphic )
{
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_FORMAT_GDIMETAFILE );
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 );
}
}
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 )
AddFormat( SOT_FORMATSTR_ID_SVIM );
if( pImageMap )
AddFormat( SOT_FORMATSTR_ID_SVIM );
}
}
// -----------------------------------------------------------------------------
......@@ -617,22 +626,46 @@ void SdTransferable::SetObjectDescriptor( const TransferableObjectDescriptor& rO
// -----------------------------------------------------------------------------
void SdTransferable::ResetPageView()
void SdTransferable::SetPageBookmarks( const List& rPageBookmarks, BOOL bPersistent )
{
if( pSdViewIntern )
pSdViewIntern->HideAllPages();
}
if( pSourceDoc )
{
if( pSdViewIntern )
pSdViewIntern->HideAllPages();
// -----------------------------------------------------------------------------
pSdDrawDocument->Clear();
pPageDocShell = NULL;
void SdTransferable::UpdatePageView()
{
if( pSdViewIntern && pSdDrawDocument )
{
SdPage* pPage = pSdDrawDocument->GetSdPage( 0, PK_STANDARD );
for( void* p = aPageBookmarks.First(); p; p = aPageBookmarks.Next() )
delete static_cast< String* >( p );
if( bPersistent )
{
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 )
( (SdrMarkView*) pSdViewIntern )->MarkAll( (SdrPageView*) pSdViewIntern->ShowPage( pPage, Point() ) );
// set flags for page transferable; if ( bPageTransferablePersistent == FALSE ),
// don't offer any formats => it's just for internal puposes
bPageTransferable = TRUE;
bPageTransferablePersistent = bPersistent;
}
}
......
......@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
......@@ -68,24 +68,22 @@
class SdPage;
class Bitmap;
class GraphicObject;
class BitmapCache
{
ULONG nMaxSize;
ULONG nCurSize;
List aEntries;
ULONG nMaxSize;
ULONG nCurSize;
List aEntries;
public:
BitmapCache(ULONG nMaxSizeKB)
: nMaxSize(nMaxSizeKB),
nCurSize(0) {}
virtual ~BitmapCache();
BitmapCache(ULONG nMaxSizeKB)
: nMaxSize(nMaxSizeKB), nCurSize(0) {}
virtual ~BitmapCache();
void Add(const SdPage* pPage, Bitmap* pBitmap, long nZoomPercent);
const Bitmap* Get(const SdPage* pPage, long& rZoomPercent,
long nZoomTolerancePercent);
void Remove(const SdPage* pPage);
void Add(const SdPage* pPage, const Bitmap& rBmp, long nZoomPercent);
const GraphicObject* Get(const SdPage* pPage, long& rZoomPercent, long nZoomTolerancePercent);
void Remove(const SdPage* pPage);
};
#endif // _SD_BMCACHE_HXX
......
......@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
......@@ -101,7 +101,6 @@ class FuDraw : public FuPoor
virtual BOOL MouseMove(const MouseEvent& rMEvt);
virtual BOOL MouseButtonUp(const MouseEvent& rMEvt);
virtual BOOL MouseButtonDown(const MouseEvent& rMEvt);
virtual BOOL Command(const CommandEvent& rCEvt);
virtual BOOL RequestHelp(const HelpEvent& rHEvt);
virtual void ScrollStart();
......
......@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
......@@ -80,58 +80,57 @@ struct FSS_IsShowingEffectInfo
class FuSlideSelection : public FuSlide
{
BOOL bSubstShown;
BOOL bPageHit;
List aSubstList; // Liste mit Ertsatzdarstellungen
Point aDragPos; // hier wird die Seite angefasst
BOOL bDragSelection;
Point aDragSelRectAnchor; // fester Punkt des Selektionsrechtecks
Rectangle aDragSelRect;
Point aPosOfInsertMarker;
Sound* pSound;
private:
BOOL bSubstShown;
BOOL bPageHit;
List aSubstList; // Liste mit Ertsatzdarstellungen
Point aDragPos; // hier wird die Seite angefasst
BOOL bDragSelection;
Point aDragSelRectAnchor; // fester Punkt des Selektionsrechtecks
Rectangle aDragSelRect;
Point aPosOfInsertMarker;
Sound* pSound;
FSS_IsShowingEffectInfo* pIsShowingEffectInfo;
void DrawInsertMarker(BOOL bShow);
Point CalcPosOfInsertMarker(const Point& rPoint);
void DrawInsertMarker(BOOL bShow);
Point CalcPosOfInsertMarker(const Point& rPoint);
USHORT GetTargetPage(const Point& rPoint) const;
BOOL MovePages(USHORT nTargetPage) const;
USHORT GetTargetPage(const Point& rPoint) const;
BOOL MovePages(USHORT nTargetPage) const;
void CreateSubst();
void DeleteSubst();
void DrawSubst() const;
void ChangeSubstPos(const Point& rVector);
void CreateSubst();
void DeleteSubst();
void DrawSubst() const;
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,
SdSlideView* pView, SdDrawDocument* pDoc,
SfxRequest& rReq);
FuSlideSelection( SdSlideViewShell* pViewSh, SdWindow* pWin,
SdSlideView* pView, SdDrawDocument* pDoc,
SfxRequest& rReq );
virtual ~FuSlideSelection();
// Mouse- & Key-Events
virtual BOOL KeyInput(const KeyEvent& rKEvt);
virtual BOOL MouseMove(const MouseEvent& rMEvt);
virtual BOOL MouseButtonUp(const MouseEvent& rMEvt);
virtual BOOL MouseButtonDown(const MouseEvent& rMEvt);
virtual void Paint(const Rectangle& rRect, SdWindow* pWin);
virtual ~FuSlideSelection();
// Mouse- & Key-Events
virtual BOOL KeyInput(const KeyEvent& rKEvt);
virtual BOOL MouseMove(const MouseEvent& rMEvt);
virtual BOOL MouseButtonUp(const MouseEvent& rMEvt);
virtual BOOL MouseButtonDown(const MouseEvent& rMEvt);
virtual void Paint(const Rectangle& rRect, SdWindow* pWin);
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
virtual void ScrollStart();
virtual void ScrollEnd();
virtual void ScrollStart();
virtual void ScrollEnd();
BOOL IsShowingEffect() const { return pIsShowingEffectInfo && pIsShowingEffectInfo->bIsShowingEffect; }
BOOL IsShowingEffect() const { return pIsShowingEffectInfo && pIsShowingEffectInfo->bIsShowingEffect; }
};
......
......@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
......@@ -81,12 +81,15 @@ class SdDrawDocument;
class INetBookmark;
class ImageMap;
class VirtualDevice;
class SdDrawDocShell;
class SdTransferable : public TransferableHelper
{
private:
SvEmbeddedObjectRef aDocShellRef;
SdDrawDocShell* pPageDocShell;
List aPageBookmarks;
TransferableDataHelper* pOLEDataHelper;
TransferableObjectDescriptor* pObjDesc;
const SdView* pSdView;
......@@ -100,10 +103,12 @@ private:
ImageMap* pImageMap;
Rectangle aVisArea;
Point aStartPos;
BOOL bInternalMove : 1;
BOOL bOwnDocument : 1;
BOOL bOwnView : 1;
BOOL bLateInit : 1;
BOOL bInternalMove : 1;
BOOL bOwnDocument : 1;
BOOL bOwnView : 1;
BOOL bLateInit : 1;
BOOL bPageTransferable : 1;
BOOL bPageTransferablePersistent : 1;
// not available
SdTransferable();
......@@ -137,9 +142,6 @@ public:
void SetObjectDescriptor( const TransferableObjectDescriptor& rObjDesc );
void ResetPageView();
void UpdatePageView();
void SetStartPos( const Point& rStartPos ) { aStartPos = rStartPos; }
const Point& GetStartPos() const { return aStartPos; }
......@@ -148,6 +150,12 @@ public:
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:
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