2013-05-19 17:13:10 -05:00
|
|
|
/* -*- 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 .
|
|
|
|
*/
|
2013-10-22 14:30:16 -05:00
|
|
|
#ifndef INCLUDED_STARMATH_INC_ELEMENTSDOCKINGWINDOW_HXX
|
|
|
|
#define INCLUDED_STARMATH_INC_ELEMENTSDOCKINGWINDOW_HXX
|
2013-05-19 17:13:10 -05:00
|
|
|
|
|
|
|
#include <sfx2/dockwin.hxx>
|
|
|
|
#include <svx/dlgctrl.hxx>
|
2013-05-20 01:22:50 -05:00
|
|
|
|
2013-05-19 17:13:10 -05:00
|
|
|
#include <document.hxx>
|
2013-05-20 01:22:50 -05:00
|
|
|
#include <node.hxx>
|
2013-05-19 17:13:10 -05:00
|
|
|
|
|
|
|
class SmElement
|
|
|
|
{
|
2013-05-20 01:22:50 -05:00
|
|
|
SmNodePointer mpNode;
|
|
|
|
OUString maText;
|
2013-11-03 06:11:31 -06:00
|
|
|
OUString maHelpText;
|
2013-05-19 17:13:10 -05:00
|
|
|
public:
|
2013-05-20 01:22:50 -05:00
|
|
|
Point mBoxLocation;
|
|
|
|
Size mBoxSize;
|
|
|
|
|
2013-11-03 06:11:31 -06:00
|
|
|
SmElement(SmNodePointer pNode, OUString aText, OUString aHelpText);
|
2013-05-19 17:13:10 -05:00
|
|
|
virtual ~SmElement();
|
|
|
|
|
2013-05-20 01:22:50 -05:00
|
|
|
SmNodePointer getNode();
|
|
|
|
OUString getText()
|
|
|
|
{
|
|
|
|
return maText;
|
|
|
|
}
|
2013-05-19 17:13:10 -05:00
|
|
|
|
2013-11-03 06:11:31 -06:00
|
|
|
OUString getHelpText()
|
|
|
|
{
|
|
|
|
return maHelpText;
|
|
|
|
}
|
|
|
|
|
2013-05-19 17:13:10 -05:00
|
|
|
virtual bool isSeparator()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class SmElementSeparator : public SmElement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SmElementSeparator();
|
|
|
|
|
|
|
|
virtual bool isSeparator()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class SmElementsControl : public Control
|
|
|
|
{
|
|
|
|
|
2013-11-03 06:11:31 -06:00
|
|
|
static const sal_uInt16 aUnaryBinaryOperatorsList[][2];
|
|
|
|
static const sal_uInt16 aRelationsList[][2];
|
|
|
|
static const sal_uInt16 aSetOperations[][2];
|
|
|
|
static const sal_uInt16 aFunctions[][2];
|
|
|
|
static const sal_uInt16 aOperators[][2];
|
|
|
|
static const sal_uInt16 aAttributes[][2];
|
|
|
|
static const sal_uInt16 aBrackets[][2];
|
|
|
|
static const sal_uInt16 aFormats[][2];
|
2013-11-05 05:04:51 -06:00
|
|
|
static const sal_uInt16 aGreek[][2];
|
|
|
|
static const sal_uInt16 aSymbols[][2];
|
2013-11-03 06:11:31 -06:00
|
|
|
static const sal_uInt16 aOthers[][2];
|
2013-05-19 17:13:10 -05:00
|
|
|
|
|
|
|
Link aSelectHdlLink;
|
|
|
|
|
|
|
|
virtual void Paint(const Rectangle&);
|
|
|
|
virtual void MouseButtonDown(const MouseEvent& rMEvt);
|
|
|
|
virtual void MouseMove( const MouseEvent& rMEvt );
|
|
|
|
|
2013-05-20 01:22:50 -05:00
|
|
|
typedef boost::shared_ptr<SmElement> SmElementPointer;
|
|
|
|
typedef std::vector< SmElementPointer > SmElementList;
|
|
|
|
|
|
|
|
SmDocShell* mpDocShell;
|
|
|
|
SmFormat maFormat;
|
|
|
|
sal_uInt16 maCurrentSetId;
|
|
|
|
SmElement* mpCurrentElement;
|
2013-05-19 17:13:10 -05:00
|
|
|
|
2013-05-20 01:22:50 -05:00
|
|
|
SmElementList maElementList;
|
|
|
|
Size maMaxElementDimensions;
|
2013-06-13 14:42:35 -05:00
|
|
|
bool mbVerticalMode;
|
2013-05-19 17:13:10 -05:00
|
|
|
|
2013-11-03 06:11:31 -06:00
|
|
|
void addElement(OUString aElementVisual, OUString aElementSource, OUString aHelpText);
|
2013-05-19 17:13:10 -05:00
|
|
|
|
2013-11-03 06:11:31 -06:00
|
|
|
void addElements(const sal_uInt16 aElementsArray[][2], sal_uInt16 size);
|
2013-05-19 17:13:10 -05:00
|
|
|
|
|
|
|
void addSeparator();
|
|
|
|
|
|
|
|
void build();
|
|
|
|
|
|
|
|
public:
|
|
|
|
SmElementsControl(Window *pParent, const ResId& rResId);
|
2013-07-25 06:37:09 -05:00
|
|
|
virtual ~SmElementsControl();
|
2013-05-19 17:13:10 -05:00
|
|
|
|
|
|
|
void setElementSetId(sal_uInt16 aSetId);
|
|
|
|
|
2013-06-13 14:42:35 -05:00
|
|
|
void setVerticalMode(bool bVertical);
|
|
|
|
|
2013-05-19 17:13:10 -05:00
|
|
|
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();
|
2013-06-13 14:42:35 -05:00
|
|
|
|
|
|
|
virtual void EndDocking( const Rectangle& rReactangle, sal_Bool bFloatMode);
|
2013-11-13 02:30:08 -06:00
|
|
|
virtual void ToggleFloatingMode();
|
2013-05-19 17:13:10 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
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: */
|