summaryrefslogtreecommitdiff
path: root/starmath/inc
diff options
context:
space:
mode:
authorTomaž Vajngerl <quikee@gmail.com>2013-05-20 00:13:10 +0200
committerTomaž Vajngerl <quikee@gmail.com>2013-05-20 00:20:27 +0200
commit2d3baccf0249f8c68dcf8f9b0000453d0bc82d8f (patch)
treee40b44c418a9dde000e6e461d719b98227538539 /starmath/inc
parentc0b8dd85d4b49e8800e69e614c567ce272ac9780 (diff)
Math: new rendered Elements docking window added
Added a docking window with elements that are rendered using the math renderer insted of static pictures. Currently this is an alternative to the existing elements floating window which will be removed when the new one is ready. This is an initial but fully functional version. Change-Id: I7678d09d643c532c672447026b0f12b7b70fc91d
Diffstat (limited to 'starmath/inc')
-rw-r--r--starmath/inc/ElementsDockingWindow.hxx142
-rw-r--r--starmath/inc/starmath.hrc48
2 files changed, 190 insertions, 0 deletions
diff --git a/starmath/inc/ElementsDockingWindow.hxx b/starmath/inc/ElementsDockingWindow.hxx
new file mode 100644
index 000000000000..48fc51bf8052
--- /dev/null
+++ b/starmath/inc/ElementsDockingWindow.hxx
@@ -0,0 +1,142 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _ELEMENTSDOCKINGWINDOW_HXX_
+#define _ELEMENTSDOCKINGWINDOW_HXX_
+
+#include <sfx2/ctrlitem.hxx>
+#include <sfx2/dockwin.hxx>
+#include <vcl/toolbox.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/group.hxx>
+#include <vcl/graph.hxx>
+
+#include <svx/dlgctrl.hxx>
+#include <document.hxx>
+
+class SmElement
+{
+ SmNode* mpNode;
+ OUString maText;
+public:
+ SmElement(SmNode* pNode, OUString aText);
+ virtual ~SmElement();
+ SmNode* getNode();
+
+ OUString getText() { return maText; }
+
+ virtual bool isSeparator()
+ {
+ return false;
+ }
+
+ Point mBoxLocation;
+ Size mBoxSize;
+};
+
+class SmElementSeparator : public SmElement
+{
+public:
+ SmElementSeparator();
+
+ virtual bool isSeparator()
+ {
+ return true;
+ }
+};
+
+class SmElementsControl : public Control
+{
+
+ static const sal_uInt16 aUnaryBinaryOperatorsList[];
+ static const sal_uInt16 aRelationsList[];
+ static const sal_uInt16 aSetOperations[];
+ static const sal_uInt16 aFunctions[];
+ static const sal_uInt16 aOperators[];
+ static const sal_uInt16 aAttributes[];
+ static const sal_uInt16 aBrackets[];
+ static const sal_uInt16 aFormats[];
+ static const sal_uInt16 aOthers[];
+
+ Link aSelectHdlLink;
+
+ virtual void Paint(const Rectangle&);
+ virtual void MouseButtonDown(const MouseEvent& rMEvt);
+ virtual void MouseMove( const MouseEvent& rMEvt );
+
+ SmDocShell* mpDocShell;
+ SmFormat maFormat;
+ sal_uInt16 maCurrentSetId;
+ SmElement* mpCurrentElement;
+
+ std::vector<SmElement*> maElementList;
+ Size maMaxElementDimensions;
+
+ void addElement(OUString aElementVisual, OUString aElementSource);
+
+ void addElements(const sal_uInt16 aElementsArray[], sal_uInt16 size);
+
+ void addSeparator();
+
+ void build();
+
+public:
+ SmElementsControl(Window *pParent, const ResId& rResId);
+
+ void setElementSetId(sal_uInt16 aSetId);
+
+ void SetSelectHdl(const Link& rLink) { aSelectHdlLink = rLink; }
+};
+
+class SmElementsDockingWindow : public SfxDockingWindow
+{
+ static const sal_uInt16 aCategories[];
+
+ SmElementsControl maElementsControl;
+ ListBox maElementListBox;
+
+ virtual void Resize();
+ SmViewShell* GetView();
+
+ DECL_LINK(SelectClickHdl, SmElement*);
+ DECL_LINK(ElementSelectedHandle, ListBox*);
+
+public:
+
+ SmElementsDockingWindow( SfxBindings* pBindings,
+ SfxChildWindow* pChildWindow,
+ Window* pParent );
+ ~SmElementsDockingWindow();
+};
+
+class SmElementsDockingWindowWrapper : public SfxChildWindow
+{
+ SFX_DECL_CHILDWINDOW_WITHID(SmElementsDockingWindowWrapper);
+
+protected:
+ SmElementsDockingWindowWrapper( Window* pParentWindow,
+ sal_uInt16 nId,
+ SfxBindings* pBindings,
+ SfxChildWinInfo* pInfo );
+ virtual ~SmElementsDockingWindowWrapper();
+};
+
+
+#endif // _SYMBOLDOCKINGWINDOW_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc
index ed1eb26ce920..a9bfbfa83119 100644
--- a/starmath/inc/starmath.hrc
+++ b/starmath/inc/starmath.hrc
@@ -56,6 +56,7 @@
#define SID_INSERTSYMBOL (SID_SMA_START + 104)
/** Command for inserting a math construction specified in commands.src */
#define SID_INSERTCOMMAND (SID_SMA_START + 105)
+#define SID_INSERTCOMMANDTEXT (SID_SMA_START + 106)
#define SID_LOADSYMBOLS (SID_SMA_START + 107)
#define SID_SAVESYMBOLS (SID_SMA_START + 108)
@@ -77,6 +78,7 @@
#define SID_TOOLBOXWINDOW (SID_SMA_START + 123)
#define SID_NO_RIGHT_SPACES (SID_SMA_START + 124)
#define SID_SAVE_ONLY_USED_SYMBOLS (SID_SMA_START + 125)
+#define SID_ELEMENTSDOCKINGWINDOW (SID_SMA_START + 126)
#define RID_FONTDIALOG (RID_APP_START + 2)
@@ -110,6 +112,7 @@
#define RID_SYMBOLFILESSTR (RID_APP_START + 809)
#define RID_ALLFILESSTR (RID_APP_START + 810)
#define RID_STATUSBAR (RID_APP_START + 816)
+#define RID_ELEMENTSDOCKINGWINDOW (RID_APP_START + 817)
#define STR_MATH_DOCUMENT_FULLTYPE_CURRENT (RID_APP_START + 821)
#define STR_STATSTR_READING (RID_APP_START + 823)
@@ -281,6 +284,39 @@
#define RID_LIMINFX (RID_APP_START + 1616)
#define RID_LIMSUPX (RID_APP_START + 1617)
+#define RID_LIM_FROMX (RID_APP_START + 1621)
+#define RID_SUM_FROMX (RID_APP_START + 1622)
+#define RID_PROD_FROMX (RID_APP_START + 1623)
+#define RID_COPROD_FROMX (RID_APP_START + 1624)
+#define RID_INT_FROMX (RID_APP_START + 1625)
+#define RID_IINT_FROMX (RID_APP_START + 1626)
+#define RID_IIINT_FROMX (RID_APP_START + 1627)
+#define RID_LINT_FROMX (RID_APP_START + 1629)
+#define RID_LLINT_FROMX (RID_APP_START + 1630)
+#define RID_LLLINT_FROMX (RID_APP_START + 1631)
+
+#define RID_LIM_TOX (RID_APP_START + 1641)
+#define RID_SUM_TOX (RID_APP_START + 1642)
+#define RID_PROD_TOX (RID_APP_START + 1643)
+#define RID_COPROD_TOX (RID_APP_START + 1644)
+#define RID_INT_TOX (RID_APP_START + 1645)
+#define RID_IINT_TOX (RID_APP_START + 1646)
+#define RID_IIINT_TOX (RID_APP_START + 1647)
+#define RID_LINT_TOX (RID_APP_START + 1649)
+#define RID_LLINT_TOX (RID_APP_START + 1650)
+#define RID_LLLINT_TOX (RID_APP_START + 1651)
+
+#define RID_LIM_FROMTOX (RID_APP_START + 1661)
+#define RID_SUM_FROMTOX (RID_APP_START + 1662)
+#define RID_PROD_FROMTOX (RID_APP_START + 1663)
+#define RID_COPROD_FROMTOX (RID_APP_START + 1664)
+#define RID_INT_FROMTOX (RID_APP_START + 1665)
+#define RID_IINT_FROMTOX (RID_APP_START + 1666)
+#define RID_IIINT_FROMTOX (RID_APP_START + 1667)
+#define RID_LINT_FROMTOX (RID_APP_START + 1669)
+#define RID_LLINT_FROMTOX (RID_APP_START + 1670)
+#define RID_LLLINT_FROMTOX (RID_APP_START + 1671)
+
#define RID_ACUTEX (RID_APP_START + 1701)
#define RID_GRAVEX (RID_APP_START + 1702)
#define RID_CHECKX (RID_APP_START + 1703)
@@ -396,6 +432,16 @@
#define RID_SPANISH_50_NAMES (RID_APP_START + 3113)
#define RID_SPANISH_60_NAMES (RID_APP_START + 3114)
+#define RID_CATERGORY_UNARY_BINARY_OPERATORS (RID_APP_START + 4001)
+#define RID_CATERGORY_RELATIONS (RID_APP_START + 4002)
+#define RID_CATERGORY_SET_OPERATIONS (RID_APP_START + 4003)
+#define RID_CATERGORY_FUNCTIONS (RID_APP_START + 4004)
+#define RID_CATERGORY_OPERATORS (RID_APP_START + 4005)
+#define RID_CATERGORY_ATTRIBUTES (RID_APP_START + 4006)
+#define RID_CATERGORY_BRACKETS (RID_APP_START + 4007)
+#define RID_CATERGORY_FORMATS (RID_APP_START + 4008)
+#define RID_CATERGORY_OTHERS (RID_APP_START + 4009)
+#define RID_CATERGORY_EXAMPLES (RID_APP_START + 4010)
#define BMP_ARROW_RIGHT 1
@@ -406,6 +452,8 @@
#define MN_SUB_SPELLING 34
#define MN_SUB_TEMPLATES 35
+#define FT_1 1
+
// 342 == SCH_IF_SMAVIEWSHELL, because SFX_INTERFACE_LIB is no
// Define but latterly an Enum
#define HID_SMA_VIEWSHELL_DOCUMENT (342)