/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * 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 . */ #ifndef INCLUDED_CUI_SOURCE_INC_NUMPAGES_HXX #define INCLUDED_CUI_SOURCE_INC_NUMPAGES_HXX #include #include #include #include #include #include #include #include #include #include #include #include #include class SvxColorListBox; class SvxNumRule; class SvxBmpNumValueSet; class SvxNumValueSet; class SvxBrushItem; class ValueSet; class SvxNumberingPreview : public vcl::Window { const SvxNumRule* pActNum; vcl::Font aStdFont; long nPageWidth; bool bPosition; sal_uInt16 nActLevel; protected: virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) override; public: SvxNumberingPreview(vcl::Window* pParent, WinBits nWinBits = WB_BORDER); void SetNumRule(const SvxNumRule* pNum) {pActNum = pNum; Invalidate();}; void SetPositionMode() { bPosition = true;} void SetLevel(sal_uInt16 nSet) {nActLevel = nSet;} }; struct SvxNumSettings_Impl { short nNumberType; short nParentNumbering; OUString sPrefix; OUString sSuffix; OUString sBulletChar; OUString sBulletFont; SvxNumSettings_Impl() : nNumberType(0), nParentNumbering(0) {} }; typedef std::vector > SvxNumSettingsArr_Impl; class SvxSingleNumPickTabPage : public SfxTabPage { using TabPage::ActivatePage; using TabPage::DeactivatePage; VclPtr m_pExamplesVS; SvxNumSettingsArr_Impl aNumSettingsArr; SvxNumRule* pActNum; SvxNumRule* pSaveNum; sal_uInt16 nActNumLvl; bool bModified : 1; bool bPreset : 1; OUString sNumCharFmtName; sal_uInt16 nNumItemId; protected: DECL_LINK(NumSelectHdl_Impl, ValueSet*, void); DECL_LINK(DoubleClickHdl_Impl, ValueSet*, void); public: SvxSingleNumPickTabPage(vcl::Window* pParent, const SfxItemSet& rSet); virtual ~SvxSingleNumPickTabPage() override; virtual void dispose() override; static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rAttrSet); virtual void ActivatePage(const SfxItemSet& rSet) override; virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override; virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; }; class SvxBulletPickTabPage : public SfxTabPage { using TabPage::ActivatePage; using TabPage::DeactivatePage; VclPtr m_pExamplesVS; SvxNumRule* pActNum; SvxNumRule* pSaveNum; sal_uInt16 nActNumLvl; bool bModified : 1; bool bPreset : 1; sal_uInt16 nNumItemId; OUString sBulletCharFormatName; protected: DECL_LINK(NumSelectHdl_Impl, ValueSet*, void); DECL_LINK(DoubleClickHdl_Impl, ValueSet*, void); public: SvxBulletPickTabPage(vcl::Window* pParent, const SfxItemSet& rSet); virtual ~SvxBulletPickTabPage() override; virtual void dispose() override; static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rAttrSet); virtual void ActivatePage(const SfxItemSet& rSet) override; virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override; virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; virtual void PageCreated(const SfxAllItemSet& aSet) override; }; #define NUM_VALUSET_COUNT 16 /// TabPage for complete numeration class SvxNumPickTabPage : public SfxTabPage { using TabPage::ActivatePage; using TabPage::DeactivatePage; VclPtr m_pExamplesVS; OUString sNumCharFmtName; OUString sBulletCharFormatName; SvxNumSettingsArr_Impl aNumSettingsArrays[NUM_VALUSET_COUNT]; // is initialized with the five formats SvxNumRule* pActNum; SvxNumRule* pSaveNum; sal_uInt16 nActNumLvl; sal_uInt16 nNumItemId; bool bModified : 1; bool bPreset : 1; protected: DECL_LINK(NumSelectHdl_Impl, ValueSet*, void); DECL_LINK(DoubleClickHdl_Impl, ValueSet*, void); public: SvxNumPickTabPage(vcl::Window* pParent, const SfxItemSet& rSet); virtual ~SvxNumPickTabPage() override; virtual void dispose() override; static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rAttrSet); virtual void ActivatePage(const SfxItemSet& rSet) override; virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override; virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; void SetCharFormatNames(const OUString& rCharName, const OUString& rBulName) { sNumCharFmtName = rCharName; sBulletCharFormatName = rBulName;} virtual void PageCreated(const SfxAllItemSet& aSet) override; }; class SvxBitmapPickTabPage : public SfxTabPage { using TabPage::ActivatePage; using TabPage::DeactivatePage; VclPtr m_pErrorText; VclPtr m_pExamplesVS; VclPtr