Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #ifndef _SVX_RUBYDLG_HXX_
31 : : #define _SVX_RUBYDLG_HXX_
32 : :
33 : : #include <sfx2/childwin.hxx>
34 : : #include <sfx2/basedlgs.hxx>
35 : : #include <vcl/lstbox.hxx>
36 : : #include <vcl/fixed.hxx>
37 : : #include <vcl/button.hxx>
38 : : #include <vcl/edit.hxx>
39 : : #include <vcl/scrbar.hxx>
40 : : #include <com/sun/star/uno/Reference.h>
41 : : #include "svx/svxdllapi.h"
42 : :
43 : : namespace com{namespace sun{namespace star{
44 : : namespace view{
45 : : class XSelectionChangeListener;
46 : : }
47 : : }}}
48 : :
49 : :
50 : : class SvxRubyDialog;
51 [ # # ]: 0 : class RubyPreview : public Window
52 : : {
53 : : protected:
54 : : virtual void Paint( const Rectangle& rRect );
55 : : SvxRubyDialog& rParentDlg;
56 : :
57 : : public:
58 : : RubyPreview(SvxRubyDialog& rParent, const ResId& rResId);
59 : : };
60 : :
61 [ # # ]: 0 : class SVX_DLLPUBLIC SvxRubyChildWindow : public SfxChildWindow
62 : : {
63 : : public:
64 : :
65 : : SvxRubyChildWindow( Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* );
66 : :
67 : : SFX_DECL_CHILDWINDOW( SvxRubyChildWindow );
68 : :
69 : : };
70 : : class SvxRubyData_Impl;
71 [ # # ]: 0 : class RubyEdit : public Edit
72 : : {
73 : : Link aScrollHdl;
74 : : Link aJumpHdl;
75 : : virtual void GetFocus();
76 : : virtual long PreNotify( NotifyEvent& rNEvt );
77 : : public:
78 : 0 : RubyEdit(Window* pParent, const ResId& rResId) :
79 [ # # ][ # # ]: 0 : Edit(pParent, rResId){}
80 : 0 : void SetScrollHdl(Link& rLink) {aScrollHdl = rLink;}
81 : 0 : void SetJumpHdl(Link& rLink) {aJumpHdl = rLink;}
82 : : };
83 : :
84 : :
85 : : class SvxRubyDialog : public SfxModelessDialog
86 : : {
87 : : using Window::SetText;
88 : : using Window::GetText;
89 : :
90 : : friend class RubyPreview;
91 : :
92 : : FixedText aLeftFT;
93 : : RubyEdit aLeft1ED;
94 : : FixedText aRightFT;
95 : : RubyEdit aRight1ED;
96 : : RubyEdit aLeft2ED;
97 : : RubyEdit aRight2ED;
98 : : RubyEdit aLeft3ED;
99 : : RubyEdit aRight3ED;
100 : : RubyEdit aLeft4ED;
101 : : RubyEdit aRight4ED;
102 : :
103 : : RubyEdit* aEditArr[8];
104 : : ScrollBar aScrollSB;
105 : :
106 : : CheckBox aAutoDetectionCB;
107 : :
108 : : FixedText aAdjustFT;
109 : : ListBox aAdjustLB;
110 : :
111 : : FixedText aPositionFT;
112 : : ListBox aPositionLB;
113 : :
114 : : FixedText aCharStyleFT;
115 : : ListBox aCharStyleLB;
116 : : PushButton aStylistPB;
117 : :
118 : : FixedText aPreviewFT;
119 : : RubyPreview aPreviewWin;
120 : :
121 : : OKButton aApplyPB;
122 : : PushButton aClosePB;
123 : : HelpButton aHelpPB;
124 : :
125 : : long nLastPos;
126 : : long nCurrentEdit;
127 : :
128 : : sal_Bool bModified;
129 : :
130 : : com::sun::star::uno::Reference<com::sun::star::view::XSelectionChangeListener> xImpl;
131 : : SfxBindings* pBindings;
132 : : SvxRubyData_Impl* pImpl;
133 : :
134 : : DECL_LINK(ApplyHdl_Impl, void *);
135 : : DECL_LINK(CloseHdl_Impl, void *);
136 : : DECL_LINK(StylistHdl_Impl, void *);
137 : : DECL_LINK(AutomaticHdl_Impl, CheckBox*);
138 : : DECL_LINK(ScrollHdl_Impl, ScrollBar*);
139 : : DECL_LINK(PositionHdl_Impl, ListBox*);
140 : : DECL_LINK(AdjustHdl_Impl, ListBox*);
141 : : DECL_LINK(CharStyleHdl_Impl, void *);
142 : : DECL_LINK(EditModifyHdl_Impl, Edit*);
143 : : DECL_LINK(EditScrollHdl_Impl, sal_Int32*);
144 : : DECL_LINK(EditJumpHdl_Impl, sal_Int32*);
145 : :
146 : : void SetText(sal_Int32 nPos, Edit& rLeft, Edit& rRight);
147 : : void GetText();
148 : : void ClearCharStyleList();
149 : : void AssertOneEntry();
150 : :
151 : : void Update();
152 : : virtual sal_Bool Close();
153 : :
154 : 0 : long GetLastPos() const {return nLastPos;}
155 : 0 : void SetLastPos(long nSet) {nLastPos = nSet;}
156 : :
157 : 0 : sal_Bool IsModified() const {return bModified;}
158 : 0 : void SetModified(sal_Bool bSet) {bModified = bSet;}
159 : :
160 : 0 : void EnableControls(sal_Bool bEnable)
161 : : {
162 : 0 : aLeftFT.Enable(bEnable);
163 : 0 : aRightFT.Enable(bEnable);
164 : 0 : aLeft1ED.Enable(bEnable);
165 : 0 : aRight1ED.Enable(bEnable);
166 : 0 : aLeft2ED.Enable(bEnable);
167 : 0 : aRight2ED.Enable(bEnable);
168 : 0 : aLeft3ED.Enable(bEnable);
169 : 0 : aRight3ED.Enable(bEnable);
170 : 0 : aLeft4ED.Enable(bEnable);
171 : 0 : aRight4ED.Enable(bEnable);
172 : 0 : aScrollSB.Enable(bEnable);
173 : 0 : aAutoDetectionCB.Enable(bEnable);
174 : 0 : aAdjustFT.Enable(bEnable);
175 : 0 : aAdjustLB.Enable(bEnable);
176 : 0 : aCharStyleFT.Enable(bEnable);
177 : 0 : aCharStyleLB.Enable(bEnable);
178 : 0 : aStylistPB.Enable(bEnable);
179 : 0 : aPreviewFT.Enable(bEnable);
180 : 0 : aPreviewWin.Enable(bEnable);
181 : 0 : aApplyPB.Enable(bEnable);
182 : 0 : }
183 : :
184 : : void GetCurrentText(String& rBase, String& rRuby);
185 : :
186 : : void UpdateColors( void );
187 : : protected:
188 : : virtual void DataChanged( const DataChangedEvent& rDCEvt );
189 : : public:
190 : :
191 : : SvxRubyDialog( SfxBindings *pBindings, SfxChildWindow *pCW,
192 : : Window* pParent, const ResId& rResId );
193 : : virtual ~SvxRubyDialog();
194 : :
195 : : virtual void Activate();
196 : : virtual void Deactivate();
197 : : };
198 : :
199 : : #endif // _SVX_RUBYDLG_HXX_
200 : :
201 : :
202 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|