LibreOffice Module sw (master) 1
vbacontentcontrol.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#pragma once
10
11#include <com/sun/star/text/XTextDocument.hpp>
12#include <ooo/vba/word/XContentControl.hpp>
13
15
17
19
21{
22private:
23 css::uno::Reference<css::text::XTextDocument> mxTextDocument;
24 std::shared_ptr<SwContentControl> m_pCC;
25
26public:
28 SwVbaContentControl(const css::uno::Reference<ooo::vba::XHelperInterface>& rParent,
29 const css::uno::Reference<css::uno::XComponentContext>& rContext,
30 const css::uno::Reference<css::text::XTextDocument>& xTextDocument,
31 std::shared_ptr<SwContentControl> pContentControl);
32 ~SwVbaContentControl() override;
33
34 // XContentControl Properties
35 sal_Bool SAL_CALL getAllowInsertDeleteSection() override;
36 void SAL_CALL setAllowInsertDeleteSection(sal_Bool bSet) override;
37
38 sal_Int32 SAL_CALL getAppearance() override;
39 void SAL_CALL setAppearance(sal_Int32 nSet) override;
40
41 OUString SAL_CALL getBuildingBlockCategory() override;
42 void SAL_CALL setBuildingBlockCategory(const OUString& sSet) override;
43
44 sal_Int32 SAL_CALL getBuildingBlockType() override;
45 void SAL_CALL setBuildingBlockType(sal_Int32 nSet) override;
46
47 sal_Bool SAL_CALL getChecked() override;
48 void SAL_CALL setChecked(sal_Bool bSet) override;
49
50 // returns or sets a WdColor (@since after 2010 I assume)
51 sal_Int32 SAL_CALL getColor() override;
52 void SAL_CALL setColor(sal_Int32 nSet) override;
53
54 sal_Int32 SAL_CALL getDateCalendarType() override;
55 void SAL_CALL setDateCalendarType(sal_Int32 nSet) override;
56
57 OUString SAL_CALL getDateDisplayFormat() override;
58 void SAL_CALL setDateDisplayFormat(const OUString& sSet) override;
59
60 sal_Int32 SAL_CALL getDateDisplayLocale() override;
61
62 sal_Int32 SAL_CALL getDateStorageFormat() override;
63 void SAL_CALL setDateStorageFormat(sal_Int32 nSet) override;
64
65 css::uno::Any SAL_CALL getDropdownListEntries() override;
66
67 // This is an integer used as a unique identifier string
68 OUString SAL_CALL getID() override;
69
70 sal_Int32 SAL_CALL getLevel() override;
71
72 // returns or sets if the user can delete the control
73 sal_Bool SAL_CALL getLockContentControl() override;
74 void SAL_CALL setLockContentControl(sal_Bool bSet) override;
75
76 // returns or sets if the user can edit the contents (i.e. read-only flag)
77 sal_Bool SAL_CALL getLockContents() override;
78 void SAL_CALL setLockContents(sal_Bool bSet) override;
79
80 sal_Bool SAL_CALL getMultiLine() override;
81 void SAL_CALL setMultiLine(sal_Bool bSet) override;
82
83 // WRONG- THIS SHOULD RETURN XBUILDINGBLOCK
84 OUString SAL_CALL getPlaceholderText() override;
85
86 sal_Bool SAL_CALL getShowingPlaceholderText() override;
87
88 OUString SAL_CALL getRepeatingSectionItemTitle() override;
89 void SAL_CALL setRepeatingSectionItemTitle(const OUString& rSet) override;
90
91 css::uno::Reference<ooo::vba::word::XRange> SAL_CALL getRange() override;
92
93 OUString SAL_CALL getTag() override;
94 void SAL_CALL setTag(const OUString& rSet) override;
95
96 // returns or sets if the control is removed after accepting user change (i.e. control -> text)
97 sal_Bool SAL_CALL getTemporary() override;
98 void SAL_CALL setTemporary(sal_Bool bSet) override;
99
100 OUString SAL_CALL getTitle() override;
101 void SAL_CALL setTitle(const OUString& rSet) override;
102
103 // returns or sets a WdContentControlType that represents the type for a content control.
104 sal_Int32 SAL_CALL getType() override;
105 void SAL_CALL setType(sal_Int32 nSet) override;
106
107 // XContentControl Methods
108
109 // Copies the content control from the active document to the Clipboard.
110 // Retrieve from the clipboard using the Paste method of the Selection object
111 // or of the Range object, or use the Paste function from within Microsoft Word.
112 void SAL_CALL Copy() override;
113
114 // Removes the control from the active document and moves it to the Clipboard.
115 void SAL_CALL Cut() override;
116
117 // Specifies whether to delete the contents of the content control. The default value is False.
118 // True removes both the content control and its contents.
119 // False removes the control but leaves the contents of the content control in the document.
120 void SAL_CALL Delete(const css::uno::Any& bDeleteContents) override;
121
122 // Set the Unicode character used to display the checked state.
123 void SAL_CALL SetCheckedSymbol(sal_Int32 Character, const css::uno::Any& sFont) override;
124
125 // Set the Unicode character used to display the unchecked state.
126 void SAL_CALL SetUnCheckedSymbol(sal_Int32 Character, const css::uno::Any& sFont) override;
127
128 // Sets the placeholder text that displays until a user enters their own text.
129 // Only one of the parameters is used when specifying placeholder text.
130 // If more than one parameter is provided, use the text specified in the first parameter.
131 // If all parameters are omitted, the placeholder text is blank.
132 void SAL_CALL SetPlaceholderText(const css::uno::Any& BuildingBlock, const css::uno::Any& Range,
133 const css::uno::Any& sText) override;
134
135 void SAL_CALL Ungroup() override;
136
137 // XHelperInterface
138 OUString getServiceImplName() override;
139 css::uno::Sequence<OUString> getServiceNames() override;
140};
141
142/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SAL_CALL setBuildingBlockType(sal_Int32 nSet) override
OUString SAL_CALL getDateDisplayFormat() override
sal_Int32 SAL_CALL getLevel() override
OUString SAL_CALL getRepeatingSectionItemTitle() override
void SAL_CALL SetUnCheckedSymbol(sal_Int32 Character, const css::uno::Any &sFont) override
std::shared_ptr< SwContentControl > m_pCC
OUString SAL_CALL getTitle() override
void SAL_CALL setColor(sal_Int32 nSet) override
void SAL_CALL setMultiLine(sal_Bool bSet) override
void SAL_CALL setDateDisplayFormat(const OUString &sSet) override
sal_Int32 SAL_CALL getColor() override
void SAL_CALL Delete(const css::uno::Any &bDeleteContents) override
OUString getServiceImplName() override
css::uno::Sequence< OUString > getServiceNames() override
void SAL_CALL setAppearance(sal_Int32 nSet) override
sal_Int32 SAL_CALL getDateStorageFormat() override
void SAL_CALL setDateCalendarType(sal_Int32 nSet) override
OUString SAL_CALL getID() override
SwVbaContentControl(const css::uno::Reference< ooo::vba::XHelperInterface > &rParent, const css::uno::Reference< css::uno::XComponentContext > &rContext, const css::uno::Reference< css::text::XTextDocument > &xTextDocument, std::shared_ptr< SwContentControl > pContentControl)
Content controls are the modern version of FormFields, providing inline functionality similar to that...
sal_Bool SAL_CALL getShowingPlaceholderText() override
void SAL_CALL SetPlaceholderText(const css::uno::Any &BuildingBlock, const css::uno::Any &Range, const css::uno::Any &sText) override
css::uno::Any SAL_CALL getDropdownListEntries() override
sal_Bool SAL_CALL getTemporary() override
OUString SAL_CALL getPlaceholderText() override
void SAL_CALL setDateStorageFormat(sal_Int32 nSet) override
sal_Int32 SAL_CALL getType() override
void SAL_CALL setLockContents(sal_Bool bSet) override
void SAL_CALL Ungroup() override
sal_Int32 SAL_CALL getDateCalendarType() override
OUString SAL_CALL getTag() override
void SAL_CALL setChecked(sal_Bool bSet) override
sal_Int32 SAL_CALL getBuildingBlockType() override
sal_Bool SAL_CALL getMultiLine() override
void SAL_CALL setBuildingBlockCategory(const OUString &sSet) override
void SAL_CALL setType(sal_Int32 nSet) override
void SAL_CALL setTitle(const OUString &rSet) override
void SAL_CALL Cut() override
sal_Bool SAL_CALL getLockContentControl() override
void SAL_CALL setTag(const OUString &rSet) override
void SAL_CALL Copy() override
void SAL_CALL SetCheckedSymbol(sal_Int32 Character, const css::uno::Any &sFont) override
sal_Int32 SAL_CALL getAppearance() override
sal_Bool SAL_CALL getAllowInsertDeleteSection() override
void SAL_CALL setRepeatingSectionItemTitle(const OUString &rSet) override
sal_Int32 SAL_CALL getDateDisplayLocale() override
css::uno::Reference< ooo::vba::word::XRange > SAL_CALL getRange() override
void SAL_CALL setLockContentControl(sal_Bool bSet) override
OUString SAL_CALL getBuildingBlockCategory() override
sal_Bool SAL_CALL getChecked() override
css::uno::Reference< css::text::XTextDocument > mxTextDocument
void SAL_CALL setTemporary(sal_Bool bSet) override
sal_Bool SAL_CALL getLockContents() override
void SAL_CALL setAllowInsertDeleteSection(sal_Bool bSet) override
unsigned char sal_Bool
InheritedHelperInterfaceWeakImpl< ooo::vba::word::XContentControl > SwVbaContentControl_BASE