diff options
Diffstat (limited to '')
89 files changed, 14764 insertions, 0 deletions
diff --git a/include/svtools/DocumentInfoPreview.hxx b/include/svtools/DocumentInfoPreview.hxx new file mode 100644 index 000000000..fda16e3ff --- /dev/null +++ b/include/svtools/DocumentInfoPreview.hxx @@ -0,0 +1,67 @@ +/* -*- 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_SVTOOLS_DOCUMENTINFOPREVIEW_HXX +#define INCLUDED_SVTOOLS_DOCUMENTINFOPREVIEW_HXX + +#include <sal/config.h> + +#include <svtools/svtdllapi.h> +#include <tools/wintypes.hxx> +#include <vcl/window.hxx> + +namespace com :: sun :: star :: uno { template <typename > class Reference; } + +class ExtMultiLineEdit; + +namespace com::sun::star { + namespace document { class XDocumentProperties; } + namespace util { struct DateTime; } +} + +namespace svtools { + +class SVT_DLLPUBLIC ODocumentInfoPreview final : public vcl::Window { +public: + ODocumentInfoPreview(vcl::Window * pParent, WinBits nBits); + + virtual ~ODocumentInfoPreview() override; + virtual void dispose() override; + + virtual void Resize() override; + + void clear(); + + void fill(css::uno::Reference< css::document::XDocumentProperties > const & xDocProps); + +private: + VclPtr<ExtMultiLineEdit> m_pEditWin; + + void insertEntry(OUString const & title, OUString const & value); + + void insertNonempty(long id, OUString const & value); + + void insertDateTime(long id, css::util::DateTime const & value); +}; + +} + +#endif // INCLUDED_SVTOOLS_DOCUMENTINFOPREVIEW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/DocumentToGraphicRenderer.hxx b/include/svtools/DocumentToGraphicRenderer.hxx new file mode 100644 index 000000000..519f47e7b --- /dev/null +++ b/include/svtools/DocumentToGraphicRenderer.hxx @@ -0,0 +1,111 @@ +/* -*- 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_SVTOOLS_DOCUMENTTOGRAPHICRENDERER_HXX +#define INCLUDED_SVTOOLS_DOCUMENTTOGRAPHICRENDERER_HXX + +#include <vector> + +#include <vcl/graph.hxx> + +#include <svtools/svtdllapi.h> + +namespace com :: sun :: star :: awt { class XToolkit; } +namespace com :: sun :: star :: frame { class XModel; } +namespace com :: sun :: star :: lang { class XComponent; } +namespace com :: sun :: star :: view { class XRenderable; } + +namespace com::sun::star { + namespace drawing { + class XShapes; + class XShape; + } + namespace frame { + class XController; + } +} + +class SVT_DLLPUBLIC DocumentToGraphicRenderer +{ + const css::uno::Reference<css::lang::XComponent>& mxDocument; + + enum DocType { + WRITER, + CALC, + IMPRESS, + UNKNOWN + }; + + css::uno::Reference<css::frame::XModel> mxModel; + css::uno::Reference<css::frame::XController> mxController; + css::uno::Reference<css::view::XRenderable> mxRenderable; + css::uno::Reference<css::awt::XToolkit> mxToolkit; + css::uno::Any maSelection; + DocType meDocType; + std::vector<OUString> maChapterNames; + + bool hasSelection() const; + + /** Always something even if hasSelection() is false (in which case the + selection is mxDocument). + */ + css::uno::Any getSelection() const; + + sal_Int32 getCurrentPageWriter(); + +public: + DocumentToGraphicRenderer(const css::uno::Reference<css::lang::XComponent>& xDocument, bool bSelectionOnly); + ~DocumentToGraphicRenderer(); + + sal_Int32 getCurrentPage(); + sal_Int32 getPageCount(); + /** + * Get list of chapter names for a page, current page is set by + * renderToGraphic(). + */ + const std::vector<OUString>& getChapterNames() const; + + Size getDocumentSizeInPixels( sal_Int32 nCurrentPage ); + + Size getDocumentSizeIn100mm(sal_Int32 nCurrentPage, Point* pDocumentPosition = nullptr, + Point* pCalcPagePosition = nullptr, Size *pCalcPageSize = nullptr); + + Graphic renderToGraphic( sal_Int32 nCurrentPage, Size aDocumentSizePixel, + Size aTargetSizePixel, Color aPageColor, bool bExtOutDevData); + + /** Determine whether rxController has a css::view::XSelectionSupplier at + which either a css::drawing::XShapes or css::drawing::XShape is + selected. XShapes has precedence over XShape. + + Call only if the SelectionOnly property was set. + */ + static bool isShapeSelected( + css::uno::Reference< css::drawing::XShapes > & rxShapes, + css::uno::Reference< css::drawing::XShape > & rxShape, + const css::uno::Reference< css::frame::XController > & rxController ); + + bool isWriter() const; + bool isCalc() const; + bool isImpress() const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/HtmlWriter.hxx b/include/svtools/HtmlWriter.hxx new file mode 100644 index 000000000..49f2aa6c0 --- /dev/null +++ b/include/svtools/HtmlWriter.hxx @@ -0,0 +1,62 @@ +/* -*- 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/. + * + */ + +#ifndef INCLUDED_SVTOOLS_HTMLWRITER_HXX +#define INCLUDED_SVTOOLS_HTMLWRITER_HXX + +#include <rtl/string.hxx> +#include <rtl/ustring.hxx> +#include <vector> +#include <svtools/svtdllapi.h> + +class SvStream; + +class SVT_DLLPUBLIC HtmlWriter final +{ +private: + std::vector<OString> maElementStack; + + SvStream& mrStream; + + bool mbElementOpen; + bool mbCharactersWritten; + bool mbPrettyPrint; + /// XML namespace, in case of XHTML. + OString maNamespace; + +public: + HtmlWriter(SvStream& rStream, const OString& rNamespace = OString()); + ~HtmlWriter(); + + void prettyPrint(bool b); + + void start(const OString& aElement); + + void end(); + + void flushStack(); + + void attribute(const OString& aAttribute, const char* aValue); + void attribute(const OString& aAttribute, sal_Int32 aValue); + void attribute(const OString& aAttribute, const OString& aValue); + void attribute(const OString& aAttribute, const OUString& aValue); + // boolean attribute e.g. <img ismap> + void attribute(const OString& aAttribute); + + void single(const OString& aContent); + void endAttribute(); + + /// Writes character data. + void characters(const OString& rChars); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/PlaceEditDialog.hxx b/include/svtools/PlaceEditDialog.hxx new file mode 100644 index 000000000..2effba66f --- /dev/null +++ b/include/svtools/PlaceEditDialog.hxx @@ -0,0 +1,104 @@ +/* -*- 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/. + */ + +#ifndef INCLUDED_SVTOOLS_PLACEEDITDIALOG_HXX +#define INCLUDED_SVTOOLS_PLACEEDITDIALOG_HXX + +#include <config_options.h> +#include <svtools/svtdllapi.h> +#include <vcl/weld.hxx> + +#include <memory> +#include <vector> + +class Place; +class DetailsContainer; + +class UNLESS_MERGELIBS(SVT_DLLPUBLIC) PlaceEditDialog final : public weld::GenericDialogController +{ +private: + std::shared_ptr< DetailsContainer > m_xCurrentDetails; + /** Vector holding the details UI control for each server type. + + The elements in this vector need to match the order in the type listbox, e.g. + the m_aDetailsContainer[0] will be shown for the type corresponding to entry 0 + in the listbox. + */ + std::vector< std::shared_ptr< DetailsContainer > > m_aDetailsContainers; + + sal_Int32 m_nCurrentType; + + bool m_bLabelChanged; + bool m_bShowPassword; + +public: + std::unique_ptr<weld::Entry> m_xEDServerName; + std::unique_ptr<weld::ComboBox> m_xLBServerType; + std::unique_ptr<weld::Entry> m_xEDUsername; + std::unique_ptr<weld::Label> m_xFTUsernameLabel; + std::unique_ptr<weld::Button> m_xBTOk; + std::unique_ptr<weld::Button> m_xBTCancel; + std::unique_ptr<weld::Button> m_xBTDelete; + std::unique_ptr<weld::Button> m_xBTRepoRefresh; + std::unique_ptr<weld::CheckButton> m_xCBPassword; + std::unique_ptr<weld::Entry> m_xEDPassword; + std::unique_ptr<weld::Label> m_xFTPasswordLabel; + std::unique_ptr<weld::Widget> m_xTypeGrid; + + std::unique_ptr<weld::Widget> m_xRepositoryBox; + std::unique_ptr<weld::Label> m_xFTRepository; + std::unique_ptr<weld::ComboBox> m_xLBRepository; + + std::unique_ptr<weld::Entry> m_xEDShare; + std::unique_ptr<weld::Label> m_xFTShare; + + std::unique_ptr<weld::Widget> m_xDetailsGrid; + std::unique_ptr<weld::Widget> m_xHostBox; + std::unique_ptr<weld::Entry> m_xEDHost; + std::unique_ptr<weld::Label> m_xFTHost; + std::unique_ptr<weld::SpinButton> m_xEDPort; + std::unique_ptr<weld::Label> m_xFTPort; + std::unique_ptr<weld::Entry> m_xEDRoot; + std::unique_ptr<weld::Label> m_xFTRoot; + + std::unique_ptr<weld::CheckButton> m_xCBDavs; + +public: + PlaceEditDialog(weld::Window* pParent); + PlaceEditDialog(weld::Window* pParent, const std::shared_ptr<Place> &rPlace ); + virtual ~PlaceEditDialog() override; + + // Returns a place instance with given information + std::shared_ptr<Place> GetPlace(); + + OUString GetServerName() const { return m_xEDServerName->get_text(); } + OUString GetServerUrl(); + OUString GetPassword() const { return m_xEDPassword->get_text(); }; + OUString GetUser() const { return m_xEDUsername->get_text(); }; + bool IsRememberChecked() const { return m_xCBPassword->get_active(); } + + void ShowPasswordControl() { m_bShowPassword = true; } + +private: + + void InitDetails( ); + + DECL_LINK ( OKHdl, weld::Button&, void ); + DECL_LINK ( DelHdl, weld::Button&, void ); + DECL_LINK ( EditHdl, DetailsContainer*, void ); + DECL_LINK ( ModifyHdl, weld::Entry&, void ); + void SelectType(bool bSkipSeparator); + DECL_LINK ( SelectTypeHdl, weld::ComboBox&, void ); + DECL_LINK ( EditLabelHdl, weld::Entry&, void ); + DECL_LINK ( EditUsernameHdl, weld::Entry&, void ); + +}; + +#endif // INCLUDED_SVTOOLS_PLACEEDITDIALOG_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/acceleratorexecute.hxx b/include/svtools/acceleratorexecute.hxx new file mode 100644 index 000000000..6c846bc52 --- /dev/null +++ b/include/svtools/acceleratorexecute.hxx @@ -0,0 +1,213 @@ +/* -*- 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_SVTOOLS_ACCELERATOREXECUTE_HXX +#define INCLUDED_SVTOOLS_ACCELERATOREXECUTE_HXX + +#include <svtools/svtdllapi.h> + +#include <memory> + +#include <com/sun/star/awt/KeyEvent.hpp> +#include <vcl/keycod.hxx> + +namespace com :: sun :: star :: frame { class XDispatchProvider; } +namespace com :: sun :: star :: frame { class XFrame; } +namespace com :: sun :: star :: frame { class XModel; } +namespace com :: sun :: star :: ui { class XAcceleratorConfiguration; } +namespace com :: sun :: star :: uno { class XComponentContext; } +namespace com :: sun :: star :: util { class XURLTransformer; } + + +namespace svt +{ + + +struct TMutexInit +{ + ::osl::Mutex m_aLock; +}; + + +/** + @descr implements a helper, which can be used to + convert vcl key codes into awt key codes ... + and reverse. + + Further such key code can be triggered. + Doing so different accelerator + configurations are merged together; a suitable + command registered for the given key code is searched + and will be dispatched. + + @attention + + Because execution of an accelerator command can be dangerous + (in case it force an office shutdown for key "ALT+F4"!) + all internal dispatches are done asynchronous. + Means that the trigger call doesn't wait till the dispatch + is finished. You can call very often. All requests will be + queued internal and dispatched ASAP. + + Of course this queue will be stopped if the environment + will be destructed... + */ +class SVT_DLLPUBLIC AcceleratorExecute final : private TMutexInit +{ + // member + private: + + /** TODO document me */ + css::uno::Reference< css::uno::XComponentContext > m_xContext; + + /** TODO document me */ + css::uno::Reference< css::util::XURLTransformer > m_xURLParser; + + /** TODO document me */ + css::uno::Reference< css::frame::XDispatchProvider > m_xDispatcher; + + /** TODO document me */ + css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xGlobalCfg; + css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xModuleCfg; + css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xDocCfg; + // interface + public: + + + /** @short factory method to create new accelerator + helper instance. + + @descr Such helper instance must be initialized at first. + So it can know its environment (global/module or + document specific). + + Afterwards it can be used to execute incoming + accelerator requests. + + The "end of life" of such helper can be reached as follow: + + - delete the object + => If it stands currently in its execute method, they will + be finished. All further queued requests will be removed + and further not executed! + + - "let it stay alone" + => All currently queued events will be finished. The + helper kills itself afterwards. A shutdown of the + environment will be recognized ... The helper stop its + work immediately then! + */ + static std::unique_ptr<AcceleratorExecute> createAcceleratorHelper(); + + + /** @short fight against inlining ... */ + virtual ~AcceleratorExecute(); + + + /** @short init this instance. + + @descr It must be called as first method after creation. + And further it can be called more than once... + but at least it should be used one times only. + Otherwise nobody can say, which asynchronous + executions will be used inside the old and which one + will be used inside the new environment. + + @param rxContext + reference to a uno service manager. + + @param xEnv + if it points to a valid frame it will be used + to execute the dispatch there. Further the frame + is used to locate the right module configuration + and use it merged together with the document and + the global configuration. + + If this parameter is set to NULL, the global configuration + is used only. Further the global Desktop instance is + used for dispatch. + */ + void init(const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const css::uno::Reference< css::frame::XFrame >& xEnv ); + + + /** @short trigger this accelerator. + + @descr The internal configurations are used to find + as suitable command for this key code. + This command will be queued and executed later + asynchronous. + + @param aKey + specify the accelerator for execute. + + @return [bool] + true if this key is configured and match to a command. + Attention: This state does not mean the success state + of the corresponding execute. Because it's done asynchronously! + */ + bool execute(const vcl::KeyCode& aKey); + bool execute(const css::awt::KeyEvent& aKey); + + /** search the command for the given key event. + * + * @param aKey The key event + * @return The command or an empty string if the key event could not be found. + */ + OUString findCommand(const css::awt::KeyEvent& aKey); + + /** TODO document me */ + static css::awt::KeyEvent st_VCLKey2AWTKey(const vcl::KeyCode& aKey); + static vcl::KeyCode st_AWTKey2VCLKey(const css::awt::KeyEvent& aKey); + + + /** TODO document me */ + static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openModuleConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext , + const css::uno::Reference< css::frame::XFrame >& xFrame); + + + /** TODO document me */ + static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openDocConfig(const css::uno::Reference< css::frame::XModel >& xModel); + + + // internal + private: + + + /** @short allow creation of instances of this class + by using our factory only! + */ + SVT_DLLPRIVATE AcceleratorExecute(); + + AcceleratorExecute(const AcceleratorExecute& rCopy) = delete; + void operator=(const AcceleratorExecute&) = delete; + + /** TODO document me */ + SVT_DLLPRIVATE OUString impl_ts_findCommand(const css::awt::KeyEvent& aKey); + + + /** TODO document me */ + SVT_DLLPRIVATE css::uno::Reference< css::util::XURLTransformer > impl_ts_getURLParser(); +}; + +} // namespace svt + +#endif // INCLUDED_SVTOOLS_ACCELERATOREXECUTE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/accessibilityoptions.hxx b/include/svtools/accessibilityoptions.hxx new file mode 100644 index 000000000..06c24c009 --- /dev/null +++ b/include/svtools/accessibilityoptions.hxx @@ -0,0 +1,50 @@ +/* -*- 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_SVTOOLS_ACCESSIBILITYOPTIONS_HXX +#define INCLUDED_SVTOOLS_ACCESSIBILITYOPTIONS_HXX + +#include <svtools/svtdllapi.h> +#include <unotools/options.hxx> + +class SvtAccessibilityOptions_Impl; + +class SVT_DLLPUBLIC SvtAccessibilityOptions final : + public utl::detail::Options +{ +private: + static SvtAccessibilityOptions_Impl* sm_pSingleImplConfig; + static sal_Int32 sm_nAccessibilityRefCount; + +public: + SvtAccessibilityOptions(); + virtual ~SvtAccessibilityOptions() override; + + // get & set config entries + bool GetIsForPagePreviews() const; + bool GetIsAllowAnimatedGraphics() const; + bool GetIsAllowAnimatedText() const; + bool GetIsAutomaticFontColor() const; + bool IsSelectionInReadonly() const; + + void SetVCLSettings(); +}; + +#endif // #ifndef INCLUDED_SVTOOLS_ACCESSIBILITYOPTIONS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/addresstemplate.hxx b/include/svtools/addresstemplate.hxx new file mode 100644 index 000000000..5cfe0bf0e --- /dev/null +++ b/include/svtools/addresstemplate.hxx @@ -0,0 +1,131 @@ +/* -*- 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_SVTOOLS_ADDRESSTEMPLATE_HXX +#define INCLUDED_SVTOOLS_ADDRESSTEMPLATE_HXX + +#include <config_options.h> +#include <memory> +#include <svtools/svtdllapi.h> +#include <vcl/weld.hxx> + +namespace com :: sun :: star :: container { class XNameAccess; } +namespace com :: sun :: star :: sdbc { class XDataSource; } +namespace com :: sun :: star :: sdb { class XDatabaseContext; } +namespace com :: sun :: star :: uno { class XComponentContext; } +namespace com :: sun :: star :: util { struct AliasProgrammaticPair; } + +#define FIELD_PAIRS_VISIBLE 5 +#define FIELD_CONTROLS_VISIBLE 2 * FIELD_PAIRS_VISIBLE + +namespace svt +{ + // = AddressBookSourceDialog + struct AddressBookSourceDialogData; + class UNLESS_MERGELIBS(SVT_DLLPUBLIC) AddressBookSourceDialog final : public weld::GenericDialogController + { + public: + AddressBookSourceDialog(weld::Window* _pParent, + const css::uno::Reference< css::uno::XComponentContext >& _rxORB ); + + /** if you use this ctor, the dialog + <ul><li>will not store it's data in the configuration (nor initially retrieve it from there)</li> + <li>will not allow to change the data source name</li> + <li>will not allow to change the table name</li> + <li>will not allow to call the data source administration dialog</li> + </ul> + + @param _rxORB + a service factory to use for various UNO related needs + @param _rxTransientDS + the data source to obtain connections from + @param _rDataSourceName + the to-be name of _rxTransientDS. This is only for displaying this + name to the user, since the dialog completely works on _rxTransientDS, + and doesn't allow to change this. + @param _rTable + the table name to display. It must refer to a valid table, relative to a connection + obtained from <arg>_rxTransientDS</arg> + */ + AddressBookSourceDialog(weld::Window* _pParent, + const css::uno::Reference< css::uno::XComponentContext >& _rxORB, + const css::uno::Reference< css::sdbc::XDataSource >& _rxTransientDS, + const OUString& _rDataSourceName, + const OUString& _rTable, + const css::uno::Sequence< css::util::AliasProgrammaticPair >& _rMapping + ); + + virtual ~AddressBookSourceDialog() override; + + // to be used if the object was constructed for editing a field mapping only + void getFieldMapping( + css::uno::Sequence< css::util::AliasProgrammaticPair >& _rMapping) const; + + private: + void implConstruct(); + + // implementations + void implScrollFields(sal_Int32 nPos, bool bAdjustFocus, bool bAdjustScrollbar); + static void implSelectField(weld::ComboBox* pBox, const OUString& rText); + + void resetTables(); + void resetFields(); + + // fill in the data sources listbox + void initializeDatasources(); + + // initialize the dialog from the configuration data + void loadConfiguration(); + + DECL_LINK(OnFieldScroll, weld::ScrolledWindow&, void); + DECL_LINK(OnFieldSelect, weld::ComboBox&, void); + DECL_LINK(OnAdministrateDatasources, weld::Button&, void); + DECL_STATIC_LINK(AddressBookSourceDialog, OnComboGetFocus, weld::Widget&, void); + DECL_LINK(OnComboLoseFocus, weld::Widget&, void); + DECL_LINK(OnComboSelect, weld::ComboBox&, void); + DECL_LINK(OnOkClicked, weld::Button&, void); + DECL_LINK(OnDelayedInitialize, void*, void); + + // string to display for "no selection" + const OUString m_sNoFieldSelection; + + /// the DatabaseContext for selecting data sources + css::uno::Reference< css::sdb::XDatabaseContext > + m_xDatabaseContext; + // the ORB for creating objects + css::uno::Reference< css::uno::XComponentContext > + m_xORB; + css::uno::Reference< css::container::XNameAccess > + m_xCurrentDatasourceTables; + + // Controls + std::unique_ptr<weld::ComboBox> m_xDatasource; + std::unique_ptr<weld::Button> m_xAdministrateDatasources; + std::unique_ptr<weld::ComboBox> m_xTable; + std::unique_ptr<weld::ScrolledWindow> m_xFieldScroller; + std::unique_ptr<weld::Button> m_xOKButton; + std::unique_ptr<weld::Widget> m_xGrid; + + std::unique_ptr<AddressBookSourceDialogData> m_pImpl; + }; +} // namespace svt + +#endif // INCLUDED_SVTOOLS_ADDRESSTEMPLATE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/apearcfg.hxx b/include/svtools/apearcfg.hxx new file mode 100644 index 000000000..119d012ed --- /dev/null +++ b/include/svtools/apearcfg.hxx @@ -0,0 +1,86 @@ +/* -*- 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_SVTOOLS_APEARCFG_HXX +#define INCLUDED_SVTOOLS_APEARCFG_HXX + +#include <svtools/svtdllapi.h> +#include <unotools/configitem.hxx> + +class Application; +enum class MouseMiddleButtonAction; + +enum class SnapType { + ToButton = 0, + ToMiddle, + NONE +}; + +enum class DragMode { + FullWindow, + Frame, + SystemDep +}; + + +class SVT_DLLPUBLIC SvtTabAppearanceCfg final : public utl::ConfigItem +{ + DragMode nDragMode ; + SnapType nSnapMode ; + MouseMiddleButtonAction nMiddleMouse; + short nAAMinPixelHeight ; + bool bFontAntialiasing ; + + bool bMenuMouseFollow ; + + static bool bInitialized ; + + SVT_DLLPRIVATE static const css::uno::Sequence<OUString>& GetPropertyNames(); + virtual void ImplCommit() override; + +public: + SvtTabAppearanceCfg( ); + virtual ~SvtTabAppearanceCfg( ) override; + + virtual void Notify( const css::uno::Sequence< OUString >& _rPropertyNames) override; + + DragMode GetDragMode () const { return nDragMode; } + + SnapType GetSnapMode () const { return nSnapMode; } + void SetSnapMode ( SnapType nSet ); + + MouseMiddleButtonAction GetMiddleMouseButton () const { return nMiddleMouse; } + void SetMiddleMouseButton ( MouseMiddleButtonAction nSet ); + + void SetApplicationDefaults ( Application* pApp ); + + bool IsMenuMouseFollow() const{return bMenuMouseFollow;} + + void SetFontAntiAliasing( bool bSet ) { bFontAntialiasing = bSet; SetModified(); } + bool IsFontAntiAliasing() const { return bFontAntialiasing; } + + sal_uInt16 GetFontAntialiasingMinPixelHeight( ) const { return nAAMinPixelHeight; } + void SetFontAntialiasingMinPixelHeight( sal_uInt16 _nMinHeight ) { nAAMinPixelHeight = _nMinHeight; SetModified(); } + + static bool IsInitialized() { return bInitialized; } + static void SetInitialized() { bInitialized = true; } +}; + +#endif // _OFA_APEARCFG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/asynclink.hxx b/include/svtools/asynclink.hxx new file mode 100644 index 000000000..f7f59d467 --- /dev/null +++ b/include/svtools/asynclink.hxx @@ -0,0 +1,74 @@ +/* -*- 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_SVTOOLS_ASYNCLINK_HXX +#define INCLUDED_SVTOOLS_ASYNCLINK_HXX + +#include <config_options.h> +#include <svtools/svtdllapi.h> +#include <tools/link.hxx> +#include <vcl/idle.hxx> +#include <osl/mutex.hxx> +#include <memory> + +class Timer; +struct ImplSVEvent; + +namespace svtools { + +class UNLESS_MERGELIBS(SVT_DLLPUBLIC) AsynchronLink +{ + Link<void*,void> _aLink; + ImplSVEvent* _nEventId; + bool _bInCall; + bool* _pDeleted; + void* _pArg; + std::unique_ptr<::osl::Mutex> _pMutex; + + DECL_DLLPRIVATE_LINK( HandleCall_Idle, Timer*, void ); + DECL_DLLPRIVATE_LINK( HandleCall_PostUserEvent, void*, void ); + SVT_DLLPRIVATE void Call_Impl( void* pArg ); + +public: + AsynchronLink( const Link<void*,void>& rLink ) + : _aLink( rLink ) + , _nEventId( nullptr ) + , _bInCall( false ) + , _pDeleted( nullptr ) + , _pArg( nullptr ) + {} + AsynchronLink() + : _nEventId( nullptr ) + , _bInCall( false ) + , _pDeleted( nullptr ) + , _pArg( nullptr ) + {} + ~AsynchronLink(); + + void CreateMutex(); + void operator=( const Link<void*,void>& rLink ) { _aLink = rLink; } + void Call( void* pObj, bool bAllowDoubles = false ); + void ClearPendingCall( ); +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/bindablecontrolhelper.hxx b/include/svtools/bindablecontrolhelper.hxx new file mode 100644 index 000000000..d05f52b71 --- /dev/null +++ b/include/svtools/bindablecontrolhelper.hxx @@ -0,0 +1,50 @@ +/* -*- 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_SVTOOLS_BINDABLECONTROLHELPER_HXX +#define INCLUDED_SVTOOLS_BINDABLECONTROLHELPER_HXX + +#include <svtools/svtdllapi.h> + +#include <com/sun/star/uno/Reference.hxx> + +namespace com :: sun :: star :: frame { class XModel; } +namespace com :: sun :: star :: uno { class XInterface; } + +namespace svt +{ + + + //= GraphicAccess + + /** helper class for obtaining streams (which also can be used with the ImageProducer) + from a resource + */ + namespace BindableControlHelper + { + SVT_DLLPUBLIC void ApplyListSourceAndBindableData( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::uno::XInterface >& rObj, const OUString& rsCtrlSource, const OUString& rsRowSource, sal_uInt16 nRefTab = 0 ); + } + + +} // namespace svt + + +#endif // INCLUDED_SVTOOLS_BINDABLECONTROLHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/borderhelper.hxx b/include/svtools/borderhelper.hxx new file mode 100644 index 000000000..3692cdf5a --- /dev/null +++ b/include/svtools/borderhelper.hxx @@ -0,0 +1,50 @@ +/* -*- 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_SVTOOLS_BORDERHELPER_HXX +#define INCLUDED_SVTOOLS_BORDERHELPER_HXX + +#include <svtools/svtdllapi.h> + +#include <basegfx/polygon/b2dpolypolygon.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <basegfx/point/b2dpoint.hxx> + +class OutputDevice; +class Point; + +enum class SvxBorderLineStyle : sal_Int16; + +namespace svtools { + +SVT_DLLPUBLIC std::vector<double> GetLineDashing( SvxBorderLineStyle nDashing, double fScale ); + +SVT_DLLPUBLIC basegfx::B2DPolyPolygon ApplyLineDashing( + const basegfx::B2DPolygon& rPolygon, SvxBorderLineStyle nDashing, double fScale ); + +SVT_DLLPUBLIC void DrawLine( OutputDevice& rDev, const basegfx::B2DPoint& rBeg, + const basegfx::B2DPoint& rEnd, sal_uInt32 nWidth, SvxBorderLineStyle nDashing ); + +SVT_DLLPUBLIC void DrawLine( OutputDevice& rDev, const Point& rBeg, + const Point& rEnd, sal_uInt32 nWidth, SvxBorderLineStyle nDashing ); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/borderline.hxx b/include/svtools/borderline.hxx new file mode 100644 index 000000000..1d7d9f1cd --- /dev/null +++ b/include/svtools/borderline.hxx @@ -0,0 +1,80 @@ +/* -*- 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_SVTOOLS_BORDERLINE_HXX +#define INCLUDED_SVTOOLS_BORDERLINE_HXX + +#include <svtools/svtdllapi.h> +#include <o3tl/typed_flags_set.hxx> + +/** + Class computing border widths shared between Line style listbox and the + SvxBorderLine implementation. + + This class doesn't know anything about units: it all depends on the different + values set. A border is composed of 2 lines separated by a gap. The computed + widths are the ones of each line and the gap and they can either be fix or vary. + + The #m_nflags member will define which widths will vary (value 0 means that all + widths are fixed). The available flags are: + - CHANGE_LINE1 + - CHANGE_LINE2 + - CHANGE_DIST + + For each line, the rate member is used as a multiplication factor is the width + isn't fixed. Otherwise it is the width in the unit expected by the client code. + */ +enum class BorderWidthImplFlags +{ + FIXED = 0, + CHANGE_LINE1 = 1, + CHANGE_LINE2 = 2, + CHANGE_DIST = 4, +}; +namespace o3tl +{ + template<> struct typed_flags<BorderWidthImplFlags> : is_typed_flags<BorderWidthImplFlags, 0x07> {}; +} +class SVT_DLLPUBLIC BorderWidthImpl +{ + BorderWidthImplFlags m_nFlags; + double m_nRate1; + double m_nRate2; + double m_nRateGap; + +public: + + BorderWidthImpl( BorderWidthImplFlags nFlags = BorderWidthImplFlags::CHANGE_LINE1, double nRate1 = 0.0, + double nRate2 = 0.0, double nRateGap = 0.0 ); + + bool operator== ( const BorderWidthImpl& r ) const; + + long GetLine1 ( long nWidth ) const; + long GetLine2( long nWidth ) const; + long GetGap( long nWidth ) const; + + long GuessWidth( long nLine1, long nLine2, long nGap ); + + bool IsEmpty( ) const { return (0 == m_nRate1) && (0 == m_nRate2); } + bool IsDouble( ) const { return (0 != m_nRate1) && (0 != m_nRate2); } +}; + +#endif // INCLUDED_SVTOOLS_BORDERLINE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx new file mode 100644 index 000000000..0b0d3af6f --- /dev/null +++ b/include/svtools/brwbox.hxx @@ -0,0 +1,772 @@ +/* -*- 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_SVTOOLS_BRWBOX_HXX +#define INCLUDED_SVTOOLS_BRWBOX_HXX + +#include <svtools/svtdllapi.h> +#include <vcl/ctrl.hxx> +#include <vcl/vclptr.hxx> +#include <tools/multisel.hxx> +#include <vcl/event.hxx> +#include <vcl/headbar.hxx> +#include <vcl/transfer.hxx> +#include <vcl/AccessibleBrowseBoxObjType.hxx> +#include <vcl/accessibletableprovider.hxx> +#include <vector> +#include <stack> + +#include <limits.h> +#include <memory> +#include <o3tl/typed_flags_set.hxx> + +class BrowserColumn; +class BrowserDataWin; +class BrowserHeader; +class ScrollBar; +class StatusBar; + +namespace svt { + class BrowseBoxImpl; +} + +namespace utl { + class AccessibleStateSetHelper; +} + +namespace vcl { + class IAccessibleFactory; +} + +#define BROWSER_INVALIDID SAL_MAX_UINT16 +#define BROWSER_ENDOFSELECTION (static_cast<long>(SFX_ENDOFSELECTION)) + +enum class BrowserMode +{ + NONE = 0x000000, + COLUMNSELECTION = 0x000001, + MULTISELECTION = 0x000002, + KEEPHIGHLIGHT = 0x000008, + HLINES = 0x000010, + VLINES = 0x000020, + + HIDESELECT = 0x000100, + HIDECURSOR = 0x000200, + + NO_HSCROLL = 0x000400, + + AUTO_VSCROLL = 0x001000, + AUTO_HSCROLL = 0x002000, + + TRACKING_TIPS = 0x004000, + + NO_VSCROLL = 0x008000, + + HEADERBAR_NEW = 0x040000, + AUTOSIZE_LASTCOL = 0x080000, + + CURSOR_WO_FOCUS = 0x200000, + // Allows a cursor which is shown even if the control does not have the focus. This does not affect other + // situations which require to temporarily hide the cursor (such as scrolling). + +}; +namespace o3tl +{ + template<> struct typed_flags<BrowserMode> : is_typed_flags<BrowserMode, 0x2cf73b> {}; +} + +#define BROWSER_NONE 0 +#define BROWSER_SELECT 720 +#define BROWSER_ENHANCESELECTION 722 +#define BROWSER_SELECTDOWN 724 +#define BROWSER_SELECTUP 725 +#define BROWSER_CURSORDOWN 731 +#define BROWSER_CURSORUP 732 +#define BROWSER_CURSORLEFT 733 +#define BROWSER_CURSORRIGHT 734 +#define BROWSER_CURSORPAGEDOWN 735 +#define BROWSER_CURSORPAGEUP 736 +#define BROWSER_CURSORENDOFFILE 741 +#define BROWSER_CURSORTOPOFFILE 742 +#define BROWSER_CURSORENDOFSCREEN 743 +#define BROWSER_CURSORTOPOFSCREEN 744 +#define BROWSER_CURSORHOME 745 +#define BROWSER_CURSOREND 746 +#define BROWSER_SCROLLDOWN 751 +#define BROWSER_SCROLLUP 752 +#define BROWSER_SELECTHOME 753 +#define BROWSER_SELECTEND 754 +#define BROWSER_SELECTCOLUMN 755 +#define BROWSER_MOVECOLUMNLEFT 756 +#define BROWSER_MOVECOLUMNRIGHT 757 + + +class BrowseEvent +{ + VclPtr<vcl::Window> pWin; + long nRow; + tools::Rectangle aRect; + sal_uInt16 nCol; + sal_uInt16 nColId; + +public: + BrowseEvent( vcl::Window* pWindow, + long nAbsRow, + sal_uInt16 nColumn, sal_uInt16 nColumnId, + const tools::Rectangle& rRect ); + + vcl::Window* GetWindow() const { return pWin; } + long GetRow() const { return nRow; } + sal_uInt16 GetColumn() const { return nCol; } + sal_uInt16 GetColumnId() const { return nColId; } + const tools::Rectangle& GetRect() const { return aRect; } +}; + + +class BrowserMouseEvent: public MouseEvent, public BrowseEvent +{ +public: + BrowserMouseEvent( BrowserDataWin* pWin, const MouseEvent& rEvt ); + BrowserMouseEvent( vcl::Window* pWin, const MouseEvent& rEvt, + long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId, + const tools::Rectangle& rRect ); +}; + + +class BrowserAcceptDropEvent : public AcceptDropEvent, public BrowseEvent +{ +public: + BrowserAcceptDropEvent( BrowserDataWin* pWin, const AcceptDropEvent& rEvt ); +}; + + +class BrowserExecuteDropEvent : public ExecuteDropEvent, public BrowseEvent +{ +public: + BrowserExecuteDropEvent( BrowserDataWin* pWin, const ExecuteDropEvent& rEvt ); +}; + + +// TODO +// The whole selection thingie in this class is somewhat... suspicious to me. +// some oddities: +// * method parameters named like members (and used in both semantics within the method!) +// * the multi selection flag is sometimes used as if it is for row selection, sometimes as if +// it's for column selection, too (and sometimes in an even stranger way :) +// * it is not really defined like all these hundreds selection related flags/methods work together +// and influence each other. I do not understand it very well, but this may be my fault :) +// * There is a GetColumnSelection, but it can't be used to determine the selected columns (at least +// not without a const_cast) +// +// We should clearly define this somewhere in the future. Or, even better, we should re-implement this +// whole class, which is planned for a long time :) +// +// sorry for the ranting. could not resist + +class SVT_DLLPUBLIC BrowseBox + :public Control + ,public DragSourceHelper + ,public DropTargetHelper + ,public vcl::IAccessibleTableProvider +{ + friend class BrowserDataWin; + friend class ::svt::BrowseBoxImpl; + +public: + static const sal_uInt16 HandleColumnId = 0; + +private: + VclPtr<BrowserDataWin> pDataWin; // window to display data rows + VclPtr<ScrollBar> pVScroll; // vertical scrollbar + VclPtr<ScrollBar> aHScroll; // horizontal scrollbar + VclPtr<StatusBar> aStatusBar; // statusbar, just to measure its height + + long nDataRowHeight; // height of a single data-row + sal_uInt16 nTitleLines; // number of lines in title row + sal_uLong nControlAreaWidth; // width of fixed area beneath hscroll + bool bColumnCursor; // single columns and fields selectable + bool bMultiSelection;// allow multiple selected rows + bool bKeepHighlight; // don't hide selection on LoseFocus + + bool bHLines; // draw lines between rows + bool bVLines; // draw lines between columns + bool bBootstrapped; // child windows resized etc. + long nTopRow; // no. of first visible row (0...) + long nCurRow; // no. of row with cursor + long nRowCount; // total number of rows in model + sal_uInt16 nFirstCol; // no. of first visible scrollable column + sal_uInt16 nCurColId; // column id of cursor + + bool bSelecting; + bool bRowDividerDrag; + bool bHit; + bool mbInteractiveRowHeight; + + long nResizeX; // mouse position at start of resizing + long nMinResizeX; // never drag more left + long nDragX; // last dragged column (MouseMove) + sal_uInt16 nResizeCol; // resize this column in MouseMove + bool bResizing; // mouse captured for column resizing + + bool bSelect; /// select or deselect + bool bSelectionIsVisible; // depending on focus + bool bScrolling; // hidden cursor while scrolling + bool bNotToggleSel; // set while in ToggleSelection() etc. + bool bHasFocus; // set/unset in Get/LoseFocus + bool bHideSelect; // hide selection (highlight) + TriState bHideCursor; // hide cursor (frame) + Range aSelRange; // for selection expansion + + ::std::vector< std::unique_ptr<BrowserColumn> > mvCols; // array of column-descriptions + union + { + MultiSelection* pSel; // selected rows for multi-selection + long nSel; // selected row for single-selection + } uRow; + std::unique_ptr<MultiSelection> pColSel; // selected column-ids + + // fdo#83943, detect if making the cursor position visible is impossible to achieve + struct CursorMoveAttempt + { + long m_nCol; + long m_nRow; + bool m_bScrolledToReachCell; + CursorMoveAttempt(long nCol, long nRow, bool bScrolledToReachCell) + : m_nCol(nCol) + , m_nRow(nRow) + , m_bScrolledToReachCell(bScrolledToReachCell) + { + } + bool operator==(const CursorMoveAttempt& r) const + { + return m_nCol == r.m_nCol && + m_nRow == r.m_nRow && + m_bScrolledToReachCell == r.m_bScrolledToReachCell; + } + bool operator!=(const CursorMoveAttempt& r) const { return !(*this == r); } + }; + std::stack<CursorMoveAttempt> + m_aGotoStack; + + ::std::unique_ptr< ::svt::BrowseBoxImpl > m_pImpl; // impl structure of the BrowseBox object + + bool m_bFocusOnlyCursor; // hide cursor if we don't have the focus + Color m_aCursorColor; // special color for cursor, COL_TRANSPARENT for usual (VCL-painted) "inverted" cursor + BrowserMode m_nCurrentMode; // last argument of SetMode (redundant, as our other members represent the current settings, too) + +private: + SVT_DLLPRIVATE void ConstructImpl(BrowserMode nMode); + SVT_DLLPRIVATE void ExpandRowSelection( const BrowserMouseEvent& rEvt ); + SVT_DLLPRIVATE void ToggleSelection(); + + SVT_DLLPRIVATE void UpdateScrollbars(); + SVT_DLLPRIVATE void AutoSizeLastColumn(); + + SVT_DLLPRIVATE long ImpGetDataRowHeight() const; + SVT_DLLPRIVATE tools::Rectangle ImplFieldRectPixel( long nRow, sal_uInt16 nColId ) const; + SVT_DLLPRIVATE sal_uInt16 FrozenColCount() const; + + SVT_DLLPRIVATE void ColumnInserted( sal_uInt16 nPos ); + + DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar*, void ); + DECL_DLLPRIVATE_LINK( StartDragHdl, HeaderBar*, void ); + + SVT_DLLPRIVATE long GetFrozenWidth() const; + + SVT_DLLPRIVATE long GetBarHeight() const; + + bool GoToRow(long nRow, bool bRowColMove, bool bDoNotModifySelection = false ); + + bool GoToColumnId( sal_uInt16 nColId, bool bMakeVisible, bool bRowColMove = false); + void SelectColumnPos( sal_uInt16 nCol, bool _bSelect, bool bMakeVisible); + + void ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRect, bool _bForeignDevice); + + bool PaintCursorIfHiddenOnce() const { return !m_bFocusOnlyCursor && !HasFocus(); } + + sal_uInt16 ToggleSelectedColumn(); + void SetToggledSelectedColumn(sal_uInt16 _nSelectedColumnId); + +protected: + /// retrieves the XAccessible implementation associated with the BrowseBox instance + ::vcl::IAccessibleFactory& getAccessibleFactory(); + +protected: + sal_uInt16 ColCount() const; + + // software plug for database access + // RowCount is counted automatically + // (with the help of RowInserted and RowRemoved), so overriding of + // the method is needless +public: + virtual long GetRowCount() const override; + +protected: + // for display in VScrollBar set it e.g. on "?" + void SetRealRowCount( const OUString &rRealRowCount ); + + // Return Value has to be sal_True always - SeekRow *has* to work! + // (else ASSERT) MI: who integrated that? It must not be like that! + + /** seeks for the given row position + @param nRow + nRow starts at 0 + */ + virtual bool SeekRow( long nRow ) = 0; + void DrawCursor(); + void PaintData(vcl::Window const & rWin, vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect); + virtual void PaintField(vcl::RenderContext& rDev, const tools::Rectangle& rRect, sal_uInt16 nColumnId) const = 0; + // Advice for the subclass: the visible scope of rows has changed. + // The subclass is able to announce changes of the model with the + // help of the methods RowInserted and RowRemoved. Because of the + // new status a paint is induced (SeekRow is called etc). + // + // parameters: nNewTopRow: number of the new TopRow (can get changed from + // VisibleRowsChanged by request of RowInserted and RowDeleted). + // nNumRows: number of visible rows (a partial visible row is counted too) + // + // Possible reason for changing the visible scope: + // - in front of the visible scope rows were inserted or removed, so the + // numbering of the visible scope has changed + // - Scrolling (and thereof resulting in another first visible row) + // - Resize the window + virtual void VisibleRowsChanged( long nNewTopRow, sal_uInt16 nNumRows); + + // number of visible rows in the window (incl. "truncated" rows) + sal_uInt16 GetVisibleRows() const; + long GetTopRow() const { return nTopRow; } + sal_uInt16 GetFirstVisibleColNumber() const { return nFirstCol; } + + // Focus-Rect enable / disable + void DoShowCursor( const char *pWhoLog ); + void DoHideCursor( const char *pWhoLog ); + short GetCursorHideCount() const; + + virtual VclPtr<BrowserHeader> CreateHeaderBar( BrowseBox* pParent ); + + // HACK(virtual create is not called in Ctor) + void SetHeaderBar( BrowserHeader* ); + + long CalcReverseZoom(long nVal); + + const DataFlavorExVector& + GetDataFlavors() const; + + bool IsDropFormatSupported( SotClipboardFormatId nFormat ); // need this because the base class' IsDropFormatSupported is not const ... + +protected: + // callbacks for the data window + virtual void ImplStartTracking(); + virtual void ImplEndTracking(); + +public: + BrowseBox( vcl::Window* pParent, WinBits nBits, + BrowserMode nMode = BrowserMode::NONE ); + virtual ~BrowseBox() override; + virtual void dispose() override; + + // override inherited handler + virtual void StateChanged( StateChangedType nStateChange ) override; + virtual void MouseButtonDown( const MouseEvent& rEvt ) override; + virtual void MouseMove( const MouseEvent& rEvt ) override; + virtual void MouseButtonUp( const MouseEvent& rEvt ) override; + virtual void KeyInput( const KeyEvent& rEvt ) override; + virtual void LoseFocus() override; + virtual void GetFocus() override; + virtual void Resize() override; + virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; + virtual void Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override; + virtual void Command( const CommandEvent& rEvt ) override; + virtual void StartDrag( sal_Int8 _nAction, const Point& _rPosPixel ) override; + + virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override; // will forward everything got to the second AcceptDrop method + virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override; // will forward everything got to the second ExecuteDrop method + + virtual sal_Int8 AcceptDrop( const BrowserAcceptDropEvent& rEvt ); + virtual sal_Int8 ExecuteDrop( const BrowserExecuteDropEvent& rEvt ); + + // new handlers + virtual void MouseButtonDown( const BrowserMouseEvent& rEvt ); + virtual void MouseButtonUp( const BrowserMouseEvent& rEvt ); + void StartScroll(); + virtual void EndScroll(); + virtual void Select(); + virtual void DoubleClick( const BrowserMouseEvent& rEvt ); + virtual bool IsCursorMoveAllowed( long nNewRow, sal_uInt16 nNewColId ) const; + virtual void CursorMoved(); + virtual void ColumnMoved( sal_uInt16 nColId ); + virtual void ColumnResized( sal_uInt16 nColId ); + /// called when the row height has been changed interactively + virtual void RowHeightChanged(); + virtual long QueryMinimumRowHeight(); + + // Window-Control (pass to DataWindow) + void SetUpdateMode( bool bUpdate ); + bool GetUpdateMode() const; + + // map-mode and font control + void SetFont( const vcl::Font& rNewFont ); + const vcl::Font& GetFont() const; + void SetTitleFont( const vcl::Font& rNewFont ) + { Control::SetFont( rNewFont ); } + + // inserting, changing, removing and freezing of columns + void InsertHandleColumn( sal_uLong nWidth ); + void InsertDataColumn( sal_uInt16 nItemId, const OUString& rText, + long nSize, HeaderBarItemBits nBits = HeaderBarItemBits::STDSTYLE, + sal_uInt16 nPos = HEADERBAR_APPEND ); + void SetColumnTitle( sal_uInt16 nColumnId, const OUString &rTitle ); + void SetColumnWidth( sal_uInt16 nColumnId, sal_uLong nWidth ); + void SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos ); + void FreezeColumn( sal_uInt16 nColumnId ); + void RemoveColumn( sal_uInt16 nColumnId ); + void RemoveColumns(); + + // control of title and data row height + void SetDataRowHeight( long nPixel ); + long GetDataRowHeight() const; + void SetTitleLines( sal_uInt16 nLines ); + long GetTitleHeight() const; + + // access to dynamic values of cursor row + OUString GetColumnTitle( sal_uInt16 nColumnId ) const; + tools::Rectangle GetFieldRect( sal_uInt16 nColumnId ) const; + sal_uLong GetColumnWidth( sal_uInt16 nColumnId ) const; + sal_uInt16 GetColumnId( sal_uInt16 nPos ) const; + sal_uInt16 GetColumnPos( sal_uInt16 nColumnId ) const; + bool IsFrozen( sal_uInt16 nColumnId ) const; + + // movement of visible area + long ScrollColumns( long nColumns ); + long ScrollRows( long nRows ); + void MakeFieldVisible( long nRow, sal_uInt16 nColId ); + + // access and movement of cursor + long GetCurRow() const { return nCurRow; } + sal_uInt16 GetCurColumnId() const { return nCurColId; } + bool GoToRow( long nRow ); + bool GoToColumnId( sal_uInt16 nColId ); + bool GoToRowColumnId( long nRow, sal_uInt16 nColId ); + + // selections + virtual void SetNoSelection() override; + virtual void SelectAll() override; + virtual void SelectRow( long nRow, bool _bSelect = true, bool bExpand = true ) override; + void SelectColumnPos( sal_uInt16 nCol, bool _bSelect = true ) + { SelectColumnPos( nCol, _bSelect, true); } + void SelectColumnId( sal_uInt16 nColId ) + { SelectColumnPos( GetColumnPos(nColId), true, true); } + long GetSelectRowCount() const; + sal_uInt16 GetSelectColumnCount() const; + virtual bool IsRowSelected( long nRow ) const override; + bool IsColumnSelected( sal_uInt16 nColumnId ) const; + long FirstSelectedRow(); + long LastSelectedRow(); + long NextSelectedRow(); + const MultiSelection* GetColumnSelection() const { return pColSel.get(); } + const MultiSelection* GetSelection() const + { return bMultiSelection ? uRow.pSel : nullptr; } + + long FirstSelectedColumn( ) const; + + bool IsResizing() const { return bResizing; } + + // access to positions of fields, column and rows + vcl::Window& GetDataWindow() const; + tools::Rectangle GetRowRectPixel( long nRow ) const; + tools::Rectangle GetFieldRectPixel( long nRow, sal_uInt16 nColId, + bool bRelToBrowser = true) const; + bool IsFieldVisible( long nRow, sal_uInt16 nColId, + bool bComplete = false ) const; + long GetRowAtYPosPixel( long nY, + bool bRelToBrowser = true ) const; + sal_uInt16 GetColumnAtXPosPixel( long nX ) const; + + // invalidations + void Clear(); + void RowRemoved( long nRow, long nNumRows = 1, bool bDoPaint = true ); + void RowModified( long nRow, sal_uInt16 nColId = BROWSER_INVALIDID ); + void RowInserted( long nRow, long nNumRows = 1, bool bDoPaint = true, bool bKeepSelection = false ); + + // miscellaneous + bool ReserveControlArea(sal_uInt16 nWidth = USHRT_MAX); + tools::Rectangle GetControlArea() const; + bool ProcessKey( const KeyEvent& rEvt ); + void Dispatch( sal_uInt16 nId ); + void SetMode( BrowserMode nMode ); + BrowserMode GetMode( ) const { return m_nCurrentMode; } + + void SetCursorColor(const Color& _rCol); + + /** specifies that the user is allowed to interactively change the height of a row, + by simply dragging an arbitrary row separator. + + Note that this works only if there's a handle column, since only in this case, + there *is* something for the user to click onto + */ + void EnableInteractiveRowHeight() { mbInteractiveRowHeight = true; } + bool IsInteractiveRowHeightEnabled( ) const { return mbInteractiveRowHeight; } + + /// access to selected methods, to be granted to the BrowserColumn + struct BrowserColumnAccess { friend class BrowserColumn; private: BrowserColumnAccess() { } }; + /** public version of PaintField, with selected access rights for the BrowserColumn + */ + void DoPaintField( OutputDevice& rDev, const tools::Rectangle& rRect, sal_uInt16 nColumnId, BrowserColumnAccess ) const + { PaintField( rDev, rRect, nColumnId ); } + + /** suggests a default width for a column containing a given text + + The width is calculated so that the text fits completely, plus some margin. + */ + sal_uLong GetDefaultColumnWidth( const OUString& _rText ) const; + + /** GetCellText returns the text at the given position + @param _nRow + the number of the row + @param _nColId + the ID of the column + @return + the text out of the cell + */ + virtual OUString GetCellText(long _nRow, sal_uInt16 _nColId) const; + + /** @return + the current column count + */ + sal_uInt16 GetColumnCount() const override { return ColCount(); } + + /** commitBrowseBoxEvent commit the event at all listeners of the browsebox + @param nEventId + the event id + @param rNewValue + the new value + @param rOldValue + the old value + */ + void commitBrowseBoxEvent(sal_Int16 nEventId, + const css::uno::Any& rNewValue, + const css::uno::Any& rOldValue); + + /** commitTableEvent commit the event at all listeners of the table + @param nEventId + the event id + @param rNewValue + the new value + @param rOldValue + the old value + */ + void commitTableEvent(sal_Int16 nEventId, + const css::uno::Any& rNewValue, + const css::uno::Any& rOldValue); + + /** fires an AccessibleEvent relative to a header bar AccessibleContext + + @param nEventId + the event id + @param rNewValue + the new value + @param rOldValue + the old value + */ + void commitHeaderBarEvent(sal_Int16 nEventId, + const css::uno::Any& rNewValue, + const css::uno::Any& rOldValue, + bool _bColumnHeaderBar + ); + + /** returns the Rectangle for either the column header bar or the row header bar + @param _bIsColumnBar + <TRUE/> when column header bar is used + @param _bOnScreen + <TRUE/> when the rectangle should be calculated OnScreen + @return + the Rectangle + */ + virtual tools::Rectangle calcHeaderRect(bool _bIsColumnBar, bool _bOnScreen = true) override; + + /** calculates the Rectangle of the table + @param _bOnScreen + <TRUE/> when the rectangle should be calculated OnScreen + @return + the Rectangle + */ + virtual tools::Rectangle calcTableRect(bool _bOnScreen = true) override; + + /** + @param _nRowId + the current row + @param _nColId + the column id + @param _bOnScreen + <TRUE/> when the rectangle should be calculated OnScreen + @return + the Rectangle + */ + virtual tools::Rectangle GetFieldRectPixelAbs(sal_Int32 _nRowId, sal_uInt16 _nColId, bool _bIsHeader, bool _bOnScreen = true) override; + + /// return <TRUE/> if and only if the accessible object for this instance has been created and is alive + bool isAccessibleAlive( ) const; + +public: + /** Creates and returns the accessible object of the whole BrowseBox. */ + virtual css::uno::Reference< + css::accessibility::XAccessible > CreateAccessible() override; + + // Children --------------------------------------------------------------- + + /** Creates the accessible object of a data table cell. + @param nRow The row index of the cell. + @param nColumnId The column pos of the cell. + @return The XAccessible interface of the specified cell. */ + virtual css::uno::Reference< + css::accessibility::XAccessible > + CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnPos ) override; + + /** Creates the accessible object of a row header. + @param nRow The row index of the header. + @return The XAccessible interface of the specified row header. */ + virtual css::uno::Reference< + css::accessibility::XAccessible > + CreateAccessibleRowHeader( sal_Int32 nRow ) override; + + /** Creates the accessible object of a column header. + @param nColumnId The column ID of the header. + @return The XAccessible interface of the specified column header. */ + virtual css::uno::Reference< + css::accessibility::XAccessible > + CreateAccessibleColumnHeader( sal_uInt16 nColumnPos ) override; + + /** @return The count of additional controls of the control area. */ + virtual sal_Int32 GetAccessibleControlCount() const override; + + /** Creates the accessible object of an additional control. + @param nIndex The 0-based index of the control. + @return The XAccessible interface of the specified control. */ + virtual css::uno::Reference< + css::accessibility::XAccessible > + CreateAccessibleControl( sal_Int32 nIndex ) override; + + /** Converts a point relative to the data window origin to a cell address. + @param rnRow Out-parameter that takes the row index. + @param rnColumnId Out-parameter that takes the column ID. + @param rPoint The position in pixels relative to the data window. + @return <TRUE/>, if the point could be converted to a valid address. */ + virtual bool ConvertPointToCellAddress( + sal_Int32& rnRow, sal_uInt16& rnColumnId, const Point& rPoint ) override; + + /** Converts a point relative to the row header bar origin to a row header + index. + @param rnRow Out-parameter that takes the row index. + @param rPoint The position in pixels relative to the header bar. + @return <TRUE/>, if the point could be converted to a valid index. */ + virtual bool ConvertPointToRowHeader( sal_Int32& rnRow, const Point& rPoint ) override; + + /** Converts a point relative to the column header bar origin to a column + header index. + @param rnColumnId Out-parameter that takes the column ID. + @param rPoint The position in pixels relative to the header bar. + @return <TRUE/>, if the point could be converted to a valid index. */ + virtual bool ConvertPointToColumnHeader( sal_uInt16& rnColumnPos, const Point& rPoint ) override; + + /** Converts a point relative to the BrowseBox origin to the index of an + existing control. + @param rnRow Out-parameter that takes the 0-based control index. + @param rPoint The position in pixels relative to the BrowseBox. + @return <TRUE/>, if the point could be converted to a valid index. */ + virtual bool ConvertPointToControlIndex( sal_Int32& rnIndex, const Point& rPoint ) override; + + /** return the name of the specified object. + @param eObjType + The type to ask for + @param _nPosition + The position of a tablecell (index position), header bar column/row cell + @return + The name of the specified object. + */ + virtual OUString GetAccessibleObjectName( ::vcl::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const override; + + /** return the description of the specified object. + @param eObjType + The type to ask for + @param _nPosition + The position of a tablecell (index position), header bar column/row cell + @return + The description of the specified object. + */ + virtual OUString GetAccessibleObjectDescription( ::vcl::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const override; + + /** @return The header text of the specified row. */ + virtual OUString GetRowDescription( sal_Int32 nRow ) const override; + + /** @return The header text of the specified column. */ + virtual OUString GetColumnDescription( sal_uInt16 _nColumn ) const override; + + /** Fills the StateSet with all states (except DEFUNC and SHOWING, done by + the accessible object), depending on the specified object type. */ + virtual void FillAccessibleStateSet( + ::utl::AccessibleStateSetHelper& rStateSet, + ::vcl::AccessibleBrowseBoxObjType eObjType ) const override; + + /** Fills the StateSet with all states for one cell (except DEFUNC and SHOWING, done by + the accessible object). */ + virtual void FillAccessibleStateSetForCell( + ::utl::AccessibleStateSetHelper& _rStateSet, + sal_Int32 _nRow, sal_uInt16 _nColumn ) const override; + + /** Sets focus to current cell of the data table. */ + virtual void GrabTableFocus() override; + + // IAccessibleTableProvider + virtual sal_Int32 GetCurrRow() const override; + virtual sal_uInt16 GetCurrColumn() const override; + virtual bool HasRowHeader() const override; + virtual bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn ) override; + virtual void SelectColumn( sal_uInt16 _nColumn, bool _bSelect = true ) override; + virtual bool IsColumnSelected( long _nColumn ) const override; + virtual sal_Int32 GetSelectedRowCount() const override; + virtual sal_Int32 GetSelectedColumnCount() const override; + virtual void GetAllSelectedRows( css::uno::Sequence< sal_Int32 >& _rRows ) const override; + virtual void GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& _rColumns ) const override; + virtual bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumn ) const override; + virtual OUString GetAccessibleCellText(long _nRow, sal_uInt16 _nColPos) const override; + virtual bool GetGlyphBoundRects( const Point& rOrigin, const OUString& rStr, int nIndex, int nLen, MetricVector& rVector ) override; + virtual tools::Rectangle GetWindowExtentsRelative( vcl::Window *pRelativeWindow ) const override; + virtual void GrabFocus() override; + virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible() override; + virtual vcl::Window* GetAccessibleParentWindow() const override; + virtual vcl::Window* GetWindowInstance() override; + +private: + // the following declares some Window/OutputDevice methods private. This happened in the course + // of CWS warnings01, which pointed out nameclashs in those methods. If the build breaks in some + // upper module, you should investigate whether you really wanted to call base class methods, + // or the versions at this class. In the latter case, use the renamed versions above. + + // Set/GetLineColor - superseded by Set/GetGridLineColor + using OutputDevice::SetLineColor; + using OutputDevice::GetLineColor; + + // ToTop/ToBottom were never property implemented. If you currently call it, this is most probably wrong + // and not doing as intended + using Window::ToTop; +}; + + +#endif // INCLUDED_SVTOOLS_BRWBOX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/brwhead.hxx b/include/svtools/brwhead.hxx new file mode 100644 index 000000000..082e9c134 --- /dev/null +++ b/include/svtools/brwhead.hxx @@ -0,0 +1,47 @@ +/* -*- 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_SVTOOLS_BRWHEAD_HXX +#define INCLUDED_SVTOOLS_BRWHEAD_HXX + +#include <svtools/svtdllapi.h> +#include <vcl/headbar.hxx> + +class BrowseBox; + + +class SVT_DLLPUBLIC BrowserHeader: public HeaderBar +{ + VclPtr<BrowseBox> _pBrowseBox; + +public: + virtual ~BrowserHeader() override; + virtual void dispose() override; +protected: + virtual void Command( const CommandEvent& rCEvt ) override; + virtual void EndDrag() override; + +public: + BrowserHeader( BrowseBox* pParent, WinBits nWinBits = WB_STDHEADERBAR | WB_DRAG ); + +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/calendar.hxx b/include/svtools/calendar.hxx new file mode 100644 index 000000000..3b6ffb5bd --- /dev/null +++ b/include/svtools/calendar.hxx @@ -0,0 +1,106 @@ +/* -*- 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_SVTOOLS_CALENDAR_HXX +#define INCLUDED_SVTOOLS_CALENDAR_HXX + +#include <config_options.h> +#include <svtools/svtdllapi.h> + +#include <vcl/calendar.hxx> +#include <vcl/field.hxx> + +class MouseEvent; +class TrackingEvent; +class KeyEvent; +class HelpEvent; +class DataChangedEvent; +class FloatingWindow; +class PushButton; +class ImplCFieldFloatWin; +class Button; + +/************************************************************************* + +Description +============ + +class CalendarField + +This class is a DateField with which one can select a date via a DropDownButton +and the CalendarControl. + +-------------------------------------------------------------------------- + +WinBits + +See DateField + +The preferences for the CalendarControl can be set via SetCalendarStyle(). + +-------------------------------------------------------------------------- + +With EnableToday()/EnableNone() we can enable a TodayButton and a NoneButton. + +-------------------------------------------------------------------------- + +Because we only take over the start date into the field, we should query +with GetCalendar() in the SelectHandler and with GetSelectDateCount()/GetSelectDate() +the selected range. We then can e.g. take over that value to another field. + +-------------------------------------------------------------------------- + +If a derived Calendar should be used, we can override the CreateCalendar() +method in CalendarField and create an own calendar there ourselves. + +*************************************************************************/ + + +class UNLESS_MERGELIBS(SVT_DLLPUBLIC) CalendarField final : public DateField +{ +private: + VclPtr<ImplCFieldFloatWin> mpFloatWin; + VclPtr<Calendar> mpCalendar; + VclPtr<PushButton> mpTodayBtn; + VclPtr<PushButton> mpNoneBtn; + bool mbToday; + bool mbNone; + + DECL_DLLPRIVATE_LINK( ImplSelectHdl, Calendar*, void ); + DECL_DLLPRIVATE_LINK( ImplClickHdl, Button*, void ); + DECL_DLLPRIVATE_LINK( ImplPopupModeEndHdl, FloatingWindow*, void ); + +public: + CalendarField( vcl::Window* pParent, WinBits nWinStyle ); + virtual ~CalendarField() override; + virtual void dispose() override; + + virtual bool ShowDropDown( bool bShow ) override; + Calendar* GetCalendar(); + + void EnableToday() { mbToday = true; } + void EnableNone() { mbNone = true; } + +private: + virtual void StateChanged( StateChangedType nStateChange ) override; +}; + +#endif // INCLUDED_SVTOOLS_CALENDAR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/cliplistener.hxx b/include/svtools/cliplistener.hxx new file mode 100644 index 000000000..1324decc2 --- /dev/null +++ b/include/svtools/cliplistener.hxx @@ -0,0 +1,55 @@ +/* -*- 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_SVTOOLS_CLIPLISTENER_HXX +#define INCLUDED_SVTOOLS_CLIPLISTENER_HXX + +#include <svtools/svtdllapi.h> +#include <tools/link.hxx> +#include <cppuhelper/implbase.hxx> +#include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp> + +namespace vcl { class Window; } + +class TransferableDataHelper; + +class SVT_DLLPUBLIC TransferableClipboardListener final : public cppu::WeakImplHelper< + css::datatransfer::clipboard::XClipboardListener > +{ + Link<TransferableDataHelper*,void> aLink; + + void AddRemoveListener( vcl::Window* pWin, bool bAdd ); +public: + // Link is called with a TransferableDataHelper pointer + TransferableClipboardListener( const Link<TransferableDataHelper*,void>& rCallback ); + virtual ~TransferableClipboardListener() override; + + void AddListener( vcl::Window* pWin ) { AddRemoveListener(pWin, true); } + void RemoveListener( vcl::Window* pWin ) { AddRemoveListener(pWin, false); } + void ClearCallbackLink(); + + // XEventListener + virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; + // XClipboardListener + virtual void SAL_CALL changedContents( const css::datatransfer::clipboard::ClipboardEvent& event ) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/collatorres.hxx b/include/svtools/collatorres.hxx new file mode 100644 index 000000000..adb854213 --- /dev/null +++ b/include/svtools/collatorres.hxx @@ -0,0 +1,54 @@ +/* -*- 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_SVTOOLS_COLLATORRES_HXX +#define INCLUDED_SVTOOLS_COLLATORRES_HXX + +#include <svtools/svtdllapi.h> +#include <rtl/ustring.hxx> +#include <vector> + +class SVT_DLLPUBLIC CollatorResource +{ +private: + // wrapper for locale specific translations data of collator algorithm + class CollatorResourceData + { + friend class CollatorResource; + private: + OUString m_aName; + OUString m_aTranslation; + public: + CollatorResourceData(const OUString& rAlgorithm, const OUString& rTranslation) + : m_aName(rAlgorithm) + , m_aTranslation(rTranslation) + { + } + const OUString& GetAlgorithm() const { return m_aName; } + const OUString& GetTranslation() const { return m_aTranslation; } + }; + std::vector<CollatorResourceData> m_aData; +public: + CollatorResource(); + const OUString& GetTranslation(const OUString& rAlgorithm); +}; + +#endif // INCLUDED_SVTOOLS_COLLATORRES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/colorcfg.hxx b/include/svtools/colorcfg.hxx new file mode 100644 index 000000000..b404f40dd --- /dev/null +++ b/include/svtools/colorcfg.hxx @@ -0,0 +1,141 @@ +/* -*- 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_SVTOOLS_COLORCFG_HXX +#define INCLUDED_SVTOOLS_COLORCFG_HXX + +#include <svtools/svtdllapi.h> +#include <rtl/ustring.hxx> +#include <tools/color.hxx> +#include <com/sun/star/uno/Sequence.h> +#include <unotools/options.hxx> +#include <memory> + + +namespace svtools{ +enum ColorConfigEntry +{ + DOCCOLOR , + DOCBOUNDARIES , + APPBACKGROUND , + OBJECTBOUNDARIES , + TABLEBOUNDARIES , + FONTCOLOR , + LINKS , + LINKSVISITED , + SPELL , + SMARTTAGS , + SHADOWCOLOR , + WRITERTEXTGRID , + WRITERFIELDSHADINGS , + WRITERIDXSHADINGS , + WRITERDIRECTCURSOR , + WRITERSCRIPTINDICATOR, + WRITERSECTIONBOUNDARIES, + WRITERHEADERFOOTERMARK, + WRITERPAGEBREAKS, + HTMLSGML , + HTMLCOMMENT , + HTMLKEYWORD , + HTMLUNKNOWN , + CALCGRID , + CALCPAGEBREAK , + CALCPAGEBREAKMANUAL, + CALCPAGEBREAKAUTOMATIC, + CALCDETECTIVE , + CALCDETECTIVEERROR , + CALCREFERENCE , + CALCNOTESBACKGROUND , + CALCVALUE, + CALCFORMULA, + CALCTEXT, + CALCPROTECTEDBACKGROUND, + DRAWGRID , + BASICIDENTIFIER, + BASICCOMMENT , + BASICNUMBER , + BASICSTRING , + BASICOPERATOR , + BASICKEYWORD , + BASICERROR , + SQLIDENTIFIER, + SQLNUMBER, + SQLSTRING, + SQLOPERATOR, + SQLKEYWORD, + SQLPARAMETER, + SQLCOMMENT, + ColorConfigEntryCount +}; + +class ColorConfig_Impl; +struct ColorConfigValue +{ + + bool bIsVisible; //validity depends on the element type + ::Color nColor; + ColorConfigValue() : bIsVisible(false), nColor(0) {} + bool operator !=(const ColorConfigValue& rCmp) const + { return nColor != rCmp.nColor || bIsVisible != rCmp.bIsVisible;} +}; + +class SVT_DLLPUBLIC ColorConfig final : + public utl::detail::Options +{ + friend class ColorConfig_Impl; +private: + static ColorConfig_Impl* m_pImpl; +public: + ColorConfig(); + virtual ~ColorConfig() override; + + // get the configured value - if bSmart is set the default color setting is provided + // instead of the automatic color + ColorConfigValue GetColorValue(ColorConfigEntry eEntry, bool bSmart = true) const; + static Color GetDefaultColor(ColorConfigEntry eEntry); +}; + +class SVT_DLLPUBLIC EditableColorConfig +{ + std::unique_ptr<ColorConfig_Impl> m_pImpl; + bool m_bModified; +public: + EditableColorConfig(); + ~EditableColorConfig(); + + css::uno::Sequence< OUString > GetSchemeNames() const; + void DeleteScheme(const OUString& rScheme ); + void AddScheme(const OUString& rScheme ); + void LoadScheme(const OUString& rScheme ); + const OUString& GetCurrentSchemeName() const; + void SetCurrentSchemeName(const OUString& rScheme); + + const ColorConfigValue& GetColorValue(ColorConfigEntry eEntry) const; + void SetColorValue(ColorConfigEntry eEntry, const ColorConfigValue& rValue); + void SetModified(); + void ClearModified() {m_bModified = false;} + bool IsModified() const {return m_bModified;} + void Commit(); + + void DisableBroadcast(); + void EnableBroadcast(); +}; +}//namespace svtools +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/colrdlg.hxx b/include/svtools/colrdlg.hxx new file mode 100644 index 000000000..f89ec0f54 --- /dev/null +++ b/include/svtools/colrdlg.hxx @@ -0,0 +1,55 @@ +/* -*- 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_SVTOOLS_COLRDLG_HXX +#define INCLUDED_SVTOOLS_COLRDLG_HXX + +#include <svtools/svtdllapi.h> +#include <tools/color.hxx> + +namespace weld { class Window; } + +namespace svtools +{ + // Select is the default. + // These values must match the constants used in ColorPickerDialog in cui/source/dialogs/colorpicker.cxx + enum class ColorPickerMode { Select = 0, Modify = 2 }; +} + +class SVT_DLLPUBLIC SvColorDialog final +{ +public: + SvColorDialog(); + ~SvColorDialog(); + + void SetColor( const Color& rColor ); + const Color& GetColor() const { return maColor;} + + void SetMode( svtools::ColorPickerMode eMode ); + + short Execute(weld::Window* pParent); + +private: + Color maColor; + svtools::ColorPickerMode meMode; +}; + +#endif // INCLUDED_SVTOOLS_COLRDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx new file mode 100644 index 000000000..1c3185915 --- /dev/null +++ b/include/svtools/ctrlbox.hxx @@ -0,0 +1,500 @@ +/* -*- 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_SVTOOLS_CTRLBOX_HXX +#define INCLUDED_SVTOOLS_CTRLBOX_HXX + +#include <svtools/svtdllapi.h> +#include <editeng/borderline.hxx> +#include <vcl/idle.hxx> +#include <vcl/metric.hxx> +#include <vcl/weld.hxx> + +#include <memory> + +namespace weld { class CustomWeld; } + +class VirtualDevice; +class BitmapEx; +class BorderWidthImpl; +class FontList; + +/** Utility class storing the border line width, style and colors. The widths + are defined in Twips. + */ +class ImpLineListData +{ +private: + BorderWidthImpl const m_aWidthImpl; + + Color ( * m_pColor1Fn )( Color ); + Color ( * m_pColor2Fn )( Color ); + Color ( * m_pColorDistFn )( Color, Color ); + + long m_nMinWidth; + SvxBorderLineStyle m_nStyle; + +public: + ImpLineListData( BorderWidthImpl aWidthImpl, + SvxBorderLineStyle nStyle, long nMinWidth, Color ( *pColor1Fn )( Color ), + Color ( *pColor2Fn )( Color ), Color ( *pColorDistFn )( Color, Color ) ) : + m_aWidthImpl( aWidthImpl ), + m_pColor1Fn( pColor1Fn ), + m_pColor2Fn( pColor2Fn ), + m_pColorDistFn( pColorDistFn ), + m_nMinWidth( nMinWidth ), + m_nStyle( nStyle ) + { + } + + /** Returns the computed width of the line 1 in twips. */ + long GetLine1ForWidth( long nWidth ) { return m_aWidthImpl.GetLine1( nWidth ); } + + /** Returns the computed width of the line 2 in twips. */ + long GetLine2ForWidth( long nWidth ) { return m_aWidthImpl.GetLine2( nWidth ); } + + /** Returns the computed width of the gap in twips. */ + long GetDistForWidth( long nWidth ) { return m_aWidthImpl.GetGap( nWidth ); } + + Color GetColorLine1( const Color& rMain ) + { + return ( *m_pColor1Fn )( rMain ); + } + + Color GetColorLine2( const Color& rMain ) + { + return ( *m_pColor2Fn )( rMain ); + } + + Color GetColorDist( const Color& rMain, const Color& rDefault ) + { + return ( *m_pColorDistFn )( rMain, rDefault ); + } + + /** Returns the minimum width in twips */ + long GetMinWidth( ) const { return m_nMinWidth;} + SvxBorderLineStyle GetStyle( ) const { return m_nStyle;} +}; + +enum class SvxBorderLineStyle : sal_Int16; + +typedef ::std::vector< FontMetric > ImplFontList; + +/************************************************************************* + +class LineListBox + +Description + +Allows selection of line styles and sizes. Note that before first insert, +units and window size need to be set. Supported units are typographic point +(pt) and millimeters (mm). For SourceUnit, pt, mm and twips are supported. +All scalar numbers in 1/100 of the corresponding unit. + +Line1 is the outer, Line2 the inner line, Distance is the distance between +these two lines. If Line2 == 0, only Line1 will be shown. Defaults for +source and target unit are FieldUnit::POINT. + +SetColor() sets the line color. + +Remarks + +Contrary to a simple ListBox, user-specific data are not supported. +If UpdateMode is disabled, no data should be read, no selections +should be set, and the return code shall be ignore, as in these are +not defined in this mode. Also the bit WinBit WB_SORT may not be set. + +-------------------------------------------------------------------------- + +class FontNameBox + +Description + +Allows selection of fonts. The ListBox will be filled using Fill parameter, +which is pointer to an FontList object. + +Calling EnableWYSIWYG() enables rendering the font name in the currently +selected font. + +See also + +FontList; FontStyleBox; FontSizeBox; FontNameMenu + +-------------------------------------------------------------------------- + +class FontStyleBox + +Description + +Allows select of FontStyle's. The parameter Fill points to a list +of available font styles for the font. + +Reproduced styles are always added - this could change in future, as +potentially not all applications [Draw,Equation,FontWork] can properly +handle synthetic fonts. On filling, the previous name will be retained +if possible. + +For DontKnow, the FontStyleBox should be filled with OUString(), +so it will contain a list with the default attributes. The currently +shown style probably needs to be reset by the application. + +See also + +FontList; FontNameBox; FontSizeBox; + +-------------------------------------------------------------------------- + +class FontSizeBox + +Description + +Allows selection of font sizes. The values are retrieved via GetValue() +and set via SetValue(). The Fill parameter fills the ListBox with the +available sizes for the passed font. + +All sizes are in 1/10 typographic point (pt). + +The passed FontList must be retained until the next fill call. + +Additionally it supports a relative mod, which allows entering +percentage values. This, eg., can be useful for template dialogs. +This mode can only be enabled, but not disabled again. + +For DontKnow the FontSizeBox should be filled FontMetric(), so it will +contain a list with the standard sizes. Th currently shown size +probably needs to be reset by the application. + +See also + +FontList; FontNameBox; FontStyleBox; FontSizeMenu + +*************************************************************************/ + +inline Color sameColor( Color rMain ) +{ + return rMain; +} + +inline Color sameDistColor( Color /*rMain*/, Color rDefault ) +{ + return rDefault; +} + +class ValueSet; + +class SVT_DLLPUBLIC SvtLineListBox +{ +public: + typedef Color (*ColorFunc)(Color); + typedef Color (*ColorDistFunc)(Color, Color); + + SvtLineListBox(std::unique_ptr<weld::MenuButton> pControl); + ~SvtLineListBox(); + + /** Set the width in Twips */ + void SetWidth(long nWidth) + { + m_nWidth = nWidth; + UpdateEntries(); + UpdatePreview(); + } + + long GetWidth() const { return m_nWidth; } + + /** Insert a listbox entry with all widths in Twips. */ + void InsertEntry(const BorderWidthImpl& rWidthImpl, + SvxBorderLineStyle nStyle, long nMinWidth = 0, + ColorFunc pColor1Fn = &sameColor, + ColorFunc pColor2Fn = &sameColor, + ColorDistFunc pColorDistFn = &sameDistColor); + + void SelectEntry( SvxBorderLineStyle nStyle ); + SvxBorderLineStyle GetSelectEntryStyle() const; + + void SetSourceUnit( FieldUnit eNewUnit ) { eSourceUnit = eNewUnit; } + + void SetColor( const Color& rColor ) + { + aColor = rColor; + UpdateEntries(); + UpdatePreview(); + } + + const Color& GetColor() const { return aColor; } + + void SetSelectHdl(const Link<SvtLineListBox&,void>& rLink) { maSelectHdl = rLink; } + + void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); } + +private: + + SVT_DLLPRIVATE void ImpGetLine( long nLine1, long nLine2, long nDistance, + Color nColor1, Color nColor2, Color nColorDist, + SvxBorderLineStyle nStyle, BitmapEx& rBmp ); + + void UpdatePaintLineColor(); // returns sal_True if maPaintCol has changed + DECL_LINK(ValueSelectHdl, ValueSet*, void); + DECL_LINK(FocusHdl, weld::Widget&, void); + DECL_LINK(ToggleHdl, weld::ToggleButton&, void); + DECL_LINK(NoneHdl, weld::Button&, void); + + void UpdateEntries(); + sal_Int32 GetStylePos(sal_Int32 nListPos); + + const Color& GetPaintColor() const + { + return maPaintCol; + } + Color GetColorLine1( sal_Int32 nPos ); + Color GetColorLine2( sal_Int32 nPos ); + Color GetColorDist( sal_Int32 nPos ); + + void UpdatePreview(); + + SvtLineListBox( const SvtLineListBox& ) = delete; + SvtLineListBox& operator =( const SvtLineListBox& ) = delete; + + std::unique_ptr<weld::MenuButton> m_xControl; + std::unique_ptr<weld::Builder> m_xBuilder; + std::unique_ptr<weld::Widget> m_xTopLevel; + std::unique_ptr<weld::Button> m_xNoneButton; + std::unique_ptr<ValueSet> m_xLineSet; + std::unique_ptr<weld::CustomWeld> m_xLineSetWin; + + std::vector<std::unique_ptr<ImpLineListData>> m_vLineList; + long m_nWidth; + ScopedVclPtr<VirtualDevice> aVirDev; + Color aColor; + Color maPaintCol; + FieldUnit eSourceUnit; + Link<SvtLineListBox&,void> maSelectHdl; +}; + +class SVT_DLLPUBLIC SvtCalendarBox +{ +public: + SvtCalendarBox(std::unique_ptr<weld::MenuButton> pControl); + ~SvtCalendarBox(); + + weld::MenuButton& get_button() { return *m_xControl; } + + void set_date(const Date& rDate); + Date get_date() const { return m_xCalendar->get_date(); } + + void set_label(const OUString& rLabel) { m_xControl->set_label(rLabel); } + OUString get_label() const { return m_xControl->get_label(); } + + void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); } + bool get_sensitive() const { return m_xControl->get_sensitive(); } + void set_visible(bool bSensitive) { m_xControl->set_visible(bSensitive); } + void show() { set_visible(true); } + void grab_focus() { m_xControl->grab_focus(); } + + void connect_activated(const Link<SvtCalendarBox&, void>& rActivatedHdl) { m_aActivatedHdl = rActivatedHdl; } + void connect_selected(const Link<SvtCalendarBox&, void>& rSelectHdl) { m_aSelectHdl = rSelectHdl; } + + void connect_focus_in(const Link<weld::Widget&, void>& rLink) { m_xControl->connect_focus_in(rLink); } + void connect_focus_out(const Link<weld::Widget&, void>& rLink) { m_xControl->connect_focus_out(rLink); } +private: + DECL_LINK(SelectHdl, weld::Calendar&, void); + DECL_LINK(ActivateHdl, weld::Calendar&, void); + + std::unique_ptr<weld::MenuButton> m_xControl; + std::unique_ptr<weld::Builder> m_xBuilder; + std::unique_ptr<weld::Widget> m_xTopLevel; + std::unique_ptr<weld::Calendar> m_xCalendar; + + Link<SvtCalendarBox&, void> m_aActivatedHdl; + Link<SvtCalendarBox&, void> m_aSelectHdl; + + void set_label_from_date(); +}; + +class SVT_DLLPUBLIC FontNameBox +{ +private: + std::unique_ptr<weld::ComboBox> m_xComboBox; + std::unique_ptr<ImplFontList> mpFontList; + size_t mnPreviewProgress; + bool mbWYSIWYG; + OUString maFontMRUEntriesFile; + Idle maUpdateIdle; + + SVT_DLLPRIVATE void ImplDestroyFontList(); + + DECL_LINK(CustomRenderHdl, weld::ComboBox::render_args, void); + DECL_STATIC_LINK(FontNameBox, CustomGetSizeHdl, OutputDevice&, Size); + DECL_LINK(UpdateHdl, Timer*, void); + + void LoadMRUEntries( const OUString& aFontMRUEntriesFile ); + void SaveMRUEntries( const OUString& aFontMRUEntriesFile ) const; + + OutputDevice& CachePreview(size_t nIndex, Point* pTopLeft); + +public: + FontNameBox(std::unique_ptr<weld::ComboBox> p); + ~FontNameBox(); + + void Fill( const FontList* pList ); + + void EnableWYSIWYG(bool bEnable); + bool IsWYSIWYGEnabled() const { return mbWYSIWYG; } + + void connect_changed(const Link<weld::ComboBox&, void>& rLink) { m_xComboBox->connect_changed(rLink); } + void connect_focus_in(const Link<weld::Widget&, void>& rLink) { m_xComboBox->connect_focus_in(rLink); } + void connect_focus_out(const Link<weld::Widget&, void>& rLink) { m_xComboBox->connect_focus_out(rLink); } + void connect_key_press(const Link<const KeyEvent&, bool>& rLink) { m_xComboBox->connect_key_press(rLink); } + int get_active() const { return m_xComboBox->get_active(); } + OUString get_active_text() const { return m_xComboBox->get_active_text(); } + void set_active_or_entry_text(const OUString& rText); + int get_count() const { return m_xComboBox->get_count(); } + OUString get_text(int nIndex) const { return m_xComboBox->get_text(nIndex); } + void set_sensitive(bool bSensitive) { m_xComboBox->set_sensitive(bSensitive); } + void save_value() { m_xComboBox->save_value(); } + OUString const& get_saved_value() const { return m_xComboBox->get_saved_value(); } + void select_entry_region(int nStartPos, int nEndPos) { m_xComboBox->select_entry_region(nStartPos, nEndPos); } + bool get_entry_selection_bounds(int& rStartPos, int& rEndPos) { return m_xComboBox->get_entry_selection_bounds(rStartPos, rEndPos); } + void clear() { m_xComboBox->clear(); } + void grab_focus() { m_xComboBox->grab_focus(); } + bool has_focus() const { return m_xComboBox->has_focus(); } + void connect_entry_activate(const Link<weld::ComboBox&, bool>& rLink) { m_xComboBox->connect_entry_activate(rLink); } + void connect_get_property_tree(const Link<boost::property_tree::ptree&, void>& rLink) { m_xComboBox->connect_get_property_tree(rLink); } + void set_entry_width_chars(int nWidth) { m_xComboBox->set_entry_width_chars(nWidth); } + void set_size_request(int nWidth, int nHeight) { m_xComboBox->set_size_request(nWidth, nHeight); } + int get_max_mru_count() { return m_xComboBox->get_max_mru_count(); } + void set_max_mru_count(int nCount) { m_xComboBox->set_max_mru_count(nCount); } + + // font size is in points, not pixels, e.g. see Window::[G]etPointFont + vcl::Font get_font() { return m_xComboBox->get_font(); } + void set_entry_font(const vcl::Font& rFont) { m_xComboBox->set_entry_font(rFont); } + vcl::Font get_entry_font() { return m_xComboBox->get_entry_font(); } + + void set_tooltip_text(const OUString& rTip) { m_xComboBox->set_tooltip_text(rTip); } + +private: + void InitFontMRUEntriesFile(); + + FontNameBox( const FontNameBox& ) = delete; + FontNameBox& operator =( const FontNameBox& ) = delete; +}; + +class SVT_DLLPUBLIC FontStyleBox +{ + std::unique_ptr<weld::ComboBox> m_xComboBox; +public: + FontStyleBox(std::unique_ptr<weld::ComboBox> p); + + void Fill(const OUString& rName, const FontList* pList); + + void connect_changed(const Link<weld::ComboBox&, void>& rLink) { m_xComboBox->connect_changed(rLink); } + OUString get_active_text() const { return m_xComboBox->get_active_text(); } + void set_active_text(const OUString& rText) { m_xComboBox->set_active_text(rText); } + void append_text(const OUString& rStr) { m_xComboBox->append_text(rStr); } + void set_sensitive(bool bSensitive) { m_xComboBox->set_sensitive(bSensitive); } + void save_value() { m_xComboBox->save_value(); } + OUString const& get_saved_value() const { return m_xComboBox->get_saved_value(); } + int get_count() const { return m_xComboBox->get_count(); } + int find_text(const OUString& rStr) const { return m_xComboBox->find_text(rStr); } +private: + FontStyleBox(const FontStyleBox& ) = delete; + FontStyleBox& operator=(const FontStyleBox&) = delete; +}; + +class SVT_DLLPUBLIC FontSizeBox +{ + FontMetric aFontMetric; + const FontList* pFontList; + int nSavedValue; + int nMin; + int nMax; + FieldUnit eUnit; + sal_uInt16 nDecimalDigits; + sal_uInt16 nRelMin; + sal_uInt16 nRelMax; + sal_uInt16 nRelStep; + short nPtRelMin; + short nPtRelMax; + short nPtRelStep; + bool bRelativeMode:1, + bRelative:1, + bPtRelative:1, + bStdSize:1; + Link<weld::ComboBox&, void> m_aChangeHdl; + Link<weld::Widget&, void> m_aFocusOutHdl; + std::unique_ptr<weld::ComboBox> m_xComboBox; + + sal_uInt16 GetDecimalDigits() const { return nDecimalDigits; } + void SetDecimalDigits(sal_uInt16 nDigits) { nDecimalDigits = nDigits; } + FieldUnit GetUnit() const { return eUnit; } + void SetUnit(FieldUnit _eUnit) { eUnit = _eUnit; } + void SetRange(int nNewMin, int nNewMax) { nMin = nNewMin; nMax = nNewMax; } + void SetValue(int nNewValue, FieldUnit eInUnit); + + void InsertValue(int i); + + OUString format_number(int nValue) const; + + DECL_LINK(ModifyHdl, weld::ComboBox&, void); + DECL_LINK(ReformatHdl, weld::Widget&, void); +public: + FontSizeBox(std::unique_ptr<weld::ComboBox> p); + + void Fill(const FontMetric* pFontMetric, const FontList* pList); + + void EnableRelativeMode(sal_uInt16 nMin, sal_uInt16 nMax, sal_uInt16 nStep = 5); + void EnablePtRelativeMode(short nMin, short nMax, short nStep = 10); + bool IsRelativeMode() const { return bRelativeMode; } + void SetRelative( bool bRelative ); + bool IsRelative() const { return bRelative; } + void SetPtRelative( bool bPtRel ) + { + bPtRelative = bPtRel; + SetRelative(true); + } + bool IsPtRelative() const { return bPtRelative; } + + void connect_changed(const Link<weld::ComboBox&, void>& rLink) { m_aChangeHdl = rLink; } + void connect_focus_out(const Link<weld::Widget&, void>& rLink) { m_aFocusOutHdl = rLink; } + void connect_key_press(const Link<const KeyEvent&, bool>& rLink) { m_xComboBox->connect_key_press(rLink); } + OUString get_active_text() const { return m_xComboBox->get_active_text(); } + void set_active_or_entry_text(const OUString& rText); + void set_sensitive(bool bSensitive) { m_xComboBox->set_sensitive(bSensitive); } + int get_active() const { return m_xComboBox->get_active(); } + int get_value() const; + void set_value(int nValue); + void save_value() { nSavedValue = get_value(); } + int get_saved_value() const { return nSavedValue; } + bool get_value_changed_from_saved() const { return get_value() != get_saved_value(); } + int get_count() const { return m_xComboBox->get_count(); } + OUString get_text(int i) const { return m_xComboBox->get_text(i); } + void grab_focus() { m_xComboBox->grab_focus(); } + bool has_focus() const { return m_xComboBox->has_focus(); } + void connect_entry_activate(const Link<weld::ComboBox&, bool>& rLink) { m_xComboBox->connect_entry_activate(rLink); } + void disable_entry_completion() { m_xComboBox->set_entry_completion(false, false); } + void connect_get_property_tree(const Link<boost::property_tree::ptree&, void>& rLink) { m_xComboBox->connect_get_property_tree(rLink); } + +private: + FontSizeBox(const FontSizeBox&) = delete; + FontSizeBox& operator=(const FontSizeBox&) = delete; +}; + + +#endif // INCLUDED_SVTOOLS_CTRLBOX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/ctrltool.hxx b/include/svtools/ctrltool.hxx new file mode 100644 index 000000000..8b35c2a07 --- /dev/null +++ b/include/svtools/ctrltool.hxx @@ -0,0 +1,219 @@ +/* -*- 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_SVTOOLS_CTRLTOOL_HXX +#define INCLUDED_SVTOOLS_CTRLTOOL_HXX + +#include <config_options.h> +#include <svtools/svtdllapi.h> +#include <rtl/ustring.hxx> +#include <sal/types.h> +#include <vcl/metric.hxx> +#include <vcl/vclptr.hxx> + +#include <vector> +#include <memory> + + +class ImplFontListNameInfo; +class OutputDevice; + +/* + +Description +============ + +class FontList + +This class manages all fonts which can be display on one or two output devices. +Additionally, this class offers methods for generating the StyleName from +bold and italics or the missing attributes from a StyleName. +Furthermore, this class can handle synthetically reproduced fonts. +It also works with several standard controls and standard menus. + +Links: + +class FontNameBox, class FontStyleBox, class FontSizeBox, +class FontNameMenu, class FontSizeMenu + +-------------------------------------------------------------------------- + +FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2 = NULL, + bool bAll = true ); + +Constructor of the FontList class. The relevant fonts will be queried from +the OutputDevice. The OutputDevice needs to exist as long as the FontList +class exists. Optionally, a second output device can be given in order to, +e.g., manage the fonts from both, a printer and a screen in a single FontList +and thus also give FontMenus the fonts if both OutputDevices. +The pDevice2 needs to exist as long as the FontList class exists. + +The OutputDevice given first should be the preferred one. This is usually +the printer. Because if two different device fonts (one for the printer and +one for the screen) exist, the ones from the "pDevice" are preferred. + +The third parameter governs whether only scalable or all fonts shall be queried. +With sal_True bitmap fonts will also be queried. +With sal_False vectorized and scalable fonts will be queried. + +-------------------------------------------------------------------------- + +String FontList::GetStyleName( const FontMetric& rFontMetric ) const; + +This method returns the StyleName of a FontMetric. +If no StyleName is set, a name will be generated from the set attributes. + +-------------------------------------------------------------------------- + +OUString FontList::GetFontMapText( const FontMetric& rFontMetric ) const; + +This method returns a Matchstring which indicates the problem that could +arise when using a font. This string should be displayed to the user. + +-------------------------------------------------------------------------- + +FontMetric FontList::Get( const String& rName, const String& rStyleName ) const; + +This method search a FontMetric for the given name and the given style name. +The Stylename can also be a synthetic one. +In that case the relevant FontMetric fields will be set. +If a StyleName is provided, a FontMetric structure without a Stylename can be +returned. To get a representation of the StyleName for displaying it to the user, +call GetStyleName() on this FontMetric structure. + +Links: + +FontList::GetStyleName() + +-------------------------------------------------------------------------- + +FontMetric FontList::Get( const String& rName, FontWeight eWeight, + FontItalic eItalic ) const; + +This method search a FontMetric structure for a provided name and styles. +This method can also return a FontMetric without a Stylename. +To get a representation of the StyleName to be presented to the user +call GetStyleName() with this FontMetric. + +Links: + +FontList::GetStyleName() + +-------------------------------------------------------------------------- + +const sal_IntPtr* FontList::GetSizeAry( const FontMetric& rFontMetric ) const; + +This method returns the available sizes for the given font. +If it is a scalable font, standard sizes are returned. +The array contains the heights of the font in tenth (1/10) point. +The last value of the array is 0. +The returned array will destroyed by the FontList. +You should thus not reference the array after the next method call on the +FontList. +*/ + +class SVT_DLLPUBLIC FontList +{ +private: + static const sal_IntPtr aStdSizeAry[]; + + OUString maMapBoth; + OUString maMapPrinterOnly; + OUString maMapStyleNotAvailable; + mutable OUString maMapNotAvailable; + OUString maLight; + OUString maLightItalic; + OUString maNormal; + OUString maNormalItalic; + OUString maBold; + OUString maBoldItalic; + OUString maBlack; + OUString maBlackItalic; + mutable std::unique_ptr<sal_IntPtr[]> + mpSizeAry; + VclPtr<OutputDevice> mpDev; + VclPtr<OutputDevice> mpDev2; + std::vector<std::unique_ptr<ImplFontListNameInfo>> m_Entries; + + SVT_DLLPRIVATE ImplFontListNameInfo* ImplFind( const OUString& rSearchName, sal_uInt32* pIndex ) const; + SVT_DLLPRIVATE ImplFontListNameInfo* ImplFindByName( const OUString& rStr ) const; + SVT_DLLPRIVATE void ImplInsertFonts(OutputDevice* pDev, bool bInsertData); + +public: + FontList( OutputDevice* pDevice, + OutputDevice* pDevice2 = nullptr); + ~FontList(); + + std::unique_ptr<FontList> Clone() const; + + OUString GetFontMapText( const FontMetric& rFontMetric ) const; + + const OUString& GetNormalStr() const { return maNormal; } + const OUString& GetItalicStr() const { return maNormalItalic; } + const OUString& GetBoldStr() const { return maBold; } + const OUString& GetBoldItalicStr() const { return maBoldItalic; } + const OUString& GetStyleName( FontWeight eWeight, FontItalic eItalic ) const; + OUString GetStyleName( const FontMetric& rFontMetric ) const; + + FontMetric Get( const OUString& rName, + const OUString& rStyleName ) const; + FontMetric Get( const OUString& rName, + FontWeight eWeight, + FontItalic eItalic ) const; + + bool IsAvailable( const OUString& rName ) const; + size_t GetFontNameCount() const + { + return m_Entries.size(); + } + const FontMetric& GetFontName(size_t nFont) const; + sal_Handle GetFirstFontMetric( const OUString& rName ) const; + static sal_Handle GetNextFontMetric( sal_Handle hFontMetric ); + static const FontMetric& GetFontMetric( sal_Handle hFontMetric ); + + const sal_IntPtr* GetSizeAry( const FontMetric& rFontMetric ) const; + static const sal_IntPtr* GetStdSizeAry() { return aStdSizeAry; } + +private: + FontList( const FontList& ) = delete; + FontList& operator =( const FontList& ) = delete; +}; + +class UNLESS_MERGELIBS(SVT_DLLPUBLIC) FontSizeNames +{ +private: + const struct ImplFSNameItem* mpArray; + sal_Int32 mnElem; + +public: + FontSizeNames( LanguageType eLanguage /* = LANGUAGE_DONTKNOW */ ); + + sal_Int32 Count() const { return mnElem; } + bool IsEmpty() const { return !mnElem; } + + sal_Int32 Name2Size( const OUString& ) const; + OUString Size2Name( sal_Int32 ) const; + + OUString GetIndexName( sal_Int32 nIndex ) const; + sal_Int32 GetIndexSize( sal_Int32 nIndex ) const; +}; + +#endif // INCLUDED_SVTOOLS_CTRLTOOL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/dialogclosedlistener.hxx b/include/svtools/dialogclosedlistener.hxx new file mode 100644 index 000000000..7b7c324fa --- /dev/null +++ b/include/svtools/dialogclosedlistener.hxx @@ -0,0 +1,65 @@ +/* -*- 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_SVTOOLS_DIALOGCLOSEDLISTENER_HXX +#define INCLUDED_SVTOOLS_DIALOGCLOSEDLISTENER_HXX + +#include <svtools/svtdllapi.h> +#include <cppuhelper/implbase.hxx> +#include <com/sun/star/ui/dialogs/XDialogClosedListener.hpp> +#include <tools/link.hxx> + + +namespace svt +{ + + + //= ODialogClosedListener + + /** + C++ class to implement a css::ui::dialogs::XDialogClosedListener + */ + class SVT_DLLPUBLIC DialogClosedListener final : + public cppu::WeakImplHelper< css::ui::dialogs::XDialogClosedListener > + { + private: + /** + This link will be called when the dialog was closed. + */ + Link<css::ui::dialogs::DialogClosedEvent*, void> m_aDialogClosedLink; + + public: + DialogClosedListener(); + + void SetDialogClosedLink( const Link<css::ui::dialogs::DialogClosedEvent*,void>& rLink ) { m_aDialogClosedLink = rLink; } + + // XDialogClosedListener methods + virtual void SAL_CALL dialogClosed( const css::ui::dialogs::DialogClosedEvent& aEvent ) override; + + // XEventListener methods + virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; + }; + + +} // namespace svt + + +#endif// COMPHELPER_DIALOGCLOSEDLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx new file mode 100644 index 000000000..04c931d82 --- /dev/null +++ b/include/svtools/editbrowsebox.hxx @@ -0,0 +1,720 @@ +/* -*- 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_SVTOOLS_EDITBROWSEBOX_HXX +#define INCLUDED_SVTOOLS_EDITBROWSEBOX_HXX +#define SVTOOLS_IN_EDITBROWSEBOX_HXX + +#include <config_options.h> +#include <memory> +#include <svtools/svtdllapi.h> +#include <tools/ref.hxx> +#include <vcl/window.hxx> + +#include <svtools/brwbox.hxx> +#include <svtools/brwhead.hxx> +#include <vcl/InterimItemWindow.hxx> +#include <vcl/vclmedit.hxx> +#include <o3tl/typed_flags_set.hxx> + +class Button; +class CheckBox; +class SpinField; + +// EditBrowseBoxFlags (EBBF) + +enum class EditBrowseBoxFlags +{ + NONE = 0x0000, +/** if this bit is _not_ set, the handle column will be invalidated upon + changing the row in the browse box. This is for forcing the row picture to + be repainted. If you do not have row pictures or text, you don't need this + invalidation, then you would specify this bit to prevent flicker +*/ + NO_HANDLE_COLUMN_CONTENT = 0x0001, +/** set this bit to activate the cell on a MouseButtonDown, not a MouseButtonUp event + */ + ACTIVATE_ON_BUTTONDOWN = 0x0002, +/** if this bit is set and EditBrowseBoxFlags::NO_HANDLE_COLUMN_CONTENT is _not_ set, the handle + column is drawn with the text contained in column 0 instead of an image +*/ + HANDLE_COLUMN_TEXT = 0x0004, + +/** If this bit is set, tab traveling is somewhat modified<br/> + If the control gets the focus because the user pressed the TAB key, then the + first or last cell (depending on whether the traveling was cycling forward or backward) + gets activated. + @see Window::GetGetFocusFlags + @see GETFOCUS_* +*/ + SMART_TAB_TRAVEL = 0x0008, + +}; +namespace o3tl +{ + template<> struct typed_flags<EditBrowseBoxFlags> : is_typed_flags<EditBrowseBoxFlags, 0x0f> {}; +} + + +class Edit; +class FormattedField; + + +namespace svt +{ + class SVT_DLLPUBLIC CellController : public SvRefBase + { + friend class EditBrowseBox; + Link<LinkParamNone*, void> maModifyHdl; + + VclPtr<Control> pWindow; + bool bSuspended; // <true> if the window is hidden and disabled + + public: + + CellController(Control* pW); + virtual ~CellController() override; + + Control& GetWindow() const { return *const_cast< CellController* >( this )->pWindow; } + + virtual void SetModified(); + virtual void ClearModified() = 0; + virtual bool IsModified() const = 0; + + // commit any current changes. Especially, do any reformatting you need (from input formatting + // to output formatting) here + virtual void CommitModifications(); + + // suspending the controller is not cumulative! + void suspend( ); + void resume( ); + bool isSuspended( ) const { return bSuspended; } + + protected: + virtual bool MoveAllowed(const KeyEvent& rEvt) const; + void SetModifyHdl(const Link<LinkParamNone*,void>& rLink) { maModifyHdl = rLink; } + virtual bool WantMouseEvent() const; + virtual void callModifyHdl() { maModifyHdl.Call(nullptr); } + }; + + typedef tools::SvRef<CellController> CellControllerRef; + + + //= IEditImplementation + + class UNLESS_MERGELIBS(SVT_DLLPUBLIC) IEditImplementation + { + public: + virtual ~IEditImplementation() = 0; + + virtual Control& GetControl() = 0; + + virtual OUString GetText( LineEnd aSeparator ) const = 0; + virtual void SetText( const OUString& _rStr ) = 0; + + virtual bool IsReadOnly() const = 0; + virtual void SetReadOnly( bool bReadOnly ) = 0; + + virtual sal_Int32 GetMaxTextLen() const = 0; + virtual void SetMaxTextLen( sal_Int32 _nMaxLen ) = 0; + + virtual Selection GetSelection() const = 0; + virtual void SetSelection( const Selection& _rSelection ) = 0; + + virtual void ReplaceSelected( const OUString& _rStr ) = 0; + virtual OUString GetSelected( LineEnd aSeparator ) const = 0; + + virtual void SetModified() = 0; + virtual bool IsModified() const = 0; + virtual void ClearModified() = 0; + virtual void SetModifyHdl( const Link<Edit&,void>& _rLink ) = 0; + }; + + + //= GenericEditImplementation + + template <class EDIT> + class GenericEditImplementation : public IEditImplementation + { + EDIT& m_rEdit; + public: + GenericEditImplementation( EDIT& _rEdit ); + + EDIT& GetEditWindow() { return static_cast< EDIT& >( GetControl() ); } + + virtual Control& GetControl() override; + + virtual OUString GetText( LineEnd aSeparator ) const override; + virtual void SetText( const OUString& _rStr ) override; + + virtual bool IsReadOnly() const override; + virtual void SetReadOnly( bool bReadOnly ) override; + + virtual sal_Int32 GetMaxTextLen() const override; + virtual void SetMaxTextLen( sal_Int32 _nMaxLen ) override; + + virtual Selection GetSelection() const override; + virtual void SetSelection( const Selection& _rSelection ) override; + + virtual void ReplaceSelected( const OUString& _rStr ) override; + virtual OUString GetSelected( LineEnd aSeparator ) const override; + + virtual void SetModified() override; + virtual bool IsModified() const override; + virtual void ClearModified() override; + virtual void SetModifyHdl( const Link<Edit&,void>& _rLink ) override; + }; + + #include <svtools/editimplementation.hxx> + + + //= MultiLineTextCell + + /** a multi line edit which can be used in a cell of an EditBrowseBox + */ + class UNLESS_MERGELIBS(SVT_DLLPUBLIC) MultiLineTextCell final : public VclMultiLineEdit + { + public: + MultiLineTextCell( vcl::Window* _pParent, WinBits _nStyle ) + : VclMultiLineEdit( _pParent, _nStyle ) + { + } + + private: + // Window overridables + virtual bool PreNotify( NotifyEvent& rNEvt ) override; + + // MultiLineEdit overridables + virtual void Modify() override; + + bool dispatchKeyEvent( const KeyEvent& _rEvent ); + }; + + + //= concrete edit implementations + + typedef GenericEditImplementation< Edit > EditImplementation; + + typedef GenericEditImplementation< MultiLineTextCell > MultiLineEditImplementation_Base; + class UNLESS_MERGELIBS(SVT_DLLPUBLIC) MultiLineEditImplementation final : public MultiLineEditImplementation_Base + { + public: + MultiLineEditImplementation( MultiLineTextCell& _rEdit ) : MultiLineEditImplementation_Base( _rEdit ) + { + } + + virtual OUString GetText( LineEnd aSeparator ) const override; + virtual OUString GetSelected( LineEnd aSeparator ) const override; + }; + + + //= EditCellController + + class SVT_DLLPUBLIC EditCellController : public CellController + { + IEditImplementation* m_pEditImplementation; + bool m_bOwnImplementation; // did we create m_pEditImplementation? + + public: + EditCellController( Edit* _pEdit ); + EditCellController( IEditImplementation* _pImplementation ); + virtual ~EditCellController( ) override; + + const IEditImplementation* GetEditImplementation( ) const { return m_pEditImplementation; } + IEditImplementation* GetEditImplementation( ) { return m_pEditImplementation; } + + virtual void SetModified() override; + virtual bool IsModified() const override; + virtual void ClearModified() override; + + protected: + virtual bool MoveAllowed(const KeyEvent& rEvt) const override; + private: + DECL_LINK(ModifyHdl, Edit&, void); + }; + + + //= SpinCellController + + class UNLESS_MERGELIBS(SVT_DLLPUBLIC) SpinCellController final : public CellController + { + public: + SpinCellController(SpinField* pSpinField); + const SpinField& GetSpinWindow() const; + SpinField& GetSpinWindow(); + + virtual void SetModified() override; + virtual bool IsModified() const override; + virtual void ClearModified() override; + + private: + virtual bool MoveAllowed(const KeyEvent& rEvt) const override; + DECL_LINK(ModifyHdl, Edit&, void); + }; + + + //= CheckBoxControl + + class SVT_DLLPUBLIC CheckBoxControl final : public Control + { + VclPtr<CheckBox> pBox; + Link<VclPtr<CheckBox>,void> m_aClickLink; + Link<LinkParamNone*,void> m_aModifyLink; + + public: + CheckBoxControl(vcl::Window* pParent); + virtual ~CheckBoxControl() override; + virtual void dispose() override; + + virtual void GetFocus() override; + virtual bool PreNotify(NotifyEvent& rEvt) override; + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rClientRect) override; + virtual void Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override; + virtual void StateChanged( StateChangedType nStateChange ) override; + virtual void DataChanged( const DataChangedEvent& _rEvent ) override; + virtual void Resize() override; + + void SetClickHdl(const Link<VclPtr<CheckBox>,void>& rHdl) {m_aClickLink = rHdl;} + + void SetModifyHdl(const Link<LinkParamNone*,void>& rHdl) {m_aModifyLink = rHdl;} + + CheckBox& GetBox() {return *pBox;}; + + private: + DECL_LINK( OnClick, Button*, void ); + }; + + //= CheckBoxCellController + class SVT_DLLPUBLIC CheckBoxCellController final : public CellController + { + public: + + CheckBoxCellController(CheckBoxControl* pWin); + CheckBox& GetCheckBox() const; + + virtual bool IsModified() const override; + virtual void ClearModified() override; + + private: + virtual bool WantMouseEvent() const override; + DECL_LINK(ModifyHdl, LinkParamNone*, void); + }; + + class SVT_DLLPUBLIC ControlBase : public InterimItemWindow + { + public: + ControlBase(vcl::Window* pParent, const OUString& rUIXMLDescription, const OString& rID) + : InterimItemWindow(pParent, rUIXMLDescription, rID) + { + } + virtual bool ControlHasFocus() const = 0; + }; + + //= ComboBoxControl + class SVT_DLLPUBLIC ComboBoxControl final : public ControlBase + { + private: + std::unique_ptr<weld::ComboBox> m_xWidget; + Link<LinkParamNone*,void> m_aModify1Hdl; + Link<LinkParamNone*,void> m_aModify2Hdl; + + friend class ComboBoxCellController; + + public: + ComboBoxControl(vcl::Window* pParent); + + virtual void GetFocus() override + { + if (m_xWidget) + m_xWidget->grab_focus(); + InterimItemWindow::GetFocus(); + } + + weld::ComboBox& get_widget() { return *m_xWidget; } + + // sets a link to call when the selection is changed by the user + void SetModifyHdl(const Link<LinkParamNone*,void>& rHdl) + { + m_aModify1Hdl = rHdl; + } + + // sets an additional link to call when the selection is changed by the user + void SetAuxModifyHdl(const Link<LinkParamNone*,void>& rLink) + { + m_aModify2Hdl = rLink; + } + + virtual bool ControlHasFocus() const override + { + return m_xWidget && m_xWidget->has_focus(); + } + + virtual void dispose() override; + + private: + DECL_LINK(SelectHdl, weld::ComboBox&, void); + + void CallModifyHdls() + { + m_aModify1Hdl.Call(nullptr); + m_aModify2Hdl.Call(nullptr); + } + }; + + //= ComboBoxCellController + class SVT_DLLPUBLIC ComboBoxCellController : public CellController + { + public: + + ComboBoxCellController(ComboBoxControl* pParent); + weld::ComboBox& GetComboBox() const { return static_cast<ComboBoxControl&>(GetWindow()).get_widget(); } + + virtual bool IsModified() const override; + virtual void ClearModified() override; + + protected: + virtual bool MoveAllowed(const KeyEvent& rEvt) const override; + private: + DECL_LINK(ModifyHdl, LinkParamNone*, void); + }; + + //= ListBoxControl + class SVT_DLLPUBLIC ListBoxControl final : public ControlBase + { + private: + std::unique_ptr<weld::ComboBox> m_xWidget; + Link<LinkParamNone*,void> m_aModify1Hdl; + Link<LinkParamNone*,void> m_aModify2Hdl; + + friend class ListBoxCellController; + + public: + ListBoxControl(vcl::Window* pParent); + + virtual void GetFocus() override + { + if (m_xWidget) + m_xWidget->grab_focus(); + InterimItemWindow::GetFocus(); + } + + weld::ComboBox& get_widget() { return *m_xWidget; } + + // sets a link to call when the selection is changed by the user + void SetModifyHdl(const Link<LinkParamNone*,void>& rHdl) + { + m_aModify1Hdl = rHdl; + } + + // sets an additional link to call when the selection is changed by the user + void SetAuxModifyHdl(const Link<LinkParamNone*,void>& rLink) + { + m_aModify2Hdl = rLink; + } + + virtual bool ControlHasFocus() const override + { + return m_xWidget && m_xWidget->has_focus(); + } + + virtual void dispose() override; + private: + DECL_LINK(SelectHdl, weld::ComboBox&, void); + + void CallModifyHdls() + { + m_aModify1Hdl.Call(nullptr); + m_aModify2Hdl.Call(nullptr); + } + }; + + //= ListBoxCellController + class SVT_DLLPUBLIC ListBoxCellController : public CellController + { + public: + + ListBoxCellController(ListBoxControl* pParent); + weld::ComboBox& GetListBox() const { return static_cast<ListBoxControl&>(GetWindow()).get_widget(); } + + virtual bool IsModified() const override; + virtual void ClearModified() override; + + protected: + virtual bool MoveAllowed(const KeyEvent& rEvt) const override; + private: + DECL_LINK(ListBoxSelectHdl, LinkParamNone*, void); + }; + + //= FormattedFieldCellController + class SVT_DLLPUBLIC FormattedFieldCellController final : public EditCellController + { + public: + FormattedFieldCellController( FormattedField* _pFormatted ); + + virtual void CommitModifications() override; + }; + + + //= EditBrowserHeader + + class SVT_DLLPUBLIC EditBrowserHeader : public BrowserHeader + { + public: + EditBrowserHeader( BrowseBox* pParent, WinBits nWinBits = WB_BUTTONSTYLE ) + :BrowserHeader(pParent, nWinBits){} + + protected: + virtual void DoubleClick() override; + }; + + + //= EditBrowseBox + + class EditBrowseBoxImpl; + class SVT_DLLPUBLIC EditBrowseBox: public BrowseBox + { + friend class EditBrowserHeader; + + enum BrowseInfo + { + COLSELECT = 1, + ROWSELECT = 2, + ROWCHANGE = 4, + COLCHANGE = 8 + }; + + public: + enum RowStatus + { + CLEAN = 0, + CURRENT = 1, + CURRENTNEW = 2, + MODIFIED = 3, + NEW = 4, + DELETED = 5, + PRIMARYKEY = 6, + CURRENT_PRIMARYKEY = 7, + FILTER = 8, + HEADERFOOTER = 9 + }; + + private: + EditBrowseBox(EditBrowseBox const &) = delete; + EditBrowseBox& operator=(EditBrowseBox const &) = delete; + + class BrowserMouseEventPtr + { + std::unique_ptr<BrowserMouseEvent> pEvent; + bool bDown; + + public: + BrowserMouseEventPtr() + : bDown(false) + { + } + + bool Is() const {return pEvent != nullptr;} + bool IsDown() const {return bDown;} + const BrowserMouseEvent* operator->() const {return pEvent.get();} + + SVT_DLLPUBLIC void Clear(); + void Set(const BrowserMouseEvent* pEvt, bool bIsDown); + } aMouseEvent; + + CellControllerRef aController, + aOldController; + + ImplSVEvent * nStartEvent, * nEndEvent, * nCellModifiedEvent; // event ids + VclPtr<vcl::Window> m_pFocusWhileRequest; + // In ActivateCell, we grab the focus asynchronously, but if between requesting activation + // and the asynchronous event the focus has changed, we won't grab it for ourself. + + long nPaintRow; // row being painted + long nEditRow; + sal_uInt16 nEditCol; + + bool bHasFocus : 1; + mutable bool bPaintStatus : 1; // paint a status (image) in the handle column + bool bActiveBeforeTracking; + + VclPtr<CheckBoxControl> pCheckBoxPaint; + + EditBrowseBoxFlags m_nBrowserFlags; + std::unique_ptr< EditBrowseBoxImpl> m_aImpl; + + protected: + VclPtr<BrowserHeader> pHeader; + + BrowserMouseEventPtr& getMouseEvent() { return aMouseEvent; } + + protected: + BrowserHeader* GetHeaderBar() const {return pHeader;} + + virtual VclPtr<BrowserHeader> CreateHeaderBar(BrowseBox* pParent) override; + + // if you want to have an own header ... + virtual VclPtr<BrowserHeader> imp_CreateHeaderBar(BrowseBox* pParent); + + virtual void ColumnMoved(sal_uInt16 nId) override; + virtual void ColumnResized(sal_uInt16 nColId) override; + virtual void Resize() override; + virtual void ArrangeControls(sal_uInt16& nX, sal_uInt16 nY); + virtual bool SeekRow(long nRow) override; + + virtual void GetFocus() override; + virtual void LoseFocus() override; + virtual void KeyInput(const KeyEvent& rEvt) override; + virtual void MouseButtonDown(const BrowserMouseEvent& rEvt) override; + virtual void MouseButtonUp(const BrowserMouseEvent& rEvt) override; + virtual void StateChanged( StateChangedType nType ) override; + virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; + + using BrowseBox::MouseButtonUp; + using BrowseBox::MouseButtonDown; + + virtual bool PreNotify(NotifyEvent& rNEvt ) override; + virtual bool EventNotify(NotifyEvent& rNEvt) override; + + virtual void EndScroll() override; + + // should be used instead of GetFieldRectPixel, 'cause this method here takes into account the borders + tools::Rectangle GetCellRect(long nRow, sal_uInt16 nColId, bool bRelToBrowser = true) const; + virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId); + sal_uInt32 GetAutoColumnWidth(sal_uInt16 nColId); + + virtual void PaintStatusCell(OutputDevice& rDev, const tools::Rectangle& rRect) const; + virtual void PaintCell(OutputDevice& rDev, const tools::Rectangle& rRect, sal_uInt16 nColId) const = 0; + + virtual RowStatus GetRowStatus(long nRow) const; + + virtual void RowHeightChanged() override; + + // callbacks for the data window + virtual void ImplStartTracking() override; + virtual void ImplEndTracking() override; + + // when changing a row: + // CursorMoving: cursor is being moved, but GetCurRow() still provides the old row + virtual bool CursorMoving(long nNewRow, sal_uInt16 nNewCol); + + // cursor has been moved + virtual void CursorMoved() override; + + virtual void CellModified(); // called whenever a cell has been modified + virtual bool SaveModified(); // called whenever a cell should be left, and it's content should be saved + // return sal_False prevents leaving the cell + virtual bool SaveRow(); // commit the current row + + virtual bool IsModified() const {return aController.is() && aController->IsModified();} + + virtual CellController* GetController(long nRow, sal_uInt16 nCol); + virtual void InitController(CellControllerRef& rController, long nRow, sal_uInt16 nCol); + static void ResizeController(CellControllerRef const & rController, const tools::Rectangle&); + virtual void DoubleClick(const BrowserMouseEvent&) override; + + void ActivateCell() { ActivateCell(GetCurRow(), GetCurColumnId()); } + + // retrieve the image for the row status + Image GetImage(RowStatus) const; + + // inserting columns + // if you don't set a width, this will be calculated automatically + // if the id isn't set the smallest unused will do it ... + virtual sal_uInt16 AppendColumn(const OUString& rName, sal_uInt16 nWidth, sal_uInt16 nPos = HEADERBAR_APPEND, sal_uInt16 nId = sal_uInt16(-1)); + + // called whenever (Shift)Tab or Enter is pressed. If true is returned, these keys + // result in traveling to the next or to th previous cell + virtual bool IsTabAllowed(bool bForward) const; + + virtual bool IsCursorMoveAllowed(long nNewRow, sal_uInt16 nNewColId) const override; + + void PaintTristate(const tools::Rectangle& rRect, const TriState& eState, bool _bEnabled=true) const; + + void AsynchGetFocus(); + // secure starting of StartEditHdl + + public: + EditBrowseBox(vcl::Window* pParent, EditBrowseBoxFlags nBrowserFlags, WinBits nBits, BrowserMode nMode = BrowserMode::NONE ); + virtual ~EditBrowseBox() override; + virtual void dispose() override; + + bool IsEditing() const {return aController.is();} + void InvalidateStatusCell(long nRow) {RowModified(nRow, 0);} + void InvalidateHandleColumn(); + + // late construction + virtual void Init(); + virtual void RemoveRows(); + virtual void Dispatch(sal_uInt16 nId); + + const CellControllerRef& Controller() const { return aController; } + EditBrowseBoxFlags GetBrowserFlags() const { return m_nBrowserFlags; } + void SetBrowserFlags(EditBrowseBoxFlags nFlags); + + virtual void ActivateCell(long nRow, sal_uInt16 nCol, bool bSetCellFocus = true); + virtual void DeactivateCell(bool bUpdate = true); + // Children --------------------------------------------------------------- + + /** @return The count of additional controls of the control area. */ + virtual sal_Int32 GetAccessibleControlCount() const override; + + /** Creates the accessible object of an additional control. + @param nIndex + The 0-based index of the control. + @return + The XAccessible interface of the specified control. */ + virtual css::uno::Reference< css::accessibility::XAccessible > + CreateAccessibleControl( sal_Int32 nIndex ) override; + + /** Sets focus to current cell of the data table. */ + virtual void GrabTableFocus() override; + + virtual tools::Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex) override; + virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) override; + + css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCheckBoxCell(long _nRow, sal_uInt16 _nColumnPos,const TriState& eState); + bool ControlHasFocus() const; + protected: + // creates the accessible which wraps the active cell + void implCreateActiveAccessible( ); + + private: + virtual void PaintField(vcl::RenderContext& rDev, const tools::Rectangle& rRect, + sal_uInt16 nColumnId ) const override; + using Control::ImplInitSettings; + SVT_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground ); + SVT_DLLPRIVATE void DetermineFocus( const GetFocusFlags _nGetFocusFlags = GetFocusFlags::NONE); + inline void EnableAndShow() const; + + SVT_DLLPRIVATE void implActivateCellOnMouseEvent(const BrowserMouseEvent& _rEvt, bool _bUp); + + DECL_DLLPRIVATE_LINK( ModifyHdl, LinkParamNone*, void ); + DECL_DLLPRIVATE_LINK( StartEditHdl, void*, void ); + DECL_DLLPRIVATE_LINK( EndEditHdl, void*, void ); + DECL_DLLPRIVATE_LINK( CellModifiedHdl, void*, void ); + }; + + +} // namespace svt + + +#undef SVTOOLS_IN_EDITBROWSEBOX_HXX +#endif // INCLUDED_SVTOOLS_EDITBROWSEBOX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/editimplementation.hxx b/include/svtools/editimplementation.hxx new file mode 100644 index 000000000..c43c44d66 --- /dev/null +++ b/include/svtools/editimplementation.hxx @@ -0,0 +1,137 @@ +/* -*- 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 SVTOOLS_IN_EDITBROWSEBOX_HXX +#error "not to be included directly!" +#endif + + +template <class EDIT> +GenericEditImplementation< EDIT >::GenericEditImplementation( EDIT& _rEdit ) + :m_rEdit( _rEdit ) +{ +} + + +template <class EDIT> +Control& GenericEditImplementation< EDIT >::GetControl() +{ + return m_rEdit; +} + + +template <class EDIT> +OUString GenericEditImplementation< EDIT >::GetText( LineEnd ) const +{ + // ignore the line end - this base implementation does not support it + return m_rEdit.GetText( ); +} + + +template <class EDIT> +void GenericEditImplementation< EDIT >::SetText( const OUString& _rStr ) +{ + m_rEdit.SetText( _rStr ); +} + + +template <class EDIT> +Selection GenericEditImplementation< EDIT >::GetSelection() const +{ + return m_rEdit.GetSelection( ); +} + + +template <class EDIT> +void GenericEditImplementation< EDIT >::SetSelection( const Selection& _rSelection ) +{ + m_rEdit.SetSelection( _rSelection ); +} + + +template <class EDIT> +void GenericEditImplementation< EDIT >::SetReadOnly( bool bReadOnly ) +{ + m_rEdit.SetReadOnly( bReadOnly ); +} + + +template <class EDIT> +bool GenericEditImplementation< EDIT >::IsReadOnly() const +{ + return m_rEdit.IsReadOnly(); +} + + +template <class EDIT> +void GenericEditImplementation< EDIT >::ReplaceSelected( const OUString& _rStr ) +{ + m_rEdit.ReplaceSelected( _rStr ); +} + + +template <class EDIT> +OUString GenericEditImplementation< EDIT >::GetSelected( LineEnd ) const +{ + return m_rEdit.GetSelected( ); +} + + +template <class EDIT> +void GenericEditImplementation< EDIT >::SetMaxTextLen( sal_Int32 _nMaxLen ) +{ + m_rEdit.SetMaxTextLen( _nMaxLen ); +} + + +template <class EDIT> +sal_Int32 GenericEditImplementation< EDIT >::GetMaxTextLen() const +{ + return m_rEdit.GetMaxTextLen( ); +} + + +template <class EDIT> +void GenericEditImplementation< EDIT >::SetModified() +{ + m_rEdit.SetModifyFlag(); +} + + +template <class EDIT> +bool GenericEditImplementation< EDIT >::IsModified() const +{ + return m_rEdit.IsModified(); +} + + +template <class EDIT> +void GenericEditImplementation< EDIT >::ClearModified() +{ + m_rEdit.ClearModifyFlag(); +} + + +template <class EDIT> +void GenericEditImplementation< EDIT >::SetModifyHdl( const Link<Edit&,void>& _rLink ) +{ + m_rEdit.SetModifyHdl( _rLink ); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/editsyntaxhighlighter.hxx b/include/svtools/editsyntaxhighlighter.hxx new file mode 100644 index 000000000..aaa2ee61b --- /dev/null +++ b/include/svtools/editsyntaxhighlighter.hxx @@ -0,0 +1,55 @@ +/* -*- 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_SVTOOLS_EDITSYNTAXHIGHLIGHTER_HXX +#define INCLUDED_SVTOOLS_EDITSYNTAXHIGHLIGHTER_HXX + +#include <comphelper/syntaxhighlight.hxx> +#include <vcl/vclmedit.hxx> +#include <svtools/svtdllapi.h> +#include <svtools/colorcfg.hxx> + +class SVT_DLLPUBLIC MultiLineEditSyntaxHighlight : public VclMultiLineEdit +{ + private: + SyntaxHighlighter aHighlighter; + svtools::ColorConfig m_aColorConfig; + + private: + void DoBracketHilight(sal_uInt16 aKey); + + protected: + virtual bool PreNotify( NotifyEvent& rNEvt ) override; + + public: + MultiLineEditSyntaxHighlight( vcl::Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER , HighlighterLanguage aLanguage = HighlighterLanguage::SQL); + + virtual void UpdateData() override; + virtual void SetText(const OUString& rNewText) override; + virtual void SetText( const OUString& rStr, const Selection& rNewSelection ) override + { SetText( rStr ); SetSelection( rNewSelection ); } + + static Color GetSyntaxHighlightColor(const svtools::ColorConfig& rColorConfig, HighlighterLanguage eLanguage, TokenType aToken); + + Color GetColorValue(TokenType aToken); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/ehdl.hxx b/include/svtools/ehdl.hxx new file mode 100644 index 000000000..054ac94fd --- /dev/null +++ b/include/svtools/ehdl.hxx @@ -0,0 +1,73 @@ +/* -*- 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_SVTOOLS_EHDL_HXX +#define INCLUDED_SVTOOLS_EHDL_HXX + +#include <svtools/svtdllapi.h> +#include <svtools/svtresid.hxx> +#include <vcl/errinf.hxx> + +typedef std::pair<const char*, ErrCode> ErrMsgCode; +SVT_DLLPUBLIC extern const ErrMsgCode RID_ERRHDL[]; +SVT_DLLPUBLIC extern const ErrMsgCode RID_ERRCTX[]; + +namespace weld { class Window; } + +class SVT_DLLPUBLIC SfxErrorContext final : private ErrorContext +{ +public: + SfxErrorContext( + sal_uInt16 nCtxIdP, weld::Window *pWin=nullptr, + const ErrMsgCode* pIds = nullptr, const std::locale& rResLocaleP = SvtResLocale()); + SfxErrorContext( + sal_uInt16 nCtxIdP, const OUString &aArg1, weld::Window *pWin=nullptr, + const ErrMsgCode* pIds = nullptr, const std::locale& rResLocaleP = SvtResLocale()); + bool GetString(ErrCode nErrId, OUString &rStr) override; + +private: + sal_uInt16 nCtxId; + const ErrMsgCode* pIds; + std::locale aResLocale; + OUString aArg1; +}; + +class SVT_DLLPUBLIC SfxErrorHandler : private ErrorHandler +{ +public: + SfxErrorHandler(const ErrMsgCode* pIds, ErrCodeArea lStart, ErrCodeArea lEnd, const std::locale& rResLocale = SvtResLocale()); + virtual ~SfxErrorHandler() override; + +protected: + bool GetErrorString(ErrCode lErrId, OUString &) const; + +private: + + ErrCodeArea lStart; + ErrCodeArea lEnd; + const ErrMsgCode* pIds; + std::locale aResLocale; + + SVT_DLLPRIVATE static void GetClassString(ErrCodeClass lErrId, OUString &); + virtual bool CreateString(const ErrorInfo *, OUString &) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/embedhlp.hxx b/include/svtools/embedhlp.hxx new file mode 100644 index 000000000..12a8a2367 --- /dev/null +++ b/include/svtools/embedhlp.hxx @@ -0,0 +1,128 @@ +/* -*- 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_SVTOOLS_EMBEDHLP_HXX +#define INCLUDED_SVTOOLS_EMBEDHLP_HXX + +#include <svtools/svtdllapi.h> +#include <com/sun/star/uno/Reference.hxx> +#include <vcl/graph.hxx> +#include <rtl/ustring.hxx> +#include <memory> + +namespace com :: sun :: star :: io { class XInputStream; } + +namespace comphelper +{ + class EmbeddedObjectContainer; +} + +namespace com::sun::star::embed { + class XEmbeddedObject; +} + +class OutputDevice; + +namespace svt { + +struct EmbeddedObjectRef_Impl; + +class SVT_DLLPUBLIC EmbeddedObjectRef +{ + std::unique_ptr<EmbeddedObjectRef_Impl> mpImpl; + + SVT_DLLPRIVATE std::unique_ptr<SvStream> GetGraphicStream( bool bUpdate ) const; + SVT_DLLPRIVATE void GetReplacement( bool bUpdate ); + + EmbeddedObjectRef& operator = ( const EmbeddedObjectRef& ) = delete; + +public: + static void DrawPaintReplacement( const tools::Rectangle &rRect, const OUString &rText, OutputDevice *pOut ); + static void DrawShading( const tools::Rectangle &rRect, OutputDevice *pOut ); + static bool TryRunningState( const css::uno::Reference < css::embed::XEmbeddedObject >& ); + static void SetGraphicToContainer( const Graphic& rGraphic, + comphelper::EmbeddedObjectContainer& aContainer, + const OUString& aName, + const OUString& aMediaType ); + + static css::uno::Reference< css::io::XInputStream > GetGraphicReplacementStream( + sal_Int64 nViewAspect, + const css::uno::Reference < css::embed::XEmbeddedObject >&, + OUString* pMediaType ) + throw(); + + static bool IsChart(const css::uno::Reference < css::embed::XEmbeddedObject >& xObj); + + const css::uno::Reference <css::embed::XEmbeddedObject>& operator->() const; + const css::uno::Reference <css::embed::XEmbeddedObject>& GetObject() const; + + // default constructed object; needs further assignment before it can be used + EmbeddedObjectRef(); + + // assign a previously default constructed object + void Assign( const css::uno::Reference < css::embed::XEmbeddedObject >& xObj, sal_Int64 nAspect ); + + // create object for a certain view aspect + EmbeddedObjectRef( const css::uno::Reference < css::embed::XEmbeddedObject >& xObj, sal_Int64 nAspect ); + + ~EmbeddedObjectRef(); + EmbeddedObjectRef( const EmbeddedObjectRef& ); + + // assigning to a container enables the object to exchange graphical representations with a storage + void AssignToContainer( comphelper::EmbeddedObjectContainer* pContainer, const OUString& rPersistName ); + comphelper::EmbeddedObjectContainer* GetContainer() const; + + sal_Int64 GetViewAspect() const; + void SetViewAspect( sal_Int64 nAspect ); + const Graphic* GetGraphic() const; + + // the original size of the object ( size of the icon for iconified object ) + // no conversion is done if no target mode is provided + Size GetSize( MapMode const * pTargetMapMode ) const; + + void SetGraphic( const Graphic& rGraphic, const OUString& rMediaType ); + void SetGraphicStream( + const css::uno::Reference< css::io::XInputStream >& xInGrStream, + const OUString& rMediaType ); + + void UpdateReplacement(); + void UpdateReplacementOnDemand(); + void Lock( bool bLock = true ); + void Clear(); + bool is() const; + + bool IsLocked() const; + bool IsChart() const; + + OUString GetChartType(); + + // #i104867# + // Provides a graphic version number for the fetchable Graphic during this object's lifetime. Internally, + // that number is incremented at each change of the Graphic. This mechanism is needed to identify if a + // remembered Graphic (e.g. primitives) has changed compared to the current one, but without actively + // fetching the Graphic what would be too expensive e.g. for charts + sal_uInt32 getGraphicVersion() const; + void SetDefaultSizeForChart( const Size& rSizeIn_100TH_MM );//#i103460# charts do not necessarily have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this method +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/embedtransfer.hxx b/include/svtools/embedtransfer.hxx new file mode 100644 index 000000000..a6787cc24 --- /dev/null +++ b/include/svtools/embedtransfer.hxx @@ -0,0 +1,61 @@ +/* -*- 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_SVTOOLS_EMBEDTRANSFER_HXX +#define INCLUDED_SVTOOLS_EMBEDTRANSFER_HXX + +#include <svtools/svtdllapi.h> +#include <vcl/transfer.hxx> +#include <memory> + +namespace com :: sun :: star :: embed { class XEmbeddedObject; } + +class Graphic; +class SVT_DLLPUBLIC SvEmbedTransferHelper final : public TransferableHelper +{ +private: + + css::uno::Reference< css::embed::XEmbeddedObject > m_xObj; + std::unique_ptr<Graphic> m_pGraphic; + sal_Int64 m_nAspect; + + OUString maParentShellID; + + virtual void AddSupportedFormats() override; + virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override; + virtual void ObjectReleased() override; + +public: + // object, replacement image, and the aspect + SvEmbedTransferHelper( const css::uno::Reference< css::embed::XEmbeddedObject >& xObj, + const Graphic* pGraphic, + sal_Int64 nAspect ); + virtual ~SvEmbedTransferHelper() override; + + void SetParentShellID( const OUString& rShellID ); + + static void FillTransferableObjectDescriptor( TransferableObjectDescriptor& rDesc, + const css::uno::Reference< css::embed::XEmbeddedObject >& xObj, + const Graphic* pGraphic, + sal_Int64 nAspect ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/extcolorcfg.hxx b/include/svtools/extcolorcfg.hxx new file mode 100644 index 000000000..2374d0fb1 --- /dev/null +++ b/include/svtools/extcolorcfg.hxx @@ -0,0 +1,109 @@ +/* -*- 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_SVTOOLS_EXTCOLORCFG_HXX +#define INCLUDED_SVTOOLS_EXTCOLORCFG_HXX + +#include <svtools/svtdllapi.h> +#include <rtl/ustring.hxx> +#include <svl/SfxBroadcaster.hxx> +#include <svl/lstner.hxx> +#include <tools/color.hxx> +#include <memory> + + +namespace svtools { + +class ExtendedColorConfig_Impl; + +class ExtendedColorConfigValue +{ + OUString m_sName; + OUString m_sDisplayName; + Color m_nColor; + Color m_nDefaultColor; +public: + ExtendedColorConfigValue() : m_nColor(0),m_nDefaultColor(0){} + ExtendedColorConfigValue(const OUString& _sName + ,const OUString& _sDisplayName + ,Color _nColor + ,Color _nDefaultColor) + : m_sName(_sName) + ,m_sDisplayName(_sDisplayName) + ,m_nColor(_nColor) + ,m_nDefaultColor(_nDefaultColor) + {} + + const OUString& getName() const { return m_sName; } + const OUString& getDisplayName() const { return m_sDisplayName; } + Color getColor() const { return m_nColor; } + Color getDefaultColor() const { return m_nDefaultColor; } + + void setColor(Color _nColor) { m_nColor = _nColor; } +}; + +class SVT_DLLPUBLIC ExtendedColorConfig final : public SfxBroadcaster, public SfxListener +{ + friend class ExtendedColorConfig_Impl; +private: + static ExtendedColorConfig_Impl* m_pImpl; +public: + ExtendedColorConfig(); + virtual ~ExtendedColorConfig() override; + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; + + // get the configured value + ExtendedColorConfigValue GetColorValue(const OUString& _sComponentName,const OUString& _sName)const; + sal_Int32 GetComponentCount() const; + OUString GetComponentName(sal_uInt32 _nPos) const; + OUString GetComponentDisplayName(const OUString& _sComponentName) const; + sal_Int32 GetComponentColorCount(const OUString& _sName) const; + ExtendedColorConfigValue GetComponentColorConfigValue(const OUString& _sComponentName,sal_uInt32 _nPos) const; +}; + +class SVT_DLLPUBLIC EditableExtendedColorConfig +{ + std::unique_ptr<ExtendedColorConfig_Impl> m_pImpl; + bool m_bModified; +public: + EditableExtendedColorConfig(); + ~EditableExtendedColorConfig(); + + void DeleteScheme(const OUString& rScheme ); + void AddScheme(const OUString& rScheme ); + void LoadScheme(const OUString& rScheme ); + void SetCurrentSchemeName(const OUString& rScheme); + + sal_Int32 GetComponentCount() const; + OUString GetComponentName(sal_uInt32 _nPos) const; + sal_Int32 GetComponentColorCount(const OUString& _sName) const; + ExtendedColorConfigValue GetComponentColorConfigValue(const OUString& _sName,sal_uInt32 _nPos) const; + void SetColorValue(const OUString& _sComponentName, const ExtendedColorConfigValue& rValue); + void SetModified(); + void ClearModified() {m_bModified = false;} + bool IsModified() const {return m_bModified;} + void Commit(); + + void DisableBroadcast(); + void EnableBroadcast(); +}; +}//namespace svtools +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/filechangedchecker.hxx b/include/svtools/filechangedchecker.hxx new file mode 100644 index 000000000..016fe9279 --- /dev/null +++ b/include/svtools/filechangedchecker.hxx @@ -0,0 +1,47 @@ +/* -*- 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/. + */ + +#ifndef INCLUDED_SVTOOLS_FILECHANGEDCHECKER_HXX +#define INCLUDED_SVTOOLS_FILECHANGEDCHECKER_HXX + +#include <config_options.h> +#include <svtools/svtdllapi.h> + +#include <osl/time.h> +#include <rtl/ustring.hxx> +#include <vcl/idle.hxx> + +#include <functional> + +class Timer; + +/** Periodically checks if a file has been modified + + Instances of this class setup a vcl timer to occasionally wake up + check whether file modification time has changed. + */ +class UNLESS_MERGELIBS(SVT_DLLPUBLIC) FileChangedChecker +{ +private: + Timer mTimer; + OUString mFileName; + TimeValue mLastModTime; + ::std::function<void ()> mpCallback; + + bool SVT_DLLPRIVATE getCurrentModTime(TimeValue& o_rValue) const; + DECL_LINK(TimerHandler, Timer *, void); + +public: + void resetTimer(); + bool hasFileChanged(); + FileChangedChecker(const OUString& rFilename, + const ::std::function<void ()>& rCallback); +}; + +#endif diff --git a/include/svtools/fontsubstconfig.hxx b/include/svtools/fontsubstconfig.hxx new file mode 100644 index 000000000..76830d1c0 --- /dev/null +++ b/include/svtools/fontsubstconfig.hxx @@ -0,0 +1,64 @@ +/* -*- 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_SVTOOLS_FONTSUBSTCONFIG_HXX +#define INCLUDED_SVTOOLS_FONTSUBSTCONFIG_HXX + +#include <svtools/svtdllapi.h> +#include <unotools/configitem.hxx> +#include <memory> + +struct SvtFontSubstConfig_Impl; + + +struct SubstitutionStruct +{ + OUString sFont; + OUString sReplaceBy; + bool bReplaceAlways; + bool bReplaceOnScreenOnly; +}; + +class SVT_DLLPUBLIC SvtFontSubstConfig final : public utl::ConfigItem +{ +private: + bool bIsEnabled; + std::unique_ptr<SvtFontSubstConfig_Impl> pImpl; + + virtual void ImplCommit() override; + +public: + SvtFontSubstConfig(); + virtual ~SvtFontSubstConfig() override; + + virtual void Notify( const css::uno::Sequence< OUString >& _rPropertyNames) override; + + bool IsEnabled() const {return bIsEnabled;} + void Enable(bool bSet) {bIsEnabled = bSet; SetModified();} + + sal_Int32 SubstitutionCount() const; + void ClearSubstitutions(); + const SubstitutionStruct* GetSubstitution(sal_Int32 nPos); + void AddSubstitution(const SubstitutionStruct& rToAdd); + void Apply(); +}; + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/framestatuslistener.hxx b/include/svtools/framestatuslistener.hxx new file mode 100644 index 000000000..3f3e4464c --- /dev/null +++ b/include/svtools/framestatuslistener.hxx @@ -0,0 +1,95 @@ +/* -*- 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_SVTOOLS_FRAMESTATUSLISTENER_HXX +#define INCLUDED_SVTOOLS_FRAMESTATUSLISTENER_HXX + +#include <svtools/svtdllapi.h> +#include <com/sun/star/frame/XFrameActionListener.hpp> +#include <com/sun/star/frame/XStatusListener.hpp> +#include <cppuhelper/weak.hxx> +#include <cppuhelper/basemutex.hxx> + +#include <unordered_map> + +namespace com :: sun :: star :: frame { class XDispatch; } +namespace com :: sun :: star :: frame { class XFrame; } +namespace com :: sun :: star :: uno { class XComponentContext; } + +namespace svt +{ + +class FrameStatusListener : public css::frame::XStatusListener, + public css::frame::XFrameActionListener, + public css::lang::XComponent, + public ::cppu::BaseMutex, + public ::cppu::OWeakObject +{ + public: + FrameStatusListener( const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const css::uno::Reference< css::frame::XFrame >& xFrame ); + virtual ~FrameStatusListener() override; + + // methods to support status forwarder, known by the old sfx2 toolbox controller implementation + void addStatusListener( const OUString& aCommandURL ); + void bindListener(); + + // XInterface + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; + virtual void SAL_CALL acquire() throw () override; + virtual void SAL_CALL release() throw () override; + + // XComponent + virtual void SAL_CALL dispose() override; + virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override; + virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; + + // XEventListener + virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; + + // XStatusListener + virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override = 0; + + // XFrameActionListener + virtual void SAL_CALL frameAction( const css::frame::FrameActionEvent& Action ) override; + + protected: + struct Listener + { + Listener( const css::util::URL& rURL, const css::uno::Reference< css::frame::XDispatch >& rDispatch ) : + aURL( rURL ), xDispatch( rDispatch ) {} + + css::util::URL aURL; + css::uno::Reference< css::frame::XDispatch > xDispatch; + }; + + typedef std::unordered_map< OUString, + css::uno::Reference< css::frame::XDispatch > > URLToDispatchMap; + + bool m_bDisposed : 1; + css::uno::Reference< css::frame::XFrame > m_xFrame; + css::uno::Reference< css::uno::XComponentContext > m_xContext; + URLToDispatchMap m_aListenerMap; +}; + +} + +#endif // INCLUDED_SVTOOLS_FRAMESTATUSLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/generictoolboxcontroller.hxx b/include/svtools/generictoolboxcontroller.hxx new file mode 100644 index 000000000..7f12c466c --- /dev/null +++ b/include/svtools/generictoolboxcontroller.hxx @@ -0,0 +1,74 @@ +/* -*- 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_SVTOOLS_GENERICTOOLBOXCONTROLLER_HXX +#define INCLUDED_SVTOOLS_GENERICTOOLBOXCONTROLLER_HXX + +#include <config_options.h> +#include <svtools/svtdllapi.h> +#include <svtools/toolboxcontroller.hxx> +#include <vcl/toolbox.hxx> + +namespace weld +{ + class Toolbar; +} + +namespace svt +{ + +class UNLESS_MERGELIBS(SVT_DLLPUBLIC) GenericToolboxController final : public svt::ToolboxController +{ +public: + GenericToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const css::uno::Reference< css::frame::XFrame >& rFrame, + ToolBox* pToolBox, + sal_uInt16 nID, + const OUString& aCommand ); + + GenericToolboxController(const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const css::uno::Reference< css::frame::XFrame >& rFrame, + weld::Toolbar& rToolbar, + const OUString& rCommand); + + virtual ~GenericToolboxController() override; + + // XComponent + virtual void SAL_CALL dispose() override; + + // XToolbarController + virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override; + + // XStatusListener + virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override; + + DECL_STATIC_LINK( GenericToolboxController, ExecuteHdl_Impl, void*, void ); + +private: + VclPtr<ToolBox> m_xToolbox; + sal_uInt16 m_nID; + + weld::Toolbar* m_pToolbox; +}; + +} + +#endif // INCLUDED_SVTOOLS_GENERICTOOLBOXCONTROLLER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/genericunodialog.hxx b/include/svtools/genericunodialog.hxx new file mode 100644 index 000000000..1c1e2d246 --- /dev/null +++ b/include/svtools/genericunodialog.hxx @@ -0,0 +1,165 @@ +/* -*- 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_SVTOOLS_GENERICUNODIALOG_HXX +#define INCLUDED_SVTOOLS_GENERICUNODIALOG_HXX + +#include <svtools/svtdllapi.h> + +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> + +#include <cppuhelper/implbase.hxx> +#include <comphelper/uno3.hxx> +#include <comphelper/propertycontainer.hxx> +#include <comphelper/broadcasthelper.hxx> +#include <tools/link.hxx> +#include <vcl/weld.hxx> + +namespace com :: sun :: star :: awt { class XWindow; } +namespace com :: sun :: star :: uno { class XComponentContext; } + +class VclWindowEvent; + + +namespace svt +{ + + +#define UNODIALOG_PROPERTY_ID_TITLE 1 +#define UNODIALOG_PROPERTY_ID_PARENT 2 + +#define UNODIALOG_PROPERTY_TITLE "Title" +#define UNODIALOG_PROPERTY_PARENT "ParentWindow" + + typedef cppu::WeakImplHelper< css::ui::dialogs::XExecutableDialog, + css::lang::XServiceInfo, + css::lang::XInitialization > OGenericUnoDialogBase; + + /** abstract base class for implementing UNO objects representing dialogs (com.sun.star.awt::XDialog) + */ + class SVT_DLLPUBLIC OGenericUnoDialog + :public OGenericUnoDialogBase + ,public ::comphelper::OMutexAndBroadcastHelper + ,public ::comphelper::OPropertyContainer + { + protected: + std::unique_ptr<weld::DialogController> m_xDialog; /// the dialog to execute + bool m_bExecuting : 1; /// we're currently executing the dialog + bool m_bTitleAmbiguous : 1; /// m_sTitle has not been set yet + bool m_bInitialized : 1; /// has "initialize" been called? + + // <properties> + OUString m_sTitle; /// title of the dialog + css::uno::Reference<css::awt::XWindow> m_xParent; /// parent window + // </properties> + + css::uno::Reference<css::uno::XComponentContext> m_aContext; + + protected: + OGenericUnoDialog(const css::uno::Reference< css::uno::XComponentContext >& _rxContext); + virtual ~OGenericUnoDialog() override; + + public: + // UNO + DECLARE_UNO3_DEFAULTS(OGenericUnoDialog, OGenericUnoDialogBase) + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + + // XTypeProvider + virtual css::uno::Sequence<css::uno::Type> SAL_CALL getTypes( ) override; + virtual css::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) override = 0; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override = 0; + virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; + virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override = 0; + + // OPropertySetHelper + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& rValue ) override; + virtual sal_Bool SAL_CALL convertFastPropertyValue( css::uno::Any& rConvertedValue, css::uno::Any& rOldValue, sal_Int32 nHandle, const css::uno::Any& rValue) override; + + // XExecutableDialog + virtual void SAL_CALL setTitle( const OUString& aTitle ) override; + virtual sal_Int16 SAL_CALL execute( ) override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; + + protected: + /** create the concrete dialog instance. Note that m_aMutex is not locked when this method get called, + but the application-wide solar mutex is (to guard the not thread-safe ctor of the dialog). + @param pParent the parent window for the new dialog + */ + virtual std::unique_ptr<weld::DialogController> createDialog(const css::uno::Reference<css::awt::XWindow>& rParent) = 0; + + /// called to destroy the dialog used. deletes m_pDialog and resets it to NULL + void destroyDialog(); + + /** called after the dialog has been executed + @param _nExecutionResult the execution result as returned by Dialog::Execute + */ + virtual void executedDialog(sal_Int16 /*_nExecutionResult*/) { } + + /** smaller form of <method>initialize</method>.<p/> + The <method>initialize</method> method is called with a sequence of com.sun.star.uno::Any's, + which is split up into the single elements, which are passed to implInitialize. The default implementation + tries to extract a com.sun.star.beans::PropertyValue from the value a pass it to the + com.sun.star.beans::XPropertySet interface of the object. + */ + virtual void implInitialize(const css::uno::Any& _rValue); + + private: + + /** ensures that m_pDialog is not <NULL/> + + This method does nothing if m_pDialog is already non-<NULL/>. Else, it calls createDialog and does + all necessary initializations of the new dialog instance. + + @precond + m_aMutex is locked + + @return + <TRUE/> if and only if m_pDialog is non-<NULL/> upon returning from the method. Note that the only + case where m_pDialog is <NULL/> is when createDialog returned <NULL/>, which is will fire an assertion + in non-product builds. + */ + bool impl_ensureDialog_lck(); + }; + + /// helper class for guarding access to methods of an OGenericUnoDialog + class UnoDialogEntryGuard + { + public: + UnoDialogEntryGuard( OGenericUnoDialog& _rDialog ) + :m_aGuard( _rDialog.GetMutex() ) + { + } + + private: + ::osl::MutexGuard m_aGuard; + }; + + +} // namespace svt + + +#endif // INCLUDED_SVTOOLS_GENERICUNODIALOG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/helpids.h b/include/svtools/helpids.h new file mode 100644 index 000000000..ce1b29cf6 --- /dev/null +++ b/include/svtools/helpids.h @@ -0,0 +1,50 @@ +/* -*- 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_SVTOOLS_HELPIDS_H +#define INCLUDED_SVTOOLS_HELPIDS_H + +#define HID_FILEDLG_LINK_CB "SVT_HID_FILEDLG_LINK_CB" +#define HID_FILEDLG_PREVIEW_CB "SVT_HID_FILEDLG_PREVIEW_CB" +#define HID_FILEDLG_STANDARD "SVT_HID_FILEDLG_STANDARD" + +// help ids for the different modi of the file picker dialog +#define HID_FILESAVE_LEVELUP "SVT_HID_FILESAVE_LEVELUP" +#define HID_FILESAVE_CREATEDIRECTORY "SVT_HID_FILESAVE_CREATEDIRECTORY" +#define HID_FILESAVE_FILEVIEW "SVT_HID_FILESAVE_FILEVIEW" +#define HID_FILESAVE_TEMPLATE "SVT_HID_FILESAVE_TEMPLATE" +#define HID_FILESAVE_FILEURL "SVT_HID_FILESAVE_FILEURL" +#define HID_FILESAVE_FILETYPE "SVT_HID_FILESAVE_FILETYPE" +#define HID_FILESAVE_DOSAVE "SVT_HID_FILESAVE_DOSAVE" +#define HID_FILESAVE_AUTOEXTENSION "SVT_HID_FILESAVE_AUTOEXTENSION" +#define HID_FILESAVE_SAVEWITHPASSWORD "SVT_HID_FILESAVE_SAVEWITHPASSWORD" +#define HID_FILESAVE_CUSTOMIZEFILTER "SVT_HID_FILESAVE_CUSTOMIZEFILTER" +#define HID_FILESAVE_SELECTION "SVT_HID_FILESAVE_SELECTION" +#define HID_FILESAVE_DIALOG "SVT_HID_FILESAVE_DIALOG" +#define HID_FILESAVE_DOPLAY "SVT_HID_FILESAVE_DOPLAY" + +#define HID_FILEOPEN_LEVELUP "SVT_HID_FILEOPEN_LEVELUP" +#define HID_FILEOPEN_READONLY "SVT_HID_FILEOPEN_READONLY" +#define HID_FILEOPEN_VERSION "SVT_HID_FILEOPEN_VERSION" +#define HID_FILEOPEN_IMAGE_TEMPLATE "SVT_HID_FILEOPEN_IMAGE_TEMPLATE" +#define HID_FILEOPEN_IMAGE_ANCHOR "SVT_HID_FILEOPEN_IMAGE_ANCHOR" + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/helpopt.hxx b/include/svtools/helpopt.hxx new file mode 100644 index 000000000..0f7ada539 --- /dev/null +++ b/include/svtools/helpopt.hxx @@ -0,0 +1,53 @@ +/* -*- 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_SVTOOLS_HELPOPT_HXX +#define INCLUDED_SVTOOLS_HELPOPT_HXX + +#include <svtools/svtdllapi.h> + +#include <rtl/ustring.hxx> +#include <unotools/options.hxx> +#include <memory> + +class SvtHelpOptions_Impl; + +class SVT_DLLPUBLIC SvtHelpOptions final : public utl::detail::Options +{ + std::shared_ptr<SvtHelpOptions_Impl> pImpl; + +public: + SvtHelpOptions(); + virtual ~SvtHelpOptions() override; + + void SetExtendedHelp( bool b ); + bool IsExtendedHelp() const; + void SetHelpTips( bool b ); + bool IsHelpTips() const; + void SetOfflineHelpPopUp(bool b); + bool IsOfflineHelpPopUp() const; + + const OUString& GetHelpStyleSheet()const; + void SetHelpStyleSheet(const OUString& rStyleSheet); + + OUString const & GetSystem() const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/htmlcfg.hxx b/include/svtools/htmlcfg.hxx new file mode 100644 index 000000000..eff992147 --- /dev/null +++ b/include/svtools/htmlcfg.hxx @@ -0,0 +1,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/. + * + * 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_SVTOOLS_HTMLCFG_HXX +#define INCLUDED_SVTOOLS_HTMLCFG_HXX + +#include <unotools/configitem.hxx> +#include <svtools/svtdllapi.h> +#include <memory> + +#define HTML_FONT_COUNT 7 + +// !!!be aware!!!: the following defines are _not_ used as values in the configuration file +// this is because of compatibility reasons +#define HTML_CFG_MSIE 1 // Internet Explorer +#define HTML_CFG_WRITER 2 // Writer +#define HTML_CFG_NS40 3 // Netscape 4.0 + +#define HTML_CFG_MAX HTML_CFG_NS40 + +struct HtmlOptions_Impl; + +class SVT_DLLPUBLIC SvxHtmlOptions final : public utl::ConfigItem +{ + std::unique_ptr<HtmlOptions_Impl> pImpl; + static const css::uno::Sequence<OUString>& GetPropertyNames(); + void Load( const css::uno::Sequence< OUString >& rPropertyNames ); + + virtual void ImplCommit() override; + +public: + SvxHtmlOptions(); + virtual ~SvxHtmlOptions() override; + + virtual void Notify( const css::uno::Sequence< OUString >& _rPropertyNames) override; + + sal_uInt16 GetFontSize(sal_uInt16 nPos) const; + void SetFontSize(sal_uInt16 nPos, sal_uInt16 nSize); + + bool IsImportUnknown() const; + void SetImportUnknown(bool bSet); + + sal_uInt16 GetExportMode() const; + + bool IsStarBasic() const; + void SetStarBasic(bool bSet); + + bool IsStarBasicWarning() const; + void SetStarBasicWarning(bool bSet); + + bool IsSaveGraphicsLocal() const; + void SetSaveGraphicsLocal(bool bSet); + + bool IsPrintLayoutExtension() const; + void SetPrintLayoutExtension(bool bSet); + + bool IsIgnoreFontFamily() const; + void SetIgnoreFontFamily(bool bSet); + + bool IsDefaultTextEncoding() const; + rtl_TextEncoding GetTextEncoding() const; + void SetTextEncoding( rtl_TextEncoding ); + static SvxHtmlOptions& Get(); + + bool IsNumbersEnglishUS() const; + void SetNumbersEnglishUS(bool bSet); +}; + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/htmlkywd.hxx b/include/svtools/htmlkywd.hxx new file mode 100644 index 000000000..36e7512e8 --- /dev/null +++ b/include/svtools/htmlkywd.hxx @@ -0,0 +1,691 @@ +/* -*- 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_SVTOOLS_HTMLKYWD_HXX +#define INCLUDED_SVTOOLS_HTMLKYWD_HXX + +#include <sal/config.h> + +#define OOO_STRING_SVTOOLS_HTML_doctype40 \ + "HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"" +#define OOO_STRING_SVTOOLS_XHTML_doctype11 \ + "html PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN\" " \ + "\"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd\"" + +// these are only switched on +#define OOO_STRING_SVTOOLS_HTML_area "area" +#define OOO_STRING_SVTOOLS_HTML_base "base" +#define OOO_STRING_SVTOOLS_HTML_comment "!--" +#define OOO_STRING_SVTOOLS_HTML_doctype "!DOCTYPE" +#define OOO_STRING_SVTOOLS_HTML_embed "embed" +#define OOO_STRING_SVTOOLS_HTML_horzrule "hr" +#define OOO_STRING_SVTOOLS_HTML_image "img" +#define OOO_STRING_SVTOOLS_HTML_input "input" +#define OOO_STRING_SVTOOLS_HTML_linebreak "br" +#define OOO_STRING_SVTOOLS_HTML_li "li" +#define OOO_STRING_SVTOOLS_HTML_link "link" +#define OOO_STRING_SVTOOLS_HTML_meta "meta" +#define OOO_STRING_SVTOOLS_HTML_nobr "nobr" +#define OOO_STRING_SVTOOLS_HTML_option "option" +#define OOO_STRING_SVTOOLS_HTML_param "param" +#define OOO_STRING_SVTOOLS_HTML_spacer "spacer" + +// these are switched off again +#define OOO_STRING_SVTOOLS_HTML_abbreviation "abbrev" +#define OOO_STRING_SVTOOLS_HTML_acronym "acronym" +#define OOO_STRING_SVTOOLS_HTML_address "address" +#define OOO_STRING_SVTOOLS_HTML_anchor "a" +#define OOO_STRING_SVTOOLS_HTML_applet "applet" +#define OOO_STRING_SVTOOLS_HTML_author "au" +#define OOO_STRING_SVTOOLS_HTML_banner "banner" +#define OOO_STRING_SVTOOLS_HTML_basefont "basefont" +#define OOO_STRING_SVTOOLS_HTML_bigprint "big" +#define OOO_STRING_SVTOOLS_HTML_blink "blink" +#define OOO_STRING_SVTOOLS_HTML_blockquote "blockquote" +#define OOO_STRING_SVTOOLS_HTML_blockquote30 "bq" +#define OOO_STRING_SVTOOLS_HTML_body "body" +#define OOO_STRING_SVTOOLS_HTML_bold "b" +#define OOO_STRING_SVTOOLS_HTML_caption "caption" +#define OOO_STRING_SVTOOLS_HTML_center "center" +#define OOO_STRING_SVTOOLS_HTML_citiation "cite" +#define OOO_STRING_SVTOOLS_HTML_code "code" +#define OOO_STRING_SVTOOLS_HTML_col "col" +#define OOO_STRING_SVTOOLS_HTML_colgroup "colgroup" +#define OOO_STRING_SVTOOLS_HTML_credit "credit" +#define OOO_STRING_SVTOOLS_HTML_dd "dd" +#define OOO_STRING_SVTOOLS_HTML_deflist "dl" +#define OOO_STRING_SVTOOLS_HTML_deletedtext "del" +#define OOO_STRING_SVTOOLS_HTML_dirlist "dir" +#define OOO_STRING_SVTOOLS_HTML_division "div" +#define OOO_STRING_SVTOOLS_HTML_dt "dt" +#define OOO_STRING_SVTOOLS_HTML_emphasis "em" +#define OOO_STRING_SVTOOLS_HTML_figure "fig" +#define OOO_STRING_SVTOOLS_HTML_font "font" +#define OOO_STRING_SVTOOLS_HTML_footnote "fn" +#define OOO_STRING_SVTOOLS_HTML_form "form" +#define OOO_STRING_SVTOOLS_HTML_frame "frame" +#define OOO_STRING_SVTOOLS_HTML_frameset "frameset" +#define OOO_STRING_SVTOOLS_HTML_head1 "h1" +#define OOO_STRING_SVTOOLS_HTML_head2 "h2" +#define OOO_STRING_SVTOOLS_HTML_head3 "h3" +#define OOO_STRING_SVTOOLS_HTML_head4 "h4" +#define OOO_STRING_SVTOOLS_HTML_head5 "h5" +#define OOO_STRING_SVTOOLS_HTML_head6 "h6" +#define OOO_STRING_SVTOOLS_HTML_head "head" +#define OOO_STRING_SVTOOLS_HTML_html "html" +#define OOO_STRING_SVTOOLS_HTML_iframe "iframe" +#define OOO_STRING_SVTOOLS_HTML_insertedtext "ins" +#define OOO_STRING_SVTOOLS_HTML_italic "i" +#define OOO_STRING_SVTOOLS_HTML_keyboard "kbd" +#define OOO_STRING_SVTOOLS_HTML_language "lang" +#define OOO_STRING_SVTOOLS_HTML_listheader "lh" +#define OOO_STRING_SVTOOLS_HTML_map "map" +#define OOO_STRING_SVTOOLS_HTML_menulist "menu" +#define OOO_STRING_SVTOOLS_HTML_multicol "multicol" +#define OOO_STRING_SVTOOLS_HTML_noembed "noembed" +#define OOO_STRING_SVTOOLS_HTML_noframe "noframe" +#define OOO_STRING_SVTOOLS_HTML_noframes "noframes" +#define OOO_STRING_SVTOOLS_HTML_noscript "noscript" +#define OOO_STRING_SVTOOLS_HTML_note "note" +#define OOO_STRING_SVTOOLS_HTML_object "object" +#define OOO_STRING_SVTOOLS_HTML_orderlist "ol" +#define OOO_STRING_SVTOOLS_HTML_parabreak "p" +#define OOO_STRING_SVTOOLS_HTML_person "person" +#define OOO_STRING_SVTOOLS_HTML_plaintext "t" +#define OOO_STRING_SVTOOLS_HTML_preformtxt "pre" +#define OOO_STRING_SVTOOLS_HTML_sample "samp" +#define OOO_STRING_SVTOOLS_HTML_script "script" +#define OOO_STRING_SVTOOLS_HTML_select "select" +#define OOO_STRING_SVTOOLS_HTML_shortquote "q" +#define OOO_STRING_SVTOOLS_HTML_smallprint "small" +#define OOO_STRING_SVTOOLS_HTML_span "span" +#define OOO_STRING_SVTOOLS_HTML_strikethrough "s" +#define OOO_STRING_SVTOOLS_HTML_strong "strong" +#define OOO_STRING_SVTOOLS_HTML_style "style" +#define OOO_STRING_SVTOOLS_HTML_subscript "sub" +#define OOO_STRING_SVTOOLS_HTML_superscript "sup" +#define OOO_STRING_SVTOOLS_HTML_table "table" +#define OOO_STRING_SVTOOLS_HTML_tablerow "tr" +#define OOO_STRING_SVTOOLS_HTML_tabledata "td" +#define OOO_STRING_SVTOOLS_HTML_tableheader "th" +#define OOO_STRING_SVTOOLS_HTML_tbody "tbody" +#define OOO_STRING_SVTOOLS_HTML_teletype "tt" +#define OOO_STRING_SVTOOLS_HTML_textarea "textarea" +#define OOO_STRING_SVTOOLS_HTML_tfoot "tfoot" +#define OOO_STRING_SVTOOLS_HTML_thead "thead" +#define OOO_STRING_SVTOOLS_HTML_title "title" +#define OOO_STRING_SVTOOLS_HTML_underline "u" +#define OOO_STRING_SVTOOLS_HTML_unorderlist "ul" +#define OOO_STRING_SVTOOLS_HTML_variable "var" + +// obsolete features +#define OOO_STRING_SVTOOLS_HTML_xmp "xmp" +#define OOO_STRING_SVTOOLS_HTML_listing "listing" + +// proposed features +#define OOO_STRING_SVTOOLS_HTML_definstance "dfn" +#define OOO_STRING_SVTOOLS_HTML_strike "strike" +#define OOO_STRING_SVTOOLS_HTML_comment2 "comment" +#define OOO_STRING_SVTOOLS_HTML_marquee "marquee" +#define OOO_STRING_SVTOOLS_HTML_plaintext2 "plaintext" +#define OOO_STRING_SVTOOLS_HTML_sdfield "sdfield" + +// names for all characters +#define OOO_STRING_SVTOOLS_HTML_C_lt "lt" +#define OOO_STRING_SVTOOLS_HTML_C_gt "gt" +#define OOO_STRING_SVTOOLS_HTML_C_amp "amp" +#define OOO_STRING_SVTOOLS_HTML_C_quot "quot" +#define OOO_STRING_SVTOOLS_HTML_C_Aacute "Aacute" +#define OOO_STRING_SVTOOLS_HTML_C_Agrave "Agrave" +#define OOO_STRING_SVTOOLS_HTML_C_Acirc "Acirc" +#define OOO_STRING_SVTOOLS_HTML_C_Atilde "Atilde" +#define OOO_STRING_SVTOOLS_HTML_C_Aring "Aring" +#define OOO_STRING_SVTOOLS_HTML_C_Auml "Auml" +#define OOO_STRING_SVTOOLS_HTML_C_AElig "AElig" +#define OOO_STRING_SVTOOLS_HTML_C_Ccedil "Ccedil" +#define OOO_STRING_SVTOOLS_HTML_C_Eacute "Eacute" +#define OOO_STRING_SVTOOLS_HTML_C_Egrave "Egrave" +#define OOO_STRING_SVTOOLS_HTML_C_Ecirc "Ecirc" +#define OOO_STRING_SVTOOLS_HTML_C_Euml "Euml" +#define OOO_STRING_SVTOOLS_HTML_C_Iacute "Iacute" +#define OOO_STRING_SVTOOLS_HTML_C_Igrave "Igrave" +#define OOO_STRING_SVTOOLS_HTML_C_Icirc "Icirc" +#define OOO_STRING_SVTOOLS_HTML_C_Iuml "Iuml" +#define OOO_STRING_SVTOOLS_HTML_C_ETH "ETH" +#define OOO_STRING_SVTOOLS_HTML_C_Ntilde "Ntilde" +#define OOO_STRING_SVTOOLS_HTML_C_Oacute "Oacute" +#define OOO_STRING_SVTOOLS_HTML_C_Ograve "Ograve" +#define OOO_STRING_SVTOOLS_HTML_C_Ocirc "Ocirc" +#define OOO_STRING_SVTOOLS_HTML_C_Otilde "Otilde" +#define OOO_STRING_SVTOOLS_HTML_C_Ouml "Ouml" +#define OOO_STRING_SVTOOLS_HTML_C_Oslash "Oslash" +#define OOO_STRING_SVTOOLS_HTML_C_Uacute "Uacute" +#define OOO_STRING_SVTOOLS_HTML_C_Ugrave "Ugrave" +#define OOO_STRING_SVTOOLS_HTML_C_Ucirc "Ucirc" +#define OOO_STRING_SVTOOLS_HTML_C_Uuml "Uuml" +#define OOO_STRING_SVTOOLS_HTML_C_Yacute "Yacute" +#define OOO_STRING_SVTOOLS_HTML_C_THORN "THORN" +#define OOO_STRING_SVTOOLS_HTML_C_szlig "szlig" +#define OOO_STRING_SVTOOLS_HTML_S_aacute "aacute" +#define OOO_STRING_SVTOOLS_HTML_S_agrave "agrave" +#define OOO_STRING_SVTOOLS_HTML_S_acirc "acirc" +#define OOO_STRING_SVTOOLS_HTML_S_atilde "atilde" +#define OOO_STRING_SVTOOLS_HTML_S_aring "aring" +#define OOO_STRING_SVTOOLS_HTML_S_auml "auml" +#define OOO_STRING_SVTOOLS_HTML_S_aelig "aelig" +#define OOO_STRING_SVTOOLS_HTML_S_ccedil "ccedil" +#define OOO_STRING_SVTOOLS_HTML_S_eacute "eacute" +#define OOO_STRING_SVTOOLS_HTML_S_egrave "egrave" +#define OOO_STRING_SVTOOLS_HTML_S_ecirc "ecirc" +#define OOO_STRING_SVTOOLS_HTML_S_euml "euml" +#define OOO_STRING_SVTOOLS_HTML_S_iacute "iacute" +#define OOO_STRING_SVTOOLS_HTML_S_igrave "igrave" +#define OOO_STRING_SVTOOLS_HTML_S_icirc "icirc" +#define OOO_STRING_SVTOOLS_HTML_S_iuml "iuml" +#define OOO_STRING_SVTOOLS_HTML_S_eth "eth" +#define OOO_STRING_SVTOOLS_HTML_S_ntilde "ntilde" +#define OOO_STRING_SVTOOLS_HTML_S_oacute "oacute" +#define OOO_STRING_SVTOOLS_HTML_S_ograve "ograve" +#define OOO_STRING_SVTOOLS_HTML_S_ocirc "ocirc" +#define OOO_STRING_SVTOOLS_HTML_S_otilde "otilde" +#define OOO_STRING_SVTOOLS_HTML_S_ouml "ouml" +#define OOO_STRING_SVTOOLS_HTML_S_oslash "oslash" +#define OOO_STRING_SVTOOLS_HTML_S_uacute "uacute" +#define OOO_STRING_SVTOOLS_HTML_S_ugrave "ugrave" +#define OOO_STRING_SVTOOLS_HTML_S_ucirc "ucirc" +#define OOO_STRING_SVTOOLS_HTML_S_uuml "uuml" +#define OOO_STRING_SVTOOLS_HTML_S_yacute "yacute" +#define OOO_STRING_SVTOOLS_HTML_S_thorn "thorn" +#define OOO_STRING_SVTOOLS_HTML_S_yuml "yuml" +#define OOO_STRING_SVTOOLS_HTML_S_acute "acute" +#define OOO_STRING_SVTOOLS_HTML_S_brvbar "brvbar" +#define OOO_STRING_SVTOOLS_HTML_S_cedil "cedil" +#define OOO_STRING_SVTOOLS_HTML_S_cent "cent" +#define OOO_STRING_SVTOOLS_HTML_S_copy "copy" +#define OOO_STRING_SVTOOLS_HTML_S_curren "curren" +#define OOO_STRING_SVTOOLS_HTML_S_deg "deg" +#define OOO_STRING_SVTOOLS_HTML_S_divide "divide" +#define OOO_STRING_SVTOOLS_HTML_S_frac12 "frac12" +#define OOO_STRING_SVTOOLS_HTML_S_frac14 "frac14" +#define OOO_STRING_SVTOOLS_HTML_S_frac34 "frac34" +#define OOO_STRING_SVTOOLS_HTML_S_iexcl "iexcl" +#define OOO_STRING_SVTOOLS_HTML_S_iquest "iquest" +#define OOO_STRING_SVTOOLS_HTML_S_laquo "laquo" +#define OOO_STRING_SVTOOLS_HTML_S_macr "macr" +#define OOO_STRING_SVTOOLS_HTML_S_micro "micro" +#define OOO_STRING_SVTOOLS_HTML_S_middot "middot" +#define OOO_STRING_SVTOOLS_HTML_S_nbsp "nbsp" +#define OOO_STRING_SVTOOLS_HTML_S_not "not" +#define OOO_STRING_SVTOOLS_HTML_S_ordf "ordf" +#define OOO_STRING_SVTOOLS_HTML_S_ordm "ordm" +#define OOO_STRING_SVTOOLS_HTML_S_para "para" +#define OOO_STRING_SVTOOLS_HTML_S_plusmn "plusmn" +#define OOO_STRING_SVTOOLS_HTML_S_pound "pound" +#define OOO_STRING_SVTOOLS_HTML_S_raquo "raquo" +#define OOO_STRING_SVTOOLS_HTML_S_reg "reg" +#define OOO_STRING_SVTOOLS_HTML_S_sect "sect" +#define OOO_STRING_SVTOOLS_HTML_S_shy "shy" +#define OOO_STRING_SVTOOLS_HTML_S_sup1 "sup1" +#define OOO_STRING_SVTOOLS_HTML_S_sup2 "sup2" +#define OOO_STRING_SVTOOLS_HTML_S_sup3 "sup3" +#define OOO_STRING_SVTOOLS_HTML_S_times "times" +#define OOO_STRING_SVTOOLS_HTML_S_uml "uml" +#define OOO_STRING_SVTOOLS_HTML_S_yen "yen" + +// HTML4 +#define OOO_STRING_SVTOOLS_HTML_S_alefsym "alefsym" +#define OOO_STRING_SVTOOLS_HTML_S_Alpha "Alpha" +#define OOO_STRING_SVTOOLS_HTML_S_alpha "alpha" +#define OOO_STRING_SVTOOLS_HTML_S_and "and" +#define OOO_STRING_SVTOOLS_HTML_S_ang "ang" +#define OOO_STRING_SVTOOLS_HTML_S_asymp "asymp" +#define OOO_STRING_SVTOOLS_HTML_S_bdquo "bdquo" +#define OOO_STRING_SVTOOLS_HTML_S_Beta "Beta" +#define OOO_STRING_SVTOOLS_HTML_S_beta "beta" +#define OOO_STRING_SVTOOLS_HTML_S_bull "bull" +#define OOO_STRING_SVTOOLS_HTML_S_cap "cap" +#define OOO_STRING_SVTOOLS_HTML_S_chi "chi" +#define OOO_STRING_SVTOOLS_HTML_S_Chi "Chi" +#define OOO_STRING_SVTOOLS_HTML_S_circ "circ" +#define OOO_STRING_SVTOOLS_HTML_S_clubs "clubs" +#define OOO_STRING_SVTOOLS_HTML_S_cong "cong" +#define OOO_STRING_SVTOOLS_HTML_S_crarr "crarr" +#define OOO_STRING_SVTOOLS_HTML_S_cup "cup" +#define OOO_STRING_SVTOOLS_HTML_S_dagger "dagger" +#define OOO_STRING_SVTOOLS_HTML_S_Dagger "Dagger" +#define OOO_STRING_SVTOOLS_HTML_S_darr "darr" +#define OOO_STRING_SVTOOLS_HTML_S_dArr "dArr" +#define OOO_STRING_SVTOOLS_HTML_S_Delta "Delta" +#define OOO_STRING_SVTOOLS_HTML_S_delta "delta" +#define OOO_STRING_SVTOOLS_HTML_S_diams "diams" +#define OOO_STRING_SVTOOLS_HTML_S_empty "empty" +#define OOO_STRING_SVTOOLS_HTML_S_emsp "emsp" +#define OOO_STRING_SVTOOLS_HTML_S_ensp "ensp" +#define OOO_STRING_SVTOOLS_HTML_S_Epsilon "Epsilon" +#define OOO_STRING_SVTOOLS_HTML_S_epsilon "epsilon" +#define OOO_STRING_SVTOOLS_HTML_S_equiv "equiv" +#define OOO_STRING_SVTOOLS_HTML_S_Eta "Eta" +#define OOO_STRING_SVTOOLS_HTML_S_eta "eta" +#define OOO_STRING_SVTOOLS_HTML_S_euro "euro" +#define OOO_STRING_SVTOOLS_HTML_S_exist "exist" +#define OOO_STRING_SVTOOLS_HTML_S_fnof "fnof" +#define OOO_STRING_SVTOOLS_HTML_S_forall "forall" +#define OOO_STRING_SVTOOLS_HTML_S_frasl "frasl" +#define OOO_STRING_SVTOOLS_HTML_S_Gamma "Gamma" +#define OOO_STRING_SVTOOLS_HTML_S_gamma "gamma" +#define OOO_STRING_SVTOOLS_HTML_S_ge "ge" +#define OOO_STRING_SVTOOLS_HTML_S_harr "harr" +#define OOO_STRING_SVTOOLS_HTML_S_hArr "hArr" +#define OOO_STRING_SVTOOLS_HTML_S_hearts "hearts" +#define OOO_STRING_SVTOOLS_HTML_S_hellip "hellip" +#define OOO_STRING_SVTOOLS_HTML_S_image "image" +#define OOO_STRING_SVTOOLS_HTML_S_infin "infin" +#define OOO_STRING_SVTOOLS_HTML_S_int "int" +#define OOO_STRING_SVTOOLS_HTML_S_Iota "Iota" +#define OOO_STRING_SVTOOLS_HTML_S_iota "iota" +#define OOO_STRING_SVTOOLS_HTML_S_isin "isin" +#define OOO_STRING_SVTOOLS_HTML_S_Kappa "Kappa" +#define OOO_STRING_SVTOOLS_HTML_S_kappa "kappa" +#define OOO_STRING_SVTOOLS_HTML_S_Lambda "Lambda" +#define OOO_STRING_SVTOOLS_HTML_S_lambda "lambda" +#define OOO_STRING_SVTOOLS_HTML_S_lang "lang" +#define OOO_STRING_SVTOOLS_HTML_S_larr "larr" +#define OOO_STRING_SVTOOLS_HTML_S_lArr "lArr" +#define OOO_STRING_SVTOOLS_HTML_S_lceil "lceil" +#define OOO_STRING_SVTOOLS_HTML_S_ldquo "ldquo" +#define OOO_STRING_SVTOOLS_HTML_S_le "le" +#define OOO_STRING_SVTOOLS_HTML_S_lfloor "lfloor" +#define OOO_STRING_SVTOOLS_HTML_S_lowast "lowast" +#define OOO_STRING_SVTOOLS_HTML_S_loz "loz" +#define OOO_STRING_SVTOOLS_HTML_S_lrm "lrm" +#define OOO_STRING_SVTOOLS_HTML_S_lsaquo "lsaquo" +#define OOO_STRING_SVTOOLS_HTML_S_lsquo "lsquo" +#define OOO_STRING_SVTOOLS_HTML_S_mdash "mdash" +#define OOO_STRING_SVTOOLS_HTML_S_minus "minus" +#define OOO_STRING_SVTOOLS_HTML_S_Mu "Mu" +#define OOO_STRING_SVTOOLS_HTML_S_mu "mu" +#define OOO_STRING_SVTOOLS_HTML_S_nabla "nabla" +#define OOO_STRING_SVTOOLS_HTML_S_ndash "ndash" +#define OOO_STRING_SVTOOLS_HTML_S_ne "ne" +#define OOO_STRING_SVTOOLS_HTML_S_ni "ni" +#define OOO_STRING_SVTOOLS_HTML_S_notin "notin" +#define OOO_STRING_SVTOOLS_HTML_S_nsub "nsub" +#define OOO_STRING_SVTOOLS_HTML_S_Nu "Nu" +#define OOO_STRING_SVTOOLS_HTML_S_nu "nu" +#define OOO_STRING_SVTOOLS_HTML_S_OElig "OElig" +#define OOO_STRING_SVTOOLS_HTML_S_oelig "oelig" +#define OOO_STRING_SVTOOLS_HTML_S_oline "oline" +#define OOO_STRING_SVTOOLS_HTML_S_Omega "Omega" +#define OOO_STRING_SVTOOLS_HTML_S_omega "omega" +#define OOO_STRING_SVTOOLS_HTML_S_Omicron "Omicron" +#define OOO_STRING_SVTOOLS_HTML_S_omicron "omicron" +#define OOO_STRING_SVTOOLS_HTML_S_oplus "oplus" +#define OOO_STRING_SVTOOLS_HTML_S_or "or" +#define OOO_STRING_SVTOOLS_HTML_S_otimes "otimes" +#define OOO_STRING_SVTOOLS_HTML_S_part "part" +#define OOO_STRING_SVTOOLS_HTML_S_permil "permil" +#define OOO_STRING_SVTOOLS_HTML_S_perp "perp" +#define OOO_STRING_SVTOOLS_HTML_S_Phi "Phi" +#define OOO_STRING_SVTOOLS_HTML_S_phi "phi" +#define OOO_STRING_SVTOOLS_HTML_S_Pi "Pi" +#define OOO_STRING_SVTOOLS_HTML_S_pi "pi" +#define OOO_STRING_SVTOOLS_HTML_S_piv "piv" +#define OOO_STRING_SVTOOLS_HTML_S_prime "prime" +#define OOO_STRING_SVTOOLS_HTML_S_Prime "Prime" +#define OOO_STRING_SVTOOLS_HTML_S_prod "prod" +#define OOO_STRING_SVTOOLS_HTML_S_prop "prop" +#define OOO_STRING_SVTOOLS_HTML_S_Psi "Psi" +#define OOO_STRING_SVTOOLS_HTML_S_psi "psi" +#define OOO_STRING_SVTOOLS_HTML_S_radic "radic" +#define OOO_STRING_SVTOOLS_HTML_S_rang "rang" +#define OOO_STRING_SVTOOLS_HTML_S_rarr "rarr" +#define OOO_STRING_SVTOOLS_HTML_S_rArr "rArr" +#define OOO_STRING_SVTOOLS_HTML_S_rceil "rceil" +#define OOO_STRING_SVTOOLS_HTML_S_rdquo "rdquo" +#define OOO_STRING_SVTOOLS_HTML_S_real "real" +#define OOO_STRING_SVTOOLS_HTML_S_rfloor "rfloor" +#define OOO_STRING_SVTOOLS_HTML_S_Rho "Rho" +#define OOO_STRING_SVTOOLS_HTML_S_rho "rho" +#define OOO_STRING_SVTOOLS_HTML_S_rlm "rlm" +#define OOO_STRING_SVTOOLS_HTML_S_rsaquo "rsaquo" +#define OOO_STRING_SVTOOLS_HTML_S_rsquo "rsquo" +#define OOO_STRING_SVTOOLS_HTML_S_sbquo "sbquo" +#define OOO_STRING_SVTOOLS_HTML_S_Scaron "Scaron" +#define OOO_STRING_SVTOOLS_HTML_S_scaron "scaron" +#define OOO_STRING_SVTOOLS_HTML_S_sdot "sdot" +#define OOO_STRING_SVTOOLS_HTML_S_Sigma "Sigma" +#define OOO_STRING_SVTOOLS_HTML_S_sigma "sigma" +#define OOO_STRING_SVTOOLS_HTML_S_sigmaf "sigmaf" +#define OOO_STRING_SVTOOLS_HTML_S_sim "sim" +#define OOO_STRING_SVTOOLS_HTML_S_spades "spades" +#define OOO_STRING_SVTOOLS_HTML_S_sub "sub" +#define OOO_STRING_SVTOOLS_HTML_S_sube "sube" +#define OOO_STRING_SVTOOLS_HTML_S_sum "sum" +#define OOO_STRING_SVTOOLS_HTML_S_sup "sup" +#define OOO_STRING_SVTOOLS_HTML_S_supe "supe" +#define OOO_STRING_SVTOOLS_HTML_S_Tau "Tau" +#define OOO_STRING_SVTOOLS_HTML_S_tau "tau" +#define OOO_STRING_SVTOOLS_HTML_S_there4 "there4" +#define OOO_STRING_SVTOOLS_HTML_S_Theta "Theta" +#define OOO_STRING_SVTOOLS_HTML_S_theta "theta" +#define OOO_STRING_SVTOOLS_HTML_S_thetasym "thetasym" +#define OOO_STRING_SVTOOLS_HTML_S_thinsp "thinsp" +#define OOO_STRING_SVTOOLS_HTML_S_tilde "tilde" +#define OOO_STRING_SVTOOLS_HTML_S_trade "trade" +#define OOO_STRING_SVTOOLS_HTML_S_uarr "uarr" +#define OOO_STRING_SVTOOLS_HTML_S_uArr "uArr" +#define OOO_STRING_SVTOOLS_HTML_S_upsih "upsih" +#define OOO_STRING_SVTOOLS_HTML_S_Upsilon "Upsilon" +#define OOO_STRING_SVTOOLS_HTML_S_upsilon "upsilon" +#define OOO_STRING_SVTOOLS_HTML_S_weierp "weierp" +#define OOO_STRING_SVTOOLS_HTML_S_Xi "Xi" +#define OOO_STRING_SVTOOLS_HTML_S_xi "xi" +#define OOO_STRING_SVTOOLS_HTML_S_Yuml "Yuml" +#define OOO_STRING_SVTOOLS_HTML_S_Zeta "Zeta" +#define OOO_STRING_SVTOOLS_HTML_S_zeta "zeta" +#define OOO_STRING_SVTOOLS_HTML_S_zwj "zwj" +#define OOO_STRING_SVTOOLS_HTML_S_zwnj "zwnj" + +// HTML attribute tokens (=options) + +// attributes without value +#define OOO_STRING_SVTOOLS_HTML_O_checked "checked" +#define OOO_STRING_SVTOOLS_HTML_O_compact "compact" +#define OOO_STRING_SVTOOLS_HTML_O_declare "declare" +#define OOO_STRING_SVTOOLS_HTML_O_disabled "disabled" +#define OOO_STRING_SVTOOLS_HTML_O_ismap "ismap" +#define OOO_STRING_SVTOOLS_HTML_O_mayscript "mayscript" +#define OOO_STRING_SVTOOLS_HTML_O_multiple "multiple" +#define OOO_STRING_SVTOOLS_HTML_O_nohref "nohref" +#define OOO_STRING_SVTOOLS_HTML_O_noresize "noresize" +#define OOO_STRING_SVTOOLS_HTML_O_noshade "noshade" +#define OOO_STRING_SVTOOLS_HTML_O_nowrap "nowrap" +#define OOO_STRING_SVTOOLS_HTML_O_sdfixed "sdfixed" +#define OOO_STRING_SVTOOLS_HTML_O_selected "selected" + +// attributes with a string as value +#define OOO_STRING_SVTOOLS_HTML_O_accesskey "accesskey" +#define OOO_STRING_SVTOOLS_HTML_O_accept "accept" +#define OOO_STRING_SVTOOLS_HTML_O_alt "alt" +#define OOO_STRING_SVTOOLS_HTML_O_axis "axis" +#define OOO_STRING_SVTOOLS_HTML_O_char "char" +#define OOO_STRING_SVTOOLS_HTML_O_charset "charset" +#define OOO_STRING_SVTOOLS_HTML_O_class "class" +#define OOO_STRING_SVTOOLS_HTML_O_code "code" +#define OOO_STRING_SVTOOLS_HTML_O_codetype "codetype" +#define OOO_STRING_SVTOOLS_HTML_O_content "content" +#define OOO_STRING_SVTOOLS_HTML_O_coords "coords" +#define OOO_STRING_SVTOOLS_HTML_O_enctype "enctype" +#define OOO_STRING_SVTOOLS_HTML_O_face "face" +#define OOO_STRING_SVTOOLS_HTML_O_frameborder "frameborder" +#define OOO_STRING_SVTOOLS_HTML_O_httpequiv "http-equiv" +#define OOO_STRING_SVTOOLS_HTML_O_language "language" +#define OOO_STRING_SVTOOLS_HTML_O_name "name" +#define OOO_STRING_SVTOOLS_HTML_O_prompt "prompt" +#define OOO_STRING_SVTOOLS_HTML_O_shape "shape" +#define OOO_STRING_SVTOOLS_HTML_O_standby "standby" +#define OOO_STRING_SVTOOLS_HTML_O_style "style" +#define OOO_STRING_SVTOOLS_HTML_O_title "title" +#define OOO_STRING_SVTOOLS_HTML_O_value "value" +#define OOO_STRING_SVTOOLS_HTML_O_SDval "sdval" +#define OOO_STRING_SVTOOLS_HTML_O_SDnum "sdnum" +#define OOO_STRING_SVTOOLS_HTML_O_sdlibrary "sdlibrary" +#define OOO_STRING_SVTOOLS_HTML_O_sdmodule "sdmodule" +#define OOO_STRING_SVTOOLS_HTML_O_sdevent "sdevent-" +#define OOO_STRING_SVTOOLS_HTML_O_sdaddparam "sdaddparam-" + +// attributes with an SGML identifier as value +#define OOO_STRING_SVTOOLS_HTML_O_id "id" +#define OOO_STRING_SVTOOLS_HTML_O_target "target" +#define OOO_STRING_SVTOOLS_HTML_O_to "to" + +// attributes with a URI as value +#define OOO_STRING_SVTOOLS_HTML_O_action "action" +#define OOO_STRING_SVTOOLS_HTML_O_archive "archive" +#define OOO_STRING_SVTOOLS_HTML_O_background "background" +#define OOO_STRING_SVTOOLS_HTML_O_classid "classid" +#define OOO_STRING_SVTOOLS_HTML_O_codebase "codebase" +#define OOO_STRING_SVTOOLS_HTML_O_data "data" +#define OOO_STRING_SVTOOLS_HTML_O_href "href" +#define OOO_STRING_SVTOOLS_HTML_O_script "script" +#define OOO_STRING_SVTOOLS_HTML_O_src "src" +#define OOO_STRING_SVTOOLS_HTML_O_usemap "usemap" + +// attributes with a colour as value (all Netscape) +#define OOO_STRING_SVTOOLS_HTML_O_alink "alink" +#define OOO_STRING_SVTOOLS_HTML_O_bgcolor "bgcolor" +#define OOO_STRING_SVTOOLS_HTML_O_bordercolor "bordercolor" +#define OOO_STRING_SVTOOLS_HTML_O_bordercolorlight "bordercolorlight" +#define OOO_STRING_SVTOOLS_HTML_O_bordercolordark "bordercolordark" +#define OOO_STRING_SVTOOLS_HTML_O_color "color" +#define OOO_STRING_SVTOOLS_HTML_O_link "link" +#define OOO_STRING_SVTOOLS_HTML_O_text "text" +#define OOO_STRING_SVTOOLS_HTML_O_vlink "vlink" + +// attributes with a numerical value +#define OOO_STRING_SVTOOLS_HTML_O_border "border" +#define OOO_STRING_SVTOOLS_HTML_O_cellspacing "cellspacing" +#define OOO_STRING_SVTOOLS_HTML_O_cellpadding "cellpadding" +#define OOO_STRING_SVTOOLS_HTML_O_charoff "charoff" +#define OOO_STRING_SVTOOLS_HTML_O_colspan "colspan" +#define OOO_STRING_SVTOOLS_HTML_O_framespacing "framespacing" +#define OOO_STRING_SVTOOLS_HTML_O_gutter "gutter" +#define OOO_STRING_SVTOOLS_HTML_O_height "height" +#define OOO_STRING_SVTOOLS_HTML_O_hspace "hspace" +#define OOO_STRING_SVTOOLS_HTML_O_left "left" +#define OOO_STRING_SVTOOLS_HTML_O_loop "loop" +#define OOO_STRING_SVTOOLS_HTML_O_marginheight "marginheight" +#define OOO_STRING_SVTOOLS_HTML_O_marginwidth "marginwidth" +#define OOO_STRING_SVTOOLS_HTML_O_maxlength "maxlength" +#define OOO_STRING_SVTOOLS_HTML_O_rowspan "rowspan" +#define OOO_STRING_SVTOOLS_HTML_O_scrollamount "scrollamount" +#define OOO_STRING_SVTOOLS_HTML_O_scrolldelay "scrolldelay" +#define OOO_STRING_SVTOOLS_HTML_O_span "span" +#define OOO_STRING_SVTOOLS_HTML_O_tabindex "tabindex" +#define OOO_STRING_SVTOOLS_HTML_O_vspace "vspace" +#define OOO_STRING_SVTOOLS_HTML_O_width "width" +#define OOO_STRING_SVTOOLS_HTML_O_zindex "z-index" + +// attributes with enum values +#define OOO_STRING_SVTOOLS_HTML_O_behavior "behavior" +#define OOO_STRING_SVTOOLS_HTML_O_clear "clear" +#define OOO_STRING_SVTOOLS_HTML_O_dir "dir" +#define OOO_STRING_SVTOOLS_HTML_O_direction "direction" +#define OOO_STRING_SVTOOLS_HTML_O_format "format" +#define OOO_STRING_SVTOOLS_HTML_O_frame "frame" +#define OOO_STRING_SVTOOLS_HTML_O_lang "lang" +#define OOO_STRING_SVTOOLS_XHTML_O_lang "xml:lang" +#define OOO_STRING_SVTOOLS_HTML_O_method "method" +#define OOO_STRING_SVTOOLS_HTML_O_rel "rel" +#define OOO_STRING_SVTOOLS_HTML_O_rev "rev" +#define OOO_STRING_SVTOOLS_HTML_O_rules "rules" +#define OOO_STRING_SVTOOLS_HTML_O_scrolling "scrolling" +#define OOO_STRING_SVTOOLS_HTML_O_sdreadonly "readonly" +#define OOO_STRING_SVTOOLS_HTML_O_subtype "subtype" +#define OOO_STRING_SVTOOLS_HTML_O_type "type" +#define OOO_STRING_SVTOOLS_HTML_O_valign "valign" +#define OOO_STRING_SVTOOLS_HTML_O_valuetype "valuetype" +#define OOO_STRING_SVTOOLS_HTML_O_wrap "wrap" + +// attributes with script code as value +#define OOO_STRING_SVTOOLS_HTML_O_onblur "onblur" +#define OOO_STRING_SVTOOLS_HTML_O_onchange "onchange" +#define OOO_STRING_SVTOOLS_HTML_O_onclick "onclick" +#define OOO_STRING_SVTOOLS_HTML_O_onfocus "onfocus" +#define OOO_STRING_SVTOOLS_HTML_O_onload "onload" +#define OOO_STRING_SVTOOLS_HTML_O_onmouseover "onmouseover" +#define OOO_STRING_SVTOOLS_HTML_O_onreset "onreset" +#define OOO_STRING_SVTOOLS_HTML_O_onselect "onselect" +#define OOO_STRING_SVTOOLS_HTML_O_onsubmit "onsubmit" +#define OOO_STRING_SVTOOLS_HTML_O_onunload "onunload" +#define OOO_STRING_SVTOOLS_HTML_O_onabort "onabort" +#define OOO_STRING_SVTOOLS_HTML_O_onerror "onerror" +#define OOO_STRING_SVTOOLS_HTML_O_onmouseout "onmouseout" +#define OOO_STRING_SVTOOLS_HTML_O_SDonblur "sdonblur" +#define OOO_STRING_SVTOOLS_HTML_O_SDonchange "sdonchange" +#define OOO_STRING_SVTOOLS_HTML_O_SDonclick "sdonclick" +#define OOO_STRING_SVTOOLS_HTML_O_SDonfocus "sdonfocus" +#define OOO_STRING_SVTOOLS_HTML_O_SDonload "sdonload" +#define OOO_STRING_SVTOOLS_HTML_O_SDonmouseover "sdonmouseover" +#define OOO_STRING_SVTOOLS_HTML_O_SDonreset "sdonreset" +#define OOO_STRING_SVTOOLS_HTML_O_SDonselect "sdonselect" +#define OOO_STRING_SVTOOLS_HTML_O_SDonsubmit "sdonsubmit" +#define OOO_STRING_SVTOOLS_HTML_O_SDonunload "sdonunload" +#define OOO_STRING_SVTOOLS_HTML_O_SDonabort "sdonabort" +#define OOO_STRING_SVTOOLS_HTML_O_SDonerror "sdonerror" +#define OOO_STRING_SVTOOLS_HTML_O_SDonmouseout "sdonmouseout" + +// attributes with context-dependent values +#define OOO_STRING_SVTOOLS_HTML_O_align "align" +#define OOO_STRING_SVTOOLS_HTML_O_cols "cols" +#define OOO_STRING_SVTOOLS_HTML_O_rows "rows" +#define OOO_STRING_SVTOOLS_HTML_O_start "start" +#define OOO_STRING_SVTOOLS_HTML_O_size "size" + +// values of <INPUT TYPE=...> +#define OOO_STRING_SVTOOLS_HTML_IT_text "text" +#define OOO_STRING_SVTOOLS_HTML_IT_password "password" +#define OOO_STRING_SVTOOLS_HTML_IT_checkbox "checkbox" +#define OOO_STRING_SVTOOLS_HTML_IT_radio "radio" +#define OOO_STRING_SVTOOLS_HTML_IT_range "range" +#define OOO_STRING_SVTOOLS_HTML_IT_scribble "scribble" +#define OOO_STRING_SVTOOLS_HTML_IT_file "file" +#define OOO_STRING_SVTOOLS_HTML_IT_hidden "hidden" +#define OOO_STRING_SVTOOLS_HTML_IT_submit "submit" +#define OOO_STRING_SVTOOLS_HTML_IT_image "image" +#define OOO_STRING_SVTOOLS_HTML_IT_reset "reset" +#define OOO_STRING_SVTOOLS_HTML_IT_button "button" + +// values of <TABLE FRAME=...> +#define OOO_STRING_SVTOOLS_HTML_TF_void "void" +#define OOO_STRING_SVTOOLS_HTML_TF_above "above" +#define OOO_STRING_SVTOOLS_HTML_TF_below "below" +#define OOO_STRING_SVTOOLS_HTML_TF_hsides "hsides" +#define OOO_STRING_SVTOOLS_HTML_TF_lhs "lhs" +#define OOO_STRING_SVTOOLS_HTML_TF_rhs "rhs" +#define OOO_STRING_SVTOOLS_HTML_TF_vsides "vsides" +#define OOO_STRING_SVTOOLS_HTML_TF_box "box" +#define OOO_STRING_SVTOOLS_HTML_TF_border "border" + +// values of <TABLE RULES=...> +#define OOO_STRING_SVTOOLS_HTML_TR_none "none" +#define OOO_STRING_SVTOOLS_HTML_TR_groups "groups" +#define OOO_STRING_SVTOOLS_HTML_TR_rows "rows" +#define OOO_STRING_SVTOOLS_HTML_TR_cols "cols" +#define OOO_STRING_SVTOOLS_HTML_TR_all "all" + +// values of <P, H?, TR, TH, TD ALIGN=...> +#define OOO_STRING_SVTOOLS_HTML_AL_left "left" +#define OOO_STRING_SVTOOLS_HTML_AL_center "center" +#define OOO_STRING_SVTOOLS_HTML_AL_middle "middle" +#define OOO_STRING_SVTOOLS_HTML_AL_right "right" +#define OOO_STRING_SVTOOLS_HTML_AL_justify "justify" +#define OOO_STRING_SVTOOLS_HTML_AL_char "char" +#define OOO_STRING_SVTOOLS_HTML_AL_all "all" + +// values of <TR VALIGN=...>, <IMG ALIGN=...> +#define OOO_STRING_SVTOOLS_HTML_VA_top "top" +#define OOO_STRING_SVTOOLS_HTML_VA_middle "middle" +#define OOO_STRING_SVTOOLS_HTML_VA_bottom "bottom" +#define OOO_STRING_SVTOOLS_HTML_VA_baseline "baseline" +#define OOO_STRING_SVTOOLS_HTML_VA_texttop "texttop" +#define OOO_STRING_SVTOOLS_HTML_VA_absmiddle "absmiddle" +#define OOO_STRING_SVTOOLS_HTML_VA_absbottom "absbottom" + +// values of <AREA SHAPE=...> +#define OOO_STRING_SVTOOLS_HTML_SH_rect "rect" +#define OOO_STRING_SVTOOLS_HTML_SH_rectangle "rectangle" +#define OOO_STRING_SVTOOLS_HTML_SH_circ "circ" +#define OOO_STRING_SVTOOLS_HTML_SH_circle "circle" +#define OOO_STRING_SVTOOLS_HTML_SH_poly "poly" +#define OOO_STRING_SVTOOLS_HTML_SH_polygon "polygon" + +#define OOO_STRING_SVTOOLS_HTML_LG_starbasic "starbasic" +#define OOO_STRING_SVTOOLS_HTML_LG_javascript "javascript" +#define OOO_STRING_SVTOOLS_HTML_LG_javascript11 "javascript1.1" +#define OOO_STRING_SVTOOLS_HTML_LG_livescript "livescript" + +// a few values for StarBASIC-Support +#define OOO_STRING_SVTOOLS_HTML_SB_library "$LIBRARY:" +#define OOO_STRING_SVTOOLS_HTML_SB_module "$MODULE:" + +// values of <FORM METHOD=...> +#define OOO_STRING_SVTOOLS_HTML_METHOD_get "get" +#define OOO_STRING_SVTOOLS_HTML_METHOD_post "post" + +// values of <META CONTENT/HTTP-EQUIV=...> +#define OOO_STRING_SVTOOLS_HTML_META_refresh "refresh" +#define OOO_STRING_SVTOOLS_HTML_META_generator "generator" +#define OOO_STRING_SVTOOLS_HTML_META_author "author" +#define OOO_STRING_SVTOOLS_HTML_META_classification "classification" +#define OOO_STRING_SVTOOLS_HTML_META_description "description" +#define OOO_STRING_SVTOOLS_HTML_META_keywords "keywords" +#define OOO_STRING_SVTOOLS_HTML_META_changed "changed" +#define OOO_STRING_SVTOOLS_HTML_META_changedby "changedby" +#define OOO_STRING_SVTOOLS_HTML_META_created "created" +#define OOO_STRING_SVTOOLS_HTML_META_content_type "content-type" +#define OOO_STRING_SVTOOLS_HTML_META_content_script_type "content-script-type" +#define OOO_STRING_SVTOOLS_HTML_META_sdendnote "sdendnote" +#define OOO_STRING_SVTOOLS_HTML_META_sdfootnote "sdfootnote" + +// values of <UL TYPE=...> +#define OOO_STRING_SVTOOLS_HTML_ULTYPE_disc "disc" +#define OOO_STRING_SVTOOLS_HTML_ULTYPE_square "square" +#define OOO_STRING_SVTOOLS_HTML_ULTYPE_circle "circle" + +// values of <MARQUEE BEHAVIOUR=...> +#define OOO_STRING_SVTOOLS_HTML_BEHAV_scroll "scroll" +#define OOO_STRING_SVTOOLS_HTML_BEHAV_slide "slide" +#define OOO_STRING_SVTOOLS_HTML_BEHAV_alternate "alternate" + +// values of <MARQUEE LOOP=...> +#define OOO_STRING_SVTOOLS_HTML_LOOP_infinite "infinite" +#define OOO_STRING_SVTOOLS_HTML_SPTYPE_block "block" +#define OOO_STRING_SVTOOLS_HTML_SPTYPE_horizontal "horizontal" +#define OOO_STRING_SVTOOLS_HTML_SPTYPE_vertical "vertical" + +// internal graphics names +#define OOO_STRING_SVTOOLS_HTML_private_image "private:image/" +#define OOO_STRING_SVTOOLS_HTML_internal_icon "internal-icon-" +#define OOO_STRING_SVTOOLS_HTML_INT_ICON_baddata "baddata" +#define OOO_STRING_SVTOOLS_HTML_INT_ICON_delayed "delayed" +#define OOO_STRING_SVTOOLS_HTML_INT_ICON_embed "embed" +#define OOO_STRING_SVTOOLS_HTML_INT_ICON_insecure "insecure" +#define OOO_STRING_SVTOOLS_HTML_INT_ICON_notfound "notfound" +#define OOO_STRING_SVTOOLS_HTML_sdendnote "sdendnote" +#define OOO_STRING_SVTOOLS_HTML_sdendnote_anc "sdendnoteanc" +#define OOO_STRING_SVTOOLS_HTML_sdendnote_sym "sdendnotesym" +#define OOO_STRING_SVTOOLS_HTML_sdfootnote "sdfootnote" +#define OOO_STRING_SVTOOLS_HTML_sdfootnote_anc "sdfootnoteanc" +#define OOO_STRING_SVTOOLS_HTML_sdfootnote_sym "sdfootnotesym" +#define OOO_STRING_SVTOOLS_HTML_FTN_anchor "anc" +#define OOO_STRING_SVTOOLS_HTML_FTN_symbol "sym" +#define OOO_STRING_SVTOOLS_HTML_WW_off "off" +#define OOO_STRING_SVTOOLS_HTML_WW_hard "hard" +#define OOO_STRING_SVTOOLS_HTML_WW_soft "soft" +#define OOO_STRING_SVTOOLS_HTML_WW_virtual "virtual" +#define OOO_STRING_SVTOOLS_HTML_WW_physical "physical" +#define OOO_STRING_SVTOOLS_HTML_on "on" +#define OOO_STRING_SVTOOLS_HTML_ET_url "application/x-www-form-urlencoded" +#define OOO_STRING_SVTOOLS_HTML_ET_multipart "multipart/form-data" +#define OOO_STRING_SVTOOLS_HTML_ET_text "text/plain" + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/htmlout.hxx b/include/svtools/htmlout.hxx new file mode 100644 index 000000000..7543f7335 --- /dev/null +++ b/include/svtools/htmlout.hxx @@ -0,0 +1,113 @@ +/* -*- 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_SVTOOLS_HTMLOUT_HXX +#define INCLUDED_SVTOOLS_HTMLOUT_HXX + +#include <svtools/svtdllapi.h> +#include <tools/solar.h> +#include <rtl/textenc.h> +#include <rtl/string.hxx> +#include <svl/macitem.hxx> + +class Color; +class ImageMap; +class HtmlWriter; +class SvStream; +class SvNumberFormatter; + +struct HTMLOutEvent +{ + const char *pBasicName; + const char *pJavaName; + SvMacroItemId nEvent; +}; + +struct SVT_DLLPUBLIC HTMLOutContext +{ + rtl_TextEncoding m_eDestEnc; + rtl_TextToUnicodeConverter m_hConv; + rtl_TextToUnicodeContext m_hContext; + + HTMLOutContext( rtl_TextEncoding eDestEnc ); + ~HTMLOutContext(); +}; + +struct HTMLOutFuncs +{ + SVT_DLLPUBLIC static OString ConvertStringToHTML( const OUString& sSrc, + rtl_TextEncoding eDestEnc, + OUString *pNonConvertableChars ); + + SVT_DLLPUBLIC static SvStream& Out_AsciiTag( SvStream&, const OString& rStr, + bool bOn = true); + SVT_DLLPUBLIC static SvStream& Out_Char( SvStream&, sal_uInt32 cChar, + HTMLOutContext& rContext, + OUString *pNonConvertableChars ); + SVT_DLLPUBLIC static SvStream& Out_String( SvStream&, const OUString&, + rtl_TextEncoding eDestEnc, + OUString *pNonConvertableChars = nullptr ); + SVT_DLLPUBLIC static SvStream& Out_Hex( SvStream&, sal_uLong nHex, sal_uInt8 nLen ); + SVT_DLLPUBLIC static SvStream& Out_Color( SvStream&, const Color&, bool bXHTML = false ); + SVT_DLLPUBLIC static SvStream& Out_ImageMap( SvStream&, const OUString&, const ImageMap&, const OUString&, + const HTMLOutEvent *pEventTable, + bool bOutStarBasic, + const char *pDelim, + const char *pIndentArea, + const char *pIndentMap, + rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252, + OUString *pNonConvertableChars = nullptr ); + SVT_DLLPUBLIC static SvStream& FlushToAscii( SvStream&, HTMLOutContext& rContext ); + + SVT_DLLPUBLIC static SvStream& OutScript( SvStream& rStrm, + const OUString& rBaseURL, + const OUString& rSource, + const OUString& rLanguage, + ScriptType eScriptType, + const OUString& rSrc, + const OUString *pSBLibrary, + const OUString *pSBModule, + rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252, + OUString *pNonConvertableChars = nullptr ); + + // the 3rd parameter is an array of HTMLOutEvents which is terminated + // by an entry that consists only of 0s + SVT_DLLPUBLIC static SvStream& Out_Events( SvStream&, const SvxMacroTableDtor&, + const HTMLOutEvent*, bool bOutStarBasic, + rtl_TextEncoding eDestEnc, + OUString *pNonConvertableChars ); + + // <TD SDVAL="..." SDNUM="..."> + SVT_DLLPUBLIC static OString CreateTableDataOptionsValNum( + bool bValue, double fVal, sal_uLong nFormat, + SvNumberFormatter& rFormatter, + rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252, + OUString *pNonConvertableChars = nullptr); + SVT_DLLPUBLIC static bool PrivateURLToInternalImg( OUString& rURL ); +}; + +struct HtmlWriterHelper +{ + SVT_DLLPUBLIC static void applyColor( HtmlWriter& rHtmlWriter, const OString &aAttributeName, const Color& rColor); + SVT_DLLPUBLIC static void applyEvents(HtmlWriter& rHtmlWriter, const SvxMacroTableDtor& rMacroTable, const HTMLOutEvent* pEventTable, bool bOutStarBasic); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/htmltokn.h b/include/svtools/htmltokn.h new file mode 100644 index 000000000..a3374a37e --- /dev/null +++ b/include/svtools/htmltokn.h @@ -0,0 +1,479 @@ +/* -*- 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_SVTOOLS_HTMLTOKN_H +#define INCLUDED_SVTOOLS_HTMLTOKN_H + +#include <svtools/svtdllapi.h> +#include <sal/types.h> +#include <stdexcept> + +namespace rtl { + class OUString; +}; +enum class HtmlOptionId; +enum class HtmlTokenId : sal_Int16; + +// search the char for the CharName +sal_Unicode GetHTMLCharName( const rtl::OUString& rName ); + +// search the TokenID for the token +SVT_DLLPUBLIC HtmlTokenId GetHTMLToken( const rtl::OUString& rName ); + +// search the TokenId for an attribute token +HtmlOptionId GetHTMLOption( const rtl::OUString& rName ); + +// search the 24-bit color for a color name (not found = ULONG_MAX) +SVT_DLLPUBLIC sal_uInt32 GetHTMLColor( const rtl::OUString& rName ); + +enum class HtmlTokenId : sal_Int16 +{ + INVALID = -1, + NONE = 0, +// always starting from 256 on, greater than a char + TEXTTOKEN = 0x100, + SINGLECHAR, + NEWPARA, + TABCHAR, + RAWDATA, + LINEFEEDCHAR, + + // these will only be turned on + AREA, // Netscape 2.0 + BASE, // HTML 3.0 + COMMENT, + DOCTYPE, + EMBED, // Netscape 2.0 ignore </EMBED> + HORZRULE, // ignore </HR> + IMAGE, // ignore </IMG> + INPUT, // ignore </INPUT> + LINEBREAK, // </BR> -> <BR> + LINK, // HTML 3.0 + META, // HTML 3.0 ignore </META> + OPTION, // ignore </OPTION> + PARAM, // HotJava + SPACER, // Netscape 3.0b5 // ignore </SPACER> + + // tokens recognised using HTML character + NONBREAKSPACE, + SOFTHYPH, + + // these will be turned back off, + // the off value is always located behind (+1) !! + ONOFF_START, + ABBREVIATION_ON = ONOFF_START, // HTML 3.0 + ABBREVIATION_OFF, // HTML 3.0 + ACRONYM_ON, // HTML 3.0 + ACRONYM_OFF, // HTML 3.0 + ADDRESS_ON, + ADDRESS_OFF, + ANCHOR_ON, + ANCHOR_OFF, + APPLET_ON, // HotJava + APPLET_OFF, // HotJava + AUTHOR_ON, // HTML 3.0 + AUTHOR_OFF, // HTML 3.0 + BANNER_ON, // HTML 3.0 + BANNER_OFF, // HTML 3.0 + BASEFONT_ON, // Netscape + BASEFONT_OFF, // Netscape + BIGPRINT_ON, // HTML 3.0 + BIGPRINT_OFF, // HTML 3.0 + BLINK_ON, // Netscape + BLINK_OFF, // Netscape + BLOCKQUOTE30_ON, // HTML 3.0 + BLOCKQUOTE30_OFF, // HTML 3.0 + BLOCKQUOTE_ON, + BLOCKQUOTE_OFF, + BODY_ON, + BODY_OFF, + BOLD_ON, + BOLD_OFF, + CAPTION_ON, // HTML 3.0 + CAPTION_OFF, // HTML 3.0 + CENTER_ON, // Netscape + CENTER_OFF, // Netscape + CITIATION_ON, + CITIATION_OFF, + CODE_ON, + CODE_OFF, + COL_ON, // HTML3 Table Model Draft + COL_OFF, // HTML3 Table Model Draft + COLGROUP_ON, // HTML3 Table Model Draft + COLGROUP_OFF, // HTML3 Table Model Draft + CREDIT_ON, // HTML 3.0 + CREDIT_OFF, // HTML 3.0 + DD_ON, + DD_OFF, + DEFLIST_ON, + DEFLIST_OFF, + DELETEDTEXT_ON, // HTML 3.0 + DELETEDTEXT_OFF, // HTML 3.0 + DIRLIST_ON, + DIRLIST_OFF, + DIVISION_ON, // HTML 3.0 + DIVISION_OFF, // HTML 3.0 + DT_ON, + DT_OFF, + EMPHASIS_ON, + EMPHASIS_OFF, + FIGURE_ON, // HTML 3.0 + FIGURE_OFF, // HTML 3.0 + FONT_ON, // Netscape + FONT_OFF, // Netscape + FOOTNOTE_ON, // HTML 3.0 + FOOTNOTE_OFF, // HTML 3.0 + FORM_ON, + FORM_OFF, + FRAME_ON, // Netscape 2.0 + FRAME_OFF, // Netscape 2.0 + FRAMESET_ON, // Netscape 2.0 + FRAMESET_OFF, // Netscape 2.0 + HEAD1_ON, + HEAD1_OFF, + HEAD2_ON, + HEAD2_OFF, + HEAD3_ON, + HEAD3_OFF, + HEAD4_ON, + HEAD4_OFF, + HEAD5_ON, + HEAD5_OFF, + HEAD6_ON, + HEAD6_OFF, + HEAD_ON, + HEAD_OFF, + HTML_ON, + HTML_OFF, + IFRAME_ON, // IE 3.0b2 + IFRAME_OFF, // IE 3.0b2 + INSERTEDTEXT_ON, // HTML 3.0 + INSERTEDTEXT_OFF, // HTML 3.0 + ITALIC_ON, + ITALIC_OFF, + KEYBOARD_ON, + KEYBOARD_OFF, + LANGUAGE_ON, // HTML 3.0 + LANGUAGE_OFF, // HTML 3.0 + LISTHEADER_ON, // HTML 3.0 + LISTHEADER_OFF, // HTML 3.0 + LI_ON, + LI_OFF, + MAP_ON, // Netscape 2.0 + MAP_OFF, // Netscape 2.0 + MENULIST_ON, + MENULIST_OFF, + MULTICOL_ON, // Netscape 3.0b5 + MULTICOL_OFF, // Netscape 3.0b5 + NOBR_ON, // Netscape + NOBR_OFF, // Netscape + NOEMBED_ON, // Netscape 2.0 + NOEMBED_OFF, // Netscape 2.0 + NOFRAMES_ON, // Netscape 2.0 + NOFRAMES_OFF, // Netscape 2.0 + NOSCRIPT_ON, // Netscape 2.0 + NOSCRIPT_OFF, // Netscape 3.0 + NOTE_ON, // HTML 3.0 + NOTE_OFF, // HTML 3.0 + OBJECT_ON, // HotJava + OBJECT_OFF, // HotJava + ORDERLIST_ON, + ORDERLIST_OFF, + PARABREAK_ON, + PARABREAK_OFF, + PERSON_ON, // HTML 3.0 + PERSON_OFF, // HTML 3.0 + PLAINTEXT_ON, // HTML 3.0 + PLAINTEXT_OFF, // HTML 3.0 + PREFORMTXT_ON, + PREFORMTXT_OFF, + SAMPLE_ON, + SAMPLE_OFF, + SCRIPT_ON, // HTML 3.2 + SCRIPT_OFF, // HTML 3.2 + SELECT_ON, + SELECT_OFF, + SHORTQUOTE_ON, // HTML 3.0 + SHORTQUOTE_OFF, // HTML 3.0 + SMALLPRINT_ON, // HTML 3.0 + SMALLPRINT_OFF, // HTML 3.0 + SPAN_ON, // Style Sheets + SPAN_OFF, // Style Sheets + STRIKETHROUGH_ON, // HTML 3.0 + STRIKETHROUGH_OFF, // HTML 3.0 + STRONG_ON, + STRONG_OFF, + STYLE_ON, // HTML 3.0 + STYLE_OFF, // HTML 3.0 + SUBSCRIPT_ON, // HTML 3.0 + SUBSCRIPT_OFF, // HTML 3.0 + SUPERSCRIPT_ON, // HTML 3.0 + SUPERSCRIPT_OFF, // HTML 3.0 + TABLE_ON, // HTML 3.0 + TABLE_OFF, // HTML 3.0 + TABLEDATA_ON, // HTML 3.0 + TABLEDATA_OFF, // HTML 3.0 + TABLEHEADER_ON, // HTML 3.0 + TABLEHEADER_OFF, // HTML 3.0 + TABLEROW_ON, // HTML 3.0 + TABLEROW_OFF, // HTML 3.0 + TBODY_ON, // HTML3 Table Model Draft + TBODY_OFF, // HTML3 Table Model Draft + TELETYPE_ON, + TELETYPE_OFF, + TEXTAREA_ON, + TEXTAREA_OFF, + TFOOT_ON, // HTML3 Table Model Draft + TFOOT_OFF, // HTML3 Table Model Draft + THEAD_ON, // HTML3 Table Model Draft + THEAD_OFF, // HTML3 Table Model Draft + TITLE_ON, + TITLE_OFF, + UNDERLINE_ON, + UNDERLINE_OFF, + UNORDERLIST_ON, + UNORDERLIST_OFF, + VARIABLE_ON, + VARIABLE_OFF, + + // obsolete features + XMP_ON, + XMP_OFF, + LISTING_ON, + LISTING_OFF, + + // proposed features + DEFINSTANCE_ON, + DEFINSTANCE_OFF, + STRIKE_ON, + STRIKE_OFF, + + UNKNOWNCONTROL_ON, + UNKNOWNCONTROL_OFF, + + // Microsoft features + COMMENT2_ON, // HTML 2.0 ? + COMMENT2_OFF, // HTML 2.0 ? + MARQUEE_ON, + MARQUEE_OFF, + PLAINTEXT2_ON, // HTML 2.0 ? + PLAINTEXT2_OFF, // HTML 2.0 ? + + SDFIELD_ON, + SDFIELD_OFF +}; + +constexpr bool isOffToken(HtmlTokenId nToken) +{ + return (nToken == HtmlTokenId::NONE || nToken >= HtmlTokenId::ONOFF_START) + ? (1 & static_cast<int>(nToken)) + : throw std::logic_error("Assertion failed!"); // C++11 does not do assert in constexpr +} + +constexpr HtmlTokenId getOnToken(HtmlTokenId nToken) +{ + return (nToken == HtmlTokenId::NONE || nToken >= HtmlTokenId::ONOFF_START) + ? HtmlTokenId(~1 & static_cast<int>(nToken)) + : throw std::logic_error("Assertion failed!"); // C++11 does not do assert in constexpr +} + +// HTML attribute token (=Options) + +enum class HtmlOptionId +{ +// always starting from 256 on, greater than a char +BOOL_START = 0x100, + +// attributes without value + CHECKED = BOOL_START, + COMPACT, + DECLARE, // IExplorer 3.0b5 + DISABLED, + ISMAP, + MAYSCRIPT, // Netscape 3.0 + MULTIPLE, + NOHREF, // Netscape + NORESIZE, // Netscape 2.0 + NOSHADE, // Netscape + NOWRAP, + SDFIXED, + SELECTED, +BOOL_END, + +// attributes with a string as value +STRING_START = BOOL_END, + ACCEPT = STRING_START, + ACCESSKEY, + ALT, + AXIS, + CHAR, // HTML3 Table Model Draft + CHARSET, + CLASS, + CODE, // HotJava + CODETYPE, + CONTENT, + COORDS, // Netscape 2.0 + ENCTYPE, + FACE, // IExplorer 2.0 + FRAMEBORDER, // IExplorer 3.0 + HTTPEQUIV, + LANGUAGE, // JavaScript + NAME, + PROMPT, + SHAPE, + STANDBY, + STYLE, // Style Sheets + TITLE, + VALUE, + SDVAL, // StarDiv NumberValue + SDNUM, // StarDiv NumberFormat + SDLIBRARY, + SDMODULE, +STRING_END, + +// attributes with an SGML identifier as value +SGMLID_START = STRING_END, + ID = SGMLID_START, + TARGET, // Netscape 2.0 + TO, +SGMLID_END, + +// attributes with a URI as value +URI_START = SGMLID_END, + ACTION = URI_START, + ARCHIVE, + BACKGROUND, + CLASSID, + CODEBASE, // HotJava + DATA, + HREF, + SCRIPT, + SRC, + USEMAP, // Netscape 2.0 +URI_END, + +// attributes with a color as value (all Netscape) +COLOR_START = URI_END, + ALINK = COLOR_START, + BGCOLOR, + BORDERCOLOR, // IExplorer 2.0 + BORDERCOLORLIGHT, // IExplorer 2.0 + BORDERCOLORDARK, // IExplorer 2.0 + COLOR, + LINK, + TEXT, + VLINK, +COLOR_END, + +// attributes with a numeric value +NUMBER_START = COLOR_END, + BORDER = NUMBER_START, + CELLSPACING, // HTML3 Table Model Draft + CELLPADDING, // HTML3 Table Model Draft + CHAROFF, // HTML3 Table Model Draft + COLSPAN, + FRAMESPACING, // IExplorer 3.0 + GUTTER, // Netscape 3.0b5 + HEIGHT, + HSPACE, // Netscape + LEFT, + LOOP, // IExplorer 2.0 + MARGINWIDTH, // Netscape 2.0 + MARGINHEIGHT, // Netscape 2.0 + MAXLENGTH, + ROWSPAN, + SCROLLAMOUNT, // IExplorer 2.0 + SCROLLDELAY, // IExplorer 2.0 + SPAN, // HTML3 Table Model Draft + TABINDEX, + VSPACE, // Netscape + WIDTH, + ZINDEX, +NUMBER_END, + +// attributes with Enum values +ENUM_START = NUMBER_END, + BEHAVIOR = ENUM_START, // IExplorer 2.0 + CLEAR, + DIR, + DIRECTION, // IExplorer 2.0 + FORMAT, + FRAME, // HTML3 Table Model Draft + LANG, + METHOD, + REL, + REV, + RULES, // HTML3 Table Model Draft + SCROLLING, // Netscape 2.0 + SDREADONLY, + SUBTYPE, + TYPE, + VALIGN, + VALUETYPE, + WRAP, +ENUM_END, + +// attributes with script code as value +SCRIPT_START = ENUM_END, + ONABORT = SCRIPT_START, // JavaScript + ONBLUR, // JavaScript + ONCHANGE, // JavaScript + ONCLICK, // JavaScript + ONERROR, // JavaScript + ONFOCUS, // JavaScript + ONLOAD, // JavaScript + ONMOUSEOUT, // JavaScript + ONMOUSEOVER, // JavaScript + ONRESET, // JavaScript + ONSELECT, // JavaScript + ONSUBMIT, // JavaScript + ONUNLOAD, // JavaScript + + SDONABORT, // StarBasic + SDONBLUR, // StarBasic + SDONCHANGE, // StarBasic + SDONCLICK, // StarBasic + SDONERROR, // StarBasic + SDONFOCUS, // StarBasic + SDONLOAD, // StarBasic + SDONMOUSEOUT, // StarBasic + SDONMOUSEOVER, // StarBasic + SDONRESET, // StarBasic + SDONSELECT, // StarBasic + SDONSUBMIT, // StarBasic + SDONUNLOAD, // StarBasic +SCRIPT_END, + +// attributes with context dependent values +CONTEXT_START = SCRIPT_END, + ALIGN = CONTEXT_START, + COLS, // Netscape 2.0 vs HTML 2.0 + ROWS, // Netscape 2.0 vs HTML 2.0 + SIZE, + START, +CONTEXT_END, + +// an unknown option +UNKNOWN = CONTEXT_END, +END +}; + +#endif // INCLUDED_SVTOOLS_HTMLTOKN_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/imagemgr.hxx b/include/svtools/imagemgr.hxx new file mode 100644 index 000000000..d66fade75 --- /dev/null +++ b/include/svtools/imagemgr.hxx @@ -0,0 +1,136 @@ +/* -*- 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_SVTOOLS_IMAGEMGR_HXX +#define INCLUDED_SVTOOLS_IMAGEMGR_HXX + +#include <rtl/ustring.hxx> +#include <svtools/svtdllapi.h> +#include <tools/gen.hxx> +#include <vcl/vclenum.hxx> + +enum class SvImageId { + NONE = 0, + START = 3076, // must match to old Id's in SFX! + + Impress = START + 47, + Bitmap = START + 49, + Calc = START + 50, + CalcTemplate = START + 51, + Database = START + 53, + ImpressTemplate = START + 54, + GIF = START + 61, + HTML = START + 63, + JPG = START + 64, + Math = START + 68, + MathTemplate = START + 69, + File = START + 74, + PCD = START + 76, + PCT = START + 77, + PCX = START + 78, + SIM = START + 79, + TextFile = START + 80, + TIFF = START + 82, + WMF = START + 84, + Writer = START + 86, + WriterTemplate = START + 87, + FixedDevice = START + 88, + RemoveableDevice = START + 89, + CDRomDevice = START + 90, + NetworkDevice = START + 91, + Table = START + 112, + Folder = START + 113, + DXF = START + 141, + MET = START + 142, + PNG = START + 143, + //retired SGF = START + 144, + //retired SGV = START + 145, + SVM = START + 146, + GlobalDoc = START + 150, + Draw = START + 151, + DrawTemplate = START + 152, + OO_DatabaseDoc = START + 169, + OO_DrawDoc = START + 170, + OO_MathDoc = START + 171, + OO_GlobalDoc = START + 172, + OO_ImpressDoc = START + 173, + OO_CalcDoc = START + 174, + OO_WriterDoc = START + 175, + OO_DrawTemplate = START + 176, + OO_ImpressTemplate = START + 177, + OO_CalcTemplate = START + 178, + OO_WriterTemplate = START + 179, + Extension = START + 180, +}; + + +class Image; +class INetURLObject; + +namespace svtools { + +struct VolumeInfo +{ + bool m_bIsVolume; + bool m_bIsRemote; + bool m_bIsRemoveable; + bool m_bIsFloppy; + bool m_bIsCompactDisc; + + VolumeInfo() : + m_bIsVolume ( false ), + m_bIsRemote ( false ), + m_bIsRemoveable ( false ), + m_bIsFloppy ( false ), + m_bIsCompactDisc( false ) {} + + VolumeInfo( bool _bIsVolume, + bool _bIsRemote, + bool _bIsRemoveable, + bool _bIsFloppy, + bool _bIsCompactDisc ) : + m_bIsVolume ( _bIsVolume ), + m_bIsRemote ( _bIsRemote ), + m_bIsRemoveable ( _bIsRemoveable ), + m_bIsFloppy ( _bIsFloppy ), + m_bIsCompactDisc( _bIsCompactDisc ) {} +}; + +} + +class SvFileInformationManager +{ +private: + static OUString GetDescription_Impl( const INetURLObject& rObject, bool bDetectFolder ); + +public: + SVT_DLLPUBLIC static OUString GetImageId( const INetURLObject& rURL, bool bBig = false ); + SVT_DLLPUBLIC static Image GetImage( const INetURLObject& rURL, bool bBig = false, Size const & rPreferredSize = Size()); + SVT_DLLPUBLIC static OUString GetFileImageId( const INetURLObject& rURL ); + SVT_DLLPUBLIC static Image GetImageNoDefault(const INetURLObject& rURL, vcl::ImageType eImageType = vcl::ImageType::Small); + SVT_DLLPUBLIC static OUString GetFolderImageId( const svtools::VolumeInfo& rInfo ); + + SVT_DLLPUBLIC static OUString GetDescription( const INetURLObject& rObject ); + SVT_DLLPUBLIC static OUString GetFileDescription( const INetURLObject& rObject ); + SVT_DLLPUBLIC static OUString GetFolderDescription( const svtools::VolumeInfo& rInfo ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/imageresourceaccess.hxx b/include/svtools/imageresourceaccess.hxx new file mode 100644 index 000000000..86dd259a2 --- /dev/null +++ b/include/svtools/imageresourceaccess.hxx @@ -0,0 +1,70 @@ +/* -*- 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_SVTOOLS_IMAGERESOURCEACCESS_HXX +#define INCLUDED_SVTOOLS_IMAGERESOURCEACCESS_HXX + +#include <config_options.h> +#include <svtools/svtdllapi.h> + +#include <com/sun/star/uno/Reference.hxx> + +namespace com :: sun :: star :: io { class XInputStream; } +namespace com :: sun :: star :: uno { class XComponentContext; } + +class SvStream; + +namespace svt +{ +namespace GraphicAccess +{ + +/** Helpers for obtaining streams (which also can be used with the ImageProducer) + from a resource. +*/ + +/** determines whether the given URL denotes an image within a resource */ +UNLESS_MERGELIBS(SVT_DLLPUBLIC) bool isSupportedURL(OUString const & rURL); + +/** for a given URL of an image within a resource, this method retrieves an + SvStream for this image. + + This method works for arbitrary URLs denoting an image, since the + css::graphics::GraphicsProvider service is used + to resolve the URL. However, obtaining the stream is expensive (since + the image must be copied), so you are strongly encouraged to only use it + when you know that the image is small enough. +*/ +UNLESS_MERGELIBS(SVT_DLLPUBLIC) std::unique_ptr<SvStream> getImageStream( + css::uno::Reference<css::uno::XComponentContext> const & rxContext, + OUString const & rImageResourceURL); + +/** for a given URL of an image within a resource, this method retrieves + a css::io::XInputStream for this image. +*/ +UNLESS_MERGELIBS(SVT_DLLPUBLIC) css::uno::Reference<css::io::XInputStream> getImageXStream( + css::uno::Reference<css::uno::XComponentContext> const & rxContext, + OUString const & rImageResourceURL); + +} // namespace GraphicAccess +} // namespace svt + +#endif // INCLUDED_SVTOOLS_IMAGERESOURCEACCESS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/imgdef.hxx b/include/svtools/imgdef.hxx new file mode 100644 index 000000000..308fd2722 --- /dev/null +++ b/include/svtools/imgdef.hxx @@ -0,0 +1,33 @@ +/* -*- 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_SVTOOLS_IMGDEF_HXX +#define INCLUDED_SVTOOLS_IMGDEF_HXX + +enum SfxSymbolsSize +{ + SFX_SYMBOLS_SIZE_SMALL = 0, + SFX_SYMBOLS_SIZE_LARGE = 1, + SFX_SYMBOLS_SIZE_32 = 3, // keep the numbers as they are written into the profile + SFX_SYMBOLS_SIZE_AUTO = 2, +}; + +#endif // INCLUDED_SVTOOLS_IMGDEF_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/indexentryres.hxx b/include/svtools/indexentryres.hxx new file mode 100644 index 000000000..800ee906e --- /dev/null +++ b/include/svtools/indexentryres.hxx @@ -0,0 +1,55 @@ +/* -*- 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_SVTOOLS_INDEXENTRYRES_HXX +#define INCLUDED_SVTOOLS_INDEXENTRYRES_HXX + +#include <svtools/svtdllapi.h> +#include <rtl/ustring.hxx> +#include <vector> + +class SVT_DLLPUBLIC IndexEntryResource +{ +private: + // wrapper for locale specific translations data of indexentry algorithm + class IndexEntryResourceData + { + friend class IndexEntryResource; + private: + OUString m_aName; + OUString m_aTranslation; + public: + IndexEntryResourceData(const OUString& rAlgorithm, const OUString& rTranslation) + : m_aName(rAlgorithm) + , m_aTranslation(rTranslation) + { + } + const OUString& GetAlgorithm () const { return m_aName; } + const OUString& GetTranslation () const { return m_aTranslation; } + }; + std::vector<IndexEntryResourceData> m_aData; +public: + IndexEntryResource(); + const OUString& GetTranslation(const OUString& rAlgorithm); +}; + +#endif // INCLUDED_SVTOOLS_INDEXENTRYRES_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/inettbc.hxx b/include/svtools/inettbc.hxx new file mode 100644 index 000000000..57439cf3e --- /dev/null +++ b/include/svtools/inettbc.hxx @@ -0,0 +1,110 @@ +/* -*- 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_SVTOOLS_INETTBC_HXX +#define INCLUDED_SVTOOLS_INETTBC_HXX + +#include <memory> +#include <rtl/ref.hxx> +#include <svtools/svtdllapi.h> +#include <tools/urlobj.hxx> + +#include <vcl/idle.hxx> +#include <vcl/weld.hxx> + +class SvtMatchContext_Impl; +class SvtURLBox_Impl; + +class SVT_DLLPUBLIC SvtURLBox +{ + friend class SvtMatchContext_Impl; + friend class SvtURLBox_Impl; + + Idle aChangedIdle; + OUString aBaseURL; + OUString aPlaceHolder; + rtl::Reference<SvtMatchContext_Impl> pCtx; + std::unique_ptr<SvtURLBox_Impl> pImpl; + INetProtocol eSmartProtocol; + bool bOnlyDirectories : 1; + bool bHistoryDisabled : 1; + bool bNoSelection : 1; + + Link<weld::ComboBox&, void> aChangeHdl; + Link<weld::Widget&, void> aFocusInHdl; + Link<weld::Widget&, void> aFocusOutHdl; + + std::unique_ptr<weld::ComboBox> m_xWidget; + + DECL_DLLPRIVATE_LINK( TryAutoComplete, Timer*, void); + SVT_DLLPRIVATE void UpdatePicklistForSmartProtocol_Impl(); + DECL_DLLPRIVATE_LINK( ChangedHdl, weld::ComboBox&, void); + DECL_DLLPRIVATE_LINK( FocusInHdl, weld::Widget&, void); + DECL_DLLPRIVATE_LINK( FocusOutHdl, weld::Widget&, void); + SVT_DLLPRIVATE void Init(); + +public: + SvtURLBox(std::unique_ptr<weld::ComboBox> xWidget); + ~SvtURLBox(); + + void set_entry_text(const OUString& rStr) { m_xWidget->set_entry_text(rStr); } + void show() { m_xWidget->show(); } + void clear() { m_xWidget->clear(); } + void connect_entry_activate(const Link<weld::ComboBox&, bool>& rLink) { m_xWidget->connect_entry_activate(rLink); } + void connect_key_press(const Link<const KeyEvent&, bool>& rLink) { m_xWidget->connect_key_press(rLink); } + void connect_changed(const Link<weld::ComboBox&, void>& rLink) { aChangeHdl = rLink; } + void trigger_changed() { aChangeHdl.Call(*m_xWidget); } + void connect_focus_in(const Link<weld::Widget&, void>& rLink) { aFocusInHdl = rLink; } + void connect_focus_out(const Link<weld::Widget&, void>& rLink) { aFocusOutHdl = rLink; } + void append_text(const OUString& rStr) { m_xWidget->append_text(rStr); } + int find_text(const OUString& rStr) const { return m_xWidget->find_text(rStr); } + OUString get_active_text() const { return m_xWidget->get_active_text(); } + void grab_focus() { m_xWidget->grab_focus(); } + void set_sensitive(bool bSensitive) { m_xWidget->set_sensitive(bSensitive); } + void set_help_id(const OString& rHelpId) { m_xWidget->set_help_id(rHelpId); } + void select_entry_region(int nStartPos, int nEndPos) { m_xWidget->select_entry_region(nStartPos, nEndPos); } + Size get_preferred_size() const { return m_xWidget->get_preferred_size(); } + + void EnableAutocomplete(bool bEnable = true) { m_xWidget->set_entry_completion(bEnable); } + void SetBaseURL( const OUString& rURL ); + const OUString& GetBaseURL() const { return aBaseURL; } + void SetOnlyDirectories( bool bDir ); + void SetNoURLSelection( bool bSet ); + void SetSmartProtocol( INetProtocol eProt ); + INetProtocol GetSmartProtocol() const { return eSmartProtocol; } + OUString GetURL(); + void DisableHistory(); + + weld::ComboBox* getWidget() { return m_xWidget.get(); } + + static OUString ParseSmart( const OUString& aText, const OUString& aBaseURL ); + + void SetPlaceHolder(const OUString& sPlaceHolder) { aPlaceHolder = sPlaceHolder; } + const OUString& GetPlaceHolder() const { return aPlaceHolder; } + bool MatchesPlaceHolder(const OUString& sToMatch) const + { + return (!aPlaceHolder.isEmpty() && aPlaceHolder == sToMatch); + } + + void SetFilter(const OUString& _sFilter); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/insdlg.hxx b/include/svtools/insdlg.hxx new file mode 100644 index 000000000..041588f6f --- /dev/null +++ b/include/svtools/insdlg.hxx @@ -0,0 +1,74 @@ +/* -*- 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_SVTOOLS_INSDLG_HXX +#define INCLUDED_SVTOOLS_INSDLG_HXX + +#include <svtools/svtdllapi.h> +#include <tools/globname.hxx> +#include <sot/formats.hxx> + +#include <vector> +#include <vcl/transfer.hxx> + +class SvObjectServer +{ +private: + SvGlobalName aClassName; + OUString aHumanName; + +public: + SvObjectServer( const SvGlobalName & rClassP, const OUString & rHumanP ) : + aClassName( rClassP ), + aHumanName( rHumanP ) {} + + const SvGlobalName & GetClassName() const { return aClassName; } + const OUString & GetHumanName() const { return aHumanName; } +}; + +class SVT_DLLPUBLIC SvObjectServerList +{ +private: + std::vector< SvObjectServer > aObjectServerList; + +public: + const SvObjectServer * Get( const OUString & rHumanName ) const; + const SvObjectServer * Get( const SvGlobalName & ) const; + void Remove( const SvGlobalName & ); + void FillInsertObjects(); + size_t Count() const + { + return aObjectServerList.size(); + } + + const SvObjectServer& operator[]( size_t n ) const + { + return aObjectServerList[ n ]; + } +}; + +class SVT_DLLPUBLIC SvPasteObjectHelper +{ +public: + static OUString GetSotFormatUIName( SotClipboardFormatId nId ); + static bool GetEmbeddedName(const TransferableDataHelper& rData, OUString& _rName, OUString& _rSource, SotClipboardFormatId const & _nFormat); +}; + +#endif // INCLUDED_SVTOOLS_INSDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/javacontext.hxx b/include/svtools/javacontext.hxx new file mode 100644 index 000000000..c34c555bb --- /dev/null +++ b/include/svtools/javacontext.hxx @@ -0,0 +1,72 @@ +/* -*- 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_SVTOOLS_JAVACONTEXT_HXX +#define INCLUDED_SVTOOLS_JAVACONTEXT_HXX + +#include <svtools/svtdllapi.h> + +#include <com/sun/star/uno/XCurrentContext.hpp> + + +namespace com :: sun :: star :: task { class XInteractionHandler; } + +namespace svt +{ +// We cannot derive from cppu::WeakImplHelper because we would export the inline +//generated class. This conflicts with other libraries if they use the same inline +//class. + class SVT_DLLPUBLIC JavaContext final : + public css::uno::XCurrentContext + { + + public: + /** A message box is + only displayed once for a recurring Java error. That is only + the first time JavaInteractionHandler.handle is called with a + particular Request then the message box is shown. Afterwards + nothing happens. + */ + JavaContext( const css::uno::Reference< css::uno::XCurrentContext> & ctx ); + virtual ~JavaContext(); + + // XInterface + virtual css::uno::Any SAL_CALL queryInterface( + const css::uno::Type& aType ) override; + + virtual void SAL_CALL acquire() throw () override; + + virtual void SAL_CALL release() throw () override; + + // XCurrentContext + virtual css::uno::Any SAL_CALL getValueByName( const OUString& Name ) override; + + private: + JavaContext(JavaContext const &) = delete; + JavaContext& operator = (JavaContext const &) = delete; + + oslInterlockedCount m_aRefCount; + css::uno::Reference< css::uno::XCurrentContext > m_xNextContext; + css::uno::Reference< css::task::XInteractionHandler> m_xHandler; + }; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/javainteractionhandler.hxx b/include/svtools/javainteractionhandler.hxx new file mode 100644 index 000000000..5fbff61ff --- /dev/null +++ b/include/svtools/javainteractionhandler.hxx @@ -0,0 +1,65 @@ +/* -*- 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_SVTOOLS_JAVAINTERACTIONHANDLER_HXX +#define INCLUDED_SVTOOLS_JAVAINTERACTIONHANDLER_HXX + +#include <svtools/svtdllapi.h> +#include <sal/types.h> + +#include <com/sun/star/task/XInteractionHandler.hpp> + +namespace com :: sun :: star :: task { class XInteractionRequest; } + +#define JAVA_INTERACTION_HANDLER_NAME "java-vm.interaction-handler" + +namespace svt +{ +// We cannot derive from cppu::WeakImplHelper because we would export the inline +//generated class. This conflicts with other libraries if they use the same inline +//class. + +class SVT_DLLPUBLIC JavaInteractionHandler final : + public css::task::XInteractionHandler +{ +public: + JavaInteractionHandler(); + + // XInterface + virtual css::uno::Any SAL_CALL queryInterface( + const css::uno::Type& aType ) override; + + virtual void SAL_CALL acquire() throw() override; + + virtual void SAL_CALL release() throw() override; + + // XCurrentContext + virtual void SAL_CALL handle( const css::uno::Reference< css::task::XInteractionRequest >& Request ) override; + +private: + oslInterlockedCount m_aRefCount; + JavaInteractionHandler(JavaInteractionHandler const&) = delete; + JavaInteractionHandler& operator = (JavaInteractionHandler const &) = delete; + SVT_DLLPRIVATE virtual ~JavaInteractionHandler(); +}; +} + +#endif // _DESKTOP_JAVAINTERACTION_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/langhelp.hxx b/include/svtools/langhelp.hxx new file mode 100644 index 000000000..248c559b6 --- /dev/null +++ b/include/svtools/langhelp.hxx @@ -0,0 +1,32 @@ +/* -*- 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/. + */ + +#ifndef INCLUDED_SVTOOLS_LANGHELP_HXX +#define INCLUDED_SVTOOLS_LANGHELP_HXX + +#include <svtools/svtdllapi.h> + +#include <com/sun/star/uno/Sequence.hxx> + +#include <rtl/ustring.hxx> + +/** Localize a URI to one of the foundation's webservices + + @param io_rURI + URI to localize - depending on your UI locale, a country local + part is appended to the URI (like "en", or "fr", or "es") + */ +SVT_DLLPUBLIC void localizeWebserviceURI( OUString& io_rURI ); + +OUString SVT_DLLPUBLIC getInstalledLocaleForLanguage(css::uno::Sequence<OUString> const & installed, OUString const & locale); +OUString SVT_DLLPUBLIC getInstalledLocaleForSystemUILanguage(css::uno::Sequence<OUString> const & installed, bool bRequestInstallIfMissing, const OUString& rPreferredLocale = OUString()); + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/langtab.hxx b/include/svtools/langtab.hxx new file mode 100644 index 000000000..9038fb24d --- /dev/null +++ b/include/svtools/langtab.hxx @@ -0,0 +1,49 @@ +/* -*- 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_SVTOOLS_LANGTAB_HXX +#define INCLUDED_SVTOOLS_LANGTAB_HXX + +#include <i18nlangtag/lang.h> +#include <rtl/ustring.hxx> +#include <svtools/svtdllapi.h> + +class LanguageTag; + +class SVT_DLLPUBLIC SvtLanguageTable +{ +public: + + static bool HasLanguageType( const LanguageType eType ); + static OUString GetLanguageString( const LanguageType eType ); + static LanguageType GetLanguageType( const OUString& rStr ); + static sal_uInt32 GetLanguageEntryCount(); + static LanguageType GetLanguageTypeAtIndex( sal_uInt32 nIndex ); + + /** Add a language tag to the table. + */ + static sal_uInt32 AddLanguageTag( const LanguageTag& rLanguageTag ); +}; + +// Add LRE or RLE embedding characters to the string based on the +// String content (see #i78466#, #i32179#) +SVT_DLLPUBLIC OUString ApplyLreOrRleEmbedding( const OUString &rText ); + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/menuoptions.hxx b/include/svtools/menuoptions.hxx new file mode 100644 index 000000000..9db1fe281 --- /dev/null +++ b/include/svtools/menuoptions.hxx @@ -0,0 +1,91 @@ +/* -*- 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_SVTOOLS_MENUOPTIONS_HXX +#define INCLUDED_SVTOOLS_MENUOPTIONS_HXX + +#include <svtools/svtdllapi.h> +#include <sal/types.h> +#include <tools/gen.hxx> +#include <unotools/options.hxx> +#include <memory> + +namespace osl { class Mutex; } + +/*-************************************************************************************************************ + @short forward declaration to our private date container implementation + @descr We use these class as internal member to support small memory requirements. + You can create the container if it is necessary. The class which use these mechanism + is faster and smaller then a complete implementation! +*//*-*************************************************************************************************************/ + +class SvtMenuOptions_Impl; + +/*-************************************************************************************************************ + @short collect information about menu features + @devstatus ready to use +*//*-*************************************************************************************************************/ + +class SAL_WARN_UNUSED SVT_DLLPUBLIC SvtMenuOptions final : public utl::detail::Options +{ + public: + SvtMenuOptions(); + virtual ~SvtMenuOptions() override; + + /*-**************************************************************************************************** + @short interface methods to get and set value of config key "org.openoffice.Office.Common/View/Menu/..." + @descr These options describe internal states to enable/disable features of installed office. + + IsEntryHidingEnabled() + SetEntryHidingState() => Activate this field for viewing all deactivated menu entries. + Menu commands that are normally not necessary are hidden by default. + Default=false + + IsFollowMouseEnabled() + SetFollowMouseState() => Automatic selection while moving the mouse on a menu. + Default=true + + @seealso configuration package "org.openoffice.Office.Common/View/Menu" + *//*-*****************************************************************************************************/ + + bool IsEntryHidingEnabled() const; + TriState GetMenuIconsState() const; + void SetMenuIconsState(TriState eState); + TriState GetContextMenuShortcuts() const; + void SetContextMenuShortcuts(TriState eState); + + private: + + /*-**************************************************************************************************** + @short return a reference to a static mutex + @descr These class is partially threadsafe (for de-/initialization only). + All access methods aren't safe! + We create a static mutex only for one ime and use at different times. + @return A reference to a static mutex member. + *//*-*****************************************************************************************************/ + + SVT_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex(); + + private: + std::shared_ptr<SvtMenuOptions_Impl> m_pImpl; + +}; // class SvtMenuOptions + +#endif // #ifndef INCLUDED_SVTOOLS_MENUOPTIONS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/miscopt.hxx b/include/svtools/miscopt.hxx new file mode 100644 index 000000000..d981d8a28 --- /dev/null +++ b/include/svtools/miscopt.hxx @@ -0,0 +1,114 @@ +/* -*- 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_SVTOOLS_MISCOPT_HXX +#define INCLUDED_SVTOOLS_MISCOPT_HXX + +#include <svtools/svtdllapi.h> +#include <sal/types.h> +#include <rtl/ustring.hxx> +#include <unotools/options.hxx> +#include <memory> + +namespace osl { class Mutex; } +template <typename Arg, typename Ret> class Link; +class LinkParamNone; + +/*-************************************************************************************************************ + @short forward declaration to our private date container implementation + @descr We use these class as internal member to support small memory requirements. + You can create the container if it is necessary. The class which use these mechanism + is faster and smaller then a complete implementation! +*//*-*************************************************************************************************************/ + +class SvtMiscOptions_Impl; +enum class ToolBoxButtonSize; + +/*-************************************************************************************************************ + @short collect information about misc group + @ATTENTION This class is partially threadsafe. + + @devstatus ready to use +*//*-*************************************************************************************************************/ + +class SVT_DLLPUBLIC SvtMiscOptions final : public utl::detail::Options +{ + public: + SvtMiscOptions(); + virtual ~SvtMiscOptions() override; + + void AddListenerLink( const Link<LinkParamNone*,void>& rLink ); + void RemoveListenerLink( const Link<LinkParamNone*,void>& rLink ); + + bool UseSystemFileDialog() const; + void SetUseSystemFileDialog( bool bSet ); + bool IsUseSystemFileDialogReadOnly() const; + + bool DisableUICustomization() const; + + bool IsPluginsEnabled() const; + + sal_Int16 GetSymbolsSize() const; + void SetSymbolsSize( sal_Int16 eSet ); + ToolBoxButtonSize GetSidebarIconSize() const; + void SetSidebarIconSize( ToolBoxButtonSize eSet ); + ToolBoxButtonSize GetNotebookbarIconSize() const; + void SetNotebookbarIconSize( ToolBoxButtonSize eSet ); + sal_Int16 GetCurrentSymbolsSize() const; + bool AreCurrentSymbolsLarge() const; + + OUString GetIconTheme() const; + void SetIconTheme(const OUString&); + bool IconThemeWasSetAutomatically(); + + sal_Int16 GetToolboxStyle() const; + void SetToolboxStyle( sal_Int16 nStyle ); + + bool UseSystemPrintDialog() const; + void SetUseSystemPrintDialog( bool bSet ); + + bool ShowLinkWarningDialog() const; + void SetShowLinkWarningDialog( bool bSet ); + bool IsShowLinkWarningDialogReadOnly() const; + + void SetExperimentalMode( bool bSet ); + bool IsExperimentalMode() const; + + void SetMacroRecorderMode( bool bSet ); + bool IsMacroRecorderMode() const; + + private: + + /*-**************************************************************************************************** + @short return a reference to a static mutex + @descr These class is partially threadsafe (for de-/initialization only). + All access methods aren't safe! + We create a static mutex only for one ime and use at different times. + @return A reference to a static mutex member. + *//*-*****************************************************************************************************/ + + SVT_DLLPRIVATE static ::osl::Mutex& GetInitMutex(); + + private: + std::shared_ptr<SvtMiscOptions_Impl> m_pImpl; + +}; // class SvtMiscOptions + +#endif // #ifndef INCLUDED_SVTOOLS_MISCOPT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/openfiledroptargetlistener.hxx b/include/svtools/openfiledroptargetlistener.hxx new file mode 100644 index 000000000..1565ce3c8 --- /dev/null +++ b/include/svtools/openfiledroptargetlistener.hxx @@ -0,0 +1,78 @@ +/* -*- 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_SVTOOLS_OPENFILEDROPTARGETLISTENER_HXX +#define INCLUDED_SVTOOLS_OPENFILEDROPTARGETLISTENER_HXX + +#include <config_options.h> +#include <svtools/svtdllapi.h> + +#include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp> + +#include <cppuhelper/implbase.hxx> +#include <cppuhelper/weakref.hxx> + +#include <sot/exchange.hxx> + +namespace com :: sun :: star :: frame { class XFrame; } + +namespace com::sun::star::uno { + class XComponentContext; +} + +/** DropTargetListener that takes care of opening a file when it is dropped in the frame. +*/ +class UNLESS_MERGELIBS(SVT_DLLPUBLIC) OpenFileDropTargetListener final : public cppu::WeakImplHelper< css::datatransfer::dnd::XDropTargetListener > +{ + private: + /// uno service manager to create necessary services + css::uno::Reference< css::uno::XComponentContext > m_xContext; + + /// weakreference to target frame (Don't use a hard reference. Owner can't delete us then!) + css::uno::WeakReference< css::frame::XFrame > m_xTargetFrame; + + /// drag/drop info + DataFlavorExVector m_aFormats; + + public: + OpenFileDropTargetListener( const css::uno::Reference< css::uno::XComponentContext >& xContext, + const css::uno::Reference< css::frame::XFrame >& xFrame ); + virtual ~OpenFileDropTargetListener() override; + + public: + // XEventListener + virtual void SAL_CALL disposing ( const css::lang::EventObject& Source ) override; + + // XDropTargetListener + virtual void SAL_CALL drop ( const css::datatransfer::dnd::DropTargetDropEvent& dtde ) override; + virtual void SAL_CALL dragEnter ( const css::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) override; + virtual void SAL_CALL dragExit ( const css::datatransfer::dnd::DropTargetEvent& dte ) override; + virtual void SAL_CALL dragOver ( const css::datatransfer::dnd::DropTargetDragEvent& dtde ) override; + virtual void SAL_CALL dropActionChanged( const css::datatransfer::dnd::DropTargetDragEvent& dtde ) override; + + private: + void implts_BeginDrag( const css::uno::Sequence< css::datatransfer::DataFlavor >& rSupportedDataFlavors ); + void implts_EndDrag(); + bool implts_IsDropFormatSupported( SotClipboardFormatId nFormat ); + void implts_OpenFile( const OUString& rFilePath ); +}; + +#endif // INCLUDED_SVTOOLS_OPENFILEDROPTARGETLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/optionsdrawinglayer.hxx b/include/svtools/optionsdrawinglayer.hxx new file mode 100644 index 000000000..762b2545e --- /dev/null +++ b/include/svtools/optionsdrawinglayer.hxx @@ -0,0 +1,138 @@ +/* -*- 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_SVTOOLS_OPTIONSDRAWINGLAYER_HXX +#define INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX + +#include <svtools/svtdllapi.h> +#include <sal/types.h> +#include <tools/color.hxx> +#include <memory> + +namespace osl { class Mutex; } + +/*-************************************************************************************************************ + @short forward declaration to our private date container implementation + @descr We use these class as internal member to support small memory requirements. + You can create the container if it is necessary. The class which use these mechanism + is faster and smaller then a complete implementation! +*//*-*************************************************************************************************************/ + +class SvtOptionsDrawinglayer_Impl; + +/*-************************************************************************************************************ + @short collect information about startup features + @devstatus ready to use +*//*-*************************************************************************************************************/ + +class SVT_DLLPUBLIC SvtOptionsDrawinglayer +{ + public: + + SvtOptionsDrawinglayer(); + ~SvtOptionsDrawinglayer(); + + /*-**************************************************************************************************** + @short interface methods to get and set value of config key "org.openoffice.Office.Common/Drawinglayer/..." + @descr These options describe internal states to enable/disable features of installed office. + + IsOverlayBuffer() + SetOverlayBuffer() => Activate this field for letting Overlay use a buffer + + IsPaintBuffer() + SetPaintBuffer() => Activate this field for letting Paint use a prerender buffer + + GetStripeColorA() + SetStripeColorA() => Set first of two colors which overlay uses to draw stripes + + GetStripeColorB() + SetStripeColorB() => Set second of two colors which overlay uses to draw stripes + + GetStripeLength() + SetStripeLength() => Set length of a single stripe in pixels + + @seealso configuration package "org.openoffice.Office.Common/Drawinglayer" + *//*-*****************************************************************************************************/ + + bool IsOverlayBuffer() const; + bool IsPaintBuffer() const; + Color GetStripeColorA() const; + Color GetStripeColorB() const; + sal_uInt16 GetStripeLength() const; + + // #i73602# + bool IsOverlayBuffer_Calc() const; + bool IsOverlayBuffer_Writer() const; + bool IsOverlayBuffer_DrawImpress() const; + + // #i74769#, #i75172# + bool IsPaintBuffer_Calc() const; + bool IsPaintBuffer_Writer() const; + bool IsPaintBuffer_DrawImpress() const; + + // #i4219# + sal_uInt32 GetMaximumPaperWidth() const; + sal_uInt32 GetMaximumPaperHeight() const; + sal_uInt32 GetMaximumPaperLeftMargin() const; + sal_uInt32 GetMaximumPaperRightMargin() const; + sal_uInt32 GetMaximumPaperTopMargin() const; + sal_uInt32 GetMaximumPaperBottomMargin() const; + + // #i95644# helper to check if AA is allowed on this system. Currently, for WIN it's disabled + // and OutDevSupportType::TransparentRect is checked (this hits XRenderExtension, e.g. + // currently for SunRay as long as not supported there) + bool IsAAPossibleOnThisSystem() const; + + // primitives + bool IsAntiAliasing() const; + bool IsSnapHorVerLinesToDiscrete() const; + bool IsSolidDragCreate() const; + bool IsRenderDecoratedTextDirect() const; + bool IsRenderSimpleTextDirect() const; + sal_uInt32 GetQuadratic3DRenderLimit() const; + sal_uInt32 GetQuadraticFormControlRenderLimit() const; + + void SetAntiAliasing( bool bState ); + + // #i97672# selection settings + bool IsTransparentSelection() const; + sal_uInt16 GetTransparentSelectionPercent() const; + sal_uInt16 GetSelectionMaximumLuminancePercent() const; + + // get system highlight color, limited to the maximum allowed luminance + // (defined in GetSelectionMaximumLuminancePercent() in SvtOptionsDrawinglayer, + // combined with Application::GetSettings().GetStyleSettings().GetHighlightColor()) + Color getHilightColor() const; + + private: + + /*-**************************************************************************************************** + @short return a reference to a static mutex + @descr These class use his own static mutex to be threadsafe. + We create a static mutex only for one ime and use at different times. + @return A reference to a static mutex member. + *//*-*****************************************************************************************************/ + SVT_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex(); + + std::shared_ptr<SvtOptionsDrawinglayer_Impl> m_pImpl; +}; + +#endif // #ifndef INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/parhtml.hxx b/include/svtools/parhtml.hxx new file mode 100644 index 000000000..1c9392d2d --- /dev/null +++ b/include/svtools/parhtml.hxx @@ -0,0 +1,295 @@ +/* -*- 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_SVTOOLS_PARHTML_HXX +#define INCLUDED_SVTOOLS_PARHTML_HXX + +#include <svtools/svtdllapi.h> +#include <svtools/svparser.hxx> +#include <svtools/htmltokn.h> + +#include <vector> + +namespace com :: sun :: star :: uno { template <class interface_type> class Reference; } + +namespace com::sun::star { + namespace document { + class XDocumentProperties; + } +} + +class Color; +enum class HtmlOptionId; + +#define HTMLFONTSZ1_DFLT 7 +#define HTMLFONTSZ2_DFLT 10 +#define HTMLFONTSZ3_DFLT 12 +#define HTMLFONTSZ4_DFLT 14 +#define HTMLFONTSZ5_DFLT 18 +#define HTMLFONTSZ6_DFLT 24 +#define HTMLFONTSZ7_DFLT 36 + +enum class HTMLTableFrame { Void, Above, Below, HSides, LHS, RHS, VSides, Box }; + +enum class HTMLTableRules { NONE, Groups, Rows, Cols, All }; + +enum class HTMLInputType +{ + Text = 1, + Password, + Checkbox, + Radio, + Range, + Scribble, + File, + Hidden, + Submit, + Image, + Reset, + Button +}; + +enum class HTMLScriptLanguage +{ + StarBasic, + JavaScript, + Unknown +}; + +template<typename EnumT> +struct HTMLOptionEnum +{ + const char *pName; // value of an HTML option + EnumT nValue; // and corresponding value of an enum +}; + +/** Representation of an HTML option (=attribute in a start tag). + * The values of the options are always stored as strings. + * The methods GetNumber,... may only be called if the option + * is actually numerical,... + */ +class SVT_DLLPUBLIC HTMLOption +{ + OUString aValue; // value of the option (always as string) + OUString aToken; // name of the option as string + HtmlOptionId nToken; // and respective token + +public: + + HTMLOption( HtmlOptionId nTyp, const OUString& rToken, const OUString& rValue ); + + // name of the option... + HtmlOptionId GetToken() const { return nToken; } // ... as enum + const OUString& GetTokenString() const { return aToken; } // ... as string + + // value of the option ... + const OUString& GetString() const { return aValue; } // ... as string + + sal_uInt32 GetNumber() const; // ... as number + sal_Int32 GetSNumber() const; // ... as number + void GetNumbers( std::vector<sal_uInt32> &rNumbers ) const; // ... as numbers + void GetColor( Color& ) const; // ... as color + + template<typename EnumT> + EnumT GetEnum( const HTMLOptionEnum<EnumT> *pOptEnums, + EnumT nDflt = static_cast<EnumT>(0) ) const + { + while( pOptEnums->pName ) + { + if( aValue.equalsIgnoreAsciiCaseAscii( pOptEnums->pName ) ) + return pOptEnums->nValue; + pOptEnums++; + } + return nDflt; + } + + template<typename EnumT> + bool GetEnum( EnumT &rEnum, const HTMLOptionEnum<EnumT> *pOptEnums ) const + { + while( pOptEnums->pName ) + { + if( aValue.equalsIgnoreAsciiCaseAscii( pOptEnums->pName ) ) + { + rEnum = pOptEnums->nValue; + return true; + } + pOptEnums++; + } + return false; + } + + // ... and as a few special enums + HTMLInputType GetInputType() const; // <INPUT TYPE=...> + HTMLTableFrame GetTableFrame() const; // <TABLE FRAME=...> + HTMLTableRules GetTableRules() const; // <TABLE RULES=...> + //SvxAdjust GetAdjust() const; // <P,TH,TD ALIGN=> +}; + +typedef ::std::vector<HTMLOption> HTMLOptions; + +class SVT_DLLPUBLIC HTMLParser : public SvParser<HtmlTokenId> +{ +private: + mutable HTMLOptions maOptions; // options of the start tag + + bool bNewDoc : 1; // read new Doc? + bool bIsInHeader : 1; // scan header section + bool bReadListing : 1; // read listings + bool bReadXMP : 1; // read XMP + bool bReadPRE : 1; // read preformatted text + bool bReadTextArea : 1; // read TEXTAREA + bool bReadScript : 1; // read <SCRIPT> + bool bReadStyle : 1; // read <STYLE> + bool bEndTokenFound : 1; // found </SCRIPT> or </STYLE> + + bool bPre_IgnoreNewPara : 1; // flags for reading of PRE paragraphs + bool bReadNextChar : 1; // true: read NextChar again(JavaScript!) + bool bReadComment : 1; // true: read NextChar again (JavaScript!) + + sal_uInt32 nPre_LinePos; // Pos in the line in the PRE-Tag + + HtmlTokenId mnPendingOffToken; ///< OFF token pending for a <XX.../> ON/OFF ON token + + OUString aEndToken; + + /// XML namespace, in case of XHTML. + OUString maNamespace; + +protected: + OUString sSaveToken; // the read tag as string + + HtmlTokenId ScanText( const sal_Unicode cBreak = 0U ); + + HtmlTokenId GetNextRawToken(); + + // scan next token + virtual HtmlTokenId GetNextToken_() override; + + virtual ~HTMLParser() override; + + void FinishHeader() { bIsInHeader = false; } + + void SetNamespace(const OUString& rNamespace); + +public: + HTMLParser( SvStream& rIn, bool bReadNewDoc = true ); + + virtual SvParserState CallParser() override; + + bool IsNewDoc() const { return bNewDoc; } + bool IsInHeader() const { return bIsInHeader; } + bool IsReadListing() const { return bReadListing; } + bool IsReadXMP() const { return bReadXMP; } + bool IsReadPRE() const { return bReadPRE; } + bool IsReadScript() const { return bReadScript; } + bool IsReadStyle() const { return bReadStyle; } + + // start PRE-/LISTING or XMP mode or filter tags respectively + inline void StartPRE(); + void FinishPRE() { bReadPRE = false; } + HtmlTokenId FilterPRE( HtmlTokenId nToken ); + + inline void StartListing(); + void FinishListing() { bReadListing = false; } + HtmlTokenId FilterListing( HtmlTokenId nToken ); + + inline void StartXMP(); + void FinishXMP() { bReadXMP = false; } + HtmlTokenId FilterXMP( HtmlTokenId nToken ); + + void FinishTextArea() { bReadTextArea = false; } + + // finish PRE-/LISTING- and XMP mode + void FinishPREListingXMP() { bReadPRE = bReadListing = bReadXMP = false; } + + // Filter the current token according to the current mode + // (PRE, XMP, ...) and set the flags. Is called by Continue before + // NextToken is called. If you implement own loops or call + // NextToken yourself, you should call this method beforehand. + HtmlTokenId FilterToken( HtmlTokenId nToken ); + + void ReadRawData( const OUString &rEndToken ) { aEndToken = rEndToken; } + + // Token without \-sequences + void UnescapeToken(); + + // Determine the options. pNoConvertToken is the optional token + // of an option, for which the CR/LFs are not deleted from the value + // of the option. + const HTMLOptions& GetOptions( HtmlOptionId const *pNoConvertToken=nullptr ); + + // for asynchronous reading from the SvStream + virtual void Continue( HtmlTokenId nToken ) override; + + +protected: + + static rtl_TextEncoding GetEncodingByMIME( const OUString& rMime ); + + /// template method: called when ParseMetaOptions adds a user-defined meta + virtual void AddMetaUserDefined( OUString const & i_rMetaName ); + +private: + /// parse meta options into XDocumentProperties and encoding + bool ParseMetaOptionsImpl( const css::uno::Reference< css::document::XDocumentProperties>&, + SvKeyValueIterator*, + const HTMLOptions&, + rtl_TextEncoding& rEnc ); + +public: + /// overriding method must call this implementation! + virtual bool ParseMetaOptions( const css::uno::Reference< css::document::XDocumentProperties>&, + SvKeyValueIterator* ); + + void ParseScriptOptions( OUString& rLangString, const OUString&, HTMLScriptLanguage& rLang, + OUString& rSrc, OUString& rLibrary, OUString& rModule ); + + // Remove a comment around the content of <SCRIPT> or <STYLE>. + // The whole line behind a "<!--" might be deleted (for JavaScript). + static void RemoveSGMLComment( OUString &rString ); + + static bool InternalImgToPrivateURL( OUString& rURL ); + static rtl_TextEncoding GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPHeader ); + bool SetEncodingByHTTPHeader( SvKeyValueIterator *pHTTPHeader ); +}; + +inline void HTMLParser::StartPRE() +{ + bReadPRE = true; + bPre_IgnoreNewPara = true; + nPre_LinePos = 0; +} + +inline void HTMLParser::StartListing() +{ + bReadListing = true; + bPre_IgnoreNewPara = true; + nPre_LinePos = 0; +} + +inline void HTMLParser::StartXMP() +{ + bReadXMP = true; + bPre_IgnoreNewPara = true; + nPre_LinePos = 0; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/parrtf.hxx b/include/svtools/parrtf.hxx new file mode 100644 index 000000000..cd846e6f2 --- /dev/null +++ b/include/svtools/parrtf.hxx @@ -0,0 +1,74 @@ +/* -*- 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_SVTOOLS_PARRTF_HXX +#define INCLUDED_SVTOOLS_PARRTF_HXX + +#include <svtools/svtdllapi.h> +#include <svtools/svparser.hxx> +#include <stack> + +struct RtfParserState_Impl +{ + rtl_TextEncoding eCodeSet; + sal_uInt8 nUCharOverread; + + RtfParserState_Impl( sal_uInt8 nUOverread, rtl_TextEncoding eCdSt ) + : eCodeSet( eCdSt ), nUCharOverread( nUOverread ) + {} +}; + +class SVT_DLLPUBLIC SvRTFParser : public SvParser<int> +{ + std::stack< RtfParserState_Impl > aParserStates; + int nOpenBrakets; + rtl_TextEncoding eCodeSet; + sal_uInt8 nUCharOverread; + +private: + static short _inSkipGroup; + +protected: + sal_Unicode GetHexValue(); + void ScanText(); + void SkipGroup(); + + // scan the next Token + virtual int GetNextToken_() override; + + void ReadUnknownData(); + void ReadBitmapData(); + + virtual ~SvRTFParser() override; + + rtl_TextEncoding GetCodeSet() const { return eCodeSet; } + void SetEncoding( rtl_TextEncoding eEnc ); + +public: + SvRTFParser( SvStream& rIn, sal_uInt8 nStackSize = 3 ); + + virtual SvParserState CallParser() override; // calling the parser + + // for asynchronous read from the SvStream + virtual void Continue( int nToken ) override; +}; + +#endif // INCLUDED_SVTOOLS_PARRTF_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/place.hxx b/include/svtools/place.hxx new file mode 100644 index 000000000..0d59f4667 --- /dev/null +++ b/include/svtools/place.hxx @@ -0,0 +1,42 @@ +/* -*- 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/. + */ + +#ifndef INCLUDED_SVTOOLS_PLACE_HXX +#define INCLUDED_SVTOOLS_PLACE_HXX + +#include <tools/urlobj.hxx> + +class Place +{ +private: + OUString msName; + INetURLObject maUrl; + + bool mbEditable; + +public: + + Place( const OUString& sName, const OUString& sUrl, bool bEditable = false ) : + msName( sName ), + maUrl( sUrl ), + mbEditable( bEditable ) {}; + + void SetName(const OUString& aName ) { msName = aName; } + void SetUrl(const OUString& aUrl ) { maUrl.SetURL( aUrl ); } + + OUString& GetName( ) { return msName; } + OUString GetUrl( ) const { return maUrl.GetMainURL( INetURLObject::DecodeMechanism::NONE ); } + INetURLObject& GetUrlObject( ) { return maUrl; } + bool IsLocal( ) const { return maUrl.GetProtocol() == INetProtocol::File; } + bool IsEditable( ) const { return mbEditable; } +}; + +#endif // INCLUDED_SVTOOLS_PLACE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/popupmenucontrollerbase.hxx b/include/svtools/popupmenucontrollerbase.hxx new file mode 100644 index 000000000..2c506af1e --- /dev/null +++ b/include/svtools/popupmenucontrollerbase.hxx @@ -0,0 +1,127 @@ +/* -*- 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_SVTOOLS_POPUPMENUCONTROLLERBASE_HXX +#define INCLUDED_SVTOOLS_POPUPMENUCONTROLLERBASE_HXX + +#include <config_options.h> +#include <svtools/svtdllapi.h> + +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/frame/XDispatchProvider.hpp> +#include <com/sun/star/frame/XDispatch.hpp> +#include <com/sun/star/frame/XStatusListener.hpp> +#include <com/sun/star/frame/XPopupMenuController.hpp> + +#include <tools/link.hxx> +#include <cppuhelper/compbase.hxx> +#include <cppuhelper/basemutex.hxx> +#include <rtl/ustring.hxx> + +namespace com :: sun :: star :: frame { class XFrame; } +namespace com :: sun :: star :: uno { class XComponentContext; } +namespace com :: sun :: star :: util { class XURLTransformer; } + +namespace svt +{ + + typedef cppu::WeakComponentImplHelper< + css::lang::XServiceInfo , + css::frame::XPopupMenuController , + css::lang::XInitialization , + css::frame::XStatusListener , + css::awt::XMenuListener , + css::frame::XDispatchProvider , + css::frame::XDispatch > PopupMenuControllerBaseType; + + class UNLESS_MERGELIBS(SVT_DLLPUBLIC) PopupMenuControllerBase : protected ::cppu::BaseMutex, // Struct for right initialization of mutex member! Must be first of baseclasses. + public PopupMenuControllerBaseType + { + public: + PopupMenuControllerBase( const css::uno::Reference< css::uno::XComponentContext >& xContext ); + virtual ~PopupMenuControllerBase() override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName( ) override = 0; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override = 0; + + // XPopupMenuController + virtual void SAL_CALL setPopupMenu( const css::uno::Reference< css::awt::XPopupMenu >& PopupMenu ) override; + virtual void SAL_CALL updatePopupMenu() override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; + + // XStatusListener + virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override = 0; + + // XMenuListener + virtual void SAL_CALL itemHighlighted( const css::awt::MenuEvent& rEvent ) override; + virtual void SAL_CALL itemSelected( const css::awt::MenuEvent& rEvent ) override; + virtual void SAL_CALL itemActivated( const css::awt::MenuEvent& rEvent ) override; + virtual void SAL_CALL itemDeactivated( const css::awt::MenuEvent& rEvent ) override; + + // XDispatchProvider + virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& aURL, const OUString& sTarget, sal_Int32 nFlags ) override; + virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptor ) override; + + // XDispatch + virtual void SAL_CALL dispatch( const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& seqProperties ) override; + virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl, const css::util::URL& aURL ) override; + virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl, const css::util::URL& aURL ) override; + + // XEventListener + virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; + + void dispatchCommand( const OUString& sCommandURL, const css::uno::Sequence< css::beans::PropertyValue >& rArgs, const OUString& sTarget = OUString() ); + + protected: + /// @throws css::uno::RuntimeException + void throwIfDisposed(); + + /** helper method to cause statusChanged is called once for the given command url */ + void updateCommand( const OUString& rCommandURL ); + + /** this function is called upon disposing the component + */ + virtual void SAL_CALL disposing() override; + + static void resetPopupMenu( css::uno::Reference< css::awt::XPopupMenu > const & rPopupMenu ); + virtual void impl_setPopupMenu(); + static OUString determineBaseURL( const OUString& aURL ); + + DECL_STATIC_LINK( PopupMenuControllerBase, ExecuteHdl_Impl, void*, void ); + + + bool m_bInitialized; + OUString m_aCommandURL; + OUString m_aBaseURL; + OUString m_aModuleName; + css::uno::Reference< css::frame::XDispatch > m_xDispatch; + css::uno::Reference< css::frame::XFrame > m_xFrame; + css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer; + css::uno::Reference< css::awt::XPopupMenu > m_xPopupMenu; + }; +} + +#endif // INCLUDED_SVTOOLS_POPUPMENUCONTROLLERBASE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/popupwindowcontroller.hxx b/include/svtools/popupwindowcontroller.hxx new file mode 100644 index 000000000..7aa1ca08f --- /dev/null +++ b/include/svtools/popupwindowcontroller.hxx @@ -0,0 +1,91 @@ +/* -*- 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_SVTOOLS_POPUPWINDOWCONTROLLER_HXX +#define INCLUDED_SVTOOLS_POPUPWINDOWCONTROLLER_HXX + +#include <memory> +#include <o3tl/deleter.hxx> +#include <svtools/svtdllapi.h> + +#include <com/sun/star/lang/XServiceInfo.hpp> + +#include <cppuhelper/implbase.hxx> +#include <svtools/toolboxcontroller.hxx> +#include <vcl/vclptr.hxx> + +namespace vcl { class Window; } + +class InterimToolbarPopup; +class ToolbarPopupContainer; +class WeldToolbarPopup; + +namespace svt +{ +class PopupWindowControllerImpl; + +//HACK to avoid duplicate ImplInheritanceHelper symbols with MSVC: +class SAL_DLLPUBLIC_TEMPLATE PopupWindowController_Base: + public cppu::ImplInheritanceHelper<svt::ToolboxController, css::lang::XServiceInfo> +{ + using ImplInheritanceHelper::ImplInheritanceHelper; +}; + +class SVT_DLLPUBLIC PopupWindowController : public PopupWindowController_Base +{ +public: + PopupWindowController( const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const css::uno::Reference< css::frame::XFrame >& xFrame, + const OUString& aCommandURL ); + + virtual ~PopupWindowController() override; + + void EndPopupMode(); + + virtual VclPtr<vcl::Window> createVclPopupWindow( vcl::Window* pParent ) = 0; + virtual std::unique_ptr<WeldToolbarPopup> weldPopupWindow(); + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override = 0; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override = 0; + + // XComponent + virtual void SAL_CALL dispose() override; + + // XStatusListener + virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override; + + // XToolbarController + virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override; + virtual void SAL_CALL click() override; + +protected: + std::unique_ptr<ToolbarPopupContainer> mxPopoverContainer; + VclPtr<InterimToolbarPopup> mxInterimPopover; + +private: + std::unique_ptr<PopupWindowControllerImpl, o3tl::default_delete<PopupWindowControllerImpl>> mxImpl; +}; + +} // namespace svt + +#endif // INCLUDED_SVTOOLS_POPUPWINDOWCONTROLLER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/printoptions.hxx b/include/svtools/printoptions.hxx new file mode 100644 index 000000000..2a0b3f012 --- /dev/null +++ b/include/svtools/printoptions.hxx @@ -0,0 +1,112 @@ +/* -*- 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_SVTOOLS_PRINTOPTIONS_HXX +#define INCLUDED_SVTOOLS_PRINTOPTIONS_HXX + +#include <config_options.h> +#include <svtools/svtdllapi.h> +#include <sal/types.h> +#include <unotools/options.hxx> + +namespace osl { class Mutex; } + +class SvtPrintOptions_Impl; +class PrinterOptions; + + +class UNLESS_MERGELIBS(SVT_DLLPUBLIC) SvtBasePrintOptions: public utl::detail::Options +{ + + SvtPrintOptions_Impl* m_pDataContainer; + +protected: + + void SetDataContainer( SvtPrintOptions_Impl* pDataContainer ) { m_pDataContainer = pDataContainer; } + +public: + + static ::osl::Mutex& GetOwnStaticMutex(); + +public: + + SvtBasePrintOptions(); + virtual ~SvtBasePrintOptions() override; + + static bool IsReduceTransparency(); + static sal_Int16 GetReducedTransparencyMode(); + static bool IsReduceGradients(); + static sal_Int16 GetReducedGradientMode(); + static sal_Int16 GetReducedGradientStepCount(); + static bool IsReduceBitmaps(); + static sal_Int16 GetReducedBitmapMode(); + static sal_Int16 GetReducedBitmapResolution(); + static bool IsReducedBitmapIncludesTransparency(); + static bool IsConvertToGreyscales(); + static bool IsPDFAsStandardPrintJobFormat(); + + void SetReduceTransparency( bool bState ); + void SetReducedTransparencyMode( sal_Int16 nMode ); + void SetReduceGradients( bool bState ); + void SetReducedGradientMode( sal_Int16 nMode ); + void SetReducedGradientStepCount( sal_Int16 nStepCount ); + void SetReduceBitmaps( bool bState ); + void SetReducedBitmapMode( sal_Int16 bState ); + void SetReducedBitmapResolution( sal_Int16 nResolution ); + void SetReducedBitmapIncludesTransparency( bool bState ); + void SetConvertToGreyscales( bool bState ); + void SetPDFAsStandardPrintJobFormat( bool bState ); + +public: + + static void GetPrinterOptions( PrinterOptions& rOptions ); + void SetPrinterOptions( const PrinterOptions& rOptions ); +}; + + +class UNLESS_MERGELIBS(SVT_DLLPUBLIC) SvtPrinterOptions final : public SvtBasePrintOptions +{ +private: + + static SvtPrintOptions_Impl* m_pStaticDataContainer; + static sal_Int32 m_nRefCount; + +public: + + SvtPrinterOptions(); + virtual ~SvtPrinterOptions() override; +}; + + +class UNLESS_MERGELIBS(SVT_DLLPUBLIC) SvtPrintFileOptions final : public SvtBasePrintOptions +{ +private: + + static SvtPrintOptions_Impl* m_pStaticDataContainer; + static sal_Int32 m_nRefCount; + +public: + + SvtPrintFileOptions(); + virtual ~SvtPrintFileOptions() override; +}; + +#endif // INCLUDED_SVTOOLS_PRINTOPTIONS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/prnsetup.hxx b/include/svtools/prnsetup.hxx new file mode 100644 index 000000000..5f55b6b41 --- /dev/null +++ b/include/svtools/prnsetup.hxx @@ -0,0 +1,82 @@ +/* -*- 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_SVTOOLS_PRNSETUP_HXX +#define INCLUDED_SVTOOLS_PRNSETUP_HXX + +#include <svtools/svtdllapi.h> +#include <vcl/print.hxx> +#include <vcl/weld.hxx> +#include <vcl/timer.hxx> + +class Printer; +class QueueInfo; +class VclSimpleEvent; + +class SVT_DLLPUBLIC PrinterSetupDialog final : public weld::GenericDialogController +{ +private: + std::unique_ptr<weld::ComboBox> m_xLbName; + std::unique_ptr<weld::Button> m_xBtnProperties; + std::unique_ptr<weld::Button> m_xBtnOptions; + std::unique_ptr<weld::Label> m_xFiStatus; + std::unique_ptr<weld::Label> m_xFiType; + std::unique_ptr<weld::Label> m_xFiLocation; + std::unique_ptr<weld::Label> m_xFiComment; + AutoTimer maStatusTimer; + VclPtr<Printer> mpPrinter; + VclPtr<Printer> mpTempPrinter; + + SVT_DLLPRIVATE void ImplSetInfo(); + + DECL_DLLPRIVATE_LINK( ImplPropertiesHdl, weld::Button&, void ); + DECL_DLLPRIVATE_LINK( ImplChangePrinterHdl, weld::ComboBox&, void ); + DECL_DLLPRIVATE_LINK( ImplGetFocusHdl, weld::Widget&, void ); + DECL_DLLPRIVATE_LINK( ImplStatusHdl, Timer*, void ); + DECL_DLLPRIVATE_LINK( ImplDataChangedHdl, VclSimpleEvent&, void); + +public: + PrinterSetupDialog(weld::Window* pWindow); + virtual ~PrinterSetupDialog() override; + + void SetPrinter( Printer* pNewPrinter ) { mpPrinter = pNewPrinter; } + Printer* GetPrinter() const { return mpPrinter; } + + virtual short run() override; + + weld::Window* GetFrameWeld() const { return m_xDialog.get(); } + + void SetOptionsHdl( const Link<weld::Button&,void>& rLink ); +}; + + +#define IMPL_PRINTDLG_STATUS_UPDATE 15000 + +void ImplFillPrnDlgListBox( const Printer* pPrinter, + weld::ComboBox* pBox, weld::Button* pPropBtn ); +void ImplFreePrnDlgListBox( weld::ComboBox* pBox, bool bClear = true ); +Printer* ImplPrnDlgListBoxSelect( weld::ComboBox const * pBox, weld::Button* pPropBtn, + Printer const * pPrinter, Printer* pTempPrinter ); +Printer* ImplPrnDlgUpdatePrinter( Printer const * pPrinter, Printer* pTempPrinter ); +void ImplPrnDlgUpdateQueueInfo( weld::ComboBox const * pBox, QueueInfo& rInfo ); +OUString ImplPrnDlgGetStatusText( const QueueInfo& rInfo ); + +#endif // INCLUDED_SVTOOLS_PRNSETUP_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/querydelete.hxx b/include/svtools/querydelete.hxx new file mode 100644 index 000000000..b41d2461e --- /dev/null +++ b/include/svtools/querydelete.hxx @@ -0,0 +1,52 @@ +/* -*- 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_SVTOOLS_FILEVIEW_HXX +#define INCLUDED_SVTOOLS_FILEVIEW_HXX + +#include <memory> +#include <vcl/weld.hxx> +#include <rtl/ustring.hxx> +#include <svtools/svtdllapi.h> + +namespace svtools +{ +// QueryDeleteDlg_Impl + +enum QueryDeleteResult_Impl +{ + QUERYDELETE_YES = RET_YES, + QUERYDELETE_ALL = 101 +}; + +class SVT_DLLPUBLIC QueryDeleteDlg_Impl final : public weld::MessageDialogController +{ +private: + std::unique_ptr<weld::Button> m_xAllButton; + +public: + QueryDeleteDlg_Impl(weld::Widget* pParent, const OUString& rName); + virtual ~QueryDeleteDlg_Impl() override; + + void EnableAllButton() { m_xAllButton->set_sensitive(true); } +}; +} + +#endif // INCLUDED_SVTOOLS_FILEVIEW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/restartdialog.hxx b/include/svtools/restartdialog.hxx new file mode 100644 index 000000000..ad1f4859d --- /dev/null +++ b/include/svtools/restartdialog.hxx @@ -0,0 +1,85 @@ +/* -*- 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/. + */ + +#ifndef INCLUDED_SVTOOLS_RESTARTDIALOG_HXX +#define INCLUDED_SVTOOLS_RESTARTDIALOG_HXX + +#include <sal/config.h> + +#include <svtools/svtdllapi.h> + +namespace com :: sun :: star :: uno { template <typename > class Reference; } + +namespace weld { class Window; } +namespace com::sun::star::uno { + class XComponentContext; +} + +namespace svtools { + +enum RestartReason { + // "For the selected Java runtime environment to work properly, + // %PRODUCTNAME must be restarted.": + RESTART_REASON_JAVA, + // For the modified default print job format to take effect, + // %PRODUCTNAME must be restarted: + RESTART_REASON_PDF_AS_STANDARD_JOB_FORMAT, + // "For the bibliography to work properly, + // %PRODUCTNAME must be restarted.": + RESTART_REASON_BIBLIOGRAPHY_INSTALL, + // "For the mail merge to work properly, + // %PRODUCTNAME must be restarted.": + RESTART_REASON_MAILMERGE_INSTALL, + // "For the updated language settings to take effect, + // %PRODUCTNAME must be restarted.": + RESTART_REASON_LANGUAGE_CHANGE, + // "For the added path to take effect, + // %PRODUCTNAME must be restarted.": + RESTART_REASON_ADDING_PATH, + // "For the assigned java parameters to take effect, + // %PRODUCTNAME must be restarted.": + RESTART_REASON_ASSIGNING_JAVAPARAMETERS, + // "For the assigned folders and archives to take effect, + // %PRODUCTNAME must be restarted.": + RESTART_REASON_ASSIGNING_FOLDERS, + // "For the modified experimental features to take effect, + // %PRODUCTNAME must be restarted.": + RESTART_REASON_EXP_FEATURES, + // "For the extension to work properly, + // %PRODUCTNAME must be restarted.": + RESTART_REASON_EXTENSION_INSTALL, + // For the OpenGL changes to take effect, + // %PRODUCTNAME must be restarted: + RESTART_REASON_OPENGL, + // For the Skia changes to take effect, + // %PRODUCTNAME must be restarted: + RESTART_REASON_SKIA, + // For the OpenCL changes to take effect, + // %PRODUCTNAME must be restarted: + RESTART_REASON_OPENCL, + // For the multi-threaded calculation changes to take effect, + // %PRODUCTNAME must be restarted: + RESTART_REASON_THREADING, + // For restructuring the Form menu, + // %PRODUCTNAME must be restarted: + RESTART_REASON_MSCOMPATIBLE_FORMS_MENU, + // No particular reason: + RESTART_REASON_NONE +}; + +// Must be called with the solar mutex locked; returns if restart was initiated: +SVT_DLLPUBLIC bool executeRestartDialog( + css::uno::Reference< css::uno::XComponentContext > const & context, + weld::Window* parent, RestartReason reason); + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/rtfkeywd.hxx b/include/svtools/rtfkeywd.hxx new file mode 100644 index 000000000..fa297843e --- /dev/null +++ b/include/svtools/rtfkeywd.hxx @@ -0,0 +1,1230 @@ +/* -*- 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_SVTOOLS_RTFKEYWD_HXX +#define INCLUDED_SVTOOLS_RTFKEYWD_HXX + +#include <sal/config.h> + +#define OOO_STRING_SVTOOLS_RTF_HEXCHAR "\\'" +#define OOO_STRING_SVTOOLS_RTF_IGNORE "\\*" +#define OOO_STRING_SVTOOLS_RTF_OPTHYPH "\\-" +#define OOO_STRING_SVTOOLS_RTF_SUBENTRY "\\:" +#define OOO_STRING_SVTOOLS_RTF_ABSH "\\absh" +#define OOO_STRING_SVTOOLS_RTF_ABSW "\\absw" +#define OOO_STRING_SVTOOLS_RTF_ALT "\\alt" +#define OOO_STRING_SVTOOLS_RTF_ANNOTATION "\\annotation" +#define OOO_STRING_SVTOOLS_RTF_ANSI "\\ansi" +#define OOO_STRING_SVTOOLS_RTF_ATNDATE "\\atndate" +#define OOO_STRING_SVTOOLS_RTF_ATNID "\\atnid" +#define OOO_STRING_SVTOOLS_RTF_AUTHOR "\\author" +#define OOO_STRING_SVTOOLS_RTF_B "\\b" +#define OOO_STRING_SVTOOLS_RTF_BGBDIAG "\\bgbdiag" +#define OOO_STRING_SVTOOLS_RTF_BGCROSS "\\bgcross" +#define OOO_STRING_SVTOOLS_RTF_BGDCROSS "\\bgdcross" +#define OOO_STRING_SVTOOLS_RTF_BGDKBDIAG "\\bgdkbdiag" +#define OOO_STRING_SVTOOLS_RTF_BGDKCROSS "\\bgdkcross" +#define OOO_STRING_SVTOOLS_RTF_BGDKDCROSS "\\bgdkdcross" +#define OOO_STRING_SVTOOLS_RTF_BGDKFDIAG "\\bgdkfdiag" +#define OOO_STRING_SVTOOLS_RTF_BGDKHORIZ "\\bgdkhoriz" +#define OOO_STRING_SVTOOLS_RTF_BGDKVERT "\\bgdkvert" +#define OOO_STRING_SVTOOLS_RTF_BGFDIAG "\\bgfdiag" +#define OOO_STRING_SVTOOLS_RTF_BGHORIZ "\\bghoriz" +#define OOO_STRING_SVTOOLS_RTF_BGVERT "\\bgvert" +#define OOO_STRING_SVTOOLS_RTF_BIN "\\bin" +#define OOO_STRING_SVTOOLS_RTF_BINFSXN "\\binfsxn" +#define OOO_STRING_SVTOOLS_RTF_BINSXN "\\binsxn" +#define OOO_STRING_SVTOOLS_RTF_BKMKCOLF "\\bkmkcolf" +#define OOO_STRING_SVTOOLS_RTF_BKMKCOLL "\\bkmkcoll" +#define OOO_STRING_SVTOOLS_RTF_BKMKEND "\\bkmkend" +#define OOO_STRING_SVTOOLS_RTF_BKMKSTART "\\bkmkstart" +#define OOO_STRING_SVTOOLS_RTF_BLUE "\\blue" +#define OOO_STRING_SVTOOLS_RTF_BOX "\\box" +#define OOO_STRING_SVTOOLS_RTF_BRDRB "\\brdrb" +#define OOO_STRING_SVTOOLS_RTF_BRDRBAR "\\brdrbar" +#define OOO_STRING_SVTOOLS_RTF_BRDRBTW "\\brdrbtw" +#define OOO_STRING_SVTOOLS_RTF_BRDRCF "\\brdrcf" +#define OOO_STRING_SVTOOLS_RTF_BRDRDB "\\brdrdb" +#define OOO_STRING_SVTOOLS_RTF_BRDRDOT "\\brdrdot" +#define OOO_STRING_SVTOOLS_RTF_BRDRDASH "\\brdrdash" +#define OOO_STRING_SVTOOLS_RTF_BRDRHAIR "\\brdrhair" +#define OOO_STRING_SVTOOLS_RTF_BRDRL "\\brdrl" +#define OOO_STRING_SVTOOLS_RTF_BRDRR "\\brdrr" +#define OOO_STRING_SVTOOLS_RTF_BRDRS "\\brdrs" +#define OOO_STRING_SVTOOLS_RTF_BRDRSH "\\brdrsh" +#define OOO_STRING_SVTOOLS_RTF_BRDRT "\\brdrt" +#define OOO_STRING_SVTOOLS_RTF_BRDRTH "\\brdrth" +#define OOO_STRING_SVTOOLS_RTF_BRDRW "\\brdrw" +#define OOO_STRING_SVTOOLS_RTF_BRSP "\\brsp" +#define OOO_STRING_SVTOOLS_RTF_BULLET "\\bullet" +#define OOO_STRING_SVTOOLS_RTF_BUPTIM "\\buptim" +#define OOO_STRING_SVTOOLS_RTF_BXE "\\bxe" +#define OOO_STRING_SVTOOLS_RTF_CAPS "\\caps" +#define OOO_STRING_SVTOOLS_RTF_CB "\\cb" +#define OOO_STRING_SVTOOLS_RTF_CBPAT "\\cbpat" +#define OOO_STRING_SVTOOLS_RTF_CELL "\\cell" +#define OOO_STRING_SVTOOLS_RTF_CELLX "\\cellx" +#define OOO_STRING_SVTOOLS_RTF_CF "\\cf" +#define OOO_STRING_SVTOOLS_RTF_CFPAT "\\cfpat" +#define OOO_STRING_SVTOOLS_RTF_CHATN "\\chatn" +#define OOO_STRING_SVTOOLS_RTF_CHDATE "\\chdate" +#define OOO_STRING_SVTOOLS_RTF_CHDPA "\\chdpa" +#define OOO_STRING_SVTOOLS_RTF_CHDPL "\\chdpl" +#define OOO_STRING_SVTOOLS_RTF_CHFTN "\\chftn" +#define OOO_STRING_SVTOOLS_RTF_CHFTNSEP "\\chftnsep" +#define OOO_STRING_SVTOOLS_RTF_CHFTNSEPC "\\chftnsepc" +#define OOO_STRING_SVTOOLS_RTF_CHPGN "\\chpgn" +#define OOO_STRING_SVTOOLS_RTF_CHTIME "\\chtime" +#define OOO_STRING_SVTOOLS_RTF_CLBGBDIAG "\\clbgbdiag" +#define OOO_STRING_SVTOOLS_RTF_CLBGCROSS "\\clbgcross" +#define OOO_STRING_SVTOOLS_RTF_CLBGDCROSS "\\clbgdcross" +#define OOO_STRING_SVTOOLS_RTF_CLBGDKBDIAG "\\clbgdkbdiag" +#define OOO_STRING_SVTOOLS_RTF_CLBGDKCROSS "\\clbgdkcross" +#define OOO_STRING_SVTOOLS_RTF_CLBGDKDCROSS "\\clbgdkdcross" +#define OOO_STRING_SVTOOLS_RTF_CLBGDKFDIAG "\\clbgdkfdiag" +#define OOO_STRING_SVTOOLS_RTF_CLBGDKHOR "\\clbgdkhor" +#define OOO_STRING_SVTOOLS_RTF_CLBGDKVERT "\\clbgdkvert" +#define OOO_STRING_SVTOOLS_RTF_CLBGFDIAG "\\clbgfdiag" +#define OOO_STRING_SVTOOLS_RTF_CLBGHORIZ "\\clbghoriz" +#define OOO_STRING_SVTOOLS_RTF_CLBGVERT "\\clbgvert" +#define OOO_STRING_SVTOOLS_RTF_CLBRDRB "\\clbrdrb" +#define OOO_STRING_SVTOOLS_RTF_CLBRDRL "\\clbrdrl" +#define OOO_STRING_SVTOOLS_RTF_CLBRDRR "\\clbrdrr" +#define OOO_STRING_SVTOOLS_RTF_CLBRDRT "\\clbrdrt" +#define OOO_STRING_SVTOOLS_RTF_CLCBPAT "\\clcbpat" +#define OOO_STRING_SVTOOLS_RTF_CLCFPAT "\\clcfpat" +#define OOO_STRING_SVTOOLS_RTF_CLMGF "\\clmgf" +#define OOO_STRING_SVTOOLS_RTF_CLMRG "\\clmrg" +#define OOO_STRING_SVTOOLS_RTF_CLSHDNG "\\clshdng" +#define OOO_STRING_SVTOOLS_RTF_COLNO "\\colno" +#define OOO_STRING_SVTOOLS_RTF_COLORTBL "\\colortbl" +#define OOO_STRING_SVTOOLS_RTF_COLS "\\cols" +#define OOO_STRING_SVTOOLS_RTF_COLSR "\\colsr" +#define OOO_STRING_SVTOOLS_RTF_COLSX "\\colsx" +#define OOO_STRING_SVTOOLS_RTF_COLUMN "\\column" +#define OOO_STRING_SVTOOLS_RTF_COLW "\\colw" +#define OOO_STRING_SVTOOLS_RTF_COMMENT "\\comment" +#define OOO_STRING_SVTOOLS_RTF_CONTEXTUALSPACE "\\contextualspace" +#define OOO_STRING_SVTOOLS_RTF_CREATIM "\\creatim" +#define OOO_STRING_SVTOOLS_RTF_CTRL "\\ctrl" +#define OOO_STRING_SVTOOLS_RTF_DEFF "\\deff" +#define OOO_STRING_SVTOOLS_RTF_DEFFORMAT "\\defformat" +#define OOO_STRING_SVTOOLS_RTF_DEFLANG "\\deflang" +#define OOO_STRING_SVTOOLS_RTF_DEFTAB "\\deftab" +#define OOO_STRING_SVTOOLS_RTF_DELETED "\\deleted" +#define OOO_STRING_SVTOOLS_RTF_DFRMTXTX "\\dfrmtxtx" +#define OOO_STRING_SVTOOLS_RTF_DFRMTXTY "\\dfrmtxty" +#define OOO_STRING_SVTOOLS_RTF_DIBITMAP "\\dibitmap" +#define OOO_STRING_SVTOOLS_RTF_DN "\\dn" +#define OOO_STRING_SVTOOLS_RTF_DOCCOMM "\\doccomm" +#define OOO_STRING_SVTOOLS_RTF_DOCTEMP "\\doctemp" +#define OOO_STRING_SVTOOLS_RTF_DROPCAPLI "\\dropcapli" +#define OOO_STRING_SVTOOLS_RTF_DROPCAPT "\\dropcapt" +#define OOO_STRING_SVTOOLS_RTF_ABSNOOVRLP "\\absnoovrlp" +#define OOO_STRING_SVTOOLS_RTF_DXFRTEXT "\\dxfrtext" +#define OOO_STRING_SVTOOLS_RTF_DY "\\dy" +#define OOO_STRING_SVTOOLS_RTF_EDMINS "\\edmins" +#define OOO_STRING_SVTOOLS_RTF_EMDASH "\\emdash" +#define OOO_STRING_SVTOOLS_RTF_ENDASH "\\endash" +#define OOO_STRING_SVTOOLS_RTF_ENDDOC "\\enddoc" +#define OOO_STRING_SVTOOLS_RTF_ENDNHERE "\\endnhere" +#define OOO_STRING_SVTOOLS_RTF_ENDNOTES "\\endnotes" +#define OOO_STRING_SVTOOLS_RTF_EXPND "\\expnd" +#define OOO_STRING_SVTOOLS_RTF_EXPNDTW "\\expndtw" +#define OOO_STRING_SVTOOLS_RTF_F "\\f" +#define OOO_STRING_SVTOOLS_RTF_FACINGP "\\facingp" +#define OOO_STRING_SVTOOLS_RTF_FACPGSXN "\\facpgsxn" +#define OOO_STRING_SVTOOLS_RTF_FALT "\\falt" +#define OOO_STRING_SVTOOLS_RTF_FCHARSET "\\fcharset" +#define OOO_STRING_SVTOOLS_RTF_FDECOR "\\fdecor" +#define OOO_STRING_SVTOOLS_RTF_FI "\\fi" +#define OOO_STRING_SVTOOLS_RTF_FIELD "\\field" +#define OOO_STRING_SVTOOLS_RTF_FLDDIRTY "\\flddirty" +#define OOO_STRING_SVTOOLS_RTF_FLDEDIT "\\fldedit" +#define OOO_STRING_SVTOOLS_RTF_FLDINST "\\fldinst" +#define OOO_STRING_SVTOOLS_RTF_FLDLOCK "\\fldlock" +#define OOO_STRING_SVTOOLS_RTF_FLDPRIV "\\fldpriv" +#define OOO_STRING_SVTOOLS_RTF_FLDRSLT "\\fldrslt" +#define OOO_STRING_SVTOOLS_RTF_FMODERN "\\fmodern" +#define OOO_STRING_SVTOOLS_RTF_FN "\\fn" +#define OOO_STRING_SVTOOLS_RTF_FNIL "\\fnil" +#define OOO_STRING_SVTOOLS_RTF_FONTTBL "\\fonttbl" +#define OOO_STRING_SVTOOLS_RTF_FOOTER "\\footer" +#define OOO_STRING_SVTOOLS_RTF_FOOTERF "\\footerf" +#define OOO_STRING_SVTOOLS_RTF_FOOTERL "\\footerl" +#define OOO_STRING_SVTOOLS_RTF_FOOTERR "\\footerr" +#define OOO_STRING_SVTOOLS_RTF_FOOTERY "\\footery" +#define OOO_STRING_SVTOOLS_RTF_FOOTNOTE "\\footnote" +#define OOO_STRING_SVTOOLS_RTF_FPRQ "\\fprq" +#define OOO_STRING_SVTOOLS_RTF_FRACWIDTH "\\fracwidth" +#define OOO_STRING_SVTOOLS_RTF_FROMAN "\\froman" +#define OOO_STRING_SVTOOLS_RTF_FS "\\fs" +#define OOO_STRING_SVTOOLS_RTF_FSCRIPT "\\fscript" +#define OOO_STRING_SVTOOLS_RTF_FSWISS "\\fswiss" +#define OOO_STRING_SVTOOLS_RTF_FTECH "\\ftech" +#define OOO_STRING_SVTOOLS_RTF_FTNBJ "\\ftnbj" +#define OOO_STRING_SVTOOLS_RTF_FTNCN "\\ftncn" +#define OOO_STRING_SVTOOLS_RTF_FTNRESTART "\\ftnrestart" +#define OOO_STRING_SVTOOLS_RTF_FTNSEP "\\ftnsep" +#define OOO_STRING_SVTOOLS_RTF_FTNSEPC "\\ftnsepc" +#define OOO_STRING_SVTOOLS_RTF_FTNSTART "\\ftnstart" +#define OOO_STRING_SVTOOLS_RTF_FTNTJ "\\ftntj" +#define OOO_STRING_SVTOOLS_RTF_GREEN "\\green" +#define OOO_STRING_SVTOOLS_RTF_GUTTER "\\gutter" +#define OOO_STRING_SVTOOLS_RTF_GUTTERSXN "\\guttersxn" +#define OOO_STRING_SVTOOLS_RTF_HEADER "\\header" +#define OOO_STRING_SVTOOLS_RTF_HEADERF "\\headerf" +#define OOO_STRING_SVTOOLS_RTF_HEADERL "\\headerl" +#define OOO_STRING_SVTOOLS_RTF_HEADERR "\\headerr" +#define OOO_STRING_SVTOOLS_RTF_HEADERY "\\headery" +#define OOO_STRING_SVTOOLS_RTF_HR "\\hr" +#define OOO_STRING_SVTOOLS_RTF_HYPHHOTZ "\\hyphhotz" +#define OOO_STRING_SVTOOLS_RTF_I "\\i" +#define OOO_STRING_SVTOOLS_RTF_ID "\\id" +#define OOO_STRING_SVTOOLS_RTF_INFO "\\info" +#define OOO_STRING_SVTOOLS_RTF_INTBL "\\intbl" +#define OOO_STRING_SVTOOLS_RTF_IXE "\\ixe" +#define OOO_STRING_SVTOOLS_RTF_KEEP "\\keep" +#define OOO_STRING_SVTOOLS_RTF_KEEPN "\\keepn" +#define OOO_STRING_SVTOOLS_RTF_KERNING "\\kerning" +#define OOO_STRING_SVTOOLS_RTF_KEYCODE "\\keycode" +#define OOO_STRING_SVTOOLS_RTF_KEYWORDS "\\keywords" +#define OOO_STRING_SVTOOLS_RTF_LANDSCAPE "\\landscape" +#define OOO_STRING_SVTOOLS_RTF_LANG "\\lang" +#define OOO_STRING_SVTOOLS_RTF_LDBLQUOTE "\\ldblquote" +#define OOO_STRING_SVTOOLS_RTF_LEVEL "\\level" +#define OOO_STRING_SVTOOLS_RTF_LI "\\li" +#define OOO_STRING_SVTOOLS_RTF_LIN "\\lin" +#define OOO_STRING_SVTOOLS_RTF_LINE "\\line" +#define OOO_STRING_SVTOOLS_RTF_LINEBETCOL "\\linebetcol" +#define OOO_STRING_SVTOOLS_RTF_LINECONT "\\linecont" +#define OOO_STRING_SVTOOLS_RTF_LINEMOD "\\linemod" +#define OOO_STRING_SVTOOLS_RTF_LINEPPAGE "\\lineppage" +#define OOO_STRING_SVTOOLS_RTF_LINERESTART "\\linerestart" +#define OOO_STRING_SVTOOLS_RTF_LINESTART "\\linestart" +#define OOO_STRING_SVTOOLS_RTF_LINESTARTS "\\linestarts" +#define OOO_STRING_SVTOOLS_RTF_LINEX "\\linex" +#define OOO_STRING_SVTOOLS_RTF_LNDSCPSXN "\\lndscpsxn" +#define OOO_STRING_SVTOOLS_RTF_LQUOTE "\\lquote" +#define OOO_STRING_SVTOOLS_RTF_MAC "\\mac" +#define OOO_STRING_SVTOOLS_RTF_MACPICT "\\macpict" +#define OOO_STRING_SVTOOLS_RTF_MAKEBACKUP "\\makebackup" +#define OOO_STRING_SVTOOLS_RTF_MARGB "\\margb" +#define OOO_STRING_SVTOOLS_RTF_MARGBSXN "\\margbsxn" +#define OOO_STRING_SVTOOLS_RTF_MARGL "\\margl" +#define OOO_STRING_SVTOOLS_RTF_MARGLSXN "\\marglsxn" +#define OOO_STRING_SVTOOLS_RTF_MARGMIRROR "\\margmirror" +#define OOO_STRING_SVTOOLS_RTF_MARGR "\\margr" +#define OOO_STRING_SVTOOLS_RTF_MARGRSXN "\\margrsxn" +#define OOO_STRING_SVTOOLS_RTF_MARGT "\\margt" +#define OOO_STRING_SVTOOLS_RTF_MARGTSXN "\\margtsxn" +#define OOO_STRING_SVTOOLS_RTF_MIN "\\min" +#define OOO_STRING_SVTOOLS_RTF_MO "\\mo" +#define OOO_STRING_SVTOOLS_RTF_NEXTCSET "\\nextcset" +#define OOO_STRING_SVTOOLS_RTF_NEXTFILE "\\nextfile" +#define OOO_STRING_SVTOOLS_RTF_NOFCHARS "\\nofchars" +#define OOO_STRING_SVTOOLS_RTF_NOFPAGES "\\nofpages" +#define OOO_STRING_SVTOOLS_RTF_NOFWORDS "\\nofwords" +#define OOO_STRING_SVTOOLS_RTF_NOLINE "\\noline" +#define OOO_STRING_SVTOOLS_RTF_NOSUPERSUB "\\nosupersub" +#define OOO_STRING_SVTOOLS_RTF_NOWRAP "\\nowrap" +#define OOO_STRING_SVTOOLS_RTF_OPERATOR "\\operator" +#define OOO_STRING_SVTOOLS_RTF_OUTL "\\outl" +#define OOO_STRING_SVTOOLS_RTF_PAGE "\\page" +#define OOO_STRING_SVTOOLS_RTF_PAGEBB "\\pagebb" +#define OOO_STRING_SVTOOLS_RTF_PAPERH "\\paperh" +#define OOO_STRING_SVTOOLS_RTF_PAPERW "\\paperw" +#define OOO_STRING_SVTOOLS_RTF_PAR "\\par" +#define OOO_STRING_SVTOOLS_RTF_PARD "\\pard" +#define OOO_STRING_SVTOOLS_RTF_PC "\\pc" +#define OOO_STRING_SVTOOLS_RTF_PCA "\\pca" +#define OOO_STRING_SVTOOLS_RTF_PGHSXN "\\pghsxn" +#define OOO_STRING_SVTOOLS_RTF_PGNCONT "\\pgncont" +#define OOO_STRING_SVTOOLS_RTF_PGNDEC "\\pgndec" +#define OOO_STRING_SVTOOLS_RTF_PGNLCLTR "\\pgnlcltr" +#define OOO_STRING_SVTOOLS_RTF_PGNLCRM "\\pgnlcrm" +#define OOO_STRING_SVTOOLS_RTF_PGNRESTART "\\pgnrestart" +#define OOO_STRING_SVTOOLS_RTF_PGNSTART "\\pgnstart" +#define OOO_STRING_SVTOOLS_RTF_PGNSTARTS "\\pgnstarts" +#define OOO_STRING_SVTOOLS_RTF_PGNUCLTR "\\pgnucltr" +#define OOO_STRING_SVTOOLS_RTF_PGNUCRM "\\pgnucrm" +#define OOO_STRING_SVTOOLS_RTF_PGNX "\\pgnx" +#define OOO_STRING_SVTOOLS_RTF_PGNY "\\pgny" +#define OOO_STRING_SVTOOLS_RTF_PGWSXN "\\pgwsxn" +#define OOO_STRING_SVTOOLS_RTF_PHCOL "\\phcol" +#define OOO_STRING_SVTOOLS_RTF_PHMRG "\\phmrg" +#define OOO_STRING_SVTOOLS_RTF_PHPG "\\phpg" +#define OOO_STRING_SVTOOLS_RTF_PICCROPB "\\piccropb" +#define OOO_STRING_SVTOOLS_RTF_PICCROPL "\\piccropl" +#define OOO_STRING_SVTOOLS_RTF_PICCROPR "\\piccropr" +#define OOO_STRING_SVTOOLS_RTF_PICCROPT "\\piccropt" +#define OOO_STRING_SVTOOLS_RTF_PICH "\\pich" +#define OOO_STRING_SVTOOLS_RTF_PICHGOAL "\\pichgoal" +#define OOO_STRING_SVTOOLS_RTF_PICSCALED "\\picscaled" +#define OOO_STRING_SVTOOLS_RTF_PICSCALEX "\\picscalex" +#define OOO_STRING_SVTOOLS_RTF_PICSCALEY "\\picscaley" +#define OOO_STRING_SVTOOLS_RTF_PICT "\\pict" +#define OOO_STRING_SVTOOLS_RTF_PICW "\\picw" +#define OOO_STRING_SVTOOLS_RTF_PICWGOAL "\\picwgoal" +#define OOO_STRING_SVTOOLS_RTF_PLAIN "\\plain" +#define OOO_STRING_SVTOOLS_RTF_PMMETAFILE "\\pmmetafile" +#define OOO_STRING_SVTOOLS_RTF_POSNEGX "\\posnegx" +#define OOO_STRING_SVTOOLS_RTF_POSNEGY "\\posnegy" +#define OOO_STRING_SVTOOLS_RTF_POSX "\\posx" +#define OOO_STRING_SVTOOLS_RTF_POSXC "\\posxc" +#define OOO_STRING_SVTOOLS_RTF_POSXI "\\posxi" +#define OOO_STRING_SVTOOLS_RTF_POSXL "\\posxl" +#define OOO_STRING_SVTOOLS_RTF_POSXO "\\posxo" +#define OOO_STRING_SVTOOLS_RTF_POSXR "\\posxr" +#define OOO_STRING_SVTOOLS_RTF_POSY "\\posy" +#define OOO_STRING_SVTOOLS_RTF_POSYB "\\posyb" +#define OOO_STRING_SVTOOLS_RTF_POSYC "\\posyc" +#define OOO_STRING_SVTOOLS_RTF_POSYIL "\\posyil" +#define OOO_STRING_SVTOOLS_RTF_POSYT "\\posyt" +#define OOO_STRING_SVTOOLS_RTF_PRINTIM "\\printim" +#define OOO_STRING_SVTOOLS_RTF_PSOVER "\\psover" +#define OOO_STRING_SVTOOLS_RTF_PVMRG "\\pvmrg" +#define OOO_STRING_SVTOOLS_RTF_PVPARA "\\pvpara" +#define OOO_STRING_SVTOOLS_RTF_PVPG "\\pvpg" +#define OOO_STRING_SVTOOLS_RTF_QC "\\qc" +#define OOO_STRING_SVTOOLS_RTF_QD "\\qd" +#define OOO_STRING_SVTOOLS_RTF_QJ "\\qj" +#define OOO_STRING_SVTOOLS_RTF_QL "\\ql" +#define OOO_STRING_SVTOOLS_RTF_QR "\\qr" +#define OOO_STRING_SVTOOLS_RTF_RDBLQUOTE "\\rdblquote" +#define OOO_STRING_SVTOOLS_RTF_RED "\\red" +#define OOO_STRING_SVTOOLS_RTF_REVBAR "\\revbar" +#define OOO_STRING_SVTOOLS_RTF_REVISED "\\revised" +#define OOO_STRING_SVTOOLS_RTF_REVISIONS "\\revisions" +#define OOO_STRING_SVTOOLS_RTF_REVPROP "\\revprop" +#define OOO_STRING_SVTOOLS_RTF_REVTIM "\\revtim" +#define OOO_STRING_SVTOOLS_RTF_RI "\\ri" +#define OOO_STRING_SVTOOLS_RTF_RIN "\\rin" +#define OOO_STRING_SVTOOLS_RTF_ROW "\\row" +#define OOO_STRING_SVTOOLS_RTF_RQUOTE "\\rquote" +#define OOO_STRING_SVTOOLS_RTF_RTF "\\rtf" +#define OOO_STRING_SVTOOLS_RTF_RXE "\\rxe" +#define OOO_STRING_SVTOOLS_RTF_S "\\s" +#define OOO_STRING_SVTOOLS_RTF_SA "\\sa" +#define OOO_STRING_SVTOOLS_RTF_SB "\\sb" +#define OOO_STRING_SVTOOLS_RTF_SBASEDON "\\sbasedon" +#define OOO_STRING_SVTOOLS_RTF_SBKCOL "\\sbkcol" +#define OOO_STRING_SVTOOLS_RTF_SBKEVEN "\\sbkeven" +#define OOO_STRING_SVTOOLS_RTF_SBKNONE "\\sbknone" +#define OOO_STRING_SVTOOLS_RTF_SBKODD "\\sbkodd" +#define OOO_STRING_SVTOOLS_RTF_SBKPAGE "\\sbkpage" +#define OOO_STRING_SVTOOLS_RTF_SBYS "\\sbys" +#define OOO_STRING_SVTOOLS_RTF_SCAPS "\\scaps" +#define OOO_STRING_SVTOOLS_RTF_SECT "\\sect" +#define OOO_STRING_SVTOOLS_RTF_SECTD "\\sectd" +#define OOO_STRING_SVTOOLS_RTF_SHAD "\\shad" +#define OOO_STRING_SVTOOLS_RTF_SHADING "\\shading" +#define OOO_STRING_SVTOOLS_RTF_SHIFT "\\shift" +#define OOO_STRING_SVTOOLS_RTF_SL "\\sl" +#define OOO_STRING_SVTOOLS_RTF_SNEXT "\\snext" +#define OOO_STRING_SVTOOLS_RTF_STRIKE "\\strike" +#define OOO_STRING_SVTOOLS_RTF_STYLESHEET "\\stylesheet" +#define OOO_STRING_SVTOOLS_RTF_SUB "\\sub" +#define OOO_STRING_SVTOOLS_RTF_SUBJECT "\\subject" +#define OOO_STRING_SVTOOLS_RTF_SUPER "\\super" +#define OOO_STRING_SVTOOLS_RTF_TAB "\\tab" +#define OOO_STRING_SVTOOLS_RTF_TB "\\tb" +#define OOO_STRING_SVTOOLS_RTF_TC "\\tc" +#define OOO_STRING_SVTOOLS_RTF_TCF "\\tcf" +#define OOO_STRING_SVTOOLS_RTF_TCL "\\tcl" +#define OOO_STRING_SVTOOLS_RTF_TEMPLATE "\\template" +#define OOO_STRING_SVTOOLS_RTF_TITLE "\\title" +#define OOO_STRING_SVTOOLS_RTF_TITLEPG "\\titlepg" +#define OOO_STRING_SVTOOLS_RTF_TLDOT "\\tldot" +#define OOO_STRING_SVTOOLS_RTF_TLEQ "\\tleq" +#define OOO_STRING_SVTOOLS_RTF_TLHYPH "\\tlhyph" +#define OOO_STRING_SVTOOLS_RTF_TLTH "\\tlth" +#define OOO_STRING_SVTOOLS_RTF_TLUL "\\tlul" +#define OOO_STRING_SVTOOLS_RTF_TQC "\\tqc" +#define OOO_STRING_SVTOOLS_RTF_TQDEC "\\tqdec" +#define OOO_STRING_SVTOOLS_RTF_TQR "\\tqr" +#define OOO_STRING_SVTOOLS_RTF_TQL "\\tql" +#define OOO_STRING_SVTOOLS_RTF_TRGAPH "\\trgaph" +#define OOO_STRING_SVTOOLS_RTF_TRLEFT "\\trleft" +#define OOO_STRING_SVTOOLS_RTF_TROWD "\\trowd" +#define OOO_STRING_SVTOOLS_RTF_TRQC "\\trqc" +#define OOO_STRING_SVTOOLS_RTF_TRQL "\\trql" +#define OOO_STRING_SVTOOLS_RTF_TRQR "\\trqr" +#define OOO_STRING_SVTOOLS_RTF_TRRH "\\trrh" +#define OOO_STRING_SVTOOLS_RTF_TX "\\tx" +#define OOO_STRING_SVTOOLS_RTF_TXE "\\txe" +#define OOO_STRING_SVTOOLS_RTF_UL "\\ul" +#define OOO_STRING_SVTOOLS_RTF_ULD "\\uld" +#define OOO_STRING_SVTOOLS_RTF_ULDB "\\uldb" +#define OOO_STRING_SVTOOLS_RTF_ULNONE "\\ulnone" +#define OOO_STRING_SVTOOLS_RTF_ULW "\\ulw" +#define OOO_STRING_SVTOOLS_RTF_UP "\\up" +#define OOO_STRING_SVTOOLS_RTF_V "\\v" +#define OOO_STRING_SVTOOLS_RTF_VERN "\\vern" +#define OOO_STRING_SVTOOLS_RTF_VERSION "\\version" +#define OOO_STRING_SVTOOLS_RTF_VERTALB "\\vertalb" +#define OOO_STRING_SVTOOLS_RTF_VERTALC "\\vertalc" +#define OOO_STRING_SVTOOLS_RTF_VERTALJ "\\vertalj" +#define OOO_STRING_SVTOOLS_RTF_VERTALT "\\vertalt" +#define OOO_STRING_SVTOOLS_RTF_WBITMAP "\\wbitmap" +#define OOO_STRING_SVTOOLS_RTF_WBMBITSPIXEL "\\wbmbitspixel" +#define OOO_STRING_SVTOOLS_RTF_WBMPLANES "\\wbmplanes" +#define OOO_STRING_SVTOOLS_RTF_WBMWIDTHBYTES "\\wbmwidthbytes" +#define OOO_STRING_SVTOOLS_RTF_WIDOWCTRL "\\widowctrl" +#define OOO_STRING_SVTOOLS_RTF_WMETAFILE "\\wmetafile" +#define OOO_STRING_SVTOOLS_RTF_XE "\\xe" +#define OOO_STRING_SVTOOLS_RTF_YR "\\yr" +#define OOO_STRING_SVTOOLS_RTF_NOBRKHYPH "\\_" +#define OOO_STRING_SVTOOLS_RTF_FORMULA "\\|" +#define OOO_STRING_SVTOOLS_RTF_NOBREAK "\\~" +#define OOO_STRING_SVTOOLS_RTF_AB "\\ab" +#define OOO_STRING_SVTOOLS_RTF_ACAPS "\\acaps" +#define OOO_STRING_SVTOOLS_RTF_ACF "\\acf" +#define OOO_STRING_SVTOOLS_RTF_ADDITIVE "\\additive" +#define OOO_STRING_SVTOOLS_RTF_ADN "\\adn" +#define OOO_STRING_SVTOOLS_RTF_AENDDOC "\\aenddoc" +#define OOO_STRING_SVTOOLS_RTF_AENDNOTES "\\aendnotes" +#define OOO_STRING_SVTOOLS_RTF_AEXPND "\\aexpnd" +#define OOO_STRING_SVTOOLS_RTF_AF "\\af" +#define OOO_STRING_SVTOOLS_RTF_AFS "\\afs" +#define OOO_STRING_SVTOOLS_RTF_AFTNBJ "\\aftnbj" +#define OOO_STRING_SVTOOLS_RTF_AFTNCN "\\aftncn" +#define OOO_STRING_SVTOOLS_RTF_AFTNNALC "\\aftnnalc" +#define OOO_STRING_SVTOOLS_RTF_AFTNNAR "\\aftnnar" +#define OOO_STRING_SVTOOLS_RTF_AFTNNAUC "\\aftnnauc" +#define OOO_STRING_SVTOOLS_RTF_AFTNNCHI "\\aftnnchi" +#define OOO_STRING_SVTOOLS_RTF_AFTNNRLC "\\aftnnrlc" +#define OOO_STRING_SVTOOLS_RTF_AFTNNRUC "\\aftnnruc" +#define OOO_STRING_SVTOOLS_RTF_SAFTNNALC "\\saftnnalc" +#define OOO_STRING_SVTOOLS_RTF_SAFTNNAR "\\saftnnar" +#define OOO_STRING_SVTOOLS_RTF_SAFTNNAUC "\\saftnnauc" +#define OOO_STRING_SVTOOLS_RTF_SAFTNNCHI "\\saftnnchi" +#define OOO_STRING_SVTOOLS_RTF_SAFTNNRLC "\\saftnnrlc" +#define OOO_STRING_SVTOOLS_RTF_SAFTNNRUC "\\saftnnruc" +#define OOO_STRING_SVTOOLS_RTF_AFTNRESTART "\\aftnrestart" +#define OOO_STRING_SVTOOLS_RTF_AFTNRSTCONT "\\aftnrstcont" +#define OOO_STRING_SVTOOLS_RTF_AFTNSEP "\\aftnsep" +#define OOO_STRING_SVTOOLS_RTF_AFTNSEPC "\\aftnsepc" +#define OOO_STRING_SVTOOLS_RTF_AFTNSTART "\\aftnstart" +#define OOO_STRING_SVTOOLS_RTF_AFTNTJ "\\aftntj" +#define OOO_STRING_SVTOOLS_RTF_AI "\\ai" +#define OOO_STRING_SVTOOLS_RTF_ALANG "\\alang" +#define OOO_STRING_SVTOOLS_RTF_ALLPROT "\\allprot" +#define OOO_STRING_SVTOOLS_RTF_ANNOTPROT "\\annotprot" +#define OOO_STRING_SVTOOLS_RTF_AOUTL "\\aoutl" +#define OOO_STRING_SVTOOLS_RTF_ASCAPS "\\ascaps" +#define OOO_STRING_SVTOOLS_RTF_ASHAD "\\ashad" +#define OOO_STRING_SVTOOLS_RTF_ASTRIKE "\\astrike" +#define OOO_STRING_SVTOOLS_RTF_ATNAUTHOR "\\atnauthor" +#define OOO_STRING_SVTOOLS_RTF_ATNICN "\\atnicn" +#define OOO_STRING_SVTOOLS_RTF_ATNREF "\\atnref" +#define OOO_STRING_SVTOOLS_RTF_ATNTIME "\\atntime" +#define OOO_STRING_SVTOOLS_RTF_ATRFEND "\\atrfend" +#define OOO_STRING_SVTOOLS_RTF_ATRFSTART "\\atrfstart" +#define OOO_STRING_SVTOOLS_RTF_AUL "\\aul" +#define OOO_STRING_SVTOOLS_RTF_AULD "\\auld" +#define OOO_STRING_SVTOOLS_RTF_AULDB "\\auldb" +#define OOO_STRING_SVTOOLS_RTF_AULNONE "\\aulnone" +#define OOO_STRING_SVTOOLS_RTF_AULW "\\aulw" +#define OOO_STRING_SVTOOLS_RTF_AUP "\\aup" +#define OOO_STRING_SVTOOLS_RTF_BKMKPUB "\\bkmkpub" +#define OOO_STRING_SVTOOLS_RTF_BRKFRM "\\brkfrm" +#define OOO_STRING_SVTOOLS_RTF_CCHS "\\cchs" +#define OOO_STRING_SVTOOLS_RTF_CPG "\\cpg" +#define OOO_STRING_SVTOOLS_RTF_CS "\\cs" +#define OOO_STRING_SVTOOLS_RTF_CVMME "\\cvmme" +#define OOO_STRING_SVTOOLS_RTF_DATAFIELD "\\datafield" +#define OOO_STRING_SVTOOLS_RTF_DO "\\do" +#define OOO_STRING_SVTOOLS_RTF_DOBXCOLUMN "\\dobxcolumn" +#define OOO_STRING_SVTOOLS_RTF_DOBXMARGIN "\\dobxmargin" +#define OOO_STRING_SVTOOLS_RTF_DOBXPAGE "\\dobxpage" +#define OOO_STRING_SVTOOLS_RTF_DOBYMARGIN "\\dobymargin" +#define OOO_STRING_SVTOOLS_RTF_DOBYPAGE "\\dobypage" +#define OOO_STRING_SVTOOLS_RTF_DOBYPARA "\\dobypara" +#define OOO_STRING_SVTOOLS_RTF_DODHGT "\\dodhgt" +#define OOO_STRING_SVTOOLS_RTF_DOLOCK "\\dolock" +#define OOO_STRING_SVTOOLS_RTF_DPAENDHOL "\\dpaendhol" +#define OOO_STRING_SVTOOLS_RTF_DPAENDL "\\dpaendl" +#define OOO_STRING_SVTOOLS_RTF_DPAENDSOL "\\dpaendsol" +#define OOO_STRING_SVTOOLS_RTF_DPAENDW "\\dpaendw" +#define OOO_STRING_SVTOOLS_RTF_DPARC "\\dparc" +#define OOO_STRING_SVTOOLS_RTF_DPARCFLIPX "\\dparcflipx" +#define OOO_STRING_SVTOOLS_RTF_DPARCFLIPY "\\dparcflipy" +#define OOO_STRING_SVTOOLS_RTF_DPASTARTHOL "\\dpastarthol" +#define OOO_STRING_SVTOOLS_RTF_DPASTARTL "\\dpastartl" +#define OOO_STRING_SVTOOLS_RTF_DPASTARTSOL "\\dpastartsol" +#define OOO_STRING_SVTOOLS_RTF_DPASTARTW "\\dpastartw" +#define OOO_STRING_SVTOOLS_RTF_DPCALLOUT "\\dpcallout" +#define OOO_STRING_SVTOOLS_RTF_DPCOA "\\dpcoa" +#define OOO_STRING_SVTOOLS_RTF_DPCOACCENT "\\dpcoaccent" +#define OOO_STRING_SVTOOLS_RTF_DPCOBESTFIT "\\dpcobestfit" +#define OOO_STRING_SVTOOLS_RTF_DPCOBORDER "\\dpcoborder" +#define OOO_STRING_SVTOOLS_RTF_DPCODABS "\\dpcodabs" +#define OOO_STRING_SVTOOLS_RTF_DPCODBOTTOM "\\dpcodbottom" +#define OOO_STRING_SVTOOLS_RTF_DPCODCENTER "\\dpcodcenter" +#define OOO_STRING_SVTOOLS_RTF_DPCODTOP "\\dpcodtop" +#define OOO_STRING_SVTOOLS_RTF_DPCOLENGTH "\\dpcolength" +#define OOO_STRING_SVTOOLS_RTF_DPCOMINUSX "\\dpcominusx" +#define OOO_STRING_SVTOOLS_RTF_DPCOMINUSY "\\dpcominusy" +#define OOO_STRING_SVTOOLS_RTF_DPCOOFFSET "\\dpcooffset" +#define OOO_STRING_SVTOOLS_RTF_DPCOSMARTA "\\dpcosmarta" +#define OOO_STRING_SVTOOLS_RTF_DPCOTDOUBLE "\\dpcotdouble" +#define OOO_STRING_SVTOOLS_RTF_DPCOTRIGHT "\\dpcotright" +#define OOO_STRING_SVTOOLS_RTF_DPCOTSINGLE "\\dpcotsingle" +#define OOO_STRING_SVTOOLS_RTF_DPCOTTRIPLE "\\dpcottriple" +#define OOO_STRING_SVTOOLS_RTF_DPCOUNT "\\dpcount" +#define OOO_STRING_SVTOOLS_RTF_DPELLIPSE "\\dpellipse" +#define OOO_STRING_SVTOOLS_RTF_DPENDGROUP "\\dpendgroup" +#define OOO_STRING_SVTOOLS_RTF_DPFILLBGCB "\\dpfillbgcb" +#define OOO_STRING_SVTOOLS_RTF_DPFILLBGCG "\\dpfillbgcg" +#define OOO_STRING_SVTOOLS_RTF_DPFILLBGCR "\\dpfillbgcr" +#define OOO_STRING_SVTOOLS_RTF_DPFILLBGGRAY "\\dpfillbggray" +#define OOO_STRING_SVTOOLS_RTF_DPFILLBGPAL "\\dpfillbgpal" +#define OOO_STRING_SVTOOLS_RTF_DPFILLFGCB "\\dpfillfgcb" +#define OOO_STRING_SVTOOLS_RTF_DPFILLFGCG "\\dpfillfgcg" +#define OOO_STRING_SVTOOLS_RTF_DPFILLFGCR "\\dpfillfgcr" +#define OOO_STRING_SVTOOLS_RTF_DPFILLFGGRAY "\\dpfillfggray" +#define OOO_STRING_SVTOOLS_RTF_DPFILLFGPAL "\\dpfillfgpal" +#define OOO_STRING_SVTOOLS_RTF_DPFILLPAT "\\dpfillpat" +#define OOO_STRING_SVTOOLS_RTF_DPGROUP "\\dpgroup" +#define OOO_STRING_SVTOOLS_RTF_DPLINE "\\dpline" +#define OOO_STRING_SVTOOLS_RTF_DPLINECOB "\\dplinecob" +#define OOO_STRING_SVTOOLS_RTF_DPLINECOG "\\dplinecog" +#define OOO_STRING_SVTOOLS_RTF_DPLINECOR "\\dplinecor" +#define OOO_STRING_SVTOOLS_RTF_DPLINEDADO "\\dplinedado" +#define OOO_STRING_SVTOOLS_RTF_DPLINEDADODO "\\dplinedadodo" +#define OOO_STRING_SVTOOLS_RTF_DPLINEDASH "\\dplinedash" +#define OOO_STRING_SVTOOLS_RTF_DPLINEDOT "\\dplinedot" +#define OOO_STRING_SVTOOLS_RTF_DPLINEGRAY "\\dplinegray" +#define OOO_STRING_SVTOOLS_RTF_DPLINEHOLLOW "\\dplinehollow" +#define OOO_STRING_SVTOOLS_RTF_DPLINEPAL "\\dplinepal" +#define OOO_STRING_SVTOOLS_RTF_DPLINESOLID "\\dplinesolid" +#define OOO_STRING_SVTOOLS_RTF_DPLINEW "\\dplinew" +#define OOO_STRING_SVTOOLS_RTF_DPPOLYCOUNT "\\dppolycount" +#define OOO_STRING_SVTOOLS_RTF_DPPOLYGON "\\dppolygon" +#define OOO_STRING_SVTOOLS_RTF_DPPOLYLINE "\\dppolyline" +#define OOO_STRING_SVTOOLS_RTF_DPPTX "\\dpptx" +#define OOO_STRING_SVTOOLS_RTF_DPPTY "\\dppty" +#define OOO_STRING_SVTOOLS_RTF_DPRECT "\\dprect" +#define OOO_STRING_SVTOOLS_RTF_DPROUNDR "\\dproundr" +#define OOO_STRING_SVTOOLS_RTF_DPSHADOW "\\dpshadow" +#define OOO_STRING_SVTOOLS_RTF_DPSHADX "\\dpshadx" +#define OOO_STRING_SVTOOLS_RTF_DPSHADY "\\dpshady" +#define OOO_STRING_SVTOOLS_RTF_DPTXBX "\\dptxbx" +#define OOO_STRING_SVTOOLS_RTF_DPTXBXMAR "\\dptxbxmar" +#define OOO_STRING_SVTOOLS_RTF_DPTXBXTEXT "\\dptxbxtext" +#define OOO_STRING_SVTOOLS_RTF_DPX "\\dpx" +#define OOO_STRING_SVTOOLS_RTF_DPXSIZE "\\dpxsize" +#define OOO_STRING_SVTOOLS_RTF_DPY "\\dpy" +#define OOO_STRING_SVTOOLS_RTF_DPYSIZE "\\dpysize" +#define OOO_STRING_SVTOOLS_RTF_DS "\\ds" +#define OOO_STRING_SVTOOLS_RTF_EMSPACE "\\emspace" +#define OOO_STRING_SVTOOLS_RTF_ENSPACE "\\enspace" +#define OOO_STRING_SVTOOLS_RTF_FBIDI "\\fbidi" +#define OOO_STRING_SVTOOLS_RTF_FET "\\fet" +#define OOO_STRING_SVTOOLS_RTF_FID "\\fid" +#define OOO_STRING_SVTOOLS_RTF_FILE "\\file" +#define OOO_STRING_SVTOOLS_RTF_FILETBL "\\filetbl" +#define OOO_STRING_SVTOOLS_RTF_FLDALT "\\fldalt" +#define OOO_STRING_SVTOOLS_RTF_FNETWORK "\\fnetwork" +#define OOO_STRING_SVTOOLS_RTF_FONTEMB "\\fontemb" +#define OOO_STRING_SVTOOLS_RTF_FONTFILE "\\fontfile" +#define OOO_STRING_SVTOOLS_RTF_FORMDISP "\\formdisp" +#define OOO_STRING_SVTOOLS_RTF_FORMPROT "\\formprot" +#define OOO_STRING_SVTOOLS_RTF_FORMSHADE "\\formshade" +#define OOO_STRING_SVTOOLS_RTF_FOSNUM "\\fosnum" +#define OOO_STRING_SVTOOLS_RTF_FRELATIVE "\\frelative" +#define OOO_STRING_SVTOOLS_RTF_FTNALT "\\ftnalt" +#define OOO_STRING_SVTOOLS_RTF_FTNIL "\\ftnil" +#define OOO_STRING_SVTOOLS_RTF_FTNNALC "\\ftnnalc" +#define OOO_STRING_SVTOOLS_RTF_FTNNAR "\\ftnnar" +#define OOO_STRING_SVTOOLS_RTF_FTNNAUC "\\ftnnauc" +#define OOO_STRING_SVTOOLS_RTF_FTNNCHI "\\ftnnchi" +#define OOO_STRING_SVTOOLS_RTF_FTNNRLC "\\ftnnrlc" +#define OOO_STRING_SVTOOLS_RTF_FTNNRUC "\\ftnnruc" +#define OOO_STRING_SVTOOLS_RTF_SFTNNALC "\\sftnnalc" +#define OOO_STRING_SVTOOLS_RTF_SFTNNAR "\\sftnnar" +#define OOO_STRING_SVTOOLS_RTF_SFTNNAUC "\\sftnnauc" +#define OOO_STRING_SVTOOLS_RTF_SFTNNCHI "\\sftnnchi" +#define OOO_STRING_SVTOOLS_RTF_SFTNNRLC "\\sftnnrlc" +#define OOO_STRING_SVTOOLS_RTF_SFTNNRUC "\\sftnnruc" +#define OOO_STRING_SVTOOLS_RTF_FTNRSTCONT "\\ftnrstcont" +#define OOO_STRING_SVTOOLS_RTF_FTNRSTPG "\\ftnrstpg" +#define OOO_STRING_SVTOOLS_RTF_FTTRUETYPE "\\fttruetype" +#define OOO_STRING_SVTOOLS_RTF_FVALIDDOS "\\fvaliddos" +#define OOO_STRING_SVTOOLS_RTF_FVALIDHPFS "\\fvalidhpfs" +#define OOO_STRING_SVTOOLS_RTF_FVALIDMAC "\\fvalidmac" +#define OOO_STRING_SVTOOLS_RTF_FVALIDNTFS "\\fvalidntfs" +#define OOO_STRING_SVTOOLS_RTF_HYPHAUTO "\\hyphauto" +#define OOO_STRING_SVTOOLS_RTF_HYPHCAPS "\\hyphcaps" +#define OOO_STRING_SVTOOLS_RTF_HYPHCONSEC "\\hyphconsec" +#define OOO_STRING_SVTOOLS_RTF_HYPHPAR "\\hyphpar" +#define OOO_STRING_SVTOOLS_RTF_LINKSELF "\\linkself" +#define OOO_STRING_SVTOOLS_RTF_LINKSTYLES "\\linkstyles" +#define OOO_STRING_SVTOOLS_RTF_LTRCH "\\ltrch" +#define OOO_STRING_SVTOOLS_RTF_LTRDOC "\\ltrdoc" +#define OOO_STRING_SVTOOLS_RTF_LTRMARK "\\ltrmark" +#define OOO_STRING_SVTOOLS_RTF_LTRPAR "\\ltrpar" +#define OOO_STRING_SVTOOLS_RTF_LTRROW "\\ltrrow" +#define OOO_STRING_SVTOOLS_RTF_LTRSECT "\\ltrsect" +#define OOO_STRING_SVTOOLS_RTF_NOCOLBAL "\\nocolbal" +#define OOO_STRING_SVTOOLS_RTF_NOEXTRASPRL "\\noextrasprl" +#define OOO_STRING_SVTOOLS_RTF_NOTABIND "\\notabind" +#define OOO_STRING_SVTOOLS_RTF_NOWIDCTLPAR "\\nowidctlpar" +#define OOO_STRING_SVTOOLS_RTF_OBJALIAS "\\objalias" +#define OOO_STRING_SVTOOLS_RTF_OBJALIGN "\\objalign" +#define OOO_STRING_SVTOOLS_RTF_OBJAUTLINK "\\objautlink" +#define OOO_STRING_SVTOOLS_RTF_OBJCLASS "\\objclass" +#define OOO_STRING_SVTOOLS_RTF_OBJCROPB "\\objcropb" +#define OOO_STRING_SVTOOLS_RTF_OBJCROPL "\\objcropl" +#define OOO_STRING_SVTOOLS_RTF_OBJCROPR "\\objcropr" +#define OOO_STRING_SVTOOLS_RTF_OBJCROPT "\\objcropt" +#define OOO_STRING_SVTOOLS_RTF_OBJDATA "\\objdata" +#define OOO_STRING_SVTOOLS_RTF_OBJECT "\\object" +#define OOO_STRING_SVTOOLS_RTF_OBJEMB "\\objemb" +#define OOO_STRING_SVTOOLS_RTF_OBJH "\\objh" +#define OOO_STRING_SVTOOLS_RTF_OBJICEMB "\\objicemb" +#define OOO_STRING_SVTOOLS_RTF_OBJLINK "\\objlink" +#define OOO_STRING_SVTOOLS_RTF_OBJLOCK "\\objlock" +#define OOO_STRING_SVTOOLS_RTF_OBJNAME "\\objname" +#define OOO_STRING_SVTOOLS_RTF_OBJPUB "\\objpub" +#define OOO_STRING_SVTOOLS_RTF_OBJSCALEX "\\objscalex" +#define OOO_STRING_SVTOOLS_RTF_OBJSCALEY "\\objscaley" +#define OOO_STRING_SVTOOLS_RTF_OBJSECT "\\objsect" +#define OOO_STRING_SVTOOLS_RTF_OBJSETSIZE "\\objsetsize" +#define OOO_STRING_SVTOOLS_RTF_OBJSUB "\\objsub" +#define OOO_STRING_SVTOOLS_RTF_OBJTIME "\\objtime" +#define OOO_STRING_SVTOOLS_RTF_OBJTRANSY "\\objtransy" +#define OOO_STRING_SVTOOLS_RTF_OBJUPDATE "\\objupdate" +#define OOO_STRING_SVTOOLS_RTF_OBJW "\\objw" +#define OOO_STRING_SVTOOLS_RTF_OTBLRUL "\\otblrul" +#define OOO_STRING_SVTOOLS_RTF_PGNHN "\\pgnhn" +#define OOO_STRING_SVTOOLS_RTF_PGNHNSC "\\pgnhnsc" +#define OOO_STRING_SVTOOLS_RTF_PGNHNSH "\\pgnhnsh" +#define OOO_STRING_SVTOOLS_RTF_PGNHNSM "\\pgnhnsm" +#define OOO_STRING_SVTOOLS_RTF_PGNHNSN "\\pgnhnsn" +#define OOO_STRING_SVTOOLS_RTF_PGNHNSP "\\pgnhnsp" +#define OOO_STRING_SVTOOLS_RTF_PICBMP "\\picbmp" +#define OOO_STRING_SVTOOLS_RTF_PICBPP "\\picbpp" +#define OOO_STRING_SVTOOLS_RTF_PN "\\pn" +#define OOO_STRING_SVTOOLS_RTF_PNACROSS "\\pnacross" +#define OOO_STRING_SVTOOLS_RTF_PNB "\\pnb" +#define OOO_STRING_SVTOOLS_RTF_PNCAPS "\\pncaps" +#define OOO_STRING_SVTOOLS_RTF_PNCARD "\\pncard" +#define OOO_STRING_SVTOOLS_RTF_PNCF "\\pncf" +#define OOO_STRING_SVTOOLS_RTF_PNDEC "\\pndec" +#define OOO_STRING_SVTOOLS_RTF_PNF "\\pnf" +#define OOO_STRING_SVTOOLS_RTF_PNFS "\\pnfs" +#define OOO_STRING_SVTOOLS_RTF_PNHANG "\\pnhang" +#define OOO_STRING_SVTOOLS_RTF_PNI "\\pni" +#define OOO_STRING_SVTOOLS_RTF_PNINDENT "\\pnindent" +#define OOO_STRING_SVTOOLS_RTF_PNLCLTR "\\pnlcltr" +#define OOO_STRING_SVTOOLS_RTF_PNLCRM "\\pnlcrm" +#define OOO_STRING_SVTOOLS_RTF_PNLVL "\\pnlvl" +#define OOO_STRING_SVTOOLS_RTF_PNLVLBLT "\\pnlvlblt" +#define OOO_STRING_SVTOOLS_RTF_PNLVLBODY "\\pnlvlbody" +#define OOO_STRING_SVTOOLS_RTF_PNLVLCONT "\\pnlvlcont" +#define OOO_STRING_SVTOOLS_RTF_PNNUMONCE "\\pnnumonce" +#define OOO_STRING_SVTOOLS_RTF_PNORD "\\pnord" +#define OOO_STRING_SVTOOLS_RTF_PNORDT "\\pnordt" +#define OOO_STRING_SVTOOLS_RTF_PNPREV "\\pnprev" +#define OOO_STRING_SVTOOLS_RTF_PNQC "\\pnqc" +#define OOO_STRING_SVTOOLS_RTF_PNQL "\\pnql" +#define OOO_STRING_SVTOOLS_RTF_PNQR "\\pnqr" +#define OOO_STRING_SVTOOLS_RTF_PNRESTART "\\pnrestart" +#define OOO_STRING_SVTOOLS_RTF_PNSCAPS "\\pnscaps" +#define OOO_STRING_SVTOOLS_RTF_PNSECLVL "\\pnseclvl" +#define OOO_STRING_SVTOOLS_RTF_PNSP "\\pnsp" +#define OOO_STRING_SVTOOLS_RTF_PNSTART "\\pnstart" +#define OOO_STRING_SVTOOLS_RTF_PNSTRIKE "\\pnstrike" +#define OOO_STRING_SVTOOLS_RTF_PNTEXT "\\pntext" +#define OOO_STRING_SVTOOLS_RTF_PNTXTA "\\pntxta" +#define OOO_STRING_SVTOOLS_RTF_PNTXTB "\\pntxtb" +#define OOO_STRING_SVTOOLS_RTF_PNUCLTR "\\pnucltr" +#define OOO_STRING_SVTOOLS_RTF_PNUCRM "\\pnucrm" +#define OOO_STRING_SVTOOLS_RTF_PNUL "\\pnul" +#define OOO_STRING_SVTOOLS_RTF_PNULD "\\pnuld" +#define OOO_STRING_SVTOOLS_RTF_PNULDB "\\pnuldb" +#define OOO_STRING_SVTOOLS_RTF_PNULNONE "\\pnulnone" +#define OOO_STRING_SVTOOLS_RTF_PNULW "\\pnulw" +#define OOO_STRING_SVTOOLS_RTF_PRCOLBL "\\prcolbl" +#define OOO_STRING_SVTOOLS_RTF_PRINTDATA "\\printdata" +#define OOO_STRING_SVTOOLS_RTF_PSZ "\\psz" +#define OOO_STRING_SVTOOLS_RTF_PUBAUTO "\\pubauto" +#define OOO_STRING_SVTOOLS_RTF_RESULT "\\result" +#define OOO_STRING_SVTOOLS_RTF_REVAUTH "\\revauth" +#define OOO_STRING_SVTOOLS_RTF_REVDTTM "\\revdttm" +#define OOO_STRING_SVTOOLS_RTF_REVPROT "\\revprot" +#define OOO_STRING_SVTOOLS_RTF_REVTBL "\\revtbl" +#define OOO_STRING_SVTOOLS_RTF_RSLTBMP "\\rsltbmp" +#define OOO_STRING_SVTOOLS_RTF_RSLTMERGE "\\rsltmerge" +#define OOO_STRING_SVTOOLS_RTF_RSLTPICT "\\rsltpict" +#define OOO_STRING_SVTOOLS_RTF_RSLTRTF "\\rsltrtf" +#define OOO_STRING_SVTOOLS_RTF_RSLTTXT "\\rslttxt" +#define OOO_STRING_SVTOOLS_RTF_RTLCH "\\rtlch" +#define OOO_STRING_SVTOOLS_RTF_RTLDOC "\\rtldoc" +#define OOO_STRING_SVTOOLS_RTF_RTLMARK "\\rtlmark" +#define OOO_STRING_SVTOOLS_RTF_RTLPAR "\\rtlpar" +#define OOO_STRING_SVTOOLS_RTF_RTLROW "\\rtlrow" +#define OOO_STRING_SVTOOLS_RTF_RTLSECT "\\rtlsect" +#define OOO_STRING_SVTOOLS_RTF_SEC "\\sec" +#define OOO_STRING_SVTOOLS_RTF_SECTNUM "\\sectnum" +#define OOO_STRING_SVTOOLS_RTF_SECTUNLOCKED "\\sectunlocked" +#define OOO_STRING_SVTOOLS_RTF_SLMULT "\\slmult" +#define OOO_STRING_SVTOOLS_RTF_SOFTCOL "\\softcol" +#define OOO_STRING_SVTOOLS_RTF_SOFTLHEIGHT "\\softlheight" +#define OOO_STRING_SVTOOLS_RTF_SOFTLINE "\\softline" +#define OOO_STRING_SVTOOLS_RTF_SOFTPAGE "\\softpage" +#define OOO_STRING_SVTOOLS_RTF_SPRSSPBF "\\sprsspbf" +#define OOO_STRING_SVTOOLS_RTF_SPRSTSP "\\sprstsp" +#define OOO_STRING_SVTOOLS_RTF_SUBDOCUMENT "\\subdocument" +#define OOO_STRING_SVTOOLS_RTF_SWPBDR "\\swpbdr" +#define OOO_STRING_SVTOOLS_RTF_TCN "\\tcn" +#define OOO_STRING_SVTOOLS_RTF_TRANSMF "\\transmf" +#define OOO_STRING_SVTOOLS_RTF_TRBRDRB "\\trbrdrb" +#define OOO_STRING_SVTOOLS_RTF_TRBRDRH "\\trbrdrh" +#define OOO_STRING_SVTOOLS_RTF_TRBRDRL "\\trbrdrl" +#define OOO_STRING_SVTOOLS_RTF_TRBRDRR "\\trbrdrr" +#define OOO_STRING_SVTOOLS_RTF_TRBRDRT "\\trbrdrt" +#define OOO_STRING_SVTOOLS_RTF_TRBRDRV "\\trbrdrv" +#define OOO_STRING_SVTOOLS_RTF_TRHDR "\\trhdr" +#define OOO_STRING_SVTOOLS_RTF_TRKEEP "\\trkeep" +#define OOO_STRING_SVTOOLS_RTF_TRPADDB "\\trpaddb" +#define OOO_STRING_SVTOOLS_RTF_TRPADDL "\\trpaddl" +#define OOO_STRING_SVTOOLS_RTF_TRPADDR "\\trpaddr" +#define OOO_STRING_SVTOOLS_RTF_TRPADDT "\\trpaddt" +#define OOO_STRING_SVTOOLS_RTF_TRPADDFB "\\trpaddfb" +#define OOO_STRING_SVTOOLS_RTF_TRPADDFL "\\trpaddfl" +#define OOO_STRING_SVTOOLS_RTF_TRPADDFR "\\trpaddfr" +#define OOO_STRING_SVTOOLS_RTF_TRPADDFT "\\trpaddft" +#define OOO_STRING_SVTOOLS_RTF_WRAPTRSP "\\wraptrsp" +#define OOO_STRING_SVTOOLS_RTF_XEF "\\xef" +#define OOO_STRING_SVTOOLS_RTF_ZWJ "\\zwj" +#define OOO_STRING_SVTOOLS_RTF_ZWNJ "\\zwnj" + +// new tokens for 1.5 +#define OOO_STRING_SVTOOLS_RTF_ABSLOCK "\\abslock" +#define OOO_STRING_SVTOOLS_RTF_ADJUSTRIGHT "\\adjustright" +#define OOO_STRING_SVTOOLS_RTF_AFTNNCHOSUNG "\\aftnnchosung" +#define OOO_STRING_SVTOOLS_RTF_AFTNNCNUM "\\aftnncnum" +#define OOO_STRING_SVTOOLS_RTF_AFTNNDBAR "\\aftnndbar" +#define OOO_STRING_SVTOOLS_RTF_AFTNNDBNUM "\\aftnndbnum" +#define OOO_STRING_SVTOOLS_RTF_AFTNNDBNUMD "\\aftnndbnumd" +#define OOO_STRING_SVTOOLS_RTF_AFTNNDBNUMK "\\aftnndbnumk" +#define OOO_STRING_SVTOOLS_RTF_AFTNNDBNUMT "\\aftnndbnumt" +#define OOO_STRING_SVTOOLS_RTF_AFTNNGANADA "\\aftnnganada" +#define OOO_STRING_SVTOOLS_RTF_AFTNNGBNUM "\\aftnngbnum" +#define OOO_STRING_SVTOOLS_RTF_AFTNNGBNUMD "\\aftnngbnumd" +#define OOO_STRING_SVTOOLS_RTF_AFTNNGBNUMK "\\aftnngbnumk" +#define OOO_STRING_SVTOOLS_RTF_AFTNNGBNUML "\\aftnngbnuml" +#define OOO_STRING_SVTOOLS_RTF_AFTNNZODIAC "\\aftnnzodiac" +#define OOO_STRING_SVTOOLS_RTF_AFTNNZODIACD "\\aftnnzodiacd" +#define OOO_STRING_SVTOOLS_RTF_AFTNNZODIACL "\\aftnnzodiacl" +#define OOO_STRING_SVTOOLS_RTF_ANIMTEXT "\\animtext" +#define OOO_STRING_SVTOOLS_RTF_ANSICPG "\\ansicpg" +#define OOO_STRING_SVTOOLS_RTF_BACKGROUND "\\background" +#define OOO_STRING_SVTOOLS_RTF_BDBFHDR "\\bdbfhdr" +#define OOO_STRING_SVTOOLS_RTF_BLIPTAG "\\bliptag" +#define OOO_STRING_SVTOOLS_RTF_BLIPUID "\\blipuid" +#define OOO_STRING_SVTOOLS_RTF_BLIPUPI "\\blipupi" +#define OOO_STRING_SVTOOLS_RTF_BRDRART "\\brdrart" +#define OOO_STRING_SVTOOLS_RTF_BRDRDASHD "\\brdrdashd" +#define OOO_STRING_SVTOOLS_RTF_BRDRDASHDD "\\brdrdashdd" +#define OOO_STRING_SVTOOLS_RTF_BRDRDASHDOTSTR "\\brdrdashdotstr" +#define OOO_STRING_SVTOOLS_RTF_BRDRDASHSM "\\brdrdashsm" +#define OOO_STRING_SVTOOLS_RTF_BRDREMBOSS "\\brdremboss" +#define OOO_STRING_SVTOOLS_RTF_BRDRENGRAVE "\\brdrengrave" +#define OOO_STRING_SVTOOLS_RTF_BRDROUTSET "\\brdroutset" +#define OOO_STRING_SVTOOLS_RTF_BRDRINSET "\\brdrinset" +#define OOO_STRING_SVTOOLS_RTF_BRDRNONE "\\brdrnone" +#define OOO_STRING_SVTOOLS_RTF_BRDRFRAME "\\brdrframe" +#define OOO_STRING_SVTOOLS_RTF_BRDRTHTNLG "\\brdrthtnlg" +#define OOO_STRING_SVTOOLS_RTF_BRDRTHTNMG "\\brdrthtnmg" +#define OOO_STRING_SVTOOLS_RTF_BRDRTHTNSG "\\brdrthtnsg" +#define OOO_STRING_SVTOOLS_RTF_BRDRTNTHLG "\\brdrtnthlg" +#define OOO_STRING_SVTOOLS_RTF_BRDRTNTHMG "\\brdrtnthmg" +#define OOO_STRING_SVTOOLS_RTF_BRDRTNTHSG "\\brdrtnthsg" +#define OOO_STRING_SVTOOLS_RTF_BRDRTNTHTNLG "\\brdrtnthtnlg" +#define OOO_STRING_SVTOOLS_RTF_BRDRTNTHTNMG "\\brdrtnthtnmg" +#define OOO_STRING_SVTOOLS_RTF_BRDRTNTHTNSG "\\brdrtnthtnsg" +#define OOO_STRING_SVTOOLS_RTF_BRDRTRIPLE "\\brdrtriple" +#define OOO_STRING_SVTOOLS_RTF_BRDRWAVY "\\brdrwavy" +#define OOO_STRING_SVTOOLS_RTF_BRDRWAVYDB "\\brdrwavydb" +#define OOO_STRING_SVTOOLS_RTF_CATEGORY "\\category" +#define OOO_STRING_SVTOOLS_RTF_CGRID "\\cgrid" +#define OOO_STRING_SVTOOLS_RTF_CHARSCALEX "\\charscalex" +#define OOO_STRING_SVTOOLS_RTF_CHBGBDIAG "\\chbgbdiag" +#define OOO_STRING_SVTOOLS_RTF_CHBGCROSS "\\chbgcross" +#define OOO_STRING_SVTOOLS_RTF_CHBGDCROSS "\\chbgdcross" +#define OOO_STRING_SVTOOLS_RTF_CHBGDKBDIAG "\\chbgdkbdiag" +#define OOO_STRING_SVTOOLS_RTF_CHBGDKCROSS "\\chbgdkcross" +#define OOO_STRING_SVTOOLS_RTF_CHBGDKDCROSS "\\chbgdkdcross" +#define OOO_STRING_SVTOOLS_RTF_CHBGDKFDIAG "\\chbgdkfdiag" +#define OOO_STRING_SVTOOLS_RTF_CHBGDKHORIZ "\\chbgdkhoriz" +#define OOO_STRING_SVTOOLS_RTF_CHBGDKVERT "\\chbgdkvert" +#define OOO_STRING_SVTOOLS_RTF_CHBGFDIAG "\\chbgfdiag" +#define OOO_STRING_SVTOOLS_RTF_CHBGHORIZ "\\chbghoriz" +#define OOO_STRING_SVTOOLS_RTF_CHBGVERT "\\chbgvert" +#define OOO_STRING_SVTOOLS_RTF_CHBRDR "\\chbrdr" +#define OOO_STRING_SVTOOLS_RTF_CHCBPAT "\\chcbpat" +#define OOO_STRING_SVTOOLS_RTF_CHCFPAT "\\chcfpat" +#define OOO_STRING_SVTOOLS_RTF_CHSHDNG "\\chshdng" +#define OOO_STRING_SVTOOLS_RTF_CLPADL "\\clpadl" +#define OOO_STRING_SVTOOLS_RTF_CLPADT "\\clpadt" +#define OOO_STRING_SVTOOLS_RTF_CLPADB "\\clpadb" +#define OOO_STRING_SVTOOLS_RTF_CLPADR "\\clpadr" +#define OOO_STRING_SVTOOLS_RTF_CLPADFL "\\clpadfl" +#define OOO_STRING_SVTOOLS_RTF_CLPADFT "\\clpadft" +#define OOO_STRING_SVTOOLS_RTF_CLPADFB "\\clpadfb" +#define OOO_STRING_SVTOOLS_RTF_CLPADFR "\\clpadfr" +#define OOO_STRING_SVTOOLS_RTF_CLTXLRTB "\\cltxlrtb" +#define OOO_STRING_SVTOOLS_RTF_CLTXTBRL "\\cltxtbrl" +#define OOO_STRING_SVTOOLS_RTF_CLVERTALB "\\clvertalb" +#define OOO_STRING_SVTOOLS_RTF_CLVERTALC "\\clvertalc" +#define OOO_STRING_SVTOOLS_RTF_CLVERTALT "\\clvertalt" +#define OOO_STRING_SVTOOLS_RTF_CLVMGF "\\clvmgf" +#define OOO_STRING_SVTOOLS_RTF_CLVMRG "\\clvmrg" +#define OOO_STRING_SVTOOLS_RTF_CLTXTBRLV "\\cltxtbrlv" +#define OOO_STRING_SVTOOLS_RTF_CLTXBTLR "\\cltxbtlr" +#define OOO_STRING_SVTOOLS_RTF_CLTXLRTBV "\\cltxlrtbv" +#define OOO_STRING_SVTOOLS_RTF_COMPANY "\\company" +#define OOO_STRING_SVTOOLS_RTF_CRAUTH "\\crauth" +#define OOO_STRING_SVTOOLS_RTF_CRDATE "\\crdate" +#define OOO_STRING_SVTOOLS_RTF_DATE "\\date" +#define OOO_STRING_SVTOOLS_RTF_DEFLANGFE "\\deflangfe" +#define OOO_STRING_SVTOOLS_RTF_DFRAUTH "\\dfrauth" +#define OOO_STRING_SVTOOLS_RTF_DFRDATE "\\dfrdate" +#define OOO_STRING_SVTOOLS_RTF_DFRSTART "\\dfrstart" +#define OOO_STRING_SVTOOLS_RTF_DFRSTOP "\\dfrstop" +#define OOO_STRING_SVTOOLS_RTF_DFRXST "\\dfrxst" +#define OOO_STRING_SVTOOLS_RTF_DGMARGIN "\\dgmargin" +#define OOO_STRING_SVTOOLS_RTF_DNTBLNSBDB "\\dntblnsbdb" +#define OOO_STRING_SVTOOLS_RTF_DOCTYPE "\\doctype" +#define OOO_STRING_SVTOOLS_RTF_DOCVAR "\\docvar" +#define OOO_STRING_SVTOOLS_RTF_DPCODESCENT "\\dpcodescent" +#define OOO_STRING_SVTOOLS_RTF_EMBO "\\embo" +#define OOO_STRING_SVTOOLS_RTF_EMFBLIP "\\emfblip" +#define OOO_STRING_SVTOOLS_RTF_EXPSHRTN "\\expshrtn" +#define OOO_STRING_SVTOOLS_RTF_FAAUTO "\\faauto" +#define OOO_STRING_SVTOOLS_RTF_FBIAS "\\fbias" +#define OOO_STRING_SVTOOLS_RTF_FFDEFRES "\\ffdefres" +#define OOO_STRING_SVTOOLS_RTF_FFDEFTEXT "\\ffdeftext" +#define OOO_STRING_SVTOOLS_RTF_FFENTRYMCR "\\ffentrymcr" +#define OOO_STRING_SVTOOLS_RTF_FFEXITMCR "\\ffexitmcr" +#define OOO_STRING_SVTOOLS_RTF_FFFORMAT "\\ffformat" +#define OOO_STRING_SVTOOLS_RTF_FFHASLISTBOX "\\ffhaslistbox" +#define OOO_STRING_SVTOOLS_RTF_FFHELPTEXT "\\ffhelptext" +#define OOO_STRING_SVTOOLS_RTF_FFHPS "\\ffhps" +#define OOO_STRING_SVTOOLS_RTF_FFL "\\ffl" +#define OOO_STRING_SVTOOLS_RTF_FFMAXLEN "\\ffmaxlen" +#define OOO_STRING_SVTOOLS_RTF_FFNAME "\\ffname" +#define OOO_STRING_SVTOOLS_RTF_FFOWNHELP "\\ffownhelp" +#define OOO_STRING_SVTOOLS_RTF_FFOWNSTAT "\\ffownstat" +#define OOO_STRING_SVTOOLS_RTF_FFPROT "\\ffprot" +#define OOO_STRING_SVTOOLS_RTF_FFRECALC "\\ffrecalc" +#define OOO_STRING_SVTOOLS_RTF_FFRES "\\ffres" +#define OOO_STRING_SVTOOLS_RTF_FFSIZE "\\ffsize" +#define OOO_STRING_SVTOOLS_RTF_FFSTATTEXT "\\ffstattext" +#define OOO_STRING_SVTOOLS_RTF_FFTYPE "\\fftype" +#define OOO_STRING_SVTOOLS_RTF_FFTYPETXT "\\fftypetxt" +#define OOO_STRING_SVTOOLS_RTF_FLDTYPE "\\fldtype" +#define OOO_STRING_SVTOOLS_RTF_FNAME "\\fname" +#define OOO_STRING_SVTOOLS_RTF_FORMFIELD "\\formfield" +#define OOO_STRING_SVTOOLS_RTF_FROMTEXT "\\fromtext" +#define OOO_STRING_SVTOOLS_RTF_FTNNCHOSUNG "\\ftnnchosung" +#define OOO_STRING_SVTOOLS_RTF_FTNNCNUM "\\ftnncnum" +#define OOO_STRING_SVTOOLS_RTF_FTNNDBAR "\\ftnndbar" +#define OOO_STRING_SVTOOLS_RTF_FTNNDBNUM "\\ftnndbnum" +#define OOO_STRING_SVTOOLS_RTF_FTNNDBNUMD "\\ftnndbnumd" +#define OOO_STRING_SVTOOLS_RTF_FTNNDBNUMK "\\ftnndbnumk" +#define OOO_STRING_SVTOOLS_RTF_FTNNDBNUMT "\\ftnndbnumt" +#define OOO_STRING_SVTOOLS_RTF_FTNNGANADA "\\ftnnganada" +#define OOO_STRING_SVTOOLS_RTF_FTNNGBNUM "\\ftnngbnum" +#define OOO_STRING_SVTOOLS_RTF_FTNNGBNUMD "\\ftnngbnumd" +#define OOO_STRING_SVTOOLS_RTF_FTNNGBNUMK "\\ftnngbnumk" +#define OOO_STRING_SVTOOLS_RTF_FTNNGBNUML "\\ftnngbnuml" +#define OOO_STRING_SVTOOLS_RTF_FTNNZODIAC "\\ftnnzodiac" +#define OOO_STRING_SVTOOLS_RTF_FTNNZODIACD "\\ftnnzodiacd" +#define OOO_STRING_SVTOOLS_RTF_FTNNZODIACL "\\ftnnzodiacl" +#define OOO_STRING_SVTOOLS_RTF_G "\\g" +#define OOO_STRING_SVTOOLS_RTF_GCW "\\gcw" +#define OOO_STRING_SVTOOLS_RTF_GRIDTBL "\\gridtbl" +#define OOO_STRING_SVTOOLS_RTF_HIGHLIGHT "\\highlight" +#define OOO_STRING_SVTOOLS_RTF_HLFR "\\hlfr" +#define OOO_STRING_SVTOOLS_RTF_HLINKBASE "\\hlinkbase" +#define OOO_STRING_SVTOOLS_RTF_HLLOC "\\hlloc" +#define OOO_STRING_SVTOOLS_RTF_HLSRC "\\hlsrc" +#define OOO_STRING_SVTOOLS_RTF_ILVL "\\ilvl" +#define OOO_STRING_SVTOOLS_RTF_IMPR "\\impr" +#define OOO_STRING_SVTOOLS_RTF_JPEGBLIP "\\jpegblip" +#define OOO_STRING_SVTOOLS_RTF_LEVELFOLLOW "\\levelfollow" +#define OOO_STRING_SVTOOLS_RTF_LEVELINDENT "\\levelindent" +#define OOO_STRING_SVTOOLS_RTF_LEVELJC "\\leveljc" +#define OOO_STRING_SVTOOLS_RTF_LEVELLEGAL "\\levellegal" +#define OOO_STRING_SVTOOLS_RTF_LEVELNFC "\\levelnfc" +#define OOO_STRING_SVTOOLS_RTF_LEVELNORESTART "\\levelnorestart" +#define OOO_STRING_SVTOOLS_RTF_LEVELNUMBERS "\\levelnumbers" +#define OOO_STRING_SVTOOLS_RTF_LEVELOLD "\\levelold" +#define OOO_STRING_SVTOOLS_RTF_LEVELPREV "\\levelprev" +#define OOO_STRING_SVTOOLS_RTF_LEVELPREVSPACE "\\levelprevspace" +#define OOO_STRING_SVTOOLS_RTF_LEVELSPACE "\\levelspace" +#define OOO_STRING_SVTOOLS_RTF_LEVELSTARTAT "\\levelstartat" +#define OOO_STRING_SVTOOLS_RTF_LEVELTEXT "\\leveltext" +#define OOO_STRING_SVTOOLS_RTF_LINKVAL "\\linkval" +#define OOO_STRING_SVTOOLS_RTF_LIST "\\list" +#define OOO_STRING_SVTOOLS_RTF_LISTID "\\listid" +#define OOO_STRING_SVTOOLS_RTF_LISTLEVEL "\\listlevel" +#define OOO_STRING_SVTOOLS_RTF_LISTNAME "\\listname" +#define OOO_STRING_SVTOOLS_RTF_LISTOVERRIDE "\\listoverride" +#define OOO_STRING_SVTOOLS_RTF_LISTOVERRIDECOUNT "\\listoverridecount" +#define OOO_STRING_SVTOOLS_RTF_LISTOVERRIDEFORMAT "\\listoverrideformat" +#define OOO_STRING_SVTOOLS_RTF_LISTOVERRIDESTART "\\listoverridestart" +#define OOO_STRING_SVTOOLS_RTF_LISTOVERRIDETABLE "\\listoverridetable" +#define OOO_STRING_SVTOOLS_RTF_LISTRESTARTHDN "\\listrestarthdn" +#define OOO_STRING_SVTOOLS_RTF_LISTSIMPLE "\\listsimple" +#define OOO_STRING_SVTOOLS_RTF_LISTTABLE "\\listtable" +#define OOO_STRING_SVTOOLS_RTF_LISTTEMPLATEID "\\listtemplateid" +#define OOO_STRING_SVTOOLS_RTF_LISTTEXT "\\listtext" +#define OOO_STRING_SVTOOLS_RTF_LS "\\ls" +#define OOO_STRING_SVTOOLS_RTF_LYTEXCTTP "\\lytexcttp" +#define OOO_STRING_SVTOOLS_RTF_LYTPRTMET "\\lytprtmet" +#define OOO_STRING_SVTOOLS_RTF_MANAGER "\\manager" +#define OOO_STRING_SVTOOLS_RTF_MSMCAP "\\msmcap" +#define OOO_STRING_SVTOOLS_RTF_NOFCHARSWS "\\nofcharsws" +#define OOO_STRING_SVTOOLS_RTF_NOLEAD "\\nolead" +#define OOO_STRING_SVTOOLS_RTF_NONSHPPICT "\\nonshppict" +#define OOO_STRING_SVTOOLS_RTF_NOSECTEXPAND "\\nosectexpand" +#define OOO_STRING_SVTOOLS_RTF_NOSNAPLINEGRID "\\nosnaplinegrid" +#define OOO_STRING_SVTOOLS_RTF_NOSPACEFORUL "\\nospaceforul" +#define OOO_STRING_SVTOOLS_RTF_NOULTRLSPC "\\noultrlspc" +#define OOO_STRING_SVTOOLS_RTF_NOXLATTOYEN "\\noxlattoyen" +#define OOO_STRING_SVTOOLS_RTF_OBJATTPH "\\objattph" +#define OOO_STRING_SVTOOLS_RTF_OBJHTML "\\objhtml" +#define OOO_STRING_SVTOOLS_RTF_OBJOCX "\\objocx" +#define OOO_STRING_SVTOOLS_RTF_OLDLINEWRAP "\\oldlinewrap" +#define OOO_STRING_SVTOOLS_RTF_OUTLINELEVEL "\\outlinelevel" +#define OOO_STRING_SVTOOLS_RTF_OVERLAY "\\overlay" +#define OOO_STRING_SVTOOLS_RTF_PANOSE "\\panose" +#define OOO_STRING_SVTOOLS_RTF_PGBRDRB "\\pgbrdrb" +#define OOO_STRING_SVTOOLS_RTF_PGBRDRFOOT "\\pgbrdrfoot" +#define OOO_STRING_SVTOOLS_RTF_PGBRDRHEAD "\\pgbrdrhead" +#define OOO_STRING_SVTOOLS_RTF_PGBRDRL "\\pgbrdrl" +#define OOO_STRING_SVTOOLS_RTF_PGBRDROPT "\\pgbrdropt" +#define OOO_STRING_SVTOOLS_RTF_PGBRDRR "\\pgbrdrr" +#define OOO_STRING_SVTOOLS_RTF_PGBRDRSNAP "\\pgbrdrsnap" +#define OOO_STRING_SVTOOLS_RTF_PGBRDRT "\\pgbrdrt" +#define OOO_STRING_SVTOOLS_RTF_PGNCHOSUNG "\\pgnchosung" +#define OOO_STRING_SVTOOLS_RTF_PGNCNUM "\\pgncnum" +#define OOO_STRING_SVTOOLS_RTF_PGNDBNUMK "\\pgndbnumk" +#define OOO_STRING_SVTOOLS_RTF_PGNDBNUMT "\\pgndbnumt" +#define OOO_STRING_SVTOOLS_RTF_PGNGANADA "\\pgnganada" +#define OOO_STRING_SVTOOLS_RTF_PGNGBNUM "\\pgngbnum" +#define OOO_STRING_SVTOOLS_RTF_PGNGBNUMD "\\pgngbnumd" +#define OOO_STRING_SVTOOLS_RTF_PGNGBNUMK "\\pgngbnumk" +#define OOO_STRING_SVTOOLS_RTF_PGNGBNUML "\\pgngbnuml" +#define OOO_STRING_SVTOOLS_RTF_PGNZODIAC "\\pgnzodiac" +#define OOO_STRING_SVTOOLS_RTF_PGNZODIACD "\\pgnzodiacd" +#define OOO_STRING_SVTOOLS_RTF_PGNZODIACL "\\pgnzodiacl" +#define OOO_STRING_SVTOOLS_RTF_PICPROP "\\picprop" +#define OOO_STRING_SVTOOLS_RTF_PNAIUEO "\\pnaiueo" +#define OOO_STRING_SVTOOLS_RTF_PNAIUEOD "\\pnaiueod" +#define OOO_STRING_SVTOOLS_RTF_PNCHOSUNG "\\pnchosung" +#define OOO_STRING_SVTOOLS_RTF_PNDBNUMD "\\pndbnumd" +#define OOO_STRING_SVTOOLS_RTF_PNDBNUMK "\\pndbnumk" +#define OOO_STRING_SVTOOLS_RTF_PNDBNUML "\\pndbnuml" +#define OOO_STRING_SVTOOLS_RTF_PNDBNUMT "\\pndbnumt" +#define OOO_STRING_SVTOOLS_RTF_PNGANADA "\\pnganada" +#define OOO_STRING_SVTOOLS_RTF_PNGBLIP "\\pngblip" +#define OOO_STRING_SVTOOLS_RTF_PNGBNUM "\\pngbnum" +#define OOO_STRING_SVTOOLS_RTF_PNGBNUMD "\\pngbnumd" +#define OOO_STRING_SVTOOLS_RTF_PNGBNUMK "\\pngbnumk" +#define OOO_STRING_SVTOOLS_RTF_PNGBNUML "\\pngbnuml" +#define OOO_STRING_SVTOOLS_RTF_PNRAUTH "\\pnrauth" +#define OOO_STRING_SVTOOLS_RTF_PNRDATE "\\pnrdate" +#define OOO_STRING_SVTOOLS_RTF_PNRNFC "\\pnrnfc" +#define OOO_STRING_SVTOOLS_RTF_PNRNOT "\\pnrnot" +#define OOO_STRING_SVTOOLS_RTF_PNRPNBR "\\pnrpnbr" +#define OOO_STRING_SVTOOLS_RTF_PNRRGB "\\pnrrgb" +#define OOO_STRING_SVTOOLS_RTF_PNRSTART "\\pnrstart" +#define OOO_STRING_SVTOOLS_RTF_PNRSTOP "\\pnrstop" +#define OOO_STRING_SVTOOLS_RTF_PNRXST "\\pnrxst" +#define OOO_STRING_SVTOOLS_RTF_PNZODIAC "\\pnzodiac" +#define OOO_STRING_SVTOOLS_RTF_PNZODIACD "\\pnzodiacd" +#define OOO_STRING_SVTOOLS_RTF_PNZODIACL "\\pnzodiacl" +#define OOO_STRING_SVTOOLS_RTF_LFOLEVEL "\\lfolevel" +#define OOO_STRING_SVTOOLS_RTF_POSYIN "\\posyin" +#define OOO_STRING_SVTOOLS_RTF_POSYOUT "\\posyout" +#define OOO_STRING_SVTOOLS_RTF_PRIVATE "\\private" +#define OOO_STRING_SVTOOLS_RTF_PROPNAME "\\propname" +#define OOO_STRING_SVTOOLS_RTF_PROPTYPE "\\proptype" +#define OOO_STRING_SVTOOLS_RTF_REVAUTHDEL "\\revauthdel" +#define OOO_STRING_SVTOOLS_RTF_REVDTTMDEL "\\revdttmdel" +#define OOO_STRING_SVTOOLS_RTF_SAUTOUPD "\\sautoupd" +#define OOO_STRING_SVTOOLS_RTF_SECTDEFAULTCL "\\sectdefaultcl" +#define OOO_STRING_SVTOOLS_RTF_SECTEXPAND "\\sectexpand" +#define OOO_STRING_SVTOOLS_RTF_SECTLINEGRID "\\sectlinegrid" +#define OOO_STRING_SVTOOLS_RTF_SECTSPECIFYCL "\\sectspecifycl" +#define OOO_STRING_SVTOOLS_RTF_SECTSPECIFYL "\\sectspecifyl" +#define OOO_STRING_SVTOOLS_RTF_SHIDDEN "\\shidden" +#define OOO_STRING_SVTOOLS_RTF_SHPBOTTOM "\\shpbottom" +#define OOO_STRING_SVTOOLS_RTF_SHPBXCOLUMN "\\shpbxcolumn" +#define OOO_STRING_SVTOOLS_RTF_SHPBXMARGIN "\\shpbxmargin" +#define OOO_STRING_SVTOOLS_RTF_SHPBXPAGE "\\shpbxpage" +#define OOO_STRING_SVTOOLS_RTF_SHPBXIGNORE "\\shpbxignore" +#define OOO_STRING_SVTOOLS_RTF_SHPBYMARGIN "\\shpbymargin" +#define OOO_STRING_SVTOOLS_RTF_SHPBYPAGE "\\shpbypage" +#define OOO_STRING_SVTOOLS_RTF_SHPBYPARA "\\shpbypara" +#define OOO_STRING_SVTOOLS_RTF_SHPBYIGNORE "\\shpbyignore" +#define OOO_STRING_SVTOOLS_RTF_SHPFBLWTXT "\\shpfblwtxt" +#define OOO_STRING_SVTOOLS_RTF_SHPFHDR "\\shpfhdr" +#define OOO_STRING_SVTOOLS_RTF_SHPGRP "\\shpgrp" +#define OOO_STRING_SVTOOLS_RTF_SHPINST "\\shpinst" +#define OOO_STRING_SVTOOLS_RTF_SHPLEFT "\\shpleft" +#define OOO_STRING_SVTOOLS_RTF_SHPLID "\\shplid" +#define OOO_STRING_SVTOOLS_RTF_SHPLOCKANCHOR "\\shplockanchor" +#define OOO_STRING_SVTOOLS_RTF_SHPPICT "\\shppict" +#define OOO_STRING_SVTOOLS_RTF_SHPRIGHT "\\shpright" +#define OOO_STRING_SVTOOLS_RTF_SHPRSLT "\\shprslt" +#define OOO_STRING_SVTOOLS_RTF_SHPTOP "\\shptop" +#define OOO_STRING_SVTOOLS_RTF_SHPTXT "\\shptxt" +#define OOO_STRING_SVTOOLS_RTF_SHPWRK "\\shpwrk" +#define OOO_STRING_SVTOOLS_RTF_SHPWR "\\shpwr" +#define OOO_STRING_SVTOOLS_RTF_SHPZ "\\shpz" +#define OOO_STRING_SVTOOLS_RTF_SPRSBSP "\\sprsbsp" +#define OOO_STRING_SVTOOLS_RTF_SPRSLNSP "\\sprslnsp" +#define OOO_STRING_SVTOOLS_RTF_SPRSTSM "\\sprstsm" +#define OOO_STRING_SVTOOLS_RTF_STATICVAL "\\staticval" +#define OOO_STRING_SVTOOLS_RTF_STEXTFLOW "\\stextflow" +#define OOO_STRING_SVTOOLS_RTF_STRIKED "\\striked" +#define OOO_STRING_SVTOOLS_RTF_SUBFONTBYSIZE "\\subfontbysize" +#define OOO_STRING_SVTOOLS_RTF_TCELLD "\\tcelld" +#define OOO_STRING_SVTOOLS_RTF_TIME "\\time" +#define OOO_STRING_SVTOOLS_RTF_TRUNCATEFONTHEIGHT "\\truncatefontheight" +#define OOO_STRING_SVTOOLS_RTF_UC "\\uc" +#define OOO_STRING_SVTOOLS_RTF_UD "\\ud" +#define OOO_STRING_SVTOOLS_RTF_ULDASH "\\uldash" +#define OOO_STRING_SVTOOLS_RTF_ULDASHD "\\uldashd" +#define OOO_STRING_SVTOOLS_RTF_ULDASHDD "\\uldashdd" +#define OOO_STRING_SVTOOLS_RTF_ULTH "\\ulth" +#define OOO_STRING_SVTOOLS_RTF_ULWAVE "\\ulwave" +#define OOO_STRING_SVTOOLS_RTF_ULC "\\ulc" +#define OOO_STRING_SVTOOLS_RTF_U "\\u" +#define OOO_STRING_SVTOOLS_RTF_UPR "\\upr" +#define OOO_STRING_SVTOOLS_RTF_USERPROPS "\\userprops" +#define OOO_STRING_SVTOOLS_RTF_VIEWKIND "\\viewkind" +#define OOO_STRING_SVTOOLS_RTF_VIEWSCALE "\\viewscale" +#define OOO_STRING_SVTOOLS_RTF_VIEWZK "\\viewzk" +#define OOO_STRING_SVTOOLS_RTF_WIDCTLPAR "\\widctlpar" +#define OOO_STRING_SVTOOLS_RTF_WINDOWCAPTION "\\windowcaption" +#define OOO_STRING_SVTOOLS_RTF_WPEQN "\\wpeqn" +#define OOO_STRING_SVTOOLS_RTF_WPJST "\\wpjst" +#define OOO_STRING_SVTOOLS_RTF_WPSP "\\wpsp" +#define OOO_STRING_SVTOOLS_RTF_YXE "\\yxe" +#define OOO_STRING_SVTOOLS_RTF_FRMTXLRTB "\\frmtxlrtb" +#define OOO_STRING_SVTOOLS_RTF_FRMTXTBRL "\\frmtxtbrl" +#define OOO_STRING_SVTOOLS_RTF_FRMTXBTLR "\\frmtxbtlr" +#define OOO_STRING_SVTOOLS_RTF_FRMTXLRTBV "\\frmtxlrtbv" +#define OOO_STRING_SVTOOLS_RTF_FRMTXTBRLV "\\frmtxtbrlv" + +// MS-2000 Tokens +#define OOO_STRING_SVTOOLS_RTF_ULTHD "\\ulthd" +#define OOO_STRING_SVTOOLS_RTF_ULTHDASH "\\ulthdash" +#define OOO_STRING_SVTOOLS_RTF_ULLDASH "\\ulldash" +#define OOO_STRING_SVTOOLS_RTF_ULTHLDASH "\\ulthldash" +#define OOO_STRING_SVTOOLS_RTF_ULTHDASHD "\\ulthdashd" +#define OOO_STRING_SVTOOLS_RTF_ULTHDASHDD "\\ulthdashdd" +#define OOO_STRING_SVTOOLS_RTF_ULHWAVE "\\ulhwave" +#define OOO_STRING_SVTOOLS_RTF_ULULDBWAVE "\\ululdbwave" +#define OOO_STRING_SVTOOLS_RTF_LOCH "\\loch" +#define OOO_STRING_SVTOOLS_RTF_HICH "\\hich" +#define OOO_STRING_SVTOOLS_RTF_DBCH "\\dbch" +#define OOO_STRING_SVTOOLS_RTF_LANGFE "\\langfe" +#define OOO_STRING_SVTOOLS_RTF_ADEFLANG "\\adeflang" +#define OOO_STRING_SVTOOLS_RTF_ADEFF "\\adeff" +#define OOO_STRING_SVTOOLS_RTF_ACCNONE "\\accnone" +#define OOO_STRING_SVTOOLS_RTF_ACCDOT "\\accdot" +#define OOO_STRING_SVTOOLS_RTF_ACCCOMMA "\\acccomma" +#define OOO_STRING_SVTOOLS_RTF_ACCCIRCLE "\\acccircle" +#define OOO_STRING_SVTOOLS_RTF_ACCUNDERDOT "\\accunderdot" +#define OOO_STRING_SVTOOLS_RTF_TWOINONE "\\twoinone" +#define OOO_STRING_SVTOOLS_RTF_HORZVERT "\\horzvert" +#define OOO_STRING_SVTOOLS_RTF_FAHANG "\\fahang" +#define OOO_STRING_SVTOOLS_RTF_FAVAR "\\favar" +#define OOO_STRING_SVTOOLS_RTF_FACENTER "\\facenter" +#define OOO_STRING_SVTOOLS_RTF_FAROMAN "\\faroman" +#define OOO_STRING_SVTOOLS_RTF_FAFIXED "\\fafixed" +#define OOO_STRING_SVTOOLS_RTF_NOCWRAP "\\nocwrap" +#define OOO_STRING_SVTOOLS_RTF_NOOVERFLOW "\\nooverflow" +#define OOO_STRING_SVTOOLS_RTF_ASPALPHA "\\aspalpha" + +// SWG-specific attributes +#define OOO_STRING_SVTOOLS_RTF_GRFALIGNV "\\grfalignv" +#define OOO_STRING_SVTOOLS_RTF_GRFALIGNH "\\grfalignh" +#define OOO_STRING_SVTOOLS_RTF_GRFMIRROR "\\grfmirror" +#define OOO_STRING_SVTOOLS_RTF_HEADERYB "\\headeryb" +#define OOO_STRING_SVTOOLS_RTF_HEADERXL "\\headerxl" +#define OOO_STRING_SVTOOLS_RTF_HEADERXR "\\headerxr" +#define OOO_STRING_SVTOOLS_RTF_FOOTERYT "\\footeryt" +#define OOO_STRING_SVTOOLS_RTF_FOOTERXL "\\footerxl" +#define OOO_STRING_SVTOOLS_RTF_FOOTERXR "\\footerxr" +#define OOO_STRING_SVTOOLS_RTF_HEADERYH "\\headeryh" +#define OOO_STRING_SVTOOLS_RTF_FOOTERYH "\\footeryh" +#define OOO_STRING_SVTOOLS_RTF_BALANCEDCOLUMN "\\swcolmnblnc" +#define OOO_STRING_SVTOOLS_RTF_UPDNPROP "\\updnprop" +#define OOO_STRING_SVTOOLS_RTF_PRTDATA "\\prtdata" +#define OOO_STRING_SVTOOLS_RTF_BKMKKEY "\\bkmkkey" + +// attributes for free-flying frames +#define OOO_STRING_SVTOOLS_RTF_FLYPRINT "\\flyprint" +#define OOO_STRING_SVTOOLS_RTF_FLYOPAQUE "\\flyopaque" +#define OOO_STRING_SVTOOLS_RTF_FLYPRTCTD "\\flyprtctd" +#define OOO_STRING_SVTOOLS_RTF_FLYMAINCNT "\\flymaincnt" +#define OOO_STRING_SVTOOLS_RTF_FLYVERT "\\flyvert" +#define OOO_STRING_SVTOOLS_RTF_FLYHORZ "\\flyhorz" +#define OOO_STRING_SVTOOLS_RTF_DFRMTXTL "\\dfrmtxtl" +#define OOO_STRING_SVTOOLS_RTF_DFRMTXTR "\\dfrmtxtr" +#define OOO_STRING_SVTOOLS_RTF_DFRMTXTU "\\dfrmtxtu" +#define OOO_STRING_SVTOOLS_RTF_DFRMTXTW "\\dfrmtxtw" +#define OOO_STRING_SVTOOLS_RTF_FLYANCHOR "\\flyanchor" +#define OOO_STRING_SVTOOLS_RTF_FLYCNTNT "\\flycntnt" +#define OOO_STRING_SVTOOLS_RTF_FLYCOLUMN "\\flycolumn" +#define OOO_STRING_SVTOOLS_RTF_FLYPAGE "\\flypage" +#define OOO_STRING_SVTOOLS_RTF_FLYINPARA "\\flyinpara" +#define OOO_STRING_SVTOOLS_RTF_BRDBOX "\\brdbox" +#define OOO_STRING_SVTOOLS_RTF_BRDLNCOL "\\brdlncol" +#define OOO_STRING_SVTOOLS_RTF_BRDLNIN "\\brdlnin" +#define OOO_STRING_SVTOOLS_RTF_BRDLNOUT "\\brdlnout" +#define OOO_STRING_SVTOOLS_RTF_BRDLNDIST "\\brdlndist" +#define OOO_STRING_SVTOOLS_RTF_SHADOW "\\shadow" +#define OOO_STRING_SVTOOLS_RTF_SHDWDIST "\\shdwdist" +#define OOO_STRING_SVTOOLS_RTF_SHDWSTYLE "\\shdwstyle" +#define OOO_STRING_SVTOOLS_RTF_SHDWCOL "\\shdwcol" +#define OOO_STRING_SVTOOLS_RTF_SHDWFCOL "\\shdwfcol" +#define OOO_STRING_SVTOOLS_RTF_PGDSCTBL "\\pgdsctbl" +#define OOO_STRING_SVTOOLS_RTF_PGDSC "\\pgdsc" +#define OOO_STRING_SVTOOLS_RTF_PGDSCUSE "\\pgdscuse" +#define OOO_STRING_SVTOOLS_RTF_PGDSCNXT "\\pgdscnxt" +#define OOO_STRING_SVTOOLS_RTF_HYPHEN "\\hyphen" +#define OOO_STRING_SVTOOLS_RTF_HYPHLEAD "\\hyphlead" +#define OOO_STRING_SVTOOLS_RTF_HYPHTRAIL "\\hyphtrail" +#define OOO_STRING_SVTOOLS_RTF_HYPHMAX "\\hyphmax" +#define OOO_STRING_SVTOOLS_RTF_TLSWG "\\tlswg" +#define OOO_STRING_SVTOOLS_RTF_PGBRK "\\pgbrk" +#define OOO_STRING_SVTOOLS_RTF_PGDSCNO "\\pgdscno" +#define OOO_STRING_SVTOOLS_RTF_SOUTLVL "\\soutlvl" +#define OOO_STRING_SVTOOLS_RTF_SHP "\\shp" +#define OOO_STRING_SVTOOLS_RTF_SN "\\sn" +#define OOO_STRING_SVTOOLS_RTF_SV "\\sv" +#define OOO_STRING_SVTOOLS_RTF_SP "\\sp" + +// Support for overline attributes +#define OOO_STRING_SVTOOLS_RTF_OL "\\ol" +#define OOO_STRING_SVTOOLS_RTF_OLD "\\old" +#define OOO_STRING_SVTOOLS_RTF_OLDB "\\oldb" +#define OOO_STRING_SVTOOLS_RTF_OLNONE "\\olnone" +#define OOO_STRING_SVTOOLS_RTF_OLW "\\olw" +#define OOO_STRING_SVTOOLS_RTF_OLDASH "\\oldash" +#define OOO_STRING_SVTOOLS_RTF_OLDASHD "\\oldashd" +#define OOO_STRING_SVTOOLS_RTF_OLDASHDD "\\oldashdd" +#define OOO_STRING_SVTOOLS_RTF_OLTH "\\olth" +#define OOO_STRING_SVTOOLS_RTF_OLWAVE "\\olwave" +#define OOO_STRING_SVTOOLS_RTF_OLC "\\olc" +#define OOO_STRING_SVTOOLS_RTF_OLTHD "\\olthd" +#define OOO_STRING_SVTOOLS_RTF_OLTHDASH "\\olthdash" +#define OOO_STRING_SVTOOLS_RTF_OLLDASH "\\olldash" +#define OOO_STRING_SVTOOLS_RTF_OLTHLDASH "\\olthldash" +#define OOO_STRING_SVTOOLS_RTF_OLTHDASHD "\\olthdashd" +#define OOO_STRING_SVTOOLS_RTF_OLTHDASHDD "\\olthdashdd" +#define OOO_STRING_SVTOOLS_RTF_OLHWAVE "\\olhwave" +#define OOO_STRING_SVTOOLS_RTF_OLOLDBWAVE "\\ololdbwave" + +// Support for nested tables +#define OOO_STRING_SVTOOLS_RTF_ITAP "\\itap" +#define OOO_STRING_SVTOOLS_RTF_NESTCELL "\\nestcell" +#define OOO_STRING_SVTOOLS_RTF_NESTTABLEPROPRS "\\nesttableprops" +#define OOO_STRING_SVTOOLS_RTF_NESTROW "\\nestrow" +#define OOO_STRING_SVTOOLS_RTF_NONESTTABLES "\\nonesttables" + +// Math +#define LO_STRING_SVTOOLS_RTF_MACC "\\macc" +#define LO_STRING_SVTOOLS_RTF_MACCPR "\\maccPr" +#define LO_STRING_SVTOOLS_RTF_MBAR "\\mbar" +#define LO_STRING_SVTOOLS_RTF_MBARPR "\\mbarPr" +#define LO_STRING_SVTOOLS_RTF_MBEGCHR "\\mbegChr" +#define LO_STRING_SVTOOLS_RTF_MBORDERBOX "\\mborderBox" +#define LO_STRING_SVTOOLS_RTF_MBORDERBOXPR "\\mborderBoxPr" +#define LO_STRING_SVTOOLS_RTF_MCHR "\\mchr" +#define LO_STRING_SVTOOLS_RTF_MDEGHIDE "\\mdegHide" +#define LO_STRING_SVTOOLS_RTF_MDEG "\\mdeg" +#define LO_STRING_SVTOOLS_RTF_MDEN "\\mden" +#define LO_STRING_SVTOOLS_RTF_MD "\\md" +#define LO_STRING_SVTOOLS_RTF_MDPR "\\mdPr" +#define LO_STRING_SVTOOLS_RTF_ME "\\me" +#define LO_STRING_SVTOOLS_RTF_MENDCHR "\\mendChr" +#define LO_STRING_SVTOOLS_RTF_MEQARR "\\meqArr" +#define LO_STRING_SVTOOLS_RTF_MF "\\mf" +#define LO_STRING_SVTOOLS_RTF_MFNAME "\\mfName" +#define LO_STRING_SVTOOLS_RTF_MFPR "\\mfPr" +#define LO_STRING_SVTOOLS_RTF_MFUNC "\\mfunc" +#define LO_STRING_SVTOOLS_RTF_MGROUPCHR "\\mgroupChr" +#define LO_STRING_SVTOOLS_RTF_MGROUPCHRPR "\\mgroupChrPr" +#define LO_STRING_SVTOOLS_RTF_MHIDEBOT "\\mhideBot" +#define LO_STRING_SVTOOLS_RTF_MHIDELEFT "\\mhideLeft" +#define LO_STRING_SVTOOLS_RTF_MHIDERIGHT "\\mhideRight" +#define LO_STRING_SVTOOLS_RTF_MHIDETOP "\\mhideTop" +#define LO_STRING_SVTOOLS_RTF_MLIMLOW "\\mlimLow" +#define LO_STRING_SVTOOLS_RTF_MLIM "\\mlim" +#define LO_STRING_SVTOOLS_RTF_MLIMUPP "\\mlimUpp" +#define LO_STRING_SVTOOLS_RTF_MM "\\mm" +#define LO_STRING_SVTOOLS_RTF_MMR "\\mmr" +#define LO_STRING_SVTOOLS_RTF_MNARY "\\mnary" +#define LO_STRING_SVTOOLS_RTF_MNARYPR "\\mnaryPr" +#define LO_STRING_SVTOOLS_RTF_MNUM "\\mnum" +#define LO_STRING_SVTOOLS_RTF_MOMATH "\\moMath" +#define LO_STRING_SVTOOLS_RTF_MPOS "\\mpos" +#define LO_STRING_SVTOOLS_RTF_MRAD "\\mrad" +#define LO_STRING_SVTOOLS_RTF_MRADPR "\\mradPr" +#define LO_STRING_SVTOOLS_RTF_MR "\\mr" +#define LO_STRING_SVTOOLS_RTF_MSEPCHR "\\msepChr" +#define LO_STRING_SVTOOLS_RTF_MSPRE "\\msPre" +#define LO_STRING_SVTOOLS_RTF_MSSUB "\\msSub" +#define LO_STRING_SVTOOLS_RTF_MSSUBSUP "\\msSubSup" +#define LO_STRING_SVTOOLS_RTF_MSSUP "\\msSup" +#define LO_STRING_SVTOOLS_RTF_MSTRIKEH "\\mstrikeH" +#define LO_STRING_SVTOOLS_RTF_MSUBHIDE "\\msubHide" +#define LO_STRING_SVTOOLS_RTF_MSUB "\\msub" +#define LO_STRING_SVTOOLS_RTF_MSUPHIDE "\\msupHide" +#define LO_STRING_SVTOOLS_RTF_MSUP "\\msup" +#define LO_STRING_SVTOOLS_RTF_MTYPE "\\mtype" +#define LO_STRING_SVTOOLS_RTF_MVERTJC "\\mvertJc" +#define LO_STRING_SVTOOLS_RTF_MMATH "\\mmath" +#define LO_STRING_SVTOOLS_RTF_MMATHPICT "\\mmathPict" +#define LO_STRING_SVTOOLS_RTF_MNOR "\\mnor" +#define LO_STRING_SVTOOLS_RTF_LISTPICTURE "\\listpicture" +#define LO_STRING_SVTOOLS_RTF_LEVELPICTURE "\\levelpicture" +#define LO_STRING_SVTOOLS_RTF_BRDRSH "\\brdrsh" +#define LO_STRING_SVTOOLS_RTF_GENERATOR "\\generator" +#define LO_STRING_SVTOOLS_RTF_VIEWBKSP "\\viewbksp" +#define LO_STRING_SVTOOLS_RTF_SBAUTO "\\sbauto" +#define LO_STRING_SVTOOLS_RTF_SAAUTO "\\saauto" +#define LO_STRING_SVTOOLS_RTF_HTMAUTSP "\\htmautsp" + +#endif // INCLUDED_SVTOOLS_RTFKEYWD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/rtfout.hxx b/include/svtools/rtfout.hxx new file mode 100644 index 000000000..1bcd3361b --- /dev/null +++ b/include/svtools/rtfout.hxx @@ -0,0 +1,41 @@ +/* -*- 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_SVTOOLS_RTFOUT_HXX +#define INCLUDED_SVTOOLS_RTFOUT_HXX + +#include <svtools/svtdllapi.h> + +#include <rtl/ustring.hxx> +#include <rtl/textenc.h> + +class SvStream; + +namespace RTFOutFuncs { + +SVT_DLLPUBLIC SvStream& Out_String( + SvStream&, const OUString&, + rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 ); + +} + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/rtftoken.h b/include/svtools/rtftoken.h new file mode 100644 index 000000000..754408dd9 --- /dev/null +++ b/include/svtools/rtftoken.h @@ -0,0 +1,1270 @@ +/* -*- 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_SVTOOLS_RTFTOKEN_H +#define INCLUDED_SVTOOLS_RTFTOKEN_H + +#include <rtl/ustring.hxx> + +namespace rtl { + class OUString; +}; + +// search the TokenID for the token +int GetRTFToken( const OUString& rSearch ); + +enum RTF_TOKEN_RANGES { + RTF_NOGROUP = 0x0100, + RTF_DOCFMT = 0x0200, + RTF_SECTFMT = 0x0300, + RTF_PARFMT = 0x0400, + RTF_TABSTOPDEF = 0x0500, + RTF_BRDRDEF = 0x0600, + RTF_CHRFMT = 0x0700, + RTF_SPECCHAR = 0x0800, + RTF_APOCTL = 0x0900, + RTF_SHADINGDEF = 0x0A00, + // free = 0x0B00, + RTF_DRAWOBJECTS = 0x0C00, + RTF_OBJECTS = 0x0D00, + RTF_NUMBULLETS = 0x0E00, + + // !!! can be mixed in using the "or" operator (border/background) !!!! + RTF_TABLEDEF = 0x1000, + + // !!! can be mixed in using the "or" operator (border/tab) !!!! + RTF_SWGDEFS = 0x4000 +}; + +enum RTF_TOKEN_IDS { + + RTF_TEXTTOKEN = RTF_NOGROUP, + RTF_SINGLECHAR, + RTF_UNKNOWNCONTROL, + RTF_UNKNOWNDATA, + + RTF_RTF, + RTF_ANSITYPE, + RTF_MACTYPE, + RTF_PCTYPE, + RTF_PCATYPE, + RTF_NEXTTYPE, + + RTF_STYLESHEET, + RTF_SBASEDON, + RTF_SNEXT, + RTF_SHIDDEN, + RTF_SAUTOUPD, + + RTF_KEYCODE, + RTF_FNKEY, + RTF_ALTKEY, + RTF_SHIFTKEY, + RTF_CTRLKEY, + + RTF_FONTTBL, + RTF_DEFF, + RTF_FNIL, + RTF_FROMAN, + RTF_FSWISS, + RTF_FMODERN, + RTF_FSCRIPT, + RTF_FDECOR, + RTF_FTECH, + + RTF_COLORTBL, + RTF_RED, + RTF_GREEN, + RTF_BLUE, + + RTF_INFO, + RTF_TITLE, + RTF_SUBJECT, + RTF_AUTHOR, + RTF_OPERATOR, + RTF_KEYWORDS, + RTF_COMMENT, + RTF_VERSION, + RTF_DOCCOMM, + RTF_VERN, + RTF_CREATIM, + RTF_REVTIM, + RTF_PRINTIM, + RTF_BUPTIM, + RTF_EDMINS, + RTF_NOFPAGES, + RTF_NOFWORDS, + RTF_NOFCHARS, + RTF_ID, + RTF_YR, + RTF_MO, + RTF_DY, + RTF_HR, + RTF_MIN, + RTF_USERPROPS, + RTF_CATEGORY, + RTF_COMPANY, + RTF_MANAGER, + RTF_PROPNAME, + RTF_LINKVAL, + RTF_NOFCHARSWS, + RTF_HLINKBASE, + RTF_STATICVAL, + RTF_PROPTYPE, + + RTF_ANNOTATION, + RTF_ATNID, + + RTF_FOOTNOTE, + + RTF_XE, + RTF_BXE, + RTF_IXE, + RTF_RXE, + RTF_TXE, + RTF_YXE, + + RTF_TC, + RTF_TCF, + RTF_TCL, + + RTF_BKMKSTART, + RTF_BKMKEND, + + RTF_PICT, // Bitmaps + RTF_PICW, + RTF_PICH, + RTF_WBMBITSPIXEL, + RTF_WBMPLANES, + RTF_WBMWIDTHBYTES, + RTF_PICWGOAL, + RTF_PICHGOAL, + RTF_BIN, + RTF_PICSCALEX, + RTF_PICSCALEY, + RTF_PICSCALED, + RTF_WBITMAP, + RTF_WMETAFILE, + RTF_MACPICT, + RTF_OSMETAFILE, + RTF_DIBITMAP, + RTF_PICCROPT, + RTF_PICCROPB, + RTF_PICCROPL, + RTF_PICCROPR, + RTF_PICDATA, + RTF_PICBMP, + RTF_PICBPP, + RTF_PICPROP, + RTF_SHPPICT, + RTF_EMFBLIP, + RTF_PNGBLIP, + RTF_JPEGBLIP, + RTF_NONSHPPICT, + RTF_BLIPTAG, + RTF_BLIPUID, + RTF_BLIPUPI, + + RTF_FIELD, // Fields + RTF_FLDDIRTY, + RTF_FLDEDIT, + RTF_FLDLOCK, + RTF_FLDPRIV, + RTF_FLDINST, + RTF_FLDRSLT, + RTF_FLDTYPE, + RTF_TIME, + RTF_DATE, + RTF_WPEQN, + + RTF_NOLINE, + RTF_REVISED, + + RTF_BKMKCOLF, + RTF_BKMKCOLL, + RTF_PSOVER, + RTF_DOCTEMP, + RTF_DELETED, + + RTF_FCHARSET, + RTF_FALT, + RTF_FPRQ, + RTF_PANOSE, + RTF_FNAME, + RTF_FBIAS, + + RTF_ADDITIVE, + RTF_BKMKPUB, + RTF_CPG, + RTF_DATAFIELD, + + RTF_FBIDI, + RTF_FID, + RTF_FILE, + RTF_FILETBL, + RTF_FNETWORK, + RTF_FONTEMB, + RTF_FONTFILE, + RTF_FOSNUM, + RTF_FRELATIVE, + RTF_FTNIL, + RTF_FTTRUETYPE, + RTF_FVALIDDOS, + RTF_FVALIDHPFS, + RTF_FVALIDMAC, + RTF_FVALIDNTFS, + RTF_LINKSELF, + RTF_PUBAUTO, + RTF_REVTBL, + RTF_RTLMARK, + RTF_SEC, + RTF_TCN, + RTF_XEF, + + RTF_UD, // Unicode + RTF_UPR, + RTF_U, + RTF_UC, + RTF_ANSICPG, + + RTF_FFEXITMCR, // Form Fields + RTF_FFENTRYMCR, + RTF_FFDEFTEXT, + RTF_FFFORMAT, + RTF_FFSTATTEXT, + RTF_FORMFIELD, + RTF_FFNAME, + RTF_FFHELPTEXT, + RTF_FFL, + RTF_FFOWNHELP, + RTF_FFOWNSTAT, + RTF_FFMAXLEN, + RTF_FFHASLISTBOX, + RTF_FFHPS, + RTF_FFPROT, + RTF_FFTYPE, + RTF_FFTYPETXT, + RTF_FFSIZE, + RTF_FFRECALC, + RTF_FFRES, + RTF_FFDEFRES, + + RTF_HIGHLIGHT, + +/* */ + + RTF_DEFTAB = RTF_DOCFMT, + RTF_HYPHHOTZ, + RTF_LINESTART, + RTF_FRACWIDTH, + RTF_NEXTFILE, + RTF_TEMPLATE, + RTF_MAKEBACKUP, + RTF_DEFFORMAT, + RTF_DEFLANG, + RTF_FTNSEP, + RTF_FTNSEPC, + RTF_FTNCN, + RTF_ENDNOTES, + RTF_ENDDOC, + RTF_FTNTJ, + RTF_FTNBJ, + RTF_FTNSTART, + RTF_FTNRESTART, + RTF_PAPERW, + RTF_PAPERH, + RTF_MARGL, + RTF_MARGR, + RTF_MARGT, + RTF_MARGB, + RTF_FACINGP, + RTF_GUTTER, + RTF_MARGMIRROR, + RTF_LANDSCAPE, + RTF_PGNSTART, + RTF_WIDOWCTRL, + RTF_REVISIONS, + RTF_REVPROP, + RTF_REVBAR, + + RTF_AENDDOC, + RTF_AENDNOTES, + RTF_AFTNBJ, + RTF_AFTNCN, + RTF_AFTNNALC, + RTF_AFTNNAR, + RTF_AFTNNAUC, + RTF_AFTNNCHI, + RTF_AFTNNRLC, + RTF_AFTNNRUC, + RTF_AFTNRESTART, + RTF_AFTNRSTCONT, + RTF_AFTNSEP, + RTF_AFTNSEPC, + RTF_AFTNSTART, + RTF_AFTNTJ, + RTF_ALLPROT, + RTF_ANNOTPROT, + RTF_ATNAUTHOR, + RTF_ATNICN, + RTF_ATNREF, + RTF_ATNTIME, + RTF_ATRFEND, + RTF_ATRFSTART, + RTF_BRKFRM, + RTF_CVMME, + RTF_FET, + RTF_FLDALT, + RTF_FORMDISP, + RTF_FORMPROT, + RTF_FORMSHADE, + RTF_FTNALT, + RTF_FTNNALC, + RTF_FTNNAR, + RTF_FTNNAUC, + RTF_FTNNCHI, + RTF_FTNNRLC, + RTF_FTNNRUC, + RTF_FTNRSTCONT, + RTF_FTNRSTPG, + RTF_HYPHAUTO, + RTF_HYPHCAPS, + RTF_HYPHCONSEC, + RTF_LINKSTYLES, + RTF_LTRDOC, + RTF_NOCOLBAL, + RTF_NOEXTRASPRL, + RTF_NOTABIND, + RTF_OTBLRUL, + RTF_PRCOLBL, + RTF_PRINTDATA, + RTF_PSZ, + RTF_REVPROT, + RTF_RTLDOC, + RTF_SPRSSPBF, + RTF_SPRSTSP, + RTF_SWPBDR, + RTF_TRANSMF, + RTF_WRAPTRSP, + + RTF_PRIVATE, + RTF_NOULTRLSPC, + RTF_MSMCAP, + RTF_NOLEAD, + RTF_NOSPACEFORUL, + RTF_LYTEXCTTP, + RTF_LYTPRTMET, + RTF_DNTBLNSBDB, + RTF_FROMTEXT, + RTF_EXPSHRTN, + RTF_PGBRDRT, + RTF_SPRSBSP, + RTF_PGBRDRR, + RTF_PGBRDRSNAP, + RTF_BDBFHDR, + RTF_SUBFONTBYSIZE, + RTF_TRUNCATEFONTHEIGHT, + RTF_SPRSLNSP, + RTF_SPRSTSM, + RTF_PGBRDRL, + RTF_WPJST, + RTF_PGBRDRB, + RTF_WPSP, + RTF_NOXLATTOYEN, + RTF_OLDLINEWRAP, + RTF_PGBRDRFOOT, + RTF_PGBRDRHEAD, + RTF_DEFLANGFE, + RTF_DOCTYPE, + RTF_PGBRDROPT, + RTF_VIEWKIND, + RTF_VIEWSCALE, + RTF_WINDOWCAPTION, + RTF_BRDRART, + RTF_VIEWZK, + RTF_DOCVAR, + + RTF_DGMARGIN, + RTF_AFTNNCHOSUNG, + RTF_AFTNNCNUM, + RTF_AFTNNDBAR, + RTF_AFTNNDBNUM, + RTF_AFTNNDBNUMD, + RTF_AFTNNDBNUMK, + RTF_AFTNNDBNUMT, + RTF_AFTNNGANADA, + RTF_AFTNNGBNUM, + RTF_AFTNNGBNUMD, + RTF_AFTNNGBNUMK, + RTF_AFTNNGBNUML, + RTF_AFTNNZODIAC, + RTF_AFTNNZODIACD, + RTF_AFTNNZODIACL, + RTF_FTNNCHOSUNG, + RTF_FTNNCNUM, + RTF_FTNNDBAR, + RTF_FTNNDBNUM, + RTF_FTNNDBNUMD, + RTF_FTNNDBNUMK, + RTF_FTNNDBNUMT, + RTF_FTNNGANADA, + RTF_FTNNGBNUM, + RTF_FTNNGBNUMD, + RTF_FTNNGBNUMK, + RTF_FTNNGBNUML, + RTF_FTNNZODIAC, + RTF_FTNNZODIACD, + RTF_FTNNZODIACL, + + RTF_ADEFLANG, + RTF_ADEFF, + +/* */ + + RTF_SECTD = RTF_SECTFMT, + RTF_ENDNHERE, + RTF_BINFSXN, + RTF_BINSXN, + RTF_SBKNONE, + RTF_SBKCOL, + RTF_SBKPAGE, + RTF_SBKEVEN, + RTF_SBKODD, + RTF_COLS, + RTF_COLSX, + RTF_COLNO, + RTF_COLSR, + RTF_COLW, + RTF_LINEBETCOL, + RTF_LINEMOD, + RTF_LINEX, + RTF_LINESTARTS, + RTF_LINERESTART, + RTF_LINEPAGE, + RTF_LINECONT, + RTF_PGWSXN, + RTF_PGHSXN, + RTF_MARGLSXN, + RTF_MARGRSXN, + RTF_MARGTSXN, + RTF_MARGBSXN, + RTF_GUTTERSXN, + RTF_LNDSCPSXN, + RTF_FACPGSXN, + RTF_TITLEPG, + RTF_HEADERY, + RTF_FOOTERY, + RTF_PGNSTARTS, + RTF_PGNCONT, + RTF_PGNRESTART, + RTF_PGNX, + RTF_PGNY, + RTF_PGNDEC, + RTF_PGNUCRM, + RTF_PGNLCRM, + RTF_PGNUCLTR, + RTF_PGNLCLTR, + RTF_VERTALT, + RTF_VERTALB, + RTF_VERTALC, + RTF_VERTALJ, + + RTF_FOOTER, + RTF_FOOTERL, + RTF_FOOTERR, + RTF_FOOTERF, + RTF_HEADER, + RTF_HEADERL, + RTF_HEADERR, + RTF_HEADERF, + RTF_DS, + RTF_LTRSECT, + RTF_PGNHN, + RTF_PGNHNSC, + RTF_PGNHNSH, + RTF_PGNHNSM, + RTF_PGNHNSN, + RTF_PGNHNSP, + RTF_RTLSECT, + RTF_SECTUNLOCKED, + RTF_STEXTFLOW, + RTF_PGNCHOSUNG, + RTF_PGNCNUM, + RTF_PGNDBNUMK, + RTF_PGNDBNUMT, + RTF_PGNGANADA, + RTF_PGNGBNUM, + RTF_PGNGBNUMD, + RTF_PGNGBNUMK, + RTF_PGNGBNUML, + RTF_PGNZODIAC, + RTF_PGNZODIACD, + RTF_PGNZODIACL, + RTF_SECTDEFAULTCL, + RTF_SECTEXPAND, + RTF_SECTLINEGRID, + RTF_SECTSPECIFYCL, + RTF_SECTSPECIFYL, + + // Swg header/footer tokens + RTF_HEADER_YB = (RTF_SECTFMT|RTF_SWGDEFS), + RTF_HEADER_XL, + RTF_HEADER_XR, + RTF_FOOTER_YT, + RTF_FOOTER_XL, + RTF_FOOTER_XR, + RTF_HEADER_YH, + RTF_FOOTER_YH, + RTF_BALANCED_COLUMN, + + +/* */ + + RTF_PARD = RTF_PARFMT, + RTF_S, + RTF_INTBL, + RTF_KEEP, + RTF_KEEPN, + RTF_LEVEL, + RTF_PAGEBB, + RTF_SBYS, + RTF_QL, + RTF_QR, + RTF_QJ, + RTF_QC, + RTF_FI, + RTF_LI, + RTF_LIN, + RTF_RI, + RTF_RIN, + RTF_SB, + RTF_SA, + RTF_SL, + RTF_HYPHPAR, + RTF_LTRPAR, + RTF_NOWIDCTLPAR, + RTF_RTLPAR, + RTF_SLMULT, + RTF_SUBDOCUMENT, + + RTF_WIDCTLPAR, + + RTF_LISTTEXT, + RTF_POSYIN, + RTF_PNRNOT, + RTF_BRDRDASHDOTSTR, + RTF_POSYOUT, + RTF_BRDRDASHD, + RTF_BRDRDASHDD, + RTF_BRDRENGRAVE, + RTF_BRDRTHTNLG, + RTF_BRDREMBOSS, + RTF_BRDRTNTHTNLG, + RTF_BRDRDASHSM, + RTF_BRDRTHTNMG, + RTF_OVERLAY, + RTF_BRDRTNTHSG, + RTF_BRDRTNTHMG, + RTF_BRDRTHTNSG, + RTF_BRDRTNTHLG, + RTF_BRDRTRIPLE, + RTF_BRDRTNTHTNSG, + RTF_BRDRTNTHTNMG, + RTF_BRDRWAVYDB, + RTF_BRDRWAVY, + RTF_ILVL, + RTF_DFRSTOP, + RTF_DFRXST, + RTF_PNRAUTH, + RTF_DFRSTART, + RTF_OUTLINELEVEL, + RTF_DFRAUTH, + RTF_DFRDATE, + RTF_PNRRGB, + RTF_PNRPNBR, + RTF_PNRSTART, + RTF_PNRXST, + RTF_PNRSTOP, + RTF_PNRDATE, + RTF_PNRNFC, + RTF_NOSNAPLINEGRID, + RTF_FAAUTO, + RTF_FAHANG, + RTF_FAVAR, + RTF_FACENTER, + RTF_FAROMAN, + RTF_FAFIXED, + RTF_ADJUSTRIGHT, + RTF_LS, + RTF_NOCWRAP, + RTF_NOOVERFLOW, + RTF_ASPALPHA, + + +/* */ + + RTF_TX = RTF_TABSTOPDEF, + RTF_TB, + RTF_TQL, + RTF_TQR, + RTF_TQC, + RTF_TQDEC, + RTF_TLDOT, + RTF_TLHYPH, + RTF_TLUL, + RTF_TLTH, + RTF_TLEQ, + + // Swg TabStop tokens + RTF_TLSWG = (RTF_TABSTOPDEF|RTF_SWGDEFS), + +/* */ + + RTF_BRDRT = RTF_BRDRDEF, + RTF_BRDRB, + RTF_BRDRL, + RTF_BRDRR, + RTF_BRDRBTW, + RTF_BRDRBAR, + RTF_BOX, + RTF_BRSP, + RTF_BRDRW, + RTF_BRDRCF, + RTF_BRDRS, + RTF_BRDRTH, + RTF_BRDRSH, + RTF_BRDRDB, + RTF_BRDRDOT, + RTF_BRDRHAIR, + RTF_BRDRDASH, + RTF_BRDRINSET, + RTF_BRDROUTSET, + RTF_BRDRFRAME, + + // Swg border tokens + RTF_BRDBOX = (RTF_BRDRDEF|RTF_SWGDEFS), + RTF_BRDLINE_COL, + RTF_BRDLINE_IN, + RTF_BRDLINE_OUT, + RTF_BRDLINE_DIST, + +/* */ + + RTF_PLAIN = RTF_CHRFMT, + RTF_B, + RTF_CAPS, + RTF_DN, + RTF_SUB, + RTF_NOSUPERSUB, + RTF_EXPND, + RTF_EXPNDTW, + RTF_KERNING, + RTF_F, + RTF_FS, + RTF_I, + RTF_OUTL, + RTF_SCAPS, + RTF_SHAD, + RTF_STRIKE, + RTF_UL, + RTF_ULD, + RTF_ULDB, + RTF_ULNONE, + RTF_ULW, + RTF_OL, + RTF_OLD, + RTF_OLDB, + RTF_OLNONE, + RTF_OLW, + RTF_UP, + RTF_SUPER, + RTF_V, + RTF_CF, + RTF_CB, + RTF_LANG, + RTF_CCHS, + RTF_CS, + RTF_LTRCH, + RTF_REVAUTH, + RTF_REVDTTM, + RTF_RTLCH, + + RTF_CHBGFDIAG, + RTF_CHBGDKVERT, + RTF_CHBGDKHORIZ, + RTF_CHBRDR, + RTF_CHBGVERT, + RTF_CHBGHORIZ, + RTF_CHBGDKFDIAG, + RTF_CHBGDCROSS, + RTF_CHBGCROSS, + RTF_CHBGBDIAG, + RTF_CHBGDKDCROSS, + RTF_CHBGDKCROSS, + RTF_CHBGDKBDIAG, + RTF_ULDASHD, + RTF_ULDASH, + RTF_ULDASHDD, + RTF_ULWAVE, + RTF_ULC, + RTF_ULTH, + RTF_OLDASHD, + RTF_OLDASH, + RTF_OLDASHDD, + RTF_OLWAVE, + RTF_OLC, + RTF_OLTH, + RTF_EMBO, + RTF_IMPR, + RTF_STRIKED, + RTF_CRDATE, + RTF_CRAUTH, + RTF_CHARSCALEX, + RTF_CHCBPAT, + RTF_CHCFPAT, + RTF_CHSHDNG, + RTF_REVAUTHDEL, + RTF_REVDTTMDEL, + RTF_CGRID, + RTF_GCW, + RTF_NOSECTEXPAND, + RTF_GRIDTBL, + RTF_G, + RTF_ANIMTEXT, + RTF_ULTHD, + RTF_ULTHDASH, + RTF_ULLDASH, + RTF_ULTHLDASH, + RTF_ULTHDASHD, + RTF_ULTHDASHDD, + RTF_ULHWAVE, + RTF_ULULDBWAVE, + RTF_OLTHD, + RTF_OLTHDASH, + RTF_OLLDASH, + RTF_OLTHLDASH, + RTF_OLTHDASHD, + RTF_OLTHDASHDD, + RTF_OLHWAVE, + RTF_OLOLDBWAVE, + + // association control words + RTF_AB, + RTF_ACAPS, + RTF_ACF, + RTF_ADN, + RTF_AEXPND, + RTF_AF, + RTF_AFS, + RTF_AI, + RTF_ALANG, + RTF_AOUTL, + RTF_ASCAPS, + RTF_ASHAD, + RTF_ASTRIKE, + RTF_AUL, + RTF_AULD, + RTF_AULDB, + RTF_AULNONE, + RTF_AULW, + RTF_AUP, + + RTF_LOCH, + RTF_HICH, + RTF_DBCH, + RTF_LANGFE, + RTF_ACCNONE, + RTF_ACCDOT, + RTF_ACCCOMMA, + RTF_TWOINONE, + RTF_HORZVERT, + + // Swg border tokens + RTF_SWG_ESCPROP = (RTF_CHRFMT|RTF_SWGDEFS), + RTF_HYPHEN, + RTF_HYPHLEAD, + RTF_HYPHTRAIL, + RTF_HYPHMAX, + + +/* */ + + RTF_CHDATE = RTF_SPECCHAR, + RTF_CHDATEL, + RTF_CHDATEA, + RTF_CHTIME, + RTF_CHPGN, + RTF_CHFTN, + RTF_CHATN, + RTF_CHFTNSEP, + RTF_CHFTNSEPC, + RTF_CELL, + RTF_ROW, + RTF_PAR, + RTF_SECT, + RTF_PAGE, + RTF_COLUM, + RTF_LINE, + RTF_TAB, + RTF_EMDASH, + RTF_ENDASH, + RTF_BULLET, + RTF_LQUOTE, + RTF_RQUOTE, + RTF_LDBLQUOTE, + RTF_RDBLQUOTE, + RTF_FORMULA, + RTF_NONBREAKINGSPACE, + RTF_OPTIONALHYPHEN, + RTF_NONBREAKINGHYPHEN, + RTF_SUBENTRYINDEX, + RTF_IGNOREFLAG, + RTF_HEX, + RTF_EMSPACE, + RTF_ENSPACE, + RTF_LTRMARK, + RTF_SECTNUM, + RTF_SOFTCOL, + RTF_SOFTLHEIGHT, + RTF_SOFTLINE, + RTF_SOFTPAGE, + RTF_ZWJ, + RTF_ZWNJ, + +/* */ + + RTF_ABSW = RTF_APOCTL, + RTF_ABSH, + RTF_NOWRAP, + RTF_DXFRTEXT, + RTF_DFRMTXTX, + RTF_DFRMTXTY, + RTF_DROPCAPLI, + RTF_DROPCAPT, + RTF_ABSNOOVRLP, + RTF_PHMRG, + RTF_PHPG, + RTF_PHCOL, + RTF_POSX, + RTF_POSNEGX, + RTF_POSXC, + RTF_POSXI, + RTF_POSXO, + RTF_POSXL, + RTF_POSXR, + RTF_PVMRG, + RTF_PVPG, + RTF_PVPARA, + RTF_POSY, + RTF_POSNEGY, + RTF_POSYT, + RTF_POSYIL, + RTF_POSYB, + RTF_POSYC, + RTF_ABSLOCK, + RTF_FRMTXLRTB, + RTF_FRMTXTBRL, + RTF_FRMTXBTLR, + RTF_FRMTXLRTBV, + RTF_FRMTXTBRLV, + + // Swg frame tokens + RTF_FLYPRINT = (RTF_APOCTL|RTF_SWGDEFS), + RTF_FLYOPAQUE, + RTF_FLYPRTCTD, + RTF_FLYMAINCNT, + RTF_FLYVERT, + RTF_FLYHORZ, + RTF_FLYOUTLEFT, + RTF_FLYOUTRIGHT, + RTF_FLYOUTUPPER, + RTF_FLYOUTLOWER, + RTF_FLYANCHOR, + RTF_FLY_CNTNT, + RTF_FLY_COLUMN, + RTF_FLY_PAGE, + RTF_FLY_INPARA, + + +/* */ + + RTF_SHADING = RTF_SHADINGDEF, + RTF_CFPAT, + RTF_CBPAT, + RTF_BGHORIZ, + RTF_BGVERT, + RTF_BGFDIAG, + RTF_BGBDIAG, + RTF_BGCROSS, + RTF_BGDCROSS, + RTF_BGDKHORIZ, + RTF_BGDKVERT, + RTF_BGDKFDIAG, + RTF_BGDKBDIAG, + RTF_BGDKCROSS, + RTF_BGDKDCROSS, + +/* */ + + RTF_TROWD = RTF_TABLEDEF, + RTF_TRGAPH, + RTF_TRLEFT, + RTF_TRRH, + + RTF_TRQL, + RTF_TRQR, + RTF_TRQC, + + RTF_CLMGF, + RTF_CLMRG, + RTF_CELLX, + RTF_LTRROW, + RTF_RTLROW, + RTF_TRBRDRB, + RTF_TRBRDRH, + RTF_TRBRDRL, + RTF_TRBRDRR, + RTF_TRBRDRT, + RTF_TRBRDRV, + RTF_TRHDR, + RTF_TRKEEP, + RTF_TRPADDB, + RTF_TRPADDL, + RTF_TRPADDR, + RTF_TRPADDT, + RTF_TRPADDFB, + RTF_TRPADDFL, + RTF_TRPADDFR, + RTF_TRPADDFT, + RTF_TCELLD, + RTF_CLTXTBRL, + RTF_CLTXLRTB, + RTF_CLVERTALB, + RTF_CLVERTALT, + RTF_CLVERTALC, + RTF_CLVMGF, + RTF_CLVMRG, + RTF_CLTXTBRLV, + RTF_CLTXBTLR, + RTF_CLTXLRTBV, + RTF_CLPADL, + RTF_CLPADT, + RTF_CLPADB, + RTF_CLPADR, + RTF_CLPADFL, + RTF_CLPADFT, + RTF_CLPADFB, + RTF_CLPADFR, + + + RTF_CLBRDRT = (RTF_BRDRDEF|RTF_TABLEDEF), + RTF_CLBRDRL, + RTF_CLBRDRB, + RTF_CLBRDRR, + + RTF_CLCFPAT = (RTF_SHADINGDEF|RTF_TABLEDEF), + RTF_CLCBPAT, + RTF_CLSHDNG, + RTF_CLBGHORIZ, + RTF_CLBGVERT, + RTF_CLBGFDIAG, + RTF_CLBGBDIAG, + RTF_CLBGCROSS, + RTF_CLBGDCROSS, + RTF_CLBGDKHOR, + RTF_CLBGDKVERT, + RTF_CLBGDKFDIAG, + RTF_CLBGDKBDIAG, + RTF_CLBGDKCROSS, + RTF_CLBGDKDCROSS, + +/* */ + + +/* */ + + RTF_DO = RTF_DRAWOBJECTS, + RTF_DOBXCOLUMN, + RTF_DOBXMARGIN, + RTF_DOBXPAGE, + RTF_DOBYMARGIN, + RTF_DOBYPAGE, + RTF_DOBYPARA, + RTF_DODHGT, + RTF_DOLOCK, + RTF_DPAENDHOL, + RTF_DPAENDL, + RTF_DPAENDSOL, + RTF_DPAENDW, + RTF_DPARC, + RTF_DPARCFLIPX, + RTF_DPARCFLIPY, + RTF_DPASTARTHOL, + RTF_DPASTARTL, + RTF_DPASTARTSOL, + RTF_DPASTARTW, + RTF_DPCALLOUT, + RTF_DPCOA, + RTF_DPCOACCENT, + RTF_DPCOBESTFIT, + RTF_DPCOBORDER, + RTF_DPCODABS, + RTF_DPCODBOTTOM, + RTF_DPCODCENTER, + RTF_DPCODTOP, + RTF_DPCOLENGTH, + RTF_DPCOMINUSX, + RTF_DPCOMINUSY, + RTF_DPCOOFFSET, + RTF_DPCOSMARTA, + RTF_DPCOTDOUBLE, + RTF_DPCOTRIGHT, + RTF_DPCOTSINGLE, + RTF_DPCOTTRIPLE, + RTF_DPCOUNT, + RTF_DPELLIPSE, + RTF_DPENDGROUP, + RTF_DPFILLBGCB, + RTF_DPFILLBGCG, + RTF_DPFILLBGCR, + RTF_DPFILLBGGRAY, + RTF_DPFILLBGPAL, + RTF_DPFILLFGCB, + RTF_DPFILLFGCG, + RTF_DPFILLFGCR, + RTF_DPFILLFGGRAY, + RTF_DPFILLFGPAL, + RTF_DPFILLPAT, + RTF_DPGROUP, + RTF_DPLINE, + RTF_DPLINECOB, + RTF_DPLINECOG, + RTF_DPLINECOR, + RTF_DPLINEDADO, + RTF_DPLINEDADODO, + RTF_DPLINEDASH, + RTF_DPLINEDOT, + RTF_DPLINEGRAY, + RTF_DPLINEHOLLOW, + RTF_DPLINEPAL, + RTF_DPLINESOLID, + RTF_DPLINEW, + RTF_DPPOLYCOUNT, + RTF_DPPOLYGON, + RTF_DPPOLYLINE, + RTF_DPPTX, + RTF_DPPTY, + RTF_DPRECT, + RTF_DPROUNDR, + RTF_DPSHADOW, + RTF_DPSHADX, + RTF_DPSHADY, + RTF_DPTXBX, + RTF_DPTXBXMAR, + RTF_DPTXBXTEXT, + RTF_DPX, + RTF_DPXSIZE, + RTF_DPY, + RTF_DPYSIZE, + + RTF_DPCODESCENT, + RTF_BACKGROUND, + RTF_SHPBYPAGE, + RTF_SHPBYPARA, + RTF_SHPBYMARGIN, + RTF_SHPBXCOLUMN, + RTF_SHPBXMARGIN, + RTF_SHPBXPAGE, + RTF_SHPLOCKANCHOR, + RTF_SHPWR, + RTF_HLLOC, + RTF_HLSRC, + RTF_SHPWRK, + RTF_SHPTOP, + RTF_SHPRSLT, + RTF_HLFR, + RTF_SHPTXT, + RTF_SHPFHDR, + RTF_SHPGRP, + RTF_SHPINST, + RTF_SHPRIGHT, + RTF_SHPFBLWTXT, + RTF_SHPZ, + RTF_SHPBOTTOM, + RTF_SHPLEFT, + RTF_SHPLID, + +/* */ + + RTF_OBJALIAS = RTF_OBJECTS, + RTF_OBJALIGN, + RTF_OBJAUTLINK, + RTF_OBJCLASS, + RTF_OBJCROPB, + RTF_OBJCROPL, + RTF_OBJCROPR, + RTF_OBJCROPT, + RTF_OBJDATA, + RTF_OBJECT, + RTF_OBJEMB, + RTF_OBJH, + RTF_OBJICEMB, + RTF_OBJLINK, + RTF_OBJLOCK, + RTF_OBJNAME, + RTF_OBJPUB, + RTF_OBJSCALEX, + RTF_OBJSCALEY, + RTF_OBJSECT, + RTF_OBJSETSIZE, + RTF_OBJSUB, + RTF_OBJTIME, + RTF_OBJTRANSY, + RTF_OBJUPDATE, + RTF_OBJW, + RTF_RESULT, + RTF_RSLTBMP, + RTF_RSLTMERGE, + RTF_RSLTPICT, + RTF_RSLTRTF, + RTF_RSLTTXT, + RTF_OBJOCX, + RTF_OBJHTML, + RTF_OBJATTPH, + +/* */ + + RTF_PN = RTF_NUMBULLETS, + RTF_PNACROSS, + RTF_PNB, + RTF_PNCAPS, + RTF_PNCARD, + RTF_PNCF, + RTF_PNDEC, + RTF_PNF, + RTF_PNFS, + RTF_PNHANG, + RTF_PNI, + RTF_PNINDENT, + RTF_PNLCLTR, + RTF_PNLCRM, + RTF_PNLVL, + RTF_PNLVLBLT, + RTF_PNLVLBODY, + RTF_PNLVLCONT, + RTF_PNNUMONCE, + RTF_PNORD, + RTF_PNORDT, + RTF_PNPREV, + RTF_PNQC, + RTF_PNQL, + RTF_PNQR, + RTF_PNRESTART, + RTF_PNSCAPS, + RTF_PNSECLVL, + RTF_PNSP, + RTF_PNSTART, + RTF_PNSTRIKE, + RTF_PNTEXT, + RTF_PNTXTA, + RTF_PNTXTB, + RTF_PNUCLTR, + RTF_PNUCRM, + RTF_PNUL, + RTF_PNULD, + RTF_PNULDB, + RTF_PNULNONE, + RTF_PNULW, + RTF_LIST, + RTF_LISTLEVEL, + RTF_LISTOVERRIDE, + RTF_LISTOVERRIDETABLE, + RTF_LISTTABLE, + RTF_LISTNAME, + RTF_LEVELNUMBERS, + RTF_LEVELNORESTART, + RTF_LEVELNFC, + RTF_LEVELOLD, + RTF_LISTOVERRIDECOUNT, + RTF_LISTTEMPLATEID, + RTF_LEVELINDENT, + RTF_LEVELFOLLOW, + RTF_LEVELLEGAL, + RTF_LEVELJC, + RTF_LISTOVERRIDESTART, + RTF_LISTID, + RTF_LISTRESTARTHDN, + RTF_LEVELTEXT, + RTF_LISTOVERRIDEFORMAT, + RTF_LEVELPREVSPACE, + RTF_LEVELPREV, + RTF_LEVELSPACE, + RTF_LISTSIMPLE, + RTF_LEVELSTARTAT, + RTF_PNAIUEO, + RTF_PNAIUEOD, + RTF_PNCHOSUNG, + RTF_PNDBNUMD, + RTF_PNDBNUMK, + RTF_PNDBNUML, + RTF_PNDBNUMT, + RTF_PNGANADA, + RTF_PNGBNUM, + RTF_PNGBNUMD, + RTF_PNGBNUMK, + RTF_PNGBNUML, + RTF_PNZODIAC, + RTF_PNZODIACD, + RTF_PNZODIACL, + RTF_LFOLEVEL, + +/* */ + + RTF_GRF_ALIGNV= RTF_SWGDEFS, + RTF_GRF_ALIGNH, + RTF_GRF_MIRROR, + RTF_SWG_PRTDATA, + RTF_BKMK_KEY, + RTF_SHADOW, + RTF_SHDW_DIST, + RTF_SHDW_STYLE, + RTF_SHDW_COL, + RTF_SHDW_FCOL, + RTF_PGDSCTBL, + RTF_PGDSC, + RTF_PGDSCUSE, + RTF_PGDSCNXT, + RTF_PGDSCNO, + RTF_PGBRK, + RTF_SOUTLVL, + +// shapes + RTF_SHP, RTF_SN, RTF_SV, RTF_SP +/* + RTF_SHPLEFT, + RTF_SHPTOP, + RTF_SHPBOTTOM, + RTF_SHPRIGHT +*/ + +}; + +#endif // INCLUDED_SVTOOLS_RTFTOKEN_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx new file mode 100644 index 000000000..686b50a96 --- /dev/null +++ b/include/svtools/ruler.hxx @@ -0,0 +1,804 @@ +/* -*- 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_SVTOOLS_RULER_HXX +#define INCLUDED_SVTOOLS_RULER_HXX + +#include <memory> +#include <map> +#include <vector> +#include <svtools/svtdllapi.h> +#include <rtl/ref.hxx> +#include <tools/fldunit.hxx> +#include <tools/link.hxx> +#include <tools/fract.hxx> +#include <vcl/window.hxx> +#include <vcl/glyphitem.hxx> + +class MouseEvent; +class TrackingEvent; +class DataChangedEvent; +class SvtRulerAccessible; + +/************************************************************************* + +Description +============ + +class Ruler + +This class is used for displaying a ruler, but it can also be used +for setting or moving tabs and margins. + +-------------------------------------------------------------------------- + +WinBits + +WB_HORZ ruler is displayed horizontally +WB_VERT ruler is displayed vertically +WB_3DLOOK 3D look +WB_BORDER border at the bottom/right margin +WB_EXTRAFIELD Field in the upper left corner for + displaying and selecting tabs, origin of coordinates, ... +WB_RIGHT_ALIGNED Marks the vertical ruler as right aligned + +-------------------------------------------------------------------------- + +All ruler parameters are set in pixel units. This way double conversions +and rounding errors are avoided and the ruler displays the margins +at their actual position in the document. Because of this, the application can, +for example in tables, do its own roundings and the positions on the ruler will +still match those in the document. However, for the ruler to know how the +document is displayed on the screen, some additional values have to be configured + +SetWinPos() sets the offset of the ruler's edit window. In doing so, +the width of the window can also be configured. If there is a 0 among the +values passed to the function, the position/width is automatically set to +the width of the ruler. + +SetPagePos() sets the offset of the page relative to the edit window and the +width of the page. If there is a 0 among the values passed to the function, +the position/width is automatically set as if the page filled the whole edit window. + +SetBorderPos() sets the offset of the border. The position is relative to +the upper/left margin of the window. This is needed when there are a horizontal +and a vertical ruler visible at the same time. Example: + aHRuler.SetBorderPos( aVRuler.GetSizePixel().Width()-1 ); + +SetNullOffset() sets the origin relative to the page. + +All the other values (margins, indentation, tabs, ...) refer to the origin, +which is set with SetNullOffset(). + +The values are computed as described below: + +- WinPos (if both windows have the same parent) + + Point aHRulerPos = aHRuler.GetPosPixel(); + Point aEditWinPos = aEditWin.GetPosPixel(); + aHRuler.SetWinPos( aEditWinPos().X() - aHRulerPos.X() ); + +- PagePos + + Point aPagePos = aEditWin.LogicToPixel( aEditWin.GetPagePos() ); + aHRuler.SetPagePos( aPagePos().X() ); + +- All other values + + Add the logical values, recompute as position and subtract the + previously saved pixel positions (of PagePos and Null Offset). + +-------------------------------------------------------------------------- + +SetUnit() and SetZoom() configure which unit is used to display +the values on the ruler. The following units are accepted: + + FieldUnit::MM + FieldUnit::CM (Default) + FieldUnit::M + FieldUnit::KM + FieldUnit::INCH + FieldUnit::FOOT + FieldUnit::MILE + FieldUnit::POINT + FieldUnit::PICA + +-------------------------------------------------------------------------- + +SetMargin1() sets the upper/left margin and SetMargin2() sets the +bottom/right margin. If these methods are called without arguments, +no margins are displayed. Otherwise, the following arguments can be passed: + + long nPos - offset in pixels relative to the origin + sal_uInt16 nStyle - bit style: + RULER_MARGIN_SIZEABLE + margin size can be changed + + The following bits can be set in addition + to these styles: + RULER_STYLE_INVISIBLE + + +SetBorders() sets an array of margins. To do this, an array of type RulerBorder +has to be passed. In the array, the following values have to be initialized: + + long nPos - offset in pixels relative to the origin + long nWidth - column spacing in pixels (can also be 0, for example, + for table columns) + sal_uInt16 nStyle - bit style: + RulerBorderStyle::Sizeable + Column spacing can be changed. This flag should + only be set if the size of the spacing is changed, + not that of a cell. + RulerBorderStyle::Moveable + Column spacing/border can be moved. Whenever + table borders are to be moved, this flag should + be set instead of SIZEABLE (SIZEABLE indicates + that the size of a spacing, not that of a single + cell can be changed). + RulerBorderStyle::Variable + Not all of the column spacings are equal + RulerBorderStyle::Table + Table border. Whenever this style is set, the column + width must be 0. + RulerBorderStyle::Snap + Auxiliary line. Whenever this style is set, the + column width must be 0. + RulerBorderStyle::Margin + Margin. Whenever this style is set, the column + width must be 0. + + The following bits can be set in addition + to these styles: + RULER_STYLE_INVISIBLE + +SetIndents() sets an array of indents. This method may only be used for horizontal +rulers. A Ruler Indent must be passed as an argument, with the following values +initialized: + + long nPos - offset relative to the origin in pixels + sal_uInt16 nStyle - bit style: + RulerIndentStyle::Top (indent of the first line) + RulerIndentStyle::Bottom (left/right indent) + RulerIndentStyle::Border (Vertical line that shows the border distance) + The following bits can be set in addition + to these styles: + RULER_STYLE_DONTKNOW (for old position or for + ambiguity) + RULER_STYLE_INVISIBLE + +SetTabs() sets an array of tabs. This method may only be used for horizontal rulers. +An array of type RulerTab must be passed as an argument, with the following values +initialized: + + long nPos - offset relative to the origin in pixels + sal_uInt16 nStyle - bit style: + RULER_TAB_DEFAULT (can't be selected) + RULER_TAB_LEFT + RULER_TAB_CENTER + RULER_TAB_RIGHT + RULER_TAB_DECIMAL + The following bits can be set in addition + to these styles: + RULER_STYLE_DONTKNOW (for old position of for + ambiguity) + RULER_STYLE_INVISIBLE + +SetLines() displays position lines in the ruler. An array of type RulerLine must be passed, with +the following values initialized: + + long nPos - offset relative to the origin in pixels + sal_uInt16 nStyle - bit style (has to be 0 currently) + +-------------------------------------------------------------------------- + +If the user should also be able to change the margins tabs, borders, ... +in the ruler, a bit more effort is necessary. In this case, the StartDrag(), +Drag() and EndDrag() methods have to be overridden. For the StartDrag() method +it is possible to prevent dragging by returning FALSE. In the drag handler, +the drag position must be queried and the values must be moved to the new +position. This is done by calling the particular Set methods. While in the +drag handler, the values are just cached and only afterward the ruler is redrawn. +All the handlers can also be set as links with the particular Set..Hdl() methods. + + - StartDrag() + Is called when dragging is started. If FALSE is returned, the dragging. + won't be executed. If TRUE is returned, the dragging will be permitted. + If the handler isn't overridden, FALSE will be returned. + + - EndDrag() + Is called at the end of dragging. + + - Drag() + Is called when dragging takes place. + + - Click() + This handler is called when no element has been clicked on. + The position can be queried with GetClickPos(). This way it is possible + to, for example, ser tabs in the ruler. After calling the click handler, + the drag, if any, is immediately triggered. This makes it possible to + set a new tab in the click handler and then immediately move it. + + - DoubleClick() + This handler is called when a double-click has been performed outside + the special panel. The methods GetClickType(), GetClickAryPos() and + GetClickPos() can be used to query what has been clicked on. + This way you can, for example, show the tab dialog when a double-click + is performed on a tab. + +In the drag handler it is possible to query what has been dragged and where +it has been dragged. There are the following query methods: + + - GetDragType() + Returns what has been dragged. + RulerType::Margin1 + RulerType::Margin2 + RulerType::Border + RulerType::Indent + RulerType::Tab + + - GetDragPos() + Returns the pixel position to which the user has moved the mouse + relative to the set zero-offset. + + - GetDragAryPos() + Returns the index in the array if a border, an indent or a tab + is being dragged. Attention: During a drag process, the array position + of the item that has been set before the drag is returned. + Therefore, it is for example also possible, to no longer show a tab + if the mouse is dragged out of the ruler in bottom/right direction. + + - GetDragSize() + If Borders are dragged, this can be used to query whether the size + resp. which side or the position should be changed. + RulerDragSize::Move or 0 - Move + RulerDragSize::N1 - left/upper border + RulerDragSize::N2 - right/bottom border + + - IsDragDelete() + This method can be used to query whether the mouse has been + moved out of the window at the bottom/right while dragging. + By this, it can for example be determined whether the user + wants to delete a tab. + + - IsDragCanceled() + Using this Handler, it can be queried in the EndDrag handler + whether the action was canceled by the user releasing the + mouse at the top/left of the window or by pressing ESC. + In this case, the values are not applied. If during the + dragging, the mouse is dragged out of the window at the + top/left, the old values are displayed automatically without + the Drag handler being called. + But if the user has moved the value to the old position, the + method returns 'false' nevertheless. + If this should be avoided, the application must remember the + old value in the StartDrag handler and compare the value in the + EndDrag handler. + + - GetDragModifier() + Returns the modifier keys that were pressed when the Drag process + was started. See MouseEvent. + + - GetClickPos() + Returns the pixel position at which the user has pressed the mouse + with respect to the configured null-offset. + + - GetClickType() + Returns what is applied by double click: + RulerType::DontKnow (no element in the ruler area) + RulerType::Outside (outside of the ruler area) + RulerType::Margin1 (only Margin1 border) + RulerType::Margin2 (only Margin2 border) + RulerType::Border (Border: GetClickAryPos()) + RulerType::Indent (indent: GetClickAryPos()) + RulerType::Tab (Tab: GetClickAryPos()) + + - GetClickAryPos() + Returns the index in the array if a Border, an Indent or a Tab + is applied via DoubleClick. + + - GetType() + This method can be used to carry out a HitTest, + in order to possibly also apply sth to an Item using the right + mouse button by catching the MouseButtonDown handler. As + parameters, the window position and possibly a pointer to a + sal_uInt16 are passed, in order to determine the array position + of a Tab, an Indent, or a Border. The following values are + returned as type: + RulerType::DontKnow (no element in the ruler area) + RulerType::Outside (outside of the ruler area) + RulerType::Margin1 (only Margin1 border) + RulerType::Margin2 (only Margin2 border) + RulerType::Border (Border: GetClickAryPos()) + RulerType::Indent (indent: GetClickAryPos()) + RulerType::Tab (Tab: GetClickAryPos()) + +If the drag process should be canceled, this can be done using CancelDrag(). +There are the following methods for controlling the Drag: + + - IsDrag() + Returns 'true' if the ruler is in a drag process. + + - CancelDrag() + Cancels the drag process, if one is being carried out. During this, + the old values are restored and the Drag and the EndDrag handlers + are called. + +In order to trigger a Drag from the document, there are the following +methods: + + - StartDocDrag() + This method is passed the MouseEvent of the document window + and what should be dragged. If RulerType::DontKnow is passed + as DragType, the ruler decides what should be dragged. In case + of the other types, the Drag is only started if a respective + element was found at the given position. + This is for example necessary if indents and columns are located + at the same X position. + The return value indicates whether the Drag has been triggered. + If a Drag is triggered, the ruler takes over the normal drag + control and behaves as if the ruler had been clicked directly. + Thus, the ruler captures the mouse and also takes over control + of the Cancel (via keyboard, or if the mouse is moved outside + of the ruler above it or left of it). All handlers are called, + too (including the StartDrag handler). If a MouseEvent with + ClickCount 2 is passed, the DoubleClick handler is also called, + respectively. + +-------------------------------------------------------------------------- + +For the extra field, the content can be determined and there are handlers +that can be used to handle specific actions. + + - ExtraDown() + This handler is called when the mouse is pressed in the extra field. + + - SetExtraType() + With this method, it can be defined what should be displayed in + the extra field. + - ExtraType what should be displayed in the extra field + RulerExtra::DontKnow (nothing) + RulerExtra::NullOffset (coordinate axes) + RulerExtra::Tab (Tab) + - sal_uInt16 nStyle bit field as style: + RULER_STYLE_HIGHLIGHT (selected) + RULER_TAB_... (a Tab style) + + - GetExtraClick() + Returns the number of mouse clicks. By this, it is for example + also possible to trigger an action by a DoubleClick in the + extra field. + + - GetExtraModifier() + Returns the modifier keys that were pressed when the extra field + was clicked. See MouseEvent. + +-------------------------------------------------------------------------- + +Further helper functions: + +- static Ruler::DrawTab() + With this method, a Tab can be output on an OutputDevice. + By this, it is also possible to show the Tabs in dialogs like + they are drawn in the ruler. + + This method outputs the Tab centred at the given position. The size + of the tabs can be defined by the defines RULER_TAB_WIDTH and + RULER_TAB_HEIGHT. + +-------------------------------------------------------------------------- + +Tips for the use of the ruler: + +- For the ruler, neither in the Drag mode nor elsewhere, the setting + of the values must be bracketed in SetUpdateMode(). The ruler itself + takes care that, if multiple values are set, they are automatically + grouped together and output flicker-free. + +- Initially, the sizes, positions and values should be set first for the + ruler, before it is displayed. This is important because otherwise + many values are calculated unnecessarily. + +- When the document window, in which the ruler resides, becomes active + resp. unactive, the methods Activate() and Deactivate() should be + called by the ruler. That is so because the display is switched according + to the settings and the system. + +- For example, while dragging Tabs and Indents, the old positions should + also be shown if possible. For that, while setting the Tabs and Indents, + the old positions should be inserted first into the array in addition + and be linked with the style RULER_STYLE_DONTKNOW. After that, the + remaining values should be set in the array. + +- In case of multiple selected paragraphs and table cells, the Tabs and + Indents should be displayed in grey in front of the first cell resp. + the first paragraph. This can also be achieved by the style + RULER_STYLE_DONTKNOW. + +- The measuring arrow should always be shown when the Alt key (WW-Like) + is pressed during the drag. Maybe, this setting should be configurable + always and possibly the measuring arrows always be shown while + dragging. For all settings, the values should always be rounded to the + multiple of one value because the screen resolution is very imprecise. + +- DoubleClicks should be handled in the following way (GetClickType()): + - RulerType::DontKnow + RulerType::Margin1 + RulerType::Margin2 + If the conditions GetClickPos() <= GetMargin1() or + GetClickPos() >= GetMargin2() are met or the type is equal to + RulerType::Margin1 or RulerType::Margin2, a side dialog should + be displayed in which the focus is at the respective border. + - RulerType::Border + A column or table dialog should be shown in which the focus + is at the respective column that can be queried using + GetClickAryPos(). + - RulerType::Indent + The dialog, in which the indents can be configured, should be + shown. In this, the focus should be on the indent which can + be queried using GetClickAryPos(). + - RulerType::Tab + A TabDialog should be displayed in which the Tab, that can be + queried using GetClickAryPos(), should be selected. + +*************************************************************************/ + + +constexpr WinBits WB_EXTRAFIELD = 0x00004000; +constexpr WinBits WB_RIGHT_ALIGNED = 0x00008000; +constexpr auto WB_STDRULER = WB_HORZ; + + +enum class RulerType { DontKnow, Outside, + Margin1, Margin2, + Border, Indent, Tab }; + +enum class RulerExtra { DontKnow, NullOffset, Tab }; + +constexpr sal_uInt16 RULER_STYLE_HIGHLIGHT = 0x8000; +constexpr sal_uInt16 RULER_STYLE_DONTKNOW = 0x4000; +constexpr sal_uInt16 RULER_STYLE_INVISIBLE = 0x2000; + +enum class RulerDragSize { + Move, + N1, + N2 +}; + +constexpr auto RULER_MOUSE_BORDERMOVE = 5; +constexpr auto RULER_MOUSE_BORDERWIDTH = 5; +constexpr auto RULER_MOUSE_MARGINWIDTH = 3; + + +enum class RulerMarginStyle { + NONE = 0x0000, + Sizeable = 0x0001, + Invisible = 0x0002 +}; +namespace o3tl { + template<> struct typed_flags<RulerMarginStyle> : is_typed_flags<RulerMarginStyle, 0x0003> {}; +} + + +enum class RulerBorderStyle { + Sizeable = 0x0001, + Moveable = 0x0002, + Variable = 0x0004, + Invisible = 0x0008 +}; +namespace o3tl { + template<> struct typed_flags<RulerBorderStyle> : is_typed_flags<RulerBorderStyle, 0x000f> {}; +} + +struct RulerBorder +{ + long nPos; + long nWidth; + RulerBorderStyle nStyle; + long nMinPos; //minimum/maximum position, supported for table borders/rows + long nMaxPos; +}; + +enum class RulerIndentStyle { + Top, Bottom +}; + +struct RulerIndent +{ + long nPos; + RulerIndentStyle nStyle; + bool bInvisible; +}; + + +constexpr sal_uInt16 RULER_TAB_LEFT = 0x0000; +constexpr sal_uInt16 RULER_TAB_RIGHT = 0x0001; +constexpr sal_uInt16 RULER_TAB_CENTER = 0x0002; +constexpr sal_uInt16 RULER_TAB_DECIMAL = 0x0003; +constexpr sal_uInt16 RULER_TAB_DEFAULT = 0x0004; +constexpr sal_uInt16 RULER_TAB_STYLE = 0x000F; +constexpr sal_uInt16 RULER_TAB_RTL = 0x0010; + +struct RulerTab +{ + long nPos; + sal_uInt16 nStyle; +}; + + +struct RulerLine +{ + long nPos; +}; + + +struct RulerSelection +{ + long nPos; + RulerType eType; + sal_uInt16 nAryPos; + RulerDragSize mnDragSize; + bool bSize; + bool bSizeBar; + bool bExpandTest; + + RulerSelection() + : nPos(0) + , eType(RulerType::DontKnow) + , nAryPos(0) + , mnDragSize(RulerDragSize::Move) + , bSize(false) + , bSizeBar(false) + , bExpandTest( false ) + {} +}; + + +struct RulerUnitData +{ + MapUnit eMapUnit; // MAP_UNIT for calculation + long nTickUnit; // Unit divider + double nTick1; // Minimal step + double nTick2; // Tick quarter unit + double nTick3; // Tick half unit + double nTick4; // Tick whole unit + char aUnitStr[8]; // Unit string +}; + + +// Data for drawing ruler tabstops +struct RulerTabData +{ + sal_uInt16 DPIScaleFactor; + sal_uInt16 width; + sal_uInt16 height; + sal_uInt16 height2; + sal_uInt16 width2; + sal_uInt16 cwidth; + sal_uInt16 cwidth2; + sal_uInt16 cwidth3; + sal_uInt16 cwidth4; + sal_uInt16 dheight; + sal_uInt16 dheight2; + sal_uInt16 dwidth; + sal_uInt16 dwidth2; + sal_uInt16 dwidth3; + sal_uInt16 dwidth4; + sal_uInt16 textoff; +}; + + +class ImplRulerData; + +class SVT_DLLPUBLIC Ruler : public vcl::Window +{ +private: + ScopedVclPtr<VirtualDevice> maVirDev; + MapMode maMapMode; + long mnBorderOff; + long mnWinOff; + long mnWinWidth; + long mnWidth; + long mnHeight; + long mnVirOff; + long mnVirWidth; + long mnVirHeight; + long mnBorderWidth; + long mnStartDragPos; + long mnDragPos; + std::unique_ptr<ImplRulerData> mpSaveData; + ImplRulerData* mpData; + std::unique_ptr<ImplRulerData> mpDragData; + tools::Rectangle maExtraRect; + WinBits mnWinStyle; + sal_uInt16 mnUnitIndex; + sal_uInt16 mnDragAryPos; + RulerDragSize mnDragSize; + sal_uInt16 mnDragModifier; + sal_uInt16 mnExtraStyle; + long mnCharWidth; + long mnLineHeight; + + RulerExtra meExtraType; + RulerType meDragType; + FieldUnit meUnit; + Fraction maZoom; + bool mbCalc; + bool mbFormat; + bool mbDrag; + bool mbDragDelete; + bool mbDragCanceled; + bool mbAutoWinWidth; + bool mbActive; + sal_uInt8 mnUpdateFlags; + + RulerSelection maHoverSelection; + + Link<Ruler*,void> maDoubleClickHdl; + + std::unique_ptr<RulerSelection> mxCurrentHitTest; + std::unique_ptr<RulerSelection> mxPreviousHitTest; + + rtl::Reference<SvtRulerAccessible> mxAccContext; + + std::map<OUString, SalLayoutGlyphs> maTextGlyphs; + + SVT_DLLPRIVATE void ImplVDrawLine(vcl::RenderContext& rRenderContext, long nX1, long nY1, long nX2, long nY2 ); + SVT_DLLPRIVATE void ImplVDrawRect(vcl::RenderContext& rRenderContext, long nX1, long nY1, long nX2, long nY2 ); + SVT_DLLPRIVATE void ImplVDrawText(vcl::RenderContext& rRenderContext, long nX, long nY, const OUString& rText, + long nMin = LONG_MIN, long nMax = LONG_MAX ); + + SVT_DLLPRIVATE void ImplDrawTicks(vcl::RenderContext& rRenderContext, + long nMin, long nMax, long nStart, long nVirTop, long nVirBottom); + SVT_DLLPRIVATE void ImplDrawBorders(vcl::RenderContext& rRenderContext, + long nMin, long nMax, long nVirTop, long nVirBottom); + SVT_DLLPRIVATE static void ImplDrawIndent(vcl::RenderContext& rRenderContext, + const tools::Polygon& rPoly, bool bIsHit); + SVT_DLLPRIVATE void ImplDrawIndents(vcl::RenderContext& rRenderContext, + long nMin, long nMax, long nVirTop, long nVirBottom); + SVT_DLLPRIVATE void ImplDrawTab(vcl::RenderContext& rRenderContext, const Point& rPos, sal_uInt16 nStyle); + SVT_DLLPRIVATE void ImplDrawTabs(vcl::RenderContext& rRenderContext, + long nMin, long nMax, long nVirTop, long nVirBottom); + + using Window::ImplInit; + SVT_DLLPRIVATE void ImplInit( WinBits nWinBits ); + SVT_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground ); + SVT_DLLPRIVATE void ImplCalc(); + SVT_DLLPRIVATE void ImplFormat(vcl::RenderContext const & rRenderContext); + SVT_DLLPRIVATE void ImplInitExtraField( bool bUpdate ); + SVT_DLLPRIVATE void ImplInvertLines(vcl::RenderContext& rRenderContext); + SVT_DLLPRIVATE void ImplDraw(vcl::RenderContext& rRenderContext); + SVT_DLLPRIVATE void ImplDrawExtra(vcl::RenderContext& rRenderContext); + SVT_DLLPRIVATE void ImplUpdate( bool bMustCalc = false ); + + virtual void ApplySettings(vcl::RenderContext& rRenderContext) override; + + using Window::ImplHitTest; + SVT_DLLPRIVATE bool ImplHitTest( const Point& rPosition, + RulerSelection* pHitTest, + bool bRequiredStyle = false, + RulerIndentStyle nRequiredStyle = RulerIndentStyle::Top ) const; + SVT_DLLPRIVATE bool ImplDocHitTest( const Point& rPos, RulerType eDragType, RulerSelection* pHitTest ) const; + SVT_DLLPRIVATE bool ImplStartDrag( RulerSelection const * pHitTest, sal_uInt16 nModifier ); + SVT_DLLPRIVATE void ImplDrag( const Point& rPos ); + SVT_DLLPRIVATE void ImplEndDrag(); + + Ruler (const Ruler &) = delete; + Ruler& operator= (const Ruler &) = delete; + +protected: + long GetRulerVirHeight() const { return mnVirHeight;} + const MapMode& GetCurrentMapMode() const { return maMapMode; } + const RulerUnitData& GetCurrentRulerUnit() const; + +public: + Ruler( vcl::Window* pParent, WinBits nWinStyle = WB_STDRULER ); + virtual ~Ruler() override; + virtual void dispose() override; + + virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; + virtual void MouseMove( const MouseEvent& rMEvt ) override; + virtual void Tracking( const TrackingEvent& rTEvt ) override; + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; + virtual void Resize() override; + virtual void StateChanged( StateChangedType nStateChange ) override; + virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; + + virtual bool StartDrag(); + virtual void Drag(); + virtual void EndDrag(); + virtual void Click(); + void DoubleClick(); + virtual void ExtraDown(); + + void Activate() override; + void Deactivate() override; + + void SetWinPos( long nOff, long nWidth = 0 ); + long GetWinOffset() const { return mnWinOff; } + void SetPagePos( long nOff = 0, long nWidth = 0 ); + long GetPageOffset() const; + void SetBorderPos( long nOff = 0 ); + long GetBorderOffset() const { return mnBorderOff; } + const tools::Rectangle& GetExtraRect() const { return maExtraRect; } + + void SetUnit( FieldUnit eNewUnit ); + FieldUnit GetUnit() const { return meUnit; } + void SetZoom( const Fraction& rNewZoom ); + + void SetExtraType( RulerExtra eNewExtraType, sal_uInt16 nStyle = 0 ); + + bool StartDocDrag( const MouseEvent& rMEvt, + RulerType eDragType ); + RulerType GetDragType() const { return meDragType; } + long GetDragPos() const { return mnDragPos; } + sal_uInt16 GetDragAryPos() const { return mnDragAryPos; } + RulerDragSize GetDragSize() const { return mnDragSize; } + bool IsDragDelete() const { return mbDragDelete; } + bool IsDragCanceled() const { return mbDragCanceled; } + sal_uInt16 GetDragModifier() const { return mnDragModifier; } + bool IsDrag() const { return mbDrag; } + void CancelDrag(); + long GetClickPos() const { return mnDragPos; } + RulerType GetClickType() const { return meDragType; } + + const RulerSelection& GetHoverSelection() const { return maHoverSelection; } + + using Window::GetType; + RulerType GetType( const Point& rPos, sal_uInt16* pAryPos = nullptr ); + + void SetNullOffset( long nPos ); + long GetNullOffset() const; + void SetMargin1() { SetMargin1( 0, RulerMarginStyle::Invisible ); } + void SetMargin1( long nPos, RulerMarginStyle nMarginStyle = RulerMarginStyle::Sizeable ); + long GetMargin1() const; + void SetMargin2() { SetMargin2( 0, RulerMarginStyle::Invisible ); } + void SetMargin2( long nPos, RulerMarginStyle nMarginStyle = RulerMarginStyle::Sizeable ); + long GetMargin2() const; + + void SetLeftFrameMargin( long nPos ); + void SetRightFrameMargin( long nPos ); + void SetLines( sal_uInt32 n = 0, const RulerLine* pLineAry = nullptr ); + void SetBorders( sal_uInt32 n = 0, const RulerBorder* pBrdAry = nullptr ); + void SetIndents( sal_uInt32 n = 0, const RulerIndent* pIndentAry = nullptr ); + + void SetTabs( sal_uInt32 n = 0, const RulerTab* pTabAry = nullptr ); + const std::vector<RulerTab>& GetTabs() const; + + static void DrawTab(vcl::RenderContext& rRenderContext, const Color &rFillColor, + const Point& rPos, sal_uInt16 nStyle); + + void SetStyle( WinBits nStyle ); + WinBits GetStyle() const { return mnWinStyle; } + + void SetDoubleClickHdl( const Link<Ruler*,void>& rLink ) { maDoubleClickHdl = rLink; } + + void SetTextRTL(bool bRTL); + bool GetTextRTL() const; + void SetCharWidth( long nWidth ) { mnCharWidth = nWidth ; } + void SetLineHeight( long nHeight ) { mnLineHeight = nHeight ; } + + void DrawTicks(); + + virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override; +}; + +#endif // INCLUDED_SVTOOLS_RULER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/sampletext.hxx b/include/svtools/sampletext.hxx new file mode 100644 index 000000000..9c32cba7b --- /dev/null +++ b/include/svtools/sampletext.hxx @@ -0,0 +1,41 @@ +/* -*- 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/. + */ +#ifndef INCLUDED_SVTOOLS_SAMPLETEXT_HXX +#define INCLUDED_SVTOOLS_SAMPLETEXT_HXX + +#include <svtools/svtdllapi.h> +#include <rtl/ustring.hxx> +#include <unicode/uscript.h> +#include <i18nlangtag/lang.h> +#include <vcl/fontcapabilities.hxx> + +class OutputDevice; +namespace vcl { class Font; } + +UScriptCode otCoverageToScript(vcl::UnicodeCoverage::UnicodeCoverageEnum eOTCoverage); + +bool isSymbolFont(const vcl::Font &rFont); + +bool canRenderNameOfSelectedFont(OutputDevice const &rDevice); + +//These ones are typically for use in the font dropdown box beside the +//fontname, so say things roughly like "Script/Alphabet/Name-Of-Major-Language" +OUString makeShortRepresentativeSymbolTextForSelectedFont(OutputDevice const &rDevice); +OUString makeShortRepresentativeTextForSelectedFont(OutputDevice const &rDevice); +OUString makeShortRepresentativeTextForScript(UScriptCode eScript); +//For the cases where the font doesn't fully support a script, but has partial support +//for a useful subset +OUString makeShortMinimalTextForScript(UScriptCode eScript); + +//These ones are typically for use in the font preview window in format character +SVT_DLLPUBLIC OUString makeRepresentativeTextForFont(sal_Int16 nScriptType, const vcl::Font &rFont); + + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/scriptedtext.hxx b/include/svtools/scriptedtext.hxx new file mode 100644 index 000000000..603ff22cb --- /dev/null +++ b/include/svtools/scriptedtext.hxx @@ -0,0 +1,95 @@ +/* -*- 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_SVTOOLS_SCRIPTEDTEXT_HXX +#define INCLUDED_SVTOOLS_SCRIPTEDTEXT_HXX + +#include <svtools/svtdllapi.h> +#include <rtl/ustring.hxx> +#include <memory> + + +namespace com :: sun :: star :: i18n { class XBreakIterator; } +namespace com :: sun :: star :: uno { template <typename > class Reference; } + +class OutputDevice; +namespace vcl { class Font; } +class SvtScriptedTextHelper_Impl; +class Size; +class Point; + + +/** +This class provides drawing text with different script types on any output devices. +*/ +class SVT_DLLPUBLIC SvtScriptedTextHelper final +{ +private: + std::unique_ptr<SvtScriptedTextHelper_Impl> mpImpl; /// Implementation of class functionality. + + SvtScriptedTextHelper& operator=( const SvtScriptedTextHelper& ) = delete; + +public: + /** Constructor sets an output device and no fonts. + @param _rOutDevice + A reference to an output device. */ + SvtScriptedTextHelper( OutputDevice& _rOutDevice ); + + /** Copy constructor. */ + SvtScriptedTextHelper( + const SvtScriptedTextHelper& _rCopy ); + + /** Destructor. */ + ~SvtScriptedTextHelper(); + + /** Sets new fonts and recalculates the text width. + @param _pLatinFont + The font for latin characters. + @param _pAsianFont + The font for asian characters. + @param _pCmplxFont + The font for complex text layout. */ + void SetFonts( vcl::Font const * _pLatinFont, vcl::Font const * _pAsianFont, vcl::Font const * _pCmplxFont ); + + /** Sets the default font of the current output device to all script types. */ + void SetDefaultFont(); + + /** Sets a new text and calculates all script breaks and the text width. + @param _rText + The new text. + @param _xBreakIter + The break iterator for iterating through the script portions. */ + void SetText( + const OUString& _rText, + const css::uno::Reference< css::i18n::XBreakIterator >& _xBreakIter ); + + /** Returns a size struct containing the width and height of the text in the current output device. + @return A size struct with the text dimensions. */ + const Size& GetTextSize() const; + + /** Draws the text in the current output device. + @param _rPos + The position of the top left edge of the text. */ + void DrawText( const Point& _rPos ); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/scrwin.hxx b/include/svtools/scrwin.hxx new file mode 100644 index 000000000..c232ae487 --- /dev/null +++ b/include/svtools/scrwin.hxx @@ -0,0 +1,72 @@ +/* -*- 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_SVTOOLS_SCRWIN_HXX +#define INCLUDED_SVTOOLS_SCRWIN_HXX + +#include <svtools/svtdllapi.h> +#include <vcl/window.hxx> +#include <vcl/vclptr.hxx> + +class DataChangedEvent; +class ScrollBar; +class ScrollBarBox; + +class SVT_DLLPUBLIC ScrollableWindow: public vcl::Window +{ +private: + Point aPixOffset; // offset to virtual window (pixel) + Size aTotPixSz; // total size of virtual window (pixel) + long nLinePixH; // size of a line/column (pixel) + long nColumnPixW; + + VclPtr<ScrollBar> aVScroll; // the scrollbars + VclPtr<ScrollBar> aHScroll; + VclPtr<ScrollBarBox> aCornerWin; // window in the bottom right corner + bool bScrolling:1; // user controlled scrolling + + DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar *, void ); + DECL_DLLPRIVATE_LINK( EndScrollHdl, ScrollBar *, void ); + +public: + ScrollableWindow( vcl::Window* pParent ); + virtual ~ScrollableWindow() override; + virtual void dispose() override; + + virtual void Resize() override; + virtual void Command( const CommandEvent& rCEvt ) override; + virtual void DataChanged( const DataChangedEvent& rDEvt ) override; + + using OutputDevice::SetMapMode; + virtual void SetMapMode( const MapMode& rNewMapMode ) override; + MapMode GetMapMode() const; + + void SetTotalSize( const Size& rNewSize ); + Size GetTotalSize() const { return PixelToLogic( aTotPixSz ); } + + using Window::Scroll; + virtual void Scroll( long nDeltaX, long nDeltaY, ScrollFlags nFlags = ScrollFlags::NONE ) override; + +private: + SVT_DLLPRIVATE Size GetOutputSizePixel() const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/sfxecode.hxx b/include/svtools/sfxecode.hxx new file mode 100644 index 000000000..3cdad87f4 --- /dev/null +++ b/include/svtools/sfxecode.hxx @@ -0,0 +1,77 @@ +/* -*- 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_SVTOOLS_SFXECODE_HXX +#define INCLUDED_SVTOOLS_SFXECODE_HXX + +class ErrCode; + +#define ERRCODE_SFX_NOTATEMPLATE ErrCode(ErrCodeArea::Sfx, ErrCodeClass::Format, 2) +#define ERRCODE_SFX_GENERAL ErrCode(ErrCodeArea::Sfx, ErrCodeClass::General, 3) +#define ERRCODE_SFX_DOLOADFAILED ErrCode(ErrCodeArea::Sfx, ErrCodeClass::Read, 4) +#define ERRCODE_SFX_ALREADYOPEN ErrCode(ErrCodeArea::Sfx, ErrCodeClass::AlreadyExists, 10) +#define ERRCODE_SFX_WRONGPASSWORD ErrCode(ErrCodeArea::Sfx, ErrCodeClass::Read, 11) +#define ERRCODE_SFX_DOCUMENTREADONLY ErrCode(ErrCodeArea::Sfx, ErrCodeClass::Write, 12) +#define ERRCODE_SFX_OLEGENERAL ErrCode(ErrCodeArea::Sfx, ErrCodeClass::NONE, 14) +#define ERRCODE_SFX_TEMPLATENOTFOUND ErrCode(ErrCodeArea::Sfx, ErrCodeClass::NotExists, 15) + +#define ERRCODE_SFX_CANTCREATECONTENT ErrCode(ErrCodeArea::Sfx, ErrCodeClass::Create, 21) +#define ERRCODE_SFX_INVALIDSYNTAX ErrCode(ErrCodeArea::Sfx, ErrCodeClass::Path, 36) +#define ERRCODE_SFX_CANTGETPASSWD ErrCode(ErrCodeArea::Sfx, ErrCodeClass::Read, 42) +#define ERRCODE_SFX_NOMOREDOCUMENTSALLOWED ErrCode(WarningFlag::Yes, ErrCodeArea::Sfx, ErrCodeClass::NONE, 44) +#define ERRCODE_SFX_CANTCREATEBACKUP ErrCode(ErrCodeArea::Sfx, ErrCodeClass::Create, 50) +#define ERRCODE_SFX_MACROS_SUPPORT_DISABLED ErrCode(WarningFlag::Yes, ErrCodeArea::Sfx, ErrCodeClass::NONE, 51) +#define ERRCODE_SFX_DOCUMENT_MACRO_DISABLED ErrCode(WarningFlag::Yes, ErrCodeArea::Sfx, ErrCodeClass::NONE, 52) +#define ERRCODE_SFX_SHARED_NOPASSWORDCHANGE ErrCode(WarningFlag::Yes, ErrCodeArea::Sfx, ErrCodeClass::NONE, 54) +#define ERRCODE_SFX_INCOMPLETE_ENCRYPTION ErrCode(WarningFlag::Yes, ErrCodeArea::Sfx, ErrCodeClass::NONE, 55) +#define ERRCODE_SFX_DOCUMENT_MACRO_DISABLED_MAC \ + ErrCode(WarningFlag::Yes, ErrCodeArea::Sfx, ErrCodeClass::NONE, 56) +#define ERRCODE_SFX_FORMAT_ROWCOL ErrCode(ErrCodeArea::Sfx, ErrCodeClass::NONE, 57) + + +// Various +#define ERRCTX_ERROR 21 +#define ERRCTX_WARNING 22 + +// Document +#define ERRCTX_SFX_LOADTEMPLATE 1 +#define ERRCTX_SFX_SAVEDOC 2 +#define ERRCTX_SFX_SAVEASDOC 3 +#define ERRCTX_SFX_DOCINFO 4 +#define ERRCTX_SFX_DOCTEMPLATE 5 +#define ERRCTX_SFX_MOVEORCOPYCONTENTS 6 + +// Application +#define ERRCTX_SFX_DOCMANAGER 50 +#define ERRCTX_SFX_OPENDOC 51 +#define ERRCTX_SFX_NEWDOCDIRECT 52 +#define ERRCTX_SFX_NEWDOC 53 + +// Organizer +#define ERRCTX_SFX_CREATEOBJSH 70 + +// BASIC +#define ERRCTX_SFX_LOADBASIC 80 + +// Addressbook +#define ERRCTX_SFX_SEARCHADDRESS 90 + +#endif // INCLUDED_SVTOOLS_SFXECODE_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/slidesorterbaropt.hxx b/include/svtools/slidesorterbaropt.hxx new file mode 100644 index 000000000..c12268fea --- /dev/null +++ b/include/svtools/slidesorterbaropt.hxx @@ -0,0 +1,77 @@ +/* -*- 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_SVTOOLS_SLIDESORTERBAROPT_HXX +#define INCLUDED_SVTOOLS_SLIDESORTERBAROPT_HXX + +#include <svtools/svtdllapi.h> +#include <unotools/options.hxx> +#include <memory> + +namespace osl { class Mutex; } + +/** forward declaration to our private date container implementation + + We use these class as internal member to support small memory requirements. + You can create the container if it is necessary. The class which use these mechanism + is faster and smaller then a complete implementation! +*/ +class SvtSlideSorterBarOptions_Impl; + +/** collect information about sidebar group + + \attention This class is partially threadsafe. +*/ +class SVT_DLLPUBLIC SvtSlideSorterBarOptions final : public utl::detail::Options +{ + public: + SvtSlideSorterBarOptions(); + virtual ~SvtSlideSorterBarOptions() override; + + bool GetVisibleImpressView() const; + void SetVisibleImpressView( bool bVisible ); + bool GetVisibleOutlineView() const; + void SetVisibleOutlineView( bool bVisible ); + bool GetVisibleNotesView() const; + void SetVisibleNotesView( bool bVisible ); + bool GetVisibleHandoutView() const; + void SetVisibleHandoutView( bool bVisible ); + bool GetVisibleSlideSorterView() const; + void SetVisibleSlideSorterView( bool bVisible ); + bool GetVisibleDrawView() const; + void SetVisibleDrawView( bool bVisible ); + + + private: + /** return a reference to a static mutex + + These class is partially threadsafe (for de-/initialization only). + All access methods aren't safe! + We create a static mutex only for one ime and use at different times. + + \return A reference to a static mutex member.*/ + SVT_DLLPRIVATE static ::osl::Mutex& GetInitMutex(); + + private: + std::shared_ptr<SvtSlideSorterBarOptions_Impl> m_pImpl; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/soerr.hxx b/include/svtools/soerr.hxx new file mode 100644 index 000000000..1e882ea76 --- /dev/null +++ b/include/svtools/soerr.hxx @@ -0,0 +1,42 @@ +/* -*- 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_SVTOOLS_SOERR_HXX +#define INCLUDED_SVTOOLS_SOERR_HXX + +#include <svtools/ehdl.hxx> +#include <svtools/svtdllapi.h> + +// error codes +#define SO_ERR(x) ErrCode(ErrCodeArea::So, ErrCodeClass::So, x) +#define SO_WRN(x) ErrCode(WarningFlag::Yes, ErrCodeArea::So, ErrCodeClass::So, x) + +#define ERRCODE_SO_GENERALERROR SO_ERR(1) +#define ERRCODE_SO_CANNOT_DOVERB_NOW SO_WRN(28) +#define ERRCODE_SO_NOVERBS SO_ERR(30) +#define ERRCODE_SO_NOTIMPL SO_ERR(33) + +// error contexts +#define ERRCTX_SO_DOVERB 1 + +SVT_DLLPUBLIC extern const ErrMsgCode RID_SO_ERROR_HANDLER[]; +SVT_DLLPUBLIC extern const ErrMsgCode RID_SO_ERRCTX[]; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/statusbarcontroller.hxx b/include/svtools/statusbarcontroller.hxx new file mode 100644 index 000000000..129a7af57 --- /dev/null +++ b/include/svtools/statusbarcontroller.hxx @@ -0,0 +1,135 @@ +/* -*- 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_SVTOOLS_STATUSBARCONTROLLER_HXX +#define INCLUDED_SVTOOLS_STATUSBARCONTROLLER_HXX + +#include <svtools/svtdllapi.h> +#include <com/sun/star/frame/XStatusbarController.hpp> +#include <cppuhelper/weak.hxx> +#include <cppuhelper/interfacecontainer.hxx> +#include <cppuhelper/basemutex.hxx> +#include <tools/gen.hxx> +#include <unordered_map> + +namespace com :: sun :: star :: awt { class XWindow; } +namespace com :: sun :: star :: beans { struct PropertyValue; } +namespace com :: sun :: star :: frame { class XDispatch; } +namespace com :: sun :: star :: frame { class XFrame; } +namespace com :: sun :: star :: ui { class XStatusbarItem; } +namespace com :: sun :: star :: uno { class XComponentContext; } +namespace com :: sun :: star :: util { class XURLTransformer; } + +namespace svt +{ + +class SVT_DLLPUBLIC StatusbarController : + public css::frame::XStatusbarController, + public ::cppu::BaseMutex, + public ::cppu::OWeakObject +{ + public: + StatusbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const css::uno::Reference< css::frame::XFrame >& xFrame, + const OUString& aCommandURL, + unsigned short nID ); + StatusbarController(); + virtual ~StatusbarController() override; + + css::uno::Reference< css::frame::XFrame > getFrameInterface() const; + css::uno::Reference< css::util::XURLTransformer > getURLTransformer() const; + + ::tools::Rectangle getControlRect() const; + + // XInterface + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; + virtual void SAL_CALL acquire() throw () override; + virtual void SAL_CALL release() throw () override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; + + // XUpdatable + virtual void SAL_CALL update() override; + + // XComponent + virtual void SAL_CALL dispose() override; + virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override; + virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; + + // XEventListener + virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; + + // XStatusListener + virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override; + + // XStatusbarController + virtual sal_Bool SAL_CALL mouseButtonDown( const css::awt::MouseEvent& aMouseEvent ) override; + virtual sal_Bool SAL_CALL mouseMove( const css::awt::MouseEvent& aMouseEvent ) override; + virtual sal_Bool SAL_CALL mouseButtonUp( const css::awt::MouseEvent& aMouseEvent ) override; + virtual void SAL_CALL command( const css::awt::Point& aPos, + ::sal_Int32 nCommand, + sal_Bool bMouseEvent, + const css::uno::Any& aData ) override; + virtual void SAL_CALL paint( const css::uno::Reference< css::awt::XGraphics >& xGraphics, + const css::awt::Rectangle& rOutputRectangle, + ::sal_Int32 nStyle ) override; + virtual void SAL_CALL click( const css::awt::Point& aPos ) override; + virtual void SAL_CALL doubleClick( const css::awt::Point& aPos ) override; + + protected: + struct Listener + { + Listener( const css::util::URL& rURL, const css::uno::Reference< css::frame::XDispatch >& rDispatch ) : + aURL( rURL ), xDispatch( rDispatch ) {} + + css::util::URL aURL; + css::uno::Reference< css::frame::XDispatch > xDispatch; + }; + + typedef std::unordered_map< OUString, + css::uno::Reference< css::frame::XDispatch > > URLToDispatchMap; + + // methods to support status forwarder, known by the old sfx2 toolbox controller implementation + void addStatusListener( const OUString& aCommandURL ); + void bindListener(); + + // execute methods + // execute bound status bar controller command/execute various commands + void execute( const css::uno::Sequence< css::beans::PropertyValue >& aArgs ); + void execute( const OUString& aCommand, const css::uno::Sequence< css::beans::PropertyValue >& aArgs ); + + bool m_bInitialized : 1, + m_bDisposed : 1; + unsigned short m_nID; + css::uno::Reference< css::frame::XFrame > m_xFrame; + css::uno::Reference< css::awt::XWindow > m_xParentWindow; + css::uno::Reference< css::uno::XComponentContext > m_xContext; + OUString m_aCommandURL; + URLToDispatchMap m_aListenerMap; + ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener + mutable css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer; + css::uno::Reference< css::ui::XStatusbarItem > m_xStatusbarItem; +}; + +} + +#endif // INCLUDED_SVTOOLS_STATUSBARCONTROLLER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/strings.hrc b/include/svtools/strings.hrc new file mode 100644 index 000000000..a71792e20 --- /dev/null +++ b/include/svtools/strings.hrc @@ -0,0 +1,347 @@ +/* -*- 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_SVTOOLS_INC_STRINGS_HRC +#define INCLUDED_SVTOOLS_INC_STRINGS_HRC + +#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String) + +// To translators: tdf#125447 use no mnemonic in this string +#define STR_UNDO NC_("STR_UNDO", "Undo: ") +// To translators: tdf#125447 use no mnemonic in this string +#define STR_REDO NC_("STR_REDO", "Redo: ") +#define STR_REPEAT NC_("STR_REPEAT", "~Repeat: ") + +#define STR_FORMAT_STRING NC_("STR_FORMAT_STRING", "Unformatted text") +#define STR_FORMAT_ID_STRING_TSVC NC_("STR_FORMAT_ID_STRING_TSVC", "Unformatted text (TSV-Calc)") +#define STR_FORMAT_BITMAP NC_("STR_FORMAT_BITMAP", "Bitmap Image (BMP)") +#define STR_FORMAT_GDIMETAFILE NC_("STR_FORMAT_GDIMETAFILE", "Graphics Device Interface metafile (GDI)") +#define STR_FORMAT_RTF NC_("STR_FORMAT_RTF", "Rich text formatting (RTF)") +#define STR_FORMAT_ID_RICHTEXT NC_("STR_FORMAT_ID_RICHTEXT", "Rich text formatting (Richtext)") +#define STR_FORMAT_ID_DRAWING NC_("STR_FORMAT_ID_DRAWING", "%PRODUCTNAME drawing format") +#define STR_FORMAT_ID_SVXB NC_("STR_FORMAT_ID_SVXB", "StarView bitmap/animation (SVXB)") +#define STR_FORMAT_ID_INTERNALLINK_STATE NC_("STR_FORMAT_ID_INTERNALLINK_STATE", "Status Info from Svx Internal Link") +#define STR_FORMAT_ID_SOLK NC_("STR_FORMAT_ID_SOLK", "%PRODUCTNAME Link (SOLK)") +#define STR_FORMAT_ID_NETSCAPE_BOOKMARK NC_("STR_FORMAT_ID_NETSCAPE_BOOKMARK", "Netscape Bookmark") +#define STR_FORMAT_ID_STARSERVER NC_("STR_FORMAT_ID_STARSERVER", "Star server format") +#define STR_FORMAT_ID_STAROBJECT NC_("STR_FORMAT_ID_STAROBJECT", "Star object format") +#define STR_FORMAT_ID_APPLETOBJECT NC_("STR_FORMAT_ID_APPLETOBJECT", "Applet object") +#define STR_FORMAT_ID_PLUGIN_OBJECT NC_("STR_FORMAT_ID_PLUGIN_OBJECT", "Plug-in object") +#define STR_FORMAT_ID_STARWRITER_30 NC_("STR_FORMAT_ID_STARWRITER_30", "StarWriter 3.0 object") +#define STR_FORMAT_ID_STARWRITER_40 NC_("STR_FORMAT_ID_STARWRITER_40", "StarWriter 4.0 object") +#define STR_FORMAT_ID_STARWRITER_50 NC_("STR_FORMAT_ID_STARWRITER_50", "StarWriter 5.0 object") +#define STR_FORMAT_ID_STARWRITERWEB_40 NC_("STR_FORMAT_ID_STARWRITERWEB_40", "StarWriter/Web 4.0 object") +#define STR_FORMAT_ID_STARWRITERWEB_50 NC_("STR_FORMAT_ID_STARWRITERWEB_50", "StarWriter/Web 5.0 object") +#define STR_FORMAT_ID_STARWRITERGLOB_40 NC_("STR_FORMAT_ID_STARWRITERGLOB_40", "StarWriter/Master 4.0 object") +#define STR_FORMAT_ID_STARWRITERGLOB_50 NC_("STR_FORMAT_ID_STARWRITERGLOB_50", "StarWriter/Master 5.0 object") +#define STR_FORMAT_ID_STARDRAW NC_("STR_FORMAT_ID_STARDRAW", "StarDraw object") +#define STR_FORMAT_ID_STARDRAW_40 NC_("STR_FORMAT_ID_STARDRAW_40", "StarDraw 4.0 object") +#define STR_FORMAT_ID_STARIMPRESS_50 NC_("STR_FORMAT_ID_STARIMPRESS_50", "StarImpress 5.0 object") +#define STR_FORMAT_ID_STARDRAW_50 NC_("STR_FORMAT_ID_STARDRAW_50", "StarDraw 5.0 object") +#define STR_FORMAT_ID_STARCALC NC_("STR_FORMAT_ID_STARCALC", "StarCalc object") +#define STR_FORMAT_ID_STARCALC_40 NC_("STR_FORMAT_ID_STARCALC_40", "StarCalc 4.0 object") +#define STR_FORMAT_ID_STARCALC_50 NC_("STR_FORMAT_ID_STARCALC_50", "StarCalc 5.0 object") +#define STR_FORMAT_ID_STARCHART NC_("STR_FORMAT_ID_STARCHART", "StarChart object") +#define STR_FORMAT_ID_STARCHART_40 NC_("STR_FORMAT_ID_STARCHART_40", "StarChart 4.0 object") +#define STR_FORMAT_ID_STARCHART_50 NC_("STR_FORMAT_ID_STARCHART_50", "StarChart 5.0 object") +#define STR_FORMAT_ID_STARIMAGE NC_("STR_FORMAT_ID_STARIMAGE", "StarImage object") +#define STR_FORMAT_ID_STARIMAGE_40 NC_("STR_FORMAT_ID_STARIMAGE_40", "StarImage 4.0 object") +#define STR_FORMAT_ID_STARIMAGE_50 NC_("STR_FORMAT_ID_STARIMAGE_50", "StarImage 5.0 object") +#define STR_FORMAT_ID_STARMATH NC_("STR_FORMAT_ID_STARMATH", "StarMath object") +#define STR_FORMAT_ID_STARMATH_40 NC_("STR_FORMAT_ID_STARMATH_40", "StarMath 4.0 object") +#define STR_FORMAT_ID_STARMATH_50 NC_("STR_FORMAT_ID_STARMATH_50", "StarMath 5.0 object") +#define STR_FORMAT_ID_STAROBJECT_PAINTDOC NC_("STR_FORMAT_ID_STAROBJECT_PAINTDOC", "StarObject Paint object") +#define STR_FORMAT_ID_HTML NC_("STR_FORMAT_ID_HTML", "HyperText Markup Language (HTML)") +#define STR_FORMAT_ID_HTML_SIMPLE NC_("STR_FORMAT_ID_HTML_SIMPLE", "Stripped HyperText Markup Language (Simple HTML)") +#define STR_FORMAT_ID_BIFF_5 NC_("STR_FORMAT_ID_BIFF_5", "Microsoft Excel Binary Interchange Format 5.0/95 (Biff5)") +#define STR_FORMAT_ID_BIFF_8 NC_("STR_FORMAT_ID_BIFF_8", "Microsoft Excel Binary Interchange Format 97/2000/XP/2003 (Biff8)") +#define STR_FORMAT_ID_SYLK NC_("STR_FORMAT_ID_SYLK", "Sylk") +#define STR_FORMAT_ID_LINK NC_("STR_FORMAT_ID_LINK", "Dynamic Data Exchange (DDE link)" ) +#define STR_FORMAT_ID_DIF NC_("STR_FORMAT_ID_DIF", "Data Interchange Format (DIF)") +#define STR_FORMAT_ID_MSWORD_DOC NC_("STR_FORMAT_ID_MSWORD_DOC", "Microsoft Word object") +#define STR_FORMAT_ID_STAR_FRAMESET_DOC NC_("STR_FORMAT_ID_STAR_FRAMESET_DOC", "StarFrameSet object") +#define STR_FORMAT_ID_OFFICE_DOC NC_("STR_FORMAT_ID_OFFICE_DOC", "Office document object") +#define STR_FORMAT_ID_NOTES_DOCINFO NC_("STR_FORMAT_ID_NOTES_DOCINFO", "Notes document info") +#define STR_FORMAT_ID_SFX_DOC NC_("STR_FORMAT_ID_SFX_DOC", "Sfx document") +#define STR_FORMAT_ID_STARCHARTDOCUMENT_50 NC_("STR_FORMAT_ID_STARCHARTDOCUMENT_50", "StarChart 5.0 object") +#define STR_FORMAT_ID_GRAPHOBJ NC_("STR_FORMAT_ID_GRAPHOBJ", "Graphic object") +#define STR_FORMAT_ID_STARWRITER_60 NC_("STR_FORMAT_ID_STARWRITER_60", "OpenOffice.org 1.0 Writer object") +#define STR_FORMAT_ID_STARWRITERWEB_60 NC_("STR_FORMAT_ID_STARWRITERWEB_60", "OpenOffice.org 1.0 Writer/Web object") +#define STR_FORMAT_ID_STARWRITERGLOB_60 NC_("STR_FORMAT_ID_STARWRITERGLOB_60", "OpenOffice.org 1.0 Writer/Master object") +#define STR_FORMAT_ID_STARDRAW_60 NC_("STR_FORMAT_ID_STARDRAW_60", "OpenOffice.org 1.0 Draw object") +#define STR_FORMAT_ID_STARIMPRESS_60 NC_("STR_FORMAT_ID_STARIMPRESS_60", "OpenOffice.org 1.0 Impress object") +#define STR_FORMAT_ID_STARCALC_60 NC_("STR_FORMAT_ID_STARCALC_60", "OpenOffice.org 1.0 Calc object") +#define STR_FORMAT_ID_STARCHART_60 NC_("STR_FORMAT_ID_STARCHART_60", "OpenOffice.org 1.0 Chart object") +#define STR_FORMAT_ID_STARMATH_60 NC_("STR_FORMAT_ID_STARMATH_60", "OpenOffice.org 1.0 Math object") +#define STR_FORMAT_ID_WMF NC_("STR_FORMAT_ID_WMF", "Windows metafile") +#define STR_FORMAT_ID_DBACCESS_QUERY NC_("STR_FORMAT_ID_DBACCESS_QUERY", "Data source object") +#define STR_FORMAT_ID_DBACCESS_TABLE NC_("STR_FORMAT_ID_DBACCESS_TABLE", "Data source table") +#define STR_FORMAT_ID_DBACCESS_COMMAND NC_("STR_FORMAT_ID_DBACCESS_COMMAND", "SQL query") +#define STR_FORMAT_ID_DIALOG_60 NC_("STR_FORMAT_ID_DIALOG_60", "OpenOffice.org 1.0 dialog") +#define STR_FORMAT_ID_FILEGRPDESCRIPTOR NC_("STR_FORMAT_ID_FILEGRPDESCRIPTOR", "Link") +#define STR_FORMAT_ID_HTML_NO_COMMENT NC_("STR_FORMAT_ID_HTML_NO_COMMENT", "HTML format without comments") +#define STR_FORMAT_ID_PNG_BITMAP NC_("STR_FORMAT_ID_PNG_BITMAP", "Portable Network Graphic (PNG)") + +#define STR_ERROR_OBJNOCREATE NC_("STR_ERROR_OBJNOCREATE", "Object % could not be inserted.") +#define STR_ERROR_OBJNOCREATE_FROM_FILE NC_("STR_ERROR_OBJNOCREATE_FROM_FILE", "Object from file % could not be inserted.") +#define STR_FURTHER_OBJECT NC_("STR_FURTHER_OBJECT", "Further objects") +#define STR_UNKNOWN_SOURCE NC_("STR_UNKNOWN_SOURCE", "Unknown source") + +#define STR_SVT_BYTES NC_("STR_SVT_BYTES", "Bytes") +#define STR_SVT_KB NC_("STR_SVT_KB", "KB") +#define STR_SVT_MB NC_("STR_SVT_MB", "MB") +#define STR_SVT_GB NC_("STR_SVT_GB", "GB") + +/* + * resources for CollatorResource / CollatorResourceData resp. + */ +/* alphanumeric sorting algorithm */ +#define STR_SVT_COLLATE_ALPHANUMERIC NC_("STR_SVT_COLLATE_ALPHANUMERIC", "Alphanumeric") +/* default or normal sorting algorithm */ +#define STR_SVT_COLLATE_NORMAL NC_("STR_SVT_COLLATE_NORMAL", "Normal") +/* default or normal sorting algorithm */ +#define STR_SVT_COLLATE_CHARSET NC_("STR_SVT_COLLATE_CHARSET", "Character set") +/* german dictionary word order / sorting */ +#define STR_SVT_COLLATE_DICTIONARY NC_("STR_SVT_COLLATE_DICTIONARY", "Dictionary") +/* chinese sorting algorithm */ +#define STR_SVT_COLLATE_PINYIN NC_("STR_SVT_COLLATE_PINYIN", "Pinyin") +/* chinese sorting algorithm */ +#define STR_SVT_COLLATE_STROKE NC_("STR_SVT_COLLATE_STROKE", "Stroke") +/* chinese sorting algorithm */ +#define STR_SVT_COLLATE_RADICAL NC_("STR_SVT_COLLATE_RADICAL", "Radical") +/* sorting according to the unicode code point of the character */ +#define STR_SVT_COLLATE_UNICODE NC_("STR_SVT_COLLATE_UNICODE", "Unicode") +/* chinese sorting algorithm */ +#define STR_SVT_COLLATE_ZHUYIN NC_("STR_SVT_COLLATE_ZHUYIN", "Zhuyin") +/* phone book sorting algorithm. e.g. German */ +#define STR_SVT_COLLATE_PHONEBOOK NC_("STR_SVT_COLLATE_PHONEBOOK", "Phone book") +#define STR_SVT_COLLATE_PHONETIC_F NC_("STR_SVT_COLLATE_PHONETIC_F", "Phonetic (alphanumeric first)") +#define STR_SVT_COLLATE_PHONETIC_L NC_("STR_SVT_COLLATE_PHONETIC_L", "Phonetic (alphanumeric last)") +/* alphanumeric indexentry algorithm */ +#define STR_SVT_INDEXENTRY_ALPHANUMERIC NC_("STR_SVT_INDEXENTRY_ALPHANUMERIC", "Alphanumeric") +/* korean dictionary indexentry algorithm */ +#define STR_SVT_INDEXENTRY_DICTIONARY NC_("STR_SVT_INDEXENTRY_DICTIONARY", "Dictionary") +/* chinese sorting algorithm */ +#define STR_SVT_INDEXENTRY_PINYIN NC_("STR_SVT_INDEXENTRY_PINYIN", "Pinyin") +/* chinese indexentry algorithm */ +#define STR_SVT_INDEXENTRY_RADICAL NC_("STR_SVT_INDEXENTRY_RADICAL", "Radical") +/* chinese indexentry algorithm */ +#define STR_SVT_INDEXENTRY_STROKE NC_("STR_SVT_INDEXENTRY_STROKE", "Stroke") +/* chinese indexentry algorithm */ +#define STR_SVT_INDEXENTRY_ZHUYIN NC_("STR_SVT_INDEXENTRY_ZHUYIN", "Zhuyin") +#define STR_SVT_INDEXENTRY_PHONETIC_FS NC_("STR_SVT_INDEXENTRY_PHONETIC_FS", "Phonetic (alphanumeric first, grouped by syllables)") +#define STR_SVT_INDEXENTRY_PHONETIC_FC NC_("STR_SVT_INDEXENTRY_PHONETIC_FC", "Phonetic (alphanumeric first, grouped by consonants)") +#define STR_SVT_INDEXENTRY_PHONETIC_LS NC_("STR_SVT_INDEXENTRY_PHONETIC_LS", "Phonetic (alphanumeric last, grouped by syllables)") +#define STR_SVT_INDEXENTRY_PHONETIC_LC NC_("STR_SVT_INDEXENTRY_PHONETIC_LC", "Phonetic (alphanumeric last, grouped by consonants)") + +#define STR_SVT_CALENDAR_TODAY NC_("STR_SVT_CALENDAR_TODAY", "Today") +#define STR_SVT_CALENDAR_NONE NC_("STR_SVT_CALENDAR_NONE", "None") + +#define STR_SVT_STYLE_LIGHT NC_("STR_SVT_STYLE_LIGHT", "Light") +#define STR_SVT_STYLE_LIGHT_ITALIC NC_("STR_SVT_STYLE_LIGHT_ITALIC", "Light Italic") +#define STR_SVT_STYLE_NORMAL NC_("STR_SVT_STYLE_NORMAL", "Regular") +#define STR_SVT_STYLE_NORMAL_ITALIC NC_("STR_SVT_STYLE_NORMAL_ITALIC", "Italic") +#define STR_SVT_STYLE_BOLD NC_("STR_SVT_STYLE_BOLD", "Bold") +#define STR_SVT_STYLE_BOLD_ITALIC NC_("STR_SVT_STYLE_BOLD_ITALIC", "Bold Italic") +#define STR_SVT_STYLE_BLACK NC_("STR_SVT_STYLE_BLACK", "Black") +#define STR_SVT_STYLE_BLACK_ITALIC NC_("STR_SVT_STYLE_BLACK_ITALIC", "Black Italic") +#define STR_SVT_STYLE_BOOK NC_("STR_SVT_STYLE_BOOK", "Book") +#define STR_SVT_STYLE_BOLD_OBLIQUE NC_("STR_SVT_STYLE_BOLD_OBLIQUE", "Bold Oblique") +#define STR_SVT_STYLE_CONDENSED NC_("STR_SVT_STYLE_CONDENSED", "Condensed") +#define STR_SVT_STYLE_CONDENSED_BOLD NC_("STR_SVT_STYLE_CONDENSED_BOLD", "Condensed Bold") +#define STR_SVT_STYLE_CONDENSED_BOLD_ITALIC NC_("STR_SVT_STYLE_CONDENSED_BOLD_ITALIC", "Condensed Bold Italic") +#define STR_SVT_STYLE_CONDENSED_BOLD_OBLIQUE NC_("STR_SVT_STYLE_CONDENSED_BOLD_OBLIQUE", "Condensed Bold Oblique") +#define STR_SVT_STYLE_CONDENSED_ITALIC NC_("STR_SVT_STYLE_CONDENSED_ITALIC", "Condensed Italic") +#define STR_SVT_STYLE_CONDENSED_OBLIQUE NC_("STR_SVT_STYLE_CONDENSED_OBLIQUE", "Condensed Oblique") +#define STR_SVT_STYLE_EXTRALIGHT NC_("STR_SVT_STYLE_EXTRALIGHT", "ExtraLight") +#define STR_SVT_STYLE_EXTRALIGHT_ITALIC NC_("STR_SVT_STYLE_EXTRALIGHT_ITALIC", "ExtraLight Italic") +#define STR_SVT_STYLE_OBLIQUE NC_("STR_SVT_STYLE_OBLIQUE", "Oblique") +#define STR_SVT_STYLE_SEMIBOLD NC_("STR_SVT_STYLE_SEMIBOLD", "Semibold") +#define STR_SVT_STYLE_SEMIBOLD_ITALIC NC_("STR_SVT_STYLE_SEMIBOLD_ITALIC", "Semibold Italic") +#define STR_SVT_FONTMAP_BOTH NC_("STR_SVT_FONTMAP_BOTH", "The same font will be used on both your printer and your screen.") +#define STR_SVT_FONTMAP_PRINTERONLY NC_("STR_SVT_FONTMAP_PRINTERONLY", "This is a printer font. The screen image may differ.") +#define STR_SVT_FONTMAP_STYLENOTAVAILABLE NC_("STR_SVT_FONTMAP_STYLENOTAVAILABLE", "This font style will be simulated or the closest matching style will be used.") +#define STR_SVT_FONTMAP_NOTAVAILABLE NC_("STR_SVT_FONTMAP_NOTAVAILABLE", "This font has not been installed. The closest available font will be used.") + +#define STR_TABBAR_PUSHBUTTON_MOVET0HOME NC_("STR_TABBAR_PUSHBUTTON_MOVET0HOME", "Move To Home") +#define STR_TABBAR_PUSHBUTTON_MOVELEFT NC_("STR_TABBAR_PUSHBUTTON_MOVELEFT", "Move Left") +#define STR_TABBAR_PUSHBUTTON_MOVERIGHT NC_("STR_TABBAR_PUSHBUTTON_MOVERIGHT", "Move Right") +#define STR_TABBAR_PUSHBUTTON_MOVETOEND NC_("STR_TABBAR_PUSHBUTTON_MOVETOEND", "Move To End") +#define STR_TABBAR_PUSHBUTTON_ADDTAB NC_("STR_TABBAR_PUSHBUTTON_ADDTAB", "Add") + +#define STR_SVT_ACC_RULER_HORZ_NAME NC_("STR_SVT_ACC_RULER_HORZ_NAME", "Horizontal Ruler") +#define STR_SVT_ACC_RULER_VERT_NAME NC_("STR_SVT_ACC_RULER_VERT_NAME", "Vertical Ruler") + +#define STR_SVT_1BIT_THRESHOLD NC_("STR_SVT_1BIT_THRESHOLD", "1 bit threshold") +#define STR_SVT_1BIT_DITHERED NC_("STR_SVT_1BIT_DITHERED", "1 bit dithered") +#define STR_SVT_4BIT_GRAYSCALE NC_("STR_SVT_4BIT_GRAYSCALE", "4 bit grayscale") +#define STR_SVT_4BIT_COLOR_PALETTE NC_("STR_SVT_4BIT_COLOR_PALETTE", "4 bit color") +#define STR_SVT_8BIT_GRAYSCALE NC_("STR_SVT_8BIT_GRAYSCALE", "8 bit grayscale") +#define STR_SVT_8BIT_COLOR_PALETTE NC_("STR_SVT_8BIT_COLOR_PALETTE", "8 bit color") +#define STR_SVT_24BIT_TRUE_COLOR NC_("STR_SVT_24BIT_TRUE_COLOR", "24 bit true color") +#define STR_SVT_ESTIMATED_SIZE_PIX_1 NC_("STR_SVT_ESTIMATED_SIZE_PIX_1", "The image needs about %1 KB of memory.") +#define STR_SVT_ESTIMATED_SIZE_PIX_2 NC_("STR_SVT_ESTIMATED_SIZE_PIX_2", "The image needs about %1 KB of memory, the file size is %2 KB.") +#define STR_SVT_ESTIMATED_SIZE_VEC NC_("STR_SVT_ESTIMATED_SIZE_VEC", "The file size is %1 KB.") +#define STR_SVT_HOST NC_("STR_SVT_HOST", "host") +#define STR_SVT_PORT NC_("STR_SVT_PORT", "port") +#define STR_SVT_OTHER_CMIS NC_("STR_SVT_OTHER_CMIS", "Other CMIS") +#define STR_SVT_PRNDLG_READY NC_("STR_SVT_PRNDLG_READY", "Ready") +#define STR_SVT_PRNDLG_PAUSED NC_("STR_SVT_PRNDLG_PAUSED", "Paused") +#define STR_SVT_PRNDLG_PENDING NC_("STR_SVT_PRNDLG_PENDING", "Pending deletion") +#define STR_SVT_PRNDLG_BUSY NC_("STR_SVT_PRNDLG_BUSY", "Busy") +#define STR_SVT_PRNDLG_INITIALIZING NC_("STR_SVT_PRNDLG_INITIALIZING", "Initializing") +#define STR_SVT_PRNDLG_WAITING NC_("STR_SVT_PRNDLG_WAITING", "Waiting") +#define STR_SVT_PRNDLG_WARMING_UP NC_("STR_SVT_PRNDLG_WARMING_UP", "Warming up") +#define STR_SVT_PRNDLG_PROCESSING NC_("STR_SVT_PRNDLG_PROCESSING", "Processing") +#define STR_SVT_PRNDLG_PRINTING NC_("STR_SVT_PRNDLG_PRINTING", "Printing") +#define STR_SVT_PRNDLG_OFFLINE NC_("STR_SVT_PRNDLG_OFFLINE", "Offline") +#define STR_SVT_PRNDLG_ERROR NC_("STR_SVT_PRNDLG_ERROR", "Error") +#define STR_SVT_PRNDLG_SERVER_UNKNOWN NC_("STR_SVT_PRNDLG_SERVER_UNKNOWN", "Unknown Server") +#define STR_SVT_PRNDLG_PAPER_JAM NC_("STR_SVT_PRNDLG_PAPER_JAM", "Paper jam") +#define STR_SVT_PRNDLG_PAPER_OUT NC_("STR_SVT_PRNDLG_PAPER_OUT", "Not enough paper") +#define STR_SVT_PRNDLG_MANUAL_FEED NC_("STR_SVT_PRNDLG_MANUAL_FEED", "Manual feed") +#define STR_SVT_PRNDLG_PAPER_PROBLEM NC_("STR_SVT_PRNDLG_PAPER_PROBLEM", "Paper problem") +#define STR_SVT_PRNDLG_IO_ACTIVE NC_("STR_SVT_PRNDLG_IO_ACTIVE", "I/O active") +#define STR_SVT_PRNDLG_OUTPUT_BIN_FULL NC_("STR_SVT_PRNDLG_OUTPUT_BIN_FULL", "Output bin full") +#define STR_SVT_PRNDLG_TONER_LOW NC_("STR_SVT_PRNDLG_TONER_LOW", "Toner low") +#define STR_SVT_PRNDLG_NO_TONER NC_("STR_SVT_PRNDLG_NO_TONER", "No toner") +#define STR_SVT_PRNDLG_PAGE_PUNT NC_("STR_SVT_PRNDLG_PAGE_PUNT", "Delete Page") +#define STR_SVT_PRNDLG_USER_INTERVENTION NC_("STR_SVT_PRNDLG_USER_INTERVENTION", "User intervention necessary") +#define STR_SVT_PRNDLG_OUT_OF_MEMORY NC_("STR_SVT_PRNDLG_OUT_OF_MEMORY", "Insufficient memory") +#define STR_SVT_PRNDLG_DOOR_OPEN NC_("STR_SVT_PRNDLG_DOOR_OPEN", "Cover open") +#define STR_SVT_PRNDLG_POWER_SAVE NC_("STR_SVT_PRNDLG_POWER_SAVE", "Power save mode") +#define STR_SVT_PRNDLG_DEFPRINTER NC_("STR_SVT_PRNDLG_DEFPRINTER", "Default printer") +#define STR_SVT_PRNDLG_JOBCOUNT NC_("STR_SVT_PRNDLG_JOBCOUNT", "%d documents") + +#define STR_NO_FIELD_SELECTION NC_("STR_NO_FIELD_SELECTION", "<none>") +#define STR_FIELD_COMPANY NC_("STR_FIELD_COMPANY", "Company") +#define STR_FIELD_DEPARTMENT NC_("STR_FIELD_DEPARTMENT", "Department") +#define STR_FIELD_FIRSTNAME NC_("STR_FIELD_FIRSTNAME", "First name") +#define STR_FIELD_LASTNAME NC_("STR_FIELD_LASTNAME", "Last name") +#define STR_FIELD_STREET NC_("STR_FIELD_STREET", "Street") +#define STR_FIELD_COUNTRY NC_("STR_FIELD_COUNTRY", "Country") +#define STR_FIELD_ZIPCODE NC_("STR_FIELD_ZIPCODE", "ZIP Code") +#define STR_FIELD_CITY NC_("STR_FIELD_CITY", "City") +#define STR_FIELD_TITLE NC_("STR_FIELD_TITLE", "Title") +#define STR_FIELD_POSITION NC_("STR_FIELD_POSITION", "Position") +#define STR_FIELD_ADDRFORM NC_("STR_FIELD_ADDRFORM", "Addr. Form") +#define STR_FIELD_INITIALS NC_("STR_FIELD_INITIALS", "Initials") +#define STR_FIELD_SALUTATION NC_("STR_FIELD_SALUTATION", "Complimentary close") +#define STR_FIELD_HOMETEL NC_("STR_FIELD_HOMETEL", "Tel: Home") +#define STR_FIELD_WORKTEL NC_("STR_FIELD_WORKTEL", "Tel: Work") +#define STR_FIELD_FAX NC_("STR_FIELD_FAX", "Fax") +#define STR_FIELD_EMAIL NC_("STR_FIELD_EMAIL", "Email") +#define STR_FIELD_URL NC_("STR_FIELD_URL", "URL") +#define STR_FIELD_NOTE NC_("STR_FIELD_NOTE", "Note") +#define STR_FIELD_USER1 NC_("STR_FIELD_USER1", "User 1") +#define STR_FIELD_USER2 NC_("STR_FIELD_USER2", "User 2") +#define STR_FIELD_USER3 NC_("STR_FIELD_USER3", "User 3") +#define STR_FIELD_USER4 NC_("STR_FIELD_USER4", "User 4") +#define STR_FIELD_ID NC_("STR_FIELD_ID", "ID") +#define STR_FIELD_STATE NC_("STR_FIELD_STATE", "State") +#define STR_FIELD_OFFICETEL NC_("STR_FIELD_OFFICETEL", "Tel: Office") +#define STR_FIELD_PAGER NC_("STR_FIELD_PAGER", "Pager") +#define STR_FIELD_MOBILE NC_("STR_FIELD_MOBILE", "Mobile") +#define STR_FIELD_TELOTHER NC_("STR_FIELD_TELOTHER", "Tel: Other") +#define STR_FIELD_CALENDAR NC_("STR_FIELD_CALENDAR", "Calendar") +#define STR_FIELD_INVITE NC_("STR_FIELD_INVITE", "Invite") + +#define STR_SVT_DEFAULT_SERVICE_LABEL NC_("STR_SVT_DEFAULT_SERVICE_LABEL", "$user$'s $service$") + +#define STR_WARNING_JAVANOTFOUND NC_("STR_WARNING_JAVANOTFOUND", "%PRODUCTNAME requires a Java runtime environment (JRE) to perform this task. Please install a JRE and restart %PRODUCTNAME.") +#define STR_WARNING_JAVANOTFOUND_WIN NC_("STR_WARNING_JAVANOTFOUND_WIN", "%PRODUCTNAME requires a %BITNESS-bit Java runtime environment (JRE) to perform this task. Please install a JRE and restart %PRODUCTNAME.") +#define STR_WARNING_JAVANOTFOUND_MAC NC_("STR_WARNING_JAVANOTFOUND_MAC", "%PRODUCTNAME requires Oracle's Java Development Kit (JDK) on macOS 10.10 or greater to perform this task. Please install them and restart %PRODUCTNAME.") +#define STR_WARNING_INVALIDJAVASETTINGS_MAC NC_("STR_WARNING_INVALIDJAVASETTINGS_MAC", "The %PRODUCTNAME configuration has been changed. Under %PRODUCTNAME - Preferences - %PRODUCTNAME - Advanced, select the Java runtime environment you want to have used by %PRODUCTNAME.") +#define STR_WARNING_INVALIDJAVASETTINGS NC_("STR_WARNING_INVALIDJAVASETTINGS", "The %PRODUCTNAME configuration has been changed. Under Tools - Options - %PRODUCTNAME - Advanced, select the Java runtime environment you want to have used by %PRODUCTNAME.") +#define STR_ERROR_JVMCREATIONFAILED_MAC NC_("STR_ERROR_JVMCREATIONFAILED_MAC", "%PRODUCTNAME requires a Java runtime environment (JRE) to perform this task. The selected JRE is defective. Please select another version or install a new JRE and select it under %PRODUCTNAME - Preferences - %PRODUCTNAME - Advanced.") +#define STR_ERROR_JVMCREATIONFAILED NC_("STR_ERROR_JVMCREATIONFAILED", "%PRODUCTNAME requires a Java runtime environment (JRE) to perform this task. The selected JRE is defective. Please select another version or install a new JRE and select it under Tools - Options - %PRODUCTNAME - Advanced.") +#define STR_WARNING_JAVANOTFOUND_TITLE NC_("STR_WARNING_JAVANOTFOUND_TITLE", "JRE Required") +#define STR_WARNING_INVALIDJAVASETTINGS_TITLE NC_("STR_WARNING_INVALIDJAVASETTINGS_TITLE", "Select JRE") +#define STR_ERROR_JVMCREATIONFAILED_TITLE NC_("STR_ERROR_JVMCREATIONFAILED_TITLE", "JRE is Defective") + +#define STR_DESCRIPTION_SOURCEFILE NC_("STR_DESCRIPTION_SOURCEFILE", "Source code") +#define STR_DESCRIPTION_BOOKMARKFILE NC_("STR_DESCRIPTION_BOOKMARKFILE", "Bookmark file") +#define STR_DESCRIPTION_GRAPHIC_DOC NC_("STR_DESCRIPTION_GRAPHIC_DOC", "Graphics") +#define STR_DESCRIPTION_CFGFILE NC_("STR_DESCRIPTION_CFGFILE", "Configuration file") +#define STR_DESCRIPTION_APPLICATION NC_("STR_DESCRIPTION_APPLICATION", "Application") +#define STR_DESCRIPTION_DATABASE_TABLE NC_("STR_DESCRIPTION_DATABASE_TABLE", "Database table") +#define STR_DESCRIPTION_SYSFILE NC_("STR_DESCRIPTION_SYSFILE", "System file") +#define STR_DESCRIPTION_WORD_DOC NC_("STR_DESCRIPTION_WORD_DOC", "MS Word document") +#define STR_DESCRIPTION_HELP_DOC NC_("STR_DESCRIPTION_HELP_DOC", "Help file") +#define STR_DESCRIPTION_HTMLFILE NC_("STR_DESCRIPTION_HTMLFILE", "HTML document") +#define STR_DESCRIPTION_ARCHIVFILE NC_("STR_DESCRIPTION_ARCHIVFILE", "Archive file") +#define STR_DESCRIPTION_LOGFILE NC_("STR_DESCRIPTION_LOGFILE", "Log file") +#define STR_DESCRIPTION_SDATABASE_DOC NC_("STR_DESCRIPTION_SDATABASE_DOC", "StarOffice Database") +#define STR_DESCRIPTION_GLOBALDOC NC_("STR_DESCRIPTION_GLOBALDOC", "StarWriter 4.0 / 5.0 Master Document") +#define STR_DESCRIPTION_SIMAGE_DOC NC_("STR_DESCRIPTION_SIMAGE_DOC", "StarOffice Image") +#define STR_DESCRIPTION_TEXTFILE NC_("STR_DESCRIPTION_TEXTFILE", "Text file") +#define STR_DESCRIPTION_LINK NC_("STR_DESCRIPTION_LINK", "Link") +#define STR_DESCRIPTION_SOFFICE_TEMPLATE_DOC NC_("STR_DESCRIPTION_SOFFICE_TEMPLATE_DOC", "StarOffice 3.0 - 5.0 Template") +#define STR_DESCRIPTION_EXCEL_DOC NC_("STR_DESCRIPTION_EXCEL_DOC", "MS Excel document") +#define STR_DESCRIPTION_EXCEL_TEMPLATE_DOC NC_("STR_DESCRIPTION_EXCEL_TEMPLATE_DOC", "MS Excel template") +#define STR_DESCRIPTION_BATCHFILE NC_("STR_DESCRIPTION_BATCHFILE", "Batch file") +#define STR_DESCRIPTION_FILE NC_("STR_DESCRIPTION_FILE", "File") +#define STR_DESCRIPTION_FOLDER NC_("STR_DESCRIPTION_FOLDER", "Folder") +#define STR_DESCRIPTION_FACTORY_WRITER NC_("STR_DESCRIPTION_FACTORY_WRITER", "Text Document") +#define STR_DESCRIPTION_FACTORY_CALC NC_("STR_DESCRIPTION_FACTORY_CALC", "Spreadsheet") +#define STR_DESCRIPTION_FACTORY_IMPRESS NC_("STR_DESCRIPTION_FACTORY_IMPRESS", "Presentation") +#define STR_DESCRIPTION_FACTORY_DRAW NC_("STR_DESCRIPTION_FACTORY_DRAW", "Drawing") +#define STR_DESCRIPTION_FACTORY_WRITERWEB NC_("STR_DESCRIPTION_FACTORY_WRITERWEB", "HTML document") +#define STR_DESCRIPTION_FACTORY_GLOBALDOC NC_("STR_DESCRIPTION_FACTORY_GLOBALDOC", "Master document") +#define STR_DESCRIPTION_FACTORY_MATH NC_("STR_DESCRIPTION_FACTORY_MATH", "Formula") +#define STR_DESCRIPTION_FACTORY_DATABASE NC_("STR_DESCRIPTION_FACTORY_DATABASE", "Database") +#define STR_DESCRIPTION_CALC_TEMPLATE NC_("STR_DESCRIPTION_CALC_TEMPLATE", "OpenOffice.org 1.0 Spreadsheet Template") +#define STR_DESCRIPTION_DRAW_TEMPLATE NC_("STR_DESCRIPTION_DRAW_TEMPLATE", "OpenOffice.org 1.0 Drawing Template") +#define STR_DESCRIPTION_IMPRESS_TEMPLATE NC_("STR_DESCRIPTION_IMPRESS_TEMPLATE", "OpenOffice.org 1.0 Presentation Template") +#define STR_DESCRIPTION_WRITER_TEMPLATE NC_("STR_DESCRIPTION_WRITER_TEMPLATE", "OpenOffice.org 1.0 Text Document Template") +#define STR_DESCRIPTION_LOCALE_VOLUME NC_("STR_DESCRIPTION_LOCALE_VOLUME", "Local drive") +#define STR_DESCRIPTION_FLOPPY_VOLUME NC_("STR_DESCRIPTION_FLOPPY_VOLUME", "Disk drive") +#define STR_DESCRIPTION_CDROM_VOLUME NC_("STR_DESCRIPTION_CDROM_VOLUME", "CD-ROM drive") +#define STR_DESCRIPTION_REMOTE_VOLUME NC_("STR_DESCRIPTION_REMOTE_VOLUME", "Network connection") +#define STR_DESCRIPTION_POWERPOINT NC_("STR_DESCRIPTION_POWERPOINT", "MS PowerPoint Document") +#define STR_DESCRIPTION_POWERPOINT_TEMPLATE NC_("STR_DESCRIPTION_POWERPOINT_TEMPLATE", "MS PowerPoint Template") +#define STR_DESCRIPTION_POWERPOINT_SHOW NC_("STR_DESCRIPTION_POWERPOINT_SHOW", "MS PowerPoint Show") +#define STR_DESCRIPTION_SXMATH_DOC NC_("STR_DESCRIPTION_SXMATH_DOC", "OpenOffice.org 1.0 Formula") +#define STR_DESCRIPTION_SXCHART_DOC NC_("STR_DESCRIPTION_SXCHART_DOC", "OpenOffice.org 1.0 Chart") +#define STR_DESCRIPTION_SXDRAW_DOC NC_("STR_DESCRIPTION_SXDRAW_DOC", "OpenOffice.org 1.0 Drawing") +#define STR_DESCRIPTION_SXCALC_DOC NC_("STR_DESCRIPTION_SXCALC_DOC", "OpenOffice.org 1.0 Spreadsheet") +#define STR_DESCRIPTION_SXIMPRESS_DOC NC_("STR_DESCRIPTION_SXIMPRESS_DOC", "OpenOffice.org 1.0 Presentation") +#define STR_DESCRIPTION_SXWRITER_DOC NC_("STR_DESCRIPTION_SXWRITER_DOC", "OpenOffice.org 1.0 Text Document") +#define STR_DESCRIPTION_SXGLOBAL_DOC NC_("STR_DESCRIPTION_SXGLOBAL_DOC", "OpenOffice.org 1.0 Master Document") +#define STR_DESCRIPTION_MATHML_DOC NC_("STR_DESCRIPTION_MATHML_DOC", "MathML Document") +#define STR_DESCRIPTION_OO_DATABASE_DOC NC_("STR_DESCRIPTION_OO_DATABASE_DOC", "OpenDocument Database") +#define STR_DESCRIPTION_OO_DRAW_DOC NC_("STR_DESCRIPTION_OO_DRAW_DOC", "OpenDocument Drawing") +#define STR_DESCRIPTION_OO_MATH_DOC NC_("STR_DESCRIPTION_OO_MATH_DOC", "OpenDocument Formula") +#define STR_DESCRIPTION_OO_GLOBAL_DOC NC_("STR_DESCRIPTION_OO_GLOBAL_DOC", "OpenDocument Master Document") +#define STR_DESCRIPTION_OO_IMPRESS_DOC NC_("STR_DESCRIPTION_OO_IMPRESS_DOC", "OpenDocument Presentation") +#define STR_DESCRIPTION_OO_CALC_DOC NC_("STR_DESCRIPTION_OO_CALC_DOC", "OpenDocument Spreadsheet") +#define STR_DESCRIPTION_OO_WRITER_DOC NC_("STR_DESCRIPTION_OO_WRITER_DOC", "OpenDocument Text") +#define STR_DESCRIPTION_OO_CALC_TEMPLATE NC_("STR_DESCRIPTION_OO_CALC_TEMPLATE", "OpenDocument Spreadsheet Template") +#define STR_DESCRIPTION_OO_DRAW_TEMPLATE NC_("STR_DESCRIPTION_OO_DRAW_TEMPLATE", "OpenDocument Drawing Template") +#define STR_DESCRIPTION_OO_IMPRESS_TEMPLATE NC_("STR_DESCRIPTION_OO_IMPRESS_TEMPLATE", "OpenDocument Presentation Template") +#define STR_DESCRIPTION_OO_WRITER_TEMPLATE NC_("STR_DESCRIPTION_OO_WRITER_TEMPLATE", "OpenDocument Text Template") +#define STR_DESCRIPTION_EXTENSION NC_("STR_DESCRIPTION_EXTENSION", "%PRODUCTNAME Extension") + +#define STR_DESCRIPTION_HUNSPELL NC_("STR_DESCRIPTION_HUNSPELL", "Hunspell SpellChecker") +#define STR_DESCRIPTION_LIBHYPHEN NC_("STR_DESCRIPTION_LIBHYPHEN", "Libhyphen Hyphenator") +#define STR_DESCRIPTION_MYTHES NC_("STR_DESCRIPTION_MYTHES", "MyThes Thesaurus") +#define STR_DESCRIPTION_IGNOREALLLIST NC_("STR_DESCRIPTION_IGNOREALLLIST", "List of Ignored Words") +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/stringtransfer.hxx b/include/svtools/stringtransfer.hxx new file mode 100644 index 000000000..dcb5bda5d --- /dev/null +++ b/include/svtools/stringtransfer.hxx @@ -0,0 +1,75 @@ +/* -*- 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_SVTOOLS_STRINGTRANSFER_HXX +#define INCLUDED_SVTOOLS_STRINGTRANSFER_HXX + +#include <config_options.h> +#include <svtools/svtdllapi.h> +#include <vcl/transfer.hxx> + + +namespace svt +{ + + + //= OStringTransferable + + class UNLESS_MERGELIBS(SVT_DLLPUBLIC) OStringTransferable final : public TransferableHelper + { + public: + OStringTransferable(const OUString& _rContent); + + private: + // TransferableHelper overridables + virtual void AddSupportedFormats() override; + virtual bool GetData( const css::datatransfer::DataFlavor& _rFlavor, const OUString& rDestDoc ) override; + + OUString m_sContent; + }; + + + //= OStringTransfer + + class OStringTransfer + { + public: + /** copies the string given into the system clipboard + <p>Beware: In opposite to the old DragServer::CopyString, this method does not <em>add</em> the string + to the clipboard, instead the old clipboard content is <em>replaced</em>!</p> + */ + SVT_DLLPUBLIC static void CopyString( const OUString& _rContent, vcl::Window* _pWindow ); + + /** extracts a string from the system clipboard given + @return <TRUE/> if the extraction was successful, i.e. if the clipboard contained a string content + */ + SVT_DLLPUBLIC static bool PasteString( OUString& _rContent, vcl::Window* _pWindow ); + + /** starts dragging a simple string + */ + SVT_DLLPUBLIC static void StartStringDrag( const OUString& _rContent, vcl::Window* _pWindow, sal_Int8 _nDragSourceActions ); + }; + + +} // namespace svt + + +#endif // INCLUDED_SVTOOLS_STRINGTRANSFER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/svparser.hxx b/include/svtools/svparser.hxx new file mode 100644 index 000000000..7acd05b5a --- /dev/null +++ b/include/svtools/svparser.hxx @@ -0,0 +1,224 @@ +/* -*- 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_SVTOOLS_SVPARSER_HXX +#define INCLUDED_SVTOOLS_SVPARSER_HXX + +#include <svtools/svtdllapi.h> +#include <tools/link.hxx> +#include <tools/ref.hxx> +#include <tools/solar.h> +#include <rtl/textenc.h> +#include <rtl/ustring.hxx> +#include <vector> +#include <memory> + +template<typename T> struct SvParser_Impl; +class SvStream; + +enum class SvParserState +{ + Accepted = 0, + NotStarted, + Working, + Pending, + Error +}; + +template<typename T> +class SVT_DLLPUBLIC SvParser : public SvRefBase +{ + DECL_LINK( NewDataRead, LinkParamNone*, void ); + +protected: + SvStream& rInput; + OUString aToken; // scanned token + sal_uLong nlLineNr; // current line number + sal_uLong nlLinePos; // current column number + + std::unique_ptr<SvParser_Impl<T>> pImplData; // internal data + long m_nTokenIndex; // current token index to detect loops for seeking backwards + long nTokenValue; // additional value (RTF) + bool bTokenHasValue; // indicates whether nTokenValue is valid + SvParserState eState; // status also in derived classes + + rtl_TextEncoding eSrcEnc; // Source encoding + + sal_uInt64 nNextChPos; + sal_uInt32 nNextCh; // current character codepoint in UTF32 for the "lex" + + bool bUCS2BSrcEnc : 1; // or as big-endian UCS2 + bool bSwitchToUCS2 : 1; // switching is allowed + bool bRTF_InTextRead : 1; // only for RTF-Parser!!! + + struct TokenStackType + { + OUString sToken; + long nTokenValue; + bool bTokenHasValue; + T nTokenId; + + TokenStackType(); + }; + + // methods for Token stack + T SkipToken( short nCnt = -1 ); // "skip" n Tokens back + TokenStackType* GetStackPtr( short nCnt ); + + // scan the next token: + // work off Token stack and call GetNextToken_() if necessary. + // That one is responsible for the recognition of new Tokens. + T GetNextToken(); + virtual T GetNextToken_() = 0; + + // is called for each Token that is recognized in CallParser + virtual void NextToken( T nToken ) = 0; + + // at times of SvRefBase derivation, not everybody may delete + virtual ~SvParser() override; + + void ClearTxtConvContext(); + +private: + std::unique_ptr<TokenStackType[]> pTokenStack; + TokenStackType *pTokenStackPos; + sal_uInt8 nTokenStackSize, nTokenStackPos; + +public: + SvParser( SvStream& rIn, sal_uInt8 nStackSize = 3 ); + + virtual SvParserState CallParser() = 0; // calling of the parser + + SvParserState GetStatus() const; // StatusInfo + + sal_uLong GetLineNr() const; + sal_uLong GetLinePos() const; + void IncLineNr(); + sal_uLong IncLinePos(); + void SetLineNr( sal_uLong nlNum ); + void SetLinePos( sal_uLong nlPos ); + + sal_uInt32 GetNextChar(); // Return next Unicode codepoint in UTF32. + void RereadLookahead(); + + bool IsParserWorking() const; + + Link<LinkParamNone*,void> GetAsynchCallLink() const; + + // for asynchronous reading from the SvStream + void SaveState( T nToken ); + void RestoreState(); + virtual void Continue( T nToken ); + + // Set/get source encoding. The UCS2BEncoding flag is valid if source + // encoding is UCS2. It specifies a big endian encoding. + void SetSrcEncoding( rtl_TextEncoding eSrcEnc ); + rtl_TextEncoding GetSrcEncoding() const; + + // May the character set be switched to UCS/2, if a BOM + // is in the first two characters of the stream? + void SetSwitchToUCS2( bool bSet ); + bool IsSwitchToUCS2() const; + + // how many bytes a character consists of + sal_uInt16 GetCharSize() const; + + T GetSaveToken() const; +}; + +// build a Which-Map 'rWhichMap' from an array of WhichIds +// 'pWhichIds'. It has the length 'nWhichIds'. +// The WhichMap is not deleted. +SVT_DLLPUBLIC void BuildWhichTable( std::vector<sal_uInt16> &rWhichMap, + sal_uInt16 const *pWhichIds, + sal_uInt16 nWhichIds ); + +/*======================================================================== + * + * SvKeyValue. + * + *======================================================================*/ + +class SvKeyValue +{ + /** Representation. + */ + OUString m_aKey; + OUString m_aValue; + +public: + /** Construction. + */ + SvKeyValue() + {} + + SvKeyValue (const OUString &rKey, const OUString &rValue) + : m_aKey (rKey), m_aValue (rValue) + {} + + SvKeyValue (const SvKeyValue &rOther) + : m_aKey (rOther.m_aKey), m_aValue (rOther.m_aValue) + {} + + /** Assignment. + */ + SvKeyValue& operator= (SvKeyValue const &rOther) + { + m_aKey = rOther.m_aKey; + m_aValue = rOther.m_aValue; + return *this; + } + + /** Operation. + */ + const OUString& GetKey() const { return m_aKey; } + const OUString& GetValue() const { return m_aValue; } +}; + +/*======================================================================== + * + * SvKeyValueIterator. + * + *======================================================================*/ + +class SVT_DLLPUBLIC SvKeyValueIterator : public SvRefBase +{ + struct Impl; + std::unique_ptr<Impl> mpImpl; + +public: + /** Construction/Destruction. + */ + SvKeyValueIterator(); + virtual ~SvKeyValueIterator() override; + SvKeyValueIterator(const SvKeyValueIterator&) = delete; + SvKeyValueIterator& operator=( const SvKeyValueIterator& ) = delete; + + /** Operation. + */ + virtual bool GetFirst (SvKeyValue &rKeyVal); + virtual bool GetNext (SvKeyValue &rKeyVal); + virtual void Append (const SvKeyValue &rKeyVal); +}; + +typedef tools::SvRef<SvKeyValueIterator> SvKeyValueIteratorRef; + +#endif // INCLUDED_SVTOOLS_SVPARSER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/svtdllapi.h b/include/svtools/svtdllapi.h new file mode 100644 index 000000000..687ed9d3f --- /dev/null +++ b/include/svtools/svtdllapi.h @@ -0,0 +1,34 @@ +/* -*- 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_SVTOOLS_SVTDLLAPI_H +#define INCLUDED_SVTOOLS_SVTDLLAPI_H + +#include <sal/types.h> + +#if defined(SVT_DLLIMPLEMENTATION) +#define SVT_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define SVT_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif +#define SVT_DLLPRIVATE SAL_DLLPRIVATE + +#endif // INCLUDED_SVTOOLS_SVTDLLAPI_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/svtresid.hxx b/include/svtools/svtresid.hxx new file mode 100644 index 000000000..f0f9b45fc --- /dev/null +++ b/include/svtools/svtresid.hxx @@ -0,0 +1,32 @@ +/* -*- 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_SVTOOLS_SVTRESID_HXX +#define INCLUDED_SVTOOLS_SVTRESID_HXX + +#include <svtools/svtdllapi.h> +#include <rtl/ustring.hxx> +#include <locale> + +SVT_DLLPUBLIC std::locale SvtResLocale(); +SVT_DLLPUBLIC OUString SvtResId(const char* pId); + +#endif // INCLUDED_SVTOOLS_SVTRESID_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/tabbar.hxx b/include/svtools/tabbar.hxx new file mode 100644 index 000000000..bccdbb55d --- /dev/null +++ b/include/svtools/tabbar.hxx @@ -0,0 +1,505 @@ +/* -*- 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_SVTOOLS_TABBAR_HXX +#define INCLUDED_SVTOOLS_TABBAR_HXX + +#include <svtools/svtdllapi.h> +#include <tools/link.hxx> +#include <vcl/window.hxx> +#include <o3tl/typed_flags_set.hxx> +#include <memory> + +class StyleSettings; + +/* + +Allowed StylbeBits +------------------ + +WB_SCROLL - The tabs can be scrolled via an extra field +WB_MINSCROLL - The tabs can be scrolled via 2 additional buttons +WB_RANGESELECT - Connected ranges can be selected +WB_MULTISELECT - single tabs can be selected +WB_BORDER - a border is drawn in the top and in the bottom +WB_DRAG - A StartDrag handler is called by the TabBar, if drag + and drop should be started. In addition, drag and drop + is activated in the TabBar with EnableDrop(). +WB_SIZEABLE - a Split handler is called by the TabBar, if the user + wants to change the width of the TabBar +WB_STDTABBAR - WB_BORDER + + +Allowed PageBits +----------------- + +Setting page bits modify the display attributes of the tab name + +TabBarPageBits::Blue + - Display tab name in light blue, used in draw for + invisible layers and in calc for scenario pages +TabBarPageBits::Italic + - Display tab name italic, used in draw for + locked layers +TabBarPageBits::Underline + - Display tab name underlined, used in draw for + non-printable layers + + +Handlers +------- + +Select - is called when a tab is selected or unselected +DoubleClick - Is called when a DoubleClick has been fired in the + TabBar. Inside of the handler, GetCurPageId() returns + the clicked tab or 0, if no tab has been clicked. +ActivatePage - Is called, if another page is activated. + GetCurPageId() returns the activated page. +DeactivatePage - Is called, when a page is deactivated. If another page + may be activated, true must be returned; if another + page shall be excluded from the activation, false must + be returned. GetCurPageId() returns the page to be + deactivated. + + +Drag and Drop +------------- + +For Drag and Drop, the WinBit WB_DRAG must be set. In addition, the +Command handler, the QueryDrop handler and the Drop handler must be overlaid. +In doing so, the following must be implemented in the handlers: + +Command - If dragging should be started in this handler, + StartDrag() must be called. This method + then selects the respective entry or returns + false, if dragging cannot be carried out. + +QueryDrop - This handler is always called by StarView, when the + mouse is pulled over the window while dragging + (s.a. SV documentation). In this handler, it must be + determined whether a drop is possible. The drop + position can be shown in TabBar using ShowDropPos(). + When calling, the position of the Event must be passed. + If the position is at the left or right border, + scrolling automatically takes place in the TabBar. + This method also returns the respective drop position, + which is also needed for a drop. If the window is left + while dragging, the drop position can be taken back + using HideDropPos(). Thus, it is also possible to handle + a drag which was triggered from outside the TabBar. + +Drop - In the Drop handler, the pages have to be moved, or + the new pages have to be inserted. The respective + drop position can be determined using ShowDropPos(). + +The following methods are needed for Drag and Drop and must be called +by the handlers: + +StartDrag - Must be called from the Command handler. As parameters, + the CommandEvent and a reference to a Region must be + passed. This vcl::Region then must be passed in + ExecuteDrag(), if the return value indicates that + ExecuteDrag shall be carried out. If the entry is not + selected, it is set as the current entry beforehand. + Because of this, attention must be paid that the Select + handler can be called from this method. + +ShowDropPos - This method must be called by the QueryDrop handler, + so that the TabBar shows where the Tabs are + inserted. This method can also be used in the Drop + handler, in order to determine the position at which + the Tabs shall be inserted. In the method, the + position of the Event must be passed. This method + returns the position, at which the Tabs shall be inserted. + +HideDropPos - This method takes back the DropPosition previously + displayed using ShowDropPos(). This method should be + called, when the window is left in the QueryDrop() + handler or the drag process has been ended. + +The following methods can be used if the pages should be switched +in the Drag and Drop: + +SwitchPage - This method must be called by the QueryDrop handler + if the page, over which the mouse pointer resides, + should be switched. This method should be called + each time the QueryDrop-Handler is called. + Switching the page happens with a delay (500 ms) and + is automatically managed by this method. + The Position of the Event must be passed in the method. + This method returns true if the page has been switched. + +EndSwitchPage - This method resets the data for the switching of the + page. This method should be called when the window + is left in QueryDrop() or the drag process has been + ended. + +IsInSwitching - With this method, it can be queried in + ActivatePage()/DeactivatePage() whether this has been + caused by SwitchPage(). Thus, for example, switching + can be avoided in DeactivatePage() without an error + box. + + +Window Resize +-------------- + +If the window width can be changed by the user, the WinBit WB_SIZEABLE +must be set. In this case, the following handler must be overlaid: + +Split - When this handler is called, the window should be + adapted to the width that is returned by GetSplitSize(). + In doing so, no minimal or maximum width is taken into + account. A minimal size can be queried using + GetMinSize() and the maximum width must be calculated + by the application itself. As only Online Resize is + supported, the window width must be changed inside + this handler and possibly the width of dependent windows + as well. For this handler, a link can also be set using + SetSplitHdl(). + +The following methods deliver more information while Splitting: + +GetSplitSize() - Returns the width of the TabBar, to which the user + wants to resize the window. No minimum or maximum + width is taken into account. However, a width < 5 + is never returned. This method only returns valid + values as long as splitting is active. + +GetMinSize() - With this method, a minimum window width can be + queried, so that at least something of a Tab is + visible. Still, the TabBar can be set more narrow + then the width that this method returns. + This method can also be called, when no splitting + is active. + + +Edit Mode +---------- + +The TabBar also offers the user the possibility to change the names +in the Tabs. + +EnableEditMode - With this, it can be configured that on Alt+LeftClick, + StartEditMode() is automatically called by the TabBar. + In the StartRenaming() handler, the renaming can still + be rejected. +StartEditMode - With this method, the EditMode is started on a Tab. + false is returned, if the EditMode is already + active, the mode is rejected with StartRenaming() + or no space is available for editing. +EndEditMode - With this method, the EditMode is ended. +SetEditText - With this method, the text in the AllowRenaming() + handler can still be replaced by another text. +GetEditText - With this method, the text, which the user has typed + in, can be queried in the AllowRenaming() handler. +IsInEditMode - This method is used to query whether the EditMode + is active. +IsEditModeCanceled - This method can be used in the EndRenaming() + handler to query whether the renaming has + been canceled. +GetEditPageId - With this method, the tab that is being/has been + renamed is queried in the Renaming handlers. + +StartRenaming() - This handler is called when the EditMode hast been + started using StartEditMode(). GetEditPageId() + can be used to query which Tab should be renamed. + false should be returned if the EditMod should + not be started. +AllowRenaming() - This handler is called when the EditMode is ended + (not in case of Cancel). Within this handler, it + can then be tested whether the text is OK. + The Tab which was renamed can be queried using + GetEditPageId(). + One of the following values should be returned: + TAB_RENAMING_YES + The Tab is renamed. + TAB_RENAMING_NO + The Tab is not renamed, but the EditMode remains + active, so that the user can adapt the name + accordingly. + TAB_RENAMING_CANCEL + The EditMode was cancelled and the old text + is restored. +EndRenaming() - This handler is called when the EditMode has been + ended. The tab that has been renamed can be + queried using GetEditPageId(). Using + IsEditModeCanceled(), it can be queried whether + the mode has been cancelled and the name has + thus not been changed. + + +Maximum Page width +------------------- + +The Page width of the tabs can be limited in order to make an easier +navigation by them possible. If then, the text cannot be displayed +completely, it is abbreviated with "..." and the whole text is +displayed in the Tip or in the active help (if no help text is set). +Using EnableAutoMaxPageWidth(), it can be configured whether the +maximum page width should be based on the currently visible width +(which is the default). Otherwise, the maximum page width can +also be set using SetMaxPageWidth() (in pixels) (in this case, the +AutoMaxPageWidth is ignored). + +ContextMenu +----------- + +If a context-sensitive PopupMenu should be displayed, the Command +handler must be overlaid. Using GetPageId() and when passing the +mouse position, it can be determined whether the mouse click has been +carried out over an item resp. over which item the mouse click has +been carried out. +*/ + +class Button; + +#define WB_RANGESELECT (WinBits(0x00200000)) +#define WB_MULTISELECT (WinBits(0x00400000)) +#define WB_MINSCROLL (WinBits(0x20000000)) +#define WB_INSERTTAB (WinBits(0x40000000)) +#define WB_STDTABBAR WB_BORDER + +// Page bits + +enum class TabBarPageBits { + NONE = 0x00, + Blue = 0x01, + Italic = 0x02, + Underline = 0x04, +}; +namespace o3tl { + template<> struct typed_flags<TabBarPageBits> : is_typed_flags<TabBarPageBits, 0x07> {}; +}; + + // interface checks only, do not use in regular control flow + +#define TPB_DISPLAY_NAME_ALLFLAGS (TabBarPageBits::Blue | TabBarPageBits::Italic | TabBarPageBits::Underline) + +// - TabBar-Types - used in TabBar::AllowRenaming + +enum TabBarAllowRenamingReturnCode { + TABBAR_RENAMING_NO, + TABBAR_RENAMING_YES, + TABBAR_RENAMING_CANCEL +}; + +class MouseEvent; +class DataChangedEvent; + +struct ImplTabBarItem; +struct TabBar_Impl; + + +class SVT_DLLPUBLIC TabBar : public vcl::Window +{ + friend class ImplTabButton; + friend class ImplTabSizer; + +private: + std::unique_ptr<TabBar_Impl> mpImpl; + + OUString maEditText; + Size maWinSize; + long mnMaxPageWidth; + long mnCurMaxWidth; + long mnOffX; + long mnOffY; + long mnLastOffX; + long mnSplitSize; + sal_uInt64 mnSwitchTime; + WinBits mnWinStyle; + sal_uInt16 mnCurPageId; + sal_uInt16 mnFirstPos; + sal_uInt16 mnDropPos; + sal_uInt16 mnSwitchId; + sal_uInt16 mnEditId; + + bool mbFormat : 1; + bool mbFirstFormat : 1; + bool mbSizeFormat : 1; + bool mbAutoEditMode : 1; + bool mbEditCanceled : 1; + bool mbDropPos : 1; + bool mbInSelect : 1; + bool mbMirrored : 1; + bool mbScrollAlwaysEnabled : 1; + + Link<TabBar*,void> maSelectHdl; + Link<TabBar*,void> maSplitHdl; + Link<const CommandEvent&, void> maScrollAreaContextHdl; + size_t maCurrentItemList; + + using Window::ImplInit; + SVT_DLLPRIVATE void ImplInit( WinBits nWinStyle ); + SVT_DLLPRIVATE void ImplInitSettings( bool bFont, bool bBackground ); + SVT_DLLPRIVATE void ImplGetColors(const StyleSettings& rStyleSettings, + Color& rFaceColor, Color& rFaceTextColor, + Color& rSelectColor, Color& rSelectTextColor); + SVT_DLLPRIVATE void ImplShowPage( sal_uInt16 nPos ); + SVT_DLLPRIVATE bool ImplCalcWidth(); + SVT_DLLPRIVATE void ImplFormat(); + SVT_DLLPRIVATE sal_uInt16 ImplGetLastFirstPos(); + SVT_DLLPRIVATE void ImplInitControls(); + SVT_DLLPRIVATE void ImplEnableControls(); + SVT_DLLPRIVATE void ImplSelect(); + SVT_DLLPRIVATE void ImplActivatePage(); + SVT_DLLPRIVATE bool ImplDeactivatePage(); + SVT_DLLPRIVATE void ImplPrePaint(); + SVT_DLLPRIVATE ImplTabBarItem* ImplGetLastTabBarItem( sal_uInt16 nItemCount ); + + DECL_DLLPRIVATE_LINK(ImplClickHdl, Button*, void); + + DECL_DLLPRIVATE_LINK(ImplAddClickHandler, Button*, void); + + ImplTabBarItem* seek( size_t i ); + ImplTabBarItem* prev(); + ImplTabBarItem* next(); + +protected: + virtual void AddTabClick(); + OUString GetAuxiliaryText(sal_uInt16 nPageId) const; // needed in derived class LayerTabBar + void SetAuxiliaryText(sal_uInt16 nPageId, const OUString& rText ); + +public: + static const sal_uInt16 APPEND; + static const sal_uInt16 PAGE_NOT_FOUND; + + TabBar( vcl::Window* pParent, WinBits nWinStyle ); + virtual ~TabBar() override; + virtual void dispose() override; + + virtual void MouseMove( const MouseEvent& rMEvt ) override; + virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; + virtual void MouseButtonUp( const MouseEvent& rMEvt ) override; + virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; + virtual void Resize() override; + virtual void RequestHelp( const HelpEvent& rHEvt ) override; + virtual void StateChanged( StateChangedType nStateChange ) override; + virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; + virtual bool PreNotify( NotifyEvent& rNEvt ) override; + + virtual void Select(); + virtual void DoubleClick(); + void Split(); + virtual void ActivatePage(); + virtual bool DeactivatePage(); + virtual bool StartRenaming(); + virtual TabBarAllowRenamingReturnCode AllowRenaming(); + virtual void EndRenaming(); + virtual void Mirror(); + + virtual void InsertPage( sal_uInt16 nPageId, const OUString& rText, + TabBarPageBits nBits = TabBarPageBits::NONE, + sal_uInt16 nPos = TabBar::APPEND ); + void RemovePage( sal_uInt16 nPageId ); + void MovePage( sal_uInt16 nPageId, sal_uInt16 nNewPos ); + + Color GetTabBgColor( sal_uInt16 nPageId ) const; + void SetTabBgColor( sal_uInt16 nPageId, const Color& aTabBgColor ); + + void Clear(); + + bool IsPageEnabled( sal_uInt16 nPageId ) const; + + void SetPageBits( sal_uInt16 nPageId, TabBarPageBits nBits ); + TabBarPageBits GetPageBits( sal_uInt16 nPageId ) const; + + sal_uInt16 GetPageCount() const; + sal_uInt16 GetPageId( sal_uInt16 nPos ) const; + sal_uInt16 GetPagePos( sal_uInt16 nPageId ) const; + sal_uInt16 GetCurPagePos() const { return GetPagePos(GetCurPageId()); } + sal_uInt16 GetPageId( const Point& rPos ) const; + tools::Rectangle GetPageRect( sal_uInt16 nPageId ) const; + // returns the rectangle in which page tabs are drawn + tools::Rectangle GetPageArea() const; + + void SetCurPageId( sal_uInt16 nPageId ); + sal_uInt16 GetCurPageId() const { return mnCurPageId; } + + void SetFirstPageId( sal_uInt16 nPageId ); + void MakeVisible( sal_uInt16 nPageId ); + + void SelectPage( sal_uInt16 nPageId, bool bSelect ); + sal_uInt16 GetSelectPageCount() const; + bool IsPageSelected( sal_uInt16 nPageId ) const; + void SetProtectionSymbol( sal_uInt16 nPageId, bool bProtection ); + + void SetMaxPageWidth( long nMaxWidth ); + + void EnableEditMode() { mbAutoEditMode = true; } + bool StartEditMode( sal_uInt16 nPageId ); + void EndEditMode( bool bCancel = false ); + void SetEditText( const OUString& rText ) { maEditText = rText; } + const OUString& GetEditText() const { return maEditText; } + bool IsInEditMode() const; + bool IsEditModeCanceled() const { return mbEditCanceled; } + sal_uInt16 GetEditPageId() const { return mnEditId; } + + /** Mirrors the entire control including position of buttons and splitter. + Mirroring is done relative to the current direction of the GUI. + @param bMirrored sal_True = the control will draw itself RTL in LTR GUI, + and vice versa; sal_False = the control behaves according to the + current direction of the GUI. */ + void SetMirrored(bool bMirrored); + /** Returns true, if the control is set to mirrored mode (see SetMirrored()). */ + bool IsMirrored() const { return mbMirrored; } + + /** Sets the control to LTR or RTL mode regardless of the GUI direction. + @param bRTL sal_False = the control will draw from left to right; + sal_True = the control will draw from right to left. */ + void SetEffectiveRTL( bool bRTL ); + /** Returns true, if the control draws from right to left (see SetEffectiveRTL()). */ + bool IsEffectiveRTL() const; + + bool StartDrag( const CommandEvent& rCEvt, vcl::Region& rRegion ); + sal_uInt16 ShowDropPos( const Point& rPos ); + void HideDropPos(); + void SwitchPage( const Point& rPos ); + void EndSwitchPage(); + + virtual void SetPageText( sal_uInt16 nPageId, const OUString& rText ); + OUString GetPageText( sal_uInt16 nPageId ) const; + OUString GetHelpText( sal_uInt16 nPageId ) const; + + long GetSplitSize() const { return mnSplitSize; } + + using Window::SetHelpText; + using Window::GetHelpText; + using Window::SetHelpId; + using Window::GetHelpId; + + void SetStyle( WinBits nStyle ); + WinBits GetStyle() const { return mnWinStyle; } + + void SetScrollAlwaysEnabled(bool bScrollAlwaysEnabled); + + Size CalcWindowSizePixel() const; + + void SetSelectHdl( const Link<TabBar*,void>& rLink ) { maSelectHdl = rLink; } + void SetSplitHdl( const Link<TabBar*,void>& rLink ) { maSplitHdl = rLink; } + void SetScrollAreaContextHdl( const Link<const CommandEvent&,void>& rLink ) { maScrollAreaContextHdl = rLink; } + + // accessibility + virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() override; +}; + +#endif // INCLUDED_SVTOOLS_TABBAR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/templatefoldercache.hxx b/include/svtools/templatefoldercache.hxx new file mode 100644 index 000000000..efeb57aba --- /dev/null +++ b/include/svtools/templatefoldercache.hxx @@ -0,0 +1,93 @@ +/* -*- 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_SVTOOLS_TEMPLATEFOLDERCACHE_HXX +#define INCLUDED_SVTOOLS_TEMPLATEFOLDERCACHE_HXX + +#include <config_options.h> +#include <svtools/svtdllapi.h> +#include <o3tl/deleter.hxx> +#include <memory> + +namespace svt +{ + + + //= TemplateFolderCache + + class TemplateFolderCacheImpl; + /** allows to cache the state of the template directories of OOo + <p>Usually, this class is used together with an instance of the + <service scope="com.sun.star.frame">DocumentTemplates</service> service. It allows to scan the template folders + of the Office, and updates the configuration so that it reflects the most recent state of the folders.<br/> + As this is an expensive, the TemplateFolderCache has been introduced. It caches the state of the template + folders, and allows to determine if the DocumentTemplates service needs to be invoked to do the (much more expensive) + update.</p> + @example C++ + <listing> + TemplateFolderCache aTemplateFolders; + if ( aTemplateFolders.needsUpdate() ) + { + // store the current state + aCache.storeState(); + + // create the DocumentTemplates instance + Reference< XDocumentTemplates > xTemplates = ...; + + // update the templates configuration + xTemplates->update(); + } + + // do anything which relies on a up-to-date template configuration + </listing> + */ + class UNLESS_MERGELIBS(SVT_DLLPUBLIC) TemplateFolderCache + { + private: + std::unique_ptr<TemplateFolderCacheImpl, o3tl::default_delete<TemplateFolderCacheImpl>> m_pImpl; + + public: + /** ctor. + @param _bAutoStoreState + Set this to <TRUE/> if you want the instance to automatically store the state of the template folders upon + destruction.<br/> + If set to <FALSE/>, you would explicitly need to call <method>storeState</method> to do this.<br/> + If the current state is not known (e.g. because you did not call needsUpdate, which retrieves it), + it is not retrieved in the dtor, regardless of the <arg>_bAutoStoreState</arg> flag. + */ + TemplateFolderCache( bool _bAutoStoreState = false ); + ~TemplateFolderCache( ); + + /** determines whether or not the template configuration needs to be updated + @return + <TRUE/> if the template configuration needs to be updated + */ + bool needsUpdate(); + + /** stores the current state of the template folders in the cache */ + void storeState(); + }; + + +} // namespace svt + + +#endif // INCLUDED_SVTOOLS_TEMPLATEFOLDERCACHE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/textwindowpeer.hxx b/include/svtools/textwindowpeer.hxx new file mode 100644 index 000000000..6edc665c6 --- /dev/null +++ b/include/svtools/textwindowpeer.hxx @@ -0,0 +1,42 @@ +/* -*- 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_SVTOOLS_TEXTWINDOWPEER_HXX +#define INCLUDED_SVTOOLS_TEXTWINDOWPEER_HXX + +#include <sal/config.h> + +#include <com/sun/star/uno/Reference.hxx> +#include <svtools/svtdllapi.h> + +namespace com::sun::star::awt { + class XWindowPeer; +} +class TextView; + +namespace svt { + +css::uno::Reference<css::awt::XWindowPeer> SVT_DLLPUBLIC createTextWindowPeer( + TextView & view); + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/toolbarmenu.hxx b/include/svtools/toolbarmenu.hxx new file mode 100644 index 000000000..f50a83598 --- /dev/null +++ b/include/svtools/toolbarmenu.hxx @@ -0,0 +1,140 @@ +/* -*- 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_SVTOOLS_TOOLBARMENU_HXX +#define INCLUDED_SVTOOLS_TOOLBARMENU_HXX + +#include <config_options.h> +#include <svtools/svtdllapi.h> + +#include <memory> + +#include <rtl/ref.hxx> +#include <vcl/dockwin.hxx> +#include <vcl/weld.hxx> + +namespace com :: sun :: star :: frame { class XFrame; } +namespace com :: sun :: star :: frame { struct FeatureStateEvent; } +namespace svt { class FrameStatusListener; } + +namespace svtools { + +class SVT_DLLPUBLIC ToolbarPopupBase +{ + friend class ToolbarPopupStatusListener; +public: + ToolbarPopupBase(const css::uno::Reference<css::frame::XFrame>& rFrame); + virtual ~ToolbarPopupBase(); + +protected: + void AddStatusListener( const OUString& rCommandURL ); + + // Forwarded from XStatusListener (subclasses must override this one to get the status updates): + /// @throws css::uno::RuntimeException + virtual void statusChanged(const css::frame::FeatureStateEvent& Event ); + + css::uno::Reference<css::frame::XFrame> mxFrame; + rtl::Reference<svt::FrameStatusListener> mxStatusListener; +}; + +class UNLESS_MERGELIBS(SVT_DLLPUBLIC) ToolbarPopup : public DockingWindow, public ToolbarPopupBase +{ +public: + ToolbarPopup(const css::uno::Reference<css::frame::XFrame>& rFrame, + vcl::Window* pParentWindow, + const OString& rID, const OUString& rUIXMLDescription ); + virtual ~ToolbarPopup() override; + virtual void dispose() override; + +protected: + void EndPopupMode(); + +private: + void init(); +}; + +} // namespace svtools + +class SVT_DLLPUBLIC WeldToolbarPopup : public svtools::ToolbarPopupBase +{ +private: + DECL_LINK(FocusHdl, weld::Widget&, void); + +protected: + std::unique_ptr<weld::Builder> m_xBuilder; + std::unique_ptr<weld::Container> m_xTopLevel; + std::unique_ptr<weld::Container> m_xContainer; + +public: + WeldToolbarPopup(const css::uno::Reference<css::frame::XFrame>& rFrame, + weld::Widget* pParent, const OUString& rUIFile, const OString& rId); + virtual ~WeldToolbarPopup() override; + weld::Container* getTopLevel() { return m_xTopLevel.get(); } + weld::Container* getContainer() { return m_xContainer.get(); } + + virtual void GrabFocus() = 0; +}; + +// we want to create WeldToolbarPopup on-demand when a toolbar dropdown is +// clicked, but the widget to be shown must exist before the dropdown +// is activated, so ToolbarPopupContainer is that widget and the +// contents of the on-demand created WeldToolbarPopup is placed +// within the ToolbarPopupContainer +class SVT_DLLPUBLIC ToolbarPopupContainer final +{ +private: + DECL_LINK(FocusHdl, weld::Widget&, void); + + std::unique_ptr<weld::Builder> m_xBuilder; + std::unique_ptr<weld::Container> m_xTopLevel; + std::unique_ptr<weld::Container> m_xContainer; + std::unique_ptr<WeldToolbarPopup> m_xPopup; +public: + ToolbarPopupContainer(weld::Widget* pParent); + ~ToolbarPopupContainer(); + weld::Container* getTopLevel() { return m_xTopLevel.get(); } + weld::Container* getContainer() { return m_xContainer.get(); } + + void setPopover(std::unique_ptr<WeldToolbarPopup> xPopup); + WeldToolbarPopup* getPopover() const { return m_xPopup.get(); } + void unsetPopover(); +}; + +class SVT_DLLPUBLIC InterimToolbarPopup final : public svtools::ToolbarPopup +{ +private: + VclPtr<vcl::Window> m_xBox; + std::unique_ptr<weld::Builder> m_xBuilder; + std::unique_ptr<weld::Container> m_xContainer; + std::unique_ptr<WeldToolbarPopup> m_xPopup; +public: + InterimToolbarPopup(const css::uno::Reference<css::frame::XFrame>& rFrame, vcl::Window* pParent, + std::unique_ptr<WeldToolbarPopup> xPopup, bool bTearable = false); + weld::Container* getContainer() { return m_xContainer.get(); } + virtual void dispose() override; + virtual ~InterimToolbarPopup() override; + + virtual void GetFocus() override; + + using ToolbarPopup::EndPopupMode; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/toolboxcontroller.hxx b/include/svtools/toolboxcontroller.hxx new file mode 100644 index 000000000..dfad5af20 --- /dev/null +++ b/include/svtools/toolboxcontroller.hxx @@ -0,0 +1,197 @@ +/* -*- 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_SVTOOLS_TOOLBOXCONTROLLER_HXX +#define INCLUDED_SVTOOLS_TOOLBOXCONTROLLER_HXX + +#include <svtools/svtdllapi.h> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/frame/XStatusListener.hpp> +#include <com/sun/star/frame/XToolbarController.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/util/XUpdatable.hpp> +#include <com/sun/star/uno/Sequence.hxx> +#include <cppuhelper/implbase.hxx> +#include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/broadcasthelper.hxx> +#include <comphelper/proparrhlp.hxx> +#include <comphelper/propertycontainer.hxx> +#include <cppuhelper/propshlp.hxx> +#include <tools/link.hxx> + +#include <unordered_map> + +namespace com :: sun :: star :: frame { class XDispatch; } +namespace com :: sun :: star :: frame { class XFrame; } +namespace com :: sun :: star :: frame { class XLayoutManager; } +namespace com :: sun :: star :: uno { class XComponentContext; } +namespace com :: sun :: star :: util { class XURLTransformer; } + +class ToolBox; + +namespace weld +{ + class Builder; + class Toolbar; +} + +namespace svt +{ + +typedef cppu::WeakImplHelper< + css::frame::XStatusListener, css::frame::XToolbarController, + css::lang::XInitialization, css::util::XUpdatable, + css::lang::XComponent > + ToolboxController_Base; + +class SVT_DLLPUBLIC ToolboxController : + public ToolboxController_Base, + public ::comphelper::OMutexAndBroadcastHelper, + public ::comphelper::OPropertyContainer, + public ::comphelper::OPropertyArrayUsageHelper< ToolboxController > +{ + private: + bool m_bSupportVisible; + public: + ToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const css::uno::Reference< css::frame::XFrame >& xFrame, + const OUString& aCommandURL ); + ToolboxController(); + virtual ~ToolboxController() override; + + css::uno::Reference< css::frame::XFrame > getFrameInterface() const; + const css::uno::Reference< css::uno::XComponentContext >& getContext() const; + css::uno::Reference< css::frame::XLayoutManager > getLayoutManager() const; + + void updateStatus( const OUString& aCommandURL ); + void updateStatus(); + + // XInterface + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; + virtual void SAL_CALL acquire() throw () override; + virtual void SAL_CALL release() throw () override; + virtual css::uno::Sequence<css::uno::Type> SAL_CALL getTypes() override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; + + // XUpdatable + virtual void SAL_CALL update() override; + + // XComponent + virtual void SAL_CALL dispose() override; + virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override; + virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; + + // XEventListener + using cppu::OPropertySetHelper::disposing; + virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; + + // XStatusListener + virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override = 0; + + // XToolbarController + virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override; + virtual void SAL_CALL click() override; + virtual void SAL_CALL doubleClick() override; + virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override; + virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) override; + // OPropertySetHelper + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& rValue ) override; + virtual sal_Bool SAL_CALL convertFastPropertyValue( css::uno::Any& rConvertedValue, css::uno::Any& rOldValue, sal_Int32 nHandle, const css::uno::Any& rValue) override; + // XPropertySet + virtual css::uno::Reference< css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override; + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; + // OPropertyArrayUsageHelper + virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override; + + + const OUString& getCommandURL() const { return m_aCommandURL; } + const OUString& getModuleName() const { return m_sModuleName; } + + void dispatchCommand( const OUString& sCommandURL, const css::uno::Sequence< css::beans::PropertyValue >& rArgs, const OUString &rTarget = OUString() ); + + void enable( bool bEnable ); + + bool IsInSidebar() const { return m_bSidebar; } + + protected: + bool getToolboxId( sal_uInt16& rItemId, ToolBox** ppToolBox ); + struct Listener + { + Listener( const css::util::URL& rURL, const css::uno::Reference< css::frame::XDispatch >& rDispatch ) : + aURL( rURL ), xDispatch( rDispatch ) {} + + css::util::URL aURL; + css::uno::Reference< css::frame::XDispatch > xDispatch; + }; + + struct DispatchInfo + { + css::uno::Reference< css::frame::XDispatch > mxDispatch; + const css::util::URL maURL; + const css::uno::Sequence< css::beans::PropertyValue > maArgs; + + DispatchInfo( const css::uno::Reference< css::frame::XDispatch >& xDispatch, + const css::util::URL& rURL, + const css::uno::Sequence< css::beans::PropertyValue >& rArgs ) + : mxDispatch( xDispatch ) + , maURL( rURL ) + , maArgs( rArgs ) + {} + }; + + DECL_STATIC_LINK( ToolboxController, ExecuteHdl_Impl, void*, void ); + + typedef std::unordered_map< OUString, + css::uno::Reference< css::frame::XDispatch > > URLToDispatchMap; + + // methods to support status forwarder, known by the old sfx2 toolbox controller implementation + void addStatusListener( const OUString& aCommandURL ); + void removeStatusListener( const OUString& aCommandURL ); + void bindListener(); + void unbindListener(); + + // TODO remove + const css::uno::Reference< css::util::XURLTransformer >& getURLTransformer() const { return m_xUrlTransformer;} + // TODO remove + const css::uno::Reference< css::awt::XWindow >& getParent() const { return m_xParentWindow;} + + bool m_bInitialized, + m_bDisposed, + m_bSidebar; + sal_uInt16 m_nToolBoxId; + css::uno::Reference< css::frame::XFrame > m_xFrame; + css::uno::Reference< css::uno::XComponentContext > m_xContext; + OUString m_aCommandURL; + URLToDispatchMap m_aListenerMap; + ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener + + css::uno::Reference< css::awt::XWindow > m_xParentWindow; + css::uno::Reference< css::util::XURLTransformer > m_xUrlTransformer; + OUString m_sModuleName; + weld::Toolbar* m_pToolbar; + weld::Builder* m_pBuilder; +}; + +} + +#endif // INCLUDED_SVTOOLS_TOOLBOXCONTROLLER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/unitconv.hxx b/include/svtools/unitconv.hxx new file mode 100644 index 000000000..2edf1ade8 --- /dev/null +++ b/include/svtools/unitconv.hxx @@ -0,0 +1,55 @@ +/* -*- 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_SVTOOLS_UNITCONV_HXX +#define INCLUDED_SVTOOLS_UNITCONV_HXX + +#include <svtools/svtdllapi.h> +#include <tools/mapunit.hxx> +#include <tools/fldunit.hxx> + +namespace weld { class MetricSpinButton; } + +// macro ----------------------------------------------------------------- + +// typedef --------------------------------------------------------------- + +typedef long (*FUNC_CONVERT)(long); + +// Functions ------------------------------------------------------------- + +SVT_DLLPUBLIC void SetFieldUnit(weld::MetricSpinButton& rCtrl, FieldUnit eUnit, bool bAll = false); + +SVT_DLLPUBLIC long CalcToUnit( float nIn, MapUnit eUnit ); +SVT_DLLPUBLIC long CalcToPoint( long nIn, MapUnit eUnit, sal_uInt16 nFactor ); + +SVT_DLLPUBLIC long ItemToControl( long nIn, MapUnit eItem, FieldUnit eCtrl ); +SVT_DLLPUBLIC long ControlToItem( long nIn, FieldUnit eCtrl, MapUnit eItem ); + +SVT_DLLPUBLIC FieldUnit MapToFieldUnit( const MapUnit eUnit ); + +SVT_DLLPUBLIC void SetMetricValue(weld::MetricSpinButton& rField, int lCoreValue, MapUnit eUnit); +SVT_DLLPUBLIC int GetCoreValue(const weld::MetricSpinButton& rField, MapUnit eUnit); + +SVT_DLLPUBLIC long PointToTwips( long nIn ); + +SVT_DLLPUBLIC long TransformMetric( long nVal, FieldUnit aOld, FieldUnit aNew ); + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/unoevent.hxx b/include/svtools/unoevent.hxx new file mode 100644 index 000000000..46335a5d2 --- /dev/null +++ b/include/svtools/unoevent.hxx @@ -0,0 +1,262 @@ +/* -*- 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_SVTOOLS_UNOEVENT_HXX +#define INCLUDED_SVTOOLS_UNOEVENT_HXX + +#include <svtools/svtdllapi.h> +#include <com/sun/star/container/XNameReplace.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <cppuhelper/implbase.hxx> +#include <vector> +#include <memory> + +namespace com :: sun :: star :: uno { class XInterface; } + +class SvxMacroTableDtor; +class SvxMacroItem; +class SvxMacro; +enum class SvMacroItemId : sal_uInt16; + +/** SvEventDescription: Description of a single event. + mnEvent is the id used by SvxMacroItem + mpEventName is the api name for this event + + the last event in an array is indicated by mnEvent && mpEventName == 0 +*/ +struct SvEventDescription +{ + SvMacroItemId mnEvent; + const char* mpEventName; +}; + +/** + * SvBaseEventDescriptor: Abstract class that implements the basics + * of an XNameReplace that is delivered by the + * XEventsSupplier::getEvents() method. + * + * The functionality this class provides is: + * 1) Which elements are in the XNameReplace? + * 2) Mapping from Api names to item IDs. + * 3) conversion from SvxMacroItem to Any and vice versa. + * + * All details of how to actually get and set SvxMacroItem(s) have to + * be supplied by the base class. + */ +class SVT_DLLPUBLIC SvBaseEventDescriptor : public cppu::WeakImplHelper +< + css::container::XNameReplace, + css::lang::XServiceInfo +> +{ +protected: + /// last element is 0, 0 + const SvEventDescription* mpSupportedMacroItems; + sal_Int16 mnMacroItems; + +public: + + SvBaseEventDescriptor(const SvEventDescription* pSupportedMacroItems); + + virtual ~SvBaseEventDescriptor() override; + + + // XNameReplace + /// calls replaceByName(const sal_uInt16, const SvxMacro&) + virtual void SAL_CALL replaceByName( + const OUString& rName, /// API name of event + const css::uno::Any& rElement ) /// event (PropertyValues) + override; + + // XNameAccess (via XNameReplace) + /// calls getByName(sal_uInt16) + virtual css::uno::Any SAL_CALL getByName( + const OUString& rName ) /// API name of event + override; + + // XNameAxcess (via XNameReplace) + virtual css::uno::Sequence< OUString > SAL_CALL + getElementNames() override; + + // XNameAccess (via XNameReplace) + virtual sal_Bool SAL_CALL hasByName( + const OUString& rName ) override; + + // XElementAccess (via XNameReplace) + virtual css::uno::Type SAL_CALL getElementType() override; + + // XElementAccess (via XNameReplace) + virtual sal_Bool SAL_CALL hasElements() override; + + // XServiceInfo + /// must be implemented in subclass + virtual OUString SAL_CALL getImplementationName() override = 0; + + // XServiceInfo + virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; + + // XServiceInfo + virtual css::uno::Sequence< OUString > SAL_CALL + getSupportedServiceNames() override; + +protected: + + /// Must be implemented in subclass. + /// + /// @throws css::lang::IllegalArgumentException + /// @throws css::container::NoSuchElementException + /// @throws css::lang::WrappedTargetException + /// @throws css::uno::RuntimeException + virtual void replaceByName( + const SvMacroItemId nEvent, /// item ID of event + const SvxMacro& rMacro) /// event (will be copied) + = 0; + + /// Must be implemented in subclass. + /// + /// @throws css::container::NoSuchElementException + /// @throws css::lang::WrappedTargetException + /// @throws css::uno::RuntimeException + virtual void getByName( + SvxMacro& rMacro, + const SvMacroItemId nEvent ) = 0; + + /// convert an API event name to the event ID as used by SvxMacroItem + SvMacroItemId mapNameToEventID(const OUString& rName) const; + + /// get the event ID for the name; return 0 if not supported + SvMacroItemId getMacroID(const OUString& rName) const; +}; + + +/** + * SvEventDescriptor: Implement the XNameReplace that is delivered by + * the XEventsSupplier::getEvents() method. The SvEventDescriptor has + * to be subclassed to implement the events for a specific + * objects. The subclass has to + * 1) supply the super class constructor with a list of known events (item IDs) + * 2) supply the super class constructor with a reference of its parent object + * (to prevent destruction) + * 3) implement getItem() and setItem(...) methods. + * + * If no object is available to which the SvEventDescriptor can attach itself, + * the class SvDetachedEventDescriptor should be used. + */ +class SVT_DLLPUBLIC SvEventDescriptor : public SvBaseEventDescriptor +{ + /// keep reference to parent to prevent it from being destroyed + css::uno::Reference< css::uno::XInterface > xParentRef; + +public: + + SvEventDescriptor(css::uno::XInterface& rParent, + const SvEventDescription* pSupportedMacroItems); + + virtual ~SvEventDescriptor() override; + + +protected: + + + using SvBaseEventDescriptor::replaceByName; + virtual void replaceByName( + const SvMacroItemId nEvent, /// item ID of event + const SvxMacro& rMacro) /// event (will be copied) + override; + + using SvBaseEventDescriptor::getByName; + virtual void getByName( + SvxMacro& rMacros, /// macro to be filled with values + const SvMacroItemId nEvent ) /// item ID of event + override; + + + /// Get the SvxMacroItem from the parent. + /// must be implemented by subclass + virtual const SvxMacroItem& getMacroItem() = 0; + + /// Set the SvxMacroItem at the parent. + /// must be implemented by subclass + virtual void setMacroItem(const SvxMacroItem& rItem) = 0; + + /// Get the SvxMacroItem Which Id needed for the current application + /// must be implemented by subclass + virtual sal_uInt16 getMacroItemWhich() const = 0; +}; + + +/** + * SvDetachedEventDescriptor: + */ +class SVT_DLLPUBLIC SvDetachedEventDescriptor : public SvBaseEventDescriptor +{ + // the macros; aMacros[i] is the value for aSupportedMacroItemIDs[i] + std::vector<std::unique_ptr<SvxMacro>> aMacros; + +public: + + SvDetachedEventDescriptor(const SvEventDescription* pSupportedMacroItems); + SvDetachedEventDescriptor& operator=( SvDetachedEventDescriptor const & ) = delete; // MSVC2015 workaround + SvDetachedEventDescriptor( SvDetachedEventDescriptor const & ) = delete; // MSVC2015 workaround + + virtual ~SvDetachedEventDescriptor() override; + + //XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + +protected: + + sal_Int16 getIndex(const SvMacroItemId nID) const; + + using SvBaseEventDescriptor::replaceByName; + virtual void replaceByName( + const SvMacroItemId nEvent, /// item ID of event + const SvxMacro& rMacro) /// event (will be copied) + override; + + using SvBaseEventDescriptor::getByName; + virtual void getByName( + SvxMacro& rMacro, /// macro to be filled + const SvMacroItemId nEvent ) /// item ID of event + override; + + /// do we have an event? + /// return true: we have a macro for the event + /// return false: no macro; getByName() will return an empty macro + /// @throws css::lang::IllegalArgumentException if the event is not supported + bool hasById( + const SvMacroItemId nEvent ) const; /// item ID of event + +}; + +class SVT_DLLPUBLIC SvMacroTableEventDescriptor final : public SvDetachedEventDescriptor +{ +public: + + SvMacroTableEventDescriptor(const SvEventDescription* pSupportedMacroItems); + SvMacroTableEventDescriptor(const SvxMacroTableDtor& aFmt, + const SvEventDescription* pSupportedMacroItems); + + virtual ~SvMacroTableEventDescriptor() override; + + void copyMacrosIntoTable(SvxMacroTableDtor& aFmt); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/unoimap.hxx b/include/svtools/unoimap.hxx new file mode 100644 index 000000000..58810153c --- /dev/null +++ b/include/svtools/unoimap.hxx @@ -0,0 +1,41 @@ +/* -*- 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_SVTOOLS_UNOIMAP_HXX +#define INCLUDED_SVTOOLS_UNOIMAP_HXX + +#include <svtools/svtdllapi.h> +#include <com/sun/star/uno/Reference.hxx> + +namespace com :: sun :: star :: uno { class XInterface; } + +class ImageMap; +struct SvEventDescription; + +SVT_DLLPUBLIC css::uno::Reference< css::uno::XInterface > SvUnoImageMapRectangleObject_createInstance( const SvEventDescription* pSupportedMacroItems ); +SVT_DLLPUBLIC css::uno::Reference< css::uno::XInterface > SvUnoImageMapCircleObject_createInstance( const SvEventDescription* pSupportedMacroItems ); +SVT_DLLPUBLIC css::uno::Reference< css::uno::XInterface > SvUnoImageMapPolygonObject_createInstance( const SvEventDescription* pSupportedMacroItems ); + +SVT_DLLPUBLIC css::uno::Reference< css::uno::XInterface > SvUnoImageMap_createInstance(); +SVT_DLLPUBLIC css::uno::Reference< css::uno::XInterface > SvUnoImageMap_createInstance( const ImageMap& rMap, const SvEventDescription* pSupportedMacroItems ); +SVT_DLLPUBLIC bool SvUnoImageMap_fillImageMap( const css::uno::Reference< css::uno::XInterface >& xImageMap, ImageMap& rMap ); + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/urlfilter.hxx b/include/svtools/urlfilter.hxx new file mode 100644 index 000000000..9f91407f8 --- /dev/null +++ b/include/svtools/urlfilter.hxx @@ -0,0 +1,45 @@ +/* -*- 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_SVL_URLFILTER_HXX +#define INCLUDED_SVL_URLFILTER_HXX + +#include <config_options.h> +#include <svtools/svtdllapi.h> +#include <tools/wldcrd.hxx> +#include <vector> + +struct UNLESS_MERGELIBS(SVT_DLLPUBLIC) FilterMatch +{ +private: + const OUString& m_rCompareString; +public: + FilterMatch( const OUString& _rCompareString ) : m_rCompareString( _rCompareString ) { } + + bool operator()( const WildCard& _rMatcher ) + { + return _rMatcher.Matches( m_rCompareString ); + } + + static void createWildCardFilterList(const OUString& _rFilterList,::std::vector< WildCard >& _rFilters); +}; + +#endif // INCLUDED_SVL_URLFILTER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx new file mode 100644 index 000000000..d5c991d86 --- /dev/null +++ b/include/svtools/valueset.hxx @@ -0,0 +1,418 @@ +/* -*- 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_SVTOOLS_VALUESET_HXX +#define INCLUDED_SVTOOLS_VALUESET_HXX + +#include <config_options.h> +#include <svtools/svtdllapi.h> +#include <tools/wintypes.hxx> +#include <vcl/customweld.hxx> +#include <vcl/image.hxx> +#include <memory> +#include <vector> + +class MouseEvent; +class TrackingEvent; +class HelpEvent; +class KeyEvent; +class DataChangedEvent; +class ScrollBar; +class UserDrawEvent; +class VirtualDevice; + +struct ValueSetItem; + +enum class DrawFrameStyle; + +/************************************************************************* + +Description +============ + +class ValueSet + +This class allows the selection of an item. In the process items are +drawn side by side. The selection of items can be more clear than in a +ListBox shape for example in case of colors or samples. +The amount of columns drawn by the control and whether the items +should be encircled can be specified. Optional a NoSelection or name +field could be shown. By default image and color items are supported. +Items could be drawn by oneself if InsertItem() is only called with +an ID. To achieve this the UserDraw handler needs to be overridden. The +description text could be specified afterwards in case of UserDraw +and any other items. + +Cross references + +class ListBox + +-------------------------------------------------------------------------- + +WinBits + +WB_RADIOSEL If set the selection will be drawn like an + RadioButton. This does only make sense if the image + is at least 8 pixel smaller on each side than the item + and also WB_DOUBLEBORDER is set and as color + COL_WINDOWWORKSPACE is specified. +WB_FLATVALUESET Flat Look (if you set WB_ITEMBORDER or WB_DOUBLEBORDER, + then you get extra border space, but the Borders + aren't painted), +WB_ITEMBORDER Items will be bordered +WB_DOUBLEBORDER Items will be bordered twice. Additionally WB_ITEMBORDER + has to be set, as otherwise this WinBit wouldn't have any + effect. It is needed if there are items with a white + background, since otherwise the 3D effect wouldn't be + recognizable. +WB_NAMEFIELD There is a namefield, where the name of an item will be + shown. +WB_NONEFIELD There is a NoSelection field which can be selected if + 0 is passed along with SelectItem. Respectively + GetSelectedItemId() returns 0 if this field or nothing + is selected. This field shows the text which is specified + by SetText() respectively no one, if no text was set. With + SetNoSelection() the selection can be disabled. +WB_VSCROLL A scrollbar will be always shown. The visible number of + lines have to be specified with SetLineCount() if this + flag is set. +WB_BORDER A border will be drawn around the window. +WB_NOPOINTERFOCUS The focus won't be gathered, if the control was pressed by + the mouse. +WB_TABSTOP It is possible to jump into the ValueSet with the tab key. +WB_NOTABSTOP It is not possible to jump into the ValueSet with the + tab key. +WB_NO_DIRECTSELECT Cursor travelling doesn't call select immediately. To + execute the selection <RETURN> has to be pressed. +-------------------------------------------------------------------------- + +The number of columns must be either set with SetColCount() or +SetItemWidth(). If the number of columns is specified by SetColCount() +the width of the items will be calculated by the visible range. +If the items should have a static width, it has to be specified +with SetItemWidth(). In this case the number of columns will be calculated +by the visible range. + +The number of rows is given by the number of items / number of columns. The +number of visible rows must either specified by SetLineCount() or +SetItemWidth(). If the number of visible rows is specified by SetLineCount(), +the height of the items will be calculated from the visible height. If the +items should have a fixed height it has to be specified with SetItemHeight(). +In this case the number of visible rows is then calculated from the visible +height. If the number of visible rows is neither specified by SetLineCount() +nor by SetItemHeight() all rows will be shown. The height of the items will +be calculated by the visible height. If the number of visible rows is +specified by SetLineCount() or SetItemHeight() ValueSet does scroll +automatically when more lines are available, as are visible. If scrolling +should be also possible with a ScrollBar WB_VSCROLL needs to be set. + +The distance between the items can be increased by SetExtraSpacing(). The +distance, which will be shown between two items (both in x and in y), is +measured in pixels. + +The exact window size for a specific item size can be calculated by +CalcWindowSizePixel(). To do this all relevant data (number of columns/...) +have to be specified and if no number of rows was set, all items need to +be inserted. If the window was created with WB_BORDER/Border=sal_True the +size has to be specified with SetOutputSizePixel(). In other cases different +size-methods can be used. With CalcItemSize() the inner and outer size of +an item could be calculated (for this the free space defined by +SetExtraSpacing() will not be included). + +The background color could be specified by SetColor(), with which the image +or UserDraw items will be underlaid. If no color is specified the color +of other windows (WindowColor) will be used for the background. + +-------------------------------------------------------------------------- + +At first all items should be inserted and only then Show() should be called +since the output area will be precomputed. If this is not done the first +Paint will appear a little bit slower. Therefore the Control, if it is loaded +from the resource and only supplied with items during runtime, should be +loaded with Hide = sal_True and then displayed with Show(). + +In case of a visible Control the creation of the new output area could be +activated before Paint by calling Format(). + +-------------------------------------------------------------------------- + +If Drag and Drop will be called from the ValueSet the Command-Handler has to +be overridden. From this StartDrag needs to be called. If this method returns +sal_True the drag-process could be initiated by ExecuteDrag(), otherwise no +processing will take place. This method makes sure that ValueSet stops its +processing and as appropriate selects the entry. Therefore the calling of +Select-Handler within this function must be expected. + +For dropping QueryDrop() and Drop() need to be overridden and ShowDropPos() +and HideDropPos() should be called within these methods. +To show the insertion point ShowDropPos() has to be called within the +QueryDrop-Handler. ShowDropPos() also scrolls the ValueSet if the passed +position is located at the window border. Furthermore ShowDropPos() returns +the position, at which the item should be inserted respectively which +insertion point was shown. If no insertion point was determined +VALUESET_ITEM_NOTFOUND will be returned. If the window was left during dragging +or the drag process is terminated HideDropPos() should be called in any case. + +-------------------------------------------------------------------------- + +This class is currently still in the SV-Tools. That's why the ValueSet needs +to be loaded as a Control out of the resource and the desired WinBits have +to be set (before Show) with SetStyle(). + +*************************************************************************/ + +typedef std::vector<std::unique_ptr<ValueSetItem>> ValueItemList; + +#define WB_ITEMBORDER (WinBits(0x00010000)) +#define WB_DOUBLEBORDER (WinBits(0x00020000)) +#define WB_NAMEFIELD (WinBits(0x00040000)) +#define WB_NONEFIELD (WinBits(0x00080000)) +#define WB_FLATVALUESET (WinBits(0x02000000)) +#define WB_NO_DIRECTSELECT (WinBits(0x04000000)) +#define WB_MENUSTYLEVALUESET (WinBits(0x08000000)) + +#define VALUESET_APPEND (size_t(-1)) +#define VALUESET_ITEM_NOTFOUND (size_t(-1)) + +class SVT_DLLPUBLIC ValueSet : public weld::CustomWidgetController +{ +private: + ScopedVclPtr<VirtualDevice> maVirDev; + css::uno::Reference<css::accessibility::XAccessible> mxAccessible; + ValueItemList mItemList; + std::unique_ptr<ValueSetItem> mpNoneItem; + std::unique_ptr<weld::ScrolledWindow> mxScrolledWindow; + tools::Rectangle maNoneItemRect; + tools::Rectangle maItemListRect; + long mnItemWidth; + long mnItemHeight; + long mnTextOffset; + long mnVisLines; + long mnLines; + long mnUserItemWidth; + long mnUserItemHeight; + sal_uInt16 mnSelItemId; + int mnSavedItemId; + sal_uInt16 mnHighItemId; + sal_uInt16 mnCols; + sal_uInt16 mnCurCol; + sal_uInt16 mnUserCols; + sal_uInt16 mnUserVisLines; + sal_uInt16 mnFirstLine; + sal_uInt16 mnSpacing; + DrawFrameStyle mnFrameStyle; + Color maColor; + OUString maText; + WinBits mnStyle; + Link<ValueSet*,void> maDoubleClickHdl; + Link<ValueSet*,void> maSelectHdl; + + bool mbFormat : 1; + bool mbHighlight : 1; + bool mbNoSelection : 1; + bool mbDrawSelection : 1; + bool mbBlackSel : 1; + bool mbDoubleSel : 1; + bool mbScroll : 1; + bool mbFullMode : 1; + bool mbEdgeBlending : 1; + bool mbHasVisibleItems : 1; + + friend class ValueItemAcc; + friend class ValueSetAcc; + + SVT_DLLPRIVATE void ImplDeleteItems(); + SVT_DLLPRIVATE void ImplFormatItem(vcl::RenderContext const & rRenderContext, ValueSetItem* pItem, tools::Rectangle aRect); + SVT_DLLPRIVATE void ImplDrawItemText(vcl::RenderContext& rRenderContext, const OUString& rStr); + SVT_DLLPRIVATE void ImplDrawSelect(vcl::RenderContext& rRenderContext, sal_uInt16 nItemId, const bool bFocus, const bool bDrawSel); + SVT_DLLPRIVATE void ImplDrawSelect(vcl::RenderContext& rRenderContext); + SVT_DLLPRIVATE void ImplHighlightItem(sal_uInt16 nItemId, bool bIsSelection = true); + SVT_DLLPRIVATE void ImplDraw(vcl::RenderContext& rRenderContext); + SVT_DLLPRIVATE size_t ImplGetItem( const Point& rPoint ) const; + SVT_DLLPRIVATE ValueSetItem* ImplGetItem( size_t nPos ); + SVT_DLLPRIVATE ValueSetItem* ImplGetFirstItem(); + SVT_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const; + SVT_DLLPRIVATE void ImplInsertItem( std::unique_ptr<ValueSetItem> pItem, const size_t nPos ); + SVT_DLLPRIVATE tools::Rectangle ImplGetItemRect( size_t nPos ) const; + SVT_DLLPRIVATE void ImplFireAccessibleEvent( short nEventId, const css::uno::Any& rOldValue, const css::uno::Any& rNewValue ); + SVT_DLLPRIVATE bool ImplHasAccessibleListeners(); + SVT_DLLPRIVATE void ImplTracking(const Point& rPos); + SVT_DLLPRIVATE void QueueReformat(); + SVT_DLLPRIVATE void SetFirstLine(sal_uInt16 nNewFirstLine); // set mnFirstLine and update scrollbar to match + SVT_DLLPRIVATE void RecalcScrollBar(); + SVT_DLLPRIVATE bool TurnOffScrollBar(); + SVT_DLLPRIVATE void TurnOnScrollBar(); + DECL_DLLPRIVATE_LINK(ImplScrollHdl, weld::ScrolledWindow&, void); + + Size GetLargestItemSize(); + + ValueSet (const ValueSet &) = delete; + ValueSet & operator= (const ValueSet &) = delete; + +protected: + virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() override; + weld::ScrolledWindow* GetScrollBar() const { return mxScrolledWindow.get(); } + +public: + ValueSet(std::unique_ptr<weld::ScrolledWindow> pScrolledWindow); + virtual ~ValueSet() override; + + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + + virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override; + virtual bool MouseButtonUp( const MouseEvent& rMEvt ) override; + virtual bool MouseMove( const MouseEvent& rMEvt ) override; + virtual bool KeyInput( const KeyEvent& rKEvt ) override; + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; + virtual void GetFocus() override; + virtual void LoseFocus() override; + virtual void Resize() override; + virtual void StyleUpdated() override; + virtual void Show() override; + virtual void Hide() override; + virtual OUString RequestHelp(tools::Rectangle& rHelpRect) override; + + virtual void Select(); + virtual void UserDraw( const UserDrawEvent& rUDEvt ); + + OUString const & GetText() const { return maText; } + void SetText(const OUString& rText) { maText = rText; } + void SetStyle(WinBits nStyle); + WinBits GetStyle() const { return mnStyle; } + + void SetOptimalSize(); + + /// Insert @rImage item. + void InsertItem(sal_uInt16 nItemId, const Image& rImage); + /// Insert @rImage item with @rStr as either a legend or tooltip depending on @bShowLegend. + void InsertItem(sal_uInt16 nItemId, const Image& rImage, + const OUString& rStr, size_t nPos = VALUESET_APPEND, bool bShowLegend = false); + /// Insert an @rColor item with @rStr tooltip. + void InsertItem(sal_uInt16 nItemId, const Color& rColor, + const OUString& rStr); + /// Insert an User Drawn item. + void InsertItem(sal_uInt16 nItemId, size_t nPos = VALUESET_APPEND); + /// Insert an User Drawn item with @rStr tooltip. + void InsertItem(sal_uInt16 nItemId, const OUString& rStr, size_t nPos); + void RemoveItem(sal_uInt16 nItemId); + + void Clear(); + + size_t GetItemCount() const; + size_t GetItemPos( sal_uInt16 nItemId ) const; + sal_uInt16 GetItemId( size_t nPos ) const; + sal_uInt16 GetItemId( const Point& rPos ) const; + tools::Rectangle GetItemRect( sal_uInt16 nItemId ) const; + void EnableFullItemMode( bool bFullMode ); + + void SetColCount( sal_uInt16 nNewCols = 1 ); + sal_uInt16 GetColCount() const + { + return mnUserCols; + } + void SetLineCount( sal_uInt16 nNewLines = 0 ); + sal_uInt16 GetLineCount() const + { + return mnUserVisLines; + } + void SetItemWidth( long nItemWidth ); + void SetItemHeight( long nLineHeight ); + + void SelectItem( sal_uInt16 nItemId ); + sal_uInt16 GetSelectedItemId() const + { + return mnSelItemId; + } + size_t GetSelectItemPos() const + { + return GetItemPos( mnSelItemId ); + } + bool IsItemSelected( sal_uInt16 nItemId ) const + { + return !mbNoSelection && (nItemId == mnSelItemId); + } + void SetNoSelection(); + bool IsNoSelection() const + { + return mbNoSelection; + } + + void RecalculateItemSizes(); + + void SetItemImage( sal_uInt16 nItemId, const Image& rImage ); + Image GetItemImage( sal_uInt16 nItemId ) const; + void SetItemColor( sal_uInt16 nItemId, const Color& rColor ); + Color GetItemColor( sal_uInt16 nItemId ) const; + void SetItemData( sal_uInt16 nItemId, void* pData ); + void* GetItemData( sal_uInt16 nItemId ) const; + void SetItemText( sal_uInt16 nItemId, const OUString& rStr ); + OUString GetItemText( sal_uInt16 nItemId ) const; + void SetColor( const Color& rColor ); + void SetColor() + { + SetColor(COL_TRANSPARENT); + } + bool IsColor() const + { + return maColor.GetTransparency() == 0; + } + + void SetExtraSpacing( sal_uInt16 nNewSpacing ); + + void Format(vcl::RenderContext const & rRenderContext); + void SetFormat(); + + Size CalcWindowSizePixel(const Size& rItemSize, + sal_uInt16 nCalcCols = 0, + sal_uInt16 nCalcLines = 0) const; + Size CalcItemSizePixel(const Size& rSize) const; + int GetScrollWidth() const; + + void SetSelectHdl(const Link<ValueSet*,void>& rLink) + { + maSelectHdl = rLink; + } + + void SetDoubleClickHdl(const Link<ValueSet*,void>& rLink) + { + maDoubleClickHdl = rLink; + } + + bool GetEdgeBlending() const + { + return mbEdgeBlending; + } + void SetEdgeBlending(bool bNew); + + void SaveValue() + { + mnSavedItemId = IsNoSelection() ? -1 : GetSelectedItemId(); + } + + bool IsValueChangedFromSaved() const + { + int nItemId = IsNoSelection() ? -1 : GetSelectedItemId(); + return mnSavedItemId != nItemId; + } +}; + + +#endif // INCLUDED_SVTOOLS_VALUESET_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |