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 .
|
|
|
|
*/
|
2004-01-20 10:46:12 +00:00
|
|
|
|
2013-10-23 22:38:46 +02:00
|
|
|
#ifndef INCLUDED_SD_SOURCE_UI_INC_VIEW_HXX
|
|
|
|
#define INCLUDED_SD_SOURCE_UI_INC_VIEW_HXX
|
2004-01-20 10:46:12 +00:00
|
|
|
|
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"
|
2013-04-10 08:20:16 +00:00
|
|
|
#include <editeng/numitem.hxx>
|
2007-07-06 12:13:13 +00:00
|
|
|
|
2004-01-20 10:46:12 +00:00
|
|
|
class SdDrawDocument;
|
2012-12-04 15:54:24 +01:00
|
|
|
class SdPage;
|
2004-01-20 10:46:12 +00:00
|
|
|
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 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
|
|
|
|
|
|
|
|
2014-02-25 23:45:44 +01:00
|
|
|
// SdViewRedrawRec
|
2004-01-20 10:46:12 +00:00
|
|
|
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:
|
2014-03-26 11:54:10 +01:00
|
|
|
TYPEINFO_OVERRIDE();
|
2004-01-20 10:46:12 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
void CompleteRedraw( OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L) SAL_OVERRIDE;
|
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);
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void MarkListHasChanged() SAL_OVERRIDE;
|
|
|
|
virtual void ModelHasChanged() SAL_OVERRIDE;
|
2004-01-20 10:46:12 +00:00
|
|
|
virtual void SelectAll();
|
|
|
|
virtual void DoCut(::Window* pWindow=NULL);
|
|
|
|
virtual void DoCopy(::Window* pWindow=NULL);
|
|
|
|
virtual void DoPaste(::Window* pWindow=NULL);
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void DoConnect(SdrOle2Obj* pOleObj) SAL_OVERRIDE;
|
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
|
|
|
|
2014-03-10 11:09:59 +02:00
|
|
|
virtual bool SdrBeginTextEdit(SdrObject* pObj, SdrPageView* pPV = 0L, ::Window* pWin = 0L, bool bIsNewObj = false,
|
2006-11-14 13:33:23 +00:00
|
|
|
SdrOutliner* pGivenOutliner = 0L, OutlinerView* pGivenOutlinerView = 0L,
|
2014-03-27 18:12:18 +01:00
|
|
|
bool bDontDeleteOutliner = false, bool bOnlyOneView = false, bool bGrabFocus = true) SAL_OVERRIDE;
|
2008-03-12 10:43:17 +00:00
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally = false) SAL_OVERRIDE;
|
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 );
|
2013-04-07 12:06:47 +02:00
|
|
|
SdrMediaObj* InsertMediaURL( const 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
|
|
|
|
2014-04-02 11:34:03 +02:00
|
|
|
SdrMediaObj* Insert3DModelURL( const OUString& rModelURL, sal_Int8& rAction,
|
|
|
|
const Point& rPos, const Size& rSize,
|
|
|
|
bool const bLink );
|
|
|
|
|
2014-04-04 13:14:45 +02:00
|
|
|
SdrMediaObj* InsertMediaObj( const OUString& rURL, const OUString& rMimeType, sal_Int8& rAction,
|
2014-04-02 11:34:03 +02:00
|
|
|
const Point& rPos, const Size& rSize );
|
|
|
|
|
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;
|
|
|
|
|
2013-03-13 17:55:26 +01:00
|
|
|
/** return parameter:
|
|
|
|
pExchangeList == NULL -> all names are unique
|
|
|
|
bNameOK == sal_False -> cancel by user
|
|
|
|
nType == 0 -> pages
|
|
|
|
nType == 1 -> objects
|
|
|
|
nType == 2 -> pages and objects */
|
2012-03-25 16:31:29 -04:30
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
bool GetExchangeList( std::vector<OUString> &rExchangeList,
|
|
|
|
std::vector<OUString> &rBookmarkList,
|
2012-03-25 16:31:29 -04:30
|
|
|
const sal_uInt16 nType );
|
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void onAccessibilityOptionsChanged() SAL_OVERRIDE;
|
2004-01-20 10:46:12 +00:00
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual SdrModel* GetMarkedObjModel() const SAL_OVERRIDE;
|
|
|
|
virtual bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0) SAL_OVERRIDE;
|
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;
|
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void AddCustomHdl() SAL_OVERRIDE;
|
2007-07-06 12:13:13 +00:00
|
|
|
|
|
|
|
SmartTagSet& getSmartTags() { return maSmartTags; }
|
|
|
|
void selectSmartTag( const SmartTagReference& xTag );
|
|
|
|
void updateHandles();
|
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual SdrViewContext GetContext() const SAL_OVERRIDE;
|
|
|
|
virtual bool HasMarkablePoints() const SAL_OVERRIDE;
|
|
|
|
virtual sal_uLong GetMarkablePointCount() const SAL_OVERRIDE;
|
|
|
|
virtual bool HasMarkedPoints() const SAL_OVERRIDE;
|
|
|
|
virtual sal_uLong GetMarkedPointCount() const SAL_OVERRIDE;
|
|
|
|
virtual bool IsPointMarkable(const SdrHdl& rHdl) const SAL_OVERRIDE;
|
|
|
|
virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark=false) SAL_OVERRIDE;
|
|
|
|
virtual void CheckPossibilities() SAL_OVERRIDE;
|
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;
|
2013-05-29 08:10:49 +00:00
|
|
|
|
|
|
|
bool ShouldToggleOn(
|
|
|
|
const bool bBulletOnOffMode,
|
|
|
|
const bool bNormalBullet);
|
|
|
|
|
|
|
|
/** change the bullets/numbering of the marked objects
|
|
|
|
|
|
|
|
@param bToggle
|
|
|
|
true: just toggle the current bullets/numbering on --> off resp. off --> on
|
|
|
|
|
|
|
|
@param bHandleBullets
|
|
|
|
true: handle bullets
|
|
|
|
false: handle numbering
|
|
|
|
|
|
|
|
@param pNumRule
|
|
|
|
numbering rule which needs to be applied. can be 0.
|
|
|
|
|
|
|
|
@param bSwitchOff
|
|
|
|
true: switch off bullets/numbering
|
|
|
|
*/
|
|
|
|
void ChangeMarkedObjectsBulletsNumbering(
|
|
|
|
const bool bToggle,
|
|
|
|
const bool bHandleBullets,
|
|
|
|
const SvxNumRule* pNumRule,
|
|
|
|
const bool bSwitchOff);
|
2007-07-06 12:13:13 +00:00
|
|
|
|
|
|
|
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 );
|
2012-12-04 15:54:24 +01:00
|
|
|
SdPage* GetPage();
|
|
|
|
SdrObject* GetSelectedSingleObject(SdPage* pPage);
|
|
|
|
|
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 * );
|
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void OnBeginPasteOrDrop( PasteOrDropInfos* pInfos ) SAL_OVERRIDE;
|
|
|
|
virtual void OnEndPasteOrDrop( PasteOrDropInfos* pInfos ) SAL_OVERRIDE;
|
2008-06-06 11:08:20 +00:00
|
|
|
|
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;
|
2013-08-11 21:13:38 +04:00
|
|
|
::std::vector<OUString> maDropFileVector;
|
2006-12-12 16:39:30 +00:00
|
|
|
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: */
|