summaryrefslogtreecommitdiffstats
path: root/sw/source/ui/vba/vbaformfield.hxx
blob: 260e79093589ea7e607013396b5dc63ec00a6060 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
#pragma once

#include <com/sun/star/text/XTextDocument.hpp>
#include <ooo/vba/word/XFormField.hpp>

#include <vbahelper/vbahelperinterface.hxx>

#include <IDocumentMarkAccess.hxx>

typedef InheritedHelperInterfaceWeakImpl<ooo::vba::word::XFormField> SwVbaFormField_BASE;

class SwVbaFormField : public SwVbaFormField_BASE
{
private:
    css::uno::Reference<css::text::XTextDocument> m_xTextDocument;
    sw::mark::IFieldmark& m_rFormField;

public:
    /// @throws css::uno::RuntimeException
    SwVbaFormField(const css::uno::Reference<ooo::vba::XHelperInterface>& rParent,
                   const css::uno::Reference<css::uno::XComponentContext>& rContext,
                   const uno::Reference<text::XTextDocument>& xTextDocument,
                   sw::mark::IFieldmark& rFormField);
    ~SwVbaFormField() override;

    // XFormField Methods
    OUString SAL_CALL getDefaultPropertyName() override;

    css::uno::Any SAL_CALL CheckBox() override;
    css::uno::Any SAL_CALL DropDown() override;
    css::uno::Any SAL_CALL TextInput() override;
    css::uno::Any SAL_CALL Previous() override;
    css::uno::Any SAL_CALL Next() override;
    css::uno::Reference<ooo::vba::word::XRange> SAL_CALL Range() override;

    // Indicates which of the three form fields this is: oovbaapi/ooo/vba/word/WdFieldType.idl
    sal_Int32 SAL_CALL getType() override;
    // True if references to the specified form field
    // are automatically updated whenever the field is exited
    sal_Bool SAL_CALL getCalculateOnExit() override;
    void SAL_CALL setCalculateOnExit(sal_Bool bSet) override;
    sal_Bool SAL_CALL getEnabled() override;
    void SAL_CALL setEnabled(sal_Bool bSet) override;
    OUString SAL_CALL getEntryMacro() override;
    void SAL_CALL setEntryMacro(const OUString& rSet) override;
    OUString SAL_CALL getExitMacro() override;
    void SAL_CALL setExitMacro(const OUString& rSet) override;
    /*
     * If the OwnHelp property is set to True,
     * HelpText specifies the text string value.
     * If OwnHelp is set to False, HelpText specifies the name of an AutoText entry
     * that contains help text for the form field.
     */
    OUString SAL_CALL getHelpText() override;
    void SAL_CALL setHelpText(const OUString& rSet) override;
    sal_Bool SAL_CALL getOwnHelp() override;
    void SAL_CALL setOwnHelp(sal_Bool bSet) override;

    OUString SAL_CALL getName() override;
    void SAL_CALL setName(const OUString& rSet) override;
    OUString SAL_CALL getResult() override;
    void SAL_CALL setResult(const OUString& rSet) override;
    /*
     * If the OwnStatus property is set to True,
     * StatusText specifies the status bar value.
     * If OwnStatus is set to False, StatusText specifies the name of an AutoText entry
     * that contains status bar text for the form field.
     */
    OUString SAL_CALL getStatusText() override;
    void SAL_CALL setStatusText(const OUString& rSet) override;
    sal_Bool SAL_CALL getOwnStatus() override;
    void SAL_CALL setOwnStatus(sal_Bool bSet) override;

    // XHelperInterface
    OUString getServiceImplName() override;
    css::uno::Sequence<OUString> getServiceNames() override;
};

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */