/* -*- 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/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
/// SfxPoolItem subclass that wraps an SwContentControl. class SW_DLLPUBLIC SwFormatContentControl final : public SfxPoolItem
{
std::shared_ptr<SwContentControl> m_pContentControl;
SwTextContentControl* m_pTextAttr;
/// Represents one list item in a content control dropdown list. class SW_DLLPUBLIC SwContentControlListItem
{ public: /// This may be empty, ToString() falls back to m_aValue.
OUString m_aDisplayText; /// This must not be empty.
OUString m_aValue;
/// Stores the properties of a content control. class SW_DLLPUBLIC SwContentControl final : public sw::BroadcastingModify
{
unotools::WeakReference<SwXContentControl> m_wXContentControl;
SwFormatContentControl* m_pFormat;
/// Can be nullptr if not in a document for undo purposes.
SwTextNode* m_pTextNode;
/// Current content is placeholder text. bool m_bShowingPlaceHolder = false;
/// Display the content control as a checkbox. bool m_bCheckbox = false;
/// If m_bCheckbox is true, is the checkbox checked? bool m_bChecked = false;
/// If m_bCheckbox is true, the value of a checked checkbox.
OUString m_aCheckedState;
/// If m_bCheckbox is true, the value of an unchecked checkbox.
OUString m_aUncheckedState;
/// If m_bDate is true, the date format in a syntax accepted by SvNumberFormatter::PutEntry().
OUString m_aDateFormat;
/// If m_bDate is true, the date's BCP 47 language tag.
OUString m_aDateLanguage;
/// Date in YYYY-MM-DDT00:00:00Z format.
OUString m_aCurrentDate;
/// Plain text, i.e. not rich text. bool m_bPlainText = false;
/// Same as drop-down, but free-form input is also accepted. bool m_bComboBox = false;
/// Same as combo box, but free-form input is not accepted. bool m_bDropDown = false;
/// The placeholder's doc part: just remembered.
OUString m_aPlaceholderDocPart;
/// The data bindings's prefix mappings: just remembered.
OUString m_aDataBindingPrefixMappings;
/// The data bindings's XPath: just remembered.
OUString m_aDataBindingXpath;
/// The data bindings's store item ID: just remembered.
OUString m_aDataBindingStoreItemID;
/// The color: just remembered.
OUString m_aColor;
/// The appearance: just remembered.
OUString m_aAppearance;
/// The alias.
OUString m_aAlias;
/// The tag: just remembered.
OUString m_aTag;
/// The id: just remembered.
sal_Int32 m_nId = 0;
/// The tabIndex: just remembered.
sal_uInt32 m_nTabIndex = 0;
/// The control and content locks: mostly just remembered.
OUString m_aLock;
/// The multiline property: just remembered.
OUString m_aMultiLine;
/// Stores a list item index, in case the doc model is not yet updated. // i.e. temporarily store the selected item until the text is inserted by GotoContentControl.
std::optional<size_t> m_oSelectedListItem;
/// Stores a date timestamp, in case the doc model is not yet updated. // i.e. temporarily store the date until the text is inserted by GotoContentControl.
std::optional<double> m_oSelectedDate;
/** * E.g. checkbox is read-only by default, but we still update contents on interaction * internally. This flag is true for the duration of that interaction.
*/ bool m_bReadWrite = false;
/// Get a copy of selected list item's index, /// potentially even if the selection is already written out to text (i.e. validated).
std::optional<size_t> GetSelectedListItem(bool bCheckDocModel) const;
// At the design level, define how the control should be locked. No effect at implementation lvl void SetLock(bool bLockContent, bool bLockControl); void SetLock(const OUString& rLock) { m_aLock = rLock; }
// At the design level, get how the control is locked. Does not reflect actual implementation.
std::optional<bool> GetLock(bool bControl) const; const OUString& GetLock() const { return m_aLock; }
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.15Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.