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