/src/libreoffice/sc/inc/autoform.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 | | |
20 | | #pragma once |
21 | | |
22 | | #include <sal/types.h> |
23 | | #include <svx/TableAutoFmt.hxx> |
24 | | #include <svx/TableStylesParser.hxx> |
25 | | #include "scdllapi.h" |
26 | | |
27 | | #include <array> |
28 | | #include <memory> |
29 | | #include "document.hxx" |
30 | | |
31 | | class ScAutoFormatDataField : public SvxAutoFormatDataField |
32 | | { |
33 | | public: |
34 | | ScAutoFormatDataField(); |
35 | | ScAutoFormatDataField(const ScAutoFormatDataField& rCopy); |
36 | | ScAutoFormatDataField(const SvxAutoFormatDataField& rCopy); |
37 | | ~ScAutoFormatDataField(); |
38 | | |
39 | | }; |
40 | | |
41 | | class SAL_DLLPUBLIC_RTTI ScAutoFormatData : public SvxAutoFormatData |
42 | | { |
43 | | private: |
44 | | std::array<std::unique_ptr<ScAutoFormatDataField>, ELEMENT_COUNT> mpDataField; |
45 | | |
46 | | public: |
47 | | ScAutoFormatData(); |
48 | | SC_DLLPUBLIC ScAutoFormatData(const ScAutoFormatData& rData); |
49 | | SC_DLLPUBLIC ScAutoFormatData(const SvxAutoFormatData& rData); |
50 | | |
51 | | ScAutoFormatDataField* GetField(size_t nIndex) override; |
52 | | const ScAutoFormatDataField* GetField(size_t nIndex) const override; |
53 | | bool SetField(size_t nIndex, const SvxAutoFormatDataField& aField) override; |
54 | 0 | SvxAutoFormatData* MakeCopy() const override { return new ScAutoFormatData(*this); }; |
55 | 0 | SvxAutoFormatDataField* GetDefaultField() const override { return new ScAutoFormatDataField; }; |
56 | | |
57 | | const SfxPoolItem* GetItem(sal_uInt8 nIndex, sal_uInt16 nWhich) const; |
58 | | template <class T> const T* GetItem(sal_uInt8 nIndex, TypedWhichId<T> nWhich) const |
59 | 0 | { |
60 | 0 | return static_cast<const T*>(GetItem(nIndex, sal_uInt16(nWhich))); |
61 | 0 | } Unexecuted instantiation: ScRotateValueItem const* ScAutoFormatData::GetItem<ScRotateValueItem>(unsigned char, TypedWhichId<ScRotateValueItem>) const Unexecuted instantiation: SvxBoxItem const* ScAutoFormatData::GetItem<SvxBoxItem>(unsigned char, TypedWhichId<SvxBoxItem>) const |
62 | | void PutItem(size_t nIndex, const SfxPoolItem& rItem); |
63 | | |
64 | | void CopyItem(size_t nToIndex, size_t nFromIndex, sal_uInt16 nWhich); |
65 | | void FillToItemSet(size_t nIndex, SfxItemSet& rItemSet) const; |
66 | | void GetFromItemSet(size_t nIndex, const SfxItemSet& rItemSet); |
67 | | }; |
68 | | |
69 | | class SAL_DLLPUBLIC_RTTI ScAutoFormat : public SvxAutoFormat |
70 | | { |
71 | | private: |
72 | | struct Impl; |
73 | | std::unique_ptr<Impl> mpImpl; |
74 | | |
75 | | public: |
76 | | ScAutoFormat(); |
77 | | ~ScAutoFormat(); |
78 | | |
79 | | const ScAutoFormatData* GetData(size_t nIndex) const override; |
80 | | ScAutoFormatData* GetData(size_t nIndex) override; |
81 | | bool InsertAutoFormat(SvxAutoFormatData* pFormat) override; |
82 | | ScAutoFormatData* ReleaseAutoFormat(const OUString& rName) override; |
83 | | ScAutoFormatData* FindAutoFormat(const OUString& rName) const override; |
84 | | const ScAutoFormatData* GetResolvedStyle(const SvxAutoFormatData* pData) const override; |
85 | 0 | SvxAutoFormatData* GetDefaultData() override { return new ScAutoFormatData();}; |
86 | 0 | SvxAutoFormatDataField* GetDefaultField() override { return new ScAutoFormatDataField; }; |
87 | | size_t size() const override; |
88 | | }; |
89 | | |
90 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |