2010-10-27 12:53:26 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2004-01-20 10:46:12 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 19:54:41 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-01-20 10:46:12 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2004-01-20 10:46:12 +00:00
|
|
|
*
|
2008-04-10 19:54:41 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-01-20 10:46:12 +00:00
|
|
|
*
|
2008-04-10 19:54:41 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-01-20 10:46:12 +00:00
|
|
|
*
|
2008-04-10 19:54:41 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2004-01-20 10:46:12 +00:00
|
|
|
*
|
2008-04-10 19:54:41 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2004-01-20 10:46:12 +00:00
|
|
|
*
|
2008-04-10 19:54:41 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2004-01-20 10:46:12 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef SD_VIEW_HXX
|
|
|
|
#define SD_VIEW_HXX
|
|
|
|
|
2011-05-03 18:23:32 -04:30
|
|
|
#include <boost/ptr_container/ptr_vector.hpp>
|
|
|
|
|
2004-01-20 10:46:12 +00:00
|
|
|
#include "pres.hxx"
|
|
|
|
#include <tools/gen.hxx>
|
|
|
|
#include <svtools/transfer.hxx>
|
|
|
|
#include <svx/fmview.hxx>
|
|
|
|
#include <svx/svdmark.hxx>
|
|
|
|
#include <svx/svdpage.hxx>
|
2005-12-14 16:06:52 +00:00
|
|
|
#include "fupoor.hxx"
|
2004-01-20 10:46:12 +00:00
|
|
|
|
2007-07-06 12:13:13 +00:00
|
|
|
#include "smarttag.hxx"
|
|
|
|
|
2004-01-20 10:46:12 +00:00
|
|
|
class SdDrawDocument;
|
|
|
|
class SdrOle2Obj;
|
|
|
|
class SdrGrafObj;
|
2004-08-12 08:16:16 +00:00
|
|
|
class SdrMediaObj;
|
2004-01-20 10:46:12 +00:00
|
|
|
class OutputDevice;
|
|
|
|
class VirtualDevice;
|
|
|
|
class ImageMap;
|
|
|
|
class Point;
|
|
|
|
class Graphic;
|
|
|
|
class SdrOutliner;
|
|
|
|
class TransferableDataHelper;
|
|
|
|
struct StyleRequestData;
|
2004-11-26 19:15:00 +00:00
|
|
|
class Outliner;
|
2004-01-20 10:46:12 +00:00
|
|
|
|
|
|
|
namespace sd {
|
|
|
|
|
|
|
|
class DrawDocShell;
|
|
|
|
struct SdNavigatorDropEvent;
|
|
|
|
class ViewShell;
|
|
|
|
class Window;
|
2004-07-13 13:14:32 +00:00
|
|
|
class ViewClipboard;
|
2004-01-20 10:46:12 +00:00
|
|
|
|
|
|
|
// -------------------
|
|
|
|
// - SdViewRedrawRec -
|
|
|
|
// -------------------
|
|
|
|
|
|
|
|
struct SdViewRedrawRec
|
|
|
|
{
|
2006-12-12 16:39:30 +00:00
|
|
|
OutputDevice* mpOut;
|
2004-01-20 10:46:12 +00:00
|
|
|
Rectangle aRect;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-11-01 13:16:39 +00:00
|
|
|
class View : public FmFormView
|
2004-01-20 10:46:12 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
TYPEINFO();
|
|
|
|
|
|
|
|
View (
|
2012-02-01 19:58:05 +04:00
|
|
|
SdDrawDocument& rDrawDoc,
|
2004-01-20 10:46:12 +00:00
|
|
|
OutputDevice* pOutDev,
|
|
|
|
ViewShell* pViewSh=NULL);
|
|
|
|
virtual ~View (void);
|
|
|
|
|
2008-08-19 23:15:24 +00:00
|
|
|
void CompleteRedraw( OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L);
|
2004-01-20 10:46:12 +00:00
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
virtual sal_Bool GetAttributes( SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr=sal_False ) const;
|
|
|
|
virtual sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll = sal_False);
|
2004-01-20 10:46:12 +00:00
|
|
|
virtual void MarkListHasChanged();
|
|
|
|
virtual void ModelHasChanged();
|
|
|
|
virtual void SelectAll();
|
|
|
|
virtual void DoCut(::Window* pWindow=NULL);
|
|
|
|
virtual void DoCopy(::Window* pWindow=NULL);
|
|
|
|
virtual void DoPaste(::Window* pWindow=NULL);
|
|
|
|
virtual void DoConnect(SdrOle2Obj* pOleObj);
|
2011-01-17 11:41:00 +01:00
|
|
|
virtual sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr = sal_False);
|
2006-12-12 16:39:30 +00:00
|
|
|
virtual void StartDrag( const Point& rStartPos, ::Window* pWindow );
|
2004-01-20 10:46:12 +00:00
|
|
|
virtual void DragFinished( sal_Int8 nDropAction );
|
|
|
|
virtual sal_Int8 AcceptDrop (
|
|
|
|
const AcceptDropEvent& rEvt,
|
|
|
|
DropTargetHelper& rTargetHelper,
|
|
|
|
::sd::Window* pTargetWindow = NULL,
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt16 nPage = SDRPAGE_NOTFOUND,
|
|
|
|
sal_uInt16 nLayer = SDRPAGE_NOTFOUND);
|
2004-01-20 10:46:12 +00:00
|
|
|
virtual sal_Int8 ExecuteDrop (
|
|
|
|
const ExecuteDropEvent& rEvt,
|
|
|
|
DropTargetHelper& rTargetHelper,
|
|
|
|
::sd::Window* pTargetWindow = NULL,
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt16 nPage = SDRPAGE_NOTFOUND,
|
|
|
|
sal_uInt16 nLayer = SDRPAGE_NOTFOUND);
|
2004-01-20 10:46:12 +00:00
|
|
|
|
|
|
|
::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::datatransfer::XTransferable>
|
|
|
|
CreateClipboardDataObject (::sd::View*, ::Window& rWindow);
|
|
|
|
::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::datatransfer::XTransferable>
|
|
|
|
CreateDragDataObject (::sd::View*, ::Window& rWindow,
|
|
|
|
const Point& rDragPos);
|
|
|
|
::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::datatransfer::XTransferable>
|
|
|
|
CreateSelectionDataObject (::sd::View*, ::Window& rWindow);
|
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
void UpdateSelectionClipboard( sal_Bool bForceDeselect );
|
2004-01-20 10:46:12 +00:00
|
|
|
|
2004-07-13 13:14:32 +00:00
|
|
|
inline DrawDocShell* GetDocSh (void) const;
|
2012-02-01 19:58:05 +04:00
|
|
|
inline SdDrawDocument& GetDoc (void) const;
|
2004-07-13 13:14:32 +00:00
|
|
|
inline ViewShell* GetViewShell (void) const;
|
2004-01-20 10:46:12 +00:00
|
|
|
|
2008-03-12 10:43:17 +00:00
|
|
|
virtual sal_Bool SdrBeginTextEdit(SdrObject* pObj, SdrPageView* pPV = 0L, ::Window* pWin = 0L, sal_Bool bIsNewObj = sal_False,
|
2006-11-14 13:33:23 +00:00
|
|
|
SdrOutliner* pGivenOutliner = 0L, OutlinerView* pGivenOutlinerView = 0L,
|
|
|
|
sal_Bool bDontDeleteOutliner = sal_False, sal_Bool bOnlyOneView = sal_False, sal_Bool bGrabFocus = sal_True);
|
2008-03-12 10:43:17 +00:00
|
|
|
|
2006-11-14 13:33:23 +00:00
|
|
|
virtual SdrEndTextEditKind SdrEndTextEdit(sal_Bool bDontDeleteReally = sal_False);
|
2008-03-12 10:43:17 +00:00
|
|
|
|
|
|
|
bool RestoreDefaultText( SdrTextObj* pTextObj );
|
2004-01-20 10:46:12 +00:00
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_Bool InsertData( const TransferableDataHelper& rDataHelper,
|
|
|
|
const Point& rPos, sal_Int8& rDnDAction, sal_Bool bDrag,
|
|
|
|
sal_uLong nFormat = 0, sal_uInt16 nPage = SDRPAGE_NOTFOUND, sal_uInt16 nLayer = SDRLAYER_NOTFOUND );
|
2005-10-19 11:24:53 +00:00
|
|
|
/** gets the metafile from the given transferable helper and insert it as a graphic shape.
|
|
|
|
@param bOptimize if set to true, the metafile is analyzed and if only one bitmap action is
|
|
|
|
present, then is is inserted as a single graphic.
|
|
|
|
*/
|
|
|
|
bool InsertMetaFile( TransferableDataHelper& rDataHelper,
|
|
|
|
const Point& rInsertPos,
|
|
|
|
ImageMap* pImageMap, bool bOptimize );
|
|
|
|
|
2004-01-20 10:46:12 +00:00
|
|
|
SdrGrafObj* InsertGraphic( const Graphic& rGraphic,
|
|
|
|
sal_Int8& rAction, const Point& rPos,
|
|
|
|
SdrObject* pSelectedObj, ImageMap* pImageMap );
|
2004-08-12 08:16:16 +00:00
|
|
|
SdrMediaObj* InsertMediaURL( const rtl::OUString& rMediaURL, sal_Int8& rAction,
|
2011-12-02 23:54:33 +01:00
|
|
|
const Point& rPos, const Size& rSize,
|
|
|
|
bool const bLink );
|
2004-01-20 10:46:12 +00:00
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
bool PasteRTFTable( SotStorageStreamRef xStm, SdrPage* pPage, sal_uLong nPasteOptions );
|
2008-03-12 10:43:17 +00:00
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_Bool IsPresObjSelected(sal_Bool bOnPage=sal_True, sal_Bool bOnMasterPage=sal_True, sal_Bool bCheckPresObjListOnly=sal_False, sal_Bool bCheckLayoutOnly=sal_False) const;
|
2004-01-20 10:46:12 +00:00
|
|
|
|
|
|
|
void SetMarkedOriginalSize();
|
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_Bool IsMorphingAllowed() const;
|
|
|
|
sal_Bool IsVectorizeAllowed() const;
|
2004-01-20 10:46:12 +00:00
|
|
|
|
|
|
|
virtual SfxStyleSheet* GetStyleSheet() const;
|
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_Bool GetExchangeList( List*& rpExchangeList, List* pBookmarkList, sal_uInt16 nType );
|
2004-01-20 10:46:12 +00:00
|
|
|
|
|
|
|
virtual void onAccessibilityOptionsChanged();
|
|
|
|
|
|
|
|
virtual SdrModel* GetMarkedObjModel() const;
|
2011-01-17 11:41:00 +01:00
|
|
|
virtual sal_Bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
|
2006-12-12 16:39:30 +00:00
|
|
|
using SdrExchangeView::Paste;
|
2004-01-20 10:46:12 +00:00
|
|
|
|
2006-01-10 13:32:00 +00:00
|
|
|
/** returns true if we have an undo manager and there is an open list undo action */
|
|
|
|
bool isRecordingUndo() const;
|
|
|
|
|
2007-07-06 12:13:13 +00:00
|
|
|
virtual void AddCustomHdl();
|
|
|
|
|
|
|
|
SmartTagSet& getSmartTags() { return maSmartTags; }
|
|
|
|
void selectSmartTag( const SmartTagReference& xTag );
|
|
|
|
void updateHandles();
|
|
|
|
|
|
|
|
virtual SdrViewContext GetContext() const;
|
2011-01-17 11:41:00 +01:00
|
|
|
virtual sal_Bool HasMarkablePoints() const;
|
|
|
|
virtual sal_uLong GetMarkablePointCount() const;
|
|
|
|
virtual sal_Bool HasMarkedPoints() const;
|
|
|
|
virtual sal_uLong GetMarkedPointCount() const;
|
|
|
|
virtual sal_Bool IsPointMarkable(const SdrHdl& rHdl) const;
|
|
|
|
virtual sal_Bool MarkPoint(SdrHdl& rHdl, sal_Bool bUnmark=sal_False);
|
2007-07-06 12:13:13 +00:00
|
|
|
virtual void CheckPossibilities();
|
2011-01-17 11:41:00 +01:00
|
|
|
virtual sal_Bool MarkPoints(const ::Rectangle* pRect, sal_Bool bUnmark);
|
2007-07-06 12:13:13 +00:00
|
|
|
using SdrMarkView::MarkPoints;
|
|
|
|
|
|
|
|
void SetPossibilitiesDirty() { bPossibilitiesDirty = true; }
|
|
|
|
void SetMoveAllowed( bool bSet ) { bMoveAllowed = bSet; }
|
|
|
|
void SetMoveProtected( bool bSet ) { bMoveProtect = bSet; }
|
|
|
|
void SetResizeFreeAllowed( bool bSet ) { bResizeFreeAllowed = bSet; }
|
|
|
|
void SetResizePropAllowed( bool bSet ) { bResizePropAllowed = bSet; }
|
|
|
|
void SetResizeProtected( bool bSet ) { bResizeProtect = bSet; }
|
|
|
|
|
|
|
|
void SetMarkedPointsSmoothPossible( bool bSet ) { bSetMarkedPointsSmoothPossible = bSet; }
|
|
|
|
void SetMarkedSegmentsKindPossible( bool bSet ) { bSetMarkedSegmentsKindPossible = bSet; }
|
|
|
|
|
2009-12-03 18:53:41 +01:00
|
|
|
SdrObject* GetEmptyPresentationObject( PresObjKind eKind );
|
2004-01-20 10:46:12 +00:00
|
|
|
protected:
|
2006-12-12 16:39:30 +00:00
|
|
|
DECL_LINK( OnParagraphInsertedHdl, ::Outliner * );
|
|
|
|
DECL_LINK( OnParagraphRemovingHdl, ::Outliner * );
|
|
|
|
|
2008-06-06 11:08:20 +00:00
|
|
|
virtual void OnBeginPasteOrDrop( PasteOrDropInfos* pInfos );
|
|
|
|
virtual void OnEndPasteOrDrop( PasteOrDropInfos* pInfos );
|
|
|
|
|
2012-02-01 19:58:05 +04:00
|
|
|
SdDrawDocument& mrDoc;
|
2006-12-12 16:39:30 +00:00
|
|
|
DrawDocShell* mpDocSh;
|
|
|
|
ViewShell* mpViewSh;
|
|
|
|
SdrMarkList* mpDragSrcMarkList;
|
|
|
|
SdrObject* mpDropMarkerObj;
|
|
|
|
SdrDropMarkerOverlay* mpDropMarker;
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt16 mnDragSrcPgNum;
|
2006-12-12 16:39:30 +00:00
|
|
|
Point maDropPos;
|
|
|
|
::std::vector< String > maDropFileVector;
|
|
|
|
sal_Int8 mnAction;
|
|
|
|
Timer maDropErrorTimer;
|
|
|
|
Timer maDropInsertFileTimer;
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt16 mnLockRedrawSmph;
|
2011-05-03 18:23:32 -04:30
|
|
|
boost::ptr_vector<SdViewRedrawRec> maLockedRedraws;
|
2006-12-12 16:39:30 +00:00
|
|
|
bool mbIsDropAllowed;
|
2004-01-20 10:46:12 +00:00
|
|
|
|
2012-03-01 18:00:32 +01:00
|
|
|
DECL_LINK( DropErrorHdl, void* );
|
|
|
|
DECL_LINK( DropInsertFileHdl, void* );
|
2004-01-20 10:46:12 +00:00
|
|
|
DECL_LINK( ExecuteNavigatorDrop, SdNavigatorDropEvent* pSdNavigatorDropEvent );
|
2004-07-13 13:14:32 +00:00
|
|
|
|
2006-11-14 13:33:23 +00:00
|
|
|
void ImplClearDrawDropMarker();
|
2007-07-06 12:13:13 +00:00
|
|
|
|
|
|
|
SmartTagSet maSmartTags;
|
|
|
|
|
2004-07-13 13:14:32 +00:00
|
|
|
private:
|
|
|
|
::std::auto_ptr<ViewClipboard> mpClipboard;
|
2004-01-20 10:46:12 +00:00
|
|
|
};
|
|
|
|
|
2004-07-13 13:14:32 +00:00
|
|
|
|
|
|
|
DrawDocShell* View::GetDocSh (void) const
|
|
|
|
{
|
2006-12-12 16:39:30 +00:00
|
|
|
return mpDocSh;
|
2004-07-13 13:14:32 +00:00
|
|
|
}
|
2012-02-01 19:58:05 +04:00
|
|
|
SdDrawDocument& View::GetDoc (void) const
|
2004-07-13 13:14:32 +00:00
|
|
|
{
|
2012-02-01 19:58:05 +04:00
|
|
|
return mrDoc;
|
2004-07-13 13:14:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ViewShell* View::GetViewShell (void) const
|
|
|
|
{
|
2006-12-12 16:39:30 +00:00
|
|
|
return mpViewSh;
|
2004-07-13 13:14:32 +00:00
|
|
|
}
|
|
|
|
|
2004-01-20 10:46:12 +00:00
|
|
|
} // end of namespace sd
|
|
|
|
|
|
|
|
#endif
|
2010-10-27 12:53:26 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|