summaryrefslogtreecommitdiff
path: root/include/svx/fntctrl.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'include/svx/fntctrl.hxx')
-rw-r--r--include/svx/fntctrl.hxx58
1 files changed, 58 insertions, 0 deletions
diff --git a/include/svx/fntctrl.hxx b/include/svx/fntctrl.hxx
index ed0828e8cc3b..c65b7e3d92e6 100644
--- a/include/svx/fntctrl.hxx
+++ b/include/svx/fntctrl.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_SVX_FNTCTRL_HXX
#include <memory>
+#include <vcl/customweld.hxx>
#include <vcl/window.hxx>
#include <editeng/svxfont.hxx>
#include <svx/svxdllapi.h>
@@ -88,6 +89,63 @@ public:
virtual Size GetOptimalSize() const override;
};
+class SAL_WARN_UNUSED SVX_DLLPUBLIC FontPrevWindow : public weld::CustomWidgetController
+{
+private:
+ std::unique_ptr<FontPrevWin_Impl> pImpl;
+ OUString maText;
+ bool mbResetForeground : 1;
+ bool mbResetBackground : 1;
+
+ SVX_DLLPRIVATE void ResetSettings(bool bForeground, bool bBackground);
+ SVX_DLLPRIVATE void ApplySettings(vcl::RenderContext& rRenderContext);
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
+ SVX_DLLPRIVATE static void SetFontSize(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont);
+ SVX_DLLPRIVATE static void SetFontLang(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont);
+
+public:
+ FontPrevWindow();
+ virtual ~FontPrevWindow() override;
+
+ virtual void StyleUpdated() override;
+
+ void Init( const SfxItemSet& rSet );
+
+ // for reasons of efficiency not const
+ SvxFont& GetFont();
+ const SvxFont& GetFont() const;
+ void SetFont( const SvxFont& rNormalFont, const SvxFont& rCJKFont, const SvxFont& rCTLFont );
+ SvxFont& GetCJKFont();
+ SvxFont& GetCTLFont();
+ void SetColor( const Color& rColor );
+ void ResetColor();
+ void SetBackColor( const Color& rColor );
+ void UseResourceText();
+ const OUString& GetText() const { return maText; }
+ void SetText(const OUString& rText) { maText = rText; }
+ void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& ) override;
+
+ bool IsTwoLines() const;
+ void SetTwoLines(bool bSet);
+
+ void SetBrackets(sal_Unicode cStart, sal_Unicode cEnd);
+
+ void SetFontWidthScale( sal_uInt16 nScaleInPercent );
+
+ void AutoCorrectFontColor();
+
+ void SetPreviewText( const OUString& rString );
+ void SetFontNameAsPreviewText();
+
+ static void SetFont( const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont );
+ static void SetFontStyle( const SfxItemSet& rSet, sal_uInt16 nSlotPosture, sal_uInt16 nSlotWeight, SvxFont& rFont ); // posture/weight
+ void SetFontWidthScale( const SfxItemSet& rSet );
+ void SetFontEscapement( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc );
+
+ void SetFromItemSet( const SfxItemSet &rSet,
+ bool bPreviewBackgroundToCharacter );
+};
+
#endif // INCLUDED_SVX_FNTCTRL_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */