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 _ELEMENTSDOCKINGWINDOW_HXX_
20 #define _ELEMENTSDOCKINGWINDOW_HXX_
22 #include <sfx2/dockwin.hxx>
23 #include <svx/dlgctrl.hxx>
25 #include <document.hxx>
36 SmElement(SmNodePointer pNode
, OUString aText
);
39 SmNodePointer
getNode();
45 virtual bool isSeparator()
51 class SmElementSeparator
: public SmElement
56 virtual bool isSeparator()
62 class SmElementsControl
: public Control
65 static const sal_uInt16 aUnaryBinaryOperatorsList
[];
66 static const sal_uInt16 aRelationsList
[];
67 static const sal_uInt16 aSetOperations
[];
68 static const sal_uInt16 aFunctions
[];
69 static const sal_uInt16 aOperators
[];
70 static const sal_uInt16 aAttributes
[];
71 static const sal_uInt16 aBrackets
[];
72 static const sal_uInt16 aFormats
[];
73 static const sal_uInt16 aOthers
[];
77 virtual void Paint(const Rectangle
&);
78 virtual void MouseButtonDown(const MouseEvent
& rMEvt
);
79 virtual void MouseMove( const MouseEvent
& rMEvt
);
81 typedef boost::shared_ptr
<SmElement
> SmElementPointer
;
82 typedef std::vector
< SmElementPointer
> SmElementList
;
84 SmDocShell
* mpDocShell
;
86 sal_uInt16 maCurrentSetId
;
87 SmElement
* mpCurrentElement
;
89 SmElementList maElementList
;
90 Size maMaxElementDimensions
;
92 void addElement(OUString aElementVisual
, OUString aElementSource
);
94 void addElements(const sal_uInt16 aElementsArray
[], sal_uInt16 size
);
101 SmElementsControl(Window
*pParent
, const ResId
& rResId
);
103 void setElementSetId(sal_uInt16 aSetId
);
105 void SetSelectHdl(const Link
& rLink
) { aSelectHdlLink
= rLink
; }
108 class SmElementsDockingWindow
: public SfxDockingWindow
110 static const sal_uInt16 aCategories
[];
112 SmElementsControl maElementsControl
;
113 ListBox maElementListBox
;
115 virtual void Resize();
116 SmViewShell
* GetView();
118 DECL_LINK(SelectClickHdl
, SmElement
*);
119 DECL_LINK(ElementSelectedHandle
, ListBox
*);
123 SmElementsDockingWindow( SfxBindings
* pBindings
,
124 SfxChildWindow
* pChildWindow
,
126 ~SmElementsDockingWindow();
129 class SmElementsDockingWindowWrapper
: public SfxChildWindow
131 SFX_DECL_CHILDWINDOW_WITHID(SmElementsDockingWindowWrapper
);
134 SmElementsDockingWindowWrapper( Window
* pParentWindow
,
136 SfxBindings
* pBindings
,
137 SfxChildWinInfo
* pInfo
);
138 virtual ~SmElementsDockingWindowWrapper();
142 #endif // _SYMBOLDOCKINGWINDOW_HXX_
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */