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-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:
|
|
|
|
TYPEINFO();
|
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
|
|
|
|
|
|
|
DrawDocShell (
|
|
|
|
SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED,
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_Bool bSdDataObj=sal_False,
|
2010-01-06 21:34:53 +01:00
|
|
|
DocumentType=DOCUMENT_TYPE_IMPRESS);
|
|
|
|
|
|
|
|
DrawDocShell (
|
|
|
|
const sal_uInt64 nModelCreationFlags,
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_Bool bSdDataObj=sal_False,
|
2010-01-06 21:34:53 +01:00
|
|
|
DocumentType=DOCUMENT_TYPE_IMPRESS);
|
2006-12-12 16:32:52 +00:00
|
|
|
|
2004-01-20 10:31:24 +00:00
|
|
|
DrawDocShell (
|
|
|
|
SdDrawDocument* pDoc,
|
|
|
|
SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED,
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_Bool bSdDataObj=sal_False,
|
2004-01-20 10:31:24 +00:00
|
|
|
DocumentType=DOCUMENT_TYPE_IMPRESS);
|
|
|
|
virtual ~DrawDocShell();
|
|
|
|
|
|
|
|
void UpdateRefDevice();
|
2014-03-18 11:23:57 +02:00
|
|
|
virtual void Activate( bool bMDI );
|
|
|
|
virtual void Deactivate( bool bMDI );
|
2014-03-17 13:38:26 +02:00
|
|
|
virtual bool InitNew( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
|
2013-12-05 12:15:15 +01:00
|
|
|
virtual bool ImportFrom(SfxMedium &rMedium,
|
|
|
|
css::uno::Reference<css::text::XTextRange> const& xInsertPosition)
|
|
|
|
SAL_OVERRIDE;
|
2014-03-17 13:38:26 +02:00
|
|
|
virtual bool ConvertFrom( SfxMedium &rMedium );
|
|
|
|
virtual bool Save();
|
|
|
|
virtual bool SaveAsOwnFormat( SfxMedium& rMedium );
|
|
|
|
virtual bool ConvertTo( SfxMedium &rMedium );
|
|
|
|
virtual bool SaveCompleted( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
|
2005-01-11 11:12:23 +00:00
|
|
|
|
2014-03-17 13:38:26 +02:00
|
|
|
virtual bool Load( SfxMedium &rMedium );
|
|
|
|
virtual bool LoadFrom( SfxMedium& rMedium );
|
|
|
|
virtual bool SaveAs( SfxMedium &rMedium );
|
2005-01-11 11:12:23 +00:00
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
virtual Rectangle GetVisArea(sal_uInt16 nAspect) const;
|
|
|
|
virtual void Draw(OutputDevice*, const JobSetup& rSetup, sal_uInt16 nAspect = ASPECT_CONTENT);
|
2010-10-20 14:54:59 +02:00
|
|
|
virtual ::svl::IUndoManager*
|
|
|
|
GetUndoManager();
|
2004-01-20 10:31:24 +00:00
|
|
|
virtual Printer* GetDocumentPrinter();
|
|
|
|
virtual void OnDocumentPrinterChanged(Printer* pNewPrinter);
|
|
|
|
virtual SfxStyleSheetBasePool* GetStyleSheetPool();
|
|
|
|
virtual Size GetFirstPageSize();
|
2014-03-10 22:48:41 +01:00
|
|
|
virtual void FillClass(SvGlobalName* pClassName, sal_uInt32* pFormat, OUString* pAppName, OUString* pFullTypeName, OUString* pShortTypeName, sal_Int32 nFileFormat, bool bTemplate = false ) const;
|
2014-03-17 13:38:26 +02:00
|
|
|
virtual void SetModified( bool = true );
|
2013-02-22 12:03:54 +01:00
|
|
|
virtual SfxDocumentInfoDialog* CreateDocumentInfoDialog( ::Window *pParent,
|
|
|
|
const SfxItemSet &rSet );
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2006-12-12 16:32:52 +00:00
|
|
|
using SotObject::GetInterface;
|
|
|
|
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();
|
2013-10-25 15:42:11 +02:00
|
|
|
rtl::Reference<FuPoor> GetDocShellFunction() const { return mxDocShellFunction; }
|
|
|
|
void SetDocShellFunction( const rtl::Reference<FuPoor>& xFunction );
|
2004-01-20 10:31:24 +00:00
|
|
|
|
|
|
|
SdDrawDocument* GetDoc();
|
2006-12-12 16:32:52 +00:00
|
|
|
DocumentType GetDocumentType() const { return meDocType; }
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
SfxPrinter* GetPrinter(sal_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
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_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();
|
|
|
|
|
2013-11-28 12:09:19 +00:00
|
|
|
sal_Bool GotoBookmark(const OUString& rBookmark);
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2013-11-28 12:09:19 +00:00
|
|
|
//realize multi-selection of objects
|
|
|
|
sal_Bool GotoTreeBookmark(const OUString& rBookmark);
|
|
|
|
sal_Bool IsMarked( SdrObject* pObject );
|
|
|
|
sal_Bool GetObjectIsmarked(const OUString& rBookmark);
|
2011-01-17 11:41:00 +01:00
|
|
|
Bitmap GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixel);
|
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
|
|
|
*/
|
2013-08-15 16:56:09 +04:00
|
|
|
sal_Bool CheckPageName(::Window* pWin, OUString& rName );
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
void SetSlotFilter(sal_Bool bEnable = sal_False, sal_uInt16 nCount = 0, const sal_uInt16* pSIDs = NULL) { mbFilterEnable = bEnable; mnFilterCount = nCount; mpFilterSIDs = pSIDs; }
|
2004-01-20 10:31:24 +00:00
|
|
|
void ApplySlotFilter() const;
|
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt16 GetStyleFamily() const { return mnStyleFamily; }
|
|
|
|
void SetStyleFamily( sal_uInt16 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
|
|
|
|
|
|
|
|
|
|
|
/** 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.
|
|
|
|
*/
|
|
|
|
virtual OutputDevice* GetDocumentRefDev (void);
|
|
|
|
|
2004-02-04 09:33:32 +00:00
|
|
|
DECL_LINK( RenameSlideHdl, AbstractSvxNameDialog* );
|
2004-01-20 10:31:24 +00:00
|
|
|
|
2011-02-07 22:11:09 +01:00
|
|
|
// ExecuteSpellPopup now handled by DrawDocShell
|
2004-01-20 10:31:24 +00:00
|
|
|
DECL_LINK( OnlineSpellCallback, SpellCallbackInfo* );
|
|
|
|
|
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;
|
|
|
|
SfxPrinter* mpPrinter;
|
|
|
|
::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;
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt16 mnStyleFamily;
|
|
|
|
const sal_uInt16* mpFilterSIDs;
|
|
|
|
sal_uInt16 mnFilterCount;
|
|
|
|
sal_Bool mbFilterEnable;
|
|
|
|
sal_Bool mbSdDataObj;
|
|
|
|
sal_Bool mbInDestruction;
|
|
|
|
sal_Bool mbOwnPrinter;
|
|
|
|
sal_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);
|
2014-03-17 13:38:26 +02:00
|
|
|
virtual void InPlaceActivate( bool bActive );
|
2013-11-28 12:09:19 +00:00
|
|
|
public:
|
|
|
|
virtual void setDocAccTitle( const OUString& rTitle );
|
|
|
|
virtual const OUString getDocAccTitle() const;
|
|
|
|
virtual void setDocReadOnly( sal_Bool bReadOnly);
|
|
|
|
virtual sal_Bool getDocReadOnly() const;
|
2004-01-20 10:31:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SV_DECL_DRAW_DOC_SHELL_DEFINED
|
|
|
|
#define SV_DECL_DRAW_DOC_SHELL_DEFINED
|
|
|
|
SV_DECL_REF(DrawDocShell)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
SV_IMPL_REF (DrawDocShell)
|
|
|
|
|
|
|
|
} // end of namespace sd
|
|
|
|
|
|
|
|
#endif
|
2010-10-27 12:53:26 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|