/* -*- 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_SVX_RUBYDIALOG_HXX #define INCLUDED_SVX_RUBYDIALOG_HXX #include #include #include #include #include #include #include #include #include #include namespace com{namespace sun{namespace star{ namespace view{ class XSelectionChangeListener; } }}} class SvxRubyDialog; class RubyPreview : public vcl::Window { protected: virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) override; VclPtr m_pParentDlg; public: RubyPreview(vcl::Window *pParent); virtual ~RubyPreview(); virtual void dispose() override; void setRubyDialog(SvxRubyDialog* pParentDlg) { m_pParentDlg = pParentDlg; } virtual Size GetOptimalSize() const override; }; class SVX_DLLPUBLIC SvxRubyChildWindow : public SfxChildWindow { public: SvxRubyChildWindow( vcl::Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* ); SFX_DECL_CHILDWINDOW( SvxRubyChildWindow ); }; class SvxRubyData_Impl; class RubyEdit : public Edit { Link aScrollHdl; Link aJumpHdl; virtual void GetFocus() override; virtual bool PreNotify( NotifyEvent& rNEvt ) override; public: RubyEdit(vcl::Window* pParent, const ResId& rResId) : Edit(pParent, rResId) { } RubyEdit(vcl::Window* pParent) : Edit(pParent, WB_BORDER) { } void SetScrollHdl(Link& rLink) {aScrollHdl = rLink;} void SetJumpHdl(Link& rLink) {aJumpHdl = rLink;} }; class SvxRubyDialog : public SfxModelessDialog { friend class RubyPreview; VclPtr m_pLeftFT; VclPtr m_pRightFT; VclPtr m_pLeft1ED; VclPtr m_pRight1ED; VclPtr m_pLeft2ED; VclPtr m_pRight2ED; VclPtr m_pLeft3ED; VclPtr m_pRight3ED; VclPtr m_pLeft4ED; VclPtr m_pRight4ED; VclPtr aEditArr[8]; VclPtr m_pScrolledWindow; VclPtr m_pScrollSB; VclPtr m_pAdjustLB; VclPtr m_pPositionLB; VclPtr m_pCharStyleFT; VclPtr m_pCharStyleLB; VclPtr m_pStylistPB; VclPtr m_pPreviewWin; VclPtr m_pApplyPB; VclPtr m_pClosePB; long nLastPos; long nCurrentEdit; bool bModified; css::uno::Reference xImpl; SfxBindings* pBindings; SvxRubyData_Impl* pImpl; DECL_LINK_TYPED(ApplyHdl_Impl, Button*, void); DECL_LINK_TYPED(CloseHdl_Impl, Button*, void); DECL_LINK_TYPED(StylistHdl_Impl, Button*, void); DECL_LINK_TYPED(ScrollHdl_Impl, ScrollBar*, void); DECL_LINK_TYPED(PositionHdl_Impl, ListBox&, void); DECL_LINK_TYPED(AdjustHdl_Impl, ListBox&, void); DECL_LINK_TYPED(CharStyleHdl_Impl, ListBox&, void); DECL_LINK_TYPED(EditModifyHdl_Impl, Edit&, void); DECL_LINK_TYPED(EditScrollHdl_Impl, sal_Int32, bool); DECL_LINK_TYPED(EditJumpHdl_Impl, sal_Int32, void); void SetRubyText(sal_Int32 nPos, Edit& rLeft, Edit& rRight); void GetRubyText(); void ClearCharStyleList(); void AssertOneEntry(); void Update(); virtual bool Close() override; long GetLastPos() const {return nLastPos;} void SetLastPos(long nSet) {nLastPos = nSet;} bool IsModified() const {return bModified;} void SetModified(bool bSet) {bModified = bSet;} void EnableControls(bool bEnable); void GetCurrentText(OUString& rBase, OUString& rRuby); void UpdateColors(); protected: virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; public: SvxRubyDialog(SfxBindings *pBindings, SfxChildWindow *pCW, vcl::Window* pParent); virtual ~SvxRubyDialog(); virtual void dispose() override; virtual void Activate() override; virtual void Deactivate() override; }; #endif // INCLUDED_SVX_RUBYDIALOG_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */