1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_STARMATH_INC_ELEMENTSDOCKINGWINDOW_HXX
20 #define INCLUDED_STARMATH_INC_ELEMENTSDOCKINGWINDOW_HXX
22 #include <sfx2/dockwin.hxx>
23 #include <svx/dlgctrl.hxx>
25 #include <document.hxx>
37 SmElement(SmNodePointer pNode
, const OUString
& aText
, const OUString
& aHelpText
);
40 SmNodePointer
getNode();
46 OUString
getHelpText()
51 virtual bool isSeparator()
57 class SmElementSeparator
: public SmElement
62 virtual bool isSeparator() SAL_OVERRIDE
68 class SmElementsControl
: public Control
71 static const sal_uInt16 aUnaryBinaryOperatorsList
[][2];
72 static const sal_uInt16 aRelationsList
[][2];
73 static const sal_uInt16 aSetOperations
[][2];
74 static const sal_uInt16 aFunctions
[][2];
75 static const sal_uInt16 aOperators
[][2];
76 static const sal_uInt16 aAttributes
[][2];
77 static const sal_uInt16 aBrackets
[][2];
78 static const sal_uInt16 aFormats
[][2];
79 static const sal_uInt16 aOthers
[][2];
83 virtual void Paint(const Rectangle
&) SAL_OVERRIDE
;
84 virtual void MouseButtonDown(const MouseEvent
& rMEvt
) SAL_OVERRIDE
;
85 virtual void MouseMove( const MouseEvent
& rMEvt
) SAL_OVERRIDE
;
87 typedef boost::shared_ptr
<SmElement
> SmElementPointer
;
88 typedef std::vector
< SmElementPointer
> SmElementList
;
90 SmDocShell
* mpDocShell
;
92 sal_uInt16 maCurrentSetId
;
93 SmElement
* mpCurrentElement
;
95 SmElementList maElementList
;
96 Size maMaxElementDimensions
;
99 void addElement(const OUString
& aElementVisual
, const OUString
& aElementSource
, const OUString
& aHelpText
);
101 void addElements(const sal_uInt16 aElementsArray
[][2], sal_uInt16 size
);
108 SmElementsControl(Window
*pParent
, const ResId
& rResId
);
109 virtual ~SmElementsControl();
111 void setElementSetId(sal_uInt16 aSetId
);
113 void setVerticalMode(bool bVertical
);
115 void SetSelectHdl(const Link
& rLink
) { aSelectHdlLink
= rLink
; }
118 class SmElementsDockingWindow
: public SfxDockingWindow
120 static const sal_uInt16 aCategories
[];
122 SmElementsControl maElementsControl
;
123 ListBox maElementListBox
;
125 virtual void Resize() SAL_OVERRIDE
;
126 SmViewShell
* GetView();
128 DECL_LINK(SelectClickHdl
, SmElement
*);
129 DECL_LINK(ElementSelectedHandle
, ListBox
*);
133 SmElementsDockingWindow( SfxBindings
* pBindings
,
134 SfxChildWindow
* pChildWindow
,
136 virtual ~SmElementsDockingWindow();
138 virtual void EndDocking( const Rectangle
& rReactangle
, bool bFloatMode
) SAL_OVERRIDE
;
139 virtual void ToggleFloatingMode() SAL_OVERRIDE
;
142 class SmElementsDockingWindowWrapper
: public SfxChildWindow
144 SFX_DECL_CHILDWINDOW_WITHID(SmElementsDockingWindowWrapper
);
147 SmElementsDockingWindowWrapper( Window
* pParentWindow
,
149 SfxBindings
* pBindings
,
150 SfxChildWinInfo
* pInfo
);
151 virtual ~SmElementsDockingWindowWrapper();
155 #endif // _SYMBOLDOCKINGWINDOW_HXX_
157 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */