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 .
22 #include <sfx2/dockwin.hxx>
23 #include <vcl/customweld.hxx>
24 #include <vcl/weld.hxx>
25 #include <unotools/resmgr.hxx>
28 #include "parsebase.hxx"
37 class SmElementsControl
39 std::unique_ptr
<AbstractSmParser
> maParser
;
41 SmDocShell
* mpDocShell
;
43 int mnCurrentSetIndex
;
44 sal_uInt16 m_nSmSyntaxVersion
;
46 std::vector
<std::unique_ptr
<ElementData
>> maItemDatas
;
47 std::unique_ptr
<weld::IconView
> mpIconView
;
49 Link
<OUString
, void> maSelectHdlLink
;
51 void addElement(const OUString
& aElementVisual
, const OUString
& aElementSource
, const OUString
& aHelpText
);
52 void addElements(int nCategory
);
56 DECL_LINK(QueryTooltipHandler
, const weld::TreeIter
&, OUString
);
57 DECL_LINK(ElementActivatedHandler
, weld::IconView
&, bool);
59 static OUString
GetElementSource(const OUString
& itemId
);
60 static OUString
GetElementHelpText(const OUString
& itemId
);
64 explicit SmElementsControl(std::unique_ptr
<weld::IconView
> pIconView
);
67 static const std::vector
<TranslateId
>& categories();
68 void setElementSetIndex(int nSetIndex
);
70 void setSmSyntaxVersion(sal_uInt16 nSmSyntaxVersion
);
72 void SetSelectHdl(const Link
<OUString
, void>& rLink
) { maSelectHdlLink
= rLink
; }
74 static Color
GetTextColor();
75 static Color
GetControlBackground();
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */