2010-10-27 12:45:03 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-21 22:06:52 +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 .
|
|
|
|
*/
|
2013-11-05 02:31:05 +01:00
|
|
|
#ifndef INCLUDED_FORMS_SOURCE_RICHTEXT_RICHTEXTENGINE_HXX
|
|
|
|
#define INCLUDED_FORMS_SOURCE_RICHTEXT_RICHTEXTENGINE_HXX
|
2004-05-07 15:12:54 +00:00
|
|
|
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/editeng.hxx>
|
2004-05-07 15:12:54 +00:00
|
|
|
#include <tools/link.hxx>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class SfxItemPool;
|
|
|
|
class EditStatus;
|
2014-02-25 18:50:02 +01:00
|
|
|
|
2004-05-07 15:12:54 +00:00
|
|
|
namespace frm
|
|
|
|
{
|
|
|
|
|
|
|
|
class IEngineStatusListener
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void EditEngineStatusChanged( const EditStatus& _rStatus ) = 0;
|
2012-03-14 13:27:56 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
~IEngineStatusListener() {}
|
2004-05-07 15:12:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class RichTextEngine : public EditEngine
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
SfxItemPool* m_pEnginePool;
|
|
|
|
::std::vector< IEngineStatusListener* > m_aStatusListeners;
|
|
|
|
|
|
|
|
public:
|
|
|
|
static RichTextEngine* Create();
|
|
|
|
RichTextEngine* Clone();
|
|
|
|
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~RichTextEngine( ) override;
|
2004-05-07 15:12:54 +00:00
|
|
|
|
|
|
|
// for multiplexing the StatusChanged events of the edit engine
|
|
|
|
void registerEngineStatusListener( IEngineStatusListener* _pListener );
|
|
|
|
void revokeEngineStatusListener( IEngineStatusListener* _pListener );
|
|
|
|
|
2017-03-03 20:57:02 +01:00
|
|
|
SfxItemPool* getPool() { return m_pEnginePool; }
|
2007-07-06 08:56:32 +00:00
|
|
|
|
2004-05-07 15:12:54 +00:00
|
|
|
protected:
|
|
|
|
/** constructs a new RichTextEngine. The instances takes the ownership of the given SfxItemPool
|
|
|
|
*/
|
2015-10-07 14:36:11 +01:00
|
|
|
explicit RichTextEngine( SfxItemPool* _pPool );
|
2004-05-07 15:12:54 +00:00
|
|
|
|
|
|
|
private:
|
2015-10-12 15:25:41 +02:00
|
|
|
RichTextEngine( const RichTextEngine& ) = delete;
|
|
|
|
RichTextEngine& operator=( const RichTextEngine& ) = delete;
|
2004-05-07 15:12:54 +00:00
|
|
|
|
|
|
|
private:
|
2016-10-05 07:56:12 +02:00
|
|
|
DECL_LINK( EditEngineStatusChanged, EditStatus&, void );
|
2004-05-07 15:12:54 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 18:50:02 +01:00
|
|
|
|
2004-05-07 15:12:54 +00:00
|
|
|
} // namespace frm
|
2014-02-25 18:50:02 +01:00
|
|
|
|
2004-05-07 15:12:54 +00:00
|
|
|
|
2013-11-05 02:31:05 +01:00
|
|
|
#endif // INCLUDED_FORMS_SOURCE_RICHTEXT_RICHTEXTENGINE_HXX
|
2004-05-07 15:12:54 +00:00
|
|
|
|
2010-10-27 12:45:03 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|