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