/src/libreoffice/include/svx/numvset.hxx
Line | Count | Source |
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 | | #ifndef INCLUDED_SVX_NUMVSET_HXX |
20 | | #define INCLUDED_SVX_NUMVSET_HXX |
21 | | |
22 | | #include <vcl/idle.hxx> |
23 | | #include <svtools/valueset.hxx> |
24 | | #include <com/sun/star/uno/Reference.h> |
25 | | #include <com/sun/star/uno/Sequence.h> |
26 | | #include <com/sun/star/lang/Locale.hpp> |
27 | | #include <svx/svxdllapi.h> |
28 | | |
29 | | namespace com::sun::star { |
30 | | namespace container{ |
31 | | class XIndexAccess; |
32 | | } |
33 | | namespace beans{ |
34 | | struct PropertyValue; |
35 | | } |
36 | | namespace text{ |
37 | | class XNumberingFormatter; |
38 | | } |
39 | | } |
40 | | |
41 | | enum class NumberingPageType |
42 | | { |
43 | | DOCBULLET, |
44 | | BULLET, |
45 | | SINGLENUM, |
46 | | OUTLINE, |
47 | | BITMAP |
48 | | }; |
49 | | |
50 | | class SVX_DLLPUBLIC SvxNumValueSet : public ValueSet |
51 | | { |
52 | | NumberingPageType mePageType; |
53 | | tools::Rectangle maOrgRect; |
54 | | VclPtr<VirtualDevice> mpVDev; |
55 | | |
56 | | css::uno::Reference<css::text::XNumberingFormatter> mxFormatter; |
57 | | css::lang::Locale maLocale; |
58 | | |
59 | | // Pair of bullet chars (first), and their respective font (second) |
60 | | std::vector<std::pair<OUString, OUString>> maCustomBullets; |
61 | | |
62 | | css::uno::Sequence< |
63 | | css::uno::Sequence< |
64 | | css::beans::PropertyValue> > maNumSettings; |
65 | | |
66 | | css::uno::Sequence< |
67 | | css::uno::Reference< |
68 | | css::container::XIndexAccess> > maOutlineSettings; |
69 | | |
70 | | public: |
71 | | SvxNumValueSet(std::unique_ptr<weld::ScrolledWindow> pScrolledWindow); |
72 | | void init(NumberingPageType eType); |
73 | | virtual ~SvxNumValueSet() override; |
74 | | |
75 | | virtual void UserDraw( const UserDrawEvent& rUDEvt ) override; |
76 | | |
77 | | void SetNumberingSettings( |
78 | | const css::uno::Sequence< |
79 | | css::uno::Sequence<css::beans::PropertyValue> >& aNum, |
80 | | css::uno::Reference<css::text::XNumberingFormatter> const & xFormatter, |
81 | | const css::lang::Locale& rLocale ); |
82 | | |
83 | | void SetOutlineNumberingSettings( |
84 | | css::uno::Sequence< |
85 | | css::uno::Reference<css::container::XIndexAccess> > const & rOutline, |
86 | | css::uno::Reference<css::text::XNumberingFormatter> const & xFormatter, |
87 | | const css::lang::Locale& rLocale); |
88 | | |
89 | 0 | const std::vector<std::pair<OUString, OUString>> & GetCustomBullets() { return maCustomBullets; } |
90 | | void SetCustomBullets(const std::vector<std::pair<OUString, OUString>>& rCustomBullets); |
91 | | |
92 | | virtual FactoryFunction GetUITestFactory() const override; |
93 | | |
94 | | }; |
95 | | |
96 | | |
97 | | class SVX_DLLPUBLIC SvxBmpNumValueSet final : public SvxNumValueSet |
98 | | { |
99 | | Idle m_aFormatIdle; |
100 | | bool m_bGrfNotFound; |
101 | | |
102 | | DECL_DLLPRIVATE_LINK(FormatHdl_Impl, Timer *, void); |
103 | | |
104 | | public: |
105 | | SvxBmpNumValueSet(std::unique_ptr<weld::ScrolledWindow> pScrolledWindow); |
106 | | void init(); |
107 | | virtual ~SvxBmpNumValueSet() override; |
108 | | |
109 | | virtual void UserDraw( const UserDrawEvent& rUDEvt ) override; |
110 | | }; |
111 | | |
112 | | #endif |
113 | | |
114 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |