fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / svx / rubydialog.hxx
blobf1538a32c3ec7d92977c03c4e4d0120f141f2aca
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #ifndef _SVX_RUBYDLG_HXX_
22 #define _SVX_RUBYDLG_HXX_
24 #include <sfx2/childwin.hxx>
25 #include <sfx2/basedlgs.hxx>
26 #include <vcl/layout.hxx>
27 #include <vcl/lstbox.hxx>
28 #include <vcl/fixed.hxx>
29 #include <vcl/button.hxx>
30 #include <vcl/edit.hxx>
31 #include <vcl/scrbar.hxx>
32 #include <com/sun/star/uno/Reference.h>
33 #include "svx/svxdllapi.h"
35 namespace com{namespace sun{namespace star{
36 namespace view{
37 class XSelectionChangeListener;
39 }}}
42 class SvxRubyDialog;
43 class RubyPreview : public Window
45 protected:
46 virtual void Paint( const Rectangle& rRect );
47 SvxRubyDialog* m_pParentDlg;
49 public:
50 RubyPreview(Window *pParent);
51 void setRubyDialog(SvxRubyDialog* pParentDlg)
53 m_pParentDlg = pParentDlg;
55 virtual Size GetOptimalSize() const;
58 class SVX_DLLPUBLIC SvxRubyChildWindow : public SfxChildWindow
60 public:
62 SvxRubyChildWindow( Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* );
64 SFX_DECL_CHILDWINDOW( SvxRubyChildWindow );
67 class SvxRubyData_Impl;
68 class RubyEdit : public Edit
70 Link aScrollHdl;
71 Link aJumpHdl;
72 virtual void GetFocus();
73 virtual long PreNotify( NotifyEvent& rNEvt );
74 public:
75 RubyEdit(Window* pParent, const ResId& rResId)
76 : Edit(pParent, rResId)
79 RubyEdit(Window* pParent)
80 : Edit(pParent, WB_BORDER)
83 void SetScrollHdl(Link& rLink) {aScrollHdl = rLink;}
84 void SetJumpHdl(Link& rLink) {aJumpHdl = rLink;}
88 class SvxRubyDialog : public SfxModelessDialog
90 using Window::SetText;
91 using Window::GetText;
93 friend class RubyPreview;
95 FixedText* m_pLeftFT;
96 FixedText* m_pRightFT;
97 RubyEdit* m_pLeft1ED;
98 RubyEdit* m_pRight1ED;
99 RubyEdit* m_pLeft2ED;
100 RubyEdit* m_pRight2ED;
101 RubyEdit* m_pLeft3ED;
102 RubyEdit* m_pRight3ED;
103 RubyEdit* m_pLeft4ED;
104 RubyEdit* m_pRight4ED;
106 RubyEdit* aEditArr[8];
107 VclScrolledWindow* m_pScrolledWindow;
108 ScrollBar* m_pScrollSB;
110 ListBox* m_pAdjustLB;
112 ListBox* m_pPositionLB;
114 FixedText* m_pCharStyleFT;
115 ListBox* m_pCharStyleLB;
116 PushButton* m_pStylistPB;
118 RubyPreview* m_pPreviewWin;
120 PushButton* m_pApplyPB;
121 PushButton* m_pClosePB;
123 long nLastPos;
124 long nCurrentEdit;
126 sal_Bool bModified;
128 com::sun::star::uno::Reference<com::sun::star::view::XSelectionChangeListener> xImpl;
129 SfxBindings* pBindings;
130 SvxRubyData_Impl* pImpl;
132 DECL_LINK(ApplyHdl_Impl, void *);
133 DECL_LINK(CloseHdl_Impl, void *);
134 DECL_LINK(StylistHdl_Impl, void *);
135 DECL_LINK(ScrollHdl_Impl, ScrollBar*);
136 DECL_LINK(PositionHdl_Impl, ListBox*);
137 DECL_LINK(AdjustHdl_Impl, ListBox*);
138 DECL_LINK(CharStyleHdl_Impl, void *);
139 DECL_LINK(EditModifyHdl_Impl, Edit*);
140 DECL_LINK(EditScrollHdl_Impl, sal_Int32*);
141 DECL_LINK(EditJumpHdl_Impl, sal_Int32*);
143 void SetText(sal_Int32 nPos, Edit& rLeft, Edit& rRight);
144 void GetText();
145 void ClearCharStyleList();
146 void AssertOneEntry();
148 void Update();
149 virtual sal_Bool Close();
151 long GetLastPos() const {return nLastPos;}
152 void SetLastPos(long nSet) {nLastPos = nSet;}
154 sal_Bool IsModified() const {return bModified;}
155 void SetModified(sal_Bool bSet) {bModified = bSet;}
157 void EnableControls(bool bEnable);
159 void GetCurrentText(String& rBase, String& rRuby);
161 void UpdateColors( void );
162 protected:
163 virtual void DataChanged( const DataChangedEvent& rDCEvt );
164 public:
166 SvxRubyDialog(SfxBindings *pBindings, SfxChildWindow *pCW,
167 Window* pParent);
168 virtual ~SvxRubyDialog();
170 virtual void Activate();
171 virtual void Deactivate();
174 #endif // _SVX_RUBYDLG_HXX_
177 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */