/* -*- 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 .
*/ #ifndef INCLUDED_SW_INC_FLDBAS_HXX #define INCLUDED_SW_INC_FLDBAS_HXX
class SwDoc; class SwField; class SwFormatField; class SwDDETable; class SwRootFrame; class SvNumberFormatter; class IDocumentRedlineAccess; class SwGetRefField; class SwXFieldMaster; namespace com::sun::star::uno { class Any; }
typedefstruct _xmlTextWriter* xmlTextWriterPtr;
enumclass SwFieldIds : sal_uInt16 { /// For old documents the Field-Which IDs must be preserved !!!
Database,
User,
Filename,
DatabaseName,
Date,
Time,
PageNumber,
Author,
Chapter,
DocStat,
GetExp, // 10
SetExp,
GetRef,
HiddenText,
Postit,
FixDate,
FixTime,
Reg,
VarReg,
SetRef,
Input, // 20
Macro,
Dde,
Table,
HiddenPara,
DocInfo,
TemplateName,
DbNextSet,
DbNumSet,
DbSetNumber,
ExtUser, // 30
RefPageSet,
RefPageGet,
Internet,
JumpEdit,
Script,
DateTime,
TableOfAuthorities,
CombinedChars,
Dropdown,
ParagraphSignature, // 40
LAST = ParagraphSignature,
Unknown = USHRT_MAX, // used as default value in some method calls
};
/** Instances of SwFields and those derived from it occur 0 to n times. For each class there is one instance of the associated type class.
Base class of all field types is SwFieldType. */
class SW_DLLPUBLIC SwFieldType : public sw::BroadcastingModify
{
unotools::WeakReference<SwXFieldMaster> m_wXFieldMaster;
SwFieldIds m_nWhich;
friendvoid FinitUI(); ///< In order to delete pointer! static std::vector<OUString>* s_pFieldNames;
staticvoid GetFieldName_(); ///< Sets up FieldNames; fldmgr.cxx!
protected: /// Single argument ctors shall be explicit. explicit SwFieldType( SwFieldIds nWhichId );
/** Base class of all fields. Type of field is queried via Which.
Expanded content of field is queried via ExpandField(). */ class SW_DLLPUBLIC SwField
{ private: mutable OUString m_Cache; ///< Cached expansion (for clipboard).
SwFieldType* m_pType;
sal_uInt32 m_nFormat; /// this can be either SvxNumType or SwChapterFormat depending on the subtype
LanguageType m_nLang; ///< Always change via SetLanguage! bool m_bUseFieldValueCache; /// control the usage of the cached field value bool m_bIsAutomaticLanguage; /// Used for tooltip purposes when it's not-empty.
OUString m_aTitle;
/// Set new type (used for copying among documents). virtual SwFieldType* ChgTyp( SwFieldType* );
/** expand the field. @param bCached return cached field value. @remark most callers should use the cached field value. this is because various fields need special handing (ChangeExpansion()) to return correct values, and only SwTextFormatter::NewFieldPortion() sets things up properly. @param pLayout the layout to use for expansion; there are a few fields that expand differently via layout mode. @return the generated text (suitable for display)
*/
OUString ExpandField(bool bCached, SwRootFrame const* pLayout) const;
/// @return name or content. virtual OUString GetFieldName() const;
/// Fields containing values that have to be formatted via number formatter. class SwValueFieldType : public SwFieldType
{ private:
SwDoc* m_pDoc; bool m_bUseFormat; ///< Use number formatter.
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.