2010-10-27 12:53:26 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01: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 .
|
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-10-23 22:38:46 +02:00
|
|
|
#ifndef INCLUDED_SD_INC_SDMOD_HXX
|
|
|
|
#define INCLUDED_SD_INC_SDMOD_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#include "glob.hxx"
|
|
|
|
#include "pres.hxx"
|
2004-10-04 17:15:08 +00:00
|
|
|
|
|
|
|
#include <sot/storage.hxx>
|
2004-08-23 07:12:23 +00:00
|
|
|
#include "sddllapi.h"
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/lstner.hxx>
|
2017-05-03 14:53:00 +02:00
|
|
|
#include <com/sun/star/beans/XPropertySetInfo.hpp>
|
2003-09-19 07:14:40 +00:00
|
|
|
#include <sfx2/module.hxx>
|
2014-02-14 22:36:19 -02:00
|
|
|
#include <sal/types.h>
|
2015-02-05 12:40:29 +01:00
|
|
|
#include <map>
|
2004-08-04 07:52:47 +00:00
|
|
|
#include <memory>
|
2003-09-19 07:14:40 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
class SdOptions;
|
|
|
|
class SvxSearchItem;
|
|
|
|
class EditFieldInfo;
|
2001-01-19 18:15:28 +00:00
|
|
|
class SdTransferable;
|
2001-06-19 14:07:14 +00:00
|
|
|
class SvNumberFormatter;
|
2001-08-20 09:56:24 +00:00
|
|
|
class SfxErrorHandler;
|
2006-02-09 13:04:51 +00:00
|
|
|
class SfxFrame;
|
2017-12-15 11:11:16 +02:00
|
|
|
struct SfxItemPropertyMapEntry;
|
2016-10-20 20:26:24 +09:00
|
|
|
namespace svtools { class ColorConfig; }
|
2004-01-20 09:18:19 +00:00
|
|
|
|
2009-12-14 12:55:05 +01:00
|
|
|
namespace com { namespace sun { namespace star { namespace frame {
|
|
|
|
class XFrame;
|
|
|
|
} } } }
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
enum SdOptionStreamMode
|
|
|
|
{
|
|
|
|
SD_OPTION_LOAD = 0,
|
|
|
|
SD_OPTION_STORE = 1
|
|
|
|
};
|
|
|
|
|
2017-12-15 11:11:16 +02:00
|
|
|
typedef std::map< SfxItemPropertyMapEntry const * , css::uno::Reference<css::beans::XPropertySetInfo> > SdExtPropertySetInfoCache;
|
2015-02-05 12:40:29 +01:00
|
|
|
typedef std::map< sal_uInt32, css::uno::Sequence< css::uno::Type> > SdTypesCache;
|
2015-02-04 09:28:37 +00:00
|
|
|
|
2014-02-14 22:36:19 -02:00
|
|
|
/*
|
|
|
|
|
|
|
|
This subclass of <SfxModule> (which is a subclass of <SfxShell>) is
|
|
|
|
linked to the DLL. One instance of this class exists while the DLL is
|
|
|
|
loaded.
|
|
|
|
|
|
|
|
SdModule is like to be compared with the <SfxApplication>-subclass.
|
|
|
|
|
|
|
|
Remember: Don`t export this class! It uses DLL-internal symbols.
|
|
|
|
|
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2017-10-25 15:53:56 +02:00
|
|
|
class SdModule final : public SfxModule, public SfxListener
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-12-12 15:25:32 +00:00
|
|
|
SFX_DECL_INTERFACE(SD_IF_SDAPP)
|
2016-10-05 07:56:12 +02:00
|
|
|
DECL_LINK( CalcFieldValueHdl, EditFieldInfo*, void );
|
2001-04-04 15:41:39 +00:00
|
|
|
|
2014-04-18 18:04:32 +02:00
|
|
|
private:
|
|
|
|
/// SfxInterface initializer.
|
|
|
|
static void InitInterface_Impl();
|
|
|
|
|
|
|
|
public:
|
2003-09-19 07:14:40 +00:00
|
|
|
SdModule(SfxObjectFactory* pDrawObjFact, SfxObjectFactory* pGraphicObjFact);
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~SdModule() override;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
SdTransferable* pTransferClip;
|
|
|
|
SdTransferable* pTransferDrag;
|
2001-08-23 09:54:33 +00:00
|
|
|
SdTransferable* pTransferSelection;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
void Execute(SfxRequest& rReq);
|
|
|
|
void GetState(SfxItemSet&);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
SdOptions* GetSdOptions(DocumentType eDocType);
|
2015-05-06 16:38:01 +02:00
|
|
|
SD_DLLPUBLIC tools::SvRef<SotStorageStream> GetOptionStream( const OUString& rOptionName, SdOptionStreamMode eMode );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool GetWaterCan() const { return bWaterCan; }
|
|
|
|
void SetWaterCan( bool bWC ) { bWaterCan = bWC; }
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2018-03-15 10:54:44 +02:00
|
|
|
SvxSearchItem* GetSearchItem() { return pSearchItem.get(); }
|
|
|
|
void SetSearchItem(std::unique_ptr<SvxSearchItem> pItem);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2003-04-24 13:35:42 +00:00
|
|
|
/** Return the virtual device that can be used for printer independent
|
|
|
|
layout.
|
|
|
|
@return
|
|
|
|
The returned pointer is NULL when the device could not be
|
|
|
|
created when this modules was instantiated.
|
|
|
|
*/
|
2015-04-14 12:44:47 +02:00
|
|
|
OutputDevice* GetVirtualRefDevice() { return mpVirtualRefDevice;}
|
2003-04-24 13:35:42 +00:00
|
|
|
|
2015-04-16 10:01:37 +02:00
|
|
|
SD_DLLPUBLIC SvNumberFormatter* GetNumberFormatter();
|
2002-08-01 10:30:12 +00:00
|
|
|
|
2013-03-01 10:11:20 +01:00
|
|
|
// virtual methods for the option dialog
|
2017-06-14 09:35:26 +02:00
|
|
|
virtual std::unique_ptr<SfxItemSet> CreateItemSet( sal_uInt16 nId ) override;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
|
2018-04-20 11:06:07 +01:00
|
|
|
virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
|
2018-05-02 14:21:41 +02:00
|
|
|
virtual std::unique_ptr<SfxStyleFamilies> CreateStyleFamilies() override;
|
2002-11-28 09:52:52 +00:00
|
|
|
|
2015-02-04 09:28:37 +00:00
|
|
|
SdExtPropertySetInfoCache gImplImpressPropertySetInfoCache;
|
|
|
|
SdExtPropertySetInfoCache gImplDrawPropertySetInfoCache;
|
|
|
|
SdTypesCache gImplTypesCache;
|
|
|
|
|
2016-10-20 20:26:24 +09:00
|
|
|
svtools::ColorConfig& GetColorConfig();
|
|
|
|
|
2017-10-25 15:53:56 +02:00
|
|
|
private:
|
2004-01-20 09:18:19 +00:00
|
|
|
|
|
|
|
SdOptions* pImpressOptions;
|
|
|
|
SdOptions* pDrawOptions;
|
2018-03-15 10:54:44 +02:00
|
|
|
std::unique_ptr<SvxSearchItem> pSearchItem;
|
|
|
|
std::unique_ptr<SvNumberFormatter> pNumberFormatter;
|
2015-05-06 16:33:19 +02:00
|
|
|
tools::SvRef<SotStorage> xOptionStorage;
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bWaterCan;
|
2018-03-15 10:54:44 +02:00
|
|
|
std::unique_ptr<SfxErrorHandler> mpErrorHdl;
|
2004-01-20 09:18:19 +00:00
|
|
|
/** This device is used for printer independent layout. It is virtual
|
|
|
|
in the sense that it does not represent a printer. The pointer may
|
|
|
|
be NULL when the virtual device could not be created.
|
|
|
|
*/
|
2015-05-06 21:15:38 +01:00
|
|
|
VclPtr< VirtualDevice > mpVirtualRefDevice;
|
2004-01-20 09:18:19 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
|
2004-01-20 09:18:19 +00:00
|
|
|
|
2017-08-03 10:23:01 +02:00
|
|
|
SfxFrame* ExecuteNewDocument( SfxRequest const & rReq );
|
2006-02-09 13:04:51 +00:00
|
|
|
|
2016-03-09 14:37:43 +02:00
|
|
|
static SfxFrame* CreateEmptyDocument( const css::uno::Reference< css::frame::XFrame >& i_rFrame );
|
2015-10-28 12:01:32 +02:00
|
|
|
static SfxFrame* CreateFromTemplate( const OUString& rTemplatePath, const css::uno::Reference< css::frame::XFrame >& i_rFrame );
|
2006-02-09 13:04:51 +00:00
|
|
|
|
2015-02-24 14:22:56 +01:00
|
|
|
bool mbEventListenerAdded;
|
|
|
|
|
2004-01-20 09:18:19 +00:00
|
|
|
/** Take an outline from a text document and create a new impress
|
|
|
|
document according to the structure of the outline.
|
|
|
|
@param rRequest
|
|
|
|
This typically is the unmodified request from a execute()
|
|
|
|
function from where this function is called.
|
|
|
|
*/
|
2017-08-03 10:23:01 +02:00
|
|
|
static bool OutlineToImpress(SfxRequest const & rRequest);
|
2009-01-20 15:57:31 +00:00
|
|
|
|
|
|
|
/** Add an eventlistener as soon as possible in sd, allows to use
|
|
|
|
remote devices to start the slideshow elegantly, and respecting
|
|
|
|
portability
|
|
|
|
@EventListenerHdl
|
|
|
|
The event listener handler
|
|
|
|
@VclSimpleEvent *
|
2015-07-02 18:24:20 +02:00
|
|
|
a pointer to a VCLSimpleEvent (see vcl/vclevent.hxx )
|
2009-01-20 15:57:31 +00:00
|
|
|
*/
|
2016-10-05 07:56:12 +02:00
|
|
|
DECL_STATIC_LINK( SdModule, EventListenerHdl, VclSimpleEvent&, void );
|
2009-01-20 15:57:31 +00:00
|
|
|
|
2016-10-20 20:26:24 +09:00
|
|
|
std::unique_ptr<svtools::ColorConfig> mpColorConfig;
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
2016-07-04 17:30:42 +01:00
|
|
|
#define SD_MOD() ( static_cast<SdModule*>(SfxApplication::GetModule(SfxToolsModule::Draw)) )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-10-23 22:38:46 +02:00
|
|
|
#endif // INCLUDED_SD_INC_SDMOD_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2010-10-27 12:53:26 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|