diff options
Diffstat (limited to 'starmath/inc')
-rw-r--r-- | starmath/inc/action.hxx | 52 | ||||
-rw-r--r-- | starmath/inc/applicat.hxx | 109 | ||||
-rw-r--r-- | starmath/inc/config.hxx | 58 | ||||
-rw-r--r-- | starmath/inc/dialog.hxx | 526 | ||||
-rw-r--r-- | starmath/inc/document.hxx | 226 | ||||
-rw-r--r-- | starmath/inc/edit.hxx | 151 | ||||
-rwxr-xr-x | starmath/inc/format.hxx | 171 | ||||
-rw-r--r-- | starmath/inc/makefile.mk | 47 | ||||
-rw-r--r-- | starmath/inc/node.hxx | 854 | ||||
-rw-r--r-- | starmath/inc/parse.hxx | 269 | ||||
-rw-r--r-- | starmath/inc/pch/precompiled_starmath.cxx | 29 | ||||
-rw-r--r-- | starmath/inc/pch/precompiled_starmath.hxx | 32 | ||||
-rw-r--r-- | starmath/inc/rect.hxx | 260 | ||||
-rw-r--r-- | starmath/inc/smdll.hxx | 50 | ||||
-rw-r--r-- | starmath/inc/smmod.hxx | 181 | ||||
-rw-r--r-- | starmath/inc/starmath.hrc | 768 | ||||
-rw-r--r-- | starmath/inc/symbol.hxx | 189 | ||||
-rw-r--r-- | starmath/inc/toolbox.hxx | 89 | ||||
-rw-r--r-- | starmath/inc/types.hxx | 204 | ||||
-rw-r--r-- | starmath/inc/unomodel.hxx | 109 | ||||
-rw-r--r-- | starmath/inc/utility.hxx | 380 | ||||
-rw-r--r-- | starmath/inc/view.hxx | 298 |
22 files changed, 5052 insertions, 0 deletions
diff --git a/starmath/inc/action.hxx b/starmath/inc/action.hxx new file mode 100644 index 000000000000..c59765ee45ac --- /dev/null +++ b/starmath/inc/action.hxx @@ -0,0 +1,52 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef ACTION_HXX +#define ACTION_HXX + +#include <svl/undo.hxx> +#include "format.hxx" + +class SmDocShell; + + +class SmFormatAction: public SfxUndoAction +{ + SmDocShell *pDoc; + SmFormat aOldFormat; + SmFormat aNewFormat; + +public: + SmFormatAction(SmDocShell *pDocSh, const SmFormat& rOldFormat, const SmFormat& rNewFormat); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rDocSh); + virtual UniString GetComment() const; +}; + +#endif + diff --git a/starmath/inc/applicat.hxx b/starmath/inc/applicat.hxx new file mode 100644 index 000000000000..9c756496ae95 --- /dev/null +++ b/starmath/inc/applicat.hxx @@ -0,0 +1,109 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef APPLICAT_HXX +#define APPLICAT_HXX + +class SvxErrorHandler; + +#include <sfx2/app.hxx> + +/**************************************************************************/ +/* +** +** MACRO DEFINITION +** +**/ + +#define SMDLL 1 + +#define APPLICATIONNAME "smath3" + +/**************************************************************************/ +/* +** +** CLASS DEFINITION +** +**/ + +#ifdef WIN +#define RELEASE "WIN304" +#endif + +#ifdef PM2 +#define RELEASE "PM304" +#endif + +#ifdef WNT +#define RELEASE "WNT304" +#endif + +#ifdef UNX +#define RELEASE "UNX304" +#endif + +#ifndef SMDLL +class SmResId : public ResId +{ +public: + SmResId(USHORT nId) : + ResId(nId) + { + } + +}; + +#endif + +#ifndef _DLL_ +class SmDLL; + +class SmApplicat: public SfxApplication +{ +protected: + SvxErrorHandler *pSvxErrorHandler; + + virtual void OpenClients(); + + // initialization / deinitialization + virtual void Init(); + virtual void Exit(); + +public: + void Main(); + + SmApplicat() : + SfxApplication("iso") + { + } + +}; + +#endif +#endif + diff --git a/starmath/inc/config.hxx b/starmath/inc/config.hxx new file mode 100644 index 000000000000..c52e429923c9 --- /dev/null +++ b/starmath/inc/config.hxx @@ -0,0 +1,58 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef CONFIG_HXX +#define CONFIG_HXX + +#include <svl/brdcst.hxx> +#include <svl/lstner.hxx> +#include "format.hxx" + +#include "cfgitem.hxx" + + +class SmPreferenceDialog; +class SmPrintDialog; +class SmPrintOptionDialog; +class SfxItemSet; + +class SmConfig : public SmMathConfig, public SfxBroadcaster +{ + SmFontPickList vFontPickList[7]; + +public: + SmConfig(); + virtual ~SmConfig(); + + SmFontPickList & GetFontPickList(USHORT nIdent) { return vFontPickList[nIdent]; } + + void ItemSetToConfig(const SfxItemSet &rSet); + void ConfigToItemSet(SfxItemSet &rSet) const; +}; + +#endif + + diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx new file mode 100644 index 000000000000..75aee6fd2009 --- /dev/null +++ b/starmath/inc/dialog.hxx @@ -0,0 +1,526 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef DIALOG_HXX +#define DIALOG_HXX + +#include <vcl/image.hxx> +#include <vcl/dialog.hxx> +#include <vcl/fixed.hxx> +#ifndef _SV_BUTTON_HXX //autogen +#include <vcl/button.hxx> +#endif +#include <vcl/image.hxx> +#include <sfx2/tabdlg.hxx> +#include <vcl/combobox.hxx> +#include <svx/charmap.hxx> +#include <sfx2/basedlgs.hxx> +#include <vcl/field.hxx> +#include <vcl/menubtn.hxx> +#include <vcl/scrbar.hxx> +#include <vcl/ctrl.hxx> +#include <vcl/menu.hxx> +#include <vcl/outdev.hxx> +#include <svtools/ctrlbox.hxx> +#include <svtools/ctrltool.hxx> +#include "utility.hxx" +#include "format.hxx" +#include "symbol.hxx" + +class SubsetMap; +#define CATEGORY_NONE 0xFFFF + +/**************************************************************************/ + +const XubString GetFontStyleName(const Font &rFont); +void SetFontStyle(const XubString &rStyleName, Font &rFont); + +/**************************************************************************/ + +class SmPrintOptionsTabPage : public SfxTabPage +{ + FixedLine aFixedLine1; + CheckBox aTitle; + CheckBox aText; + CheckBox aFrame; + FixedLine aFixedLine2; + RadioButton aSizeNormal; + RadioButton aSizeScaled; + RadioButton aSizeZoomed; + MetricField aZoom; + FixedLine aFixedLine3; + CheckBox aNoRightSpaces; + + DECL_LINK(SizeButtonClickHdl, Button *); + + virtual BOOL FillItemSet(SfxItemSet& rSet); + virtual void Reset(const SfxItemSet& rSet); + +public: + static SfxTabPage* Create(Window *pWindow, const SfxItemSet &rSet); + + SmPrintOptionsTabPage(Window *pParent, const SfxItemSet &rOptions); +}; + +/**************************************************************************/ + +class SmShowFont : public Control +{ + virtual void Paint(const Rectangle&); + +public: + SmShowFont(Window *pParent, const ResId& rResId) : + Control(pParent, rResId) + { + } + + void SetFont(const Font& rFont); +}; + +class SmFontDialog : public ModalDialog +{ + FixedText aFixedText1; + ComboBox aFontBox; + CheckBox aBoldCheckBox; + CheckBox aItalicCheckBox; + OKButton aOKButton1; + CancelButton aCancelButton1; + SmShowFont aShowFont; + FixedText aFixedText2; + + Font Face; + + DECL_LINK(FontSelectHdl, ComboBox *); + DECL_LINK(FontModifyHdl, ComboBox *); + DECL_LINK(AttrChangeHdl, CheckBox *); + + void InitColor_Impl(); + + virtual void DataChanged( const DataChangedEvent& rDCEvt ); + +public: + SmFontDialog(Window * pParent, OutputDevice *pFntListDevice, BOOL bHideCheckboxes, BOOL bFreeRes = TRUE); + + const Font& GetFont() const { return Face; } + void SetFont(const Font &rFont); +}; + +/**************************************************************************/ + +class SmFontSizeDialog : public ModalDialog +{ + FixedText aFixedText1; + MetricField aBaseSize; + FixedText aFixedText4; + MetricField aTextSize; + FixedText aFixedText5; + MetricField aIndexSize; + FixedText aFixedText6; + MetricField aFunctionSize; + FixedText aFixedText7; + MetricField aOperatorSize; + FixedText aFixedText8; + MetricField aBorderSize; + FixedLine aFixedLine1; + OKButton aOKButton1; + CancelButton aCancelButton1; + PushButton aDefaultButton; + + DECL_LINK(DefaultButtonClickHdl, Button *); + +public: + SmFontSizeDialog(Window *pParent, BOOL bFreeRes = TRUE); + + void ReadFrom(const SmFormat &rFormat); + void WriteTo (SmFormat &rFormat) const; +}; + +/**************************************************************************/ + +class SmFontTypeDialog : public ModalDialog +{ + FixedText aFixedText1; + SmFontPickListBox aVariableFont; + FixedText aFixedText2; + SmFontPickListBox aFunctionFont; + FixedText aFixedText3; + SmFontPickListBox aNumberFont; + FixedText aFixedText4; + SmFontPickListBox aTextFont; + FixedText aFixedText5; + SmFontPickListBox aSerifFont; + FixedText aFixedText6; + SmFontPickListBox aSansFont; + FixedText aFixedText7; + SmFontPickListBox aFixedFont; + FixedLine aFixedLine1; + FixedLine aFixedLine2; + OKButton aOKButton1; + CancelButton aCancelButton1; + MenuButton aMenuButton; + PushButton aDefaultButton; + + OutputDevice *pFontListDev; + + DECL_LINK(MenuSelectHdl, Menu *); + DECL_LINK(DefaultButtonClickHdl, Button *); + +public: + SmFontTypeDialog(Window *pParent, OutputDevice *pFntListDevice, BOOL bFreeRes = TRUE); + + void ReadFrom(const SmFormat &rFormat); + void WriteTo (SmFormat &rFormat) const; +}; + +/**************************************************************************/ + +#define NOCATEGORIES 10 + +class SmCategoryDesc : public Resource +{ + XubString Name; + XubString *Strings[4]; + Bitmap *Graphics[4]; /* regular bitmaps */ + Bitmap *GraphicsH[4]; /* high contrast bitmaps */ + USHORT Minimum[4]; + USHORT Maximum[4]; + USHORT Value[4]; + BOOL bIsHighContrast; + +public: + SmCategoryDesc(const ResId &rResId, USHORT nCategoryIdx); + ~SmCategoryDesc(); + + const XubString & GetName() const { return Name; } + const XubString * GetString(USHORT Index) const { return Strings[Index]; } + USHORT GetMinimum(USHORT Index) { return Minimum[Index]; } + USHORT GetMaximum(USHORT Index) { return Maximum[Index]; } + USHORT GetValue(USHORT Index) const { return Value[Index]; } + void SetValue(USHORT Index, USHORT nVal) { Value[Index] = nVal;} + + void SetHighContrast( BOOL bVal ) { bIsHighContrast = bVal; } + const Bitmap * GetGraphic(USHORT Index) const + { + return bIsHighContrast ? GraphicsH[Index] : Graphics[Index]; + } +}; + + +class SmDistanceDialog : public ModalDialog +{ + FixedText aFixedText1; + MetricField aMetricField1; + FixedText aFixedText2; + MetricField aMetricField2; + FixedText aFixedText3; + MetricField aMetricField3; + CheckBox aCheckBox1; + FixedText aFixedText4; + MetricField aMetricField4; + OKButton aOKButton1; + CancelButton aCancelButton1; + MenuButton aMenuButton; + PushButton aDefaultButton; + FixedBitmap aBitmap; + FixedLine aFixedLine; + + SmCategoryDesc *Categories[NOCATEGORIES]; + USHORT nActiveCategory; + BOOL bScaleAllBrackets; + + DECL_LINK(GetFocusHdl, Control *); + DECL_LINK(MenuSelectHdl, Menu *); + DECL_LINK(DefaultButtonClickHdl, Button *); + DECL_LINK(CheckBoxClickHdl, CheckBox *); + + using Window::SetHelpId; + void SetHelpId(MetricField &rField, ULONG nHelpId); + void SetCategory(USHORT Category); + + void ApplyImages(); + +public: + SmDistanceDialog(Window *pParent, BOOL bFreeRes = TRUE); + ~SmDistanceDialog(); + + void ReadFrom(const SmFormat &rFormat); + void WriteTo (SmFormat &rFormat) /*const*/; + + // Window + virtual void DataChanged( const DataChangedEvent &rEvt ); +}; + + +/**************************************************************************/ + + +class SmAlignDialog : public ModalDialog +{ + RadioButton aLeft; + RadioButton aCenter; + RadioButton aRight; + FixedLine aFixedLine1; + OKButton aOKButton1; + CancelButton aCancelButton1; + PushButton aDefaultButton; + + DECL_LINK(DefaultButtonClickHdl, Button *); + +public: + SmAlignDialog(Window *pParent, BOOL bFreeRes = TRUE); + + void ReadFrom(const SmFormat &rFormat); + void WriteTo (SmFormat &rFormat) const; +}; + +/**************************************************************************/ + +class SmShowSymbolSet : public Control +{ + SymbolPtrVec_t aSymbolSet; + ScrollBar aVScrollBar; + Size aOutputSize; + Link aSelectHdlLink; + Link aDblClickHdlLink; + USHORT nLen; + USHORT nRows, nColumns; + USHORT nSelectSymbol; + + virtual void Paint(const Rectangle&); + virtual void MouseButtonDown(const MouseEvent& rMEvt); + virtual void KeyInput(const KeyEvent& rKEvt); + + DECL_LINK( ScrollHdl, ScrollBar* ); + +public: + SmShowSymbolSet(Window *pParent, const ResId& rResId); + + void SetSymbolSet(const SymbolPtrVec_t& rSymbolSet); + + void SelectSymbol(USHORT nSymbol); + USHORT GetSelectSymbol() const { return nSelectSymbol; } + + void SetSelectHdl(const Link& rLink) { aSelectHdlLink = rLink; } + void SetDblClickHdl(const Link& rLink) { aDblClickHdlLink = rLink; } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class SmShowSymbol : public Control +{ + Link aDblClickHdlLink; + + virtual void Paint(const Rectangle&); + virtual void MouseButtonDown(const MouseEvent& rMEvt); + +public: + SmShowSymbol(Window *pParent, const ResId& rResId) : + Control(pParent, rResId) {} + + void SetSymbol(const SmSym *pSymbol); + void SetDblClickHdl(const Link &rLink) { aDblClickHdlLink = rLink; } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class SmSymDefineDialog; + +class SmSymbolDialog : public ModalDialog +{ + FixedText aSymbolSetText; + ListBox aSymbolSets; + SmShowSymbolSet aSymbolSetDisplay; + FixedText aSymbolName; + SmShowSymbol aSymbolDisplay; + PushButton aGetBtn; + PushButton aCloseBtn; + PushButton aEditBtn; + + SmViewShell &rViewSh; + SmSymbolManager &rSymbolMgr; + + String aSymbolSetName; + SymbolPtrVec_t aSymbolSet; + + OutputDevice *pFontListDev; + + DECL_LINK(SymbolSetChangeHdl, ListBox *); + DECL_LINK(SymbolChangeHdl, SmShowSymbolSet *); + DECL_LINK(SymbolDblClickHdl, SmShowSymbolSet *); + DECL_LINK(CloseClickHdl, Button *); + DECL_LINK(EditClickHdl, Button *); + DECL_LINK(GetClickHdl, Button *); + + void FillSymbolSets(BOOL bDeleteText = TRUE); + void SetSymbolSetManager(SmSymbolManager &rMgr); + const SmSym *GetSymbol() const; + void InitColor_Impl(); + + virtual void DataChanged( const DataChangedEvent& rDCEvt ); + +public: + SmSymbolDialog(Window * pParent, OutputDevice *pFntListDevice, + SmSymbolManager &rSymbolMgr, SmViewShell &rViewShell, BOOL bFreeRes = TRUE); + virtual ~SmSymbolDialog(); + + BOOL SelectSymbolSet(const XubString &rSymbolSetName); + void SelectSymbol(USHORT nSymbolPos); + USHORT GetSelectedSymbol() const { return aSymbolSetDisplay.GetSelectSymbol(); } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class SmShowChar : public Control +{ + virtual void Paint(const Rectangle&); + +public: + SmShowChar(Window *pParent, const ResId& rResId) + : Control(pParent, rResId) + { + } + + void SetChar(xub_Unicode aChar); + void SetFont(const Font &rFont); +}; + +//////////////////////////////////////////////////////////////////////////////// + +class SmSymDefineDialog : public ModalDialog +{ + FixedText aOldSymbolText; + ComboBox aOldSymbols; + FixedText aOldSymbolSetText; + ComboBox aOldSymbolSets; + SvxShowCharSet aCharsetDisplay; + FixedText aSymbolText; + ComboBox aSymbols; + FixedText aSymbolSetText; + ComboBox aSymbolSets; + FixedText aFontText; + ListBox aFonts; + FixedText aFontsSubsetFT; + ListBox aFontsSubsetLB; + FixedText aStyleText; + FontStyleBox aStyles; + FixedText aOldSymbolName; + SmShowChar aOldSymbolDisplay; + FixedText aOldSymbolSetName; + FixedText aSymbolName; + SmShowChar aSymbolDisplay; + FixedText aSymbolSetName; + OKButton aOkBtn; + CancelButton aCancelBtn; + PushButton aAddBtn; + PushButton aChangeBtn; + PushButton aDeleteBtn; + FixedImage aRightArrow; + Image aRigthArrow_Im; + Image aRigthArrow_Im_HC; // hi-contrast version + + SmSymbolManager aSymbolMgrCopy, + &rSymbolMgr; + const SmSym *pOrigSymbol; + + const SubsetMap *pSubsetMap; + FontList *pFontList; + + DECL_LINK(OldSymbolChangeHdl, ComboBox *); + DECL_LINK(OldSymbolSetChangeHdl, ComboBox *); + DECL_LINK(ModifyHdl, ComboBox *); + DECL_LINK(FontChangeHdl, ListBox *); + DECL_LINK(SubsetChangeHdl, ListBox*); + DECL_LINK(StyleChangeHdl, ComboBox *); + DECL_LINK(CharHighlightHdl, Control* pControl); + DECL_LINK(AddClickHdl, Button *); + DECL_LINK(ChangeClickHdl, Button *); + DECL_LINK(DeleteClickHdl, Button *); + + void FillSymbols(ComboBox &rComboBox, BOOL bDeleteText = TRUE); + void FillSymbolSets(ComboBox &rComboBox, BOOL bDeleteText = TRUE); + void FillFonts(BOOL bDeleteText = TRUE); + void FillStyles(BOOL bDeleteText = TRUE); + + void SetSymbolSetManager(const SmSymbolManager &rMgr); + void SetFont(const XubString &rFontName, const XubString &rStyleName); + void SetOrigSymbol(const SmSym *pSymbol, const XubString &rSymbolSetName); + void UpdateButtons(); + + BOOL SelectSymbolSet(ComboBox &rComboBox, const XubString &rSymbolSetName, + BOOL bDeleteText); + BOOL SelectSymbol(ComboBox &rComboBox, const XubString &rSymbolName, + BOOL bDeleteText); + BOOL SelectFont(const XubString &rFontName, BOOL bApplyFont); + BOOL SelectStyle(const XubString &rStyleName, BOOL bApplyFont); + + SmSym * GetSymbol(const ComboBox &rComboBox); + const SmSym * GetSymbol(const ComboBox &rComboBox) const + { + return ((SmSymDefineDialog *) this)->GetSymbol(rComboBox); + } + + void InitColor_Impl(); + + virtual void DataChanged( const DataChangedEvent& rDCEvt ); + +public: + SmSymDefineDialog(Window *pParent, OutputDevice *pFntListDevice, SmSymbolManager &rMgr, BOOL bFreeRes = TRUE); + ~SmSymDefineDialog(); + + using OutputDevice::SetFont; + + // Dialog + virtual short Execute(); + + BOOL SelectOldSymbolSet(const XubString &rSymbolSetName) + { + return SelectSymbolSet(aOldSymbolSets, rSymbolSetName, FALSE); + } + + BOOL SelectOldSymbol(const XubString &rSymbolName) + { + return SelectSymbol(aOldSymbols, rSymbolName, FALSE); + } + + BOOL SelectSymbolSet(const XubString &rSymbolSetName) + { + return SelectSymbolSet(aSymbolSets, rSymbolSetName, FALSE); + } + + BOOL SelectSymbol(const XubString &rSymbolName) + { + return SelectSymbol(aSymbols, rSymbolName, FALSE); + } + + BOOL SelectFont(const XubString &rFontName) { return SelectFont(rFontName, TRUE); } + BOOL SelectStyle(const XubString &rStyleName) { return SelectStyle(rStyleName, TRUE); }; + void SelectChar(xub_Unicode cChar); +}; + + + +#endif + diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx new file mode 100644 index 000000000000..f03cd43fc965 --- /dev/null +++ b/starmath/inc/document.hxx @@ -0,0 +1,226 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef DOCUMENT_HXX +#define DOCUMENT_HXX + +#define SMDLL 1 + +#include <sot/storage.hxx> +#include <sot/sotref.hxx> +#include <sfx2/objsh.hxx> +#include <svl/lstner.hxx> +#include <sfx2/docfac.hxx> +#include <vcl/virdev.hxx> + +#include "format.hxx" +#include "parse.hxx" +#include "smmod.hxx" + +#include <vcl/jobset.hxx> + +class SmNode; +class SfxMenuBarManager; +class SfxPrinter; +class Printer; + +#define HINT_DATACHANGED 1004 + +#define SM30BIDENT ((ULONG)0x534D3033L) +#define SM30IDENT ((ULONG)0x30334d53L) +#define SM304AIDENT ((ULONG)0x34303330L) +#define SM30VERSION ((ULONG)0x00010000L) +#define SM50VERSION ((ULONG)0x00010001L) //Unterschied zur SM30VERSION ist + //der neue Border im Format. + +#define FRMIDENT ((ULONG)0x03031963L) +#define FRMVERSION ((ULONG)0x00010001L) + +#define STAROFFICE_XML "StarOffice XML (Math)" +#define MATHML_XML "MathML XML (Math)" + +/* Zugriff auf den Drucker sollte ausschliesslich ueber diese Klasse erfolgen + * ========================================================================== + * + * Der Drucker kann dem Dokument oder auch dem OLE-Container gehoeren. Wenn + * das Dokument also eine OLE-Dokument ist, so gehoert der Drucker auch + * grundsaetzlich dem Container. Der Container arbeitet aber eventuell mit + * einer anderen MapUnit als der Server. Der Drucker wird bezueglich des MapMode + * im Konstruktor entsprechend eingestellt und im Destruktor wieder restauriert. + * Das bedingt natuerlich, das diese Klasse immer nur kurze Zeit existieren darf + * (etwa waehrend des Paints). + * Die Kontrolle darueber ob der Drucker selbst angelegt, vom Server besorgt + * oder dann auch NULL ist, uebernimmt die DocShell in der Methode GetPrt(), + * fuer die der Access auch Friend der DocShell ist. +*/ + +class SmDocShell; +class EditEngine; + +//////////////////////////////////////////////////////////// + +class SmPrinterAccess +{ + Printer* pPrinter; + OutputDevice* pRefDev; +public: + SmPrinterAccess( SmDocShell &rDocShell ); + ~SmPrinterAccess(); + Printer* GetPrinter() { return pPrinter; } + OutputDevice* GetRefDev() { return pRefDev; } +}; + + +//////////////////////////////////////////////////////////// + +void SetEditEngineDefaultFonts( + EditEngine &rEditEngine, + SfxItemPool &rEditEngineItemPool ); + +//////////////////////////////////////////////////////////// + +class SmDocShell : public SfxObjectShell, public SfxListener +{ + friend class SmPrinterAccess; + friend class SmModel; + + String aText; + SmFormat aFormat; + SmParser aInterpreter; + String aAccText; + SmNode *pTree; + SfxMenuBarManager *pMenuMgr; + SfxItemPool *pEditEngineItemPool; + EditEngine *pEditEngine; + SfxPrinter *pPrinter; //Siehe Kommentar zum SmPrinter Access! + Printer *pTmpPrinter; //ebenfalls + long nLeftBorder, + nRightBorder, + nTopBorder, + nBottomBorder; + USHORT nModifyCount; + BOOL bIsFormulaArranged; + + + + virtual void SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType); + + BOOL WriteAsMathType3( SfxMedium& ); + + virtual void Draw(OutputDevice *pDevice, + const JobSetup & rSetup, + USHORT nAspect = ASPECT_CONTENT); + + virtual void FillClass(SvGlobalName* pClassName, + sal_uInt32* pFormat, + String* pAppName, + String* pFullTypeName, + String* pShortTypeName, + sal_Int32 nFileFormat, + sal_Bool bTemplate = sal_False ) const; + + virtual BOOL SetData( const String& rData ); + virtual ULONG GetMiscStatus() const; + virtual void OnDocumentPrinterChanged( Printer * ); + virtual sal_Bool InitNew( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ); + virtual BOOL Load( SfxMedium& rMedium ); + void ImplSave( SvStorageStreamRef xStrm ); + virtual BOOL Save(); + virtual BOOL SaveAs( SfxMedium& rMedium ); + virtual BOOL ConvertTo( SfxMedium &rMedium ); + virtual BOOL SaveCompleted( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ); + + Printer *GetPrt(); + OutputDevice* GetRefDev(); + + BOOL IsFormulaArranged() const { return bIsFormulaArranged; } + void SetFormulaArranged(BOOL bVal) { bIsFormulaArranged = bVal; } + + virtual BOOL ConvertFrom(SfxMedium &rMedium); + +public: + TYPEINFO(); + SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START+1) + using SotObject::GetInterface; + SFX_DECL_OBJECTFACTORY(); + + SmDocShell( const sal_uInt64 i_nSfxCreationFlags ); + virtual ~SmDocShell(); + + void LoadSymbols(); + void SaveSymbols(); + + void ArrangeFormula(); + + //Zugriff fuer die View. Diese Zugriffe sind nur fuer den nicht OLE-Fall! + //und fuer die Kommunikation mit dem SFX! + //Alle internen Verwendungen des Printers sollten ausschlieslich uber + //den SmPrinterAccess funktionieren. + BOOL HasPrinter() { return 0 != pPrinter; } + SfxPrinter *GetPrinter() { GetPrt(); return pPrinter; } + void SetPrinter( SfxPrinter * ); + + const String GetComment() const; + + // to replace chars that can not be saved with the document... + sal_Bool ReplaceBadChars(); + + void UpdateText(); + void SetText(const String& rBuffer); + String& GetText() { return (aText); } + void SetFormat(SmFormat& rFormat); + const SmFormat& GetFormat() { return (aFormat); } + + void Parse(); + SmParser & GetParser() { return aInterpreter; } + const SmNode * GetFormulaTree() const { return pTree; } + void SetFormulaTree(SmNode *&rTree) { pTree = rTree; } + + String GetAccessibleText(); + + EditEngine & GetEditEngine(); + SfxItemPool & GetEditEngineItemPool(); + + void Draw(OutputDevice &rDev, Point &rPosition); + Size GetSize(); + + void Repaint(); + + virtual SfxUndoManager *GetUndoManager (); + + virtual SfxItemPool& GetPool() const; + + void Execute( SfxRequest& rReq ); + void GetState(SfxItemSet &); + + virtual void SetVisArea (const Rectangle & rVisArea); + virtual void SetModified(BOOL bModified); +}; + + +#endif + diff --git a/starmath/inc/edit.hxx b/starmath/inc/edit.hxx new file mode 100644 index 000000000000..4abbcdb950d8 --- /dev/null +++ b/starmath/inc/edit.hxx @@ -0,0 +1,151 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef EDIT_HXX +#define EDIT_HXX + +#include <vcl/window.hxx> +#include <vcl/timer.hxx> +#include <svtools/transfer.hxx> +#include <editeng/editdata.hxx> +#include <svtools/colorcfg.hxx> + +//#ifndef _ACCESSIBILITY_HXX_ +//#include "accessibility.hxx" +//#endif + +class SmDocShell; +class SmViewShell; +class EditView; +class EditEngine; +class EditStatus; +class ScrollBar; +class ScrollBarBox; +class DataChangedEvent; +class Menu; +class SmCmdBoxWindow; +class SmEditAccessible; +class CommandEvent; + +/**************************************************************************/ + + void SmGetLeftSelectionPart(const ESelection aSelection, + USHORT &nPara, USHORT &nPos); + +/**************************************************************************/ + +class SmEditWindow : public Window, public DropTargetHelper +{ + ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > xAccessible; + SmEditAccessible * pAccessible; + + SmCmdBoxWindow &rCmdBox; + EditView *pEditView; + ScrollBar *pHScrollBar, + *pVScrollBar; + ScrollBarBox *pScrollBox; + Timer aModifyTimer, + aCursorMoveTimer; + ESelection aOldSelection; + + virtual void KeyInput(const KeyEvent& rKEvt); + virtual void Command(const CommandEvent& rCEvt); + DECL_LINK(MenuSelectHdl, Menu *); + DECL_LINK(ModifyTimerHdl, Timer *); + DECL_LINK(CursorMoveTimerHdl, Timer *); + + virtual void DataChanged( const DataChangedEvent& ); + virtual void Resize(); + virtual void MouseMove(const MouseEvent &rEvt); + virtual void MouseButtonUp(const MouseEvent &rEvt); + virtual void MouseButtonDown(const MouseEvent &rEvt); + + virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); + virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); + virtual void Paint(const Rectangle& rRect); + + DECL_LINK(EditStatusHdl ,EditStatus *); + DECL_LINK(ScrollHdl, ScrollBar *); + + void CreateEditView(); + + Rectangle AdjustScrollBars(); + void SetScrollBarRanges(); + void InitScrollBars(); + void InvalidateSlots(); + +public: + SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin ); + ~SmEditWindow(); + + SmDocShell * GetDoc(); + SmViewShell * GetView(); + EditView * GetEditView() { return pEditView; } + EditEngine * GetEditEngine(); + SfxItemPool * GetEditEngineItemPool(); + + // Window + virtual void SetText(const XubString &rText); + virtual String GetText() const; + virtual void GetFocus(); + virtual void LoseFocus(); + + ESelection GetSelection() const; + void SetSelection(const ESelection &rSel); + + BOOL IsEmpty() const; + BOOL IsSelected() const; + BOOL IsAllSelected() const; + void Cut(); + void Copy(); + void Paste(); + void Delete(); + void SelectAll(); + void InsertText(const String &rText); + void InsertCommand(USHORT nCommand); + void MarkError(const Point &rPos); + void SelNextMark(); + void SelPrevMark(); + BOOL HasMark(const String &rText) const; + + void Flush(); + void DeleteEditView( SmViewShell &rView ); + + void ApplyColorConfigValues( const svtools::ColorConfig &rColorCfg ); + + BOOL HandleWheelCommands( const CommandEvent &rCEvt ); + + // for Accessibility + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); + + using Window::GetAccessible; + SmEditAccessible * GetAccessible() { return pAccessible; } +}; + + +#endif + diff --git a/starmath/inc/format.hxx b/starmath/inc/format.hxx new file mode 100755 index 000000000000..4d13ea48185e --- /dev/null +++ b/starmath/inc/format.hxx @@ -0,0 +1,171 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef FORMAT_HXX +#define FORMAT_HXX + + +#include <svl/smplhint.hxx> +#include <svl/brdcst.hxx> +#include "utility.hxx" +#include <types.hxx> + + +#define SM_FMT_VERSION_51 ((BYTE) 0x01) +#define SM_FMT_VERSION_NOW SM_FMT_VERSION_51 + +#define FNTNAME_TIMES "Times New Roman" +#define FNTNAME_HELV "Helvetica" +#define FNTNAME_COUR "Courier" +#define FNTNAME_MATH FONTNAME_MATH + + +// symbolic names used as array indices +#define SIZ_BEGIN 0 +#define SIZ_TEXT 0 +#define SIZ_INDEX 1 +#define SIZ_FUNCTION 2 +#define SIZ_OPERATOR 3 +#define SIZ_LIMITS 4 +#define SIZ_END 4 + +// symbolic names used as array indices +#define FNT_BEGIN 0 +#define FNT_VARIABLE 0 +#define FNT_FUNCTION 1 +#define FNT_NUMBER 2 +#define FNT_TEXT 3 +#define FNT_SERIF 4 +#define FNT_SANS 5 +#define FNT_FIXED 6 +#define FNT_MATH 7 +#define FNT_END 7 + +// symbolic names used as array indices +#define DIS_BEGIN 0 +#define DIS_HORIZONTAL 0 +#define DIS_VERTICAL 1 +#define DIS_ROOT 2 +#define DIS_SUPERSCRIPT 3 +#define DIS_SUBSCRIPT 4 +#define DIS_NUMERATOR 5 +#define DIS_DENOMINATOR 6 +#define DIS_FRACTION 7 +#define DIS_STROKEWIDTH 8 +#define DIS_UPPERLIMIT 9 +#define DIS_LOWERLIMIT 10 +#define DIS_BRACKETSIZE 11 +#define DIS_BRACKETSPACE 12 +#define DIS_MATRIXROW 13 +#define DIS_MATRIXCOL 14 +#define DIS_ORNAMENTSIZE 15 +#define DIS_ORNAMENTSPACE 16 +#define DIS_OPERATORSIZE 17 +#define DIS_OPERATORSPACE 18 +#define DIS_LEFTSPACE 19 +#define DIS_RIGHTSPACE 20 +#define DIS_TOPSPACE 21 +#define DIS_BOTTOMSPACE 22 +#define DIS_NORMALBRACKETSIZE 23 +#define DIS_END 23 + + +// to be broadcastet on format changes: +#define HINT_FORMATCHANGED 10003 + +enum SmHorAlign { AlignLeft, AlignCenter, AlignRight }; + +String GetDefaultFontName( LanguageType nLang, USHORT nIdent ); + +class SmFormat : public SfxBroadcaster +{ + SmFace vFont[FNT_END + 1]; + BOOL bDefaultFont[FNT_END + 1]; + Size aBaseSize; + long nVersion; + USHORT vSize[SIZ_END + 1]; + USHORT vDist[DIS_END + 1]; + SmHorAlign eHorAlign; + INT16 nGreekCharStyle; + BOOL bIsTextmode, + bScaleNormalBrackets; + +public: + SmFormat(); + SmFormat(const SmFormat &rFormat) : SfxBroadcaster() { *this = rFormat; } + + const Size & GetBaseSize() const { return aBaseSize; } + void SetBaseSize(const Size &rSize) { aBaseSize = rSize; } + + const SmFace & GetFont(USHORT nIdent) const { return vFont[nIdent]; } + void SetFont(USHORT nIdent, const SmFace &rFont, BOOL bDefault = FALSE); + void SetFontSize(USHORT nIdent, const Size &rSize) { vFont[nIdent].SetSize( rSize ); } + + void SetDefaultFont(USHORT nIdent, BOOL bVal) { bDefaultFont[nIdent] = bVal; } + BOOL IsDefaultFont(USHORT nIdent) const { return bDefaultFont[nIdent]; } + + USHORT GetRelSize(USHORT nIdent) const { return vSize[nIdent]; } + void SetRelSize(USHORT nIdent, USHORT nVal) { vSize[nIdent] = nVal;} + + USHORT GetDistance(USHORT nIdent) const { return vDist[nIdent]; } + void SetDistance(USHORT nIdent, USHORT nVal) { vDist[nIdent] = nVal; } + + SmHorAlign GetHorAlign() const { return eHorAlign; } + void SetHorAlign(SmHorAlign eAlign) { eHorAlign = eAlign; } + + BOOL IsTextmode() const { return bIsTextmode; } + void SetTextmode(BOOL bVal) { bIsTextmode = bVal; } + + INT16 GetGreekCharStyle() const { return nGreekCharStyle; } + void SetGreekCharStyle(INT16 nVal) { nGreekCharStyle = nVal; } + + BOOL IsScaleNormalBrackets() const { return bScaleNormalBrackets; } + void SetScaleNormalBrackets(BOOL bVal) { bScaleNormalBrackets = bVal; } + + long GetVersion() const { return nVersion; } + + //! at time (5.1) use only the lower byte!!! + void SetVersion(long nVer) { nVersion = nVer; } + + SmFormat & operator = (const SmFormat &rFormat); + + BOOL operator == (const SmFormat &rFormat) const; + inline BOOL operator != (const SmFormat &rFormat) const; + + void RequestApplyChanges() const + { + ((SmFormat *) this)->Broadcast(SfxSimpleHint(HINT_FORMATCHANGED)); + } + +}; + +inline BOOL SmFormat::operator != (const SmFormat &rFormat) const +{ + return !(*this == rFormat); +} + +#endif + diff --git a/starmath/inc/makefile.mk b/starmath/inc/makefile.mk new file mode 100644 index 000000000000..930e5281c6fb --- /dev/null +++ b/starmath/inc/makefile.mk @@ -0,0 +1,47 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* +PRJ=.. + +PRJNAME=starmath +TARGET=inc + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +# --- Files -------------------------------------------------------- +# --- Targets ------------------------------------------------------- + +.INCLUDE : target.mk + +.IF "$(ENABLE_PCH)"!="" +ALLTAR : \ + $(SLO)$/precompiled.pch \ + $(SLO)$/precompiled_ex.pch + +.ENDIF # "$(ENABLE_PCH)"!="" + diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx new file mode 100644 index 000000000000..92c9d4621292 --- /dev/null +++ b/starmath/inc/node.hxx @@ -0,0 +1,854 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef NODE_HXX +#define NODE_HXX + + +#include <vector> + +#include "parse.hxx" +#include "types.hxx" +#include "rect.hxx" +#include "format.hxx" + + +#define ATTR_BOLD 0x0001 +#define ATTR_ITALIC 0x0002 + +#define FNTSIZ_ABSOLUT 1 +#define FNTSIZ_PLUS 2 +#define FNTSIZ_MINUS 3 +#define FNTSIZ_MULTIPLY 4 +#define FNTSIZ_DIVIDE 5 + +// flags to interdict respective status changes +#define FLG_FONT 0x0001 +#define FLG_SIZE 0x0002 +#define FLG_BOLD 0x0004 +#define FLG_ITALIC 0x0008 +#define FLG_COLOR 0x0010 +#define FLG_VISIBLE 0x0020 +#define FLG_HORALIGN 0x0040 + + +extern SmFormat *pActiveFormat; + +class SmDocShell; +class SmNode; +class SmStructureNode; + +typedef std::vector< SmNode * > SmNodeArray; +typedef std::vector< SmStructureNode * > SmStructureNodeArray; + + +//////////////////////////////////////////////////////////////////////////////// + +enum SmScaleMode { SCALE_NONE, SCALE_WIDTH, SCALE_HEIGHT }; + +enum SmNodeType +{ + NTABLE, NBRACE, NBRACEBODY, NOPER, NALIGN, + NATTRIBUT, NFONT, NUNHOR, NBINHOR, NBINVER, + NBINDIAGONAL, NSUBSUP, NMATRIX, NPLACE, NTEXT, + NSPECIAL, NGLYPH_SPECIAL, NMATH, NBLANK, NERROR, + NLINE, NEXPRESSION, NPOLYLINE, NROOT, NROOTSYMBOL, + NRECTANGLE, NVERTICAL_BRACE +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmNode : public SmRect +{ + SmFace aFace; + + SmToken aNodeToken; + SmNodeType eType; + SmScaleMode eScaleMode; + RectHorAlign eRectHorAlign; + USHORT nFlags, + nAttributes; + BOOL bIsPhantom, + bIsDebug; +protected: + SmNode(SmNodeType eNodeType, const SmToken &rNodeToken); + + // index in accessible text -1 if not (yet) applicable + sal_Int32 nAccIndex; + +public: + virtual ~SmNode(); + + virtual BOOL IsVisible() const; + + virtual USHORT GetNumSubNodes() const; + virtual SmNode * GetSubNode(USHORT nIndex); + const SmNode * GetSubNode(USHORT nIndex) const + { + return ((SmNode *) this)->GetSubNode(nIndex); + } + + virtual SmNode * GetLeftMost(); + const SmNode * GetLeftMost() const + { + return ((SmNode *) this)->GetLeftMost(); + } + + USHORT & Flags() { return nFlags; } + USHORT & Attributes() { return nAttributes; } + + BOOL IsDebug() const { return bIsDebug; } + BOOL IsPhantom() const { return bIsPhantom; } + void SetPhantom(BOOL bIsPhantom); + void SetColor(const Color &rColor); + + void SetAttribut(USHORT nAttrib); + void ClearAttribut(USHORT nAttrib); + + const SmFace & GetFont() const { return aFace; }; + SmFace & GetFont() { return aFace; }; + + void SetFont(const SmFace &rFace); + void SetFontSize(const Fraction &rRelSize, USHORT nType); + void SetSize(const Fraction &rScale); + + virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); + virtual void PrepareAttributes(); + +#if OSL_DEBUG_LEVEL + void ToggleDebug() const; +#endif + + void SetRectHorAlign(RectHorAlign eHorAlign, BOOL bApplyToSubTree = TRUE ); + RectHorAlign GetRectHorAlign() const { return eRectHorAlign; } + + const SmRect & GetRect() const { return *this; } + SmRect & GetRect() { return *this; } + + virtual void Move(const Point &rPosition); + void MoveTo(const Point &rPosition) { Move(rPosition - GetTopLeft()); } + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + virtual void CreateTextFromNode(String &rText); + +#ifdef SM_RECT_DEBUG + using SmRect::Draw; +#endif + virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; + + virtual void GetAccessibleText( String &rText ) const; + sal_Int32 GetAccessibleIndex() const { return nAccIndex; } + const SmNode * FindNodeWithAccessibleIndex(xub_StrLen nAccIndex) const; + + USHORT GetRow() const { return (USHORT)aNodeToken.nRow; } + USHORT GetColumn() const { return (USHORT)aNodeToken.nCol; } + + SmScaleMode GetScaleMode() const { return eScaleMode; } + void SetScaleMode(SmScaleMode eMode) { eScaleMode = eMode; } + + virtual void AdaptToX(const OutputDevice &rDev, ULONG nWidth); + virtual void AdaptToY(const OutputDevice &rDev, ULONG nHeight); + + SmNodeType GetType() const { return eType; } + const SmToken & GetToken() const { return aNodeToken; } + + const SmNode * FindTokenAt(USHORT nRow, USHORT nCol) const; + const SmNode * FindRectClosestTo(const Point &rPoint) const; +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmStructureNode : public SmNode +{ + SmNodeArray aSubNodes; + +protected: + SmStructureNode(SmNodeType eNodeType, const SmToken &rNodeToken) + : SmNode(eNodeType, rNodeToken) + {} + +public: + SmStructureNode( const SmStructureNode &rNode ); + virtual ~SmStructureNode(); + + virtual BOOL IsVisible() const; + + virtual USHORT GetNumSubNodes() const; + void SetNumSubNodes(USHORT nSize) { aSubNodes.resize(nSize); } + + using SmNode::GetSubNode; + virtual SmNode * GetSubNode(USHORT nIndex); + void SetSubNodes(SmNode *pFirst, SmNode *pSecond, SmNode *pThird = NULL); + void SetSubNodes(const SmNodeArray &rNodeArray); + + virtual SmStructureNode & operator = ( const SmStructureNode &rNode ); + + virtual void GetAccessibleText( String &rText ) const; +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmVisibleNode : public SmNode +{ +protected: + SmVisibleNode(SmNodeType eNodeType, const SmToken &rNodeToken) + : SmNode(eNodeType, rNodeToken) + {} + +public: + + virtual BOOL IsVisible() const; + virtual USHORT GetNumSubNodes() const; + using SmNode::GetSubNode; + virtual SmNode * GetSubNode(USHORT nIndex); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmGraphicNode : public SmVisibleNode +{ +protected: + SmGraphicNode(SmNodeType eNodeType, const SmToken &rNodeToken) + : SmVisibleNode(eNodeType, rNodeToken) + {} + +public: + + virtual void GetAccessibleText( String &rText ) const; +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmRectangleNode : public SmGraphicNode +{ + Size aToSize; + +public: + SmRectangleNode(const SmToken &rNodeToken) + : SmGraphicNode(NRECTANGLE, rNodeToken) + {} + + virtual void AdaptToX(const OutputDevice &rDev, ULONG nWidth); + virtual void AdaptToY(const OutputDevice &rDev, ULONG nHeight); + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + +#ifdef SM_RECT_DEBUG + using SmRect::Draw; +#endif + virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; + + void CreateTextFromNode(String &rText); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmPolyLineNode : public SmGraphicNode +{ + Polygon aPoly; + Size aToSize; + long nWidth; + +public: + SmPolyLineNode(const SmToken &rNodeToken); + + long GetWidth() const { return nWidth; } + + virtual void AdaptToX(const OutputDevice &rDev, ULONG nWidth); + virtual void AdaptToY(const OutputDevice &rDev, ULONG nHeight); + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + +#ifdef SM_RECT_DEBUG + using SmRect::Draw; +#endif + virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmTextNode : public SmVisibleNode +{ + XubString aText; + USHORT nFontDesc; + +protected: + SmTextNode(SmNodeType eNodeType, const SmToken &rNodeToken, USHORT nFontDescP ); + +public: + SmTextNode(const SmToken &rNodeToken, USHORT nFontDescP ); + + USHORT GetFontDesc() const { return nFontDesc; } + void SetText(const XubString &rText) { aText = rText; } + const XubString & GetText() const { return aText; } + + virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + virtual void CreateTextFromNode(String &rText); + +#ifdef SM_RECT_DEBUG + using SmRect::Draw; +#endif + virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; + + virtual void GetAccessibleText( String &rText ) const; +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmSpecialNode : public SmTextNode +{ + bool bIsFromGreekSymbolSet; + +protected: + SmSpecialNode(SmNodeType eNodeType, const SmToken &rNodeToken, USHORT _nFontDesc); + +public: + SmSpecialNode(const SmToken &rNodeToken); + + virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + +#ifdef SM_RECT_DEBUG + using SmRect::Draw; +#endif + virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmGlyphSpecialNode : public SmSpecialNode +{ +public: + SmGlyphSpecialNode(const SmToken &rNodeToken) + : SmSpecialNode(NGLYPH_SPECIAL, rNodeToken, FNT_MATH) + {} + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmMathSymbolNode : public SmSpecialNode +{ +protected: + SmMathSymbolNode(SmNodeType eNodeType, const SmToken &rNodeToken) + : SmSpecialNode(eNodeType, rNodeToken, FNT_MATH) + { + xub_Unicode cChar = GetToken().cMathChar; + if ((xub_Unicode) '\0' != cChar) + SetText( cChar ); + } + +public: + SmMathSymbolNode(const SmToken &rNodeToken); + + virtual void AdaptToX(const OutputDevice &rDev, ULONG nWidth); + virtual void AdaptToY(const OutputDevice &rDev, ULONG nHeight); + + virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + void CreateTextFromNode(String &rText); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmRootSymbolNode : public SmMathSymbolNode +{ + ULONG nBodyWidth; // width of body (argument) of root sign + +public: + SmRootSymbolNode(const SmToken &rNodeToken) + : SmMathSymbolNode(NROOTSYMBOL, rNodeToken) + {} + + virtual void AdaptToX(const OutputDevice &rDev, ULONG nWidth); + virtual void AdaptToY(const OutputDevice &rDev, ULONG nHeight); + +#ifdef SM_RECT_DEBUG + using SmRect::Draw; +#endif + virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmPlaceNode : public SmMathSymbolNode +{ +public: + SmPlaceNode(const SmToken &rNodeToken) + : SmMathSymbolNode(NPLACE, rNodeToken) + { + } + + virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmErrorNode : public SmMathSymbolNode +{ +public: + SmErrorNode(SmParseError /*eError*/, const SmToken &rNodeToken) + : SmMathSymbolNode(NERROR, rNodeToken) + { + SetText((xub_Unicode) MS_ERROR); + } + + virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmTableNode : public SmStructureNode +{ +public: + SmTableNode(const SmToken &rNodeToken) + : SmStructureNode(NTABLE, rNodeToken) + {} + + using SmNode::GetLeftMost; + virtual SmNode * GetLeftMost(); + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmLineNode : public SmStructureNode +{ + BOOL bUseExtraSpaces; + +protected: + SmLineNode(SmNodeType eNodeType, const SmToken &rNodeToken) + : SmStructureNode(eNodeType, rNodeToken) + { + bUseExtraSpaces = TRUE; + } + +public: + SmLineNode(const SmToken &rNodeToken) + : SmStructureNode(NLINE, rNodeToken) + { + bUseExtraSpaces = TRUE; + } + + void SetUseExtraSpaces(BOOL bVal) { bUseExtraSpaces = bVal; } + BOOL IsUseExtraSpaces() const { return bUseExtraSpaces; }; + + virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmExpressionNode : public SmLineNode +{ +public: + SmExpressionNode(const SmToken &rNodeToken) + : SmLineNode(NEXPRESSION, rNodeToken) + {} + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + void CreateTextFromNode(String &rText); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmUnHorNode : public SmStructureNode +{ +public: + SmUnHorNode(const SmToken &rNodeToken) + : SmStructureNode(NUNHOR, rNodeToken) + { + SetNumSubNodes(2); + } + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmRootNode : public SmStructureNode +{ +protected: + void GetHeightVerOffset(const SmRect &rRect, + long &rHeight, long &rVerOffset) const; + Point GetExtraPos(const SmRect &rRootSymbol, const SmRect &rExtra) const; + +public: + SmRootNode(const SmToken &rNodeToken) + : SmStructureNode(NROOT, rNodeToken) + { + SetNumSubNodes(3); + } + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + void CreateTextFromNode(String &rText); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmBinHorNode : public SmStructureNode +{ +public: + SmBinHorNode(const SmToken &rNodeToken) + : SmStructureNode(NBINHOR, rNodeToken) + { + SetNumSubNodes(3); + } + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmBinVerNode : public SmStructureNode +{ +public: + SmBinVerNode(const SmToken &rNodeToken) + : SmStructureNode(NBINVER, rNodeToken) + { + SetNumSubNodes(3); + } + + using SmNode::GetLeftMost; + virtual SmNode * GetLeftMost(); + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + void CreateTextFromNode(String &rText); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmBinDiagonalNode : public SmStructureNode +{ + BOOL bAscending; + + void GetOperPosSize(Point &rPos, Size &rSize, + const Point &rDiagPoint, double fAngleDeg) const; + +public: + SmBinDiagonalNode(const SmToken &rNodeToken); + + BOOL IsAscending() const { return bAscending; } + void SetAscending(BOOL bVal) { bAscending = bVal; } + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +// enums used to index sub-/supscripts in the 'aSubNodes' array +// in 'SmSubSupNode' +// See graphic for positions at char: +// +// CSUP +// +// LSUP H H RSUP +// H H +// HHHH +// H H +// LSUB H H RSUB +// +// CSUB +// +enum SmSubSup +{ CSUB, CSUP, RSUB, RSUP, LSUB, LSUP +}; + +// numbers of entries in the above enum (that is: the number of possible +// sub-/supscripts) +#define SUBSUP_NUM_ENTRIES 6 + + +class SmSubSupNode : public SmStructureNode +{ + BOOL bUseLimits; + +public: + SmSubSupNode(const SmToken &rNodeToken) + : SmStructureNode(NSUBSUP, rNodeToken) + { + SetNumSubNodes(1 + SUBSUP_NUM_ENTRIES); + bUseLimits = FALSE; + } + + SmNode * GetBody() { return GetSubNode(0); } + const SmNode * GetBody() const + { + return ((SmSubSupNode *) this)->GetBody(); + } + + void SetUseLimits(BOOL bVal) { bUseLimits = bVal; } + BOOL IsUseLimits() const { return bUseLimits; }; + + SmNode * GetSubSup(SmSubSup eSubSup) { return GetSubNode( sal::static_int_cast< USHORT >(1 + eSubSup) ); }; + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + void CreateTextFromNode(String &rText); + +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmBraceNode : public SmStructureNode +{ +public: + SmBraceNode(const SmToken &rNodeToken) + : SmStructureNode(NBRACE, rNodeToken) + { + SetNumSubNodes(3); + } + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + void CreateTextFromNode(String &rText); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmBracebodyNode : public SmStructureNode +{ + long nBodyHeight; + +public: + inline SmBracebodyNode(const SmToken &rNodeToken); + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + long GetBodyHeight() const { return nBodyHeight; } +}; + + +inline SmBracebodyNode::SmBracebodyNode(const SmToken &rNodeToken) : + SmStructureNode(NBRACEBODY, rNodeToken) +{ + nBodyHeight = 0; +} + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmVerticalBraceNode : public SmStructureNode +{ +public: + inline SmVerticalBraceNode(const SmToken &rNodeToken); + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +inline SmVerticalBraceNode::SmVerticalBraceNode(const SmToken &rNodeToken) : + SmStructureNode(NVERTICAL_BRACE, rNodeToken) +{ + SetNumSubNodes(3); +} + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmOperNode : public SmStructureNode +{ +public: + SmOperNode(const SmToken &rNodeToken) + : SmStructureNode(NOPER, rNodeToken) + { + SetNumSubNodes(2); + } + + SmNode * GetSymbol(); + const SmNode * GetSymbol() const + { + return ((SmOperNode *) this)->GetSymbol(); + } + + long CalcSymbolHeight(const SmNode &rSymbol, const SmFormat &rFormat) const; + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmAlignNode : public SmStructureNode +{ +public: + SmAlignNode(const SmToken &rNodeToken) + : SmStructureNode(NALIGN, rNodeToken) + {} + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmAttributNode : public SmStructureNode +{ +public: + SmAttributNode(const SmToken &rNodeToken) + : SmStructureNode(NATTRIBUT, rNodeToken) + {} + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + void CreateTextFromNode(String &rText); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmFontNode : public SmStructureNode +{ + USHORT nSizeType; + Fraction aFontSize; + +public: + SmFontNode(const SmToken &rNodeToken) + : SmStructureNode(NFONT, rNodeToken) + { + nSizeType = FNTSIZ_MULTIPLY; + aFontSize = Fraction(1L); + } + + void SetSizeParameter(const Fraction &rValue, USHORT nType); + const Fraction & GetSizeParameter() const {return aFontSize;} + const USHORT& GetSizeType() const {return nSizeType;} + + virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + void CreateTextFromNode(String &rText); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmMatrixNode : public SmStructureNode +{ + USHORT nNumRows, + nNumCols; + +public: + SmMatrixNode(const SmToken &rNodeToken) + : SmStructureNode(NMATRIX, rNodeToken) + { + nNumRows = nNumCols = 0; + } + + USHORT GetNumRows() const {return nNumRows;} + USHORT GetNumCols() const {return nNumCols;} + void SetRowCol(USHORT nMatrixRows, USHORT nMatrixCols); + + using SmNode::GetLeftMost; + virtual SmNode * GetLeftMost(); + + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); + void CreateTextFromNode(String &rText); +}; + + +//////////////////////////////////////////////////////////////////////////////// + + +class SmBlankNode : public SmGraphicNode +{ + USHORT nNum; + +public: + SmBlankNode(const SmToken &rNodeToken) + : SmGraphicNode(NBLANK, rNodeToken) + { + nNum = 0; + } + + void IncreaseBy(const SmToken &rToken); + void Clear() { nNum = 0; } + + virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); + virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); +}; + + +//////////////////////////////////////////////////////////////////////////////// + +#endif + + diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx new file mode 100644 index 000000000000..facf17d561e2 --- /dev/null +++ b/starmath/inc/parse.hxx @@ -0,0 +1,269 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef PARSE_HXX +#define PARSE_HXX + + +#include <vcl/svapp.hxx> +#include <tools/stack.hxx> +#include <tools/list.hxx> +#include <tools/string.hxx> + +#include "types.hxx" + +class SmNode; +class SmDocShell; + + +// TokenGroups +#define TGOPER 0x00000001 +#define TGRELATION 0x00000002 +#define TGSUM 0x00000004 +#define TGPRODUCT 0x00000008 +#define TGUNOPER 0x00000010 +#define TGPOWER 0x00000020 +#define TGATTRIBUT 0x00000040 +#define TGALIGN 0x00000080 +#define TGFUNCTION 0x00000100 +#define TGBLANK 0x00000200 +#define TGLBRACES 0x00000400 +#define TGRBRACES 0x00000800 +#define TGCOLOR 0x00001000 +#define TGFONT 0x00002000 +#define TGSTANDALONE 0x00004000 +#define TGDISCARDED 0x00008000 +#define TGLIMIT 0x00010000 +#define TGFONTATTR 0x00020000 + + +enum SmTokenType +{ + TEND, TLGROUP, TRGROUP, TLPARENT, TRPARENT, + TLBRACKET, TRBRACKET, TPLUS, TMINUS, TMULTIPLY, + TDIVIDEBY, TASSIGN, TPOUND, TSPECIAL, TSLASH, + TBACKSLASH, TBLANK, TSBLANK, TRSUB, TRSUP, + TCSUB, TCSUP, TLSUB, TLSUP, TGT, + TLT, TAND, TOR, TINTERSECT, TUNION, + TNEWLINE, TBINOM, TFROM, TTO, TINT, + TSUM, TOPER, TABS, TSQRT, TFACT, + TNROOT, TOVER, TTIMES, TGE, TLE, + TGG, TLL, TDOTSAXIS, TDOTSLOW, TDOTSVERT, + TDOTSDIAG, TDOTSUP, TDOTSDOWN, TACUTE, TBAR, + TBREVE, TCHECK, TCIRCLE, TDOT, TDDOT, + TDDDOT, TGRAVE, THAT, TTILDE, TVEC, + TUNDERLINE, TOVERLINE, TOVERSTRIKE, TITALIC, TNITALIC, + TBOLD, TNBOLD, TPHANTOM, TFONT, TSIZE, + TCOLOR, TALIGNL, TALIGNC, TALIGNR, TLEFT, + TRIGHT, TLANGLE, TLBRACE, TLLINE, TLDLINE, + TLCEIL, TLFLOOR, TNONE, TMLINE, TRANGLE, + TRBRACE, TRLINE, TRDLINE, TRCEIL, TRFLOOR, + TSIN, TCOS, TTAN, TCOT, TFUNC, + TSTACK, TMATRIX, TMATFORM, TDPOUND, TPLACE, + TTEXT, TNUMBER, TCHARACTER, TIDENT, TNEQ, + TEQUIV, TDEF, TPROP, TSIM, TSIMEQ, + TAPPROX, TPARALLEL, TORTHO, TIN, TNOTIN, + TSUBSET, TSUBSETEQ, TSUPSET, TSUPSETEQ, TPLUSMINUS, + TMINUSPLUS, TOPLUS, TOMINUS, TDIV, TOTIMES, + TODIVIDE, TTRANSL, TTRANSR, TIINT, TIIINT, + TLINT, TLLINT, TLLLINT, TPROD, TCOPROD, + TFORALL, TEXISTS, TLIM, TNABLA, TTOWARD, + TSINH, TCOSH, TTANH, TCOTH, TASIN, + TACOS, TATAN, TLN, TLOG, TUOPER, + TBOPER, TBLACK, TWHITE, TRED, TGREEN, + TBLUE, TCYAN, TMAGENTA, TYELLOW, TFIXED, + TSANS, TSERIF, TPOINT, TASINH, TACOSH, + TATANH, TACOTH, TACOT, TEXP, TCDOT, + TODOT, TLESLANT, TGESLANT, TNSUBSET, TNSUPSET, + TNSUBSETEQ, TNSUPSETEQ, TPARTIAL, TNEG, TNI, + TBACKEPSILON, TALEPH, TIM, TRE, TWP, + TEMPTYSET, TINFINITY, TESCAPE, TLIMSUP, TLIMINF, + TNDIVIDES, TDRARROW, TDLARROW, TDLRARROW, TUNDERBRACE, + TOVERBRACE, TCIRC, TTOP, THBAR, TLAMBDABAR, + TLEFTARROW, TRIGHTARROW, TUPARROW, TDOWNARROW, TDIVIDES, + TNDIBVIDES, TSETN, TSETZ, TSETQ, TSETR, + TSETC, TWIDEVEC, TWIDETILDE, TWIDEHAT, TWIDESLASH, + TWIDEBACKSLASH, TLDBRACKET, TRDBRACKET, TNOSPACE, + TUNKNOWN, TDEBUG +}; + + +struct SmToken +{ + // token text + String aText; + // token info + SmTokenType eType; + sal_Unicode cMathChar; + // parse-help info + ULONG nGroup; + USHORT nLevel; + // token position + USHORT nRow; + xub_StrLen nCol; + + SmToken(); +}; + + +enum SmParseError +{ + PE_NONE, PE_UNEXPECTED_END_OF_INPUT, + PE_UNEXPECTED_CHAR, PE_UNEXPECTED_TOKEN, + PE_FUNC_EXPECTED, PE_UNOPER_EXPECTED, + PE_BINOPER_EXPECTED, PE_SYMBOL_EXPECTED, + PE_IDENTIFIER_EXPECTED, PE_POUND_EXPECTED, + PE_COLOR_EXPECTED, PE_LGROUP_EXPECTED, + PE_RGROUP_EXPECTED, PE_LBRACE_EXPECTED, + PE_RBRACE_EXPECTED, PE_PARENT_MISMATCH, + PE_RIGHT_EXPECTED, PE_FONT_EXPECTED, + PE_SIZE_EXPECTED, PE_DOUBLE_ALIGN, + PE_DOUBLE_SUBSUPSCRIPT +}; + + +struct SmErrorDesc +{ + SmParseError Type; + SmNode *pNode; + String Text; +}; + +DECLARE_STACK(SmNodeStack, SmNode *) +DECLARE_LIST(SmErrDescList, SmErrorDesc *) + +/**************************************************************************/ + +// defines possible conversions of the formula text from the format of +// one release to the one of another. +enum SmConvert +{ + CONVERT_NONE, + CONVERT_40_TO_50, + CONVERT_50_TO_60, + CONVERT_60_TO_50 +}; + + +class SmParser +{ + String BufferString; + SmToken CurToken; + SmNodeStack NodeStack; + SmErrDescList ErrDescList; + int CurError; + LanguageType nLang; + xub_StrLen BufferIndex, + nTokenIndex; + USHORT Row, + ColOff; + SmConvert eConversion; + BOOL bImportSymNames, + bExportSymNames; + + // declare copy-constructor and assignment-operator private + SmParser(const SmParser &); + SmParser & operator = (const SmParser &); + +protected: +#if OSL_DEBUG_LEVEL + BOOL IsDelimiter( const String &rTxt, xub_StrLen nPos ); +#endif + void NextToken(); + xub_StrLen GetTokenIndex() const { return nTokenIndex; } + void Insert(const String &rText, USHORT nPos); + void Replace( USHORT nPos, USHORT nLen, const String &rText ); + + inline BOOL TokenInGroup(ULONG nGroup); + + // grammar + void Table(); + void Line(); + void Expression(); + void Relation(); + void Sum(); + void Product(); + void SubSup(ULONG nActiveGroup); + void OpSubSup(); + void Power(); + void Blank(); + void Term(); + void Escape(); + void Operator(); + void Oper(); + void UnOper(); + void Align(); + void FontAttribut(); + void Attribut(); + void Font(); + void FontSize(); + void Color(); + void Brace(); + void Bracebody(BOOL bIsLeftRight); + void Function(); + void Binom(); + void Stack(); + void Matrix(); + void Special(); + void GlyphSpecial(); + // end of grammar + + LanguageType GetLanguage() const { return nLang; } + void SetLanguage( LanguageType nNewLang ) { nLang = nNewLang; } + + void Error(SmParseError Error); + +public: + SmParser(); + + SmNode *Parse(const String &rBuffer); + + const String & GetText() const { return BufferString; }; + + SmConvert GetConversion() const { return eConversion; } + void SetConversion(SmConvert eConv) { eConversion = eConv; } + + BOOL IsImportSymbolNames() const { return bImportSymNames; } + void SetImportSymbolNames(BOOL bVal) { bImportSymNames = bVal; } + BOOL IsExportSymbolNames() const { return bExportSymNames; } + void SetExportSymbolNames(BOOL bVal) { bExportSymNames = bVal; } + + USHORT AddError(SmParseError Type, SmNode *pNode); + + const SmErrorDesc * NextError(); + const SmErrorDesc * PrevError(); + const SmErrorDesc * GetError(USHORT i = 0xFFFF); +}; + + +inline BOOL SmParser::TokenInGroup(ULONG nGroup) +{ + return (CurToken.nGroup & nGroup) ? TRUE : FALSE; +} + + +#endif + diff --git a/starmath/inc/pch/precompiled_starmath.cxx b/starmath/inc/pch/precompiled_starmath.cxx new file mode 100644 index 000000000000..e47f70d5909d --- /dev/null +++ b/starmath/inc/pch/precompiled_starmath.cxx @@ -0,0 +1,29 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_starmath.hxx" + diff --git a/starmath/inc/pch/precompiled_starmath.hxx b/starmath/inc/pch/precompiled_starmath.hxx new file mode 100644 index 000000000000..51f5fa1fed8c --- /dev/null +++ b/starmath/inc/pch/precompiled_starmath.hxx @@ -0,0 +1,32 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): Generated on 2006-09-01 17:50:02.482976 + +#ifdef PRECOMPILED_HEADERS +#endif + diff --git a/starmath/inc/rect.hxx b/starmath/inc/rect.hxx new file mode 100644 index 000000000000..f1af81c5c163 --- /dev/null +++ b/starmath/inc/rect.hxx @@ -0,0 +1,260 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef RECT_HXX +#define RECT_HXX + +#include <new> + + +#include <tools/gen.hxx> +#include <vcl/outdev.hxx> +#include <vcl/metric.hxx> +#include <tools/debug.hxx> + +#include "format.hxx" + + +BOOL SmGetGlyphBoundRect(const OutputDevice &rDev, + const XubString &rText, Rectangle &rRect); + +BOOL SmIsMathAlpha(const XubString &rText); + + +inline long SmFromTo(long nFrom, long nTo, double fRelDist) +{ + return nFrom + (long) (fRelDist * (nTo - nFrom)); +} + + +//////////////////////////////////////// +// SmRect +// ... (to be done) +// This Implementation assumes that the x-axis points to the right and the +// y-axis to the bottom. +// Note: however, italic spaces can be negative! +// + +// possible flags for the 'Draw' function below (just for debugging) +#define SM_RECT_CORE 0x0001 +#define SM_RECT_ITALIC 0x0002 +#define SM_RECT_LINES 0x0004 +#define SM_RECT_MID 0x0008 + +// possible positions and alignments for the 'AlignTo' function +enum RectPos + // (RP_LEFT : align the current object to the left of the argument, ...) +{ RP_LEFT, RP_RIGHT, + RP_TOP, RP_BOTTOM, + RP_ATTRIBUT +}; +enum RectHorAlign +{ RHA_LEFT, RHA_CENTER, RHA_RIGHT +}; +enum RectVerAlign +{ RVA_TOP, RVA_MID, RVA_BOTTOM, RVA_BASELINE, RVA_CENTERY, + RVA_ATTRIBUT_HI, RVA_ATTRIBUT_MID, RVA_ATTRIBUT_LO +}; + +// different methods of copying baselines and mid's in 'ExtendBy' function +enum RectCopyMBL +{ RCP_THIS, // keep baseline of current object even if it has none + RCP_ARG, // as above but for the argument + RCP_NONE, // result will have no baseline + RCP_XOR // if current object has a baseline keep it else copy + // the arguments baseline (even if it has none) +}; + + +class SmRect +{ + Point aTopLeft; + Size aSize; + long nBaseline, + nAlignT, + nAlignM, + nAlignB, + nGlyphTop, + nGlyphBottom, + nItalicLeftSpace, + nItalicRightSpace, + nLoAttrFence, + nHiAttrFence; + USHORT nBorderWidth; + BOOL bHasBaseline, + bHasAlignInfo; + +protected: + void BuildRect (const OutputDevice &rDev, const SmFormat *pFormat, + const XubString &rText, USHORT nBorderWidth); + void Init(const OutputDevice &rDev, const SmFormat *pFormat, + const XubString &rText, USHORT nBorderWidth); + + void ClearBaseline() { bHasBaseline = FALSE; }; + inline void CopyMBL(const SmRect& rRect); + void CopyAlignInfo(const SmRect& rRect); + + SmRect & Union(const SmRect &rRect); + +public: + SmRect(); + SmRect(const OutputDevice &rDev, const SmFormat *pFormat, + const XubString &rText, long nBorderWidth); + SmRect(long nWidth, long nHeight); + SmRect(const SmRect &rRect); + + + USHORT GetBorderWidth() const { return nBorderWidth; } + + void SetItalicSpaces(long nLeftSpace, long nRightSpace); + + void SetWidth(ULONG nWidth) { aSize.Width() = nWidth; } + void SetHeight(ULONG nHeight) { aSize.Height() = nHeight; } + + void SetLeft(long nLeft); + void SetRight(long nRight); + void SetBottom(long nBottom); + void SetTop(long nTop); + + const Point & GetTopLeft() const { return aTopLeft; } + + long GetTop() const { return GetTopLeft().Y(); } + long GetLeft() const { return GetTopLeft().X(); } + long GetBottom() const { return GetTop() + GetHeight() - 1; } + long GetRight() const { return GetLeft() + GetWidth() - 1; } + long GetCenterX() const { return (GetLeft() + GetRight()) / 2L; } + long GetCenterY() const { return (GetTop() + GetBottom()) / 2L; } + long GetWidth() const { return GetSize().Width(); } + long GetHeight() const { return GetSize().Height(); } + + long GetItalicLeftSpace() const { return nItalicLeftSpace; } + long GetItalicRightSpace() const { return nItalicRightSpace; } + + void SetHiAttrFence(long nVal) { nHiAttrFence = nVal; } + void SetLoAttrFence(long nVal) { nLoAttrFence = nVal; } + long GetHiAttrFence() const { return nHiAttrFence; } + long GetLoAttrFence() const { return nLoAttrFence; } + + long GetItalicLeft() const { return GetLeft() - GetItalicLeftSpace(); } + long GetItalicCenterX() const { return (GetItalicLeft() + GetItalicRight()) / 2; } + long GetItalicRight() const { return GetRight() + GetItalicRightSpace(); } + long GetItalicWidth() const { return GetWidth() + GetItalicLeftSpace() + GetItalicRightSpace(); } + + BOOL HasBaseline() const { return bHasBaseline; } + inline long GetBaseline() const; + long GetBaselineOffset() const { return GetBaseline() - GetTop(); } + + void SetAlignTop(long nVal) { nAlignT = nVal; } + + long GetAlignT() const { return nAlignT; } + long GetAlignM() const { return nAlignM; } + long GetAlignB() const { return nAlignB; } + + void SetAlignT(long nVal) { nAlignT = nVal; } + + const Point GetCenter() const + { return Point(GetCenterX(), GetCenterY()); } + + const Size & GetSize() const { return aSize; } + + const Size GetItalicSize() const + { return Size(GetItalicWidth(), GetHeight()); } + + void Move (const Point &rPosition); + void MoveTo(const Point &rPosition) { Move(rPosition - GetTopLeft()); } + + BOOL IsEmpty() const + { + return GetWidth() == 0 || GetHeight() == 0; + } + + BOOL HasAlignInfo() const { return bHasAlignInfo; } + + const Point AlignTo(const SmRect &rRect, RectPos ePos, + RectHorAlign eHor, RectVerAlign eVer) const; + + SmRect & ExtendBy(const SmRect &rRect, RectCopyMBL eCopyMode); + SmRect & ExtendBy(const SmRect &rRect, RectCopyMBL eCopyMode, + long nNewAlignM); + SmRect & ExtendBy(const SmRect &rRect, RectCopyMBL eCopyMode, + BOOL bKeepVerAlignParams); + + long OrientedDist(const Point &rPoint) const; + BOOL IsInsideRect(const Point &rPoint) const; + BOOL IsInsideItalicRect(const Point &rPoint) const; + + inline SmRect & operator = (const SmRect &rRect); + + inline Rectangle AsRectangle() const; + SmRect AsGlyphRect() const; + +#ifdef SM_RECT_DEBUG + void Draw(OutputDevice &rDev, const Point &rPosition, int nFlags) const; +#endif +}; + + +inline void SmRect::SetItalicSpaces(long nLeftSpace, long nRightSpace) + // set extra spacing to the left and right for (italic) + // letters/text +{ + nItalicLeftSpace = nLeftSpace; + nItalicRightSpace = nRightSpace; +} + + +inline void SmRect::CopyMBL(const SmRect &rRect) + // copy AlignM baseline and value of 'rRect' +{ + nBaseline = rRect.nBaseline; + bHasBaseline = rRect.bHasBaseline; + nAlignM = rRect.nAlignM; +} + + +inline long SmRect::GetBaseline() const +{ + DBG_ASSERT(HasBaseline(), "Sm: Baseline nicht vorhanden"); + return nBaseline; +} + + +inline SmRect & SmRect::operator = (const SmRect &rRect) +{ + new (this) SmRect(rRect); // placement new + return *this; +} + + +inline Rectangle SmRect::AsRectangle() const +{ + return Rectangle(Point(GetItalicLeft(), GetTop()), GetItalicSize()); +} + + + +#endif diff --git a/starmath/inc/smdll.hxx b/starmath/inc/smdll.hxx new file mode 100644 index 000000000000..79f51a82f912 --- /dev/null +++ b/starmath/inc/smdll.hxx @@ -0,0 +1,50 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SMDLL_HXX +#define SMDLL_HXX + +#include <tools/resid.hxx> +#include <sfx2/sfxdefs.hxx> +#include "smmod.hxx" + +class SmData; +class SfxMedium; +class SfxFilter; + +class SmDLL +{ + static BOOL bInitialized; +public: + static void Init(); + static void Exit(); + + static ULONG DetectFilter( SfxMedium& rMedium, const SfxFilter **ppFilter, + SfxFilterFlags nMust, SfxFilterFlags nDont ); +}; + +#endif + diff --git a/starmath/inc/smmod.hxx b/starmath/inc/smmod.hxx new file mode 100644 index 000000000000..f74beb9de92b --- /dev/null +++ b/starmath/inc/smmod.hxx @@ -0,0 +1,181 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SMMOD_HXX +#define _SMMOD_HXX + +#ifndef _SV_RESARY_HXX +#include <tools/resary.hxx> +#endif +#include <svl/lstner.hxx> +#include <svtools/colorcfg.hxx> + +#include <tools/shl.hxx> +#include <sfx2/module.hxx> + +#ifndef _STARMATH_HRC +#include "starmath.hrc" +#endif + +#include <unotools/options.hxx> + +class SvxErrorHandler; +class SfxObjectFactory; +class SmConfig; +class SmModule; +class SmSymbolManager; + +/************************************************************************* +|* +|* This subclass of <SfxModule> (which is a subclass of <SfxShell>) is +|* linked to the DLL. One instance of this class exists while the DLL is +|* loaded. +|* +|* SdModule is like to be compared with the <SfxApplication>-subclass. +|* +|* Remember: Don`t export this class! It uses DLL-internal symbols. +|* +\************************************************************************/ + +class SvtSysLocale; +class VirtualDevice; + +///////////////////////////////////////////////////////////////// + +class SmResId : public ResId +{ +public: + SmResId(USHORT nId); +}; + +class SmNamesArray : public Resource +{ + ResStringArray aNamesAry; + LanguageType nLanguage; + +public: + SmNamesArray( LanguageType nLang, int nRID ) : + Resource( SmResId(RID_LOCALIZED_NAMES) ), + aNamesAry (SmResId( static_cast < USHORT > ( nRID ))), + nLanguage (nLang) + { + FreeResource(); + } + + LanguageType GetLanguage() const { return nLanguage; } + const ResStringArray& GetNamesArray() const { return aNamesAry; } +}; + +///////////////////////////////////////////////////////////////// + +class SmLocalizedSymbolData : public Resource +{ + ResStringArray aUiSymbolNamesAry; + ResStringArray aExportSymbolNamesAry; + ResStringArray aUiSymbolSetNamesAry; + ResStringArray aExportSymbolSetNamesAry; + SmNamesArray *p50NamesAry; + SmNamesArray *p60NamesAry; + LanguageType n50NamesLang; + LanguageType n60NamesLang; + +public: + SmLocalizedSymbolData(); + ~SmLocalizedSymbolData(); + + const ResStringArray& GetUiSymbolNamesArray() const { return aUiSymbolNamesAry; } + const ResStringArray& GetExportSymbolNamesArray() const { return aExportSymbolNamesAry; } + const String GetUiSymbolName( const String &rExportName ) const; + const String GetExportSymbolName( const String &rUiName ) const; + + const ResStringArray& GetUiSymbolSetNamesArray() const { return aUiSymbolSetNamesAry; } + const ResStringArray& GetExportSymbolSetNamesArray() const { return aExportSymbolSetNamesAry; } + const String GetUiSymbolSetName( const String &rExportName ) const; + const String GetExportSymbolSetName( const String &rUiName ) const; + + const ResStringArray* Get50NamesArray( LanguageType nLang ); + const ResStringArray* Get60NamesArray( LanguageType nLang ); +}; + +///////////////////////////////////////////////////////////////// + +class SmModule : public SfxModule, utl::ConfigurationListener +{ + svtools::ColorConfig *pColorConfig; + SmConfig *pConfig; + SmLocalizedSymbolData *pLocSymbolData; + SvtSysLocale *pSysLocale; + VirtualDevice *pVirtualDev; + + virtual void FillStatusBar(StatusBar &rBar); + void _CreateSysLocale() const; + void _CreateVirtualDev() const; + + void ApplyColorConfigValues( const svtools::ColorConfig &rColorCfg ); + +public: + TYPEINFO(); + SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START + 0) + + SmModule(SfxObjectFactory* pObjFact); + virtual ~SmModule(); + + virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ); + + svtools::ColorConfig & GetColorConfig(); + + SmConfig * GetConfig(); + SmSymbolManager & GetSymbolManager(); + + SmLocalizedSymbolData & GetLocSymbolData() const; + + void GetState(SfxItemSet&); + + const SvtSysLocale& GetSysLocale() const + { + if( !pSysLocale ) + _CreateSysLocale(); + return *pSysLocale; + } + + VirtualDevice & GetDefaultVirtualDev() + { + if (!pVirtualDev) + _CreateVirtualDev(); + return *pVirtualDev; + } + + //virtuelle Methoden fuer den Optionendialog + virtual SfxItemSet* CreateItemSet( USHORT nId ); + virtual void ApplyItemSet( USHORT nId, const SfxItemSet& rSet ); + virtual SfxTabPage* CreateTabPage( USHORT nId, Window* pParent, const SfxItemSet& rSet ); +}; + +#define SM_MOD() ( *(SmModule**) GetAppData(SHL_SM) ) + +#endif // _SDMOD_HXX + diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc new file mode 100644 index 000000000000..8d156792e1d3 --- /dev/null +++ b/starmath/inc/starmath.hrc @@ -0,0 +1,768 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _STARMATH_HRC +#define _STARMATH_HRC + +#include <svl/solar.hrc> +#include <sfx2/sfxsids.hrc> +#include <editeng/memberids.hrc> + +#define SID_NEXTERR (SID_SMA_START + 1) +#define SID_PREVERR (SID_SMA_START + 2) +#define SID_NEXTMARK (SID_SMA_START + 3) +#define SID_PREVMARK (SID_SMA_START + 4) +#define SID_SYMBOLS_CATALOGUE (SID_SMA_START + 5) +#define SID_PREFERENCES (SID_SMA_START + 6) +#define SID_VIEW050 (SID_SMA_START + 7) +#define SID_VIEW100 (SID_SMA_START + 8) +#define SID_VIEW200 (SID_SMA_START + 9) +#define SID_ZOOMIN (SID_SMA_START + 10) +#define SID_ZOOMOUT (SID_SMA_START + 11) +#define SID_DRAW (SID_SMA_START + 12) +#define SID_ADJUST (SID_SMA_START + 13) +#define SID_TOOLBOX (SID_SMA_START + 14) +#define SID_FORMULACURSOR (SID_SMA_START + 15) +#define SID_FONT (SID_SMA_START + 50) +#define SID_FONTSIZE (SID_SMA_START + 51) +#define SID_DISTANCE (SID_SMA_START + 52) +#define SID_ALIGN (SID_SMA_START + 53) + +#define SID_AUTO_REDRAW (SID_SMA_START + 55) +#define SID_SYMBOLS (SID_SMA_START + 56) // Muss erstmal wieder aufgenommen werden ! +#define SID_TEXTMODE (SID_SMA_START + 57) +#define SID_INSERT_FORMULA (SID_SMA_START + 58) +#define SID_TEXT (SID_SMA_START + 100) +#define SID_GAPHIC_SM (SID_SMA_START + 101) +#define SID_FITINWINDOW (SID_SMA_START + 103) +#define SID_INSERTTEXT (SID_SMA_START + 104) +#define SID_INSERTCOMMAND (SID_SMA_START + 105) + +#define SID_LOADSYMBOLS (SID_SMA_START + 107) +#define SID_SAVESYMBOLS (SID_SMA_START + 108) +#define SID_ZOOMSTATUS (SID_SMA_START + 109) +#define SID_MODIFYSTATUS (SID_SMA_START + 110) +#define SID_TEXTSTATUS (SID_SMA_START + 111) + +#define SID_PRINTTITLE (SID_SMA_START + 112) +#define SID_PRINTTEXT (SID_SMA_START + 113) +#define SID_PRINTFRAME (SID_SMA_START + 114) +#define SID_PRINTSIZE (SID_SMA_START + 115) +#define SID_PRINTZOOM (SID_SMA_START + 116) + +#define SID_COPYOBJECT (SID_SMA_START + 117) +#define SID_PASTEOBJECT (SID_SMA_START + 118) +#define SID_AUTOREDRAW (SID_SMA_START + 119) + +#define SID_GETEDITTEXT (SID_SMA_START + 121) +#define SID_CMDBOXWINDOW (SID_SMA_START + 122) +#define SID_TOOLBOXWINDOW (SID_SMA_START + 123) +#define SID_NO_RIGHT_SPACES (SID_SMA_START + 124) +#define SID_DUMMY (SID_SMA_START + 254) + +//#define GID_FORMEL (RID_GROUPS_OFFSET + 1) +//#define GID_ERROR (RID_GROUPS_OFFSET + 2) + +//#define RID_OPTIONSDIALOG (RID_APP_START + 1) +#define RID_FONTDIALOG (RID_APP_START + 2) +#define RID_FONTSIZEDIALOG (RID_APP_START + 3) +#define RID_FONTTYPEDIALOG (RID_APP_START + 4) +#define RID_DISTANCEDIALOG (RID_APP_START + 5) +#define RID_ALIGNDIALOG (RID_APP_START + 6) +#define RID_PRINTOPTIONPAGE (RID_APP_START + 7) +#define RID_SYMBOLDIALOG (RID_APP_START + 8) +#define RID_SYMDEFINEDIALOG (RID_APP_START + 9) +#define RID_EXTRAOPTIONPAGE (RID_APP_START + 10) +#define RID_PRINTUIOPTIONS (RID_APP_START + 11) + +#define RID_MATH_TOOLBOX (RID_APP_START + 50) +// wegen #58705# entfernt +//#define RID_DRAW_OBJECTBAR (RID_APP_START + 51) + +#define RID_DEFAULTSAVEQUERY (RID_APP_START + 102) +#define RID_WRITESYMBOLERROR (RID_APP_START + 202) +#define RID_READSYMBOLERROR (RID_APP_START + 203) +#define RID_NOMATHTYPEFACEWARNING (RID_APP_START + 204) +#define RID_OBJECTNAME (RID_APP_START + 501) + // free +#define RID_UNDOEDITNAME (RID_APP_START + 503) +#define RID_UNDOFORMATNAME (RID_APP_START + 504) +#define RID_APPICO (RID_APP_START + 601) +#define RID_TMPICO (RID_APP_START + 603) +#define RID_COMMANDMENU (RID_APP_START + 701) +#define RID_VIEWMENU (RID_APP_START + 702) +#define RID_DISTANCEMENU (RID_APP_START + 703) +#define RID_FONTMENU (RID_APP_START + 704) +#define RID_STARTUPWINDOW (RID_APP_START + 800) +#define RID_TOOLBOXWINDOW (RID_APP_START + 801) +#define RID_CMDBOXWINDOW (RID_APP_START + 802) +#define RID_FONTREGULAR (RID_APP_START + 804) +#define RID_FONTITALIC (RID_APP_START + 805) +#define RID_FONTBOLD (RID_APP_START + 806) +//#define RID_PRINTOPTION (RID_APP_START + 807) +#define RID_DOCUMENTSTR (RID_APP_START + 808) +#define RID_SYMBOLFILESSTR (RID_APP_START + 809) +#define RID_ALLFILESSTR (RID_APP_START + 810) +#define RID_CREATORSTR (RID_APP_START + 811) +#define RID_FILESMFTYP (RID_APP_START + 812) +#define RID_FILESYMTYP (RID_APP_START + 813) +#define RID_SMMENU (RID_APP_START + 814) +#define RID_SMACCEL (RID_APP_START + 815) +#define RID_STATUSBAR (RID_APP_START + 816) +#define RID_APPNAMESTR (RID_APP_START + 817) + +#define STR_MATH_DOCUMENT_FULLTYPE_CURRENT (RID_APP_START + 821) +#define RID_SMPLUGINMENU (RID_APP_START + 822) +#define STR_STATSTR_READING (RID_APP_START + 823) +#define STR_STATSTR_WRITING (RID_APP_START + 824) +#define STR_CMDBOXWINDOW (RID_APP_START + 825) + +#define RID_ERR_IDENT (RID_APP_START + 920) +#define RID_ERR_UNKOWN (RID_APP_START + 921) +#define RID_ERR_UNEXPECTEDCHARACTER (RID_APP_START + 922) +#define RID_ERR_LGROUPEXPECTED (RID_APP_START + 923) +#define RID_ERR_RGROUPEXPECTED (RID_APP_START + 924) +#define RID_ERR_LBRACEEXPECTED (RID_APP_START + 925) +#define RID_ERR_RBRACEEXPECTED (RID_APP_START + 926) +#define RID_ERR_FUNCEXPECTED (RID_APP_START + 927) +#define RID_ERR_UNOPEREXPECTED (RID_APP_START + 928) +#define RID_ERR_BINOPEREXPECTED (RID_APP_START + 929) +#define RID_ERR_SYMBOLEXPECTED (RID_APP_START + 930) +#define RID_ERR_IDENTEXPECTED (RID_APP_START + 931) +#define RID_ERR_POUNDEXPECTED (RID_APP_START + 932) +#define RID_ERR_COLOREXPECTED (RID_APP_START + 933) +#define RID_ERR_LPARENTEXPECTED (RID_APP_START + 934) +#define RID_ERR_RPARENTEXPECTED (RID_APP_START + 935) +#define RID_ERR_RIGHTEXPECTED (RID_APP_START + 936) +#define RID_ERR_OVERFLOW (RID_APP_START + 937) + +// toolbox image lists for 'Selection' window +//!! RID_ILH_XYZ = RID_IL_XYZ + 1 !! +#define RID_IL_CATALOG (RID_APP_START + 950) +#define RID_ILH_CATALOG (RID_APP_START + 951) +#define RID_IL_UNBINOPS (RID_APP_START + 952) +#define RID_ILH_UNBINOPS (RID_APP_START + 953) +#define RID_IL_RELATIONS (RID_APP_START + 954) +#define RID_ILH_RELATIONS (RID_APP_START + 955) +#define RID_IL_SETOPERATIONS (RID_APP_START + 956) +#define RID_ILH_SETOPERATIONS (RID_APP_START + 957) +#define RID_IL_FUNCTIONS (RID_APP_START + 958) +#define RID_ILH_FUNCTIONS (RID_APP_START + 959) +#define RID_IL_OPERATORS (RID_APP_START + 960) +#define RID_ILH_OPERATORS (RID_APP_START + 961) +#define RID_IL_ATTRIBUTES (RID_APP_START + 962) +#define RID_ILH_ATTRIBUTES (RID_APP_START + 963) +#define RID_IL_BRACKETS (RID_APP_START + 964) +#define RID_ILH_BRACKETS (RID_APP_START + 965) +#define RID_IL_FORMAT (RID_APP_START + 966) +#define RID_ILH_FORMAT (RID_APP_START + 967) +#define RID_IL_MISC (RID_APP_START + 968) +#define RID_ILH_MISC (RID_APP_START + 969) + +#define RID_UNBINOPS_CAT (RID_APP_START + 1101) +#define RID_RELATIONS_CAT (RID_APP_START + 1102) +#define RID_SETOPERATIONS_CAT (RID_APP_START + 1103) +#define RID_FUNCTIONS_CAT (RID_APP_START + 1104) +#define RID_OPERATORS_CAT (RID_APP_START + 1105) +#define RID_ATTRIBUTES_CAT (RID_APP_START + 1106) +#define RID_BRACKETS_CAT (RID_APP_START + 1107) +#define RID_FORMAT_CAT (RID_APP_START + 1108) +#define RID_UNBINOPS_CAT_HLP (RID_APP_START + 1109) +#define RID_RELATIONS_CAT_HLP (RID_APP_START + 1110) +#define RID_SETOPEROPERATIONS_CAT_HLP (RID_APP_START + 1111) +#define RID_FUNCTIONS_CAT_HLP (RID_APP_START + 1112) +#define RID_OPERATORS_CAT_HLP (RID_APP_START + 1113) +#define RID_ATTRIBUTES_CAT_HLP (RID_APP_START + 1114) +#define RID_BRACKETS_CAT_HLP (RID_APP_START + 1115) +#define RID_FORMAT_CAT_HLP (RID_APP_START + 1116) +#define RID_MISC_CAT (RID_APP_START + 1117) +#define RID_MISC_CAT_HLP (RID_APP_START + 1118) + +// new resource ID's +#define RID_PLUSX (RID_APP_START + 1201) +#define RID_MINUSX (RID_APP_START + 1202) +#define RID_PLUSMINUSX (RID_APP_START + 1203) +#define RID_MINUSPLUSX (RID_APP_START + 1204) +#define RID_XPLUSY (RID_APP_START + 1205) +#define RID_XCDOTY (RID_APP_START + 1206) +#define RID_XTIMESY (RID_APP_START + 1207) +#define RID_XSYMTIMESY (RID_APP_START + 1208) +#define RID_XMINUSY (RID_APP_START + 1209) +#define RID_XOVERY (RID_APP_START + 1210) +#define RID_XDIVY (RID_APP_START + 1211) +#define RID_XSYMDIVIDEY (RID_APP_START + 1212) +#define RID_NEGX (RID_APP_START + 1213) +#define RID_XANDY (RID_APP_START + 1214) +#define RID_XORY (RID_APP_START + 1215) +#define RID_XODIVIDEY (RID_APP_START + 1216) +#define RID_XODOTY (RID_APP_START + 1217) +#define RID_XOMINUSY (RID_APP_START + 1218) +#define RID_XOPLUSY (RID_APP_START + 1219) +#define RID_XOTIMESY (RID_APP_START + 1220) +#define RID_XCIRCY (RID_APP_START + 1221) +#define RID_XWIDESLASHY (RID_APP_START + 1222) +#define RID_XWIDEBSLASHY (RID_APP_START + 1223) + +#define RID_XEQY (RID_APP_START + 1301) +#define RID_XNEQY (RID_APP_START + 1302) +#define RID_XEQUIVY (RID_APP_START + 1303) +#define RID_XORTHOY (RID_APP_START + 1304) +#define RID_XLTY (RID_APP_START + 1305) +#define RID_XGTY (RID_APP_START + 1306) +#define RID_XAPPROXY (RID_APP_START + 1307) +#define RID_XPARALLELY (RID_APP_START + 1308) +#define RID_XLESLANTY (RID_APP_START + 1309) +#define RID_XGESLANTY (RID_APP_START + 1310) +#define RID_XSIMEQY (RID_APP_START + 1311) +#define RID_XPROPY (RID_APP_START + 1312) +#define RID_XLEY (RID_APP_START + 1313) +#define RID_XGEY (RID_APP_START + 1314) +#define RID_XSIMY (RID_APP_START + 1315) +#define RID_XTOWARDY (RID_APP_START + 1316) +#define RID_XLLY (RID_APP_START + 1317) +#define RID_XGGY (RID_APP_START + 1318) +#define RID_XDEFY (RID_APP_START + 1319) +#define RID_XTRANSLY (RID_APP_START + 1320) +#define RID_XTRANSRY (RID_APP_START + 1321) +#define RID_XDIVIDESY (RID_APP_START + 1322) +#define RID_XNDIVIDESY (RID_APP_START + 1323) +#define RID_DLARROW (RID_APP_START + 1324) +#define RID_DLRARROW (RID_APP_START + 1325) +#define RID_DRARROW (RID_APP_START + 1326) + +#define RID_XINY (RID_APP_START + 1401) +#define RID_XNOTINY (RID_APP_START + 1402) +#define RID_XOWNSY (RID_APP_START + 1403) +#define RID_XINTERSECTIONY (RID_APP_START + 1405) +#define RID_XUNIONY (RID_APP_START + 1406) +#define RID_XSETMINUSY (RID_APP_START + 1407) +#define RID_XSLASHY (RID_APP_START + 1408) +#define RID_XSUBSETY (RID_APP_START + 1409) +#define RID_XSUBSETEQY (RID_APP_START + 1410) +#define RID_XSUPSETY (RID_APP_START + 1411) +#define RID_XSUPSETEQY (RID_APP_START + 1412) +#define RID_XNSUBSETY (RID_APP_START + 1413) +#define RID_XNSUBSETEQY (RID_APP_START + 1414) +#define RID_XNSUPSETY (RID_APP_START + 1415) +#define RID_XNSUPSETEQY (RID_APP_START + 1416) +#define RID_SETN (RID_APP_START + 1417) +#define RID_SETZ (RID_APP_START + 1418) +#define RID_SETQ (RID_APP_START + 1419) +#define RID_SETR (RID_APP_START + 1420) +#define RID_SETC (RID_APP_START + 1421) + +#define RID_ABSX (RID_APP_START + 1501) +#define RID_FACTX (RID_APP_START + 1502) +#define RID_SQRTX (RID_APP_START + 1503) +#define RID_NROOTXY (RID_APP_START + 1504) +#define RID_EX (RID_APP_START + 1505) +#define RID_LNX (RID_APP_START + 1506) +#define RID_EXPX (RID_APP_START + 1507) +#define RID_LOGX (RID_APP_START + 1508) +#define RID_SINX (RID_APP_START + 1509) +#define RID_COSX (RID_APP_START + 1510) +#define RID_TANX (RID_APP_START + 1511) +#define RID_COTX (RID_APP_START + 1512) +#define RID_SINHX (RID_APP_START + 1513) +#define RID_COSHX (RID_APP_START + 1514) +#define RID_TANHX (RID_APP_START + 1515) +#define RID_COTHX (RID_APP_START + 1516) +#define RID_ARCSINX (RID_APP_START + 1517) +#define RID_ARCCOSX (RID_APP_START + 1518) +#define RID_ARCTANX (RID_APP_START + 1519) +#define RID_ARCCOTX (RID_APP_START + 1520) +#define RID_ARSINHX (RID_APP_START + 1521) +#define RID_ARCOSHX (RID_APP_START + 1522) +#define RID_ARTANHX (RID_APP_START + 1523) +#define RID_ARCOTHX (RID_APP_START + 1524) + +#define RID_LIMX (RID_APP_START + 1601) +#define RID_SUMX (RID_APP_START + 1602) +#define RID_PRODX (RID_APP_START + 1603) +#define RID_COPRODX (RID_APP_START + 1604) +#define RID_INTX (RID_APP_START + 1605) +#define RID_IINTX (RID_APP_START + 1606) +#define RID_IIINTX (RID_APP_START + 1607) +#define RID_LINTX (RID_APP_START + 1609) +#define RID_LLINTX (RID_APP_START + 1610) +#define RID_LLLINTX (RID_APP_START + 1611) +#define RID_FROMXTOY (RID_APP_START + 1613) +#define RID_FROMX (RID_APP_START + 1614) +#define RID_TOX (RID_APP_START + 1615) +#define RID_LIMINFX (RID_APP_START + 1616) +#define RID_LIMSUPX (RID_APP_START + 1617) + +#define RID_ACUTEX (RID_APP_START + 1701) +#define RID_GRAVEX (RID_APP_START + 1702) +#define RID_CHECKX (RID_APP_START + 1703) +#define RID_BREVEX (RID_APP_START + 1704) +#define RID_BARX (RID_APP_START + 1705) +#define RID_VECX (RID_APP_START + 1706) +#define RID_HATX (RID_APP_START + 1707) +#define RID_TILDEX (RID_APP_START + 1708) +#define RID_CIRCLEX (RID_APP_START + 1709) +#define RID_DOTX (RID_APP_START + 1710) +#define RID_DDOTX (RID_APP_START + 1711) +#define RID_DDDOTX (RID_APP_START + 1712) +#define RID_OVERLINEX (RID_APP_START + 1713) +#define RID_UNDERLINEX (RID_APP_START + 1714) +#define RID_OVERSTRIKEX (RID_APP_START + 1715) +#define RID_PHANTOMX (RID_APP_START + 1716) +#define RID_BOLDX (RID_APP_START + 1717) +#define RID_ITALX (RID_APP_START + 1718) +#define RID_SIZEXY (RID_APP_START + 1719) +#define RID_FONTXY (RID_APP_START + 1720) +#define RID_COLORX (RID_APP_START + 1721) +#define RID_WIDEHATX (RID_APP_START + 1722) +#define RID_WIDETILDEX (RID_APP_START + 1723) +#define RID_WIDEVECX (RID_APP_START + 1724) + +#define RID_LRPARENTX (RID_APP_START + 1801) +#define RID_LRBRACKETX (RID_APP_START + 1802) +#define RID_LRANGLEX (RID_APP_START + 1803) +#define RID_LRBRACEX (RID_APP_START + 1804) +#define RID_LRLINEX (RID_APP_START + 1805) +#define RID_LRDLINEX (RID_APP_START + 1806) +#define RID_LRGROUPX (RID_APP_START + 1808) +#define RID_SLRPARENTX (RID_APP_START + 1809) +#define RID_SLRBRACKETX (RID_APP_START + 1810) +#define RID_SLRANGLEX (RID_APP_START + 1811) +#define RID_SLRBRACEX (RID_APP_START + 1812) +#define RID_SLRLINEX (RID_APP_START + 1813) +#define RID_SLRDLINEX (RID_APP_START + 1814) +#define RID_LRCEILX (RID_APP_START + 1817) +#define RID_LRFLOORX (RID_APP_START + 1818) +#define RID_SLRCEILX (RID_APP_START + 1819) +#define RID_SLRFLOORX (RID_APP_START + 1820) +#define RID_LMRANGLEXY (RID_APP_START + 1821) +#define RID_SLMRANGLEXY (RID_APP_START + 1822) +#define RID_LRDBRACKETX (RID_APP_START + 1823) +#define RID_SLRDBRACKETX (RID_APP_START + 1824) +#define RID_XOVERBRACEY (RID_APP_START + 1825) +#define RID_XUNDERBRACEY (RID_APP_START + 1826) + +#define RID_NEWLINE (RID_APP_START + 1901) +#define RID_SBLANK (RID_APP_START + 1902) +#define RID_BLANK (RID_APP_START + 1903) +#define RID_RSUBX (RID_APP_START + 1904) +#define RID_BINOMXY (RID_APP_START + 1905) +#define RID_STACK (RID_APP_START + 1906) +#define RID_MATRIX (RID_APP_START + 1907) +#define RID_RSUPX (RID_APP_START + 1908) +#define RID_ALIGNLX (RID_APP_START + 1909) +#define RID_ALIGNCX (RID_APP_START + 1910) +#define RID_ALIGNRX (RID_APP_START + 1911) +#define RID_LSUBX (RID_APP_START + 1912) +#define RID_LSUPX (RID_APP_START + 1916) +#define RID_CSUBX (RID_APP_START + 1917) +#define RID_CSUPX (RID_APP_START + 1918) +#define RID_NOSPACE (RID_APP_START + 1919) + +#define RID_ALEPH (RID_APP_START + 2001) +#define RID_EMPTYSET (RID_APP_START + 2002) +#define RID_RE (RID_APP_START + 2003) +#define RID_IM (RID_APP_START + 2004) +#define RID_INFINITY (RID_APP_START + 2005) +#define RID_PARTIAL (RID_APP_START + 2006) +#define RID_WP (RID_APP_START + 2007) +#define RID_DOTSAXIS (RID_APP_START + 2008) +#define RID_DOTSUP (RID_APP_START + 2009) +#define RID_DOTSDOWN (RID_APP_START + 2010) +#define RID_DOTSLOW (RID_APP_START + 2011) +#define RID_DOTSVERT (RID_APP_START + 2012) +#define RID_NABLA (RID_APP_START + 2013) +#define RID_HBAR (RID_APP_START + 2014) +#define RID_LAMBDABAR (RID_APP_START + 2015) +#define RID_LEFTARROW (RID_APP_START + 2016) +#define RID_RIGHTARROW (RID_APP_START + 2017) +#define RID_UPARROW (RID_APP_START + 2018) +#define RID_DOWNARROW (RID_APP_START + 2019) +#define RID_EXISTS (RID_APP_START + 1608) +#define RID_FORALL (RID_APP_START + 1612) + +// new menue resource ID's +#define RID_UNBINOPS_MENU (RID_APP_START + 2164) +#define RID_RELATIONS_MENU (RID_APP_START + 2165) +#define RID_SETOPERATIONS_MENU (RID_APP_START + 2166) +#define RID_FUNCTIONS_MENU (RID_APP_START + 2167) +#define RID_OPERATORS_MENU (RID_APP_START + 2168) +#define RID_ATTRIBUTES_MENU (RID_APP_START + 2169) +#define RID_BRACKETS_MENU (RID_APP_START + 2170) +#define RID_FORMAT_MENU (RID_APP_START + 2171) +#define RID_MISC_MENU (RID_APP_START + 2172) +#define RID_FUNCTIONSOTHER1_MENU (RID_APP_START + 2173) + +#define RID_XPP_LINE (RID_APP_START + 3000) +#define RID_XPP_DLINE (RID_APP_START + 3001) +#define RID_XPP_SQRT (RID_APP_START + 3002) +#define RID_XPP_SQRT2 (RID_APP_START + 3003) +#define RID_XPP_HAT (RID_APP_START + 3004) +#define RID_XPP_TILDE (RID_APP_START + 3005) +#define RID_XPP_BAR (RID_APP_START + 3006) +#define RID_XPP_VEC (RID_APP_START + 3007) +#define RID_XPP_LBRACE (RID_APP_START + 3008) +#define RID_XPP_RBRACE (RID_APP_START + 3009) +#define RID_XPP_LPARENT (RID_APP_START + 3010) +#define RID_XPP_RPARENT (RID_APP_START + 3011) +#define RID_XPP_LANGLE (RID_APP_START + 3012) +#define RID_XPP_RANGLE (RID_APP_START + 3013) +#define RID_XPP_LBRACKET (RID_APP_START + 3014) +#define RID_XPP_RBRACKET (RID_APP_START + 3015) +#define RID_XPP_LDBRACKET (RID_APP_START + 3016) +#define RID_XPP_RDBRACKET (RID_APP_START + 3017) +#define RID_XPP_LCEIL (RID_APP_START + 3018) +#define RID_XPP_RCEIL (RID_APP_START + 3019) +#define RID_XPP_LFLOOR (RID_APP_START + 3020) +#define RID_XPP_RFLOOR (RID_APP_START + 3021) +#define RID_XPP_OVERBRACE (RID_APP_START + 3022) +#define RID_XPP_UNDERBRACE (RID_APP_START + 3023) + +#define RID_LOCALIZED_NAMES (RID_APP_START + 3101) +#define RID_UI_SYMBOL_NAMES (RID_APP_START + 3102) +#define RID_EXPORT_SYMBOL_NAMES (RID_APP_START + 3103) +#define RID_LOCALIZED_SYMBOLSET_NAMES (RID_APP_START + 3104) +#define RID_UI_SYMBOLSET_NAMES (RID_APP_START + 3105) +#define RID_EXPORT_SYMBOLSET_NAMES (RID_APP_START + 3106) +#define RID_FRENCH_50_NAMES (RID_APP_START + 3107) +#define RID_FRENCH_60_NAMES (RID_APP_START + 3108) +#define RID_ITALIAN_50_NAMES (RID_APP_START + 3109) +#define RID_ITALIAN_60_NAMES (RID_APP_START + 3110) +#define RID_SWEDISH_50_NAMES (RID_APP_START + 3111) +#define RID_SWEDISH_60_NAMES (RID_APP_START + 3112) +#define RID_SPANISH_50_NAMES (RID_APP_START + 3113) +#define RID_SPANISH_60_NAMES (RID_APP_START + 3114) + +#define MN_SUB_SENDTO (RID_APP_START + 3120) + +#define HID_SMA_OPTIONSDIALOG (HID_SMA_START + 1) +#define HID_SMA_FONTDIALOG (HID_SMA_START + 2) +#define HID_SMA_FONTSIZEDIALOG (HID_SMA_START + 3) +#define HID_SMA_FONTTYPEDIALOG (HID_SMA_START + 4) +#define HID_SMA_DISTANCEDIALOG (HID_SMA_START + 5) +#define HID_SMA_ALIGNDIALOG (HID_SMA_START + 6) +#define HID_SMA_PRINTOPTIONPAGE (HID_SMA_START + 7) +#define HID_SMA_SYMBOLDIALOG (HID_SMA_START + 8) +#define HID_SMA_SYMDEFINEDIALOG (HID_SMA_START + 9) +#define HID_SMA_EXTRAOPTIONPAGE (HID_SMA_START + 10) +#define HID_SMA_DOCSAVEQUERY (HID_SMA_START + 11) +#define HID_SMA_OBJECTSAVEQUERY (HID_SMA_START + 12) +#define HID_SMA_DEFAULTSAVEQUERY (HID_SMA_START + 13) +#define HID_SMA_ILLEGALOBJECTERROR (HID_SMA_START + 14) +#define HID_SMA_ILLEGALFILEERROR (HID_SMA_START + 15) +#define HID_SMA_WRITESYMBOLERROR (HID_SMA_START + 16) +#define HID_SMA_READSYMBOLERROR (HID_SMA_START + 17) +#define HID_SMA_NOMATHTYPEFACEWARNING (HID_SMA_START + 18) +#define HID_SMA_OBJECTNAME (HID_SMA_START + 19) +#define HID_SMA_VIEWNAME (HID_SMA_START + 20) +#define HID_SMA_UNDOEDITNAME (HID_SMA_START + 21) +#define HID_SMA_UNDOFORMATNAME (HID_SMA_START + 22) +#define HID_SMA_APPICO (HID_SMA_START + 23) +#define HID_SMA_DOCICO (HID_SMA_START + 24) +#define HID_SMA_TMPICO (HID_SMA_START + 25) +#define HID_SMA_COMMANDMENU (HID_SMA_START + 26) +#define HID_SMA_VIEWMENU (HID_SMA_START + 27) +#define HID_SMA_DISTANCEMENU (HID_SMA_START + 28) +#define HID_SMA_FONTMENU (HID_SMA_START + 29) +#define HID_SMA_STARTUPWINDOW (HID_SMA_START + 30) +#define HID_SMA_TOOLBOXWINDOW (HID_SMA_START + 31) +#define HID_SMA_CMDBOXWINDOW (HID_SMA_START + 32) +#define HID_SMA_UPDATEOBJECT (HID_SMA_START + 33) +#define HID_SMA_FONTREGULAR (HID_SMA_START + 34) +#define HID_SMA_FONTITALIC (HID_SMA_START + 35) +#define HID_SMA_FONTBOLD (HID_SMA_START + 36) +#define HID_SMA_PRINTOPTION (HID_SMA_START + 37) +#define HID_SMA_DOCUMENTSTR (HID_SMA_START + 38) +#define HID_SMA_SYMBOLFILESSTR (HID_SMA_START + 39) +#define HID_SMA_ALLFILESSTR (HID_SMA_START + 40) +#define HID_SMA_CREATORSTR (HID_SMA_START + 41) +#define HID_SMA_FILESMFTYP (HID_SMA_START + 42) +#define HID_SMA_FILESYMTYP (HID_SMA_START + 43) +#define HID_SMA_WIN_DOCUMENT (HID_SMA_START + 44) +#define HID_SMA_COMMAND_WIN_EDIT (HID_SMA_START + 45) + +#define HID_SMA_PLUSX (HID_SMA_START + 50) +#define HID_SMA_MINUSX (HID_SMA_START + 51) +#define HID_SMA_PLUSMINUSX (HID_SMA_START + 52) +#define HID_SMA_MINUSPLUSX (HID_SMA_START + 53) +#define HID_SMA_NEGX (HID_SMA_START + 54) +#define HID_SMA_XPLUSY (HID_SMA_START + 55) +#define HID_SMA_XMINUSY (HID_SMA_START + 56) +#define HID_SMA_XCDOTY (HID_SMA_START + 57) +#define HID_SMA_XTIMESY (HID_SMA_START + 58) +#define HID_SMA_XSYMTIMESY (HID_SMA_START + 59) +#define HID_SMA_XSYMDIVIDEY (HID_SMA_START + 60) +#define HID_SMA_XDIVY (HID_SMA_START + 61) +#define HID_SMA_XOVERY (HID_SMA_START + 62) +#define HID_SMA_XODIVIDEY (HID_SMA_START + 63) +#define HID_SMA_XODOTY (HID_SMA_START + 64) +#define HID_SMA_XOMINUSY (HID_SMA_START + 65) +#define HID_SMA_XOPLUSY (HID_SMA_START + 66) +#define HID_SMA_XOTIMESY (HID_SMA_START + 67) +#define HID_SMA_XANDY (HID_SMA_START + 68) +#define HID_SMA_XORY (HID_SMA_START + 69) +#define HID_SMA_XEQY (HID_SMA_START + 70) +#define HID_SMA_XNEQY (HID_SMA_START + 71) +#define HID_SMA_XLTY (HID_SMA_START + 72) +#define HID_SMA_XGTY (HID_SMA_START + 73) +#define HID_SMA_XLEY (HID_SMA_START + 74) +#define HID_SMA_XGEY (HID_SMA_START + 75) +#define HID_SMA_XLESLANTY (HID_SMA_START + 76) +#define HID_SMA_XGESLANTY (HID_SMA_START + 77) +#define HID_SMA_XLLY (HID_SMA_START + 78) +#define HID_SMA_XGGY (HID_SMA_START + 79) +#define HID_SMA_XDEFY (HID_SMA_START + 80) +#define HID_SMA_XEQUIVY (HID_SMA_START + 81) +#define HID_SMA_XAPPROXY (HID_SMA_START + 82) +#define HID_SMA_XSIMY (HID_SMA_START + 83) +#define HID_SMA_XSIMEQY (HID_SMA_START + 84) +#define HID_SMA_XPROPY (HID_SMA_START + 85) +#define HID_SMA_XORTHOY (HID_SMA_START + 86) +#define HID_SMA_XPARALLELY (HID_SMA_START + 87) +#define HID_SMA_XTOWARDY (HID_SMA_START + 88) +#define HID_SMA_XTRANSLY (HID_SMA_START + 89) +#define HID_SMA_XTRANSRY (HID_SMA_START + 90) +#define HID_SMA_XINY (HID_SMA_START + 91) +#define HID_SMA_XNOTINY (HID_SMA_START + 92) +#define HID_SMA_XOWNSY (HID_SMA_START + 93) +#define HID_SMA_XUNIONY (HID_SMA_START + 94) +#define HID_SMA_XINTERSECTIONY (HID_SMA_START + 95) +#define HID_SMA_XSETMINUSY (HID_SMA_START + 96) +#define HID_SMA_XSLASHY (HID_SMA_START + 97) +#define HID_SMA_XSUBSETY (HID_SMA_START + 98) +#define HID_SMA_XSUBSETEQY (HID_SMA_START + 99) +#define HID_SMA_XSUPSETY (HID_SMA_START + 100) +#define HID_SMA_XSUPSETEQY (HID_SMA_START + 101) +#define HID_SMA_XNSUBSETY (HID_SMA_START + 102) +#define HID_SMA_XNSUBSETEQY (HID_SMA_START + 103) +#define HID_SMA_XNSUPSETY (HID_SMA_START + 104) +#define HID_SMA_XNSUPSETEQY (HID_SMA_START + 105) +#define HID_SMA_ABSX (HID_SMA_START + 106) +#define HID_SMA_FACTX (HID_SMA_START + 107) +#define HID_SMA_SQRTX (HID_SMA_START + 108) +#define HID_SMA_NROOTXY (HID_SMA_START + 109) +#define HID_SMA_EX (HID_SMA_START + 110) +#define HID_SMA_EXPX (HID_SMA_START + 111) +#define HID_SMA_LNX (HID_SMA_START + 112) +#define HID_SMA_LOGX (HID_SMA_START + 113) +#define HID_SMA_SINX (HID_SMA_START + 114) +#define HID_SMA_COSX (HID_SMA_START + 115) +#define HID_SMA_TANX (HID_SMA_START + 116) +#define HID_SMA_COTX (HID_SMA_START + 117) +#define HID_SMA_ARCSINX (HID_SMA_START + 118) +#define HID_SMA_ARCCOSX (HID_SMA_START + 119) +#define HID_SMA_ARCTANX (HID_SMA_START + 120) +#define HID_SMA_ARCCOTX (HID_SMA_START + 121) +#define HID_SMA_SINHX (HID_SMA_START + 122) +#define HID_SMA_COSHX (HID_SMA_START + 123) +#define HID_SMA_TANHX (HID_SMA_START + 124) +#define HID_SMA_COTHX (HID_SMA_START + 125) +#define HID_SMA_ARSINHX (HID_SMA_START + 126) +#define HID_SMA_ARCOSHX (HID_SMA_START + 127) +#define HID_SMA_ARTANHX (HID_SMA_START + 128) +#define HID_SMA_ARCOTHX (HID_SMA_START + 129) +#define HID_SMA_SUMX (HID_SMA_START + 130) +#define HID_SMA_PRODX (HID_SMA_START + 131) +#define HID_SMA_COPRODX (HID_SMA_START + 132) +#define HID_SMA_LIMX (HID_SMA_START + 133) +#define HID_SMA_LIMINFX (HID_SMA_START + 134) +#define HID_SMA_LIMSUPX (HID_SMA_START + 135) +#define HID_SMA_EXISTS (HID_SMA_START + 136) +#define HID_SMA_FORALL (HID_SMA_START + 137) +#define HID_SMA_NABLA (HID_SMA_START + 138) +#define HID_SMA_INTX (HID_SMA_START + 139) +#define HID_SMA_IINTX (HID_SMA_START + 140) +#define HID_SMA_IIINTX (HID_SMA_START + 141) +#define HID_SMA_LINTX (HID_SMA_START + 142) +#define HID_SMA_LLINTX (HID_SMA_START + 143) +#define HID_SMA_LLLINTX (HID_SMA_START + 144) +#define HID_SMA_FROMX (HID_SMA_START + 145) +#define HID_SMA_TOX (HID_SMA_START + 146) +#define HID_SMA_FROMXTOY (HID_SMA_START + 147) +#define HID_SMA_XCIRCY (HID_SMA_START + 148) +#define HID_SMA_XDIVIDESY (HID_SMA_START + 149) +#define HID_SMA_XNDIVIDESY (HID_SMA_START + 150) +#define HID_SMA_DLARROW (HID_SMA_START + 151) +#define HID_SMA_DLRARROW (HID_SMA_START + 152) +#define HID_SMA_DRARROW (HID_SMA_START + 153) + +#define HID_SMA_MISC_CAT (HID_SMA_START + 154) +#define HID_SMA_UNBINOPS_CAT (HID_SMA_START + 155) +#define HID_SMA_RELATIONS_CAT (HID_SMA_START + 156) +#define HID_SMA_SETOPERATIONS_CAT (HID_SMA_START + 157) +#define HID_SMA_FUNCTIONS_CAT (HID_SMA_START + 158) +#define HID_SMA_OPERATORS_CAT (HID_SMA_START + 159) +#define HID_SMA_ATTRIBUTES_CAT (HID_SMA_START + 160) +#define HID_SMA_BRACKETS_CAT (HID_SMA_START + 161) +#define HID_SMA_FORMAT_CAT (HID_SMA_START + 162) + +#define HID_SMA_OPERATOR_WIN (HID_SMA_START + 163) +#define HID_SMA_UNBINOPS_TBX (HID_SMA_START + 164) +#define HID_SMA_RELATIONS_TBX (HID_SMA_START + 165) +#define HID_SMA_SETOPERATIONS_TBX (HID_SMA_START + 166) +#define HID_SMA_FUNCTIONS_TBX (HID_SMA_START + 167) +#define HID_SMA_OPERATORS_TBX (HID_SMA_START + 168) +#define HID_SMA_ATTRIBUTES_TBX (HID_SMA_START + 169) +#define HID_SMA_BRACKETS_TBX (HID_SMA_START + 170) +#define HID_SMA_FORMAT_TBX (HID_SMA_START + 171) +#define HID_SMA_SELECTION_TBX (HID_SMA_START + 172) +#define HID_SMA_COMMAND_WIN (HID_SMA_START + 173) +#define HID_SMA_MISC_MENU (HID_SMA_START + 174) +#define HID_SMA_FUNCTIONSOTHER1_MENU (HID_SMA_START + 175) + +#define HID_SMA_ACUTEX (HID_SMA_START + 180) +#define HID_SMA_BARX (HID_SMA_START + 181) +#define HID_SMA_BREVEX (HID_SMA_START + 182) +#define HID_SMA_CHECKX (HID_SMA_START + 183) +#define HID_SMA_CIRCLEX (HID_SMA_START + 184) +#define HID_SMA_DOTX (HID_SMA_START + 185) +#define HID_SMA_DDOTX (HID_SMA_START + 186) +#define HID_SMA_DDDOTX (HID_SMA_START + 187) +#define HID_SMA_GRAVEX (HID_SMA_START + 188) +#define HID_SMA_HATX (HID_SMA_START + 189) +#define HID_SMA_TILDEX (HID_SMA_START + 190) +#define HID_SMA_VECX (HID_SMA_START + 191) +#define HID_SMA_UNDERLINEX (HID_SMA_START + 192) +#define HID_SMA_OVERLINEX (HID_SMA_START + 193) +#define HID_SMA_OVERSTRIKEX (HID_SMA_START + 194) +#define HID_SMA_PHANTOMX (HID_SMA_START + 195) +#define HID_SMA_BOLDX (HID_SMA_START + 196) +#define HID_SMA_ITALX (HID_SMA_START + 197) +#define HID_SMA_SIZEXY (HID_SMA_START + 198) +#define HID_SMA_FONTXY (HID_SMA_START + 199) +#define HID_SMA_COLORX (HID_SMA_START + 200) +#define HID_SMA_LRGROUPX (HID_SMA_START + 201) +#define HID_SMA_LRPARENTX (HID_SMA_START + 202) +#define HID_SMA_LRBRACKETX (HID_SMA_START + 203) +#define HID_SMA_LRBRACEX (HID_SMA_START + 204) +#define HID_SMA_LRANGLEX (HID_SMA_START + 205) +#define HID_SMA_LRCEILX (HID_SMA_START + 206) +#define HID_SMA_LRFLOORX (HID_SMA_START + 207) +#define HID_SMA_LRLINEX (HID_SMA_START + 208) +#define HID_SMA_LRDLINEX (HID_SMA_START + 209) +#define HID_SMA_SLRPARENTX (HID_SMA_START + 210) +#define HID_SMA_SLRBRACKETX (HID_SMA_START + 211) +#define HID_SMA_SLRBRACEX (HID_SMA_START + 212) +#define HID_SMA_SLRANGLEX (HID_SMA_START + 213) +#define HID_SMA_SLRCEILX (HID_SMA_START + 214) +#define HID_SMA_SLRFLOORX (HID_SMA_START + 215) +#define HID_SMA_SLRLINEX (HID_SMA_START + 216) +#define HID_SMA_SLRDLINEX (HID_SMA_START + 217) +#define HID_SMA_RSUBX (HID_SMA_START + 218) +#define HID_SMA_RSUPX (HID_SMA_START + 219) +#define HID_SMA_LSUBX (HID_SMA_START + 220) +#define HID_SMA_LSUPX (HID_SMA_START + 221) +#define HID_SMA_SBLANK (HID_SMA_START + 222) +#define HID_SMA_BLANK (HID_SMA_START + 223) +#define HID_SMA_NEWLINE (HID_SMA_START + 224) +#define HID_SMA_BINOMXY (HID_SMA_START + 225) +#define HID_SMA_STACK (HID_SMA_START + 226) +#define HID_SMA_MATRIX (HID_SMA_START + 227) +#define HID_SMA_ALIGNLX (HID_SMA_START + 228) +#define HID_SMA_ALIGNCX (HID_SMA_START + 229) +#define HID_SMA_ALIGNRX (HID_SMA_START + 230) +#define HID_SMA_ALEPH (HID_SMA_START + 231) +#define HID_SMA_EMPTYSET (HID_SMA_START + 232) +#define HID_SMA_RE (HID_SMA_START + 233) +#define HID_SMA_IM (HID_SMA_START + 234) +#define HID_SMA_INFINITY (HID_SMA_START + 235) +#define HID_SMA_PARTIAL (HID_SMA_START + 236) +#define HID_SMA_WP (HID_SMA_START + 237) +#define HID_SMA_DOTSAXIS (HID_SMA_START + 238) +#define HID_SMA_DOTSUP (HID_SMA_START + 239) +#define HID_SMA_DOTSDOWN (HID_SMA_START + 240) +#define HID_SMA_DOTSLOW (HID_SMA_START + 241) +#define HID_SMA_DOTSVERT (HID_SMA_START + 242) +#define HID_SMA_NOSPACE (HID_SMA_START + 243) + +#define HID_SMA_SETN (HID_SMA2_START + 1) +#define HID_SMA_SETZ (HID_SMA2_START + 2) +#define HID_SMA_SETQ (HID_SMA2_START + 3) +#define HID_SMA_SETR (HID_SMA2_START + 4) +#define HID_SMA_SETC (HID_SMA2_START + 5) +#define HID_SMA_WIDEHATX (HID_SMA2_START + 6) +#define HID_SMA_WIDETILDEX (HID_SMA2_START + 7) +#define HID_SMA_WIDEVECX (HID_SMA2_START + 8) +#define HID_SMA_CSUBX (HID_SMA2_START + 9) +#define HID_SMA_CSUPX (HID_SMA2_START + 10) +#define HID_SMA_HBAR (HID_SMA2_START + 11) +#define HID_SMA_LAMBDABAR (HID_SMA2_START + 12) +#define HID_SMA_LEFTARROW (HID_SMA2_START + 13) +#define HID_SMA_RIGHTARROW (HID_SMA2_START + 14) +#define HID_SMA_UPARROW (HID_SMA2_START + 15) +#define HID_SMA_DOWNARROW (HID_SMA2_START + 16) + +#define HID_SMA_DEFAULT_DIST (HID_SMA2_START + 17) +#define HID_SMA_LINE_DIST (HID_SMA2_START + 18) +#define HID_SMA_ROOT_DIST (HID_SMA2_START + 19) +#define HID_SMA_SUP_DIST (HID_SMA2_START + 20) +#define HID_SMA_SUB_DIST (HID_SMA2_START + 21) +#define HID_SMA_NUMERATOR_DIST (HID_SMA2_START + 22) +#define HID_SMA_DENOMINATOR_DIST (HID_SMA2_START + 23) +#define HID_SMA_FRACLINE_EXCWIDTH (HID_SMA2_START + 24) +#define HID_SMA_FRACLINE_LINEWIDTH (HID_SMA2_START + 25) +#define HID_SMA_UPPERLIMIT_DIST (HID_SMA2_START + 26) +#define HID_SMA_LOWERLIMIT_DIST (HID_SMA2_START + 27) +#define HID_SMA_BRACKET_EXCHEIGHT (HID_SMA2_START + 28) +#define HID_SMA_BRACKET_DIST (HID_SMA2_START + 29) +#define HID_SMA_MATRIXROW_DIST (HID_SMA2_START + 30) +#define HID_SMA_MATRIXCOL_DIST (HID_SMA2_START + 31) +#define HID_SMA_ATTRIBUT_DIST (HID_SMA2_START + 32) +#define HID_SMA_INTERATTRIBUT_DIST (HID_SMA2_START + 33) +#define HID_SMA_OPERATOR_EXCHEIGHT (HID_SMA2_START + 34) +#define HID_SMA_OPERATOR_DIST (HID_SMA2_START + 35) +#define HID_SMA_LEFTBORDER_DIST (HID_SMA2_START + 36) +#define HID_SMA_RIGHTBORDER_DIST (HID_SMA2_START + 37) +#define HID_SMA_UPPERBORDER_DIST (HID_SMA2_START + 38) +#define HID_SMA_LOWERBORDER_DIST (HID_SMA2_START + 39) +#define HID_SMA_SCALE_ALL_BRACKETS (HID_SMA2_START + 40) +#define HID_SMA_BRACKET_EXCHEIGHT2 (HID_SMA2_START + 41) +#define HID_SMA_LMRANGLEXY (HID_SMA2_START + 42) +#define HID_SMA_SLMRANGLEXY (HID_SMA2_START + 43) +#define HID_SMA_XWIDESLASHY (HID_SMA2_START + 44) +#define HID_SMA_XWIDEBSLASHY (HID_SMA2_START + 45) +#define HID_SMA_XOVERBRACEY (HID_SMA2_START + 46) +#define HID_SMA_XUNDERBRACEY (HID_SMA2_START + 47) +#define HID_SMA_LRDBRACKETX (HID_SMA2_START + 48) +#define HID_SMA_SLRDBRACKETX (HID_SMA2_START + 49) + +#define HID_SMA_CONTROL_SYMBOLSET_VIEW (HID_SMA2_START + 50) +#define HID_SMA_CONTROL_FONTCHAR_VIEW (HID_SMA2_START + 51) + +#define BMP_ARROW_RIGHT 1 + +#define MN_WIN 60 +#define MN_SUB_VIEW 31 +#define MN_SUB_TOOLBAR 32 +#define MN_SUB_GRAPHIC 33 +#define MN_SUB_SPELLING 34 +#define MN_SUB_TEMPLATES 35 + +// 342 == SCH_IF_SMAVIEWSHELL, da SFX_INTERFACE_LIB kein +// Define sondern neuerdings ein Enum ist +#define HID_SMA_VIEWSHELL_DOCUMENT (342) + +#endif + diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx new file mode 100644 index 000000000000..51e8ad0b8642 --- /dev/null +++ b/starmath/inc/symbol.hxx @@ -0,0 +1,189 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SYMBOL_HXX +#define SYMBOL_HXX + +#include <vos/refernce.hxx> +#include <vcl/font.hxx> +#include <tools/list.hxx> +#include <tools/debug.hxx> +#include <tools/dynary.hxx> +#include <svl/lstner.hxx> +#include <svl/svarray.hxx> + +#include <map> +#include <vector> +#include <set> +#include <functional> +#include <algorithm> + +#include "unomodel.hxx" +#include "utility.hxx" +#include "smmod.hxx" + + +#define SYMBOLSET_NONE 0xFFFF +#define SYMBOL_NONE 0xFFFF + + +//////////////////////////////////////////////////////////////////////////////// + +inline const String GetExportSymbolName( const String &rUiSymbolName ) +{ + return SM_MOD()->GetLocSymbolData().GetExportSymbolName( rUiSymbolName ); +} + + +inline const String GetUiSymbolName( const String &rExportSymbolName ) +{ + return SM_MOD()->GetLocSymbolData().GetUiSymbolName( rExportSymbolName ); +} + +inline const String GetExportSymbolSetName( const String &rUiSymbolSetName ) +{ + return SM_MOD()->GetLocSymbolData().GetExportSymbolSetName( rUiSymbolSetName ); +} + + +inline const String GetUiSymbolSetName( const String &rExportSymbolSetName ) +{ + return SM_MOD()->GetLocSymbolData().GetUiSymbolSetName( rExportSymbolSetName ); +} + +//////////////////////////////////////////////////////////////////////////////// + +class SmSym +{ + SmFace m_aFace; + String m_aName; + String m_aExportName; + String m_aSetName; + sal_Unicode m_cChar; + BOOL m_bPredefined; + BOOL m_bDocSymbol; + +public: + SmSym(); + SmSym(const String& rName, const Font& rFont, sal_Unicode cChar, + const String& rSet, BOOL bIsPredefined = FALSE); + SmSym(const SmSym& rSymbol); + + SmSym& operator = (const SmSym& rSymbol); + + const Font& GetFace() const { return m_aFace; } + sal_Unicode GetCharacter() const { return m_cChar; } + const String& GetName() const { return m_aName; } + + void SetFace( const Font& rFont ) { m_aFace = rFont; } + void SetCharacter( sal_Unicode cChar ) { m_cChar = cChar; } + +//! since the symbol name is also used as key in the map it should not be possible to change the name +//! because ten the key would not be the same as its supposed copy here +// void SetName( const String &rTxt ) { m_aName = rTxt; } + + BOOL IsPredefined() const { return m_bPredefined; } + const String & GetSymbolSetName() const { return m_aSetName; } + void SetSymbolSetName( const String &rName ) { m_aSetName = rName; } + const String & GetExportName() const { return m_aExportName; } + void SetExportName( const String &rName ) { m_aExportName = rName; } + + BOOL IsDocSymbol() const { return m_bDocSymbol; } + void SetDocSymbol( BOOL bVal ) { m_bDocSymbol = bVal; } + + // true if rSymbol has the same name, font and character + bool IsEqualInUI( const SmSym& rSymbol ) const; +}; + +/**************************************************************************/ + +struct lt_String +{ + bool operator()( const String &r1, const String &r2 ) const + { + // r1 < r2 ? + return r1.CompareTo( r2 ) == COMPARE_LESS; + } +}; + + +// type of the actual container to hold the symbols +typedef std::map< String, SmSym, lt_String > SymbolMap_t; + +// vector of pointers to the actual symbols in the above container +typedef std::vector< const SmSym * > SymbolPtrVec_t; + +struct lt_SmSymPtr : public std::binary_function< const SmSym *, const SmSym *, bool > +{ + bool operator() ( const SmSym *pSym1, const SmSym *pSym2 ) + { + return pSym1->GetCharacter() < pSym2->GetCharacter(); + } +}; + + +class SmSymbolManager : public SfxListener +{ + SymbolMap_t m_aSymbols; + bool m_bModified; + + virtual void SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType); + + void Init(); + void Exit(); + +public: + SmSymbolManager(); + SmSymbolManager(const SmSymbolManager& rSymbolSetManager); + ~SmSymbolManager(); + + SmSymbolManager & operator = (const SmSymbolManager& rSymbolSetManager); + + // symbol sets are for UI purpose only, thus we assemble them here + std::set< String > GetSymbolSetNames() const; + const SymbolPtrVec_t GetSymbolSet( const String& rSymbolSetName ); + + USHORT GetSymbolCount() const { return static_cast< USHORT >(m_aSymbols.size()); } + const SymbolPtrVec_t GetSymbols() const; + bool AddOrReplaceSymbol( const SmSym & rSymbol, bool bForceChange = false ); + void RemoveSymbol( const String & rSymbolName ); + + SmSym * GetSymbolByName(const String& rSymbolName); + const SmSym * GetSymbolByName(const String& rSymbolName) const + { + return ((SmSymbolManager *) this)->GetSymbolByName(rSymbolName); + } + + bool IsModified() const { return m_bModified; } + void SetModified(bool bModify) { m_bModified = bModify; } + + void Load(); + void Save(); +}; + +#endif + diff --git a/starmath/inc/toolbox.hxx b/starmath/inc/toolbox.hxx new file mode 100644 index 000000000000..1881adc0f845 --- /dev/null +++ b/starmath/inc/toolbox.hxx @@ -0,0 +1,89 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef TOOLBOX_HXX +#define TOOLBOX_HXX + +#include <sfx2/basedlgs.hxx> +#include <sfx2/childwin.hxx> +#include <vcl/toolbox.hxx> +#include "smmod.hxx" +#include "config.hxx" + +#include "dialog.hrc" + +#define NUM_TBX_CATEGORIES 9 + +class SmToolBoxWindow : public SfxFloatingWindow +{ + +protected: + ToolBox aToolBoxCat; + FixedLine aToolBoxCat_Delim; // to visualy seperate the catalog part + ToolBox *pToolBoxCmd; + ToolBox *vToolBoxCategories[NUM_TBX_CATEGORIES]; + ImageList *aImageLists [NUM_TBX_CATEGORIES + 1]; /* regular */ + ImageList *aImageListsH[NUM_TBX_CATEGORIES + 1]; /* high contrast */ + USHORT nActiveCategoryRID; + + virtual BOOL Close(); + virtual void GetFocus(); + + void ApplyImageLists( USHORT nCategoryRID ); + + DECL_LINK( CategoryClickHdl, ToolBox* ); + DECL_LINK( CmdSelectHdl, ToolBox* ); + + SmViewShell * GetView(); + const ImageList * GetImageList( USHORT nResId, BOOL bHighContrast ); + +public: + SmToolBoxWindow(SfxBindings *pBindings, + SfxChildWindow *pChildWindow, + Window *pParent); + ~SmToolBoxWindow(); + + // Window + virtual void StateChanged( StateChangedType nStateChange ); + virtual void DataChanged( const DataChangedEvent &rEvt ); + + void AdjustPosSize( BOOL bSetPos ); + void SetCategory(USHORT nCategory); +}; + +/**************************************************************************/ + +class SmToolBoxWrapper : public SfxChildWindow +{ + SFX_DECL_CHILDWINDOW(SmToolBoxWrapper); + +protected: + SmToolBoxWrapper(Window *pParentWindow, + USHORT, SfxBindings*, SfxChildWinInfo*); +}; + +#endif + diff --git a/starmath/inc/types.hxx b/starmath/inc/types.hxx new file mode 100644 index 000000000000..2ad899f37cc7 --- /dev/null +++ b/starmath/inc/types.hxx @@ -0,0 +1,204 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef TYPES_HXX +#define TYPES_HXX + +#include <sal/types.h> +#include <tools/debug.hxx> + +#define FONTNAME_MATH "OpenSymbol" + +///////////////////////////////////////////////////////////////// + +enum SmPrintSize { PRINT_SIZE_NORMAL, PRINT_SIZE_SCALED, PRINT_SIZE_ZOOMED }; + +///////////////////////////////////////////////////////////////// + +#define FONT_ARIAL "Arial" +#define FONT_SYMBOL "Symbol" +#define FONT_MS_PMINCHO "MS PMincho" +#define FONT_MS_PGOTHIC "MS PGothic" +#define FONT_SUN_BATANG "SunBatang" + + +inline sal_Bool IsInPrivateUseArea( sal_Unicode cChar ) { return 0xE000 <= cChar && cChar <= 0xF8FF; } + +// Greek char range as seen in svx/.../charmap.cxx RID_SUBSETSTR_BASIC_GREEK +inline sal_Bool IsGreekChar( sal_Unicode cChar ) { return 0x0370 <= cChar && cChar <= 0x03FF; } + +sal_Unicode ConvertMathPrivateUseAreaToUnicode( sal_Unicode cChar ); + +sal_Unicode ConvertMathToMathML( sal_Unicode cChar ); + +///////////////////////////////////////////////////////////////// +// enum definitions for characters from the 'StarSymbol' font +// (some chars have more than one alias!) +//! Note: not listed here does not(!) mean "not used" +//! (see %alpha ... %gamma for example) +// +enum MathSymbol +{ + MS_FACT = (sal_Unicode) 0x0021, + MS_INFINITY = (sal_Unicode) 0x221E, + MS_SLASH = (sal_Unicode) 0x002F, + + MS_NDIVIDES = (sal_Unicode) 0x2224, + MS_DRARROW = (sal_Unicode) 0x21D2, + MS_DLARROW = (sal_Unicode) 0x21D0, + MS_DLRARROW = (sal_Unicode) 0x21D4, + MS_OVERBRACE = (sal_Unicode) 0x23DE, + MS_UNDERBRACE = (sal_Unicode) 0x23DF, + MS_CIRC = (sal_Unicode) 0x2218, + MS_ASSIGN = (sal_Unicode) 0x003D, + MS_ERROR = (sal_Unicode) 0x00BF, + + MS_NEQ = (sal_Unicode) 0x2260, + MS_PLUS = (sal_Unicode) 0x002B, + MS_MINUS = (sal_Unicode) 0x2212, + MS_MULTIPLY = (sal_Unicode) 0x2217, + MS_TIMES = (sal_Unicode) 0x00D7, + MS_CDOT = (sal_Unicode) 0x22C5, + MS_DIV = (sal_Unicode) 0x00F7, + MS_PLUSMINUS = (sal_Unicode) 0x00B1, + MS_MINUSPLUS = (sal_Unicode) 0x2213, + MS_OPLUS = (sal_Unicode) 0x2295, + MS_OMINUS = (sal_Unicode) 0x2296, + MS_OTIMES = (sal_Unicode) 0x2297, + MS_ODIVIDE = (sal_Unicode) 0x2298, + MS_ODOT = (sal_Unicode) 0x2299, + MS_UNION = (sal_Unicode) 0x222A, + MS_INTERSECT = (sal_Unicode) 0x2229, + + MS_LT = (sal_Unicode) 0x003C, + MS_GT = (sal_Unicode) 0x003E, + MS_LE = (sal_Unicode) 0x2264, + MS_GE = (sal_Unicode) 0x2265, + MS_LESLANT = (sal_Unicode) 0x2A7D, + MS_GESLANT = (sal_Unicode) 0x2A7E, + MS_LL = (sal_Unicode) 0x226A, + MS_GG = (sal_Unicode) 0x226B, + MS_SIM = (sal_Unicode) 0x223C, + MS_SIMEQ = (sal_Unicode) 0x2243, + MS_APPROX = (sal_Unicode) 0x2248, + MS_DEF = (sal_Unicode) 0x225D, + MS_EQUIV = (sal_Unicode) 0x2261, + MS_PROP = (sal_Unicode) 0x221D, + MS_PARTIAL = (sal_Unicode) 0x2202, + + MS_SUBSET = (sal_Unicode) 0x2282, + MS_SUPSET = (sal_Unicode) 0x2283, + MS_SUBSETEQ = (sal_Unicode) 0x2286, + MS_SUPSETEQ = (sal_Unicode) 0x2287, + MS_NSUBSET = (sal_Unicode) 0x2284, + MS_NSUPSET = (sal_Unicode) 0x2285, + MS_NSUBSETEQ = (sal_Unicode) 0x2288, + MS_NSUPSETEQ = (sal_Unicode) 0x2289, + MS_IN = (sal_Unicode) 0x2208, + MS_NOTIN = (sal_Unicode) 0x2209, + MS_EXISTS = (sal_Unicode) 0x2203, + MS_BACKEPSILON = (sal_Unicode) 0x220D, + MS_ALEPH = (sal_Unicode) 0x2135, + MS_IM = (sal_Unicode) 0x2111, + MS_RE = (sal_Unicode) 0x211C, + MS_WP = (sal_Unicode) 0x2118, + + MS_LINE = (sal_Unicode) 0x2223, + MS_DLINE = (sal_Unicode) 0x2225, + MS_ORTHO = (sal_Unicode) 0x22A5, + MS_DOTSLOW = (sal_Unicode) 0x2026, + MS_DOTSAXIS = (sal_Unicode) 0x22EF, + MS_DOTSVERT = (sal_Unicode) 0x22EE, + MS_DOTSUP = (sal_Unicode) 0x22F0, + MS_DOTSDOWN = (sal_Unicode) 0x22F1, + MS_TRANSR = (sal_Unicode) 0x22B6, + MS_TRANSL = (sal_Unicode) 0x22B7, + MS_BACKSLASH = (sal_Unicode) 0x2216, + MS_NEG = (sal_Unicode) 0x00AC, + + MS_FORALL = (sal_Unicode) 0x2200, + MS_NABLA = (sal_Unicode) 0x2207, + MS_PROD = (sal_Unicode) 0x220F, + MS_COPROD = (sal_Unicode) 0x2210, + MS_SUM = (sal_Unicode) 0x2211, + MS_SQRT = (sal_Unicode) 0x221A, + MS_INT = (sal_Unicode) 0x222B, + MS_IINT = (sal_Unicode) 0x222C, + MS_IIINT = (sal_Unicode) 0x222D, + MS_LINT = (sal_Unicode) 0x222E, + MS_LLINT = (sal_Unicode) 0x222F, + MS_LLLINT = (sal_Unicode) 0x2230, + + MS_GRAVE = (sal_Unicode) 0x0300, + MS_ACUTE = (sal_Unicode) 0x0301, + MS_HAT = (sal_Unicode) 0x0302, + MS_TILDE = (sal_Unicode) 0x0303, + MS_BAR = (sal_Unicode) 0x0304, + MS_BREVE = (sal_Unicode) 0x0306, + MS_CIRCLE = (sal_Unicode) 0x030A, + MS_CHECK = (sal_Unicode) 0x030C, + MS_VEC = (sal_Unicode) 0x20D7, + MS_DOT = (sal_Unicode) 0x02D9, + MS_DDOT = (sal_Unicode) 0x00A8, + MS_DDDOT = (sal_Unicode) 0x20DB, + MS_AND = (sal_Unicode) 0x2227, + MS_OR = (sal_Unicode) 0x2228, + MS_NI = (sal_Unicode) 0x220B, + MS_EMPTYSET = (sal_Unicode) 0x2205, + + MS_LPARENT = (sal_Unicode) 0x0028, + MS_RPARENT = (sal_Unicode) 0x0029, + MS_LBRACKET = (sal_Unicode) 0x005B, + MS_RBRACKET = (sal_Unicode) 0x005D, + MS_LBRACE = (sal_Unicode) 0x007B, + MS_RBRACE = (sal_Unicode) 0x007D, + MS_LCEIL = (sal_Unicode) 0x2308, + MS_RCEIL = (sal_Unicode) 0x2309, + MS_LFLOOR = (sal_Unicode) 0x230A, + MS_RFLOOR = (sal_Unicode) 0x230B, + MS_LANGLE = (sal_Unicode) 0x2329, + MS_RANGLE = (sal_Unicode) 0x232A, + MS_LDBRACKET = (sal_Unicode) 0x27E6, + MS_RDBRACKET = (sal_Unicode) 0x27E7, + + MS_PLACE = (sal_Unicode) 0x2751, + + MS_LAMBDABAR = (sal_Unicode) 0x019B, + MS_HBAR = (sal_Unicode) 0x210F, + MS_LEFTARROW = (sal_Unicode) 0x2190, + MS_UPARROW = (sal_Unicode) 0x2191, + MS_RIGHTARROW = (sal_Unicode) 0x2192, + MS_DOWNARROW = (sal_Unicode) 0x2193, + MS_SETN = (sal_Unicode) 0x2115, + MS_SETZ = (sal_Unicode) 0x2124, + MS_SETQ = (sal_Unicode) 0x211A, + MS_SETR = (sal_Unicode) 0x211D, + MS_SETC = (sal_Unicode) 0x2102 +}; + + +#endif + diff --git a/starmath/inc/unomodel.hxx b/starmath/inc/unomodel.hxx new file mode 100644 index 000000000000..8ee5795c38b4 --- /dev/null +++ b/starmath/inc/unomodel.hxx @@ -0,0 +1,109 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef UNOMODEL_HXX +#define UNOMODEL_HXX + +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/beans/XMultiPropertySet.hpp> +#include <com/sun/star/beans/XPropertyState.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/view/XRenderable.hpp> + +#include <sfx2/sfxbasemodel.hxx> +#include <comphelper/propertysethelper.hxx> +#include <vcl/print.hxx> + +class SmFormat; + +//////////////////////////////////////////////////////////// + +#define PRTUIOPT_TITLE_ROW "TitleRow" +#define PRTUIOPT_FORMULA_TEXT "FormulaText" +#define PRTUIOPT_BORDER "Border" +#define PRTUIOPT_PRINT_FORMAT "PrintFormat" +#define PRTUIOPT_PRINT_SCALE "PrintScale" + +class SmPrintUIOptions : public vcl::PrinterOptionsHelper +{ +public: + SmPrintUIOptions(); +}; + + +//////////////////////////////////////////////////////////// + +#define A2OU(pText) rtl::OUString::createFromAscii(pText) + +//----------------------------------------------------------------------------- +class SmModel : public SfxBaseModel, + public comphelper::PropertySetHelper, + public com::sun::star::lang::XServiceInfo, + public com::sun::star::view::XRenderable +{ + SmPrintUIOptions* m_pPrintUIOptions; +protected: + virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const ::com::sun::star::uno::Any* pValues ) + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); + virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException ); +public: + SmModel( SfxObjectShell *pObjSh = 0 ); + virtual ~SmModel() throw (); + + //XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw(); + virtual void SAL_CALL release( ) throw(); + + //XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + + //XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + //XRenderable + virtual sal_Int32 SAL_CALL getRendererCount( const ::com::sun::star::uno::Any& rSelection, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rxOptions ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRenderer( sal_Int32 nRenderer, const ::com::sun::star::uno::Any& rSelection, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rxOptions ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL render( sal_Int32 nRenderer, const ::com::sun::star::uno::Any& rSelection, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rxOptions ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + //XServiceInfo + virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); + virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xParent ) throw( ::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException ); + + static ::com::sun::star::uno::Sequence< rtl::OUString > getSupportedServiceNames_Static(); + static ::rtl::OUString getImplementationName_Static(); +}; + +//////////////////////////////////////////////////////////// + +#endif + diff --git a/starmath/inc/utility.hxx b/starmath/inc/utility.hxx new file mode 100644 index 000000000000..e7db51152e25 --- /dev/null +++ b/starmath/inc/utility.hxx @@ -0,0 +1,380 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef UTILITY_HXX +#define UTILITY_HXX + +#include <sfx2/minarray.hxx> +#ifndef _FONT_HXX //autogen +#include <vcl/font.hxx> +#endif +#include <vcl/fixed.hxx> +#include <vcl/combobox.hxx> +#include <vcl/lstbox.hxx> +#include <tools/fract.hxx> + + +class SmRect; +class String; + +#define C2S(cChar) String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(cChar)) + +///////////////////////////////////////////////////////////////// + +const ByteString ExportString( const String& rString ); +const String ImportString( const ByteString& rByteString ); + +///////////////////////////////////////////////////////////////// + +inline long SmPtsTo100th_mm(long nNumPts) + // returns the length (in 100th of mm) that corresponds to the length + // 'nNumPts' (in units points). + // 72.27 [pt] = 1 [inch] = 2,54 [cm] = 2540 [100th of mm]. + // result is being rounded to the nearest integer. +{ + DBG_ASSERT(nNumPts >= 0, "Sm : Ooops..."); + // broken into multiple and fraction of 'nNumPts' to reduce chance + // of overflow + // (7227 / 2) is added in order to round to the nearest integer + return 35 * nNumPts + (nNumPts * 1055L + (7227 / 2)) / 7227L; +} + + +inline long SmPtsTo100th_mm(const Fraction &rNumPts) + // as above but with argument 'rNumPts' as 'Fraction' +{ + Fraction aTmp (254000L, 7227L); + return aTmp *= rNumPts; +} + + +inline Fraction Sm100th_mmToPts(long nNum100th_mm) + // returns the length (in points) that corresponds to the length + // 'nNum100th_mm' (in 100th of mm). +{ + DBG_ASSERT(nNum100th_mm >= 0, "Sm : Ooops..."); + Fraction aTmp (7227L, 254000L); + return aTmp *= Fraction(nNum100th_mm); +} + + +inline long SmRoundFraction(const Fraction &rFrac) +{ + DBG_ASSERT(rFrac > Fraction(), "Sm : Ooops..."); + return (rFrac.GetNumerator() + rFrac.GetDenominator() / 2) / rFrac.GetDenominator(); +} + + +class SmViewShell; +SmViewShell * SmGetActiveView(); + + +//////////////////////////////////////////////////////////// +// +// SmFace +// + +BOOL IsItalic( const Font &rFont ); +BOOL IsBold( const Font &rFont ); + +class SmFace : public Font +{ + long nBorderWidth; + + void Impl_Init(); + +public: + SmFace() : + Font(), nBorderWidth(-1) { Impl_Init(); } + SmFace(const Font& rFont) : + Font(rFont), nBorderWidth(-1) { Impl_Init(); } + SmFace(const String& rName, const Size& rSize) : + Font(rName, rSize), nBorderWidth(-1) { Impl_Init(); } + SmFace( FontFamily eFamily, const Size& rSize) : + Font(eFamily, rSize), nBorderWidth(-1) { Impl_Init(); } + + SmFace(const SmFace &rFace) : + Font(rFace), nBorderWidth(-1) { Impl_Init(); } + + // overloaded version in order to supply a min value + // for font size (height). (Also used in ctor's to do so.) + void SetSize(const Size& rSize); + + void SetBorderWidth(long nWidth) { nBorderWidth = nWidth; } + long GetBorderWidth() const; + long GetDefaultBorderWidth() const { return GetSize().Height() / 20 ; } + void FreezeBorderWidth() { nBorderWidth = GetDefaultBorderWidth(); } + + SmFace & operator = (const SmFace &rFace); +}; + +SmFace & operator *= (SmFace &rFace, const Fraction &rFrac); + + +#ifdef NEVER +//////////////////////////////////////////////////////////// +// +// SmInfoText +// + +class SmInfoText : public FixedText +{ +protected: + USHORT nMaxLen; + String aText; + +public: + SmInfoText(Window* pParent, WinBits nWinStyle = 0, USHORT nMax = 128); + SmInfoText(Window* pParent, const ResId& rResId, USHORT nMax = 128); + + void SetText(const String& rStr); + + XubString GetText() const { return (aText); } +}; +#endif + + +//////////////////////////////////////////////////////////// +// +// SmPickList +// + +class SmPickList : public SfxPtrArr +{ +protected: + USHORT nSize; + + virtual void *CreateItem(const String& rString) = 0; + virtual void *CreateItem(const void *pItem) = 0; + virtual void DestroyItem(void *pItem) = 0; + + virtual BOOL CompareItem(const void *pFirstItem, const void *pSecondItem) const = 0; + + virtual String GetStringItem(void *pItem) = 0; + + void *GetPtr(USHORT nPos) const { return SfxPtrArr::GetObject(nPos); } + void *&GetPtr(USHORT nPos) { return SfxPtrArr::GetObject(nPos); } + void InsertPtr(USHORT nPos, void *pItem) { SfxPtrArr::Insert(nPos, pItem); } + void RemovePtr(USHORT nPos, USHORT nCount = 1) { SfxPtrArr::Remove(nPos, nCount); } + +public: + SmPickList(USHORT nInitSize = 0, USHORT nMaxSize = 5); + virtual ~SmPickList(); + + SmPickList& operator = (const SmPickList& rList); + + void *Get(USHORT nPos = 0) const { return GetPtr(nPos); } + using SfxPtrArr::Insert; + void Insert(const void* pItem); + void Update(const void* pItem, const void *pNewItem); + using SfxPtrArr::Remove; + void Remove(const void* pItem); + + using SfxPtrArr::operator []; + void *operator [] (USHORT nPos) const { return GetPtr(nPos); } + + USHORT GetSize() const { return nSize; } + USHORT Count() const { return SfxPtrArr::Count(); } + + void Clear(); +}; + + +//////////////////////////////////////////////////////////// +// +// SmStringPickList +// +#ifdef NEVER +class SmStringPickList : public SmPickList +{ +protected: + virtual void *CreateItem(const String& rString); + virtual void *CreateItem(const void *pItem); + virtual void DestroyItem(void *pItem); + + virtual BOOL CompareItem(const void *pFirstItem, const void *pSecondItem) const; + + virtual String GetStringItem(void *pItem); + +public: + SmStringPickList() + : SmPickList(0, 5) {} + SmStringPickList(USHORT nInitSize, USHORT nMaxSize) + : SmPickList(nInitSize, nMaxSize) {} + SmStringPickList(const SmPickList& rOrig ) + : SmPickList(rOrig) {} + virtual ~SmStringPickList() { Clear(); } + + virtual void Insert(const String &rString); + virtual void Update(const String &rString, const String &rNewString); + virtual void Remove(const String &rString); + + inline BOOL Contains(const String &rString) const; + inline String Get(USHORT nPos = 0) const; + + inline SmStringPickList& operator = (const SmStringPickList& rList); + inline String operator [] (USHORT nPos) const; +}; + +inline SmStringPickList& SmStringPickList::operator = (const SmStringPickList& rList) +{ + *(SmPickList *)this = *(SmPickList *)&rList; return *this; +} + +inline String SmStringPickList::operator [] (USHORT nPos) const +{ + return *((String *)SmPickList::operator[](nPos)); +} + +inline String SmStringPickList::Get(USHORT nPos) const +{ + return nPos < Count() ? *((String *)SmPickList::Get(nPos)) : String(); +} + +inline BOOL SmStringPickList::Contains(const String &rString) const +{ + return SmPickList::Contains((void *)&rString); +} +#endif + +//////////////////////////////////////////////////////////// +// +// SmFontPickList +// + +class SmFontDialog; + +class SmFontPickList : public SmPickList +{ +protected: + virtual void *CreateItem(const String& rString); + virtual void *CreateItem(const void *pItem); + virtual void DestroyItem(void *pItem); + + virtual BOOL CompareItem(const void *pFirstItem, const void *pSecondItem) const; + + virtual String GetStringItem(void *pItem); + +public: + SmFontPickList() + : SmPickList(0, 5) {} + SmFontPickList(USHORT nInitSize, USHORT nMaxSize) + : SmPickList(nInitSize, nMaxSize) {} + SmFontPickList(const SmPickList& rOrig ) + : SmPickList(rOrig) {} + virtual ~SmFontPickList() { Clear(); } + + using SfxPtrArr::Insert; + virtual void Insert(const Font &rFont); + using SmPickList::Update; + virtual void Update(const Font &rFont, const Font &rNewFont); + using SfxPtrArr::Remove; + virtual void Remove(const Font &rFont); + + using SmPickList::Contains; + inline BOOL Contains(const Font &rFont) const; + inline Font Get(USHORT nPos = 0) const; + + inline SmFontPickList& operator = (const SmFontPickList& rList); + using SfxPtrArr::operator []; + inline Font operator [] (USHORT nPos) const; + + void ReadFrom(const SmFontDialog& rDialog); + void WriteTo(SmFontDialog& rDialog) const; +}; + +inline SmFontPickList& SmFontPickList::operator = (const SmFontPickList& rList) +{ + *(SmPickList *)this = *(SmPickList *)&rList; return *this; +} + +inline Font SmFontPickList::operator [] (USHORT nPos) const +{ + return *((Font *)SmPickList::operator[](nPos)); +} + +inline Font SmFontPickList::Get(USHORT nPos) const +{ + return nPos < Count() ? *((Font *)SmPickList::Get(nPos)) : Font(); +} + +inline BOOL SmFontPickList::Contains(const Font &rFont) const +{ + return SmPickList::Contains((void *)&rFont); +} + + +//////////////////////////////////////////////////////////// +// +// SmStringPickComboBox +// +#ifdef NEVER +class SmStringPickComboBox : public SmStringPickList, public ComboBox +{ +protected: + virtual void LoseFocus(); + + DECL_LINK(SelectHdl, ComboBox *); + +public: + SmStringPickComboBox(Window* pParent, WinBits nWinStyle = 0, USHORT nMax = 4); + SmStringPickComboBox(Window* pParent, const ResId& rResId, USHORT nMax = 4); + + SmStringPickComboBox& operator = (const SmStringPickList& rList); + + void SetText(const String& rStr); + + virtual void Insert(const String &rString); + virtual void Update(const String &rString, const String &rNewString); + virtual void Remove(const String &rString); +}; +#endif + +//////////////////////////////////////////////////////////// +// +// SmFontPickListBox +// + +class SmFontPickListBox : public SmFontPickList, public ListBox +{ +protected: + DECL_LINK(SelectHdl, ListBox *); + +public: + SmFontPickListBox(Window* pParent, const ResId& rResId, USHORT nMax = 4); + + SmFontPickListBox& operator = (const SmFontPickList& rList); + + using SfxPtrArr::Insert; + virtual void Insert(const Font &rFont); + using Window::Update; + virtual void Update(const Font &rFont, const Font &rNewFont); + using SfxPtrArr::Remove; + virtual void Remove(const Font &rFont); +}; + +#endif + diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx new file mode 100644 index 000000000000..d414d1e72309 --- /dev/null +++ b/starmath/inc/view.hxx @@ -0,0 +1,298 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef VIEW_HXX +#define VIEW_HXX + +#include <sfx2/dockwin.hxx> +#include <sfx2/viewsh.hxx> +#include <svtools/scrwin.hxx> +#include <sfx2/ctrlitem.hxx> +#include <sfx2/shell.hxx> +#include <sfx2/viewfac.hxx> +#include <sfx2/viewfrm.hxx> +#include <svtools/colorcfg.hxx> +#include "edit.hxx" +#include "node.hxx" +#include "accessibility.hxx" + +class Menu; +class DataChangedEvent; +class SmClipboardChangeListener; +class SmDocShell; +class SmViewShell; +class SmPrintUIOptions; + +/**************************************************************************/ + +class SmGraphicWindow : public ScrollableWindow +{ + Point aFormulaDrawPos; + Rectangle aCursorRect; + + ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > xAccessible; + SmGraphicAccessible * pAccessible; + + SmViewShell *pViewShell; + USHORT nZoom; + short nModifyCount; + BOOL bIsCursorVisible; + +protected: + void SetFormulaDrawPos(const Point &rPos) { aFormulaDrawPos = rPos; } + void SetIsCursorVisible(BOOL bVis) { bIsCursorVisible = bVis; } + using Window::SetCursor; + void SetCursor(const SmNode *pNode); + void SetCursor(const Rectangle &rRect); + + virtual void DataChanged( const DataChangedEvent& ); + virtual void Paint(const Rectangle&); + virtual void KeyInput(const KeyEvent& rKEvt); + virtual void Command(const CommandEvent& rCEvt); + virtual void StateChanged( StateChangedType eChanged ); + DECL_LINK(MenuSelectHdl, Menu *); + +public: + SmGraphicWindow(SmViewShell* pShell); + ~SmGraphicWindow(); + + // Window + virtual void MouseButtonDown(const MouseEvent &rMEvt); + virtual void GetFocus(); + virtual void LoseFocus(); + + SmViewShell * GetView() { return pViewShell; } + + using Window::SetZoom; + void SetZoom(USHORT Factor); + using Window::GetZoom; + USHORT GetZoom() const { return nZoom; } + + const Point & GetFormulaDrawPos() const { return aFormulaDrawPos; } + + void ZoomToFitInWindow(); + using ScrollableWindow::SetTotalSize; + void SetTotalSize(); + + BOOL IsCursorVisible() const { return bIsCursorVisible; } + void ShowCursor(BOOL bShow); + const SmNode * SetCursorPos(USHORT nRow, USHORT nCol); + + void ApplyColorConfigValues( const svtools::ColorConfig &rColorCfg ); + + // for Accessibility + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); + + using Window::GetAccessible; + SmGraphicAccessible * GetAccessible_Impl() { return pAccessible; } +}; + +/**************************************************************************/ + +class SmGraphicController: public SfxControllerItem +{ +protected: + SmGraphicWindow &rGraphic; +public: + SmGraphicController(SmGraphicWindow &, USHORT, SfxBindings & ); + virtual void StateChanged(USHORT nSID, + SfxItemState eState, + const SfxPoolItem* pState); +}; + +/**************************************************************************/ + +class SmEditController: public SfxControllerItem +{ +protected: + SmEditWindow &rEdit; + +public: + SmEditController(SmEditWindow &, USHORT, SfxBindings & ); +#if OSL_DEBUG_LEVEL > 1 + virtual ~SmEditController(); +#endif + + virtual void StateChanged(USHORT nSID, + SfxItemState eState, + const SfxPoolItem* pState); +}; + +/**************************************************************************/ + +class SmCmdBoxWindow : public SfxDockingWindow +{ + SmEditWindow aEdit; + SmEditController aController; + BOOL bExiting; + + Timer aInitialFocusTimer; + + DECL_LINK(InitialFocusTimerHdl, Timer *); + +protected : + + // Window + virtual void GetFocus(); + virtual void Resize(); + virtual void Paint(const Rectangle& rRect); + virtual void StateChanged( StateChangedType nStateChange ); + + virtual Size CalcDockingSize(SfxChildAlignment eAlign); + virtual SfxChildAlignment CheckAlignment(SfxChildAlignment eActual, + SfxChildAlignment eWish); + + virtual void ToggleFloatingMode(); + +public: + SmCmdBoxWindow(SfxBindings *pBindings, + SfxChildWindow *pChildWindow, + Window *pParent); + + virtual ~SmCmdBoxWindow (); + + void AdjustPosition(); + + SmEditWindow *GetEditWindow() { return (&aEdit); } + SmViewShell *GetView(); +}; + +/**************************************************************************/ + +class SmCmdBoxWrapper : public SfxChildWindow +{ + SFX_DECL_CHILDWINDOW(SmCmdBoxWrapper); + +protected: + SmCmdBoxWrapper(Window *pParentWindow, + USHORT nId, + SfxBindings *pBindings, + SfxChildWinInfo *pInfo); + +#if OSL_DEBUG_LEVEL > 1 + virtual ~SmCmdBoxWrapper(); +#endif + +public: + + SmEditWindow *GetEditWindow() + { + return (((SmCmdBoxWindow *)pWindow)->GetEditWindow()); + } + +}; + +/**************************************************************************/ + +namespace sfx2 { class FileDialogHelper; } +struct SmViewShell_Impl; + +class SmViewShell: public SfxViewShell +{ + // for handling the PasteClipboardState + friend class SmClipboardChangeListener; + + SmGraphicWindow aGraphic; + SmGraphicController aGraphicController; + String StatusText; + + ::com::sun::star::uno:: Reference < + ::com::sun::star::lang:: XEventListener > xClipEvtLstnr; + SmClipboardChangeListener* pClipEvtLstnr; + SmViewShell_Impl* pImpl; + BOOL bPasteState; + + DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* ); + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + +protected: + + Size GetTextLineSize(OutputDevice& rDevice, + const String& rLine); + Size GetTextSize(OutputDevice& rDevice, + const String& rText, + long MaxWidth); + void DrawTextLine(OutputDevice& rDevice, + const Point& rPosition, + const String& rLine); + void DrawText(OutputDevice& rDevice, + const Point& rPosition, + const String& rText, + USHORT MaxWidth); + + virtual USHORT Print(SfxProgress &rProgress, BOOL bIsAPI, PrintDialog *pPrintDialog = 0); + virtual SfxPrinter *GetPrinter(BOOL bCreate = FALSE); + virtual USHORT SetPrinter(SfxPrinter *pNewPrinter, + USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false); + + BOOL Insert( SfxMedium& rMedium ); + BOOL InsertFrom(SfxMedium &rMedium); + + virtual SfxTabPage *CreatePrintOptionsPage(Window *pParent, + const SfxItemSet &rOptions); + virtual void Deactivate(BOOL IsMDIActivate); + virtual void Activate(BOOL IsMDIActivate); + virtual Size GetOptimalSizePixel() const; + virtual void AdjustPosSizePixel(const Point &rPos, const Size &rSize); + virtual void InnerResizePixel(const Point &rOfs, const Size &rSize); + virtual void OuterResizePixel(const Point &rOfs, const Size &rSize); + virtual void QueryObjAreaPixel( Rectangle& rRect ) const; + virtual void SetZoomFactor( const Fraction &rX, const Fraction &rY ); + +public: + TYPEINFO(); + + SmViewShell(SfxViewFrame *pFrame, SfxViewShell *pOldSh); + ~SmViewShell(); + + SmDocShell * GetDoc() + { + return (SmDocShell *) GetViewFrame()->GetObjectShell(); + } + + SmEditWindow * GetEditWindow(); + SmGraphicWindow & GetGraphicWindow() { return aGraphic; } + const SmGraphicWindow & GetGraphicWindow() const { return aGraphic; } + + void SetStatusText(const String& Text); + + void ShowError( const SmErrorDesc *pErrorDesc ); + void NextError(); + void PrevError(); + + SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START+2) + SFX_DECL_VIEWFACTORY(SmViewShell); + + virtual void Execute( SfxRequest& rReq ); + virtual void GetState(SfxItemSet &); + + void Impl_Print( OutputDevice &rOutDev, const SmPrintUIOptions &rPrintUIOptions, + Rectangle aOutRect, Point aZeroPoint ); +}; + +#endif + |