LibreOffice Module starmath (master) 1
ElementsDockingWindow.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <sfx2/dockwin.hxx>
23#include <vcl/customweld.hxx>
24#include <vcl/weld.hxx>
25#include <unotools/resmgr.hxx>
26
27#include "node.hxx"
28#include "parsebase.hxx"
29
30#include <memory>
31#include <vector>
32
33class SmDocShell;
34class SvTreeListBox;
35struct ElementData;
36
38{
39 std::unique_ptr<AbstractSmParser> maParser;
40
45
46 std::vector<std::unique_ptr<ElementData>> maItemDatas;
47 std::unique_ptr<weld::IconView> mpIconView;
48
50
51 void addElement(const OUString& aElementVisual, const OUString& aElementSource, const OUString& aHelpText);
52 void addElements(int nCategory);
53
54 void build();
55
56 DECL_LINK(QueryTooltipHandler, const weld::TreeIter&, OUString);
57 DECL_LINK(ElementActivatedHandler, weld::IconView&, bool);
58
59 static OUString GetElementSource(const OUString& itemId);
60 static OUString GetElementHelpText(const OUString& itemId);
61
62public:
63
64 explicit SmElementsControl(std::unique_ptr<weld::IconView> pIconView);
66
67 static const std::vector<TranslateId>& categories();
68 void setElementSetIndex(int nSetIndex);
69
70 void setSmSyntaxVersion(sal_uInt16 nSmSyntaxVersion);
71
72 void SetSelectHdl(const Link<OUString, void>& rLink) { maSelectHdlLink = rLink; }
73
74 static Color GetTextColor();
76};
77
78/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::IconView > mpIconView
void SetSelectHdl(const Link< OUString, void > &rLink)
DECL_LINK(ElementActivatedHandler, weld::IconView &, bool)
std::unique_ptr< AbstractSmParser > maParser
static Color GetControlBackground()
Link< OUString, void > maSelectHdlLink
void addElements(int nCategory)
static OUString GetElementSource(const OUString &itemId)
SmElementsControl(std::unique_ptr< weld::IconView > pIconView)
void addElement(const OUString &aElementVisual, const OUString &aElementSource, const OUString &aHelpText)
void setElementSetIndex(int nSetIndex)
static const std::vector< TranslateId > & categories()
void setSmSyntaxVersion(sal_uInt16 nSmSyntaxVersion)
std::vector< std::unique_ptr< ElementData > > maItemDatas
DECL_LINK(QueryTooltipHandler, const weld::TreeIter &, OUString)
static OUString GetElementHelpText(const OUString &itemId)