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:31:24 +00:00
|
|
|
|
2013-10-23 22:38:46 +02:00
|
|
|
#ifndef INCLUDED_SD_SOURCE_UI_INC_DRAWDOCSHELL_HXX
|
|
|
|
#define INCLUDED_SD_SOURCE_UI_INC_DRAWDOCSHELL_HXX
|
2004-01-20 10:31:24 +00:00
|
|
|
|
|
|
|
#include <sfx2/docfac.hxx>
|
|
|
|
#include <sfx2/objsh.hxx>
|
2004-10-04 17:35:47 +00:00
|
|
|
|
|
|
|
#include <vcl/jobset.hxx>
|
2004-01-20 10:31:24 +00:00
|
|
|
#include "glob.hxx"
|
|
|
|
#include "sdmod.hxx"
|
|
|
|
#include "pres.hxx"
|
2004-08-23 07:20:28 +00:00
|
|
|
#include "sddllapi.h"
|
2005-12-14 16:06:40 +00:00
|
|
|
#include "fupoor.hxx"
|
2004-01-20 10:31:24 +00:00
|
|
|
|
|
|
|
class SfxStyleSheetBasePool;
|
|
|
|
class FontList;
|
|
|
|
class SdDrawDocument;
|
|
|
|
class SdPage;
|
|
|
|
class SfxPrinter;
|
|
|
|
struct SpellCallbackInfo;
|
2006-12-12 16:32:52 +00:00
|
|
|
class AbstractSvxNameDialog;
|
2010-10-22 15:00:39 +02:00
|
|
|
class SfxUndoManager;
|
2004-01-20 10:31:24 +00:00
|
|
|
|
|
|
|
namespace sd {
|
|
|
|
|
|
|
|
class FrameView;
|
|
|
|
class ViewShell;
|
2014-10-17 23:45:59 +07:00
|
|
|
class DrawViewShell;
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2014-02-25 23:45:44 +01:00
|
|
|
// DrawDocShell
|
2004-10-04 17:35:47 +00:00
|
|
|
class SD_DLLPUBLIC DrawDocShell : public SfxObjectShell
|
2004-01-20 10:31:24 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-12-12 16:32:52 +00:00
|
|
|
SFX_DECL_INTERFACE(SD_IF_SDDRAWDOCSHELL)
|
2004-10-04 17:35:47 +00:00
|
|
|
SFX_DECL_OBJECTFACTORY();
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2014-04-18 18:04:32 +02:00
|
|
|
private:
|
|
|
|
/// SfxInterface initializer.
|
|
|
|
static void InitInterface_Impl();
|
|
|
|
|
|
|
|
public:
|
2004-01-20 10:31:24 +00:00
|
|
|
DrawDocShell (
|
2016-10-24 10:43:29 +02:00
|
|
|
SfxObjectCreateMode eMode,
|
|
|
|
bool bSdDataObj,
|
2016-10-11 12:21:55 +02:00
|
|
|
DocumentType=DocumentType::Impress);
|
2010-01-06 21:34:53 +01:00
|
|
|
|
|
|
|
DrawDocShell (
|
2015-04-09 16:35:22 +02:00
|
|
|
SfxModelFlags nModelCreationFlags,
|
2016-10-24 10:43:29 +02:00
|
|
|
bool bSdDataObj,
|
2016-10-11 12:21:55 +02:00
|
|
|
DocumentType=DocumentType::Impress);
|
2006-12-12 16:32:52 +00:00
|
|
|
|
2004-01-20 10:31:24 +00:00
|
|
|
DrawDocShell (
|
|
|
|
SdDrawDocument* pDoc,
|
2016-10-24 10:43:29 +02:00
|
|
|
SfxObjectCreateMode eMode,
|
|
|
|
bool bSdDataObj,
|
2016-10-11 12:21:55 +02:00
|
|
|
DocumentType=DocumentType::Impress);
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~DrawDocShell() override;
|
2004-01-20 10:31:24 +00:00
|
|
|
|
|
|
|
void UpdateRefDevice();
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Activate( bool bMDI ) override;
|
|
|
|
virtual void Deactivate( bool bMDI ) override;
|
2015-10-28 12:01:32 +02:00
|
|
|
virtual bool InitNew( const css::uno::Reference< css::embed::XStorage >& xStorage ) override;
|
2013-12-05 12:15:15 +01:00
|
|
|
virtual bool ImportFrom(SfxMedium &rMedium,
|
|
|
|
css::uno::Reference<css::text::XTextRange> const& xInsertPosition)
|
2015-10-12 16:04:04 +02:00
|
|
|
override;
|
|
|
|
virtual bool ConvertFrom( SfxMedium &rMedium ) override;
|
|
|
|
virtual bool Save() override;
|
|
|
|
virtual bool SaveAsOwnFormat( SfxMedium& rMedium ) override;
|
|
|
|
virtual bool ConvertTo( SfxMedium &rMedium ) override;
|
2015-10-28 12:01:32 +02:00
|
|
|
virtual bool SaveCompleted( const css::uno::Reference< css::embed::XStorage >& xStorage ) override;
|
2015-10-12 16:04:04 +02:00
|
|
|
|
|
|
|
virtual bool Load( SfxMedium &rMedium ) override;
|
|
|
|
virtual bool LoadFrom( SfxMedium& rMedium ) override;
|
|
|
|
virtual bool SaveAs( SfxMedium &rMedium ) override;
|
|
|
|
|
|
|
|
virtual Rectangle GetVisArea(sal_uInt16 nAspect) const override;
|
|
|
|
virtual void Draw(OutputDevice*, const JobSetup& rSetup, sal_uInt16 nAspect = ASPECT_CONTENT) override;
|
2010-10-20 14:54:59 +02:00
|
|
|
virtual ::svl::IUndoManager*
|
2015-10-12 16:04:04 +02:00
|
|
|
GetUndoManager() override;
|
|
|
|
virtual Printer* GetDocumentPrinter() override;
|
|
|
|
virtual void OnDocumentPrinterChanged(Printer* pNewPrinter) override;
|
|
|
|
virtual SfxStyleSheetBasePool* GetStyleSheetPool() override;
|
|
|
|
virtual void FillClass(SvGlobalName* pClassName, SotClipboardFormatId* pFormat, OUString* pAppName, OUString* pFullTypeName, OUString* pShortTypeName, sal_Int32 nFileFormat, bool bTemplate = false ) const override;
|
|
|
|
virtual void SetModified( bool = true ) override;
|
2016-03-08 16:21:26 +02:00
|
|
|
virtual VclPtr<SfxDocumentInfoDialog> CreateDocumentInfoDialog( const SfxItemSet &rSet ) override;
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2006-12-12 16:32:52 +00:00
|
|
|
using SfxObjectShell::GetVisArea;
|
|
|
|
using SfxShell::GetViewShell;
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2006-12-12 16:32:52 +00:00
|
|
|
sd::ViewShell* GetViewShell() { return mpViewShell; }
|
2004-01-20 10:31:24 +00:00
|
|
|
::sd::FrameView* GetFrameView();
|
2016-04-13 15:37:03 +02:00
|
|
|
const rtl::Reference<FuPoor>& GetDocShellFunction() const { return mxDocShellFunction; }
|
2013-10-25 15:42:11 +02:00
|
|
|
void SetDocShellFunction( const rtl::Reference<FuPoor>& xFunction );
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2014-06-09 10:09:42 +02:00
|
|
|
SdDrawDocument* GetDoc() { return mpDoc;}
|
2006-12-12 16:32:52 +00:00
|
|
|
DocumentType GetDocumentType() const { return meDocType; }
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
SfxPrinter* GetPrinter(bool bCreate);
|
2004-01-20 10:31:24 +00:00
|
|
|
void SetPrinter(SfxPrinter *pNewPrinter);
|
2006-05-04 13:59:14 +00:00
|
|
|
void UpdateFontList();
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool IsInDestruction() const { return mbInDestruction; }
|
2004-01-20 10:31:24 +00:00
|
|
|
|
|
|
|
void CancelSearching();
|
|
|
|
|
|
|
|
void Execute( SfxRequest& rReq );
|
|
|
|
void GetState(SfxItemSet&);
|
|
|
|
|
|
|
|
void Connect(sd::ViewShell* pViewSh);
|
|
|
|
void Disconnect(sd::ViewShell* pViewSh);
|
|
|
|
void UpdateTablePointers();
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool GotoBookmark(const OUString& rBookmark);
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool IsMarked( SdrObject* pObject );
|
2015-08-04 07:51:32 -03:00
|
|
|
// Optionally realize multi-selection of objects
|
2016-08-01 09:51:02 +02:00
|
|
|
bool GetObjectIsmarked(const OUString& rBookmark, bool bRealizeMultiSelectionOfObjects);
|
2016-09-09 13:55:14 +02:00
|
|
|
Bitmap GetPagePreviewBitmap(SdPage* pPage);
|
2004-01-20 10:31:24 +00:00
|
|
|
|
|
|
|
/** checks, if the given name is a valid new name for a slide
|
|
|
|
|
|
|
|
<p>If the name is invalid, an <type>SvxNameDialog</type> pops up that
|
|
|
|
queries again for a new name until it is ok or the user chose
|
|
|
|
Cancel.</p>
|
|
|
|
|
|
|
|
@param pWin is necessary to pass to the <type>SvxNameDialog</type> in
|
|
|
|
case an invalid name was entered.
|
|
|
|
@param rName the new name that is to be set for a slide. This string
|
|
|
|
may be set to an empty string (see below).
|
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
@return sal_True, if the new name is unique. Note that if the user entered
|
2004-01-20 10:31:24 +00:00
|
|
|
a default name of a not-yet-existing slide (e.g. 'Slide 17'),
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_True is returned, but rName is set to an empty string.
|
2004-01-20 10:31:24 +00:00
|
|
|
*/
|
2014-09-23 11:20:40 +02:00
|
|
|
bool CheckPageName(vcl::Window* pWin, OUString& rName );
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2015-11-10 10:23:02 +01:00
|
|
|
void SetSlotFilter(bool bEnable = false, sal_uInt16 nCount = 0, const sal_uInt16* pSIDs = nullptr) { mbFilterEnable = bEnable; mnFilterCount = nCount; mpFilterSIDs = pSIDs; }
|
2004-01-20 10:31:24 +00:00
|
|
|
void ApplySlotFilter() const;
|
|
|
|
|
2016-05-04 11:31:33 +02:00
|
|
|
SfxStyleFamily GetStyleFamily() const { return mnStyleFamily; }
|
|
|
|
void SetStyleFamily( SfxStyleFamily nSF ) { mnStyleFamily = nSF; }
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2004-11-26 19:11:50 +00:00
|
|
|
/** executes the SID_OPENDOC slot to let the framework open a document
|
|
|
|
with the given URL and this document as a referer */
|
2013-08-24 18:49:18 +04:00
|
|
|
void OpenBookmark( const OUString& rBookmarkURL );
|
2004-11-26 19:11:50 +00:00
|
|
|
|
2004-01-20 10:31:24 +00:00
|
|
|
/** checks, if the given name is a valid new name for a slide
|
|
|
|
|
|
|
|
<p>This method does not pop up any dialog (like CheckPageName).</p>
|
|
|
|
|
|
|
|
@param rInOutPageName the new name for a slide that is to be renamed.
|
|
|
|
This string will be set to an empty string if
|
|
|
|
bResetStringIfStandardName is true and the name is of the
|
|
|
|
form of any, possibly not-yet existing, standard slide
|
|
|
|
(e.g. 'Slide 17')
|
|
|
|
|
|
|
|
@param bResetStringIfStandardName if true allows setting rInOutPageName
|
|
|
|
to an empty string, which returns true and implies that the
|
|
|
|
slide will later on get a new standard name (with a free
|
|
|
|
slide number).
|
|
|
|
|
|
|
|
@return true, if the new name is unique. If bResetStringIfStandardName
|
|
|
|
is true, the return value is also true, if the slide name is
|
|
|
|
a standard name (see above)
|
|
|
|
*/
|
2013-08-15 16:56:09 +04:00
|
|
|
bool IsNewPageNameValid( OUString & rInOutPageName, bool bResetStringIfStandardName = false );
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2016-12-28 22:04:43 +03:00
|
|
|
/** checks, if the given name is a *unique* name for an *existing* slide
|
|
|
|
|
|
|
|
@param rPageName the name of an existing slide
|
|
|
|
|
|
|
|
@return true, if the name is unique and the slide exists
|
|
|
|
*/
|
|
|
|
bool IsPageNameUnique(const OUString& rPagName) const;
|
|
|
|
|
2004-01-20 10:31:24 +00:00
|
|
|
/** Return the reference device for the current document. When the
|
|
|
|
inherited implementation returns a device then this is passed to the
|
|
|
|
caller. Otherwise the returned value depends on the printer
|
|
|
|
independent layout mode and will usually be either a printer or a
|
|
|
|
virtual device used for screen rendering.
|
|
|
|
@return
|
|
|
|
Returns NULL when the current document has no reference device.
|
|
|
|
*/
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual OutputDevice* GetDocumentRefDev() override;
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2016-10-05 07:56:12 +02:00
|
|
|
DECL_LINK( RenameSlideHdl, AbstractSvxNameDialog&, bool );
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2015-09-22 12:26:29 +02:00
|
|
|
// ExecuteSpellPopup now handled by DrawDocShell
|
2016-10-05 07:56:12 +02:00
|
|
|
DECL_LINK( OnlineSpellCallback, SpellCallbackInfo&, void );
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2008-01-28 13:55:42 +00:00
|
|
|
void ClearUndoBuffer();
|
|
|
|
|
2004-01-20 10:31:24 +00:00
|
|
|
protected:
|
|
|
|
|
2006-12-12 16:32:52 +00:00
|
|
|
SdDrawDocument* mpDoc;
|
|
|
|
SfxUndoManager* mpUndoManager;
|
2015-03-18 20:52:22 +00:00
|
|
|
VclPtr<SfxPrinter> mpPrinter;
|
2006-12-12 16:32:52 +00:00
|
|
|
::sd::ViewShell* mpViewShell;
|
|
|
|
FontList* mpFontList;
|
2013-10-25 15:42:11 +02:00
|
|
|
rtl::Reference<FuPoor> mxDocShellFunction;
|
2006-12-12 16:32:52 +00:00
|
|
|
DocumentType meDocType;
|
2016-05-04 11:31:33 +02:00
|
|
|
SfxStyleFamily mnStyleFamily;
|
2015-09-24 18:59:52 +02:00
|
|
|
const sal_uInt16* mpFilterSIDs;
|
|
|
|
sal_uInt16 mnFilterCount;
|
2014-04-24 10:52:02 +02:00
|
|
|
bool mbFilterEnable;
|
|
|
|
bool mbSdDataObj;
|
|
|
|
bool mbInDestruction;
|
|
|
|
bool mbOwnPrinter;
|
|
|
|
bool mbNewDocument;
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2006-12-12 16:32:52 +00:00
|
|
|
bool mbOwnDocument; // if true, we own mpDoc and will delete it in our d'tor
|
2008-07-02 10:51:38 +00:00
|
|
|
void Construct(bool bClipboard);
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void InPlaceActivate( bool bActive ) override;
|
2014-10-17 23:45:59 +07:00
|
|
|
private:
|
2015-04-29 09:55:11 +02:00
|
|
|
static void setEditMode(DrawViewShell* pDrawViewShell, bool isMasterPage);
|
2004-01-20 10:31:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SV_DECL_DRAW_DOC_SHELL_DEFINED
|
|
|
|
#define SV_DECL_DRAW_DOC_SHELL_DEFINED
|
2014-04-07 12:31:09 +02:00
|
|
|
typedef ::tools::SvRef<DrawDocShell> DrawDocShellRef;
|
2004-01-20 10:31:24 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
} // end of namespace sd
|
|
|
|
|
|
|
|
#endif
|
2010-10-27 12:53:26 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|