xref: /trunk/main/starmath/inc/dialog.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef DIALOG_HXX
28*cdf0e10cSrcweir #define DIALOG_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include <vcl/image.hxx>
31*cdf0e10cSrcweir #include <vcl/dialog.hxx>
32*cdf0e10cSrcweir #include <vcl/fixed.hxx>
33*cdf0e10cSrcweir #include <vcl/button.hxx>
34*cdf0e10cSrcweir #include <vcl/image.hxx>
35*cdf0e10cSrcweir #include <sfx2/tabdlg.hxx>
36*cdf0e10cSrcweir #include <vcl/combobox.hxx>
37*cdf0e10cSrcweir #include <svx/charmap.hxx>
38*cdf0e10cSrcweir #include <sfx2/basedlgs.hxx>
39*cdf0e10cSrcweir #include <vcl/field.hxx>
40*cdf0e10cSrcweir #include <vcl/menubtn.hxx>
41*cdf0e10cSrcweir #include <vcl/scrbar.hxx>
42*cdf0e10cSrcweir #include <vcl/ctrl.hxx>
43*cdf0e10cSrcweir #include <vcl/menu.hxx>
44*cdf0e10cSrcweir #include <vcl/outdev.hxx>
45*cdf0e10cSrcweir #include <svtools/ctrlbox.hxx>
46*cdf0e10cSrcweir #include <svtools/ctrltool.hxx>
47*cdf0e10cSrcweir #include "utility.hxx"
48*cdf0e10cSrcweir #include "format.hxx"
49*cdf0e10cSrcweir #include "symbol.hxx"
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir class SubsetMap;
52*cdf0e10cSrcweir #define CATEGORY_NONE   0xFFFF
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir /**************************************************************************/
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir const XubString GetFontStyleName(const Font &rFont);
57*cdf0e10cSrcweir void            SetFontStyle(const XubString &rStyleName, Font &rFont);
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir /**************************************************************************/
60*cdf0e10cSrcweir 
61*cdf0e10cSrcweir class SmPrintOptionsTabPage : public SfxTabPage
62*cdf0e10cSrcweir {
63*cdf0e10cSrcweir     FixedLine       aFixedLine1;
64*cdf0e10cSrcweir     CheckBox        aTitle;
65*cdf0e10cSrcweir     CheckBox        aText;
66*cdf0e10cSrcweir     CheckBox        aFrame;
67*cdf0e10cSrcweir     FixedLine       aFixedLine2;
68*cdf0e10cSrcweir     RadioButton     aSizeNormal;
69*cdf0e10cSrcweir     RadioButton     aSizeScaled;
70*cdf0e10cSrcweir     RadioButton     aSizeZoomed;
71*cdf0e10cSrcweir     MetricField     aZoom;
72*cdf0e10cSrcweir     FixedLine       aFixedLine3;
73*cdf0e10cSrcweir     CheckBox        aNoRightSpaces;
74*cdf0e10cSrcweir     CheckBox        aSaveOnlyUsedSymbols;
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir     DECL_LINK(SizeButtonClickHdl, Button *);
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir     virtual sal_Bool    FillItemSet(SfxItemSet& rSet);
79*cdf0e10cSrcweir     virtual void    Reset(const SfxItemSet& rSet);
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir public:
82*cdf0e10cSrcweir     static SfxTabPage* Create(Window *pWindow, const SfxItemSet &rSet);
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir     SmPrintOptionsTabPage(Window *pParent, const SfxItemSet &rOptions);
85*cdf0e10cSrcweir };
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir /**************************************************************************/
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir class SmShowFont : public Control
90*cdf0e10cSrcweir {
91*cdf0e10cSrcweir     virtual void    Paint(const Rectangle&);
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir public:
94*cdf0e10cSrcweir     SmShowFont(Window *pParent, const ResId& rResId) :
95*cdf0e10cSrcweir         Control(pParent, rResId)
96*cdf0e10cSrcweir     {
97*cdf0e10cSrcweir     }
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir     void SetFont(const Font& rFont);
100*cdf0e10cSrcweir };
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir class SmFontDialog : public ModalDialog
103*cdf0e10cSrcweir {
104*cdf0e10cSrcweir     FixedText       aFixedText1;
105*cdf0e10cSrcweir     ComboBox        aFontBox;
106*cdf0e10cSrcweir     CheckBox        aBoldCheckBox;
107*cdf0e10cSrcweir     CheckBox        aItalicCheckBox;
108*cdf0e10cSrcweir     OKButton        aOKButton1;
109*cdf0e10cSrcweir     CancelButton    aCancelButton1;
110*cdf0e10cSrcweir     SmShowFont      aShowFont;
111*cdf0e10cSrcweir     FixedText       aFixedText2;
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir     Font    Face;
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir     DECL_LINK(FontSelectHdl, ComboBox *);
116*cdf0e10cSrcweir     DECL_LINK(FontModifyHdl, ComboBox *);
117*cdf0e10cSrcweir     DECL_LINK(AttrChangeHdl, CheckBox *);
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir     void            InitColor_Impl();
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir public:
124*cdf0e10cSrcweir     SmFontDialog(Window * pParent, OutputDevice *pFntListDevice, sal_Bool bHideCheckboxes, sal_Bool bFreeRes = sal_True);
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir     const Font& GetFont() const { return Face; }
127*cdf0e10cSrcweir     void        SetFont(const Font &rFont);
128*cdf0e10cSrcweir };
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir /**************************************************************************/
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir class SmFontSizeDialog : public ModalDialog
133*cdf0e10cSrcweir {
134*cdf0e10cSrcweir     FixedText       aFixedText1;
135*cdf0e10cSrcweir     MetricField     aBaseSize;
136*cdf0e10cSrcweir     FixedText       aFixedText4;
137*cdf0e10cSrcweir     MetricField     aTextSize;
138*cdf0e10cSrcweir     FixedText       aFixedText5;
139*cdf0e10cSrcweir     MetricField     aIndexSize;
140*cdf0e10cSrcweir     FixedText       aFixedText6;
141*cdf0e10cSrcweir     MetricField     aFunctionSize;
142*cdf0e10cSrcweir     FixedText       aFixedText7;
143*cdf0e10cSrcweir     MetricField     aOperatorSize;
144*cdf0e10cSrcweir     FixedText       aFixedText8;
145*cdf0e10cSrcweir     MetricField     aBorderSize;
146*cdf0e10cSrcweir     FixedLine       aFixedLine1;
147*cdf0e10cSrcweir     OKButton        aOKButton1;
148*cdf0e10cSrcweir     CancelButton    aCancelButton1;
149*cdf0e10cSrcweir     PushButton      aDefaultButton;
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir     DECL_LINK(DefaultButtonClickHdl, Button *);
152*cdf0e10cSrcweir 
153*cdf0e10cSrcweir public:
154*cdf0e10cSrcweir     SmFontSizeDialog(Window *pParent, sal_Bool bFreeRes = sal_True);
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir     void ReadFrom(const SmFormat &rFormat);
157*cdf0e10cSrcweir     void WriteTo (SmFormat &rFormat) const;
158*cdf0e10cSrcweir };
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir /**************************************************************************/
161*cdf0e10cSrcweir 
162*cdf0e10cSrcweir class SmFontTypeDialog : public ModalDialog
163*cdf0e10cSrcweir {
164*cdf0e10cSrcweir     FixedText           aFixedText1;
165*cdf0e10cSrcweir     SmFontPickListBox   aVariableFont;
166*cdf0e10cSrcweir     FixedText           aFixedText2;
167*cdf0e10cSrcweir     SmFontPickListBox   aFunctionFont;
168*cdf0e10cSrcweir     FixedText           aFixedText3;
169*cdf0e10cSrcweir     SmFontPickListBox   aNumberFont;
170*cdf0e10cSrcweir     FixedText           aFixedText4;
171*cdf0e10cSrcweir     SmFontPickListBox   aTextFont;
172*cdf0e10cSrcweir     FixedText           aFixedText5;
173*cdf0e10cSrcweir     SmFontPickListBox   aSerifFont;
174*cdf0e10cSrcweir     FixedText           aFixedText6;
175*cdf0e10cSrcweir     SmFontPickListBox   aSansFont;
176*cdf0e10cSrcweir     FixedText           aFixedText7;
177*cdf0e10cSrcweir     SmFontPickListBox   aFixedFont;
178*cdf0e10cSrcweir     FixedLine           aFixedLine1;
179*cdf0e10cSrcweir     FixedLine           aFixedLine2;
180*cdf0e10cSrcweir     OKButton            aOKButton1;
181*cdf0e10cSrcweir     CancelButton        aCancelButton1;
182*cdf0e10cSrcweir     MenuButton          aMenuButton;
183*cdf0e10cSrcweir     PushButton          aDefaultButton;
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir     OutputDevice       *pFontListDev;
186*cdf0e10cSrcweir 
187*cdf0e10cSrcweir     DECL_LINK(MenuSelectHdl, Menu *);
188*cdf0e10cSrcweir     DECL_LINK(DefaultButtonClickHdl, Button *);
189*cdf0e10cSrcweir 
190*cdf0e10cSrcweir public:
191*cdf0e10cSrcweir     SmFontTypeDialog(Window *pParent, OutputDevice *pFntListDevice, sal_Bool bFreeRes = sal_True);
192*cdf0e10cSrcweir 
193*cdf0e10cSrcweir     void ReadFrom(const SmFormat &rFormat);
194*cdf0e10cSrcweir     void WriteTo (SmFormat &rFormat) const;
195*cdf0e10cSrcweir };
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir /**************************************************************************/
198*cdf0e10cSrcweir 
199*cdf0e10cSrcweir #define NOCATEGORIES    10
200*cdf0e10cSrcweir 
201*cdf0e10cSrcweir class SmCategoryDesc : public Resource
202*cdf0e10cSrcweir {
203*cdf0e10cSrcweir     XubString       Name;
204*cdf0e10cSrcweir     XubString      *Strings[4];
205*cdf0e10cSrcweir     Bitmap         *Graphics[4];    /* regular bitmaps */
206*cdf0e10cSrcweir     Bitmap         *GraphicsH[4];   /* high contrast bitmaps */
207*cdf0e10cSrcweir     sal_uInt16          Minimum[4];
208*cdf0e10cSrcweir     sal_uInt16          Maximum[4];
209*cdf0e10cSrcweir     sal_uInt16          Value[4];
210*cdf0e10cSrcweir     sal_Bool            bIsHighContrast;
211*cdf0e10cSrcweir 
212*cdf0e10cSrcweir public:
213*cdf0e10cSrcweir     SmCategoryDesc(const ResId &rResId, sal_uInt16 nCategoryIdx);
214*cdf0e10cSrcweir     ~SmCategoryDesc();
215*cdf0e10cSrcweir 
216*cdf0e10cSrcweir     const XubString &   GetName() const                 { return Name; }
217*cdf0e10cSrcweir     const XubString *   GetString(sal_uInt16 Index) const   { return Strings[Index];  }
218*cdf0e10cSrcweir     sal_uInt16          GetMinimum(sal_uInt16 Index)        { return Minimum[Index]; }
219*cdf0e10cSrcweir     sal_uInt16          GetMaximum(sal_uInt16 Index)        { return Maximum[Index]; }
220*cdf0e10cSrcweir     sal_uInt16          GetValue(sal_uInt16 Index) const    { return Value[Index]; }
221*cdf0e10cSrcweir     void            SetValue(sal_uInt16 Index, sal_uInt16 nVal) { Value[Index] = nVal;}
222*cdf0e10cSrcweir 
223*cdf0e10cSrcweir     void            SetHighContrast( sal_Bool bVal )    { bIsHighContrast = bVal; }
224*cdf0e10cSrcweir     const Bitmap *  GetGraphic(sal_uInt16 Index) const
225*cdf0e10cSrcweir     {
226*cdf0e10cSrcweir         return bIsHighContrast ? GraphicsH[Index] : Graphics[Index];
227*cdf0e10cSrcweir     }
228*cdf0e10cSrcweir };
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir 
231*cdf0e10cSrcweir class SmDistanceDialog : public ModalDialog
232*cdf0e10cSrcweir {
233*cdf0e10cSrcweir     FixedText       aFixedText1;
234*cdf0e10cSrcweir     MetricField     aMetricField1;
235*cdf0e10cSrcweir     FixedText       aFixedText2;
236*cdf0e10cSrcweir     MetricField     aMetricField2;
237*cdf0e10cSrcweir     FixedText       aFixedText3;
238*cdf0e10cSrcweir     MetricField     aMetricField3;
239*cdf0e10cSrcweir     CheckBox        aCheckBox1;
240*cdf0e10cSrcweir     FixedText       aFixedText4;
241*cdf0e10cSrcweir     MetricField     aMetricField4;
242*cdf0e10cSrcweir     OKButton        aOKButton1;
243*cdf0e10cSrcweir     CancelButton    aCancelButton1;
244*cdf0e10cSrcweir     MenuButton      aMenuButton;
245*cdf0e10cSrcweir     PushButton      aDefaultButton;
246*cdf0e10cSrcweir     FixedBitmap     aBitmap;
247*cdf0e10cSrcweir     FixedLine       aFixedLine;
248*cdf0e10cSrcweir 
249*cdf0e10cSrcweir     SmCategoryDesc *Categories[NOCATEGORIES];
250*cdf0e10cSrcweir     sal_uInt16          nActiveCategory;
251*cdf0e10cSrcweir     sal_Bool            bScaleAllBrackets;
252*cdf0e10cSrcweir 
253*cdf0e10cSrcweir     DECL_LINK(GetFocusHdl, Control *);
254*cdf0e10cSrcweir     DECL_LINK(MenuSelectHdl, Menu *);
255*cdf0e10cSrcweir     DECL_LINK(DefaultButtonClickHdl, Button *);
256*cdf0e10cSrcweir     DECL_LINK(CheckBoxClickHdl, CheckBox *);
257*cdf0e10cSrcweir 
258*cdf0e10cSrcweir     using   Window::SetHelpId;
259*cdf0e10cSrcweir     void    SetHelpId(MetricField &rField, const rtl::OString& sHelpId);
260*cdf0e10cSrcweir     void    SetCategory(sal_uInt16 Category);
261*cdf0e10cSrcweir 
262*cdf0e10cSrcweir     void    ApplyImages();
263*cdf0e10cSrcweir 
264*cdf0e10cSrcweir public:
265*cdf0e10cSrcweir     SmDistanceDialog(Window *pParent, sal_Bool bFreeRes = sal_True);
266*cdf0e10cSrcweir     ~SmDistanceDialog();
267*cdf0e10cSrcweir 
268*cdf0e10cSrcweir     void ReadFrom(const SmFormat &rFormat);
269*cdf0e10cSrcweir     void WriteTo (SmFormat &rFormat) /*const*/;
270*cdf0e10cSrcweir 
271*cdf0e10cSrcweir     // Window
272*cdf0e10cSrcweir     virtual void    DataChanged( const DataChangedEvent &rEvt );
273*cdf0e10cSrcweir };
274*cdf0e10cSrcweir 
275*cdf0e10cSrcweir 
276*cdf0e10cSrcweir /**************************************************************************/
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir 
279*cdf0e10cSrcweir class SmAlignDialog : public ModalDialog
280*cdf0e10cSrcweir {
281*cdf0e10cSrcweir     RadioButton  aLeft;
282*cdf0e10cSrcweir     RadioButton  aCenter;
283*cdf0e10cSrcweir     RadioButton  aRight;
284*cdf0e10cSrcweir     FixedLine    aFixedLine1;
285*cdf0e10cSrcweir     OKButton     aOKButton1;
286*cdf0e10cSrcweir     CancelButton aCancelButton1;
287*cdf0e10cSrcweir     PushButton   aDefaultButton;
288*cdf0e10cSrcweir 
289*cdf0e10cSrcweir     DECL_LINK(DefaultButtonClickHdl, Button *);
290*cdf0e10cSrcweir 
291*cdf0e10cSrcweir public:
292*cdf0e10cSrcweir     SmAlignDialog(Window *pParent, sal_Bool bFreeRes = sal_True);
293*cdf0e10cSrcweir 
294*cdf0e10cSrcweir     void ReadFrom(const SmFormat &rFormat);
295*cdf0e10cSrcweir     void WriteTo (SmFormat &rFormat) const;
296*cdf0e10cSrcweir };
297*cdf0e10cSrcweir 
298*cdf0e10cSrcweir /**************************************************************************/
299*cdf0e10cSrcweir 
300*cdf0e10cSrcweir class SmShowSymbolSet : public Control
301*cdf0e10cSrcweir {
302*cdf0e10cSrcweir     SymbolPtrVec_t aSymbolSet;
303*cdf0e10cSrcweir     ScrollBar   aVScrollBar;
304*cdf0e10cSrcweir     Size        aOutputSize;
305*cdf0e10cSrcweir     Link        aSelectHdlLink;
306*cdf0e10cSrcweir     Link        aDblClickHdlLink;
307*cdf0e10cSrcweir     sal_uInt16      nLen;
308*cdf0e10cSrcweir     sal_uInt16      nRows, nColumns;
309*cdf0e10cSrcweir     sal_uInt16      nSelectSymbol;
310*cdf0e10cSrcweir 
311*cdf0e10cSrcweir     virtual void    Paint(const Rectangle&);
312*cdf0e10cSrcweir     virtual void    MouseButtonDown(const MouseEvent& rMEvt);
313*cdf0e10cSrcweir     virtual void    KeyInput(const KeyEvent& rKEvt);
314*cdf0e10cSrcweir 
315*cdf0e10cSrcweir     DECL_LINK( ScrollHdl, ScrollBar* );
316*cdf0e10cSrcweir 
317*cdf0e10cSrcweir public:
318*cdf0e10cSrcweir     SmShowSymbolSet(Window *pParent, const ResId& rResId);
319*cdf0e10cSrcweir 
320*cdf0e10cSrcweir     void    SetSymbolSet(const SymbolPtrVec_t& rSymbolSet);
321*cdf0e10cSrcweir 
322*cdf0e10cSrcweir     void    SelectSymbol(sal_uInt16 nSymbol);
323*cdf0e10cSrcweir     sal_uInt16  GetSelectSymbol() const { return nSelectSymbol; }
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir     void SetSelectHdl(const Link& rLink)   { aSelectHdlLink = rLink; }
326*cdf0e10cSrcweir     void SetDblClickHdl(const Link& rLink) { aDblClickHdlLink = rLink; }
327*cdf0e10cSrcweir };
328*cdf0e10cSrcweir 
329*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////
330*cdf0e10cSrcweir 
331*cdf0e10cSrcweir class SmShowSymbol : public Control
332*cdf0e10cSrcweir {
333*cdf0e10cSrcweir     Link  aDblClickHdlLink;
334*cdf0e10cSrcweir 
335*cdf0e10cSrcweir     virtual void    Paint(const Rectangle&);
336*cdf0e10cSrcweir     virtual void    MouseButtonDown(const MouseEvent& rMEvt);
337*cdf0e10cSrcweir 
338*cdf0e10cSrcweir public:
339*cdf0e10cSrcweir     SmShowSymbol(Window *pParent, const ResId& rResId) :
340*cdf0e10cSrcweir         Control(pParent, rResId) {}
341*cdf0e10cSrcweir 
342*cdf0e10cSrcweir     void    SetSymbol(const SmSym *pSymbol);
343*cdf0e10cSrcweir     void    SetDblClickHdl(const Link &rLink) { aDblClickHdlLink = rLink; }
344*cdf0e10cSrcweir };
345*cdf0e10cSrcweir 
346*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////
347*cdf0e10cSrcweir 
348*cdf0e10cSrcweir class SmSymDefineDialog;
349*cdf0e10cSrcweir 
350*cdf0e10cSrcweir class SmSymbolDialog : public ModalDialog
351*cdf0e10cSrcweir {
352*cdf0e10cSrcweir     FixedText       aSymbolSetText;
353*cdf0e10cSrcweir     ListBox         aSymbolSets;
354*cdf0e10cSrcweir     SmShowSymbolSet aSymbolSetDisplay;
355*cdf0e10cSrcweir     FixedText       aSymbolName;
356*cdf0e10cSrcweir     SmShowSymbol    aSymbolDisplay;
357*cdf0e10cSrcweir     PushButton      aGetBtn;
358*cdf0e10cSrcweir     PushButton      aCloseBtn;
359*cdf0e10cSrcweir     PushButton      aEditBtn;
360*cdf0e10cSrcweir 
361*cdf0e10cSrcweir     SmViewShell        &rViewSh;
362*cdf0e10cSrcweir     SmSymbolManager    &rSymbolMgr;
363*cdf0e10cSrcweir 
364*cdf0e10cSrcweir     String              aSymbolSetName;
365*cdf0e10cSrcweir     SymbolPtrVec_t      aSymbolSet;
366*cdf0e10cSrcweir 
367*cdf0e10cSrcweir     OutputDevice       *pFontListDev;
368*cdf0e10cSrcweir 
369*cdf0e10cSrcweir     DECL_LINK(SymbolSetChangeHdl, ListBox *);
370*cdf0e10cSrcweir     DECL_LINK(SymbolChangeHdl, SmShowSymbolSet *);
371*cdf0e10cSrcweir     DECL_LINK(SymbolDblClickHdl, SmShowSymbolSet *);
372*cdf0e10cSrcweir     DECL_LINK(CloseClickHdl, Button *);
373*cdf0e10cSrcweir     DECL_LINK(EditClickHdl, Button *);
374*cdf0e10cSrcweir     DECL_LINK(GetClickHdl, Button *);
375*cdf0e10cSrcweir 
376*cdf0e10cSrcweir     void            FillSymbolSets(sal_Bool bDeleteText = sal_True);
377*cdf0e10cSrcweir     void            SetSymbolSetManager(SmSymbolManager &rMgr);
378*cdf0e10cSrcweir     const SmSym    *GetSymbol() const;
379*cdf0e10cSrcweir     void            InitColor_Impl();
380*cdf0e10cSrcweir 
381*cdf0e10cSrcweir     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
382*cdf0e10cSrcweir 
383*cdf0e10cSrcweir public:
384*cdf0e10cSrcweir     SmSymbolDialog(Window * pParent, OutputDevice *pFntListDevice,
385*cdf0e10cSrcweir             SmSymbolManager &rSymbolMgr, SmViewShell &rViewShell, sal_Bool bFreeRes = sal_True);
386*cdf0e10cSrcweir     virtual ~SmSymbolDialog();
387*cdf0e10cSrcweir 
388*cdf0e10cSrcweir     sal_Bool    SelectSymbolSet(const XubString &rSymbolSetName);
389*cdf0e10cSrcweir     void    SelectSymbol(sal_uInt16 nSymbolPos);
390*cdf0e10cSrcweir     sal_uInt16  GetSelectedSymbol() const   { return aSymbolSetDisplay.GetSelectSymbol(); }
391*cdf0e10cSrcweir };
392*cdf0e10cSrcweir 
393*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////
394*cdf0e10cSrcweir 
395*cdf0e10cSrcweir class SmShowChar : public Control
396*cdf0e10cSrcweir {
397*cdf0e10cSrcweir     virtual void    Paint(const Rectangle&);
398*cdf0e10cSrcweir 
399*cdf0e10cSrcweir public:
400*cdf0e10cSrcweir     SmShowChar(Window *pParent, const ResId& rResId)
401*cdf0e10cSrcweir     : Control(pParent, rResId)
402*cdf0e10cSrcweir     {
403*cdf0e10cSrcweir     }
404*cdf0e10cSrcweir 
405*cdf0e10cSrcweir     void    SetSymbol( const SmSym *pSym );
406*cdf0e10cSrcweir     void    SetSymbol( sal_UCS4 cChar, const Font &rFont );
407*cdf0e10cSrcweir };
408*cdf0e10cSrcweir 
409*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////
410*cdf0e10cSrcweir 
411*cdf0e10cSrcweir class SmSymDefineDialog : public ModalDialog
412*cdf0e10cSrcweir {
413*cdf0e10cSrcweir     FixedText       aOldSymbolText;
414*cdf0e10cSrcweir     ComboBox        aOldSymbols;
415*cdf0e10cSrcweir     FixedText       aOldSymbolSetText;
416*cdf0e10cSrcweir     ComboBox        aOldSymbolSets;
417*cdf0e10cSrcweir     SvxShowCharSet  aCharsetDisplay;
418*cdf0e10cSrcweir     FixedText       aSymbolText;
419*cdf0e10cSrcweir     ComboBox        aSymbols;
420*cdf0e10cSrcweir     FixedText       aSymbolSetText;
421*cdf0e10cSrcweir     ComboBox        aSymbolSets;
422*cdf0e10cSrcweir     FixedText       aFontText;
423*cdf0e10cSrcweir     ListBox         aFonts;
424*cdf0e10cSrcweir     FixedText       aFontsSubsetFT;
425*cdf0e10cSrcweir     ListBox         aFontsSubsetLB;
426*cdf0e10cSrcweir     FixedText       aStyleText;
427*cdf0e10cSrcweir     FontStyleBox    aStyles;
428*cdf0e10cSrcweir     FixedText       aOldSymbolName;
429*cdf0e10cSrcweir     SmShowChar      aOldSymbolDisplay;
430*cdf0e10cSrcweir     FixedText       aOldSymbolSetName;
431*cdf0e10cSrcweir     FixedText       aSymbolName;
432*cdf0e10cSrcweir     SmShowChar      aSymbolDisplay;
433*cdf0e10cSrcweir     FixedText       aSymbolSetName;
434*cdf0e10cSrcweir     OKButton        aOkBtn;
435*cdf0e10cSrcweir     CancelButton    aCancelBtn;
436*cdf0e10cSrcweir     PushButton      aAddBtn;
437*cdf0e10cSrcweir     PushButton      aChangeBtn;
438*cdf0e10cSrcweir     PushButton      aDeleteBtn;
439*cdf0e10cSrcweir     FixedImage      aRightArrow;
440*cdf0e10cSrcweir     Image           aRigthArrow_Im;
441*cdf0e10cSrcweir     Image           aRigthArrow_Im_HC;     // hi-contrast version
442*cdf0e10cSrcweir 
443*cdf0e10cSrcweir     SmSymbolManager     aSymbolMgrCopy,
444*cdf0e10cSrcweir                        &rSymbolMgr;
445*cdf0e10cSrcweir     const SmSym        *pOrigSymbol;
446*cdf0e10cSrcweir 
447*cdf0e10cSrcweir     const SubsetMap    *pSubsetMap;
448*cdf0e10cSrcweir     FontList           *pFontList;
449*cdf0e10cSrcweir 
450*cdf0e10cSrcweir     DECL_LINK(OldSymbolChangeHdl, ComboBox *);
451*cdf0e10cSrcweir     DECL_LINK(OldSymbolSetChangeHdl, ComboBox *);
452*cdf0e10cSrcweir     DECL_LINK(ModifyHdl, ComboBox *);
453*cdf0e10cSrcweir     DECL_LINK(FontChangeHdl, ListBox *);
454*cdf0e10cSrcweir     DECL_LINK(SubsetChangeHdl, ListBox*);
455*cdf0e10cSrcweir     DECL_LINK(StyleChangeHdl, ComboBox *);
456*cdf0e10cSrcweir     DECL_LINK(CharHighlightHdl, Control* pControl);
457*cdf0e10cSrcweir     DECL_LINK(AddClickHdl, Button *);
458*cdf0e10cSrcweir     DECL_LINK(ChangeClickHdl, Button *);
459*cdf0e10cSrcweir     DECL_LINK(DeleteClickHdl, Button *);
460*cdf0e10cSrcweir 
461*cdf0e10cSrcweir     void    FillSymbols(ComboBox &rComboBox, sal_Bool bDeleteText = sal_True);
462*cdf0e10cSrcweir     void    FillSymbolSets(ComboBox &rComboBox, sal_Bool bDeleteText = sal_True);
463*cdf0e10cSrcweir     void    FillFonts(sal_Bool bDeleteText = sal_True);
464*cdf0e10cSrcweir     void    FillStyles(sal_Bool bDeleteText = sal_True);
465*cdf0e10cSrcweir 
466*cdf0e10cSrcweir     void    SetSymbolSetManager(const SmSymbolManager &rMgr);
467*cdf0e10cSrcweir     void    SetFont(const XubString &rFontName, const XubString &rStyleName);
468*cdf0e10cSrcweir     void    SetOrigSymbol(const SmSym *pSymbol, const XubString &rSymbolSetName);
469*cdf0e10cSrcweir     void    UpdateButtons();
470*cdf0e10cSrcweir 
471*cdf0e10cSrcweir     sal_Bool    SelectSymbolSet(ComboBox &rComboBox, const XubString &rSymbolSetName,
472*cdf0e10cSrcweir                             sal_Bool bDeleteText);
473*cdf0e10cSrcweir     sal_Bool    SelectSymbol(ComboBox &rComboBox, const XubString &rSymbolName,
474*cdf0e10cSrcweir                             sal_Bool bDeleteText);
475*cdf0e10cSrcweir     sal_Bool    SelectFont(const XubString &rFontName, sal_Bool bApplyFont);
476*cdf0e10cSrcweir     sal_Bool    SelectStyle(const XubString &rStyleName, sal_Bool bApplyFont);
477*cdf0e10cSrcweir 
478*cdf0e10cSrcweir     SmSym       * GetSymbol(const ComboBox &rComboBox);
479*cdf0e10cSrcweir     const SmSym * GetSymbol(const ComboBox &rComboBox) const
480*cdf0e10cSrcweir     {
481*cdf0e10cSrcweir         return ((SmSymDefineDialog *) this)->GetSymbol(rComboBox);
482*cdf0e10cSrcweir     }
483*cdf0e10cSrcweir 
484*cdf0e10cSrcweir     void            InitColor_Impl();
485*cdf0e10cSrcweir 
486*cdf0e10cSrcweir     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
487*cdf0e10cSrcweir 
488*cdf0e10cSrcweir public:
489*cdf0e10cSrcweir     SmSymDefineDialog(Window *pParent, OutputDevice *pFntListDevice, SmSymbolManager &rMgr, sal_Bool bFreeRes = sal_True);
490*cdf0e10cSrcweir     ~SmSymDefineDialog();
491*cdf0e10cSrcweir 
492*cdf0e10cSrcweir     using OutputDevice::SetFont;
493*cdf0e10cSrcweir 
494*cdf0e10cSrcweir     // Dialog
495*cdf0e10cSrcweir     virtual short   Execute();
496*cdf0e10cSrcweir 
497*cdf0e10cSrcweir     sal_Bool SelectOldSymbolSet(const XubString &rSymbolSetName)
498*cdf0e10cSrcweir     {
499*cdf0e10cSrcweir         return SelectSymbolSet(aOldSymbolSets, rSymbolSetName, sal_False);
500*cdf0e10cSrcweir     }
501*cdf0e10cSrcweir 
502*cdf0e10cSrcweir     sal_Bool SelectOldSymbol(const XubString &rSymbolName)
503*cdf0e10cSrcweir     {
504*cdf0e10cSrcweir         return SelectSymbol(aOldSymbols, rSymbolName, sal_False);
505*cdf0e10cSrcweir     }
506*cdf0e10cSrcweir 
507*cdf0e10cSrcweir     sal_Bool SelectSymbolSet(const XubString &rSymbolSetName)
508*cdf0e10cSrcweir     {
509*cdf0e10cSrcweir         return SelectSymbolSet(aSymbolSets, rSymbolSetName, sal_False);
510*cdf0e10cSrcweir     }
511*cdf0e10cSrcweir 
512*cdf0e10cSrcweir     sal_Bool SelectSymbol(const XubString &rSymbolName)
513*cdf0e10cSrcweir     {
514*cdf0e10cSrcweir         return SelectSymbol(aSymbols, rSymbolName, sal_False);
515*cdf0e10cSrcweir     }
516*cdf0e10cSrcweir 
517*cdf0e10cSrcweir     sal_Bool        SelectFont(const XubString &rFontName)   { return SelectFont(rFontName, sal_True); }
518*cdf0e10cSrcweir     sal_Bool        SelectStyle(const XubString &rStyleName) { return SelectStyle(rStyleName, sal_True); };
519*cdf0e10cSrcweir     void        SelectChar(xub_Unicode cChar);
520*cdf0e10cSrcweir };
521*cdf0e10cSrcweir 
522*cdf0e10cSrcweir 
523*cdf0e10cSrcweir 
524*cdf0e10cSrcweir #endif
525*cdf0e10cSrcweir 
526