summaryrefslogtreecommitdiff
path: root/include/svtools
diff options
context:
space:
mode:
Diffstat (limited to 'include/svtools')
-rw-r--r--include/svtools/AccessibleBrowseBoxObjType.hxx52
-rw-r--r--include/svtools/DocumentInfoPreview.hxx73
-rw-r--r--include/svtools/DocumentToGraphicRenderer.hxx62
-rw-r--r--include/svtools/GraphicExportOptionsDialog.hxx78
-rw-r--r--include/svtools/PlaceEditDialog.hxx92
-rw-r--r--include/svtools/QueryFolderName.hxx57
-rw-r--r--include/svtools/ServerDetailsControls.hxx148
-rw-r--r--include/svtools/acceleratorexecute.hxx246
-rw-r--r--include/svtools/accessibilityoptions.hxx72
-rw-r--r--include/svtools/accessiblefactory.hxx184
-rw-r--r--include/svtools/accessibletable.hxx203
-rw-r--r--include/svtools/accessibletableprovider.hxx241
-rw-r--r--include/svtools/addresstemplate.hxx144
-rw-r--r--include/svtools/apearcfg.hxx97
-rw-r--r--include/svtools/asynclink.hxx66
-rw-r--r--include/svtools/bindablecontrolhelper.hxx52
-rw-r--r--include/svtools/borderhelper.hxx47
-rw-r--r--include/svtools/brwbox.hxx831
-rw-r--r--include/svtools/brwhead.hxx46
-rw-r--r--include/svtools/calendar.hxx451
-rw-r--r--include/svtools/cliplistener.hxx54
-rw-r--r--include/svtools/collatorres.hxx42
-rw-r--r--include/svtools/colorcfg.hxx138
-rw-r--r--include/svtools/colrdlg.hxx60
-rw-r--r--include/svtools/contextmenuhelper.hxx116
-rw-r--r--include/svtools/controldims.hrc93
-rw-r--r--include/svtools/ctrlbox.hxx552
-rw-r--r--include/svtools/ctrltool.hxx241
-rw-r--r--include/svtools/dialogclosedlistener.hxx69
-rw-r--r--include/svtools/dialogcontrolling.hxx293
-rw-r--r--include/svtools/editbrowsebox.hxx685
-rw-r--r--include/svtools/editimplementation.hxx144
-rw-r--r--include/svtools/editsyntaxhighlighter.hxx56
-rw-r--r--include/svtools/ehdl.hxx77
-rw-r--r--include/svtools/embedhlp.hxx124
-rw-r--r--include/svtools/embedtransfer.hxx57
-rw-r--r--include/svtools/extcolorcfg.hxx111
-rw-r--r--include/svtools/extensionlistbox.hxx98
-rw-r--r--include/svtools/filechangedchecker.hxx54
-rw-r--r--include/svtools/filectrl.hxx96
-rw-r--r--include/svtools/filedlg2.hrc23
-rw-r--r--include/svtools/fileurlbox.hxx68
-rw-r--r--include/svtools/fileview.hxx258
-rw-r--r--include/svtools/fmtfield.hxx319
-rw-r--r--include/svtools/fontsubstconfig.hxx61
-rw-r--r--include/svtools/framestatuslistener.hxx101
-rw-r--r--include/svtools/generictoolboxcontroller.hxx61
-rw-r--r--include/svtools/genericunodialog.hxx185
-rw-r--r--include/svtools/grfmgr.hxx624
-rw-r--r--include/svtools/headbar.hxx377
-rw-r--r--include/svtools/helpid.hrc97
-rw-r--r--include/svtools/helpopt.hxx65
-rw-r--r--include/svtools/htmlcfg.hxx94
-rw-r--r--include/svtools/htmlkywd.hxx796
-rw-r--r--include/svtools/htmlout.hxx118
-rw-r--r--include/svtools/htmltokn.h561
-rw-r--r--include/svtools/hyperlabel.hxx87
-rw-r--r--include/svtools/imagemgr.hrc147
-rw-r--r--include/svtools/imagemgr.hxx79
-rw-r--r--include/svtools/imageresourceaccess.hxx81
-rw-r--r--include/svtools/imap.hxx151
-rw-r--r--include/svtools/imapcirc.hxx75
-rw-r--r--include/svtools/imapobj.hxx145
-rw-r--r--include/svtools/imappoly.hxx81
-rw-r--r--include/svtools/imaprect.hxx73
-rw-r--r--include/svtools/imgdef.hxx36
-rw-r--r--include/svtools/indexentryres.hxx42
-rw-r--r--include/svtools/inetimg.hxx78
-rw-r--r--include/svtools/inettbc.hxx97
-rw-r--r--include/svtools/insdlg.hxx79
-rw-r--r--include/svtools/itemdel.hxx30
-rw-r--r--include/svtools/ivctrl.hxx353
-rw-r--r--include/svtools/javacontext.hxx82
-rw-r--r--include/svtools/javainteractionhandler.hxx75
-rw-r--r--include/svtools/langhelp.hxx30
-rw-r--r--include/svtools/langtab.hxx57
-rw-r--r--include/svtools/localresaccess.hxx75
-rw-r--r--include/svtools/menuoptions.hxx128
-rw-r--r--include/svtools/miscopt.hxx150
-rw-r--r--include/svtools/optionsdrawinglayer.hxx198
-rw-r--r--include/svtools/parhtml.hxx289
-rw-r--r--include/svtools/parrtf.hxx85
-rw-r--r--include/svtools/place.hxx42
-rw-r--r--include/svtools/popupmenucontrollerbase.hxx131
-rw-r--r--include/svtools/popupwindowcontroller.hxx79
-rw-r--r--include/svtools/printoptions.hxx120
-rw-r--r--include/svtools/prnsetup.hxx93
-rw-r--r--include/svtools/restartdialog.hxx47
-rw-r--r--include/svtools/roadmap.hxx123
-rw-r--r--include/svtools/roadmapwizard.hxx246
-rw-r--r--include/svtools/rtfkeywd.hxx1212
-rw-r--r--include/svtools/rtfout.hxx58
-rw-r--r--include/svtools/rtftoken.h1265
-rw-r--r--include/svtools/ruler.hxx802
-rw-r--r--include/svtools/sampletext.hxx49
-rw-r--r--include/svtools/scriptedtext.hxx95
-rw-r--r--include/svtools/scrwin.hxx93
-rw-r--r--include/svtools/sfxecode.hxx113
-rw-r--r--include/svtools/slidesorterbaropt.hxx98
-rw-r--r--include/svtools/soerr.hxx74
-rw-r--r--include/svtools/sores.hxx103
-rw-r--r--include/svtools/statusbarcontroller.hxx141
-rw-r--r--include/svtools/stdctrl.hxx41
-rw-r--r--include/svtools/stdmenu.hxx161
-rw-r--r--include/svtools/stringtransfer.hxx76
-rw-r--r--include/svtools/svlbitm.hxx257
-rw-r--r--include/svtools/svmedit.hxx45
-rw-r--r--include/svtools/svmedit2.hxx46
-rw-r--r--include/svtools/svparser.hxx278
-rw-r--r--include/svtools/svtabbx.hxx255
-rw-r--r--include/svtools/svtdllapi.h34
-rw-r--r--include/svtools/svtools.hrc324
-rw-r--r--include/svtools/svtresid.hxx38
-rw-r--r--include/svtools/svxbox.hxx178
-rw-r--r--include/svtools/tabbar.hxx557
-rw-r--r--include/svtools/table/defaultinputhandler.hxx65
-rw-r--r--include/svtools/table/gridtablerenderer.hxx121
-rw-r--r--include/svtools/table/tablecontrol.hxx218
-rw-r--r--include/svtools/table/tablecontrolinterface.hxx257
-rw-r--r--include/svtools/table/tableinputhandler.hxx73
-rw-r--r--include/svtools/table/tablemodel.hxx539
-rw-r--r--include/svtools/table/tablerenderer.hxx285
-rw-r--r--include/svtools/table/tablesort.hxx89
-rw-r--r--include/svtools/table/tabletypes.hxx64
-rw-r--r--include/svtools/templatefoldercache.hxx102
-rw-r--r--include/svtools/templdlg.hxx81
-rw-r--r--include/svtools/textwindowpeer.hxx65
-rw-r--r--include/svtools/toolbarmenu.hxx140
-rw-r--r--include/svtools/toolboxcontroller.hxx162
-rw-r--r--include/svtools/toolpanel/decklayouter.hxx99
-rw-r--r--include/svtools/toolpanel/drawerlayouter.hxx97
-rw-r--r--include/svtools/toolpanel/paneltabbar.hxx96
-rw-r--r--include/svtools/toolpanel/refbase.hxx75
-rw-r--r--include/svtools/toolpanel/tabalignment.hxx42
-rw-r--r--include/svtools/toolpanel/tabitemcontent.hxx43
-rw-r--r--include/svtools/toolpanel/tablayouter.hxx99
-rw-r--r--include/svtools/toolpanel/toolpanel.hxx138
-rw-r--r--include/svtools/toolpanel/toolpaneldeck.hxx194
-rw-r--r--include/svtools/toolpanelopt.hxx99
-rw-r--r--include/svtools/transfer.hxx521
-rw-r--r--include/svtools/treelist.hxx366
-rw-r--r--include/svtools/treelistbox.hxx806
-rwxr-xr-xinclude/svtools/treelistentries.hxx20
-rw-r--r--include/svtools/treelistentry.hxx104
-rw-r--r--include/svtools/unitconv.hxx54
-rw-r--r--include/svtools/unoevent.hxx320
-rw-r--r--include/svtools/unoimap.hxx39
-rw-r--r--include/svtools/urlcontrol.hxx53
-rw-r--r--include/svtools/valueset.hxx391
-rw-r--r--include/svtools/viewdataentry.hxx81
-rw-r--r--include/svtools/wizardmachine.hxx385
-rw-r--r--include/svtools/wizdlg.hxx301
-rw-r--r--include/svtools/xwindowitem.hxx58
153 files changed, 27029 insertions, 0 deletions
diff --git a/include/svtools/AccessibleBrowseBoxObjType.hxx b/include/svtools/AccessibleBrowseBoxObjType.hxx
new file mode 100644
index 000000000000..6334cb82aac1
--- /dev/null
+++ b/include/svtools/AccessibleBrowseBoxObjType.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 _SVTOOLS_ACCESSIBLEBROWSEBOXOBJTYPE_HXX
+#define _SVTOOLS_ACCESSIBLEBROWSEBOXOBJTYPE_HXX
+
+// ============================================================================
+
+namespace svt {
+
+// ============================================================================
+
+/** This enumeration contains a constant for each kind of accessible object of
+ a BrowseBox. */
+enum AccessibleBrowseBoxObjType
+{
+ BBTYPE_BROWSEBOX, /// The BrowseBox itself.
+ BBTYPE_TABLE, /// The data table.
+ BBTYPE_ROWHEADERBAR, /// The row header bar ("handle column").
+ BBTYPE_COLUMNHEADERBAR, /// The horizontal column header bar.
+ BBTYPE_TABLECELL, /// A cell of the data table.
+ BBTYPE_ROWHEADERCELL, /// A cell of the row header bar.
+ BBTYPE_COLUMNHEADERCELL, /// A cell of the column header bar.
+ BBTYPE_CHECKBOXCELL /// A cell with a checkbox.
+};
+
+// ============================================================================
+
+} // namespace svt
+
+// ============================================================================
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/DocumentInfoPreview.hxx b/include/svtools/DocumentInfoPreview.hxx
new file mode 100644
index 000000000000..167de92636de
--- /dev/null
+++ b/include/svtools/DocumentInfoPreview.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 SVTOOLS_DOCUMENTINFOPREVIEW_HXX
+#define SVTOOLS_DOCUMENTINFOPREVIEW_HXX
+
+#include "sal/config.h"
+
+#include "boost/scoped_ptr.hpp"
+#include "i18nlangtag/languagetag.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "svtools/svmedit2.hxx"
+#include "svtools/svtdllapi.h"
+#include "tools/wintypes.hxx"
+#include "vcl/window.hxx"
+
+class SvtDocInfoTable_Impl;
+
+namespace com { namespace sun { namespace star {
+ namespace document { class XDocumentProperties; }
+ namespace util { struct DateTime; }
+} } }
+
+namespace svtools {
+
+class SVT_DLLPUBLIC ODocumentInfoPreview: public Window {
+public:
+ ODocumentInfoPreview(Window * pParent, WinBits nBits);
+
+ virtual ~ODocumentInfoPreview();
+
+ virtual void Resize();
+
+ void clear();
+
+ void fill(
+ com::sun::star::uno::Reference<
+ com::sun::star::document::XDocumentProperties > const & xDocProps,
+ OUString const & rURL);
+
+private:
+ ExtMultiLineEdit m_pEditWin;
+ boost::scoped_ptr< SvtDocInfoTable_Impl > m_pInfoTable;
+ LanguageTag m_aLanguageTag;
+
+ void insertEntry(OUString const & title, OUString const & value);
+
+ void insertNonempty(long id, OUString const & value);
+
+ void insertDateTime(long id, com::sun::star::util::DateTime const & value);
+};
+
+}
+
+#endif // 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 000000000000..3033e6473129
--- /dev/null
+++ b/include/svtools/DocumentToGraphicRenderer.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/.
+ *
+ * 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 _DOCUMENTTOGRAPHICRENDERER_HXX_
+#define _DOCUMENTTOGRAPHICRENDERER_HXX_
+
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/view/XRenderable.hpp>
+#include <com/sun/star/awt/XToolkit.hpp>
+
+#include <vcl/graph.hxx>
+
+#include "svtools/svtdllapi.h"
+
+using namespace css;
+using namespace css::uno;
+using namespace css::lang;
+using namespace css::beans;
+
+class SVT_DLLPUBLIC DocumentToGraphicRenderer
+{
+ const Reference<XComponent>& mxDocument;
+
+ Reference<frame::XModel> mxModel;
+ Reference<frame::XController> mxController;
+ Reference<view::XRenderable> mxRenderable;
+ Reference<awt::XToolkit> mxToolkit;
+
+public:
+ DocumentToGraphicRenderer(const Reference<XComponent>& xDocument);
+ ~DocumentToGraphicRenderer();
+
+ sal_Int32 getCurrentPageWriter( );
+
+ Size getDocumentSizeInPixels( sal_Int32 aCurrentPage );
+
+ Size getDocumentSizeIn100mm( sal_Int32 aCurrentPage );
+
+ Graphic renderToGraphic(sal_Int32 aCurrentPage, Size aDocumentSizePixel, Size aTargetSizePixel);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/GraphicExportOptionsDialog.hxx b/include/svtools/GraphicExportOptionsDialog.hxx
new file mode 100644
index 000000000000..b346f8c25671
--- /dev/null
+++ b/include/svtools/GraphicExportOptionsDialog.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 _GRAPHICEXPORTOPTIONSDIALOG_HXX_
+#define _GRAPHICEXPORTOPTIONSDIALOG_HXX_
+
+#include <vcl/fltcall.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include <vcl/layout.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/scrbar.hxx>
+
+#include <svtools/DocumentToGraphicRenderer.hxx>
+
+#include "svtools/svtdllapi.h"
+
+using namespace css;
+using namespace css::uno;
+using namespace css::lang;
+using namespace css::frame;
+using namespace css::beans;
+
+class SVT_DLLPUBLIC GraphicExportOptionsDialog : public ModalDialog
+{
+private:
+ NumericField* mpWidth;
+ NumericField* mpHeight;
+ ComboBox* mpResolution;
+
+ Size mSize100mm;
+ double mResolution;
+
+ DocumentToGraphicRenderer mRenderer;
+
+ sal_Int32 mCurrentPage;
+
+ void initialize();
+ void updateWidth();
+ void updateHeight();
+ void updateResolution();
+
+ double getViewWidthInch();
+ double getViewHeightInch();
+
+ DECL_LINK( widthModifiedHandle, void* );
+ DECL_LINK( heightModifiedHandle, void* );
+ DECL_LINK( resolutionModifiedHandle, void* );
+
+public:
+ GraphicExportOptionsDialog( Window* pWindow, const Reference<XComponent>& rxSourceDocument );
+ ~GraphicExportOptionsDialog();
+
+ Sequence<PropertyValue> getFilterData();
+};
+
+#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 000000000000..d529442cd738
--- /dev/null
+++ b/include/svtools/PlaceEditDialog.hxx
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2012 Julien Levesy <jlevesy@gmail.com> (initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef _PLACEEDITDIALOG_HXX
+#define _PLACEEDITDIALOG_HXX
+
+#include "ServerDetailsControls.hxx"
+
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/lstbox.hxx>
+
+#include <svtools/inettbc.hxx>
+#include <svtools/place.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <vector>
+
+class SVT_DLLPUBLIC PlaceEditDialog : public ModalDialog
+{
+private :
+
+ Edit* m_pEDServerName;
+ ListBox* m_pLBServerType;
+ boost::shared_ptr< DetailsContainer > m_pCurrentDetails;
+
+ Edit* m_pEDUsername;
+ OKButton* m_pBTOk;
+ CancelButton* m_pBTCancel;
+
+ PushButton* m_pBTDelete;
+
+ /** 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< boost::shared_ptr< DetailsContainer > > m_aDetailsContainers;
+
+public :
+
+ PlaceEditDialog( Window* pParent);
+ PlaceEditDialog(Window* pParent, const boost::shared_ptr<Place> &pPlace );
+ ~PlaceEditDialog();
+
+ // Returns a place instance with given information
+ boost::shared_ptr<Place> GetPlace();
+
+ OUString GetServerName() { return m_pEDServerName->GetText(); }
+ OUString GetServerUrl();
+
+private:
+
+ void InitDetails( );
+
+ DECL_LINK ( OKHdl, Button * );
+ DECL_LINK ( DelHdl, Button * );
+ DECL_LINK ( EditHdl, void * );
+ DECL_LINK ( SelectTypeHdl, void * );
+ DECL_LINK ( EditUsernameHdl, void * );
+
+};
+
+#endif //_PLACEEDITDIALOG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/QueryFolderName.hxx b/include/svtools/QueryFolderName.hxx
new file mode 100644
index 000000000000..b3ff30d24b81
--- /dev/null
+++ b/include/svtools/QueryFolderName.hxx
@@ -0,0 +1,57 @@
+/* -*- 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 SVT_QUERYFOLDER_HXX
+#define SVT_QUERYFOLDER_HXX
+
+#include <vcl/fixed.hxx>
+#include <vcl/button.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/dialog.hxx>
+
+//-------------------------------------------------------------------------
+namespace svtools {
+
+//-------------------------------------------------------------------------
+// QueryFolderNameDialog
+//-------------------------------------------------------------------------
+
+class QueryFolderNameDialog : public ModalDialog
+{
+private:
+ FixedText aNameText;
+ Edit aNameEdit;
+ FixedLine aNameLine;
+ OKButton aOKBtn;
+ CancelButton aCancelBtn;
+
+ DECL_LINK( OKHdl, void * );
+ DECL_LINK( NameHdl, void * );
+
+public:
+ QueryFolderNameDialog( Window* _pParent,
+ const String& rTitle,
+ const String& rDefaultText,
+ String* pGroupName = NULL );
+ String GetName() const { return aNameEdit.GetText(); }
+};
+
+}
+#endif // SVT_QUERYFOLDER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx
new file mode 100644
index 000000000000..f75b8aa87e2a
--- /dev/null
+++ b/include/svtools/ServerDetailsControls.hxx
@@ -0,0 +1,148 @@
+/* -*- 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:
+ *
+ */
+#ifndef _SERVERDETAILSCONTROLS_HXX
+#define _SERVERDETAILSCONTROLS_HXX
+
+#include <map>
+
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+
+#include <tools/urlobj.hxx>
+#include <vcl/builder.hxx>
+#include <vcl/button.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/field.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/layout.hxx>
+
+class DetailsContainer
+{
+ private:
+ Link m_aChangeHdl;
+ VclFrame* m_pFrame;
+
+ public:
+ DetailsContainer( VclBuilderContainer* pBuilder, const OString& rFrame );
+ virtual ~DetailsContainer( );
+
+ void setChangeHdl( const Link& rLink ) { m_aChangeHdl = rLink; }
+
+ virtual void show( bool bShow = true );
+ virtual INetURLObject getUrl( );
+
+ /** Try to split the URL in the controls of that container.
+
+ \param sUrl the URL to split
+ \return true if the split worked, false otherwise.
+ */
+ virtual bool setUrl( const INetURLObject& rUrl );
+
+ virtual void setUsername( const OUString& /*rUsername*/ ) { };
+
+ protected:
+ void notifyChange( );
+ DECL_LINK ( ValueChangeHdl, void * );
+};
+
+class HostDetailsContainer : public DetailsContainer
+{
+ private:
+ sal_uInt16 m_nDefaultPort;
+ OUString m_sScheme;
+
+ protected:
+ Edit* m_pEDHost;
+ NumericField* m_pEDPort;
+ Edit* m_pEDPath;
+
+ public:
+ HostDetailsContainer( VclBuilderContainer* pBuilder, sal_uInt16 nPort, OUString sScheme );
+ virtual ~HostDetailsContainer( ) { };
+
+ virtual void show( bool bShow = true );
+ virtual INetURLObject getUrl( );
+ virtual bool setUrl( const INetURLObject& rUrl );
+
+ protected:
+ void setScheme( OUString sScheme ) { m_sScheme = sScheme; }
+
+ /** Verifies that the schement split from the URL can be handled by
+ the container and set the proper controls accordingly if needed.
+ */
+ virtual bool verifyScheme( const OUString& rScheme );
+};
+
+class DavDetailsContainer : public HostDetailsContainer
+{
+ private:
+ CheckBox* m_pCBDavs;
+
+ public:
+ DavDetailsContainer( VclBuilderContainer* pBuilder );
+ ~DavDetailsContainer( ) { };
+
+ virtual void show( bool bShow = true );
+
+ protected:
+ virtual bool verifyScheme( const OUString& rScheme );
+
+ private:
+ DECL_LINK ( ToggledDavsHdl, CheckBox * pCheckBox );
+};
+
+class SmbDetailsContainer : public DetailsContainer
+{
+ private:
+ Edit* m_pEDHost;
+ Edit* m_pEDShare;
+ Edit* m_pEDPath;
+
+ public:
+ SmbDetailsContainer( VclBuilderContainer* pBuilder );
+ ~SmbDetailsContainer( ) { };
+
+ virtual INetURLObject getUrl( );
+ virtual bool setUrl( const INetURLObject& rUrl );
+};
+
+class CmisDetailsContainer : public DetailsContainer
+{
+ private:
+ OUString m_sUsername;
+ com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv;
+ std::vector< OUString > m_aServerTypesURLs;
+ std::vector< OUString > m_aRepoIds;
+ OUString m_sRepoId;
+
+ Edit* m_pEDBinding;
+ ListBox* m_pLBRepository;
+ Button* m_pBTRepoRefresh;
+ ListBox* m_pLBServerType;
+ Edit* m_pEDPath;
+
+ public:
+ CmisDetailsContainer( VclBuilderContainer* pBuilder );
+ ~CmisDetailsContainer( ) { };
+
+ virtual INetURLObject getUrl( );
+ virtual bool setUrl( const INetURLObject& rUrl );
+ virtual void setUsername( const OUString& rUsername );
+
+ private:
+ void selectRepository( );
+ DECL_LINK ( SelectServerTypeHdl, void * );
+ DECL_LINK ( RefreshReposHdl, void * );
+ DECL_LINK ( SelectRepoHdl, void * );
+};
+
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/acceleratorexecute.hxx b/include/svtools/acceleratorexecute.hxx
new file mode 100644
index 000000000000..0b3b473449b7
--- /dev/null
+++ b/include/svtools/acceleratorexecute.hxx
@@ -0,0 +1,246 @@
+/* -*- 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 <vector>
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/util/URL.hpp>
+#include <com/sun/star/awt/KeyEvent.hpp>
+#include <vcl/keycod.hxx>
+#include <vcl/evntpost.hxx>
+#include <osl/mutex.h>
+
+
+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 exceution of an accelerator command can be dangerous
+ (in case it force an office shutdown for key "ALT+F4"!)
+ all internal dispatches are done asynchronous.
+ Menas that the trigger call doesnt 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 : private TMutexInit
+{
+ //-------------------------------------------
+ // const, types
+ private:
+
+ /** @deprecated
+ replaced by internal class AsyncAccelExec ...
+ remove this resource here if we go forwards to next major */
+ typedef ::std::vector< ::std::pair< css::util::URL, css::uno::Reference< css::frame::XDispatch > > > TCommandQueue;
+
+ //-------------------------------------------
+ // 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;
+
+ /** @deprecated
+ replaced by internal class AsyncAccelExec ...
+ remove this resource here if we go forwards to next major */
+ TCommandQueue m_lCommandQueue;
+
+ /** @deprecated
+ replaced by internal class AsyncAccelExec ...
+ remove this resource here if we go forwards to next major */
+ ::vcl::EventPoster m_aAsyncCallback;
+
+ //-------------------------------------------
+ // 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 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 then once ...
+ but at least its should be used one times only.
+ Otherwhise 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 an 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.
+ */
+ virtual 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 configuartions 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 [sal_Bool]
+ sal_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 its done asynchronous!
+ */
+ virtual sal_Bool execute(const KeyCode& aKey);
+ virtual sal_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 ::com::sun::star::awt::KeyEvent& aKey);
+ //---------------------------------------
+ /** TODO document me */
+ static css::awt::KeyEvent st_VCLKey2AWTKey(const KeyCode& aKey);
+ static KeyCode st_AWTKey2VCLKey(const css::awt::KeyEvent& aKey);
+
+ //---------------------------------------
+ /** TODO document me */
+ static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openGlobalConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext);
+
+ //---------------------------------------
+ /** 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);
+ void operator=(const AcceleratorExecute&) {};
+ //---------------------------------------
+ /** 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();
+
+ //---------------------------------------
+ /** @deprecated
+ replaced by internal class AsyncAccelExec ...
+ remove this resource here if we go forwards to next major */
+ DECL_DLLPRIVATE_LINK(impl_ts_asyncCallback, void*);
+};
+
+} // 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 000000000000..4c168143aff9
--- /dev/null
+++ b/include/svtools/accessibilityoptions.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_ACCESSIBILITYOPTIONS_HXX
+#define INCLUDED_SVTOOLS_ACCESSIBILITYOPTIONS_HXX
+
+#include "svtools/svtdllapi.h"
+#include <unotools/configitem.hxx>
+#include <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
+#include <unotools/options.hxx>
+
+class SvtAccessibilityOptions_Impl;
+
+class SVT_DLLPUBLIC SvtAccessibilityOptions:
+ public utl::detail::Options, private SfxListener
+{
+private:
+ static SvtAccessibilityOptions_Impl* sm_pSingleImplConfig;
+ static sal_Int32 sm_nAccessibilityRefCount;
+
+public:
+ SvtAccessibilityOptions();
+ virtual ~SvtAccessibilityOptions();
+
+ // get & set config entries
+ sal_Bool GetIsForPagePreviews() const;
+ sal_Bool GetIsHelpTipsDisappear() const;
+ sal_Bool GetIsAllowAnimatedGraphics() const;
+ sal_Bool GetIsAllowAnimatedText() const;
+ sal_Bool GetIsAutomaticFontColor() const;
+ sal_Bool GetIsSystemFont() const;
+ sal_Int16 GetHelpTipSeconds() const;
+ sal_Bool IsSelectionInReadonly() const;
+ sal_Bool GetAutoDetectSystemHC() const;
+
+ void SetIsForPagePreviews(sal_Bool bSet);
+ void SetIsHelpTipsDisappear(sal_Bool bSet);
+ void SetIsAllowAnimatedGraphics(sal_Bool bSet);
+ void SetIsAllowAnimatedText(sal_Bool bSet);
+ void SetIsAutomaticFontColor(sal_Bool bSet);
+ void SetIsSystemFont(sal_Bool bSet);
+ void SetHelpTipSeconds(sal_Int16 nSet);
+ void SetSelectionInReadonly(sal_Bool bSet);
+ void SetAutoDetectSystemHC(sal_Bool bSet);
+
+ sal_Bool IsModified() const;
+ void Commit();
+
+ //SfxListener:
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+ void SetVCLSettings();
+};
+
+#endif // #ifndef INCLUDED_SVTOOLS_ACCESSIBILITYOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/accessiblefactory.hxx b/include/svtools/accessiblefactory.hxx
new file mode 100644
index 000000000000..d30af055c91d
--- /dev/null
+++ b/include/svtools/accessiblefactory.hxx
@@ -0,0 +1,184 @@
+/* -*- 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_ACCESSIBLE_FACTORY_HXX
+#define SVTOOLS_ACCESSIBLE_FACTORY_HXX
+
+#include "AccessibleBrowseBoxObjType.hxx"
+#include "accessibletableprovider.hxx"
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <rtl/ref.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace accessibility {
+ class XAccessible;
+ class XAccessibleContext;
+ }
+ namespace awt {
+ class XWindow;
+ }
+} } }
+class SvHeaderTabListBox;
+class SvtIconChoiceCtrl;
+class TabBar;
+class SvTreeListBox;
+class VCLXWindow;
+class TextEngine;
+class TextView;
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ class ToolPanelDeck;
+ class IToolPanelDeck;
+ class PanelTabBar;
+ namespace table
+ {
+ class IAccessibleTable;
+ class IAccessibleTableControl;
+ }
+
+ /** a function which is able to create a factory for the standard Accessible/Context
+ components needed for standard toolkit controls
+
+ The returned pointer denotes an instance of the IAccessibleFactory, which has been acquired
+ <em>once</em>. The caller is responsible for holding this reference as long as it needs the
+ factory, and release it afterwards.
+ */
+ typedef void* (SAL_CALL * GetSvtAccessibilityComponentFactory)( );
+
+ //================================================================
+ //= IAccessibleFactory
+ //================================================================
+ class IAccessibleFactory : public ::rtl::IReference
+ {
+ public:
+ virtual IAccessibleTabListBox*
+ createAccessibleTabListBox(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent,
+ SvHeaderTabListBox& rBox
+ ) const = 0;
+
+ virtual IAccessibleBrowseBox*
+ createAccessibleBrowseBox(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
+ IAccessibleTableProvider& _rBrowseBox
+ ) const = 0;
+ virtual table::IAccessibleTableControl*
+ createAccessibleTableControl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
+ table::IAccessibleTable& _rTable
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleIconChoiceCtrl(
+ SvtIconChoiceCtrl& _rIconCtrl,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _xParent
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleTabBar(
+ TabBar& _rTabBar
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleTextWindowContext(
+ VCLXWindow* pVclXWindow, TextEngine& rEngine, TextView& rView, bool bCompoundControlChild
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleTreeListBox(
+ SvTreeListBox& _rListBox,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _xParent
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleBrowseBoxHeaderBar(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent,
+ IAccessibleTableProvider& _rOwningTable,
+ AccessibleBrowseBoxObjType _eObjType
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleBrowseBoxTableCell(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
+ IAccessibleTableProvider& _rBrowseBox,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xFocusWindow,
+ sal_Int32 _nRowId,
+ sal_uInt16 _nColId,
+ sal_Int32 _nOffset
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleBrowseBoxHeaderCell(
+ sal_Int32 _nColumnRowId,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent,
+ IAccessibleTableProvider& _rBrowseBox,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xFocusWindow,
+ AccessibleBrowseBoxObjType _eObjType
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createAccessibleCheckBoxCell(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
+ IAccessibleTableProvider& _rBrowseBox,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xFocusWindow,
+ sal_Int32 _nRowPos,
+ sal_uInt16 _nColPos,
+ const TriState& _eState,
+ sal_Bool _bIsTriState
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ createEditBrowseBoxTableCellAccess(
+ const ::com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible >& _rxParent,
+ const ::com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible >& _rxControlAccessible,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _rxFocusWindow,
+ IAccessibleTableProvider& _rBrowseBox,
+ sal_Int32 _nRowPos,
+ sal_uInt16 _nColPos
+ ) const = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleToolPanelDeck(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent,
+ ::svt::ToolPanelDeck& i_rPanelDeck
+ ) = 0;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
+ createAccessibleToolPanelTabBar(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent,
+ ::svt::IToolPanelDeck& i_rPanelDeck,
+ ::svt::PanelTabBar& i_rTabBar
+ ) = 0;
+
+ protected:
+ ~IAccessibleFactory() {}
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVTOOLS_ACCESSIBLE_FACTORY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/accessibletable.hxx b/include/svtools/accessibletable.hxx
new file mode 100644
index 000000000000..7b314df4f4bf
--- /dev/null
+++ b/include/svtools/accessibletable.hxx
@@ -0,0 +1,203 @@
+/* -*- 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_ACCESSIBLETABLE_HXX
+#define _SVTOOLS_ACCESSIBLETABLE_HXX
+
+#include <vcl/window.hxx>
+#include <unotools/accessiblestatesethelper.hxx>
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+
+
+namespace svt{ namespace table
+{
+
+typedef sal_Int32 RowPos;
+
+
+enum AccessibleTableType
+{
+ /** Child index of the column header bar (first row). */
+ TCINDEX_COLUMNHEADERBAR = 0,
+ /** Child index of the row header bar ("handle column"). */
+ TCINDEX_ROWHEADERBAR = 1,
+ /** Child index of the data table. */
+ TCINDEX_TABLE = 2
+};
+
+enum AccessibleTableControlObjType
+{
+ TCTYPE_GRIDCONTROL, /// The GridControl itself.
+ TCTYPE_TABLE, /// The data table.
+ TCTYPE_ROWHEADERBAR, /// The row header bar.
+ TCTYPE_COLUMNHEADERBAR, /// The horizontal column header bar.
+ TCTYPE_TABLECELL, /// A cell of the data table.
+ TCTYPE_ROWHEADERCELL, /// A cell of the row header bar.
+ TCTYPE_COLUMNHEADERCELL, /// A cell of the column header bar.
+};
+
+
+/** This abstract class provides methods to implement an accessible table object.
+*/
+class IAccessibleTable
+{
+public:
+ /** @return The position of the current row. */
+ virtual sal_Int32 GetCurrentRow() const = 0;
+ /** @return The position of the current column. */
+ virtual sal_Int32 GetCurrentColumn() const = 0;
+ /** Creates and returns the accessible object of the whole GridControl. */
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible()= 0;
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex )= 0;
+ virtual OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const= 0;
+ virtual sal_Bool GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow )= 0;
+ virtual sal_Bool HasColHeader() = 0;
+ virtual sal_Bool HasRowHeader() = 0;
+
+ /** 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 colum/row cell
+ @return
+ The description of the specified object.
+ */
+ virtual OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType, sal_Int32 _nPosition = -1) const= 0;
+
+ /** 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,
+ AccessibleTableControlObjType eObjType ) const= 0;
+
+ // Window
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const = 0;
+ virtual void GrabFocus()= 0;
+ virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True )= 0;
+ virtual Window* GetAccessibleParentWindow() const= 0;
+ virtual Window* GetWindowInstance()= 0;
+ virtual sal_Int32 GetAccessibleControlCount() const = 0;
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )= 0;
+ virtual long GetRowCount() const= 0;
+ virtual long GetColumnCount() const= 0;
+ virtual sal_Bool HasRowHeader() const= 0;
+ virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )= 0;
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True ) = 0;
+ virtual Rectangle calcHeaderCellRect( sal_Bool _bColHeader, sal_Int32 _nPos ) = 0;
+ virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True ) = 0;
+ virtual Rectangle calcCellRect( sal_Int32 _nRowPos, sal_Int32 _nColPos ) = 0;
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex)= 0;
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)= 0;
+ virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const= 0;
+ virtual OUString GetRowDescription( sal_Int32 _nRow ) const = 0;
+ virtual OUString GetRowName(sal_Int32 _nIndex) const = 0;
+ virtual OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const = 0;
+ virtual OUString GetColumnName( sal_Int32 _nIndex ) const = 0;
+ virtual css::uno::Any GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0;
+ virtual OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0;
+
+ virtual sal_Int32 GetSelectedRowCount() const = 0;
+ virtual sal_Int32 GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const = 0;
+ virtual bool IsRowSelected( sal_Int32 const i_rowIndex ) const = 0;
+ virtual void SelectRow( sal_Int32 const i_rowIndex, bool const i_select ) = 0;
+ virtual void SelectAllRows( bool const i_select ) = 0;
+
+protected:
+ ~IAccessibleTable() {}
+};
+
+
+/** interface for an implementation of a table control's Accesible component
+*/
+class IAccessibleTableControl
+{
+public:
+ /** returns the XAccessible object itself
+
+ The reference returned here can be used to control the life time of the
+ IAccessibleTableImplementation object.
+
+ The returned reference is guaranteed to not be <NULL/>.
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ getMyself() = 0;
+
+ /** disposes the accessible implementation, so that it becomes defunc
+ */
+ virtual void dispose() = 0;
+
+ /** checks whether the accessible implementation, and its context, are still alive
+ @return <TRUE/>, if the object is not disposed or disposing.
+ */
+ virtual sal_Bool isAlive() const = 0;
+
+ /** returns the accessible object for the row or the column header bar
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ getTableHeader( ::svt::table::AccessibleTableControlObjType _eObjType ) = 0;
+
+ /** returns the accessible object for the table representation
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ getTable() = 0;
+
+ /** commits the event at all listeners of the cell
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ virtual void commitCellEvent(
+ sal_Int16 nEventId,
+ const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue
+ ) = 0;
+ /** commits the event at all listeners of the table
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ virtual void commitTableEvent(
+ sal_Int16 nEventId,
+ const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue
+ ) = 0;
+
+ ///** Commits an event to all listeners. */
+ virtual void commitEvent(
+ sal_Int16 nEventId,
+ const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue
+ ) = 0;
+
+protected:
+ ~IAccessibleTableControl() {}
+};
+
+
+} // namespace table
+} // namespace svt
+
+#endif // _SVTOOLS_ACCESSIBLETABLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/accessibletableprovider.hxx b/include/svtools/accessibletableprovider.hxx
new file mode 100644
index 000000000000..775ac23c8ab2
--- /dev/null
+++ b/include/svtools/accessibletableprovider.hxx
@@ -0,0 +1,241 @@
+/* -*- 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_ACCESSIBLETABLEPROVIDER_HXX
+#define _SVTOOLS_ACCESSIBLETABLEPROVIDER_HXX
+
+#include <vcl/window.hxx>
+#include <unotools/accessiblestatesethelper.hxx>
+#include <svtools/AccessibleBrowseBoxObjType.hxx>
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+
+
+namespace svt
+{
+
+#define OFFSET_DEFAULT ((sal_Int32)-1)
+#define OFFSET_NONE ((sal_Int32)0)
+
+enum AccessibleTableChildIndex
+{
+ /** Child index of the column header bar (first row). Exists always. */
+ BBINDEX_COLUMNHEADERBAR = 0,
+ /** Child index of the row header bar ("handle column"). Exists always. */
+ BBINDEX_ROWHEADERBAR = 1,
+ /** Child index of the data table. */
+ BBINDEX_TABLE = 2,
+ /** Child index of the first additional control. */
+ BBINDEX_FIRSTCONTROL = 3
+};
+
+
+/** This abstract class provides methods to implement an accessible table object.
+*/
+class IAccessibleTableProvider
+{
+public:
+ /** @return The count of the rows. */
+ virtual long GetRowCount() const = 0;
+ /** @return The count of the columns. */
+ virtual sal_uInt16 GetColumnCount() const = 0;
+
+ /** @return The position of the current row. */
+ virtual sal_Int32 GetCurrRow() const = 0;
+ /** @return The position of the current column. */
+ virtual sal_uInt16 GetCurrColumn() const = 0;
+
+ /** @return The description of a row.
+ @param _nRow The row which description is in demand. */
+ virtual OUString GetRowDescription( sal_Int32 _nRow ) const = 0;
+ /** @return The description of a column.
+ @param _nColumn The column which description is in demand. */
+ virtual OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const = 0;
+
+ /** @return <TRUE/>, if the object has a row header. */
+ virtual sal_Bool HasRowHeader() const = 0; //GetColumnId
+ /** @return <TRUE/>, if the object can focus a cell. */
+ virtual sal_Bool IsCellFocusable() const = 0;
+ virtual sal_Bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0;
+
+ virtual void SetNoSelection() = 0;
+ virtual void SelectAll() = 0;
+ virtual void SelectRow( long _nRow, sal_Bool _bSelect = sal_True, sal_Bool bExpand = sal_True ) = 0;
+ virtual void SelectColumn( sal_uInt16 _nColumnPos, sal_Bool _bSelect = sal_True ) = 0;
+ virtual sal_Int32 GetSelectedRowCount() const = 0;
+ virtual sal_Int32 GetSelectedColumnCount() const = 0;
+ /** @return <TRUE/>, if the row is selected. */
+ virtual bool IsRowSelected( long _nRow ) const = 0;
+ virtual sal_Bool IsColumnSelected( long _nColumnPos ) const = 0;
+ virtual void GetAllSelectedRows( css::uno::Sequence< sal_Int32 >& _rRows ) const = 0;
+ virtual void GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& _rColumns ) const = 0;
+
+ /** @return <TRUE/>, if the cell is visible. */
+ virtual sal_Bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const = 0;
+ virtual String GetAccessibleCellText( long _nRow, sal_uInt16 _nColumnPos ) const = 0;
+
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True ) = 0;
+ virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True ) = 0;
+ virtual Rectangle GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumnPos, sal_Bool _bIsHeader, sal_Bool _bOnScreen = sal_True ) = 0;
+
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0;
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleRowHeader( sal_Int32 _nRow ) = 0;
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleColumnHeader( sal_uInt16 _nColumnPos ) = 0;
+
+ virtual sal_Int32 GetAccessibleControlCount() const = 0;
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex ) = 0;
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint ) = 0;
+
+ virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_uInt16& _rnColPos, const Point& _rPoint ) = 0;
+ virtual sal_Bool ConvertPointToRowHeader( sal_Int32& _rnRow, const Point& _rPoint ) = 0;
+ virtual sal_Bool ConvertPointToColumnHeader( sal_uInt16& _rnColPos, const Point& _rPoint ) = 0;
+
+ virtual OUString GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const = 0;
+ virtual OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const = 0;
+
+ virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& _rStateSet, ::svt::AccessibleBrowseBoxObjType _eType ) const = 0;
+ virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const = 0;
+ virtual void GrabTableFocus() = 0;
+
+ // OutputDevice
+ virtual sal_Bool GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector ) = 0;
+
+ // Window
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const = 0;
+ virtual void GrabFocus() = 0;
+ virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True ) = 0;
+ virtual Window* GetAccessibleParentWindow() const = 0;
+ virtual Window* GetWindowInstance() = 0;
+
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex) = 0;
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) = 0;
+
+protected:
+ ~IAccessibleTableProvider() {}
+};
+
+
+/** interface for an implementation of a table control's Accesible component
+*/
+class IAccessibleTabListBox
+{
+public:
+ /** returns the XAccessible object itself
+
+ The reference returned here can be used to control the life time of the
+ IAccessibleTableImplementation object.
+
+ The returned reference is guaranteed to not be <NULL/>.
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ getMyself() = 0;
+
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ SAL_CALL getAccessibleChild( sal_Int32 nChildIndex )
+ throw ( css::lang::IndexOutOfBoundsException, css::uno::RuntimeException ) = 0;
+
+ /** returns the accessible object for the row or the column header bar
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ getHeaderBar( ::svt::AccessibleBrowseBoxObjType _eObjType ) = 0;
+
+protected:
+ ~IAccessibleTabListBox() {}
+};
+
+/** interface for an implementation of a browse box's Accesible component
+*/
+class IAccessibleBrowseBox
+{
+public:
+ /** returns the XAccessible object itself
+
+ The reference returned here can be used to control the life time of the
+ IAccessibleTableImplementation object.
+
+ The returned reference is guaranteed to not be <NULL/>.
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ getMyself() = 0;
+
+ /** disposes the accessible implementation, so that it becomes defunc
+ */
+ virtual void dispose() = 0;
+
+ /** checks whether the accessible implementation, and its context, are still alive
+ @return <TRUE/>, if the object is not disposed or disposing.
+ */
+ virtual sal_Bool isAlive() const = 0;
+
+ /** returns the accessible object for the row or the column header bar
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ getHeaderBar( ::svt::AccessibleBrowseBoxObjType _eObjType ) = 0;
+
+ /** returns the accessible object for the table representation
+ */
+ virtual css::uno::Reference< css::accessibility::XAccessible >
+ getTable() = 0;
+
+ /** commits the event at all listeners of the column/row header bar
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ virtual void commitHeaderBarEvent(
+ sal_Int16 nEventId,
+ const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue,
+ sal_Bool _bColumnHeaderBar
+ ) = 0;
+
+ /** commits the event at all listeners of the table
+ @param nEventId
+ the event id
+ @param rNewValue
+ the new value
+ @param rOldValue
+ the old value
+ */
+ virtual void commitTableEvent(
+ sal_Int16 nEventId,
+ const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue
+ ) = 0;
+
+ /** Commits an event to all listeners. */
+ virtual void commitEvent(
+ sal_Int16 nEventId,
+ const css::uno::Any& rNewValue,
+ const css::uno::Any& rOldValue
+ ) = 0;
+
+protected:
+ ~IAccessibleBrowseBox() {}
+};
+
+
+} // namespace svt
+
+
+#endif // _SVTOOLS_ACCESSIBLETABLEPROVIDER_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 000000000000..d7406235b9a6
--- /dev/null
+++ b/include/svtools/addresstemplate.hxx
@@ -0,0 +1,144 @@
+/* -*- 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 _SVT_ADDRESSTEMPLATE_HXX_
+#define _SVT_ADDRESSTEMPLATE_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <vcl/dialog.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/combobox.hxx>
+#include <vcl/button.hxx>
+#include <vcl/layout.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/scrbar.hxx>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/util/AliasProgrammaticPair.hpp>
+#include <com/sun/star/sdb/XDatabaseContext.hpp>
+#include <com/sun/star/sdbc/XDataSource.hpp>
+#include <unotools/configitem.hxx>
+
+// .......................................................................
+namespace svt
+{
+// .......................................................................
+
+ // ===================================================================
+ // = AddressBookSourceDialog
+ // ===================================================================
+ struct AddressBookSourceDialogData;
+ class SVT_DLLPUBLIC AddressBookSourceDialog : public ModalDialog
+ {
+ protected:
+ // Controls
+ ComboBox* m_pDatasource;
+ PushButton* m_pAdministrateDatasources;
+ ComboBox* m_pTable;
+ ScrollBar* m_pFieldScroller;
+
+ // string to display for "no selection"
+ const String m_sNoFieldSelection;
+
+ /// the DatabaseContext for selecting data sources
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XDatabaseContext >
+ m_xDatabaseContext;
+ // the ORB for creating objects
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ m_xORB;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
+ m_xCurrentDatasourceTables;
+
+ AddressBookSourceDialogData*
+ m_pImpl;
+
+ public:
+ AddressBookSourceDialog( Window* _pParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::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( Window* _pParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource >& _rxTransientDS,
+ const OUString& _rDataSourceName,
+ const OUString& _rTable,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::util::AliasProgrammaticPair >& _rMapping
+ );
+
+ ~AddressBookSourceDialog();
+
+ // to be used if the object was constructed for editing a field mapping only
+ void getFieldMapping(
+ ::com::sun::star::uno::Sequence< ::com::sun::star::util::AliasProgrammaticPair >& _rMapping) const;
+
+ protected:
+ void implConstruct();
+
+ // Window overridables
+ virtual long PreNotify( NotifyEvent& _rNEvt );
+
+ // implementations
+ void implScrollFields(sal_Int32 _nPos, sal_Bool _bAdjustFocus, sal_Bool _bAdjustScrollbar);
+ void implSelectField(ListBox* _pBox, const String& _rText);
+
+ void initalizeListBox(ListBox* _pList);
+ void resetTables();
+ void resetFields();
+
+ // fill in the data sources listbox
+ void initializeDatasources();
+
+ // initialize the dialog from the configuration data
+ void loadConfiguration();
+
+ DECL_LINK(OnFieldScroll, ScrollBar*);
+ DECL_LINK(OnFieldSelect, ListBox*);
+ DECL_LINK(OnAdministrateDatasources, void*);
+ DECL_LINK(OnComboGetFocus, ComboBox*);
+ DECL_LINK(OnComboLoseFocus, ComboBox*);
+ DECL_LINK(OnComboSelect, ComboBox*);
+ DECL_LINK(OnOkClicked, void*);
+ DECL_LINK(OnDelayedInitialize, void*);
+ };
+
+
+// .......................................................................
+} // namespace svt
+// .......................................................................
+
+#endif // _SVT_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 000000000000..fdfb4ef0f671
--- /dev/null
+++ b/include/svtools/apearcfg.hxx
@@ -0,0 +1,97 @@
+/* -*- 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 _SVT_APEARCFG_HXX
+#define _SVT_APEARCFG_HXX
+
+#include "svtools/svtdllapi.h"
+#include "tools/solar.h"
+#include <unotools/configitem.hxx>
+
+class Application;
+
+typedef enum {
+ SnapToButton = 0,
+ SnapToMiddle,
+ NoSnap
+} SnapType;
+
+typedef enum { // MUST match the order chosen in ListBox LB_DRAG_MODE in optgdlg.src
+ DragFullWindow,
+ DragFrame,
+ DragSystemDep
+} DragMode;
+
+
+class SVT_DLLPUBLIC SvtTabAppearanceCfg : public utl::ConfigItem
+{
+ short nDragMode ;
+ short nScaleFactor ;
+ short nSnapMode ;
+ short nMiddleMouse;
+#if defined( UNX )
+ short nAAMinPixelHeight ;
+#endif
+
+ sal_Bool bMenuMouseFollow ;
+#if defined( UNX )
+ sal_Bool bFontAntialiasing ;
+#endif
+
+ static sal_Bool bInitialized ;
+
+ SVT_DLLPRIVATE const com::sun::star::uno::Sequence<OUString>& GetPropertyNames();
+
+public:
+ SvtTabAppearanceCfg( );
+ ~SvtTabAppearanceCfg( );
+
+ virtual void Commit();
+ virtual void Notify( const com::sun::star::uno::Sequence< OUString >& _rPropertyNames);
+
+ sal_uInt16 GetDragMode () const { return nDragMode; }
+
+ sal_uInt16 GetScaleFactor () const { return nScaleFactor; }
+ void SetScaleFactor ( sal_uInt16 nSet );
+
+ sal_uInt16 GetSnapMode () const { return nSnapMode; }
+ void SetSnapMode ( sal_uInt16 nSet );
+
+ sal_uInt16 GetMiddleMouseButton () const { return nMiddleMouse; }
+ void SetMiddleMouseButton ( sal_uInt16 nSet );
+
+ void SetApplicationDefaults ( Application* pApp );
+
+ void SetMenuMouseFollow(sal_Bool bSet) {bMenuMouseFollow = bSet; SetModified();}
+ sal_Bool IsMenuMouseFollow() const{return bMenuMouseFollow;}
+
+#if defined( UNX )
+ void SetFontAntiAliasing( sal_Bool bSet ) { bFontAntialiasing = bSet; SetModified(); }
+ sal_Bool IsFontAntiAliasing() const { return bFontAntialiasing; }
+
+ sal_uInt16 GetFontAntialiasingMinPixelHeight( ) const { return nAAMinPixelHeight; }
+ void SetFontAntialiasingMinPixelHeight( sal_uInt16 _nMinHeight ) { nAAMinPixelHeight = _nMinHeight; SetModified(); }
+#endif
+
+ static sal_Bool IsInitialized() { return bInitialized; }
+ static void SetInitialized() { bInitialized = sal_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 000000000000..9551c1478f6b
--- /dev/null
+++ b/include/svtools/asynclink.hxx
@@ -0,0 +1,66 @@
+/* -*- 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_ASYNCLINK_HXX
+#define SVTOOLS_ASYNCLINK_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/solar.h>
+#include <tools/link.hxx>
+#include <osl/mutex.hxx>
+
+class Timer;
+
+namespace svtools {
+
+class SVT_DLLPUBLIC AsynchronLink
+{
+ Link _aLink;
+ sal_uLong _nEventId;
+ Timer* _pTimer;
+ sal_Bool _bInCall;
+ sal_Bool* _pDeleted;
+ void* _pArg;
+ ::osl::Mutex* _pMutex;
+
+ DECL_DLLPRIVATE_STATIC_LINK( AsynchronLink, HandleCall, void* );
+ SVT_DLLPRIVATE void Call_Impl( void* pArg );
+
+public:
+ AsynchronLink( const Link& rLink ) :
+ _aLink( rLink ), _nEventId( 0 ), _pTimer( 0 ), _bInCall( sal_False ),
+ _pDeleted( 0 ), _pMutex( 0 ){}
+ AsynchronLink() : _nEventId( 0 ), _pTimer( 0 ), _bInCall( sal_False ),
+ _pDeleted( 0 ), _pMutex( 0 ){}
+ ~AsynchronLink();
+
+ void CreateMutex();
+ void operator=( const Link& rLink ) { _aLink = rLink; }
+ void Call( void* pObj, sal_Bool bAllowDoubles = sal_False,
+ sal_Bool bUseTimer = sal_False );
+ void ClearPendingCall( );
+ sal_Bool IsSet() const { return _aLink.IsSet(); }
+ Link GetLink() const { return _aLink; }
+};
+
+}
+
+#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 000000000000..0fdea457d5f5
--- /dev/null
+++ b/include/svtools/bindablecontrolhelper.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 SVTOOLS_INC_BINDABLECONTROL_HXX
+#define SVTOOLS_INC_BINDABLECONTROL_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <com/sun/star/frame/XModel.hpp>
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= GraphicAccess
+ //====================================================================
+ /** helper class for obtaining streams (which also can be used with the ImageProducer)
+ from a resource
+ */
+ class BindableControlHelper
+ {
+ private:
+ BindableControlHelper(); // never implemented
+
+ public:
+ SVT_DLLPUBLIC static void ApplyListSourceAndBindableData( const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& xModel, const com::sun::star::uno::Reference< com::sun::star::uno::XInterface >& rObj, const OUString& rsCtrlSource, const OUString& rsRowSource, sal_uInt16 nRefTab = 0 );
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVTOOLS_INC_BINDABLECONTROL_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 000000000000..77884bf2620a
--- /dev/null
+++ b/include/svtools/borderhelper.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 _BORDERHELPER_HXX
+#define _BORDERHELPER_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/point/b2dpoint.hxx>
+#include <vcl/outdev.hxx>
+
+namespace svtools
+{
+ SVT_DLLPUBLIC basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon,
+ sal_uInt16 nDashing, MapUnit eUnit );
+
+ SVT_DLLPUBLIC basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon,
+ sal_uInt16 nDashing, MapUnit eUnit, double fScale );
+
+ SVT_DLLPUBLIC void DrawLine( OutputDevice& rDev, const basegfx::B2DPoint& rBeg,
+ const basegfx::B2DPoint& rEnd, sal_uInt32 nWidth, sal_uInt16 nDashing );
+
+ SVT_DLLPUBLIC void DrawLine( OutputDevice& rDev, const Point& rBeg,
+ const Point& rEnd, sal_uInt32 nWidth, sal_uInt16 nDashing );
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
new file mode 100644
index 000000000000..128c57c699c2
--- /dev/null
+++ b/include/svtools/brwbox.hxx
@@ -0,0 +1,831 @@
+/* -*- 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 _SVX_BRWBOX_HXX
+#define _SVX_BRWBOX_HXX
+
+#include "svtools/svtdllapi.h"
+#include <vcl/scrbar.hxx>
+#include <vcl/ctrl.hxx>
+#include <tools/multisel.hxx>
+#include <svtools/headbar.hxx>
+#include <svtools/transfer.hxx>
+#include <svtools/AccessibleBrowseBoxObjType.hxx>
+#include <svtools/accessibletableprovider.hxx>
+#include <vector>
+
+#include <limits.h>
+#include <memory>
+
+class BrowserColumn;
+class BrowserDataWin;
+class MultiSelection;
+class BrowserHeader;
+
+typedef ::std::vector< BrowserColumn* > BrowserColumns;
+
+namespace svt {
+ class BrowseBoxImpl;
+ class IAccessibleFactory;
+}
+namespace utl {
+ class AccessibleStateSetHelper;
+}
+
+// -------------------
+// - BrowseBox-Types -
+// -------------------
+
+#define BROWSER_INVALIDID SAL_MAX_UINT16
+#define BROWSER_ENDOFSELECTION (static_cast<long>(SFX_ENDOFSELECTION))
+
+typedef sal_uLong BrowserMode;
+
+#define BROWSER_COLUMNSELECTION 0x0001
+#define BROWSER_MULTISELECTION 0x0002
+#define BROWSER_THUMBDRAGGING 0x0004
+#define BROWSER_KEEPHIGHLIGHT 0x0008
+#define BROWSER_KEEPSELECTION BROWSER_KEEPHIGHLIGHT // old, don't use!
+#define BROWSER_HLINES 0x0010
+#define BROWSER_VLINES 0x0020
+#define BROWSER_HLINESFULL BROWSER_HLINES // old, don't use!
+#define BROWSER_VLINESFULL BROWSER_VLINES // old, don't use!
+#define BROWSER_HLINESDOTS 0x0000 // old => don't use!
+#define BROWSER_VLINESDOTS 0x0000 // old => don't use!
+
+#define BROWSER_HIDESELECT 0x0100 // old => don't use!
+#define BROWSER_HIDECURSOR 0x0200
+
+#define BROWSER_NO_HSCROLL 0x0400
+#define BROWSER_NO_SCROLLBACK 0x0800
+
+#define BROWSER_AUTO_VSCROLL 0x1000
+#define BROWSER_AUTO_HSCROLL 0x2000
+
+#define BROWSER_TRACKING_TIPS 0x4000
+
+#define BROWSER_NO_VSCROLL 0x8000
+
+#define BROWSER_HIGHLIGHT_NONE 0x0100 // == BROWSER_HIDESELECT
+
+#define BROWSER_HEADERBAR_NEW 0x00040000
+#define BROWSER_AUTOSIZE_LASTCOL 0x00080000
+#define BROWSER_OWN_DATACHANGED 0x00100000
+
+#define BROWSER_CURSOR_WO_FOCUS 0x00200000
+ // 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).
+
+#define BROWSER_SMART_HIDECURSOR 0x00400000
+ // is an enhanced version of BROWSER_HIDECURSOR.
+ // When set, BROWSER_HIDECURSOR is overruled, and the cursor is hidden as long as no selection exists,
+ // but shown otherwise. This does not affect other situations which require to temporarily hide the
+ // cursor (such as scrolling).
+
+#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
+
+// ---------------
+// - BrowseEvent -
+// ---------------
+
+class BrowseEvent
+{
+ Window* pWin;
+ long nRow;
+ Rectangle aRect;
+ sal_uInt16 nCol;
+ sal_uInt16 nColId;
+
+public:
+ BrowseEvent();
+ BrowseEvent( Window* pWindow,
+ long nAbsRow,
+ sal_uInt16 nColumn, sal_uInt16 nColumnId,
+ const Rectangle& rRect );
+
+ Window* GetWindow() const { return pWin; }
+ long GetRow() const { return nRow; }
+ sal_uInt16 GetColumn() const { return nCol; }
+ sal_uInt16 GetColumnId() const { return nColId; }
+ const Rectangle& GetRect() const { return aRect; }
+};
+
+// ---------------------
+// - BrowserMouseEvent -
+// ---------------------
+
+class BrowserMouseEvent: public MouseEvent, public BrowseEvent
+{
+public:
+ BrowserMouseEvent();
+ BrowserMouseEvent( BrowserDataWin* pWin, const MouseEvent& rEvt );
+ BrowserMouseEvent( Window* pWin, const MouseEvent& rEvt,
+ long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId,
+ const Rectangle& rRect );
+};
+
+// --------------------------
+// - BrowserAcceptDropEvent -
+// --------------------------
+
+class BrowserAcceptDropEvent : public AcceptDropEvent, public BrowseEvent
+{
+public:
+ BrowserAcceptDropEvent();
+ BrowserAcceptDropEvent( BrowserDataWin* pWin, const AcceptDropEvent& rEvt );
+};
+
+// ---------------------------
+// - BrowserExecuteDropEvent -
+// ---------------------------
+
+class BrowserExecuteDropEvent : public ExecuteDropEvent, public BrowseEvent
+{
+public:
+ BrowserExecuteDropEvent();
+ BrowserExecuteDropEvent( BrowserDataWin* pWin, const ExecuteDropEvent& rEvt );
+};
+
+// -------------
+// - BrowseBox -
+// -------------
+
+// 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 svt::IAccessibleTableProvider
+{
+ #define NO_CURSOR_HIDE 0
+ #define HARD_CURSOR_HIDE 1
+ #define SMART_CURSOR_HIDE 2
+
+ friend class BrowserDataWin;
+ friend class ::svt::BrowseBoxImpl;
+
+#ifdef DBG_UTIL
+ friend const char* BrowseBoxCheckInvariants( const void * pVoid );
+#endif
+
+public:
+ static const sal_uInt16 HandleColumnId = 0;
+
+private:
+ Window* pDataWin; // window to display data rows
+ ScrollBar* pVScroll; // vertical scrollbar
+ ScrollBar aHScroll; // horizontal scrollbar
+
+ long nDataRowHeight; // height of a single data-row
+ sal_uInt16 nTitleLines; // number of lines in title row
+ sal_uLong nControlAreaWidth; // width of fixed area beneeth hscroll
+ sal_Bool bThumbDragging; // handle thumb dragging
+ sal_Bool bColumnCursor; // single columns and fields selectable
+ sal_Bool bMultiSelection;// allow multiple selected rows
+ sal_Bool bKeepHighlight; // don't hide selection on LoseFocus
+
+ sal_Bool bHLines; // draw lines between rows
+ sal_Bool bVLines; // draw lines between columns
+ sal_Bool bHDots; // draw lines between rows dotted
+ sal_Bool bVDots; // draw lines between columns dotted
+ Color aGridLineColor; // color for lines, default dark grey
+ sal_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
+
+ sal_Bool bSelecting;
+ sal_Bool bRowDividerDrag;
+ sal_Bool bHit;
+ sal_Bool mbInteractiveRowHeight;
+ Point a1stPoint;
+ Point a2ndPoint;
+
+ 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
+ sal_Bool bResizing; // mouse captured for column resizing
+
+ sal_Bool bSelect; // select or deselect
+ sal_Bool bSelectionIsVisible; // depending on focus
+ sal_Bool bScrolling; // hidden cursor while scrolling
+ sal_Bool bNotToggleSel; // set while in ToggleSelection() etc.
+ sal_Bool bHasFocus; // set/unset in Get/LoseFocus
+ sal_Bool bHideSelect; // hide selection (highlight)
+ sal_Bool bHideCursor; // hide cursor (frame)
+ Range aSelRange; // for selection expansion
+
+ BrowserColumns* pCols; // array of column-descriptions
+ union
+ {
+ MultiSelection* pSel; // selected rows for multi-selection
+ long nSel; // selected row for single-selection
+ } uRow;
+ MultiSelection* pColSel; // selected column-ids
+
+ ::std::auto_ptr< ::svt::BrowseBoxImpl > m_pImpl; // impl structure of the BrowseBox object
+
+ sal_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( sal_Bool bForce = sal_False );
+
+ SVT_DLLPRIVATE void UpdateScrollbars();
+ SVT_DLLPRIVATE void AutoSizeLastColumn();
+
+ SVT_DLLPRIVATE long ImpGetDataRowHeight() const;
+ SVT_DLLPRIVATE 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 * );
+ DECL_DLLPRIVATE_LINK( EndScrollHdl, void * );
+ DECL_DLLPRIVATE_LINK( StartDragHdl, HeaderBar * );
+
+ SVT_DLLPRIVATE long GetFrozenWidth() const;
+
+ sal_Bool GoToRow(long nRow, sal_Bool bRowColMove, sal_Bool bDoNotModifySelection = sal_False );
+
+ sal_Bool GoToColumnId( sal_uInt16 nColId, sal_Bool bMakeVisible, sal_Bool bRowColMove = sal_False);
+ void SelectColumnPos( sal_uInt16 nCol, sal_Bool _bSelect, sal_Bool bMakeVisible);
+ void SelectColumnId( sal_uInt16 nColId, sal_Bool _bSelect, sal_Bool bMakeVisible)
+ { SelectColumnPos( GetColumnPos(nColId), _bSelect, bMakeVisible); }
+
+ void ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, sal_Bool _bForeignDevice, sal_Bool _bDrawSelections);
+
+ sal_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
+ ::svt::IAccessibleFactory& getAccessibleFactory();
+
+protected:
+ sal_uInt16 ColCount() const;
+
+ // software plug for database access
+ // Der RowCount wird jetzt intern automatisch gezaehlt
+ // (ueber RowInserted und RowRemoved), daher ist das Ueberladen
+ // dieser Methode ueberfluessig!
+public:
+ virtual long GetRowCount() const;
+
+protected:
+ // fuer Anzeige im VScrollBar z.B. auf "?" oder setzen
+ void SetRealRowCount( const String &rRealRowCount );
+
+ // Return Value muss immer sal_True sein - SeekRow *muss* klappen!
+ // (sonst ASSERT) MI: wer hat das eingebaut? Das darf nicht so sein!
+
+ /** seeks for the given row position
+ @param nRow
+ nRow starts at 0
+ */
+ virtual sal_Bool SeekRow( long nRow ) = 0;
+ virtual void DrawCursor();
+ virtual void PaintRow( OutputDevice &rDev, const Rectangle &rRect );
+ virtual void PaintData( Window& rWin, const Rectangle& rRect );
+ virtual void PaintField( OutputDevice& rDev, const Rectangle& rRect,
+ sal_uInt16 nColumnId ) const = 0;
+ // Benachrichtigung an die abgeleitete Klasse, dass sich der sichtbare
+ // Bereich von Rows geaendert hat. Aus dieser Methode heraus darf
+ // die abgeleitete Klasse Aenderungen des Model mit Hilfe der Methoden
+ // RowInserted und RowRemoved bekanntgeben. Mit sich daraus ergebenden
+ // neuen Zustand wird anschliessend ein Paint veranlasst (und entsprechend
+ // SeekRow etc. gerufen).
+ //
+ // Parameter: nNewTopRow: Nr. der neuen TopRow (kann von VisibleRowsChanged
+ // durch Aufruf von RowInserted und RowDeleted noch veraendert werden).
+ // nNumRows: Anzahl der sichtbaren Rows (auch eine teilweise sichtbare Row
+ // wird mitgezaehlt).
+ //
+ // Moegliche Ursachen fuer die Aenderung des sichtbaren Bereiches:
+ // - Vor dem sichtbaren Bereich sind Rows eingefuegt oder geloescht worden,
+ // dadurch aendert sich nur die Numerierung der sichtbaren Rows
+ // - Scrollen (und daraus resultierend eine andere erste sichtbare Row)
+ // - Resize des Fensters
+ virtual void VisibleRowsChanged( long nNewTopRow, sal_uInt16 nNumRows);
+
+ // Anzahl sichtbarer Rows in dem Fenster (inkl. "angeschnittener" Rows)
+ sal_uInt16 GetVisibleRows()
+ { return (sal_uInt16)((pDataWin->GetOutputSizePixel().Height() - 1 )/ GetDataRowHeight() + 1); }
+ long GetTopRow() { return nTopRow; }
+ sal_uInt16 GetFirstVisibleColNumber() const { return nFirstCol; }
+
+ // Focus-Rect ein-/ausschalten
+ void DoShowCursor( const char *pWhoLog );
+ void DoHideCursor( const char *pWhoLog );
+ short GetCursorHideCount() const;
+
+ virtual BrowserHeader* CreateHeaderBar( BrowseBox* pParent );
+
+ // HACK(virtuelles Create wird im Ctor nicht gerufen)
+ void SetHeaderBar( BrowserHeader* );
+
+ long CalcReverseZoom(long nVal);
+
+ inline const DataFlavorExVector&
+ GetDataFlavors() const;
+
+ sal_Bool IsDropFormatSupported( SotFormatStringId nFormat ); // need this because the base class' IsDropFormatSupported is not const ...
+ sal_Bool IsDropFormatSupported( SotFormatStringId nFormat ) const;
+
+ sal_Bool IsDropFormatSupported( const css::datatransfer::DataFlavor& _rFlavor ); // need this because the base class' IsDropFormatSupported is not const ...
+ sal_Bool IsDropFormatSupported( const css::datatransfer::DataFlavor& _rFlavor ) const;
+
+private:
+ void* implGetDataFlavors() const;
+ // with this we can make GetDataFlavors() inline, which is strongly needed as SVTOOLS does not export
+ // any sysbols containing an "_STL", so a non-inlined method would not be exported ....
+
+protected:
+ // callbacks for the data window
+ virtual void ImplStartTracking();
+ virtual void ImplTracking();
+ virtual void ImplEndTracking();
+
+public:
+ BrowseBox( Window* pParent, WinBits nBits = 0,
+ BrowserMode nMode = 0 );
+ BrowseBox( Window* pParent, const ResId& rId,
+ BrowserMode nMode = 0 );
+ ~BrowseBox();
+
+ // ererbte ueberladene Handler
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void MouseButtonDown( const MouseEvent& rEvt );
+ virtual void MouseMove( const MouseEvent& rEvt );
+ virtual void MouseButtonUp( const MouseEvent& rEvt );
+ virtual void KeyInput( const KeyEvent& rEvt );
+ virtual void LoseFocus();
+ virtual void GetFocus();
+ virtual void Resize();
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Command( const CommandEvent& rEvt );
+ virtual void StartDrag( sal_Int8 _nAction, const Point& _rPosPixel );
+
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); // will forward everything got to the second AcceptDrop method
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); // will forward everything got to the second ExecuteDrop method
+
+ virtual sal_Int8 AcceptDrop( const BrowserAcceptDropEvent& rEvt );
+ virtual sal_Int8 ExecuteDrop( const BrowserExecuteDropEvent& rEvt );
+
+ // neue Handler
+ virtual void MouseButtonDown( const BrowserMouseEvent& rEvt );
+ virtual void MouseMove( const BrowserMouseEvent& rEvt );
+ virtual void MouseButtonUp( const BrowserMouseEvent& rEvt );
+ virtual void StartScroll();
+ virtual void EndScroll();
+ virtual void Select();
+ virtual void DoubleClick( const BrowserMouseEvent& rEvt );
+ virtual sal_Bool IsCursorMoveAllowed( long nNewRow, sal_uInt16 nNewColId ) const;
+ virtual void CursorMoved();
+ virtual void ColumnMoved( sal_uInt16 nColId );
+ virtual void ColumnResized( sal_uInt16 nColId );
+ virtual long QueryColumnResize( sal_uInt16 nColId, long nWidth );
+ /// called when the row height has been changed interactively
+ virtual void RowHeightChanged();
+ virtual long QueryMinimumRowHeight();
+
+ // Window-Control (pass to DataWindow)
+ void SetUpdateMode( sal_Bool bUpdate );
+ sal_Bool GetUpdateMode() const;
+
+ // map-mode and font control
+ void SetFont( const Font& rNewFont );
+ const Font& GetFont() const { return pDataWin->GetFont(); }
+ void SetTitleFont( const Font& rNewFont )
+ { Control::SetFont( rNewFont ); }
+ const Font& GetTitleFont() const { return Control::GetFont(); }
+
+ // color for line painting
+ void SetGridLineColor(const Color& rColor) {aGridLineColor = rColor;}
+ const Color& GetGridLineColor() const {return aGridLineColor;}
+
+ // inserting, changing, removing and freezing of columns
+ void InsertHandleColumn( sal_uLong nWidth );
+ void InsertDataColumn( sal_uInt16 nItemId, const XubString& rText,
+ long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE,
+ sal_uInt16 nPos = HEADERBAR_APPEND );
+ void SetColumnTitle( sal_uInt16 nColumnId, const String &rTitle );
+ void SetColumnWidth( sal_uInt16 nColumnId, sal_uLong nWidth );
+ void SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos );
+ void FreezeColumn( sal_uInt16 nColumnId, sal_Bool bFreeze = sal_True );
+ void UnfreezeColumns();
+ 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 );
+ sal_uInt16 GetTitleLines() const { return nTitleLines; }
+ virtual long GetTitleHeight() const;
+
+ // access to dynamic values of cursor row
+ String GetColumnTitle( sal_uInt16 nColumnId ) const;
+ 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;
+ sal_Bool IsFrozen( sal_uInt16 nColumnId ) const;
+
+ // movement of visible area
+ void ResetScroll();
+ long ScrollColumns( long nColumns );
+ long ScrollRows( long nRows );
+ sal_Bool MakeFieldVisible( long nRow, sal_uInt16 nColId, sal_Bool bComplete = sal_False );
+
+ // access and movement of cursor
+ long GetCurRow() const { return nCurRow; }
+ sal_uInt16 GetCurColumnId() const { return nCurColId; }
+ sal_Bool GoToRow( long nRow );
+ sal_Bool GoToColumnId( sal_uInt16 nColId );
+ sal_Bool GoToRowColumnId( long nRow, sal_uInt16 nColId );
+
+ // selections
+ virtual void SetNoSelection();
+ virtual void SelectAll();
+ virtual void SelectRow( long nRow, sal_Bool _bSelect = sal_True, sal_Bool bExpand = sal_True );
+ void SelectColumnPos( sal_uInt16 nCol, sal_Bool _bSelect = sal_True )
+ { SelectColumnPos( nCol, _bSelect, sal_True); }
+ void SelectColumnId( sal_uInt16 nColId, sal_Bool _bSelect = sal_True )
+ { SelectColumnPos( GetColumnPos(nColId), _bSelect, sal_True); }
+ long GetSelectRowCount() const;
+ sal_uInt16 GetSelectColumnCount() const;
+ virtual bool IsRowSelected( long nRow ) const;
+ bool IsColumnSelected( sal_uInt16 nColumnId ) const;
+ long FirstSelectedRow( sal_Bool bInverse = sal_False );
+ long LastSelectedRow();
+ long NextSelectedRow();
+ const MultiSelection* GetColumnSelection() const { return pColSel; }
+ const MultiSelection* GetSelection() const
+ { return bMultiSelection ? uRow.pSel : 0; }
+
+ long FirstSelectedColumn( ) const;
+
+ sal_Bool IsResizing() const { return bResizing; }
+
+ // access to positions of fields, column and rows
+ Window& GetDataWindow() const { return *pDataWin; }
+ Rectangle GetRowRectPixel( long nRow,
+ sal_Bool bRelToBrowser = sal_True ) const;
+ Rectangle GetFieldRectPixel( long nRow, sal_uInt16 nColId,
+ sal_Bool bRelToBrowser = sal_True) const;
+ sal_Bool IsFieldVisible( long nRow, sal_uInt16 nColId,
+ sal_Bool bComplete = sal_False ) const;
+ long GetRowAtYPosPixel( long nY,
+ sal_Bool bRelToBrowser = sal_True ) const;
+ sal_uInt16 GetColumnAtXPosPixel( long nX,
+ sal_Bool bRelToBrowser = sal_True ) const;
+
+ // invalidations
+ void Clear();
+ void RowRemoved( long nRow, long nNumRows = 1, sal_Bool bDoPaint = sal_True );
+ void RowModified( long nRow, sal_uInt16 nColId = BROWSER_INVALIDID );
+ void RowInserted( long nRow, long nNumRows = 1, sal_Bool bDoPaint = sal_True, sal_Bool bKeepSelection = sal_False );
+
+ // miscellanous
+ void ReserveControlArea( sal_uInt16 nWidth = USHRT_MAX );
+ Rectangle GetControlArea() const;
+ sal_Bool ProcessKey( const KeyEvent& rEvt );
+ void Dispatch( sal_uInt16 nId );
+ void SetMode( BrowserMode nMode = 0 );
+ BrowserMode GetMode( ) const { return m_nCurrentMode; }
+
+ void SetCursorColor(const Color& _rCol);
+ Color GetCursorColor() const { return m_aCursorColor; }
+ void ResetSelecting() { bSelecting = sal_False; }
+
+ /** 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( sal_Bool _bEnable = sal_True ) { mbInteractiveRowHeight = _bEnable; }
+ sal_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 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 som margin.
+ */
+ sal_uLong GetDefaultColumnWidth( const String& _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 String GetCellText(long _nRow, sal_uInt16 _nColId) const;
+
+ /** @return
+ the current column count
+ */
+ sal_uInt16 GetColumnCount() const { 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,
+ sal_Bool _bColumnHeaderBar
+ );
+
+ /** returns the Rectangle for either the column header bar ot 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 Rectangle calcHeaderRect(sal_Bool _bIsColumnBar,sal_Bool _bOnScreen = sal_True);
+
+ /** calculates the Rectangle of the table
+ @param _bOnScreen
+ <TRUE/> when the rectangle should be calculated OnScreen
+ @return
+ the Rectangle
+ */
+ virtual Rectangle calcTableRect(sal_Bool _bOnScreen = sal_True);
+
+ /**
+ @param _nRowId
+ the current row
+ @param _nColId
+ the column id
+ @param _bOnScreen
+ <TRUE/> when the rectangle should be calculated OnScreen
+ @return
+ the Rectangle
+ */
+ virtual Rectangle GetFieldRectPixelAbs(sal_Int32 _nRowId,sal_uInt16 _nColId, sal_Bool _bIsHeader, sal_Bool _bOnScreen = sal_True);
+
+ /// return <TRUE/> if and only if the accessible object for this instance has been created and is alive
+ sal_Bool isAccessibleAlive( ) const;
+
+ // ACCESSIBILITY ==========================================================
+public:
+ /** Creates and returns the accessible object of the whole BrowseBox. */
+ virtual css::uno::Reference<
+ css::accessibility::XAccessible > CreateAccessible();
+
+ // 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 );
+
+ /** 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 );
+
+ /** 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 );
+
+ /** @return The count of additional controls of the control area. */
+ virtual sal_Int32 GetAccessibleControlCount() const;
+
+ /** 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 );
+
+ // Conversions ------------------------------------------------------------
+
+ /** 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 sal_Bool ConvertPointToCellAddress(
+ sal_Int32& rnRow, sal_uInt16& rnColumnId, const Point& rPoint );
+
+ /** 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 sal_Bool ConvertPointToRowHeader( sal_Int32& rnRow, const Point& rPoint );
+
+ /** 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 sal_Bool ConvertPointToColumnHeader( sal_uInt16& rnColumnPos, const Point& rPoint );
+
+ /** 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 sal_Bool ConvertPointToControlIndex( sal_Int32& rnIndex, const Point& rPoint );
+
+ // Object data and state --------------------------------------------------
+
+ /** 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 colum/row cell
+ @return
+ The name of the specified object.
+ */
+ virtual OUString GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const;
+
+ /** 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 colum/row cell
+ @return
+ The description of the specified object.
+ */
+ virtual OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const;
+
+ /** @return The header text of the specified row. */
+ virtual OUString GetRowDescription( sal_Int32 nRow ) const;
+
+ /** @return The header text of the specified column. */
+ virtual OUString GetColumnDescription( sal_uInt16 _nColumn ) const;
+
+ /** 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,
+ ::svt::AccessibleBrowseBoxObjType eObjType ) const;
+
+ /** 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;
+
+ /** Sets focus to current cell of the data table. */
+ virtual void GrabTableFocus();
+
+ // IAccessibleTableProvider
+ virtual sal_Int32 GetCurrRow() const;
+ virtual sal_uInt16 GetCurrColumn() const;
+ virtual sal_Bool HasRowHeader() const;
+ virtual sal_Bool IsCellFocusable() const;
+ virtual sal_Bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn );
+ virtual void SelectColumn( sal_uInt16 _nColumn, sal_Bool _bSelect = sal_True );
+ virtual sal_Bool IsColumnSelected( long _nColumn ) const;
+ virtual sal_Int32 GetSelectedRowCount() const;
+ virtual sal_Int32 GetSelectedColumnCount() const;
+ virtual void GetAllSelectedRows( css::uno::Sequence< sal_Int32 >& _rRows ) const;
+ virtual void GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& _rColumns ) const;
+ virtual sal_Bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumn ) const;
+ virtual String GetAccessibleCellText(long _nRow, sal_uInt16 _nColPos) const;
+ virtual sal_Bool GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector );
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
+ virtual void GrabFocus();
+ virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True );
+ virtual Window* GetAccessibleParentWindow() const;
+ virtual Window* GetWindowInstance();
+
+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;
+};
+
+//-------------------------------------------------------------------
+inline const DataFlavorExVector& BrowseBox::GetDataFlavors() const
+{
+ return *reinterpret_cast<DataFlavorExVector*>(implGetDataFlavors());
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/brwhead.hxx b/include/svtools/brwhead.hxx
new file mode 100644
index 000000000000..6eaa06a5f62b
--- /dev/null
+++ b/include/svtools/brwhead.hxx
@@ -0,0 +1,46 @@
+/* -*- 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 _BRWHEAD_HXX
+#define _BRWHEAD_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/headbar.hxx>
+
+class BrowseBox;
+
+//===================================================================
+
+class SVT_DLLPUBLIC BrowserHeader: public HeaderBar
+{
+ BrowseBox* _pBrowseBox;
+
+protected:
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void Select();
+ virtual void EndDrag();
+
+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 000000000000..2c41ae7ed929
--- /dev/null
+++ b/include/svtools/calendar.hxx
@@ -0,0 +1,451 @@
+/* -*- 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 _CALENDAR_HXX
+#define _CALENDAR_HXX
+
+#include "svtools/svtdllapi.h"
+#include <unotools/calendarwrapper.hxx>
+#include <com/sun/star/i18n/Weekdays.hpp>
+
+#include <vcl/ctrl.hxx>
+#include <vcl/timer.hxx>
+#include <vcl/field.hxx>
+#include <set>
+
+class MouseEvent;
+class TrackingEvent;
+class KeyEvent;
+class HelpEvent;
+class DataChangedEvent;
+class FloatingWindow;
+class PushButton;
+class ImplCFieldFloatWin;
+
+/*************************************************************************
+
+Description
+============
+
+class Calendar
+
+This class allows for the selection of a date. The displayed date range is
+the one specified by the Date class. We display as many months as we have
+space in the control. The user can switch between months using a ContextMenu
+(clicking on the month's name) or via two ScrollButtons in-between the months.
+
+--------------------------------------------------------------------------
+
+WinBits
+
+WB_BORDER We draw a border around the window.
+WB_TABSTOP Keyboard control is possible. We get the focus, when
+ the user clicks in the Control.
+WB_QUICKHELPSHOWSDATEINFO Show DateInfo as BallonHelp even if QuickInfo is enabled
+WB_BOLDTEXT We format by bold texts and DIB_BOLD is evaluated by
+ AddDateInfo()
+WB_FRAMEINFO We format in a way, so that FrameInfo can be displayed
+ and the FrameColor is evaluated by AddDateInfo()
+WB_RANGESELECT The user can select multiple days, which need to be
+ consecutive
+WB_MULTISELECT The user can select multiple days
+WB_WEEKNUMBER We also display the weekdays
+
+--------------------------------------------------------------------------
+
+We set and get the selected date by SetCurDate()/GetCurDate().
+If the user selects a date Select() is called. If the user double clicks
+DoubleClick() is called.
+
+--------------------------------------------------------------------------
+
+CalcWindowSizePixel() calculates the window size in pixel that is needed
+to display a certain number of months.
+
+--------------------------------------------------------------------------
+
+SetSaturdayColor() and SetSundayColor() set a special color for Saturdays
+and Sundays.
+AddDateInfo() marks special days. With that we can set e.g. public holidays
+to another color or encircle them (for e.g. appointments).
+If we do not supply a year in the date, the day is used in EVERY year.
+
+AddDateInfo() can also add text for every date, which is displayed if the
+BalloonHelp is enabled.
+In order to not have to supply all years with the relevant data, we call
+the RequestDateInfo() handler if a new year is displayed. We can then query
+the year in the handler with GetRequestYear().
+
+--------------------------------------------------------------------------
+
+In order to display a ContextMenu for a date, we need to override the
+Command handler. GetDate() can infer the date from the mouse's position.
+If we use the keyboard, the current date should be use.
+
+If a ContextMenu is displayed, the baseclass' handler must not be called.
+
+--------------------------------------------------------------------------
+
+For multiple selection (WB_RANGESELECT or WB_MULTISELECT) SelectDate(),
+SelectDateRange() can select date ranges. SelectDateRange() selects
+including the end date.
+SetNoSelection() deselects everything.
+SetCurDate() does not select the current date, but only defines the focus
+rectangle.
+GetSelectDateCount()/GetSelectDate() query the selected range.
+IsDateSelected() queries for the status of a date.
+
+The SelectionChanging() handler is being called while a user selects a
+date. In it, we can change the selected range. E.g. if we want to limit
+or extend the selected range. The selected range is realised via SelectDate()
+and SelectDateRange() and queried with GetSelectDateCount()/GetSelectDate().
+
+IsSelectLeft() returns the direction of the selection:
+sal_True is a selection to the left or up
+sal_False is a selection to the right or down
+
+--------------------------------------------------------------------------
+
+If the DateRange area changes and we want to take over the selection, we
+should only do this is if IsScrollDateRangeChanged() retruns sal_True.
+This method returns sal_True if the area change was triggered by using the
+ScrollButtons and sal_False if it was triggered by Resize(), other method
+calls or by ending a selection.
+
+*************************************************************************/
+
+// ------------------
+// - Calendar types -
+// ------------------
+
+#define WB_QUICKHELPSHOWSDATEINFO ((WinBits)0x00004000)
+#define WB_BOLDTEXT ((WinBits)0x00008000)
+#define WB_FRAMEINFO ((WinBits)0x00010000)
+#define WB_WEEKNUMBER ((WinBits)0x00020000)
+// Needs to in agreement with the WinBits in the TabBar or
+// we move it to \vcl\inc\wintypes.hxx
+#ifndef WB_RANGESELECT
+#define WB_RANGESELECT ((WinBits)0x00200000)
+#endif
+#ifndef WB_MULTISELECT
+#define WB_MULTISELECT ((WinBits)0x00400000)
+#endif
+
+#define DIB_BOLD ((sal_uInt16)0x0001)
+
+// ------------
+// - Calendar -
+// ------------
+
+typedef std::set<sal_uInt32> IntDateSet;
+
+
+class SVT_DLLPUBLIC Calendar : public Control
+{
+private:
+ IntDateSet* mpSelectTable;
+ IntDateSet* mpOldSelectTable;
+ IntDateSet* mpRestoreSelectTable;
+ OUString maDayTexts[31];
+ OUString maDayText;
+ OUString maWeekText;
+ CalendarWrapper maCalendarWrapper;
+ Rectangle maPrevRect;
+ Rectangle maNextRect;
+ String maDayOfWeekText;
+ sal_Int32 mnDayOfWeekAry[7];
+ Date maOldFormatFirstDate;
+ Date maOldFormatLastDate;
+ Date maFirstDate;
+ Date maOldFirstDate;
+ Date maCurDate;
+ Date maOldCurDate;
+ Date maAnchorDate;
+ Date maDropDate;
+ Color maSelColor;
+ Color maOtherColor;
+ Color* mpStandardColor;
+ Color* mpSaturdayColor;
+ Color* mpSundayColor;
+ sal_uLong mnDayCount;
+ long mnDaysOffX;
+ long mnWeekDayOffY;
+ long mnDaysOffY;
+ long mnMonthHeight;
+ long mnMonthWidth;
+ long mnMonthPerLine;
+ long mnLines;
+ long mnDayWidth;
+ long mnDayHeight;
+ long mnWeekWidth;
+ WinBits mnWinStyle;
+ sal_uInt16 mnFirstYear;
+ sal_uInt16 mnLastYear;
+ sal_uInt16 mnRequestYear;
+ sal_Bool mbCalc:1,
+ mbFormat:1,
+ mbDrag:1,
+ mbSelection:1,
+ mbMultiSelection:1,
+ mbWeekSel:1,
+ mbUnSel:1,
+ mbMenuDown:1,
+ mbSpinDown:1,
+ mbPrevIn:1,
+ mbNextIn:1,
+ mbDirect:1,
+ mbInSelChange:1,
+ mbTravelSelect:1,
+ mbScrollDateRange:1,
+ mbSelLeft:1,
+ mbAllSel:1,
+ mbDropPos:1;
+ Link maSelectionChangingHdl;
+ Link maDateRangeChangedHdl;
+ Link maRequestDateInfoHdl;
+ Link maDoubleClickHdl;
+ Link maSelectHdl;
+ Timer maDragScrollTimer;
+ sal_uInt16 mnDragScrollHitTest;
+
+#ifdef _SV_CALENDAR_CXX
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit( WinBits nWinStyle );
+ SVT_DLLPRIVATE void ImplInitSettings();
+ SVT_DLLPRIVATE void ImplGetWeekFont( Font& rFont ) const;
+ SVT_DLLPRIVATE void ImplFormat();
+ using Window::ImplHitTest;
+ SVT_DLLPRIVATE sal_uInt16 ImplHitTest( const Point& rPos, Date& rDate ) const;
+ SVT_DLLPRIVATE void ImplDrawSpin( sal_Bool bDrawPrev = sal_True, sal_Bool bDrawNext = sal_True );
+ SVT_DLLPRIVATE void ImplDrawDate( long nX, long nY,
+ sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear,
+ DayOfWeek eDayOfWeek,
+ sal_Bool bBack = sal_True, sal_Bool bOther = sal_False,
+ sal_uLong nToday = 0 );
+ SVT_DLLPRIVATE void ImplDraw( sal_Bool bPaint = sal_False );
+ SVT_DLLPRIVATE void ImplUpdateDate( const Date& rDate );
+ SVT_DLLPRIVATE void ImplUpdateSelection( IntDateSet* pOld );
+ SVT_DLLPRIVATE void ImplMouseSelect( const Date& rDate, sal_uInt16 nHitTest,
+ sal_Bool bMove, sal_Bool bExpand, sal_Bool bExtended );
+ SVT_DLLPRIVATE void ImplUpdate( sal_Bool bCalcNew = sal_False );
+ using Window::ImplScroll;
+ SVT_DLLPRIVATE void ImplScroll( sal_Bool bPrev );
+ SVT_DLLPRIVATE void ImplInvertDropPos();
+ SVT_DLLPRIVATE void ImplShowMenu( const Point& rPos, const Date& rDate );
+ SVT_DLLPRIVATE void ImplTracking( const Point& rPos, sal_Bool bRepeat );
+ SVT_DLLPRIVATE void ImplEndTracking( sal_Bool bCancel );
+ SVT_DLLPRIVATE DayOfWeek ImplGetWeekStart() const;
+#endif
+
+protected:
+
+ DECL_STATIC_LINK( Calendar, ScrollHdl, Timer *);
+
+public:
+ Calendar( Window* pParent, WinBits nWinStyle = 0 );
+ ~Calendar();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void SelectionChanging();
+ virtual void DateRangeChanged();
+ virtual void RequestDateInfo();
+ virtual void DoubleClick();
+ virtual void Select();
+
+ const CalendarWrapper& GetCalendarWrapper() const { return maCalendarWrapper; }
+
+ void SelectDate( const Date& rDate, sal_Bool bSelect = sal_True );
+ void SetNoSelection();
+ sal_Bool IsDateSelected( const Date& rDate ) const;
+ Date GetFirstSelectedDate() const;
+ void EnableCallEverySelect( sal_Bool bEvery = sal_True ) { mbAllSel = bEvery; }
+ sal_Bool IsCallEverySelectEnabled() const { return mbAllSel; }
+
+ sal_uInt16 GetRequestYear() const { return mnRequestYear; }
+ void SetCurDate( const Date& rNewDate );
+ Date GetCurDate() const { return maCurDate; }
+ void SetFirstDate( const Date& rNewFirstDate );
+ Date GetFirstDate() const { return maFirstDate; }
+ Date GetLastDate() const { return GetFirstDate() + mnDayCount; }
+ sal_uLong GetDayCount() const { return mnDayCount; }
+ Date GetFirstMonth() const;
+ Date GetLastMonth() const;
+ sal_uInt16 GetMonthCount() const;
+ sal_Bool GetDate( const Point& rPos, Date& rDate ) const;
+ Rectangle GetDateRect( const Date& rDate ) const;
+
+ long GetCurMonthPerLine() const { return mnMonthPerLine; }
+ long GetCurLines() const { return mnLines; }
+
+ const Color& GetStandardColor() const;
+ const Color& GetSaturdayColor() const;
+ const Color& GetSundayColor() const;
+
+ void StartSelection();
+ void EndSelection();
+
+ sal_Bool IsTravelSelect() const { return mbTravelSelect; }
+ sal_Bool IsScrollDateRangeChanged() const { return mbScrollDateRange; }
+ sal_Bool IsSelectLeft() const { return mbSelLeft; }
+
+ Size CalcWindowSizePixel( long nCalcMonthPerLine = 1,
+ long nCalcLines = 1 ) const;
+
+ void SetSelectionChangingHdl( const Link& rLink ) { maSelectionChangingHdl = rLink; }
+ const Link& GetSelectionChangingHdl() const { return maSelectionChangingHdl; }
+ void SetDateRangeChangedHdl( const Link& rLink ) { maDateRangeChangedHdl = rLink; }
+ const Link& GetDateRangeChangedHdl() const { return maDateRangeChangedHdl; }
+ void SetRequestDateInfoHdl( const Link& rLink ) { maRequestDateInfoHdl = rLink; }
+ const Link& GetRequestDateInfoHdl() const { return maRequestDateInfoHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+};
+
+inline const Color& Calendar::GetStandardColor() const
+{
+ if ( mpStandardColor )
+ return *mpStandardColor;
+ else
+ return GetFont().GetColor();
+}
+
+inline const Color& Calendar::GetSaturdayColor() const
+{
+ if ( mpSaturdayColor )
+ return *mpSaturdayColor;
+ else
+ return GetFont().GetColor();
+}
+
+inline const Color& Calendar::GetSundayColor() const
+{
+ if ( mpSundayColor )
+ return *mpSundayColor;
+ else
+ return GetFont().GetColor();
+}
+
+/*************************************************************************
+
+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.
+
+--------------------------------------------------------------------------
+
+If we set WB_RANGESELECT with SetCalendarStyle(), we can select multiple days
+in the Calendar.
+
+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.
+
+*************************************************************************/
+
+// -----------------
+// - CalendarField -
+// -----------------
+
+class SVT_DLLPUBLIC CalendarField : public DateField
+{
+private:
+ ImplCFieldFloatWin* mpFloatWin;
+ Calendar* mpCalendar;
+ WinBits mnCalendarStyle;
+ PushButton* mpTodayBtn;
+ PushButton* mpNoneBtn;
+ Date maDefaultDate;
+ sal_Bool mbToday;
+ sal_Bool mbNone;
+ Link maSelectHdl;
+
+#ifdef _SV_CALENDAR_CXX
+ DECL_DLLPRIVATE_LINK( ImplSelectHdl, Calendar* );
+ DECL_DLLPRIVATE_LINK( ImplClickHdl, PushButton* );
+ DECL_DLLPRIVATE_LINK( ImplPopupModeEndHdl, void* );
+#endif
+
+public:
+ CalendarField( Window* pParent, WinBits nWinStyle );
+ ~CalendarField();
+
+ virtual void Select();
+
+ virtual sal_Bool ShowDropDown( sal_Bool bShow );
+ virtual Calendar* CreateCalendar( Window* pParent );
+ Calendar* GetCalendar();
+
+ void SetDefaultDate( const Date& rDate ) { maDefaultDate = rDate; }
+ Date GetDefaultDate() const { return maDefaultDate; }
+
+ void EnableToday( sal_Bool bToday = sal_True ) { mbToday = bToday; }
+ sal_Bool IsTodayEnabled() const { return mbToday; }
+ void EnableNone( sal_Bool bNone = sal_True ) { mbNone = bNone; }
+ sal_Bool IsNoneEnabled() const { return mbNone; }
+
+ void SetCalendarStyle( WinBits nStyle ) { mnCalendarStyle = nStyle; }
+ WinBits GetCalendarStyle() const { return mnCalendarStyle; }
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+
+protected:
+ virtual void StateChanged( StateChangedType nStateChange );
+};
+
+#endif // _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 000000000000..47ff64403dc6
--- /dev/null
+++ b/include/svtools/cliplistener.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 _CLIPLISTENER_HXX
+#define _CLIPLISTENER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/link.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp>
+
+class Window;
+
+
+class SVT_DLLPUBLIC TransferableClipboardListener : public ::cppu::WeakImplHelper1<
+ ::com::sun::star::datatransfer::clipboard::XClipboardListener >
+{
+ Link aLink;
+
+public:
+ // Link is called with a TransferableDataHelper pointer
+ TransferableClipboardListener( const Link& rCallback );
+ ~TransferableClipboardListener();
+
+ void AddRemoveListener( Window* pWin, sal_Bool bAdd );
+ void ClearCallbackLink();
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
+ throw(::com::sun::star::uno::RuntimeException);
+ // XClipboardListener
+ virtual void SAL_CALL changedContents( const ::com::sun::star::datatransfer::clipboard::ClipboardEvent& event )
+ throw(::com::sun::star::uno::RuntimeException);
+};
+
+#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 000000000000..d8abf68ccf82
--- /dev/null
+++ b/include/svtools/collatorres.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 SVTOOLS_COLLATORRESOURCE_HXX
+#define SVTOOLS_COLLATORRESOURCE_HXX
+
+#include "svtools/svtdllapi.h"
+#include <rtl/ustring.hxx>
+
+class CollatorResourceData;
+
+class SVT_DLLPUBLIC CollatorResource
+{
+ private:
+
+ CollatorResourceData *mp_Data;
+
+ public:
+ CollatorResource();
+ ~CollatorResource();
+ const OUString& GetTranslation (const OUString& r_Algorithm);
+};
+
+#endif /* SVTOOLS_COLLATORRESOURCE_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 000000000000..2ea6649bdb8c
--- /dev/null
+++ b/include/svtools/colorcfg.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_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 <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
+#include <unotools/options.hxx>
+
+//-----------------------------------------------------------------------------
+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 ,
+ DRAWGRID ,
+ BASICIDENTIFIER,
+ BASICCOMMENT ,
+ BASICNUMBER ,
+ BASICSTRING ,
+ BASICOPERATOR ,
+ BASICKEYWORD ,
+ BASICERROR ,
+ SQLIDENTIFIER,
+ SQLNUMBER,
+ SQLSTRING,
+ SQLOPERATOR,
+ SQLKEYWORD,
+ SQLPARAMETER,
+ SQLCOMMENT,
+ ColorConfigEntryCount
+};
+
+class ColorConfig_Impl;
+struct ColorConfigValue
+{
+
+ sal_Bool bIsVisible; //validity depends on the element type
+ sal_Int32 nColor;
+ ColorConfigValue() : bIsVisible(sal_False), nColor(0) {}
+ sal_Bool operator !=(const ColorConfigValue& rCmp) const
+ { return nColor != rCmp.nColor || bIsVisible != rCmp.bIsVisible;}
+};
+
+class SVT_DLLPUBLIC ColorConfig:
+ public utl::detail::Options
+{
+ friend class ColorConfig_Impl;
+private:
+ static ColorConfig_Impl* m_pImpl;
+public:
+ ColorConfig();
+ virtual ~ColorConfig();
+
+ // get the configured value - if bSmart is set the default color setting is provided
+ // instead of the automatic color
+ ColorConfigValue GetColorValue(ColorConfigEntry eEntry, sal_Bool bSmart = sal_True)const;
+ static Color GetDefaultColor(ColorConfigEntry eEntry);
+};
+
+class SVT_DLLPUBLIC EditableColorConfig
+{
+ ColorConfig_Impl* m_pImpl;
+ sal_Bool m_bModified;
+public:
+ EditableColorConfig();
+ ~EditableColorConfig();
+
+ ::com::sun::star::uno::Sequence< OUString > GetSchemeNames() const;
+ void DeleteScheme(const OUString& rScheme );
+ void AddScheme(const OUString& rScheme );
+ sal_Bool 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 = sal_False;}
+ sal_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 000000000000..ce155302865b
--- /dev/null
+++ b/include/svtools/colrdlg.hxx
@@ -0,0 +1,60 @@
+/* -*- 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 _SV_COLRDLG_HXX
+#define _SV_COLRDLG_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <tools/color.hxx>
+
+class Window;
+
+// ---------------
+// - ColorDialog -
+// ---------------
+
+namespace svtools
+{
+ // SELECT is the default
+ enum ColorPickerMode { ColorPickerMode_SELECT = 0, ColorPickerMode_ADD = 1, ColorPickerMode_MODIFY = 2 };
+}
+
+class SVT_DLLPUBLIC SvColorDialog
+{
+public:
+ SvColorDialog( ::Window* pParent );
+ virtual ~SvColorDialog();
+
+ void SetColor( const Color& rColor );
+ const Color& GetColor() const;
+
+ void SetMode( sal_Int16 eMode );
+
+ virtual short Execute();
+
+private:
+ Window* mpParent;
+ Color maColor;
+ sal_Int16 meMode;
+};
+
+#endif // _SV_COLRDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/contextmenuhelper.hxx b/include/svtools/contextmenuhelper.hxx
new file mode 100644
index 000000000000..258da5dedbfb
--- /dev/null
+++ b/include/svtools/contextmenuhelper.hxx
@@ -0,0 +1,116 @@
+/* -*- 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_CONTEXTMENUHELPER_HXX
+#define INCLUDED_SVTOOLS_CONTEXTMENUHELPER_HXX
+
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/awt/XPopupMenu.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/ui/XImageManager.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+
+#include <rtl/ustring.hxx>
+#include <cppuhelper/weak.hxx>
+#include <vcl/menu.hxx>
+#include "svtools/svtdllapi.h"
+
+namespace svt
+{
+
+/**
+ Context menu helper class.
+
+ Fills images and labels for a provided popup menu or
+ com.sun.star.awt.XPopupMenu.
+
+ PRECONDITION:
+ All commands must be set via SetItemCommand and are part
+ of the configuration files
+ (see org.openoffice.Office.UI.[Module]Commands.xcu)
+*/
+struct ExecuteInfo;
+class SVT_DLLPUBLIC ContextMenuHelper
+{
+ public:
+ // create context menu helper
+ // ARGS: xFrame = frame defines the context of the context menu
+ // bAutoRefresh = specifies that the context will be constant or not
+ ContextMenuHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, bool bAutoRefresh=true );
+ ~ContextMenuHelper();
+
+ // methods to complete a popup menu (set images, labels, enable/disable states)
+ // ATTENTION: The item ID's must be unique for the whole popup (inclusive the sub menus!)
+ void completeAndExecute( const Point& aPos, PopupMenu& aPopupMenu );
+ void completeAndExecute( const Point& aPos, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >& xPopupMenu );
+
+ private:
+ // asynchronous link to prevent destruction while on stack
+ DECL_STATIC_LINK( ContextMenuHelper, ExecuteHdl_Impl, ExecuteInfo* );
+
+ // no copy-ctor and operator=
+ ContextMenuHelper( const ContextMenuHelper& );
+ const ContextMenuHelper& operator=( const ContextMenuHelper& );
+
+ // show context menu and dispatch command automatically
+ void executePopupMenu( const Point& aPos, PopupMenu* pMenu );
+
+ // fill image and label for every menu item on the provided menu
+ void completeMenuProperties( Menu* pMenu );
+
+ // dispatch provided command
+ bool dispatchCommand( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const OUString& aCommandURL );
+
+
+ // methods to retrieve a single command URL dependent value from a
+ // ui configuratin manager
+ Image getImageFromCommandURL( const OUString& aCmdURL ) const;
+ OUString getLabelFromCommandURL( const OUString& aCmdURL ) const;
+
+ // creates an association between current module/controller bound to the
+ // provided frame and their ui configuration managers.
+ bool associateUIConfigurationManagers();
+
+ // resets associations to create associations again on-demand.
+ // Useful for implementations which recycle frames. Normal
+ // implementations can profit from caching and should set
+ // auto refresh on ctor to false (default).
+ void resetAssociations()
+ {
+ if ( m_bAutoRefresh )
+ m_bUICfgMgrAssociated = false;
+ }
+
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XFrame > m_xWeakFrame;
+ OUString m_aModuleIdentifier;
+ OUString m_aSelf;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aDefaultArgs;
+ ::com::sun::star::uno::Reference< ::com::sun::star::ui::XImageManager > m_xDocImageMgr;
+ ::com::sun::star::uno::Reference< ::com::sun::star::ui::XImageManager > m_xModuleImageMgr;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xUICommandLabels;
+ bool m_bAutoRefresh;
+ bool m_bUICfgMgrAssociated;
+};
+
+} // namespace svt
+
+#endif // INCLUDED_SVTOOLS_CONTEXTMENUHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/controldims.hrc b/include/svtools/controldims.hrc
new file mode 100644
index 000000000000..2d01ddc668e1
--- /dev/null
+++ b/include/svtools/controldims.hrc
@@ -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 _SVT_CONTROLDIMS_HRC_
+#define _SVT_CONTROLDIMS_HRC_
+
+//
+// From: Dialogue Specification and Guidelines - Visual Design V1.3
+// by Christian Jansen
+//
+
+//
+// Usage:
+// ======
+//
+// all values have to be mapped by MAP_APPFONT
+//
+
+// Base
+#define RSC_BS_CHARHEIGHT 8
+#define RSC_BS_CHARWIDTH 4
+
+// control dimensions
+#define RSC_CD_PUSHBUTTON_WIDTH 50
+#define RSC_CD_PUSHBUTTON_HEIGHT 14
+
+#define RSC_CD_FIXEDTEXT_HEIGHT RSC_BS_CHARHEIGHT
+#define RSC_CD_FIXEDLINE_HEIGHT RSC_BS_CHARHEIGHT
+#define RSC_CD_FIXEDLINE_WIDTH RSC_BS_CHARWIDTH // for vertical FixedLines
+
+#define RSC_CD_DROPDOWN_HEIGHT 12 // also combobox and dropdown list
+#define RSC_CD_TEXTBOX_HEIGHT 12 // also numeric fields etc.
+
+#define RSC_CD_CHECKBOX_HEIGHT 10 // also tristate
+#define RSC_CD_RADIOBUTTON_HEIGHT 10
+
+// spacings
+#define RSC_SP_CTRL_X 6 // controls that are unrelated
+#define RSC_SP_CTRL_Y 7
+#define RSC_SP_CTRL_GROUP_X 3 // related controls, or controls in a groupbox
+#define RSC_SP_CTRL_GROUP_Y 4
+#define RSC_SP_CTRL_DESC_X 3 // between description text and related control
+#define RSC_SP_CTRL_DESC_Y 3
+
+// overruled spacings between certain controls
+#define RSC_SP_FLGR_SPACE_X 6 // between groupings made with FixedLine
+#define RSC_SP_FLGR_SPACE_Y 4
+#define RSC_SP_GRP_SPACE_X 6 // between groupings made with GroupBox
+#define RSC_SP_GRP_SPACE_Y 6
+#define RSC_SP_CHK_TEXTINDENT 8 // x indent of text aligned to checkbox title
+
+// dialog inner border
+#define RSC_SP_DLG_INNERBORDER_LEFT 6
+#define RSC_SP_DLG_INNERBORDER_TOP 6
+#define RSC_SP_DLG_INNERBORDER_RIGHT 6
+#define RSC_SP_DLG_INNERBORDER_BOTTOM 6
+
+// tab page inner border
+#define RSC_SP_TBPG_INNERBORDER_LEFT 6 // for tabpage groupings
+#define RSC_SP_TBPG_INNERBORDER_TOP 3
+#define RSC_SP_TBPG_INNERBORDER_RIGHT 6
+#define RSC_SP_TBPG_INNERBORDER_BOTTOM 6
+
+// FixedLine group inner border
+#define RSC_SP_FLGR_INNERBORDER_LEFT 6 // for FixedLine groupings
+#define RSC_SP_FLGR_INNERBORDER_TOP 3
+#define RSC_SP_FLGR_INNERBORDER_RIGHT 0
+#define RSC_SP_FLGR_INNERBORDER_BOTTOM 0
+
+// GroupBox inner border
+#define RSC_SP_GRP_INNERBORDER_LEFT 6 // for GroupBox groupings
+#define RSC_SP_GRP_INNERBORDER_TOP 6
+#define RSC_SP_GRP_INNERBORDER_RIGHT 6
+
+#endif // _SVT_CONTROLDIMS_HRC_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx
new file mode 100644
index 000000000000..39e5bb02bcc0
--- /dev/null
+++ b/include/svtools/ctrlbox.hxx
@@ -0,0 +1,552 @@
+/* -*- 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 _CTRLBOX_HXX
+#define _CTRLBOX_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <tools/string.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/combobox.hxx>
+#include <vcl/image.hxx>
+#include <vcl/virdev.hxx>
+#include <vcl/metric.hxx>
+#include <vcl/field.hxx>
+
+class FontList;
+class ImplColorListData;
+class ImpLineListData;
+
+typedef ::std::vector< ImplColorListData* > ImpColorList;
+typedef ::std::vector< ImpLineListData* > ImpLineList;
+typedef ::std::vector< FontInfo > ImplFontList;
+
+// FIXME: STYLE_* duplicate values from editeng::SvxBorderStyle,
+// which in turn duplicates values from com::sun::star::table::BorderLineStyle:
+// this needs cleaning up on master
+#define STYLE_SOLID ( ( sal_uInt16 ) 0 )
+#define STYLE_DOTTED ( ( sal_uInt16 ) 1 )
+#define STYLE_DASHED ( ( sal_uInt16 ) 2 )
+#define STYLE_FINE_DASHED ( ( sal_uInt16 ) 14 )
+#define STYLE_NONE ( ( sal_uInt16 ) -1)
+
+#define CHANGE_LINE1 ( ( sal_uInt16 ) 1 )
+#define CHANGE_LINE2 ( ( sal_uInt16 ) 2 )
+#define CHANGE_DIST ( ( sal_uInt16 ) 4 )
+#define ADAPT_DIST ( ( sal_uInt16 ) 8 )
+
+
+
+/*************************************************************************
+
+Description
+============
+
+class ColorListBox
+
+Description
+
+Allows color selection
+
+--------------------------------------------------------------------------
+
+class LineListBox
+
+Description
+
+Allows selection of line styles and sizes. Not 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 FUNIT_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 String(),
+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 an 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 FontInfo(), so it will
+contain an list with the standard sizes. Th currently shown size
+probably needs to be reset by the application.
+
+See also
+
+FontList; FontNameBox; FontStyleBox; FontSizeMenu
+
+*************************************************************************/
+
+// ----------------
+// - ColorListBox -
+// ----------------
+
+class SVT_DLLPUBLIC ColorListBox : public ListBox
+{
+ ImpColorList* pColorList; // separate liste, in case of user data are required from outside
+ Size aImageSize;
+
+#ifdef _CTRLBOX_CXX
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit();
+ SVT_DLLPRIVATE void ImplDestroyColorEntries();
+#endif
+public:
+ ColorListBox( Window* pParent,
+ WinBits nWinStyle = WB_BORDER );
+ ColorListBox( Window* pParent, const ResId& rResId );
+ virtual ~ColorListBox();
+
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ using ListBox::InsertEntry;
+ virtual sal_uInt16 InsertEntry( const XubString& rStr,
+ sal_uInt16 nPos = LISTBOX_APPEND );
+ virtual sal_uInt16 InsertEntry( const Color& rColor, const XubString& rStr,
+ sal_uInt16 nPos = LISTBOX_APPEND );
+ void InsertAutomaticEntryColor(const Color &rAutoColorValue);
+ bool IsAutomaticSelected() { return !GetSelectEntryPos(); }
+ using ListBox::RemoveEntry;
+ virtual void RemoveEntry( sal_uInt16 nPos );
+ virtual void Clear();
+ void CopyEntries( const ColorListBox& rBox );
+
+ using ListBox::GetEntryPos;
+ virtual sal_uInt16 GetEntryPos( const Color& rColor ) const;
+ virtual Color GetEntryColor( sal_uInt16 nPos ) const;
+ Size GetImageSize() const { return aImageSize; }
+
+ void SelectEntry( const XubString& rStr, sal_Bool bSelect = sal_True )
+ { ListBox::SelectEntry( rStr, bSelect ); }
+ void SelectEntry( const Color& rColor, sal_Bool bSelect = sal_True );
+ XubString GetSelectEntry( sal_uInt16 nSelIndex = 0 ) const
+ { return ListBox::GetSelectEntry( nSelIndex ); }
+ Color GetSelectEntryColor( sal_uInt16 nSelIndex = 0 ) const;
+ sal_Bool IsEntrySelected( const XubString& rStr ) const
+ { return ListBox::IsEntrySelected( rStr ); }
+
+ sal_Bool IsEntrySelected( const Color& rColor ) const;
+
+private:
+ // declared as private because some compilers would generate the default functions
+ ColorListBox( const ColorListBox& );
+ ColorListBox& operator =( const ColorListBox& );
+
+ void SetEntryData( sal_uInt16 nPos, void* pNewData );
+ void* GetEntryData( sal_uInt16 nPos ) const;
+};
+
+inline void ColorListBox::SelectEntry( const Color& rColor, sal_Bool bSelect )
+{
+ sal_uInt16 nPos = GetEntryPos( rColor );
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ ListBox::SelectEntryPos( nPos, bSelect );
+}
+
+inline sal_Bool ColorListBox::IsEntrySelected( const Color& rColor ) const
+{
+ sal_uInt16 nPos = GetEntryPos( rColor );
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ return IsEntryPosSelected( nPos );
+ else
+ return sal_False;
+}
+
+inline Color ColorListBox::GetSelectEntryColor( sal_uInt16 nSelIndex ) const
+{
+ sal_uInt16 nPos = GetSelectEntryPos( nSelIndex );
+ Color aColor;
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ aColor = GetEntryColor( nPos );
+ return aColor;
+}
+
+// ---------------
+// - LineListBox -
+// ---------------
+
+/**
+ 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.
+ */
+class SVT_DLLPUBLIC BorderWidthImpl
+{
+ sal_uInt16 m_nFlags;
+ double m_nRate1;
+ double m_nRate2;
+ double m_nRateGap;
+
+public:
+
+ BorderWidthImpl( sal_uInt16 nFlags = CHANGE_LINE1, double nRate1 = 0.0,
+ double nRate2 = 0.0, double nRateGap = 0.0 );
+
+ BorderWidthImpl& operator= ( const BorderWidthImpl& r );
+ 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); }
+};
+
+SVT_DLLPUBLIC inline Color sameColor( Color rMain )
+{
+ return rMain;
+}
+
+SVT_DLLPUBLIC inline Color sameDistColor( Color /*rMain*/, Color rDefault )
+{
+ return rDefault;
+}
+
+
+class SVT_DLLPUBLIC LineListBox : public ListBox
+{
+ ImpLineList* pLineList;
+ long m_nWidth;
+ XubString m_sNone;
+
+ VirtualDevice aVirDev;
+ Size aTxtSize;
+ Color aColor;
+ Color maPaintCol;
+ FieldUnit eUnit;
+ FieldUnit eSourceUnit;
+
+ SVT_DLLPRIVATE void ImpGetLine( long nLine1, long nLine2, long nDistance,
+ Color nColor1, Color nColor2, Color nColorDist,
+ sal_uInt16 nStyle, Bitmap& rBmp );
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit();
+ sal_Bool UpdatePaintLineColor( void ); // returns sal_True if maPaintCol has changed
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void UpdateEntries( long nOldWidth );
+ sal_uInt16 GetStylePos( sal_uInt16 nListPos, long nWidth );
+
+public:
+ LineListBox( Window* pParent, WinBits nWinStyle = WB_BORDER );
+ LineListBox( Window* pParent, const ResId& rResId );
+ virtual ~LineListBox();
+
+ /** Set the width in Twips */
+ void SetWidth( long nWidth );
+ void SetNone( const XubString& sNone );
+
+ using ListBox::InsertEntry;
+ virtual sal_uInt16 InsertEntry( const XubString& rStr, sal_uInt16 nPos = LISTBOX_APPEND );
+ /** Insert a listbox entry with all widths in Twips. */
+ void InsertEntry( BorderWidthImpl aWidthImpl,
+ sal_uInt16 nStyle, long nMinWidth = 0,
+ Color (*pColor1Fn)(Color) = &sameColor,
+ Color (*pColor2Fn)( Color ) = &sameColor,
+ Color (*pColorDistFn)( Color, Color ) = &sameDistColor );
+
+ using ListBox::RemoveEntry;
+ virtual void RemoveEntry( sal_uInt16 nPos );
+ virtual void Clear();
+
+ using ListBox::GetEntryPos;
+ virtual sal_uInt16 GetEntryPos( sal_uInt16 nStyle = STYLE_SOLID ) const;
+ sal_uInt16 GetEntryStyle( sal_uInt16 nPos ) const;
+
+ void SelectEntry( const XubString& rStr, sal_Bool bSelect = sal_True ) { ListBox::SelectEntry( rStr, bSelect ); }
+ void SelectEntry( sal_uInt16 nStyle = STYLE_SOLID, sal_Bool bSelect = sal_True );
+ sal_uInt16 GetSelectEntryStyle( sal_uInt16 nSelIndex = 0 ) const;
+ inline sal_Bool IsEntrySelected( const XubString& rStr ) const { return ListBox::IsEntrySelected( rStr ); }
+ sal_Bool IsEntrySelected( sal_uInt16 nStyle1 = STYLE_SOLID ) const;
+
+ inline void SetUnit( FieldUnit eNewUnit ) { eUnit = eNewUnit; }
+ inline FieldUnit GetUnit() const { return eUnit; }
+ inline void SetSourceUnit( FieldUnit eNewUnit ) { eSourceUnit = eNewUnit; }
+ inline FieldUnit GetSourceUnit() const { return eSourceUnit; }
+
+ void SetColor( const Color& rColor );
+ inline Color GetColor( void ) const;
+
+protected:
+
+ inline const Color& GetPaintColor( void ) const;
+ Color GetColorLine1( sal_uInt16 nPos = 0 );
+ Color GetColorLine2( sal_uInt16 nPos = 0 );
+ Color GetColorDist( sal_uInt16 nPos = 0 );
+
+private:
+ // declared as private because some compilers would generate the default methods
+ LineListBox( const LineListBox& );
+ LineListBox& operator =( const LineListBox& );
+ void SetEntryData( sal_uInt16 nPos, void* pNewData );
+ void* GetEntryData( sal_uInt16 nPos ) const;
+};
+
+inline sal_Bool LineListBox::IsEntrySelected( sal_uInt16 nStyle ) const
+{
+ sal_uInt16 nPos = GetEntryPos( nStyle );
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ return IsEntryPosSelected( nPos );
+ else
+ return sal_False;
+}
+
+inline void LineListBox::SetColor( const Color& rColor )
+{
+ aColor = rColor;
+
+ UpdateEntries( m_nWidth );
+}
+
+inline Color LineListBox::GetColor( void ) const
+{
+ return aColor;
+}
+
+const Color& LineListBox::GetPaintColor( void ) const
+{
+ return maPaintCol;
+}
+
+inline void LineListBox::SetWidth( long nWidth )
+{
+ long nOldWidth = m_nWidth;
+ m_nWidth = nWidth;
+ UpdateEntries( nOldWidth );
+}
+
+inline void LineListBox::SetNone( const XubString& sNone )
+{
+ m_sNone = sNone;
+}
+
+// ---------------
+// - FontNameBox -
+// ---------------
+
+class SVT_DLLPUBLIC FontNameBox : public ComboBox
+{
+private:
+ ImplFontList* mpFontList;
+ sal_Bool mbWYSIWYG;
+ String maFontMRUEntriesFile;
+
+#ifdef _CTRLBOX_CXX
+ SVT_DLLPRIVATE void ImplCalcUserItemSize();
+ SVT_DLLPRIVATE void ImplDestroyFontList();
+#endif
+
+protected:
+ void LoadMRUEntries( const String& aFontMRUEntriesFile, sal_Unicode cSep = ';' );
+ void SaveMRUEntries( const String& aFontMRUEntriesFile, sal_Unicode cSep = ';' ) const;
+public:
+ FontNameBox( Window* pParent,
+ WinBits nWinStyle = WB_SORT );
+ FontNameBox( Window* pParent, const ResId& rResId );
+ virtual ~FontNameBox();
+
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ void Fill( const FontList* pList );
+
+ void EnableWYSIWYG( sal_Bool bEnable = sal_True );
+ sal_Bool IsWYSIWYGEnabled() const { return mbWYSIWYG; }
+
+private:
+ void InitFontMRUEntriesFile();
+
+ // declared as private because some compilers would generate the default functions
+ FontNameBox( const FontNameBox& );
+ FontNameBox& operator =( const FontNameBox& );
+};
+
+// ----------------
+// - FontStyleBox -
+// ----------------
+
+class SVT_DLLPUBLIC FontStyleBox : public ComboBox
+{
+ XubString aLastStyle;
+
+private:
+ using ComboBox::SetText;
+public:
+ FontStyleBox( Window* pParent, const ResId& rResId );
+ FontStyleBox( Window* pParent, WinBits nBits );
+ virtual ~FontStyleBox();
+
+ virtual void Select();
+ virtual void LoseFocus();
+ virtual void Modify();
+
+ void SetText( const OUString& rText );
+ void Fill( const XubString& rName, const FontList* pList );
+
+private:
+ // declared as private because some compilers would generate the default functions
+ FontStyleBox( const FontStyleBox& );
+ FontStyleBox& operator =( const FontStyleBox& );
+};
+
+inline void FontStyleBox::SetText( const OUString& rText )
+{
+ aLastStyle = rText;
+ ComboBox::SetText( rText );
+}
+
+// ---------------
+// - FontSizeBox -
+// ---------------
+
+class SVT_DLLPUBLIC FontSizeBox : public MetricBox
+{
+ FontInfo aFontInfo;
+ const FontList* pFontList;
+ sal_uInt16 nRelMin;
+ sal_uInt16 nRelMax;
+ sal_uInt16 nRelStep;
+ short nPtRelMin;
+ short nPtRelMax;
+ short nPtRelStep;
+ sal_Bool bRelativeMode:1,
+ bRelative:1,
+ bPtRelative:1,
+ bStdSize:1;
+
+#ifdef _CTRLBOX_CXX
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit();
+#endif
+
+protected:
+ virtual OUString CreateFieldText( sal_Int64 nValue ) const;
+
+public:
+ FontSizeBox( Window* pParent, WinBits nWinStyle = 0 );
+ FontSizeBox( Window* pParent, const ResId& rResId );
+ virtual ~FontSizeBox();
+
+ void Reformat();
+ void Modify();
+
+ void Fill( const FontInfo* pInfo, const FontList* pList );
+
+ void EnableRelativeMode( sal_uInt16 nMin = 50, sal_uInt16 nMax = 150,
+ sal_uInt16 nStep = 5 );
+ void EnablePtRelativeMode( short nMin = -200, short nMax = 200,
+ short nStep = 10 );
+ sal_Bool IsRelativeMode() const { return bRelativeMode; }
+ void SetRelative( sal_Bool bRelative = sal_False );
+ sal_Bool IsRelative() const { return bRelative; }
+ void SetPtRelative( sal_Bool bPtRel = sal_True )
+ { bPtRelative = bPtRel; SetRelative( sal_True ); }
+ sal_Bool IsPtRelative() const { return bPtRelative; }
+
+ virtual void SetValue( sal_Int64 nNewValue, FieldUnit eInUnit );
+ virtual void SetValue( sal_Int64 nNewValue );
+ virtual sal_Int64 GetValue( FieldUnit eOutUnit ) const;
+ virtual sal_Int64 GetValue() const;
+ sal_Int64 GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const;
+
+private:
+ // declared as private because some compilers would generate the default functions
+ FontSizeBox( const FontSizeBox& );
+ FontSizeBox& operator =( const FontSizeBox& );
+};
+
+#endif // _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 000000000000..b90f1b67a532
--- /dev/null
+++ b/include/svtools/ctrltool.hxx
@@ -0,0 +1,241 @@
+/* -*- 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 _CTRLTOOL_HXX
+#define _CTRLTOOL_HXX
+
+#include <boost/ptr_container/ptr_vector.hpp>
+
+#include "svtools/svtdllapi.h"
+#include <rtl/ustring.hxx>
+#include <sal/types.h>
+#include <vcl/metric.hxx>
+
+class ImplFontListNameInfo;
+class OutputDevice;
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class FontList
+
+Diese Klasse verwaltet alle Fonts, die auf einem oder zwei Ausgabegeraeten
+dargestellt werden koennen. Zusaetzlich bietet die Klasse Methoden an, um
+aus Fett und Kursiv den StyleName zu generieren oder aus einem Stylename
+die fehlenden Attribute. Zusaetzlich kann diese Klasse syntetisch nachgebildete
+Fonts verarbeiten. Diese Klasse kann mit verschiedenen Standard-Controls und
+Standard-Menus zusammenarbeiten.
+
+Querverweise
+
+class FontNameBox, class FontStyleBox, class FontSizeBox,
+class FontNameMenu, class FontSizeMenu
+
+--------------------------------------------------------------------------
+
+FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2 = NULL,
+ sal_Bool bAll = sal_True );
+
+Konstruktor der Klasse FontList. Vom uebergebenen OutputDevice werden die
+entsprechenden Fonts abgefragt. Das OutputDevice muss solange existieren,
+wie auch die Klasse FontList existiert. Optional kann noch ein 2tes
+Ausgabedevice uebergeben werden, damit man zum Beispiel die Fonts von
+einem Drucker und dem Bildschirm zusammen in einer FontListe verwalten kann
+und somit auch den FontListen und FontMenus die Fonts von beiden OutputDevices
+zu uebergeben. Auch das pDevice2 muss solange existieren, wie die Klasse
+FontList existiert.
+
+Das OutputDevice, welches als erstes uebergeben wird, sollte das bevorzugte
+sein. Dies sollte im normalfall der Drucker sein. Denn wenn 2 verschiede
+Device-Schriften (eine fuer Drucker und eine fuer den Bildschirm) vorhanden
+sind, wird die vom uebergebenen Device "pDevice" bevorzugt.
+
+Mit dem dritten Parameter kann man angeben, ob nur skalierbare Schriften
+abgefragt werden sollen oder alle. Wenn sal_True uebergeben wird, werden auch
+Bitmap-Schriften mit abgefragt. Bei sal_False werden Vector-Schriften und
+scalierbare Schriften abgefragt.
+
+--------------------------------------------------------------------------
+
+String FontList::GetStyleName( const FontInfo& rInfo ) const;
+
+Diese Methode gibt den StyleName von einer FontInfo zurueck. Falls kein
+StyleName gesetzt ist, wird aus den gesetzten Attributen ein entsprechender
+Name generiert, der dem Anwender praesentiert werden kann.
+
+--------------------------------------------------------------------------
+
+XubString FontList::GetFontMapText( const FontInfo& rInfo ) const;
+
+Diese Methode gibt einen Matchstring zurueck, der dem Anwender
+anzeigen soll, welche Probleme es mit diesem Font geben kann.
+
+--------------------------------------------------------------------------
+
+FontInfo FontList::Get( const String& rName, const String& rStyleName ) const;
+
+Diese Methode sucht aus dem uebergebenen Namen und dem uebergebenen StyleName
+die entsprechende FontInfo-Struktur raus. Der Stylename kann in dieser
+Methode auch ein syntetischer sein. In diesem Fall werden die entsprechenden
+Werte in der FontInfo-Struktur entsprechend gesetzt. Wenn ein StyleName
+uebergeben wird, kann jedoch eine FontInfo-Struktur ohne Stylename
+zurueckgegeben werden. Um den StyleName dem Anwender zu repraesentieren,
+muss GetStyleName() mit dieser FontInfo-Struktur aufgerufen werden.
+
+Querverweise
+
+FontList::GetStyleName()
+
+--------------------------------------------------------------------------
+
+FontInfo FontList::Get( const String& rName, FontWeight eWeight,
+ FontItalic eItalic ) const;
+
+Diese Methode sucht aus dem uebergebenen Namen und den uebergebenen Styles
+die entsprechende FontInfo-Struktur raus. Diese Methode kann auch eine
+FontInfo-Struktur ohne Stylename zurueckgegeben. Um den StyleName dem
+Anwender zu repraesentieren, muss GetStyleName() mit dieser FontInfo-Struktur
+aufgerufen werden.
+
+Querverweise
+
+FontList::GetStyleName()
+
+--------------------------------------------------------------------------
+
+const long* FontList::GetSizeAry( const FontInfo& rInfo ) const;
+
+Diese Methode liefert zum uebergebenen Font die vorhandenen Groessen.
+Falls es sich dabei um einen skalierbaren Font handelt, werden Standard-
+Groessen zurueckgegeben. Das Array enthaelt die Hoehen des Fonts in 10tel
+Point. Der letzte Wert des Array ist 0. Das Array, was zurueckgegeben wird,
+wird von der FontList wieder zerstoert. Nach dem Aufruf der naechsten Methode
+von der FontList, sollte deshalb das Array nicht mehr referenziert werden.
+
+*************************************************************************/
+
+// ------------
+// - FontList -
+// ------------
+
+#define FONTLIST_FONTINFO_NOTFOUND ((sal_uInt16)0xFFFF)
+
+#define FONTLIST_FONTNAMETYPE_PRINTER ((sal_uInt16)0x0001)
+#define FONTLIST_FONTNAMETYPE_SCREEN ((sal_uInt16)0x0002)
+
+class SVT_DLLPUBLIC FontList
+{
+private:
+ OUString maMapBoth;
+ OUString maMapPrinterOnly;
+ OUString maMapScreenOnly;
+ OUString maMapSizeNotAvailable;
+ OUString maMapStyleNotAvailable;
+ OUString maMapNotAvailable;
+ OUString maLight;
+ OUString maLightItalic;
+ OUString maNormal;
+ OUString maNormalItalic;
+ OUString maBold;
+ OUString maBoldItalic;
+ OUString maBlack;
+ OUString maBlackItalic;
+ long* mpSizeAry;
+ OutputDevice* mpDev;
+ OutputDevice* mpDev2;
+ boost::ptr_vector<ImplFontListNameInfo> maEntries;
+#ifdef CTRLTOOL_CXX
+ SVT_DLLPRIVATE ImplFontListNameInfo* ImplFind( const OUString& rSearchName, sal_uLong* pIndex ) const;
+ SVT_DLLPRIVATE ImplFontListNameInfo* ImplFindByName( const OUString& rStr ) const;
+ SVT_DLLPRIVATE void ImplInsertFonts( OutputDevice* pDev, sal_Bool bAll,
+ sal_Bool bInsertData );
+#endif
+
+public:
+ FontList( OutputDevice* pDevice,
+ OutputDevice* pDevice2 = NULL,
+ sal_Bool bAll = sal_True );
+ ~FontList();
+
+ FontList* Clone() const;
+
+ OutputDevice* GetDevice() const { return mpDev; }
+ OutputDevice* GetDevice2() const { return mpDev2; }
+ XubString GetFontMapText( const FontInfo& rInfo ) 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 FontInfo& rInfo ) const;
+
+ FontInfo Get( const OUString& rName,
+ const OUString& rStyleName ) const;
+ FontInfo Get( const OUString& rName,
+ FontWeight eWeight,
+ FontItalic eItalic ) const;
+
+ sal_Bool IsAvailable( const OUString& rName ) const;
+ sal_uInt16 GetFontNameCount() const
+ {
+ return (sal_uInt16)maEntries.size();
+ }
+ const FontInfo& GetFontName( sal_uInt16 nFont ) const;
+ sal_Handle GetFirstFontInfo( const OUString& rName ) const;
+ sal_Handle GetNextFontInfo( sal_Handle hFontInfo ) const;
+ const FontInfo& GetFontInfo( sal_Handle hFontInfo ) const;
+
+ const long* GetSizeAry( const FontInfo& rInfo ) const;
+ static const long* GetStdSizeAry();
+
+private:
+ FontList( const FontList& );
+ FontList& operator =( const FontList& );
+};
+
+
+// -----------------
+// - FontSizeNames -
+// -----------------
+
+class SVT_DLLPUBLIC FontSizeNames
+{
+private:
+ const struct ImplFSNameItem* mpArray;
+ sal_uLong mnElem;
+
+public:
+ FontSizeNames( LanguageType eLanguage /* = LANGUAGE_DONTKNOW */ );
+
+ sal_uLong Count() const { return mnElem; }
+ sal_Bool IsEmpty() const { return !mnElem; }
+
+ long Name2Size( const String& ) const;
+ String Size2Name( long ) const;
+
+ String GetIndexName( sal_uLong nIndex ) const;
+ long GetIndexSize( sal_uLong nIndex ) const;
+};
+
+#endif // _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 000000000000..afaad3854827
--- /dev/null
+++ b/include/svtools/dialogclosedlistener.hxx
@@ -0,0 +1,69 @@
+/* -*- 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_DIALOGCLOSEDLISTENER_HXX
+#define _SVTOOLS_DIALOGCLOSEDLISTENER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/ui/dialogs/XDialogClosedListener.hpp>
+#include <tools/link.hxx>
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ //=====================================================================
+ //= ODialogClosedListener
+ //=====================================================================
+ /**
+ C++ class to implement a ::com::sun::star::ui::dialogs::XDialogClosedListener
+ */
+ class SVT_DLLPUBLIC DialogClosedListener :
+ public ::cppu::WeakImplHelper1< ::com::sun::star::ui::dialogs::XDialogClosedListener >
+ {
+ private:
+ /**
+ This link will be called when the dialog was closed.
+
+ The link must have the type:
+ DECL_LINK( DialogClosedHdl, ::com::sun::star::ui::dialogs::DialogClosedEvent* );
+ */
+ Link m_aDialogClosedLink;
+
+ public:
+ DialogClosedListener();
+
+ inline void SetDialogClosedLink( const Link& rLink ) { m_aDialogClosedLink = rLink; }
+
+ // XDialogClosedListener methods
+ virtual void SAL_CALL dialogClosed( const ::com::sun::star::ui::dialogs::DialogClosedEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener methods
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( ::com::sun::star::uno::RuntimeException );
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif// COMPHELPER_DIALOGCLOSEDLISTENER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/dialogcontrolling.hxx b/include/svtools/dialogcontrolling.hxx
new file mode 100644
index 000000000000..56d31d4e7161
--- /dev/null
+++ b/include/svtools/dialogcontrolling.hxx
@@ -0,0 +1,293 @@
+/* -*- 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_DIALOGCONTROLLING_HXX
+#define SVTOOLS_DIALOGCONTROLLING_HXX
+
+#include <svtools/svtdllapi.h>
+
+#include <tools/link.hxx>
+#include <vcl/button.hxx>
+
+#include <vector>
+#include <boost/shared_ptr.hpp>
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //=====================================================================
+ //= IWindowOperator
+ //=====================================================================
+ /** an abstract interface for operating on a ->Window
+ */
+ class SVT_DLLPUBLIC SAL_NO_VTABLE IWindowOperator
+ {
+ public:
+ /** called when an event happened which should be reacted to
+
+ @param _rTrigger
+ the event which triggered the call. If the Id of the event is 0, then this is the initial
+ call which is made when ->_rOperateOn is added to the responsibility of the DialogController.
+ @param _rOperateOn
+ the window on which to operate
+ */
+ virtual void operateOn( const VclWindowEvent& _rTrigger, Window& _rOperateOn ) const = 0;
+
+ virtual ~IWindowOperator();
+ };
+ typedef ::boost::shared_ptr< IWindowOperator > PWindowOperator;
+
+ //=====================================================================
+ //= IWindowEventFilter
+ //=====================================================================
+ /** an abstract interface for deciding whether a ->VclWindowEvent
+ is worth paying attention to
+ */
+ class SVT_DLLPUBLIC SAL_NO_VTABLE IWindowEventFilter
+ {
+ public:
+ virtual bool payAttentionTo( const VclWindowEvent& _rEvent ) const = 0;
+
+ virtual ~IWindowEventFilter();
+ };
+ typedef ::boost::shared_ptr< IWindowEventFilter > PWindowEventFilter;
+
+ //=====================================================================
+ //= DialogController
+ //=====================================================================
+ struct DialogController_Data;
+ /** a class controlling interactions between dialog controls
+
+ An instance of this class listens to all events fired by a certain
+ ->Control (more precise, a ->Window), the so-called instigator.
+
+ Additionally, the ->DialogController maintains a list of windows which
+ are affected by changes in the instigator window. Let's call those the
+ dependent windows.
+
+ Now, by help of an owner-provided ->IWindowEventFilter, the ->DialogController
+ decides which events are worth attention. By help of an owner-provided
+ ->IWindowOperator, it handles those events for all dependent windows.
+ */
+ class SVT_DLLPUBLIC DialogController
+ {
+ private:
+ ::std::auto_ptr< DialogController_Data > m_pImpl;
+
+ public:
+ DialogController( Window& _rInstigator, const PWindowEventFilter& _pEventFilter, const PWindowOperator& _pOperator );
+ virtual ~DialogController();
+
+ /** adds a window to the list of dependent windows
+
+ @param _rWindow
+ The window to add to the list of dependent windows.
+
+ The caller is responsible for life-time control: The given window
+ must live at least as long as the ->DialogController instance does.
+ */
+ void addDependentWindow( Window& _rWindow );
+
+ /** resets the controller so that no actions happened anymore.
+
+ The instances is disfunctional after this method has been called.
+ */
+ void reset();
+
+ private:
+ void impl_Init();
+ void impl_updateAll( const VclWindowEvent& _rTriggerEvent );
+ void impl_update( const VclWindowEvent& _rTriggerEvent, Window& _rWindow );
+
+ DECL_LINK( OnWindowEvent, const VclWindowEvent* );
+
+ private:
+ DialogController( const DialogController& ); // never implemented
+ DialogController& operator=( const DialogController& ); // never implemented
+ };
+ typedef ::boost::shared_ptr< DialogController > PDialogController;
+
+ //=====================================================================
+ //= ControlDependencyManager
+ //=====================================================================
+ struct ControlDependencyManager_Data;
+ /** helper class for managing control dependencies
+
+ Instances of this class are intended to be held as members of a dialog/tabpage/whatever
+ class, with easy administration of inter-control dependencies (such as "Enable
+ control X if and only if checkbox Y is checked).
+ */
+ class SVT_DLLPUBLIC ControlDependencyManager
+ {
+ private:
+ ::std::auto_ptr< ControlDependencyManager_Data > m_pImpl;
+
+ public:
+ ControlDependencyManager();
+ ~ControlDependencyManager();
+
+ /** clears all dialog controllers previously added to the manager
+ */
+ void clear();
+
+ /** ensures that a given window is enabled or disabled, according to the check state
+ of a given radio button
+ @param _rRadio
+ denotes the radio button whose check state is to observe
+ @param _rDependentWindow
+ denotes the window which should be enabled when ->_rRadio is checked, and
+ disabled when it's unchecked
+ */
+ void enableOnRadioCheck( RadioButton& _rRadio, Window& _rDependentWindow );
+ void enableOnRadioCheck( RadioButton& _rRadio, Window& _rDependentWindow1, Window& _rDependentWindow2, Window& _rDependentWindow3 );
+ void enableOnRadioCheck( RadioButton& _rRadio, Window& _rDependentWindow1, Window& _rDependentWindow2, Window& _rDependentWindow3, Window& _rDependentWindow4, Window& _rDependentWindow5 );
+
+ /** ensures that a given window is enabled or disabled, according to the mark state
+ of a given check box
+ @param _rBox
+ denotes the check box whose mark state is to observe
+ @param _rDependentWindow
+ denotes the window which should be enabled when ->_rBox is marked, and
+ disabled when it's unmarked
+ */
+ void enableOnCheckMark( CheckBox& _rBox, Window& _rDependentWindow );
+ void enableOnCheckMark( CheckBox& _rBox, Window& _rDependentWindow1, Window& _rDependentWindow2 );
+ void enableOnCheckMark( CheckBox& _rBox, Window& _rDependentWindow1, Window& _rDependentWindow2, Window& _rDependentWindow3, Window& _rDependentWindow4 );
+
+ /** adds a non-standard controller whose functionality is not covered by the other methods
+
+ @param _pController
+ the controller to add to the manager. Must not be <NULL/>.
+ */
+ void addController( const PDialogController& _pController );
+
+ private:
+ ControlDependencyManager( const ControlDependencyManager& ); // never implemented
+ ControlDependencyManager& operator=( const ControlDependencyManager& ); // never implemented
+ };
+
+ //=====================================================================
+ //= EnableOnCheck
+ //=====================================================================
+ /** a helper class implementing the ->IWindowOperator interface,
+ which enables a dependent window depending on the check state of
+ an instigator window.
+
+ @see DialogController
+ */
+ template< class CHECKABLE >
+ class SVT_DLLPUBLIC EnableOnCheck : public IWindowOperator
+ {
+ public:
+ typedef CHECKABLE SourceType;
+
+ private:
+ SourceType& m_rCheckable;
+
+ public:
+ /** constructs the instance
+
+ @param _rCheckable
+ a ->Window instance which supports a boolean method IsChecked. Usually
+ a ->RadioButton or ->CheckBox
+ */
+ EnableOnCheck( SourceType& _rCheckable )
+ :m_rCheckable( _rCheckable )
+ {
+ }
+
+ virtual void operateOn( const VclWindowEvent& /*_rTrigger*/, Window& _rOperateOn ) const
+ {
+ _rOperateOn.Enable( m_rCheckable.IsChecked() );
+ }
+ };
+
+ //=====================================================================
+ //= FilterForRadioOrCheckToggle
+ //=====================================================================
+ /** a helper class implementing the ->IWindowEventFilter interface,
+ which filters for radio buttons or check boxes being toggled.
+
+ Technically, the class simply filters for the ->VCLEVENT_RADIOBUTTON_TOGGLE
+ and the ->VCLEVENT_CHECKBOX_TOGGLE event.
+ */
+ class SVT_DLLPUBLIC FilterForRadioOrCheckToggle : public IWindowEventFilter
+ {
+ const Window& m_rWindow;
+ public:
+ FilterForRadioOrCheckToggle( const Window& _rWindow )
+ :m_rWindow( _rWindow )
+ {
+ }
+
+ bool payAttentionTo( const VclWindowEvent& _rEvent ) const
+ {
+ if ( ( _rEvent.GetWindow() == &m_rWindow )
+ && ( ( _rEvent.GetId() == VCLEVENT_RADIOBUTTON_TOGGLE )
+ || ( _rEvent.GetId() == VCLEVENT_CHECKBOX_TOGGLE )
+ )
+ )
+ return true;
+ return false;
+ }
+ };
+
+ //=====================================================================
+ //= RadioDependentEnabler
+ //=====================================================================
+ /** a ->DialogController derivee which enables or disables its dependent windows,
+ depending on the check state of a radio button.
+
+ The usage of this class is as simple as
+ <code>
+ pController = new RadioDependentEnabler( m_aOptionSelectSomething );
+ pController->addDependentWindow( m_aLabelSelection );
+ pController->addDependentWindow( m_aListSelection );
+ </code>
+
+ With this, both <code>m_aLabelSelection</code> and <code>m_aListSelection</code> will
+ be disabled if and only <code>m_aOptionSelectSomething</code> is checked.
+ */
+ class SVT_DLLPUBLIC RadioDependentEnabler : public DialogController
+ {
+ public:
+ RadioDependentEnabler( RadioButton& _rButton )
+ :DialogController( _rButton,
+ PWindowEventFilter( new FilterForRadioOrCheckToggle( _rButton ) ),
+ PWindowOperator( new EnableOnCheck< RadioButton >( _rButton ) ) )
+ {
+ }
+
+ RadioDependentEnabler( CheckBox& _rBox )
+ :DialogController( _rBox,
+ PWindowEventFilter( new FilterForRadioOrCheckToggle( _rBox ) ),
+ PWindowOperator( new EnableOnCheck< CheckBox >( _rBox ) ) )
+ {
+ }
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVTOOLS_DIALOGCONTROLLING_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 000000000000..c9299d363c0a
--- /dev/null
+++ b/include/svtools/editbrowsebox.hxx
@@ -0,0 +1,685 @@
+/* -*- 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_EDITBROWSEBOX_HXX_
+#define _SVTOOLS_EDITBROWSEBOX_HXX_
+#define SVTOOLS_IN_EDITBROWSEBOX_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/ref.hxx>
+#include <tools/rtti.hxx>
+#include <vcl/window.hxx>
+#include <vcl/combobox.hxx>
+#include <vcl/lstbox.hxx>
+
+#include <vcl/button.hxx>
+#include <svtools/brwbox.hxx>
+#include <vcl/timer.hxx>
+#include <svtools/brwhead.hxx>
+#include <svtools/svmedit.hxx>
+#include <vcl/svapp.hxx>
+
+//==================================================================
+// EditBrowseBoxFlags (EBBF)
+
+#define EBBF_NONE ((sal_Int32)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
+*/
+#define EBBF_NO_HANDLE_COLUMN_CONTENT ((sal_Int32)0x0001)
+/** set this bit to activate the cell on a MouseButtonDown, not a MouseButtonUp event
+ */
+#define EBBF_ACTIVATE_ON_BUTTONDOWN ((sal_Int32)0x0002)
+/** if this bit is set and EBBF_NO_HANDLE_COLUMN_CONTENT is _not_ set, the handle
+ column is drawn with the text contained in column 0 instead of an image
+*/
+#define EBBF_HANDLE_COLUMN_TEXT ((sal_Int32)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_*
+*/
+#define EBBF_SMART_TAB_TRAVEL ((sal_Int32)0x0008)
+
+/// @deprecated
+#define EBBF_NOROWPICTURE EBBF_NO_HANDLE_COLUMN_CONTENT
+
+//==================================================================
+
+class Edit;
+class SpinField;
+class FormattedField;
+
+// .......................................................................
+namespace svt
+{
+// .......................................................................
+
+ class CellControllerRef;
+
+ //==================================================================
+ //= CellController
+ //==================================================================
+ class SVT_DLLPUBLIC CellController : public SvRefBase
+ {
+ friend class EditBrowseBox;
+
+ protected:
+ Control* pWindow;
+ sal_Bool bSuspended; // <sal_True> if the window is hidden and disabled
+
+ public:
+ TYPEINFO();
+
+ CellController(Control* pW);
+ virtual ~CellController();
+
+ Control& GetWindow() const { return *const_cast< CellController* >( this )->pWindow; }
+
+ virtual void SetModified();
+ virtual void ClearModified() = 0;
+ virtual sal_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 culmulative!
+ void suspend( );
+ void resume( );
+ inline sal_Bool isSuspended( ) const { return bSuspended; }
+
+ protected:
+ virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
+ virtual void SetModifyHdl(const Link& rLink) = 0;
+ virtual sal_Bool WantMouseEvent() const;
+ };
+
+ SV_DECL_IMPL_REF(CellController);
+
+ //==================================================================
+ //= IEditImplementation
+ //==================================================================
+ class SVT_DLLPUBLIC IEditImplementation
+ {
+ public:
+ virtual ~IEditImplementation() = 0;
+
+ virtual Control& GetControl() = 0;
+
+ virtual String GetText( LineEnd aSeparator ) const = 0;
+ virtual void SetText( const OUString& _rStr ) = 0;
+
+ virtual sal_Bool IsReadOnly() const = 0;
+ virtual void SetReadOnly( sal_Bool bReadOnly ) = 0;
+
+ virtual xub_StrLen GetMaxTextLen() const = 0;
+ virtual void SetMaxTextLen( xub_StrLen _nMaxLen ) = 0;
+
+ virtual Selection GetSelection() const = 0;
+ virtual void SetSelection( const Selection& _rSelection ) = 0;
+
+ virtual void ReplaceSelected( const String& _rStr ) = 0;
+ virtual void DeleteSelected() = 0;
+ virtual String GetSelected( LineEnd aSeparator ) const = 0;
+
+ virtual void SetModified() = 0;
+ virtual sal_Bool IsModified() const = 0;
+ virtual void ClearModified() = 0;
+ virtual void SetModifyHdl( const Link& _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();
+
+ virtual String GetText( LineEnd aSeparator ) const;
+ virtual void SetText( const OUString& _rStr );
+
+ virtual sal_Bool IsReadOnly() const;
+ virtual void SetReadOnly( sal_Bool bReadOnly );
+
+ virtual xub_StrLen GetMaxTextLen() const;
+ virtual void SetMaxTextLen( xub_StrLen _nMaxLen );
+
+ virtual Selection GetSelection() const;
+ virtual void SetSelection( const Selection& _rSelection );
+
+ virtual void ReplaceSelected( const String& _rStr );
+ virtual void DeleteSelected();
+ virtual String GetSelected( LineEnd aSeparator ) const;
+
+ virtual void SetModified();
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+ virtual void SetModifyHdl( const Link& _rLink );
+ };
+
+ #include <svtools/editimplementation.hxx>
+
+ //==================================================================
+ //= MultiLineTextCell
+ //==================================================================
+ /** a multi line edit which can be used in a cell of a EditBrowseBox
+ */
+ class SVT_DLLPUBLIC MultiLineTextCell : public MultiLineEdit
+ {
+ public:
+ MultiLineTextCell( Window* _pParent, WinBits _nStyle )
+ :MultiLineEdit( _pParent, _nStyle )
+ {
+ }
+
+ protected:
+ // Window overridables
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+ // MultiLineEdit overridables
+ virtual void Modify();
+
+ private:
+ sal_Bool dispatchKeyEvent( const KeyEvent& _rEvent );
+ };
+
+ //==================================================================
+ //= concrete edit implementations
+ //==================================================================
+ typedef GenericEditImplementation< Edit > EditImplementation;
+
+ typedef GenericEditImplementation< MultiLineTextCell > MultiLineEditImplementation_Base;
+ class SVT_DLLPUBLIC MultiLineEditImplementation : public MultiLineEditImplementation_Base
+ {
+ public:
+ MultiLineEditImplementation( MultiLineTextCell& _rEdit ) : MultiLineEditImplementation_Base( _rEdit )
+ {
+ }
+
+ virtual String GetText( LineEnd aSeparator ) const;
+ virtual String GetSelected( LineEnd aSeparator ) const;
+ };
+
+ //==================================================================
+ //= EditCellController
+ //==================================================================
+ class SVT_DLLPUBLIC EditCellController : public CellController
+ {
+ IEditImplementation* m_pEditImplementation;
+ sal_Bool m_bOwnImplementation; // did we create m_pEditImplementation?
+
+ public:
+ TYPEINFO();
+ EditCellController( Edit* _pEdit );
+ EditCellController( IEditImplementation* _pImplementation );
+ ~EditCellController( );
+
+ const IEditImplementation* GetEditImplementation( ) const { return m_pEditImplementation; }
+ IEditImplementation* GetEditImplementation( ) { return m_pEditImplementation; }
+
+ virtual void SetModified();
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+
+ protected:
+ virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
+ virtual void SetModifyHdl(const Link& rLink);
+ };
+
+ //==================================================================
+ //= SpinCellController
+ //==================================================================
+ class SVT_DLLPUBLIC SpinCellController : public CellController
+ {
+ public:
+ TYPEINFO();
+ SpinCellController(SpinField* pSpinField);
+ SpinField& GetSpinWindow() const {return (SpinField &)GetWindow();}
+
+ virtual void SetModified();
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+
+ protected:
+ virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
+ virtual void SetModifyHdl(const Link& rLink);
+ };
+
+ //==================================================================
+ //= CheckBoxControl
+ //==================================================================
+ class SVT_DLLPUBLIC CheckBoxControl : public Control
+ {
+ CheckBox* pBox;
+ Rectangle aFocusRect;
+ Link m_aClickLink,m_aModifyLink;
+
+ public:
+ CheckBoxControl(Window* pParent, WinBits nWinStyle = 0);
+ ~CheckBoxControl();
+
+ virtual void GetFocus();
+ virtual long PreNotify(NotifyEvent& rEvt);
+ virtual void Paint(const Rectangle& rClientRect);
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& _rEvent );
+ virtual void Resize();
+
+ void SetClickHdl(const Link& rHdl) {m_aClickLink = rHdl;}
+ const Link& GetClickHdl() const {return m_aClickLink;}
+
+ void SetModifyHdl(const Link& rHdl) {m_aModifyLink = rHdl;}
+ const Link& GetModifyHdl() const {return m_aModifyLink;}
+
+ CheckBox& GetBox() {return *pBox;};
+
+ private:
+ DECL_LINK( OnClick, void* );
+ };
+
+ //==================================================================
+ //= CheckBoxCellController
+ //==================================================================
+ class SVT_DLLPUBLIC CheckBoxCellController : public CellController
+ {
+ public:
+ TYPEINFO();
+
+ CheckBoxCellController(CheckBoxControl* pWin):CellController(pWin){}
+ CheckBox& GetCheckBox() const;
+
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+
+ protected:
+ virtual void SetModifyHdl(const Link& rLink);
+ virtual sal_Bool WantMouseEvent() const;
+ };
+
+ //==================================================================
+ //= ComboBoxControl
+ //==================================================================
+ class SVT_DLLPUBLIC ComboBoxControl : public ComboBox
+ {
+ friend class ComboBoxCellController;
+
+ public:
+ ComboBoxControl(Window* pParent, WinBits nWinStyle = 0);
+
+ protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ };
+
+ //==================================================================
+ //= ComboBoxCellController
+ //==================================================================
+ class SVT_DLLPUBLIC ComboBoxCellController : public CellController
+ {
+ public:
+ TYPEINFO();
+
+ ComboBoxCellController(ComboBoxControl* pParent);
+ ComboBoxControl& GetComboBox() const {return (ComboBoxControl &)GetWindow();}
+
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+
+ protected:
+ virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
+ virtual void SetModifyHdl(const Link& rLink);
+ };
+
+ //==================================================================
+ //= ListBoxControl
+ //==================================================================
+ class SVT_DLLPUBLIC ListBoxControl : public ListBox
+ {
+ friend class ListBoxCellController;
+
+ public:
+ ListBoxControl(Window* pParent, WinBits nWinStyle = 0);
+
+ protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ };
+
+ //==================================================================
+ //= ListBoxCellController
+ //==================================================================
+ class SVT_DLLPUBLIC ListBoxCellController : public CellController
+ {
+ public:
+ TYPEINFO();
+
+ ListBoxCellController(ListBoxControl* pParent);
+ ListBoxControl& GetListBox() const {return (ListBoxControl &)GetWindow();}
+
+ virtual sal_Bool IsModified() const;
+ virtual void ClearModified();
+
+ protected:
+ virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
+ virtual void SetModifyHdl(const Link& rLink);
+ };
+
+ //==================================================================
+ //= FormattedFieldCellController
+ //==================================================================
+ class SVT_DLLPUBLIC FormattedFieldCellController : public EditCellController
+ {
+ public:
+ TYPEINFO();
+ FormattedFieldCellController( FormattedField* _pFormatted );
+
+ virtual void CommitModifications();
+ };
+
+ //==================================================================
+ //= EditBrowserHeader
+ //==================================================================
+ class SVT_DLLPUBLIC EditBrowserHeader : public BrowserHeader
+ {
+ public:
+ EditBrowserHeader( BrowseBox* pParent, WinBits nWinBits = WB_BUTTONSTYLE )
+ :BrowserHeader(pParent, nWinBits){}
+
+ protected:
+ virtual void DoubleClick();
+ };
+
+ //==================================================================
+ //= 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:
+ // forbid these ones
+ EditBrowseBox(EditBrowseBox&);
+ EditBrowseBox& operator=(EditBrowseBox&);
+
+ class BrowserMouseEventPtr
+ {
+ BrowserMouseEvent* pEvent;
+ sal_Bool bDown;
+
+ public:
+ BrowserMouseEventPtr():pEvent(NULL){}
+ ~BrowserMouseEventPtr(){Clear();}
+
+ sal_Bool Is() const {return pEvent != NULL;}
+ sal_Bool IsDown() const {return bDown;}
+ const BrowserMouseEvent* operator->() const {return pEvent;}
+ const BrowserMouseEvent& operator*() const {return *pEvent;}
+
+ SVT_DLLPUBLIC void Clear();
+ void Set(const BrowserMouseEvent* pEvt, sal_Bool bIsDown);
+ } aMouseEvent;
+
+ const BrowserMouseEvent* pMouseEvent; // is set during a mouse event
+ CellControllerRef aController,
+ aOldController;
+
+ sal_uLong nStartEvent, nEndEvent, nCellModifiedEvent; // event ids
+ Window* m_pFocusWhileRequest;
+ // In ActivateCell, we grab the focus asynchronously, but if between requesting activation
+ // and the asynchornous event the focus has changed, we won't grab it for ourself.
+
+ long nPaintRow; // row beeing painted
+ long nEditRow, nOldEditRow;
+ sal_uInt16 nEditCol, nOldEditCol;
+
+ sal_Bool bHasFocus : 1;
+ mutable sal_Bool bPaintStatus : 1; // paint a status (image) in the handle column
+ sal_Bool bActiveBeforeTracking;
+
+ CheckBoxControl* pCheckBoxPaint;
+
+ sal_Int32 m_nBrowserFlags;
+ ImageList m_aStatusImages;
+ ::std::auto_ptr< EditBrowseBoxImpl> m_aImpl;
+
+ protected:
+ BrowserHeader* pHeader;
+
+ sal_Bool isGetCellFocusPending() const { return nStartEvent != 0; }
+ void cancelGetCellFocus() { if (nStartEvent) Application::RemoveUserEvent(nStartEvent); nStartEvent = 0; }
+ void forceGetCellFocus() { cancelGetCellFocus(); LINK(this, EditBrowseBox, StartEditHdl).Call((void*)NULL); }
+
+ BrowserMouseEventPtr& getMouseEvent() { return aMouseEvent; }
+
+ protected:
+ BrowserHeader* GetHeaderBar() const {return pHeader;}
+
+ virtual BrowserHeader* CreateHeaderBar(BrowseBox* pParent);
+
+ // if you want to have an own header ...
+ virtual BrowserHeader* imp_CreateHeaderBar(BrowseBox* pParent);
+
+ virtual void ColumnMoved(sal_uInt16 nId);
+ virtual void ColumnResized(sal_uInt16 nColId);
+ virtual void Resize();
+ virtual void ArrangeControls(sal_uInt16& nX, sal_uInt16 nY);
+ virtual sal_Bool SeekRow(long nRow);
+
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void KeyInput(const KeyEvent& rEvt);
+ virtual void MouseButtonDown(const BrowserMouseEvent& rEvt);
+ virtual void MouseButtonUp(const BrowserMouseEvent& rEvt);
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ using BrowseBox::MouseButtonUp;
+ using BrowseBox::MouseButtonDown;
+
+ virtual long PreNotify(NotifyEvent& rNEvt );
+ virtual long Notify(NotifyEvent& rNEvt);
+
+ virtual void EndScroll();
+
+ // should be used instead of GetFieldRectPixel, 'cause this method here takes into account the borders
+ Rectangle GetCellRect(long nRow, sal_uInt16 nColId, sal_Bool bRelToBrowser = sal_True) const;
+ virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId);
+ virtual sal_uInt32 GetAutoColumnWidth(sal_uInt16 nColId);
+
+ virtual void PaintStatusCell(OutputDevice& rDev, const Rectangle& rRect) const;
+ virtual void PaintCell(OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColId) const = 0;
+
+ virtual RowStatus GetRowStatus(long nRow) const;
+
+ virtual void RowHeightChanged();
+
+ // callbacks for the data window
+ virtual void ImplStartTracking();
+ virtual void ImplTracking();
+ virtual void ImplEndTracking();
+
+ // when changing a row:
+ // CursorMoving: cursor is beeing moved, but GetCurRow() still provides the old row
+ virtual sal_Bool CursorMoving(long nNewRow, sal_uInt16 nNewCol);
+
+ // cursor has been moved
+ virtual void CursorMoved();
+
+ virtual void CellModified(); // called whenever a cell has been modified
+ virtual sal_Bool SaveModified(); // called whenever a cell should be left, and it's content should be saved
+ // return sal_False prevents leaving the cell
+ virtual sal_Bool SaveRow(); // commit the current row
+
+ virtual sal_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);
+ virtual void ResizeController(CellControllerRef& rController, const Rectangle&);
+ virtual void ReleaseController(CellControllerRef& pController, long nRow, sal_uInt16 nCol);
+ virtual void DoubleClick(const BrowserMouseEvent&);
+
+ void ActivateCell() { ActivateCell(GetCurRow(), GetCurColumnId()); }
+
+ // retrieve the image for the row status
+ virtual 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 String& rName, sal_uInt16 nWidth = 0, 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 sal_Bool IsTabAllowed(sal_Bool bForward) const;
+
+ virtual sal_Bool IsCursorMoveAllowed(long nNewRow, sal_uInt16 nNewColId) const;
+
+ void PaintTristate(OutputDevice& rDev, const Rectangle& rRect,const TriState& eState,sal_Bool _bEnabled=sal_True) const;
+
+ void AsynchGetFocus();
+ // secure starting of StartEditHdl
+
+ public:
+ EditBrowseBox(Window* pParent, sal_Int32 nBrowserFlags = EBBF_NONE, WinBits nBits = WB_TABSTOP, BrowserMode nMode = 0 );
+ EditBrowseBox(Window* pParent, const ResId& rId, sal_Int32 nBrowserFlags = EBBF_NONE, BrowserMode nMode = 0 );
+ ~EditBrowseBox();
+
+ sal_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);
+
+ CellControllerRef Controller() const { return aController; }
+ sal_Int32 GetBrowserFlags() const { return m_nBrowserFlags; }
+ void SetBrowserFlags(sal_Int32 nFlags);
+
+ virtual void ActivateCell(long nRow, sal_uInt16 nCol, sal_Bool bSetCellFocus = sal_True);
+ virtual void DeactivateCell(sal_Bool bUpdate = sal_True);
+ // Children ---------------------------------------------------------------
+
+ /** Creates the accessible object of a data table cell.
+ @param nRow
+ The row index of the cell.
+ @param nColumnId
+ The column ID of the cell.
+ @return
+ The XAccessible interface of the specified cell. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnPos );
+
+ /** @return The count of additional controls of the control area. */
+ virtual sal_Int32 GetAccessibleControlCount() const;
+
+ /** 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 ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ CreateAccessibleControl( sal_Int32 nIndex );
+
+ /** 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 ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ CreateAccessibleRowHeader( sal_Int32 _nRow );
+
+ /** Sets focus to current cell of the data table. */
+ virtual void GrabTableFocus();
+
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex);
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > CreateAccessibleCheckBoxCell(long _nRow, sal_uInt16 _nColumnPos,const TriState& eState);
+ protected:
+ // creates the accessible which wraps the active cell
+ void implCreateActiveAccessible( );
+
+ private:
+ virtual void PaintField(OutputDevice& rDev, const Rectangle& rRect,
+ sal_uInt16 nColumnId ) const;
+ using Control::ImplInitSettings;
+ SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SVT_DLLPRIVATE void DetermineFocus( const sal_uInt16 _nGetFocusFlags = 0);
+ inline void HideAndDisable(CellControllerRef& rController);
+ inline void EnableAndShow() const;
+
+ SVT_DLLPRIVATE void implActivateCellOnMouseEvent(const BrowserMouseEvent& _rEvt, sal_Bool _bUp);
+ SVT_DLLPRIVATE void impl_construct();
+
+ DECL_DLLPRIVATE_LINK(ModifyHdl, void* );
+ DECL_DLLPRIVATE_LINK(StartEditHdl, void* );
+ DECL_DLLPRIVATE_LINK(EndEditHdl, void* );
+ DECL_DLLPRIVATE_LINK(CellModifiedHdl, void* );
+ };
+
+// .......................................................................
+} // namespace svt
+// .......................................................................
+
+#undef SVTOOLS_IN_EDITBROWSEBOX_HXX
+#endif // _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 000000000000..983bf6dae5e8
--- /dev/null
+++ b/include/svtools/editimplementation.hxx
@@ -0,0 +1,144 @@
+/* -*- 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>
+String 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( sal_Bool bReadOnly )
+{
+ m_rEdit.SetReadOnly( bReadOnly );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+sal_Bool GenericEditImplementation< EDIT >::IsReadOnly() const
+{
+ return m_rEdit.IsReadOnly();
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::ReplaceSelected( const String& _rStr )
+{
+ m_rEdit.ReplaceSelected( _rStr );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::DeleteSelected()
+{
+ m_rEdit.DeleteSelected();
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+String GenericEditImplementation< EDIT >::GetSelected( LineEnd ) const
+{
+ return m_rEdit.GetSelected( );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::SetMaxTextLen( xub_StrLen _nMaxLen )
+{
+ m_rEdit.SetMaxTextLen( _nMaxLen );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+xub_StrLen GenericEditImplementation< EDIT >::GetMaxTextLen() const
+{
+ return (xub_StrLen)m_rEdit.GetMaxTextLen( );
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+void GenericEditImplementation< EDIT >::SetModified()
+{
+ m_rEdit.SetModifyFlag();
+}
+
+//----------------------------------------------------------------------
+template <class EDIT>
+sal_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& _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 000000000000..747d0567c213
--- /dev/null
+++ b/include/svtools/editsyntaxhighlighter.hxx
@@ -0,0 +1,56 @@
+/* -*- 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 _EDITSYNTAXHIGHLIGHTER_HXX
+#define _EDITSYNTAXHIGHLIGHTER_HXX
+
+#include <comphelper/syntaxhighlight.hxx>
+#include <svtools/svmedit.hxx>
+#include <svtools/svtdllapi.h>
+#include <svtools/colorcfg.hxx>
+
+class SVT_DLLPUBLIC MultiLineEditSyntaxHighlight : public MultiLineEdit
+{
+ private:
+ bool mbDoBracketHilight;
+ SyntaxHighlighter aHighlighter;
+ svtools::ColorConfig m_aColorConfig;
+
+ private:
+ virtual void DoBracketHilight(sal_uInt16 aKey);
+
+ protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+ public:
+ MultiLineEditSyntaxHighlight( Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER , HighlighterLanguage aLanguage = HIGHLIGHT_SQL);
+ MultiLineEditSyntaxHighlight( Window* pParent, const ResId& rResId , HighlighterLanguage aLanguage = HIGHLIGHT_SQL);
+ ~MultiLineEditSyntaxHighlight();
+
+ virtual void UpdateData();
+ virtual void SetText(const OUString& rNewText);
+ virtual void SetText( const OUString& rStr, const Selection& rNewSelection )
+ { SetText( rStr ); SetSelection( rNewSelection ); }
+
+ Color GetColorValue(TokenTypes 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 000000000000..4b06a6e9d781
--- /dev/null
+++ b/include/svtools/ehdl.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 _EHDL_HXX
+#define _EHDL_HXX
+
+#ifndef __RSC
+
+#include "svtools/svtdllapi.h"
+
+#include <tools/errinf.hxx>
+
+class Window;
+class ResMgr;
+
+class SVT_DLLPUBLIC SfxErrorContext : private ErrorContext
+{
+public:
+ SfxErrorContext(
+ sal_uInt16 nCtxIdP, Window *pWin=0,
+ sal_uInt16 nResIdP=USHRT_MAX, ResMgr *pMgrP=0);
+ SfxErrorContext(
+ sal_uInt16 nCtxIdP, const String &aArg1, Window *pWin=0,
+ sal_uInt16 nResIdP=USHRT_MAX, ResMgr *pMgrP=0);
+ virtual sal_Bool GetString(sal_uLong nErrId, OUString &rStr);
+
+private:
+ sal_uInt16 nCtxId;
+ sal_uInt16 nResId;
+ ResMgr *pMgr;
+ String aArg1;
+};
+
+class SVT_DLLPUBLIC SfxErrorHandler : private ErrorHandler
+{
+public:
+ SfxErrorHandler(sal_uInt16 nId, sal_uLong lStart, sal_uLong lEnd, ResMgr *pMgr=0);
+ ~SfxErrorHandler();
+
+protected:
+ virtual sal_Bool GetErrorString(sal_uLong lErrId, OUString &, sal_uInt16&) const;
+ virtual sal_Bool GetMessageString(sal_uLong lErrId, OUString &, sal_uInt16&) const;
+
+private:
+
+ sal_uLong lStart;
+ sal_uLong lEnd;
+ sal_uInt16 nId;
+ ResMgr *pMgr;
+ ResMgr *pFreeMgr;
+
+ SVT_DLLPRIVATE sal_Bool GetClassString(sal_uLong lErrId, String &) const;
+ virtual sal_Bool CreateString(
+ const ErrorInfo *, OUString &, sal_uInt16 &) const;
+};
+
+#endif
+
+#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 000000000000..ba948376af9b
--- /dev/null
+++ b/include/svtools/embedhlp.hxx
@@ -0,0 +1,124 @@
+/* -*- 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_EMBEDHLP_HXX
+#define _SVTOOLS_EMBEDHLP_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <vcl/graph.hxx>
+#include <tools/mapunit.hxx>
+#include <rtl/ustring.hxx>
+
+namespace comphelper
+{
+ class EmbeddedObjectContainer;
+}
+
+namespace com { namespace sun { namespace star { namespace embed {
+ class XEmbeddedObject;
+}}}}
+
+class Rectangle;
+class OutputDevice;
+
+namespace svt {
+
+struct EmbeddedObjectRef_Impl;
+
+class SVT_DLLPUBLIC EmbeddedObjectRef
+{
+ EmbeddedObjectRef_Impl* mpImpl;
+
+ SVT_DLLPRIVATE SvStream* GetGraphicStream( bool bUpdate ) const;
+ SVT_DLLPRIVATE void GetReplacement( bool bUpdate );
+
+ EmbeddedObjectRef& operator = ( const EmbeddedObjectRef& );
+
+public:
+ static void DrawPaintReplacement( const Rectangle &rRect, const OUString &rText, OutputDevice *pOut );
+ static void DrawShading( const Rectangle &rRect, OutputDevice *pOut );
+ static bool TryRunningState( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& );
+ static void SetGraphicToContainer( const Graphic& rGraphic,
+ comphelper::EmbeddedObjectContainer& aContainer,
+ const OUString& aName,
+ const OUString& aMediaType );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetGraphicReplacementStream(
+ sal_Int64 nViewAspect,
+ const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&,
+ OUString* pMediaType )
+ throw();
+
+ const com::sun::star::uno::Reference <com::sun::star::embed::XEmbeddedObject>& operator->() const;
+ const com::sun::star::uno::Reference <com::sun::star::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 ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj, sal_Int64 nAspect );
+
+ // create object for a certain view aspect
+ EmbeddedObjectRef( const ::com::sun::star::uno::Reference < ::com::sun::star::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( OUString* pMediaType = NULL ) 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* pTargetMapMode = NULL ) const;
+
+ void SetGraphic( const Graphic& rGraphic, const OUString& rMediaType );
+ void SetGraphicStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::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;
+
+ // #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 necessaryly 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 000000000000..9da80b87f37a
--- /dev/null
+++ b/include/svtools/embedtransfer.hxx
@@ -0,0 +1,57 @@
+/* -*- 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 _EMBEDTRANSFER_HXX
+#define _EMBEDTRANSFER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <svtools/transfer.hxx>
+
+class Graphic;
+class SVT_DLLPUBLIC SvEmbedTransferHelper : public TransferableHelper
+{
+private:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject > m_xObj;
+ Graphic* m_pGraphic;
+ sal_Int64 m_nAspect;
+
+protected:
+
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual void ObjectReleased();
+
+public:
+ // object, replacement image, and the aspect
+ SvEmbedTransferHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >& xObj,
+ const Graphic* pGraphic,
+ sal_Int64 nAspect );
+ ~SvEmbedTransferHelper();
+
+ static void FillTransferableObjectDescriptor( TransferableObjectDescriptor& rDesc,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::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 000000000000..226e6065d5b0
--- /dev/null
+++ b/include/svtools/extcolorcfg.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_EXTCOLORCFG_HXX
+#define INCLUDED_SVTOOLS_EXTCOLORCFG_HXX
+
+#include "svtools/svtdllapi.h"
+#include <rtl/ustring.hxx>
+#include <tools/color.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
+
+//-----------------------------------------------------------------------------
+namespace svtools{
+
+class ExtendedColorConfig_Impl;
+class ExtendedColorConfigValue
+{
+ OUString m_sName;
+ OUString m_sDisplayName;
+ sal_Int32 m_nColor;
+ sal_Int32 m_nDefaultColor;
+public:
+ ExtendedColorConfigValue() : m_nColor(0),m_nDefaultColor(0){}
+ ExtendedColorConfigValue(const OUString& _sName
+ ,const OUString& _sDisplayName
+ ,sal_Int32 _nColor
+ ,sal_Int32 _nDefaultColor)
+ : m_sName(_sName)
+ ,m_sDisplayName(_sDisplayName)
+ ,m_nColor(_nColor)
+ ,m_nDefaultColor(_nDefaultColor)
+ {}
+
+ inline OUString getName() const { return m_sName; }
+ inline OUString getDisplayName() const { return m_sDisplayName; }
+ inline sal_Int32 getColor() const { return m_nColor; }
+ inline sal_Int32 getDefaultColor() const { return m_nDefaultColor; }
+
+ inline void setColor(sal_Int32 _nColor) { m_nColor = _nColor; }
+
+ sal_Bool operator !=(const ExtendedColorConfigValue& rCmp) const
+ { return m_nColor != rCmp.m_nColor;}
+};
+
+class SVT_DLLPUBLIC ExtendedColorConfig : public SfxBroadcaster, public SfxListener
+{
+ friend class ExtendedColorConfig_Impl;
+private:
+ static ExtendedColorConfig_Impl* m_pImpl;
+public:
+ ExtendedColorConfig();
+ ~ExtendedColorConfig();
+
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+
+ // 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
+{
+ ExtendedColorConfig_Impl* m_pImpl;
+ sal_Bool m_bModified;
+public:
+ EditableExtendedColorConfig();
+ ~EditableExtendedColorConfig();
+
+ void DeleteScheme(const OUString& rScheme );
+ void AddScheme(const OUString& rScheme );
+ sal_Bool 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 = sal_False;}
+ sal_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/extensionlistbox.hxx b/include/svtools/extensionlistbox.hxx
new file mode 100644
index 000000000000..62f5c383579a
--- /dev/null
+++ b/include/svtools/extensionlistbox.hxx
@@ -0,0 +1,98 @@
+/* -*- 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_EXTENSIONLISTBOX_HXX
+#define _SVTOOLS_EXTENSIONLISTBOX_HXX
+
+#include <vcl/ctrl.hxx>
+#include <rtl/ustring.hxx>
+
+// ============================================================================
+
+namespace svt
+{
+
+// ============================================================================
+
+/** This abstract class provides methods to implement an extension list box.
+ This header is needed for the automatic test tool
+*/
+class IExtensionListBox: public Control
+{
+public:
+ enum { ENTRY_NOTFOUND = -1 };
+
+ IExtensionListBox( Window* pParent, WinBits nWinStyle = 0 ): Control( pParent, nWinStyle ){}
+
+ /** @return The count of the entries in the list box. */
+ virtual sal_Int32 getItemCount() const = 0;
+
+ /** @return The index of the first selected entry in the list box.
+ When nothing is selected, which is the case when getItemCount returns '0',
+ then this function returns ENTRY_NOTFOUND */
+ virtual sal_Int32 getSelIndex() const = 0;
+
+ /** @return The item name of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual OUString getItemName( sal_Int32 index ) const = 0;
+
+ /** @return The version string of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual OUString getItemVersion( sal_Int32 index ) const = 0;
+
+ /** @return The description string of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual OUString getItemDescription( sal_Int32 index ) const = 0;
+
+ /** @return The publisher string of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual OUString getItemPublisher( sal_Int32 index ) const = 0;
+
+ /** @return The link behind the publisher text of the entry with the given index
+ The index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual OUString getItemPublisherLink( sal_Int32 index ) const = 0;
+
+ /** The entry at the given position will be selected
+ Index starts with 0.
+ Throws an com::sun::star::lang::IllegalArgumentException, when the position is invalid. */
+ virtual void select( sal_Int32 index ) = 0;
+
+ /** The first found entry with the given name will be selected
+ When there was no entry found with the name, the selection doesn't change.
+ Please note that there might be more than one entry with the same
+ name, because:
+ 1. the name is not unique
+ 2. one extension can be installed as user and shared extension.
+ */
+ virtual void select( const OUString & sName ) = 0;
+};
+// ============================================================================
+
+} // namespace svt
+
+// ============================================================================
+
+#endif // _SVTOOLS_EXTENSIONLISTBOX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/filechangedchecker.hxx b/include/svtools/filechangedchecker.hxx
new file mode 100644
index 000000000000..2b8caa9d2da5
--- /dev/null
+++ b/include/svtools/filechangedchecker.hxx
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * [ Surendran Mahendran <surenspost@gmail.com>]
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef SVTOOLS_INCLUDED_FILECHANGEDCHECKER_HXX
+#define SVTOOLS_INCLUDED_FILECHANGEDCHECKER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <boost/function.hpp>
+#include <osl/file.hxx>
+#include <vcl/timer.hxx>
+
+/** 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 SVT_DLLPUBLIC FileChangedChecker
+{
+private :
+ Timer mTimer;
+ OUString mFileName;
+ TimeValue mLastModTime;
+ ::boost::function0<void> mpCallback;
+
+ bool SVT_DLLPRIVATE getCurrentModTime(TimeValue& o_rValue) const;
+ DECL_LINK(TimerHandler, void *);
+
+public :
+ void resetTimer();
+ bool hasFileChanged();
+ FileChangedChecker(const OUString& rFilename, const ::boost::function0<void>& rCallback);
+};
+
+#endif
diff --git a/include/svtools/filectrl.hxx b/include/svtools/filectrl.hxx
new file mode 100644
index 000000000000..5654f004f69c
--- /dev/null
+++ b/include/svtools/filectrl.hxx
@@ -0,0 +1,96 @@
+/* -*- 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 _SV_FILECTRL_HXX
+#define _SV_FILECTRL_HXX
+
+#include "svtools/svtdllapi.h"
+#include <vcl/window.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/button.hxx>
+
+
+#define STR_FILECTRL_BUTTONTEXT 333 // ID-Range?!
+
+// Flags for FileControl
+typedef sal_uInt16 FileControlMode;
+#define FILECTRL_RESIZEBUTTONBYPATHLEN ((sal_uInt16)0x0001)//if this is set, the button will become small as soon as the Text in the Edit Field is to long to be shown completely
+
+
+// Flags for internal use of FileControl
+typedef sal_uInt16 FileControlMode_Internal;
+#define FILECTRL_INRESIZE ((sal_uInt16)0x0001)
+#define FILECTRL_ORIGINALBUTTONTEXT ((sal_uInt16)0x0002)
+
+
+class SVT_DLLPUBLIC FileControl : public Window
+{
+private:
+ Edit maEdit;
+ PushButton maButton;
+
+ String maButtonText;
+ sal_Bool mbOpenDlg;
+
+ Link maDialogCreatedHdl;
+
+ FileControlMode mnFlags;
+ FileControlMode_Internal mnInternalFlags;
+
+private:
+ SVT_DLLPRIVATE void ImplBrowseFile( );
+
+protected:
+ SVT_DLLPRIVATE void Resize();
+ SVT_DLLPRIVATE void GetFocus();
+ SVT_DLLPRIVATE void StateChanged( StateChangedType nType );
+ SVT_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
+ DECL_DLLPRIVATE_LINK( ButtonHdl, void* );
+
+public:
+ FileControl( Window* pParent, WinBits nStyle, FileControlMode = 0 );
+ ~FileControl();
+
+ Edit& GetEdit() { return maEdit; }
+ PushButton& GetButton() { return maButton; }
+
+ void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+
+ void SetOpenDialog( sal_Bool bOpen ) { mbOpenDlg = bOpen; }
+ sal_Bool IsOpenDialog() const { return mbOpenDlg; }
+
+ void SetText( const OUString& rStr );
+ OUString GetText() const;
+ OUString GetSelectedText() const { return maEdit.GetSelected(); }
+
+ void SetSelection( const Selection& rSelection ) { maEdit.SetSelection( rSelection ); }
+ Selection GetSelection() const { return maEdit.GetSelection(); }
+
+ void SetReadOnly( sal_Bool bReadOnly = sal_True ) { maEdit.SetReadOnly( bReadOnly ); }
+ sal_Bool IsReadOnly() const { return maEdit.IsReadOnly(); }
+
+ //------
+ //use this to manipulate the dialog bevore executing it:
+ void SetDialogCreatedHdl( const Link& rLink ) { maDialogCreatedHdl = rLink; }
+ const Link& GetDialogCreatedHdl() const { return maDialogCreatedHdl; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/filedlg2.hrc b/include/svtools/filedlg2.hrc
new file mode 100644
index 000000000000..4da7f5e0f894
--- /dev/null
+++ b/include/svtools/filedlg2.hrc
@@ -0,0 +1,23 @@
+/* -*- 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 .
+ */
+#define STR_FILEDLG_OPEN 1002
+#define STR_FILEDLG_TYPE 1005
+#define STR_FILEDLG_SAVE 1010
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/fileurlbox.hxx b/include/svtools/fileurlbox.hxx
new file mode 100644
index 000000000000..5a9219d48050
--- /dev/null
+++ b/include/svtools/fileurlbox.hxx
@@ -0,0 +1,68 @@
+/* -*- 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_FILEURLBOX_HXX
+#define SVTOOLS_FILEURLBOX_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/inettbc.hxx>
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ //=====================================================================
+ //= FileURLBox
+ //=====================================================================
+ class SVT_DLLPUBLIC FileURLBox : public SvtURLBox
+ {
+ protected:
+ String m_sPreservedText;
+
+ public:
+ FileURLBox( Window* _pParent, WinBits _nStyle );
+
+ protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ public:
+ /** transforms the given URL content into a system-dependent notation, if possible, and
+ sets it as current display text
+
+ <p>If the user enters an URL such as "file:///c:/some%20directory", then this will be converted
+ to "c:\some directory" for better readability.</p>
+
+ @param _rURL
+ denotes the URL to set. Note that no check is made whether it is a valid URL - this
+ is the responsibility of the caller.
+
+ @see SvtURLBox::GetURL
+ */
+ void DisplayURL( const String& _rURL );
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // SVTOOLS_FILEURLBOX_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/fileview.hxx b/include/svtools/fileview.hxx
new file mode 100644
index 000000000000..d7cb77a19a47
--- /dev/null
+++ b/include/svtools/fileview.hxx
@@ -0,0 +1,258 @@
+/* -*- 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 _SVT_FILEVIEW_HXX
+#define _SVT_FILEVIEW_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/ucb/XContent.hpp>
+#include <vcl/ctrl.hxx>
+#include <vcl/image.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <rtl/ustring.hxx>
+
+// class SvtFileView -----------------------------------------------------
+
+#define FILEVIEW_ONLYFOLDER 0x0001
+#define FILEVIEW_MULTISELECTION 0x0002
+
+#define FILEVIEW_SHOW_ONLYTITLE 0x0010
+#define FILEVIEW_SHOW_NONE 0x0020
+
+class ViewTabListBox_Impl;
+class SvtFileView_Impl;
+class SvTreeListEntry;
+class HeaderBar;
+class IUrlFilter;
+
+/// the result of an action in the FileView
+enum FileViewResult
+{
+ eSuccess,
+ eFailure,
+ eTimeout,
+ eStillRunning
+};
+
+/// describes parameters for doing an action on the FileView asynchronously
+struct FileViewAsyncAction
+{
+ sal_uInt32 nMinTimeout; /// minimum time to wait for a result, in milliseconds
+ sal_uInt32 nMaxTimeout; /// maximum time to wait for a result, in milliseconds, until eTimeout is returned
+ Link aFinishHandler; /// the handler to be called when the action is finished. Called in every case, no matter of the result
+
+ FileViewAsyncAction()
+ {
+ nMinTimeout = nMaxTimeout = 0;
+ }
+};
+
+class SVT_DLLPUBLIC SvtFileView : public Control
+{
+private:
+ SvtFileView_Impl* mpImp;
+ sal_Bool bSortColumn;
+
+ ::com::sun::star::uno::Sequence< OUString > mpBlackList;
+
+ DECL_DLLPRIVATE_LINK( HeaderSelect_Impl, HeaderBar * );
+ DECL_DLLPRIVATE_LINK( HeaderEndDrag_Impl, HeaderBar * );
+
+protected:
+ virtual void GetFocus();
+
+public:
+ SvtFileView( Window* pParent, const ResId& rResId, sal_Bool bOnlyFolder, sal_Bool bMultiSelection );
+ SvtFileView( Window* pParent, const ResId& rResId, sal_uInt8 nFlags );
+ ~SvtFileView();
+
+ const String& GetViewURL() const;
+ String GetURL( SvTreeListEntry* pEntry ) const;
+ String GetCurrentURL() const;
+
+ sal_Bool GetParentURL( String& _rParentURL ) const;
+ void CreatedFolder( const String& rUrl, const String& rNewFolder );
+
+ void SetHelpId( const OString& rHelpId );
+ const OString& GetHelpId( ) const;
+ void SetSizePixel( const Size& rNewSize );
+ virtual void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize );
+ void SetSortColumn( sal_Bool bValue ) { bSortColumn = bValue; }
+ sal_Bool GetSortColumn() { return bSortColumn; }
+
+ /** initialize the view with the content of a folder given by URL, and aply an immediate filter
+
+ @param rFolderURL
+ the URL of the folder whose content is to be read
+ @param rFilter
+ the initial filter to be applied
+ @param pAsyncDescriptor
+ If not <NULL/>, this struct describes the parameters for doing the
+ action asynchronously.
+ */
+ FileViewResult Initialize(
+ const String& rFolderURL,
+ const String& rFilter,
+ const FileViewAsyncAction* pAsyncDescriptor,
+ const ::com::sun::star::uno::Sequence< OUString >& rBlackList
+ );
+
+ FileViewResult Initialize(
+ const String& rFolderURL,
+ const String& rFilter,
+ const FileViewAsyncAction* pAsyncDescriptor );
+ /** initialze the view with a sequence of contents, which have already been obtained elsewhere
+
+ This method will never return <member>eStillRunning</member>, since it will fill the
+ view synchronously
+ */
+ sal_Bool Initialize( const ::com::sun::star::uno::Sequence< OUString >& aContents );
+
+ /** initializes the view with the content of a folder given by an UCB content
+ */
+ sal_Bool Initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent>& _xContent,
+ const String& rFilter );
+
+ /** reads the current content of the current folder again, and applies the given filter to it
+
+ Note 1: The folder is really read a second time. This implies that any new elements (which were
+ not present when you called Initialize the last time) are now displayed.
+
+ Note 2: This method must not be called when you previously initialized the view from a sequence
+ of strings, or a UNO content object.
+
+ @param rFilter
+ the filter to be applied
+ @param pAsyncDescriptor
+ If not <NULL/>, this struct describes the parameters for doing the
+ action asynchronously.
+ */
+ FileViewResult ExecuteFilter(
+ const String& rFilter,
+ const FileViewAsyncAction* pAsyncDescriptor
+ );
+
+ /** cancels a running async action (if any)
+
+ @seealso Initialize
+ @seealso ExecuteFilter
+ @seealso FileViewAsyncAction
+ */
+ void CancelRunningAsyncAction();
+
+ /** initializes the view with the parent folder of the current folder
+
+ @param rNewURL
+ the URL of the folder which we just navigated to
+ @param pAsyncDescriptor
+ If not <NULL/>, this struct describes the parameters for doing the
+ action asynchronously.
+ */
+ FileViewResult PreviousLevel(
+ const FileViewAsyncAction* pAsyncDescriptor
+ );
+
+ void SetNoSelection();
+
+ void SetSelectHdl( const Link& rHdl );
+ void SetDoubleClickHdl( const Link& rHdl );
+ void SetOpenDoneHdl( const Link& rHdl );
+
+ sal_uLong GetSelectionCount() const;
+ SvTreeListEntry* FirstSelected() const;
+ SvTreeListEntry* NextSelected( SvTreeListEntry* pEntry ) const;
+ void EnableAutoResize();
+ void SetFocus();
+
+ void EnableContextMenu( sal_Bool bEnable );
+ void EnableDelete( sal_Bool bEnable );
+ void EnableNameReplacing( sal_Bool bEnable = sal_True );
+ // translate folder names or display doc-title instead of file name
+ // EnableContextMenu( sal_True )/EnableDelete(sal_True) disable name replacing!
+
+ // save and load column size and sort order
+ String GetConfigString() const;
+ void SetConfigString( const String& rCfgStr );
+
+ void SetUrlFilter( const IUrlFilter* _pFilter );
+
+ void EndInplaceEditing( bool _bCancel );
+
+protected:
+ virtual void StateChanged( StateChangedType nStateChange );
+};
+
+// struct SvtContentEntry ------------------------------------------------
+
+struct SvtContentEntry
+{
+ sal_Bool mbIsFolder;
+ OUString maURL;
+
+ SvtContentEntry( const OUString& rURL, sal_Bool bIsFolder ) :
+ mbIsFolder( bIsFolder ), maURL( rURL ) {}
+};
+
+namespace svtools {
+
+// -----------------------------------------------------------------------
+// QueryDeleteDlg_Impl
+// -----------------------------------------------------------------------
+
+enum QueryDeleteResult_Impl
+{
+ QUERYDELETE_YES = 0,
+ QUERYDELETE_NO,
+ QUERYDELETE_ALL,
+ QUERYDELETE_CANCEL
+};
+
+class SVT_DLLPUBLIC QueryDeleteDlg_Impl : public ModalDialog
+{
+ FixedText _aEntryLabel;
+ FixedText _aEntry;
+ FixedText _aQueryMsg;
+
+ PushButton _aYesButton;
+ PushButton _aAllButton;
+ PushButton _aNoButton;
+ CancelButton _aCancelButton;
+
+ QueryDeleteResult_Impl _eResult;
+
+private:
+
+ DECL_DLLPRIVATE_STATIC_LINK( QueryDeleteDlg_Impl, ClickLink, PushButton* );
+
+public:
+
+ QueryDeleteDlg_Impl( Window* pParent,
+ const String& rName );
+
+ void EnableAllButton() { _aAllButton.Enable( sal_True ); }
+ QueryDeleteResult_Impl GetResult() const { return _eResult; }
+};
+
+}
+
+#endif // _SVT_FILEVIEW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/fmtfield.hxx b/include/svtools/fmtfield.hxx
new file mode 100644
index 000000000000..8486926e53a9
--- /dev/null
+++ b/include/svtools/fmtfield.hxx
@@ -0,0 +1,319 @@
+/* -*- 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 _FMTFIELD_HXX_
+#define _FMTFIELD_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <vcl/spinfld.hxx>
+#include <svl/zforlist.hxx>
+
+namespace validation { class NumberValidator; }
+
+typedef sal_uInt16 FORMAT_CHANGE_TYPE;
+#define FCT_KEYONLY 0x00 // only a new key was set
+#define FCT_FORMATTER 0x01 // a new formatter weas set, usually implies a change of the key, too
+#define FCT_PRECISION 0x02 // a new precision was set
+#define FCT_THOUSANDSSEP 0x03 // the thousands separator setting changed
+
+//------------------------------------------------------------------------------
+class SVT_DLLPUBLIC FormattedField : public SpinField
+{
+private:
+ // Da ein SvNumberFormatter eine ziemlich teure (sowohl zeit- als auch platz-maessig) Angelegenheit ist,
+ // haelt sich nicht jedes Field, an dem kein Formatter gesetzt wurde, eine eigenen Instanz, sondern es gibt nur eine
+ // einzige statische.
+ class StaticFormatter
+ {
+ static SvNumberFormatter* s_cFormatter;
+ static sal_uLong s_nReferences;
+ public:
+ StaticFormatter();
+ ~StaticFormatter();
+
+ operator SvNumberFormatter* () { return GetFormatter(); }
+ SVT_DLLPUBLIC SvNumberFormatter* GetFormatter();
+ };
+
+protected:
+ String m_sLastValidText;
+ // hat nichts mit dem current value zu tun, ist der letzte Text, der waehrend einer Eingabe als gueltig erkannt
+ // wurde (also durch CheckText geprueft, nicht durch den Formatter gejagt)
+ Selection m_aLastSelection;
+
+ double m_dMinValue;
+ double m_dMaxValue;
+ sal_Bool m_bHasMin : 1;
+ sal_Bool m_bHasMax : 1;
+
+ sal_Bool m_bStrictFormat : 1;
+
+ sal_Bool m_bValueDirty : 1;
+ sal_Bool m_bEnableEmptyField : 1;
+ sal_Bool m_bAutoColor : 1;
+ sal_Bool m_bEnableNaN : 1;
+ double m_dCurrentValue;
+ double m_dDefaultValue;
+
+ sal_uLong m_nFormatKey;
+ SvNumberFormatter* m_pFormatter;
+ StaticFormatter m_aStaticFormatter;
+
+ double m_dSpinSize;
+ double m_dSpinFirst;
+ double m_dSpinLast;
+
+ // es macht einen Unterschied, ob man bei eingestellter Textformatierung beim LostFocus den aktuellen String durch
+ // den Formatter jagt und das Ergebnis anzeigt oder erst aus dem String ein double macht, das formatiert und dann
+ // ausgibt
+ sal_Bool m_bTreatAsNumber;
+ // und mit den folgenden Members koennen wir das Ganze hier auch zur formatierten Text-Ausgabe benutzen ...
+ String m_sCurrentTextValue;
+ String m_sDefaultText;
+
+ // die bei der letzten Ausgabe-Operation vom Formatter gelieferte Farbe (nicht dass wir sie beachten wuerden, aber
+ // man kann sie von aussen abfragen)
+ Color* m_pLastOutputColor;
+
+ bool m_bUseInputStringForFormatting;
+
+public:
+ FormattedField(Window* pParent, WinBits nStyle = 0, SvNumberFormatter* pInitialFormatter = NULL, sal_Int32 nFormatKey = 0);
+ FormattedField(Window* pParent, const ResId& rResId, SvNumberFormatter* pInitialFormatter = NULL, sal_Int32 nFormatKey = 0);
+ virtual ~FormattedField();
+
+ // Min-/Max-Verwaltung
+ sal_Bool HasMinValue() const { return m_bHasMin; }
+ void ClearMinValue() { m_bHasMin = sal_False; }
+ void SetMinValue(double dMin);
+ double GetMinValue() const { return m_dMinValue; }
+
+ sal_Bool HasMaxValue() const { return m_bHasMax; }
+ void ClearMaxValue() { m_bHasMax = sal_False; }
+ void SetMaxValue(double dMax);
+ double GetMaxValue() const { return m_dMaxValue; }
+
+ // aktueller Wert
+ virtual void SetValue(double dVal);
+ virtual double GetValue();
+ // die Standard-Implementierung jagt die Eingabe jeweils durch den Formatter, so einer vorhanden ist
+
+ void GetColor() const;
+
+ void SetTextValue(const OUString& rText);
+ // der String wird in ein double umgewandelt (durch den Formatter) und anschliessen in SetValue gesteckt
+
+ sal_Bool IsEmptyFieldEnabled() const { return m_bEnableEmptyField; }
+ void EnableEmptyField(sal_Bool bEnable);
+ // wenn nicht enabled, wird beim Verlassen des Feldes der Text auf den letzten gueltigen zurueckgesetzt
+
+ void SetDefaultValue(double dDefault) { m_dDefaultValue = dDefault; m_bValueDirty = sal_True; }
+ // wenn der aktuelle String ungueltig ist, liefert GetValue() diesen Default-Wert
+ double GetDefaultValue() const { return m_dDefaultValue; }
+
+ // Einstellungen fuer das Format
+ sal_uLong GetFormatKey() const { return m_nFormatKey; }
+ void SetFormatKey(sal_uLong nFormatKey);
+
+ SvNumberFormatter* GetFormatter() const { return m_pFormatter; }
+ void SetFormatter(SvNumberFormatter* pFormatter, sal_Bool bResetFormat = sal_True);
+ // wenn bResetFormat sal_False ist, wird versucht, das alte eingestellte Format mit 'hinueberzuretten' (teuer, wenn es sich nicht
+ // um eines der Standard-Formate handelt, die in allen Formattern gleich sind)
+ // wenn sal_True, wird als neuer FormatKey 0 gesetzt
+
+ sal_Bool GetThousandsSep() const;
+ void SetThousandsSep(sal_Bool _bUseSeparator);
+ // the is no check if the current format is numeric, so be cautious when calling these functions
+
+ sal_uInt16 GetDecimalDigits() const;
+ void SetDecimalDigits(sal_uInt16 _nPrecision);
+ // the is no check if the current format is numeric, so be cautious when calling these functions
+
+ SvNumberFormatter* StandardFormatter() { return m_aStaticFormatter; }
+ // Wenn man keinen eigenen Formatter explizit anlegen will, kann man diesen hier in SetFormatter stecken ...
+ // Das hier gelieferte Objekt wird allerdings zwischen allen Instanzen der Klasse geteilt (aus Zeit- und Platzgruenden),
+ // also ist etwas Vorsicht angebracht ...
+
+ OUString GetFormat(LanguageType& eLang) const;
+ sal_Bool SetFormat(const OUString& rFormatString, LanguageType eLang);
+ // sal_False, wenn der FormatString nicht gesetzt werden konnte (also wahrscheinlich ungueltig ist)
+
+ sal_Bool IsStrictFormat() const { return m_bStrictFormat; }
+ void SetStrictFormat(sal_Bool bEnable) { m_bStrictFormat = bEnable; }
+ // Formatueberpruefung waehrend der Eingabe ?
+
+ // Spin-Handling
+ virtual void Up();
+ virtual void Down();
+ // Standard-Implementierung : hoch- oder runterzaehlen des aktuellen double einfach um die gesetzte SpinSize
+ virtual void First();
+ virtual void Last();
+ // Standard-Implementierung : aktuelles double setzen auf eingestellten first respektive last value
+
+ void SetSpinSize(double dStep) { m_dSpinSize = dStep; }
+ double GetSpinSize() const { return m_dSpinSize; }
+
+ void SetSpinFirst(double dFirst) { m_dSpinFirst = dFirst; }
+ double GetSpinFirst() const { return m_dSpinFirst; }
+
+ void SetSpinLast(double dLast) { m_dSpinLast = dLast; }
+ double GetSpinLast() const { return m_dSpinLast; }
+
+ sal_Bool TreatingAsNumber() const { return m_bTreatAsNumber; }
+ void TreatAsNumber(sal_Bool bDoSo) { m_bTreatAsNumber = bDoSo; }
+
+public:
+ virtual void SetText( const OUString& rStr );
+ virtual void SetText( const OUString& rStr, const Selection& rNewSelection );
+
+ // die folgenden Methoden sind interesant, wenn m_bTreatAsNumber auf sal_False sitzt
+ /** nehmen wir mal an, irgendjemand will das ganze schoene double-Handling gar nicht haben, sondern
+ einfach den Text formatiert ausgeben ...
+ (der Text wird einfach nur durch den Formatter gejagt und dann gesetzt)
+ */
+ void SetTextFormatted(const OUString& rText);
+ String GetTextValue() const;
+
+ void SetDefaultText(const OUString& rDefault) { m_sDefaultText = rDefault; }
+ String GetDefaultText() const { return m_sDefaultText; }
+
+ // die bei der letzten Ausgabe-Operation vom Formatter gelieferte Farbe (Ausgabe-Operationen werden getriggert durch
+ // SetValue, SetTextValue, SetTextFormatted, also indirekt eventuell auch durch SetMin-/-MaxValue)
+ Color* GetLastOutputColor() const { return m_pLastOutputColor; }
+
+ /** reformats the current text. Interesting if the user entered some text in an "input format", and
+ this should be formatted in the "output format" (which may differ, e.g. by additional numeric
+ digits or such).
+ */
+ void Commit();
+
+ // enable automatic coloring. if set to sal_True, and the format the field is working with for any current value
+ // says that it has to be painted in a special color (e.g. a format where negative numbers should be printed
+ // red), the text is painted with that color automatically.
+ // The color used is the same as returned by GetLastOutputColor()
+ void SetAutoColor(sal_Bool _bAutomatic);
+ sal_Bool GetAutoColor() const { return m_bAutoColor; }
+
+ /** enables handling of not-a-number value.
+
+ When this is set to <FALSE/> (the default), then invalid inputs (i.e. text which cannot be
+ intepreted, according to the current formatting) will be handled as if the default value
+ has been entered. GetValue the will return this default value.
+
+ When set to <TRUE/>, then GetValue will return NaN (not a number, see <method scope="rtl::math">isNan</method>)
+ when the current input is invalid.
+
+ Note that setting this to <TRUE/> implies that upon leaving the control, the input
+ will *not* be corrected to a valid value. For example, if the user enters "foo" in the
+ control, and then tabs out of it, the text "foo" will persist, and GetValue will
+ return NaN in subsequent calls.
+ */
+ void EnableNotANumber( sal_Bool _bEnable );
+ sal_Bool IsNotANumberEnabled( ) const { return m_bEnableNaN; }
+
+ /** When being set to true, the strings in the field are formatted using the
+ InputLine format. That's also what you get in Calc when you edit a cell
+ using F2
+ */
+ void UseInputStringForFormatting( bool bUseInputStr = true );
+ bool IsUsingInputStringForFormatting() const;
+
+protected:
+ virtual long Notify(NotifyEvent& rNEvt);
+ virtual void Modify();
+
+ // CheckText ueberschreiben fuer Ueberpruefung zur Eingabezeit
+ virtual sal_Bool CheckText(const OUString&) const { return sal_True; }
+
+ // any aspect of the current format has changed
+ virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat);
+
+ void ImplSetTextImpl(const OUString& rNew, Selection* pNewSel);
+ void ImplSetValue(double dValue, sal_Bool bForce);
+ sal_Bool ImplGetValue(double& dNewVal);
+
+ void ImplSetFormatKey(sal_uLong nFormatKey);
+ // SetFormatKey without FormatChanged notification
+
+ virtual SvNumberFormatter* CreateFormatter() { SetFormatter(StandardFormatter()); return m_pFormatter; }
+ SvNumberFormatter* ImplGetFormatter() const { return m_pFormatter ? m_pFormatter : ((FormattedField*)this)->CreateFormatter(); }
+
+ long PreNotify(NotifyEvent& rNEvt);
+
+ virtual void ReFormat();
+};
+
+//------------------------------------------------------------------------------
+class SVT_DLLPUBLIC DoubleNumericField : public FormattedField
+{
+protected:
+ validation::NumberValidator* m_pNumberValidator;
+
+public:
+ DoubleNumericField(Window* pParent, WinBits nStyle = 0)
+ :FormattedField(pParent, nStyle)
+ ,m_pNumberValidator( NULL )
+ {
+ ResetConformanceTester();
+ }
+
+ DoubleNumericField(Window* pParent, const ResId& rResId)
+ :FormattedField(pParent, rResId)
+ ,m_pNumberValidator( NULL )
+ {
+ ResetConformanceTester();
+ }
+ virtual ~DoubleNumericField();
+
+protected:
+ virtual sal_Bool CheckText(const OUString& sText) const;
+
+ virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat);
+ void ResetConformanceTester();
+};
+
+//==============================================================================
+#define FCT_CURRENCY_SYMBOL 0x10
+#define FCT_CURRSYM_POSITION 0x20
+
+//------------------------------------------------------------------------------
+class DoubleCurrencyField : public FormattedField
+{
+ OUString m_sCurrencySymbol;
+ sal_Bool m_bPrependCurrSym;
+ sal_Bool m_bChangingFormat;
+
+public:
+ DoubleCurrencyField(Window* pParent, WinBits nStyle = 0);
+
+ OUString getCurrencySymbol() const { return m_sCurrencySymbol; }
+ void setCurrencySymbol(const OUString& rSymbol);
+
+ sal_Bool getPrependCurrSym() const { return m_bPrependCurrSym; }
+ void setPrependCurrSym(sal_Bool _bPrepend);
+
+protected:
+ virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat);
+
+ void UpdateCurrencyFormat();
+};
+
+#endif // _FMTFIELD_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/fontsubstconfig.hxx b/include/svtools/fontsubstconfig.hxx
new file mode 100644
index 000000000000..5221e29aa585
--- /dev/null
+++ b/include/svtools/fontsubstconfig.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 _SVT_FONTSUBSTCONFIG_HXX
+#define _SVT_FONTSUBSTCONFIG_HXX
+
+#include "svtools/svtdllapi.h"
+#include <unotools/configitem.hxx>
+
+struct SvtFontSubstConfig_Impl;
+
+//-----------------------------------------------------------------------------
+struct SubstitutionStruct
+{
+ OUString sFont;
+ OUString sReplaceBy;
+ sal_Bool bReplaceAlways;
+ sal_Bool bReplaceOnScreenOnly;
+};
+//-----------------------------------------------------------------------------
+class SVT_DLLPUBLIC SvtFontSubstConfig : public utl::ConfigItem
+{
+ sal_Bool bIsEnabled;
+ SvtFontSubstConfig_Impl* pImpl;
+public:
+ SvtFontSubstConfig();
+ virtual ~SvtFontSubstConfig();
+
+ virtual void Commit();
+ virtual void Notify( const com::sun::star::uno::Sequence< OUString >& _rPropertyNames);
+
+ sal_Bool IsEnabled() const {return bIsEnabled;}
+ void Enable(sal_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 000000000000..7543788f5afc
--- /dev/null
+++ b/include/svtools/framestatuslistener.hxx
@@ -0,0 +1,101 @@
+/* -*- 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_FRAMESTATUSLISTENER_HXX
+#define _SVTOOLS_FRAMESTATUSLISTENER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XFrameActionListener.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/broadcasthelper.hxx>
+
+#include <boost/unordered_map.hpp>
+
+namespace svt
+{
+
+class SVT_DLLPUBLIC FrameStatusListener : public ::com::sun::star::frame::XStatusListener,
+ public ::com::sun::star::frame::XFrameActionListener,
+ public ::com::sun::star::lang::XComponent,
+ public ::comphelper::OBaseMutex,
+ public ::cppu::OWeakObject
+{
+ public:
+ FrameStatusListener( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame );
+ virtual ~FrameStatusListener();
+
+ // methods to support status forwarder, known by the old sfx2 toolbox controller implementation
+ void addStatusListener( const OUString& aCommandURL );
+ void bindListener();
+ void unbindListener();
+ sal_Bool isBound() const;
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ // XFrameActionListener
+ virtual void SAL_CALL frameAction( const com::sun::star::frame::FrameActionEvent& Action ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ protected:
+ struct Listener
+ {
+ Listener( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& rDispatch ) :
+ aURL( rURL ), xDispatch( rDispatch ) {}
+
+ ::com::sun::star::util::URL aURL;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
+ };
+
+ typedef ::boost::unordered_map< OUString,
+ com::sun::star::uno::Reference< com::sun::star::frame::XDispatch >,
+ OUStringHash,
+ ::std::equal_to< OUString > > URLToDispatchMap;
+
+ sal_Bool m_bInitialized : 1,
+ m_bDisposed : 1;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ URLToDispatchMap m_aListenerMap;
+};
+
+}
+
+#endif // _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 000000000000..f01d5428a44f
--- /dev/null
+++ b/include/svtools/generictoolboxcontroller.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 __SVTOOLS_GENERICTOOLBOXCONTROLLER_HXX_
+#define __SVTOOLS_GENERICTOOLBOXCONTROLLER_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <svtools/toolboxcontroller.hxx>
+#include <vcl/toolbox.hxx>
+
+namespace svt
+{
+
+struct ExecuteInfo;
+class SVT_DLLPUBLIC GenericToolboxController : public svt::ToolboxController
+{
+ public:
+ GenericToolboxController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
+ const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame,
+ ToolBox* pToolBox,
+ sal_uInt16 nID,
+ const OUString& aCommand );
+ virtual ~GenericToolboxController();
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ DECL_STATIC_LINK( GenericToolboxController, ExecuteHdl_Impl, ExecuteInfo* );
+
+ private:
+ ToolBox* m_pToolbox;
+ sal_uInt16 m_nID;
+};
+
+}
+
+#endif // __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 000000000000..808282255bf5
--- /dev/null
+++ b/include/svtools/genericunodialog.hxx
@@ -0,0 +1,185 @@
+/* -*- 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 _SVT_GENERICUNODIALOG_HXX_
+#define _SVT_GENERICUNODIALOG_HXX_
+
+#include "svtools/svtdllapi.h"
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/lang/NotInitializedException.hpp>
+
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/propshlp.hxx>
+#include <comphelper/proparrhlp.hxx>
+#include <comphelper/uno3.hxx>
+#include <comphelper/propertycontainer.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <tools/link.hxx>
+
+class Dialog;
+class Window;
+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::WeakImplHelper3 < com::sun::star::ui::dialogs::XExecutableDialog
+ , com::sun::star::lang::XServiceInfo
+ , com::sun::star::lang::XInitialization
+ > OGenericUnoDialogBase;
+
+ /** abstract base class for implementing UNO objects representing dialogs (<type scope="com.sun.star.awt">XDialog</type>)
+ */
+ class SVT_DLLPUBLIC OGenericUnoDialog
+ :public OGenericUnoDialogBase
+ ,public ::comphelper::OMutexAndBroadcastHelper
+ ,public ::comphelper::OPropertyContainer
+ {
+ private:
+ ::osl::Mutex m_aExecutionMutex; /// acess safety for execute/cancel
+
+ protected:
+ Dialog* m_pDialog; /// the dialog to execute
+ sal_Bool m_bExecuting : 1; /// we're currently executing the dialog
+ sal_Bool m_bCanceled : 1; /// endDialog was called while we were executing
+ sal_Bool m_bTitleAmbiguous : 1; /// m_sTitle has not been set yet
+ bool m_bInitialized : 1; /// has "initialize" been called?
+ bool m_bNeedInitialization : 1; /// do we need to be initialized before any other API call is allowed?
+
+ // <properties>
+ OUString m_sTitle; /// title of the dialog
+ com::sun::star::uno::Reference<com::sun::star::awt::XWindow> m_xParent; /// parent window
+ // </properties>
+
+ com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> m_aContext;
+
+ public:
+ inline bool needInitialization() const { return m_bNeedInitialization && !m_bInitialized; }
+
+ protected:
+ OGenericUnoDialog(const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& _rxContext);
+ virtual ~OGenericUnoDialog();
+
+ public:
+ // UNO
+ DECLARE_UNO3_DEFAULTS(OGenericUnoDialog, OGenericUnoDialogBase);
+ virtual com::sun::star::uno::Any SAL_CALL queryInterface(const com::sun::star::uno::Type& _rType) throw (com::sun::star::uno::RuntimeException);
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence<com::sun::star::uno::Type> SAL_CALL getTypes( ) throw(com::sun::star::uno::RuntimeException);
+ virtual com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(com::sun::star::uno::RuntimeException) = 0;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw(com::sun::star::uno::RuntimeException) = 0;
+ virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw(com::sun::star::uno::RuntimeException);
+ virtual ::comphelper::StringSequence SAL_CALL getSupportedServiceNames() throw(com::sun::star::uno::RuntimeException) = 0;
+
+ // OPropertySetHelper
+ virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const com::sun::star::uno::Any& rValue ) throw(com::sun::star::uno::Exception);
+ virtual sal_Bool SAL_CALL convertFastPropertyValue( com::sun::star::uno::Any& rConvertedValue, com::sun::star::uno::Any& rOldValue, sal_Int32 nHandle, const com::sun::star::uno::Any& rValue) throw(com::sun::star::lang::IllegalArgumentException);
+
+ // XExecutableDialog
+ virtual void SAL_CALL setTitle( const OUString& aTitle ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL execute( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments ) throw(com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
+
+ protected:
+ /** create the concret dialog instance. note that m_aMutex is not locked when this method get's 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 Dialog* createDialog(Window* _pParent) = 0;
+
+ /// called to destroy the dialog used. the default implementation just deletes m_pDialog and resets it to NULL
+ virtual 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 <type scope="com.sun.star.uno">Any</type>'s,
+ which is split up into the single elements, which are passed to implInitialize. The default implementation
+ tries to exract an <type scope="com.sun.star.beans">PropertyValue</type> from the value an pass it to the
+ <type scope="com.sun.star.beans">XPropertySet</type> interface of the object.
+ */
+ virtual void implInitialize(const com::sun::star::uno::Any& _rValue);
+
+ private:
+ DECL_LINK( OnDialogDying, VclWindowEvent* );
+
+ /** 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 a OGenericUnoDialog
+ class UnoDialogEntryGuard
+ {
+ public:
+ UnoDialogEntryGuard( OGenericUnoDialog& _rDialog )
+ :m_aGuard( _rDialog.GetMutex() )
+ {
+ if ( _rDialog.needInitialization() )
+ throw ::com::sun::star::lang::NotInitializedException();
+ }
+
+ private:
+ ::osl::MutexGuard m_aGuard;
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // _SVT_GENERICUNODIALOG_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
new file mode 100644
index 000000000000..9a3bd8c1d1ff
--- /dev/null
+++ b/include/svtools/grfmgr.hxx
@@ -0,0 +1,624 @@
+/* -*- 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 _GRFMGR_HXX
+#define _GRFMGR_HXX
+
+#include <vcl/graph.hxx>
+#include <svtools/svtdllapi.h>
+
+#define GRFMGR_DRAW_NOTCACHED 0x00000000UL
+#define GRFMGR_DRAW_CACHED 0x00000001UL
+#define GRFMGR_DRAW_SMOOTHSCALE 0x00000002UL
+#define GRFMGR_DRAW_USE_DRAWMODE_SETTINGS 0x00000004UL
+#define GRFMGR_DRAW_SUBSTITUTE 0x00000008UL
+#define GRFMGR_DRAW_NO_SUBSTITUTE 0x00000010UL
+#define GRFMGR_DRAW_STANDARD (GRFMGR_DRAW_CACHED|GRFMGR_DRAW_SMOOTHSCALE)
+
+// AutoSwap defines
+
+#define GRFMGR_AUTOSWAPSTREAM_LINK ((SvStream*)0x00000000UL)
+#define GRFMGR_AUTOSWAPSTREAM_LOADED ((SvStream*)0xfffffffdUL)
+#define GRFMGR_AUTOSWAPSTREAM_TEMP ((SvStream*)0xfffffffeUL)
+#define GRFMGR_AUTOSWAPSTREAM_NONE ((SvStream*)0xffffffffUL)
+
+// Adjustment defines
+
+#define ADJUSTMENT_NONE 0x00000000UL
+#define ADJUSTMENT_DRAWMODE 0x00000001UL
+#define ADJUSTMENT_COLORS 0x00000002UL
+#define ADJUSTMENT_MIRROR 0x00000004UL
+#define ADJUSTMENT_ROTATE 0x00000008UL
+#define ADJUSTMENT_TRANSPARENCY 0x00000010UL
+#define ADJUSTMENT_ALL 0xFFFFFFFFUL
+
+enum GraphicDrawMode
+{
+ GRAPHICDRAWMODE_STANDARD = 0,
+ GRAPHICDRAWMODE_GREYS = 1,
+ GRAPHICDRAWMODE_MONO = 2,
+ GRAPHICDRAWMODE_WATERMARK = 3
+};
+
+class GraphicManager;
+class SvStream;
+class BitmapWriteAccess;
+class GraphicCache;
+class VirtualDevice;
+struct GrfSimpleCacheObj;
+struct ImplTileInfo;
+
+class SVT_DLLPUBLIC GraphicAttr
+{
+private:
+
+ double mfGamma;
+ sal_uInt32 mnMirrFlags;
+ long mnLeftCrop;
+ long mnTopCrop;
+ long mnRightCrop;
+ long mnBottomCrop;
+ sal_uInt16 mnRotate10;
+ short mnContPercent;
+ short mnLumPercent;
+ short mnRPercent;
+ short mnGPercent;
+ short mnBPercent;
+ sal_Bool mbInvert;
+ sal_uInt8 mcTransparency;
+ GraphicDrawMode meDrawMode;
+
+public:
+
+ GraphicAttr();
+ ~GraphicAttr();
+
+ sal_Bool operator==( const GraphicAttr& rAttr ) const;
+ sal_Bool operator!=( const GraphicAttr& rAttr ) const { return !( *this == rAttr ); }
+
+ void SetDrawMode( GraphicDrawMode eDrawMode ) { meDrawMode = eDrawMode; }
+ GraphicDrawMode GetDrawMode() const { return meDrawMode; }
+
+ void SetMirrorFlags( sal_uLong nMirrFlags ) { mnMirrFlags = nMirrFlags; }
+ sal_uLong GetMirrorFlags() const { return mnMirrFlags; }
+
+ void SetCrop( long nLeft_100TH_MM, long nTop_100TH_MM, long nRight_100TH_MM, long nBottom_100TH_MM )
+ {
+ mnLeftCrop = nLeft_100TH_MM; mnTopCrop = nTop_100TH_MM;
+ mnRightCrop = nRight_100TH_MM; mnBottomCrop = nBottom_100TH_MM;
+ }
+ long GetLeftCrop() const { return mnLeftCrop; }
+ long GetTopCrop() const { return mnTopCrop; }
+ long GetRightCrop() const { return mnRightCrop; }
+ long GetBottomCrop() const { return mnBottomCrop; }
+
+ void SetRotation( sal_uInt16 nRotate10 ) { mnRotate10 = nRotate10; }
+ sal_uInt16 GetRotation() const { return mnRotate10; }
+
+ void SetLuminance( short nLuminancePercent ) { mnLumPercent = nLuminancePercent; }
+ short GetLuminance() const { return mnLumPercent; }
+
+ void SetContrast( short nContrastPercent ) { mnContPercent = nContrastPercent; }
+ short GetContrast() const { return mnContPercent; }
+
+ void SetChannelR( short nChannelRPercent ) { mnRPercent = nChannelRPercent; }
+ short GetChannelR() const { return mnRPercent; }
+
+ void SetChannelG( short nChannelGPercent ) { mnGPercent = nChannelGPercent; }
+ short GetChannelG() const { return mnGPercent; }
+
+ void SetChannelB( short nChannelBPercent ) { mnBPercent = nChannelBPercent; }
+ short GetChannelB() const { return mnBPercent; }
+
+ void SetGamma( double fGamma ) { mfGamma = fGamma; }
+ double GetGamma() const { return mfGamma; }
+
+ void SetInvert( sal_Bool bInvert ) { mbInvert = bInvert; }
+ sal_Bool IsInvert() const { return mbInvert; }
+
+ void SetTransparency( sal_uInt8 cTransparency ) { mcTransparency = cTransparency; }
+ sal_uInt8 GetTransparency() const { return mcTransparency; }
+
+ sal_Bool IsSpecialDrawMode() const { return( meDrawMode != GRAPHICDRAWMODE_STANDARD ); }
+ sal_Bool IsMirrored() const { return( mnMirrFlags != 0UL ); }
+ sal_Bool IsCropped() const
+ {
+ return( mnLeftCrop != 0 || mnTopCrop != 0 ||
+ mnRightCrop != 0 || mnBottomCrop != 0 );
+ }
+ sal_Bool IsRotated() const { return( ( mnRotate10 % 3600 ) != 0 ); }
+ sal_Bool IsTransparent() const { return( mcTransparency > 0 ); }
+ sal_Bool IsAdjusted() const
+ {
+ return( mnLumPercent != 0 || mnContPercent != 0 || mnRPercent != 0 ||
+ mnGPercent != 0 || mnBPercent != 0 || mfGamma != 1.0 || mbInvert );
+ }
+
+ friend SvStream& operator<<( SvStream& rOStm, const GraphicAttr& rAttr );
+ friend SvStream& operator>>( SvStream& rIStm, GraphicAttr& rAttr );
+};
+
+class SVT_DLLPUBLIC GraphicObject : public SvDataCopyStream
+{
+ friend class GraphicManager;
+
+private:
+
+ static GraphicManager* mpGlobalMgr;
+
+ Graphic maGraphic;
+ GraphicAttr maAttr;
+ Size maPrefSize;
+ MapMode maPrefMapMode;
+ sal_uLong mnSizeBytes;
+ GraphicType meType;
+ GraphicManager* mpMgr;
+ String* mpLink;
+ Link* mpSwapStreamHdl;
+ String* mpUserData;
+ Timer* mpSwapOutTimer;
+ GrfSimpleCacheObj* mpSimpleCache;
+ sal_uLong mnAnimationLoopCount;
+ sal_Bool mbAutoSwapped : 1;
+ sal_Bool mbTransparent : 1;
+ sal_Bool mbAnimated : 1;
+ sal_Bool mbEPS : 1;
+ sal_Bool mbIsInSwapIn : 1;
+ sal_Bool mbIsInSwapOut : 1;
+ sal_Bool mbAlpha : 1;
+
+ void SVT_DLLPRIVATE ImplConstruct();
+ void SVT_DLLPRIVATE ImplAssignGraphicData();
+ void SVT_DLLPRIVATE ImplSetGraphicManager(
+ const GraphicManager* pMgr,
+ const OString* pID = NULL,
+ const GraphicObject* pCopyObj = NULL
+ );
+ void SVT_DLLPRIVATE ImplAutoSwapIn();
+ sal_Bool SVT_DLLPRIVATE ImplIsAutoSwapped() const { return mbAutoSwapped; }
+ sal_Bool SVT_DLLPRIVATE ImplGetCropParams(
+ OutputDevice* pOut,
+ Point& rPt,
+ Size& rSz,
+ const GraphicAttr* pAttr,
+ PolyPolygon& rClipPolyPoly,
+ sal_Bool& bRectClipRegion
+ ) const;
+
+ /** Render a given number of tiles in an optimized way
+
+ This method recursively subdivides the tile rendering problem
+ in smaller parts, i.e. rendering output size x with few tiles
+ of size y, which in turn are generated from the original
+ bitmap in a recursive fashion. The subdivision size can be
+ controlled by the exponent argument, which specifies the
+ minimal number of smaller tiles used in one recursion
+ step. The resulting tile size is given as the integer number
+ of repetitions of the original bitmap along x and y. As the
+ exponent need not necessarily divide these numbers without
+ remainder, the repetition counts are effectively converted to
+ base-exponent numbers, where each place denotes the number of
+ times the corresponding tile size is rendered.
+
+ @param rVDev
+ Virtual device to render everything into
+
+ @param nExponent
+ Number of repetitions per subdivision step, _must_ be greater than 1
+
+ @param nNumTilesX
+ Number of original tiles to generate in x direction
+
+ @param nNumTilesY
+ Number of original tiles to generate in y direction
+
+ @param rTileSizePixel
+ Size in pixel of the original tile bitmap to render it in
+
+ @param pAttr
+ Graphic attributes to be used for rendering
+
+ @param nFlags
+ Graphic flags to be used for rendering
+
+ @param rCurrPos
+ Current output point for this recursion level (should start with (0,0))
+
+ @return true, if everything was successfully rendered.
+ */
+ bool SVT_DLLPRIVATE ImplRenderTempTile(
+ VirtualDevice& rVDev,
+ int nExponent,
+ int nNumTilesX,
+ int nNumTilesY,
+ const Size& rTileSizePixel,
+ const GraphicAttr* pAttr,
+ sal_uLong nFlags
+ );
+
+ /// internally called by ImplRenderTempTile()
+ bool SVT_DLLPRIVATE ImplRenderTileRecursive(
+ VirtualDevice& rVDev,
+ int nExponent,
+ int nMSBFactor,
+ int nNumOrigTilesX,
+ int nNumOrigTilesY,
+ int nRemainderTilesX,
+ int nRemainderTilesY,
+ const Size& rTileSizePixel,
+ const GraphicAttr* pAttr,
+ sal_uLong nFlags,
+ ImplTileInfo& rTileInfo
+ );
+
+ bool SVT_DLLPRIVATE ImplDrawTiled(
+ OutputDevice* pOut,
+ const Rectangle& rArea,
+ const Size& rSizePixel,
+ const Size& rOffset,
+ const GraphicAttr* pAttr,
+ sal_uLong nFlags,
+ int nTileCacheSize1D
+ );
+
+ bool SVT_DLLPRIVATE ImplDrawTiled(
+ OutputDevice& rOut,
+ const Point& rPos,
+ int nNumTilesX,
+ int nNumTilesY,
+ const Size& rTileSize,
+ const GraphicAttr* pAttr,
+ sal_uLong nFlags
+ );
+
+ void SVT_DLLPRIVATE ImplTransformBitmap(
+ BitmapEx& rBmpEx,
+ const GraphicAttr& rAttr,
+ const Size& rCropLeftTop,
+ const Size& rCropRightBottom,
+ const Rectangle& rCropRect,
+ const Size& rDstSize,
+ sal_Bool bEnlarge
+ ) const;
+
+ DECL_LINK( ImplAutoSwapOutHdl, void* );
+
+protected:
+
+ virtual void GraphicManagerDestroyed();
+ virtual SvStream* GetSwapStream() const;
+
+ virtual void Load( SvStream& );
+ virtual void Save( SvStream& );
+ virtual void Assign( const SvDataCopyStream& );
+
+public:
+
+ TYPEINFO();
+
+ GraphicObject( const GraphicManager* pMgr = NULL );
+ GraphicObject( const Graphic& rGraphic, const GraphicManager* pMgr = NULL );
+ GraphicObject( const GraphicObject& rCacheObj, const GraphicManager* pMgr = NULL );
+ explicit GraphicObject( const OString& rUniqueID, const GraphicManager* pMgr = NULL );
+ ~GraphicObject();
+
+ GraphicObject& operator=( const GraphicObject& rCacheObj );
+ sal_Bool operator==( const GraphicObject& rCacheObj ) const;
+ sal_Bool operator!=( const GraphicObject& rCacheObj ) const { return !( *this == rCacheObj ); }
+
+ sal_Bool HasSwapStreamHdl() const { return( mpSwapStreamHdl != NULL && mpSwapStreamHdl->IsSet() ); }
+ void SetSwapStreamHdl();
+ void SetSwapStreamHdl( const Link& rHdl, const sal_uLong nSwapOutTimeout = 0UL );
+ sal_uLong GetSwapOutTimeout() const { return( mpSwapOutTimer ? mpSwapOutTimer->GetTimeout() : 0 ); }
+
+ void FireSwapInRequest();
+ void FireSwapOutRequest();
+
+ GraphicManager& GetGraphicManager() const { return *mpMgr; }
+
+ sal_Bool IsCached(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ const GraphicAttr* pAttr = NULL,
+ sal_uLong nFlags = GRFMGR_DRAW_STANDARD
+ ) const;
+ void ReleaseFromCache();
+
+ const Graphic& GetGraphic() const;
+ void SetGraphic( const Graphic& rGraphic, const GraphicObject* pCopyObj = 0);
+ void SetGraphic( const Graphic& rGraphic, const String& rLink );
+
+ /** Get graphic transformed according to given attributes
+
+ This method returns a Graphic transformed, cropped and scaled
+ to the given parameters, ready to be rendered to printer or
+ display. The returned graphic has the same visual appearance
+ as if it had been drawn via GraphicObject::Draw() to a
+ specific output device.
+
+ @param rDestSize
+ Desired output size in logical coordinates. The mapmode to
+ interpret these logical coordinates in is given by the second
+ parameter, rDestMap.
+
+ @param rDestMap
+ Mapmode the output should be interpreted in. This is used to
+ interpret rDestSize, to set the appropriate PrefMapMode on the
+ returned Graphic, and to deal correctly with metafile graphics.
+
+ @param rAttr
+ Graphic attributes used to transform the graphic. This
+ includes cropping, rotation, mirroring, and various color
+ adjustment parameters.
+
+ @return the readily transformed Graphic
+ */
+ Graphic GetTransformedGraphic(
+ const Size& rDestSize,
+ const MapMode& rDestMap,
+ const GraphicAttr& rAttr
+ ) const;
+ Graphic GetTransformedGraphic( const GraphicAttr* pAttr = NULL ) const; // TODO: Change to Impl
+
+ void SetAttr( const GraphicAttr& rAttr );
+ const GraphicAttr& GetAttr() const { return maAttr; }
+
+ sal_Bool HasLink() const { return( mpLink != NULL && mpLink->Len() > 0 ); }
+ void SetLink();
+ void SetLink( const String& rLink );
+ String GetLink() const;
+
+ sal_Bool HasUserData() const { return( mpUserData != NULL && mpUserData->Len() > 0 ); }
+ void SetUserData();
+ void SetUserData( const String& rUserData );
+ String GetUserData() const;
+
+ OString GetUniqueID() const;
+
+ GraphicType GetType() const { return meType; }
+ const Size& GetPrefSize() const { return maPrefSize; }
+ const MapMode& GetPrefMapMode() const { return maPrefMapMode; }
+ sal_uLong GetSizeBytes() const { return mnSizeBytes; }
+ sal_Bool IsTransparent() const { return mbTransparent; }
+ sal_Bool IsAlpha() const { return mbAlpha; }
+ sal_Bool IsAnimated() const { return mbAnimated; }
+ sal_Bool IsEPS() const { return mbEPS; }
+
+ Link GetAnimationNotifyHdl() const { return maGraphic.GetAnimationNotifyHdl(); }
+
+ sal_Bool SwapOut();
+ sal_Bool SwapOut( SvStream* pOStm );
+ sal_Bool SwapIn();
+
+ sal_Bool IsInSwapIn() const { return mbIsInSwapIn; }
+ sal_Bool IsInSwapOut() const { return mbIsInSwapOut; }
+ sal_Bool IsInSwap() const { return( mbIsInSwapOut || mbIsInSwapOut ); }
+ sal_Bool IsSwappedOut() const { return( mbAutoSwapped || maGraphic.IsSwapOut() ); }
+ void SetSwapState();
+
+ bool Draw(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ const GraphicAttr* pAttr = NULL,
+ sal_uLong nFlags = GRFMGR_DRAW_STANDARD
+ );
+
+ sal_Bool DrawWithPDFHandling(
+ OutputDevice& rOutDev,
+ const Point& rPt,
+ const Size& rSz,
+ const GraphicAttr* pGrfAttr = NULL,
+ const sal_uLong nFlags = GRFMGR_DRAW_STANDARD
+ );
+
+ /** Draw the graphic repeatedly into the given output rectangle
+
+ @param pOut
+ OutputDevice where the rendering should take place
+
+ @param rArea
+ The output area that is filled with tiled instances of this graphic
+
+ @param rSize
+ The actual size of a single tile
+
+ @param rOffset
+ Offset from the left, top position of rArea, where to start
+ the tiling. The upper left corner of the graphic tilings will
+ virtually start at this position. Concretely, only that many
+ tiles are drawn to completely fill the given output area.
+
+ @param pAttr
+ Optional GraphicAttr
+
+ @param nFlags
+ Optional rendering flags
+
+ @param nTileCacheSize1D
+ Optional dimension of the generated cache tiles. The pOut sees
+ a number of tile draws, which have approximately
+ nTileCacheSize1D times nTileCacheSize1D bitmap sizes if the
+ tile bitmap is smaller. Otherwise, the tile is drawn as
+ is. This is useful if e.g. you want only a few, very large
+ bitmap drawings appear on the outdev.
+
+ @return sal_True, if drawing completed successfully
+ */
+ sal_Bool DrawTiled(
+ OutputDevice* pOut,
+ const Rectangle& rArea,
+ const Size& rSize,
+ const Size& rOffset,
+ const GraphicAttr* pAttr = NULL,
+ sal_uLong nFlags = GRFMGR_DRAW_STANDARD,
+ int nTileCacheSize1D=128
+ );
+
+ sal_Bool StartAnimation(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ long nExtraData = 0L,
+ const GraphicAttr* pAttr = NULL,
+ sal_uLong nFlags = GRFMGR_DRAW_STANDARD,
+ OutputDevice* pFirstFrameOutDev = NULL
+ );
+
+ void StopAnimation( OutputDevice* pOut = NULL, long nExtraData = 0L );
+
+ friend SvStream& operator<<( SvStream& rOStm, const GraphicObject& rGraphicObj );
+ friend SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj );
+
+ static GraphicObject CreateGraphicObjectFromURL( const OUString &rURL );
+ // will inspect an object ( e.g. a control ) for any 'ImageURL'
+ // properties and return these in a vector. Note: this implementation
+ // will cater for XNameContainer objects and deepinspect any containees
+ // if they exist
+ static void InspectForGraphicObjectImageURL( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIf, std::vector< OUString >& rvEmbedImgUrls );
+};
+
+typedef ::std::vector< GraphicObject* > GraphicObjectList_impl;
+
+class SVT_DLLPUBLIC GraphicManager
+{
+ friend class GraphicObject;
+ friend class GraphicDisplayCacheEntry;
+
+private:
+
+ GraphicObjectList_impl maObjList;
+ GraphicCache* mpCache;
+
+ GraphicManager( const GraphicManager& ) {}
+ GraphicManager& operator=( const GraphicManager& ) { return *this; }
+
+ sal_Bool SVT_DLLPRIVATE ImplDraw(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ GraphicObject& rObj,
+ const GraphicAttr& rAttr,
+ const sal_uLong nFlags,
+ sal_Bool& rCached
+ );
+
+ sal_Bool SVT_DLLPRIVATE ImplCreateOutput(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ const BitmapEx& rBmpEx,
+ const GraphicAttr& rAttr,
+ const sal_uLong nFlags,
+ BitmapEx* pBmpEx = NULL
+ );
+ sal_Bool SVT_DLLPRIVATE ImplCreateOutput(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ const GDIMetaFile& rMtf,
+ const GraphicAttr& rAttr,
+ const sal_uLong nFlags,
+ GDIMetaFile& rOutMtf,
+ BitmapEx& rOutBmpEx
+ );
+
+ static void SVT_DLLPRIVATE ImplAdjust(
+ BitmapEx& rBmpEx,
+ const GraphicAttr& rAttr,
+ sal_uLong nAdjustmentFlags
+ );
+ static void SVT_DLLPRIVATE ImplAdjust(
+ GDIMetaFile& rMtf,
+ const GraphicAttr& rAttr,
+ sal_uLong nAdjustmentFlags
+ );
+ static void SVT_DLLPRIVATE ImplAdjust(
+ Animation& rAnimation,
+ const GraphicAttr& rAttr,
+ sal_uLong nAdjustmentFlags
+ );
+
+ static void SVT_DLLPRIVATE ImplDraw(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ const GDIMetaFile& rMtf,
+ const GraphicAttr& rAttr
+ );
+
+ // Only used by GraphicObject's Ctor's and Dtor's
+ void SVT_DLLPRIVATE ImplRegisterObj(
+ const GraphicObject& rObj,
+ Graphic& rSubstitute,
+ const OString* pID = NULL,
+ const GraphicObject* pCopyObj = NULL
+ );
+ void SVT_DLLPRIVATE ImplUnregisterObj( const GraphicObject& rObj );
+ inline sal_Bool SVT_DLLPRIVATE ImplHasObjects() const { return !maObjList.empty(); }
+
+ // Only used in swap case by GraphicObject
+ void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedOut( const GraphicObject& rObj );
+ sal_Bool SVT_DLLPRIVATE ImplFillSwappedGraphicObject(
+ const GraphicObject& rObj,
+ Graphic& rSubstitute
+ );
+ void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedIn( const GraphicObject& rObj );
+
+ OString SVT_DLLPRIVATE ImplGetUniqueID( const GraphicObject& rObj ) const;
+
+public:
+
+ GraphicManager( sal_uLong nCacheSize = 10000000UL, sal_uLong nMaxObjCacheSize = 2400000UL );
+ ~GraphicManager();
+
+ void SetMaxCacheSize( sal_uLong nNewCacheSize );
+
+ void SetMaxObjCacheSize(
+ sal_uLong nNewMaxObjSize,
+ sal_Bool bDestroyGreaterCached = sal_False
+ );
+
+ void SetCacheTimeout( sal_uLong nTimeoutSeconds );
+
+ void ReleaseFromCache( const GraphicObject& rObj );
+
+ sal_Bool IsInCache(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ const GraphicObject& rObj,
+ const GraphicAttr& rAttr
+ ) const;
+
+ sal_Bool DrawObj(
+ OutputDevice* pOut,
+ const Point& rPt,
+ const Size& rSz,
+ GraphicObject& rObj,
+ const GraphicAttr& rAttr,
+ const sal_uLong nFlags,
+ sal_Bool& rCached
+ );
+};
+
+#endif // _GRFMGR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/headbar.hxx b/include/svtools/headbar.hxx
new file mode 100644
index 000000000000..9be63ce3229d
--- /dev/null
+++ b/include/svtools/headbar.hxx
@@ -0,0 +1,377 @@
+/* -*- 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 _HEADBAR_HXX
+#define _HEADBAR_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/link.hxx>
+#include <vcl/window.hxx>
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class HeaderBar
+
+Diese Klasse dient zur Anzeige einer Ueberschiftszeile. Diese kann Texte,
+Images oder beides anzeigen. Man kann die Items in der Groesse aendern,
+verschieben oder anklicken. In vielen Faellen macht es zum Beispiel Sinn,
+dieses Control mit einer SvTabListBox zu verbinden.
+
+--------------------------------------------------------------------------
+
+WinBits
+
+WB_BORDER Oben und unten wird ein Border gezeichnet
+WB_BOTTOMBORDER Unten wird ein Border gezeichnet
+WB_BUTTONSTYLE Die Items sehen aus wie Buttons, ansonsten sind sie flach
+WB_3DLOOK 3D-Darstellung
+WB_DRAG Items koennen verschoben werden
+WB_STDHEADERBAR WB_BUTTONSTYLE | WB_BOTTOMBORDER
+
+--------------------------------------------------------------------------
+
+ItemBits
+
+HIB_LEFT Inhalt wird im Item linksbuendig ausgegeben
+HIB_CENTER Inhalt wird im Item zentriert ausgegeben
+HIB_RIGHT Inhalt wird im Item rechtsbuendig ausgegeben
+HIB_TOP Inhalt wird im Item an der oberen Kante ausgegeben
+HIB_VCENTER Inhalt wird im Item vertikal zentiert ausgegeben
+HIB_BOTTOM Inhalt wird im Item an der unteren Kante ausgegeben
+HIB_LEFTIMAGE Bei Text und Image, wird Image links vom Text ausgegeben
+HIB_RIGHTIMAGE Bei Text und Image, wird Image rechts vom Text ausgegeben
+HIB_FIXED Item laesst sich nicht in der Groesse aendern
+HIB_FIXEDPOS Item laesst sich nicht verschieben
+HIB_CLICKABLE Item laesst sich anklicken
+ (Select-Handler wird erst bei MouseButtonUp gerufen)
+HIB_FLAT Item wird flach dargestellt, auch wenn WB_BUTTONSTYLE gesetzt ist
+HIB_DOWNARROW Es wird ein Pfeil nach unter hinter dem Text ausgegeben,
+ welcher zum Beispiel angezeigt werden sollte, wenn nach
+ diesem Item eine dazugehoerende Liste absteigend sortiert
+ ist. Der Status des Pfeils kann mit SetItemBits()
+ gesetzt/zurueckgesetzt werden.
+HIB_UPARROW Es wird ein Pfeil nach oben hinter dem Text ausgegeben,
+ welcher zum Beispiel angezeigt werden sollte, wenn nach
+ diesem Item eine dazugehoerende Liste aufsteigend sortiert
+ ist.Der Status des Pfeils kann mit SetItemBits()
+ gesetzt/zurueckgesetzt werden.
+HIB_USERDRAW Zu diesem Item wird auch der UserDraw-Handler gerufen.
+HIB_STDSTYLE (HIB_LEFT | HIB_LEFTIMAGE | HIB_VCENTER | HIB_CLICKABLE)
+
+--------------------------------------------------------------------------
+
+Handler
+
+Select() Wird gerufen, wenn Item angeklickt wird. Wenn
+ HIB_CLICKABLE beim Item gesetzt ist und nicht HIB_FLAT,
+ wird der Handler erst im MouseButtonUp-Handler gerufen,
+ wenn die Maus ueber dem Item losgelassen wurde. Dann
+ verhaellt sich der Select-Handler wie bei einem
+ ToolBox-Button.
+DoubleClick() Dieser Handler wird gerufen, wenn ein Item
+ doppelt geklickt wird. Ob das Item oder der
+ Trenner angeklickt wurden, kann mit IsItemMode()
+ abgefragt werden. Wenn ein Trenner doppelt angeklickt
+ wird, sollte normalerweise die optimale Spaltenbreite
+ berechnet werden und diese gesetzt werden.
+StartDrag() Dieser Handler wird gerufen, wenn Draggen gestartet
+ wird, bzw. wenn ein Item angeklickt wurde.
+ In diesem Handler sollte spaetestens mit SetDragSize()
+ die Groesse der Size-Linie gesetzt werden, wenn
+ IsItemMode() sal_False zurueckliefert.
+Drag() Dieser Handler wird gerufen, wenn gedraggt wird. Wenn
+ mit SetDragSize() keine Groesse gesetzt wird, kann
+ dieser Handler dafuer benutzt werden, um die
+ Linie im angrenzenden Fenster selber zu zeichnen. Mit
+ GetDragPos() kann die aktuelle Drag-Position abgefragt
+ werden. Mit IsItemMode() sollte in diesem Fall
+ abgefragt werden, ob auch ein Trenner gedraggt wird.
+EndDrag() Dieser Handler wird gerufen, wenn ein Drag-Vorgang
+ beendet wurde. Wenn im EndDrag-Handler GetCurItemId()
+ 0 zurueckliefert, wurde der Drag-Vorgang abgebrochen.
+ Wenn dies nicht der Fall ist und IsItemMode() sal_False
+ zurueckliefert, sollte von dem gedraggten Item
+ die neue Groesse mit GetItemSize() abgefragt werden
+ und entsprechend im dazugehoerigem Control uebernommen
+ werden. Wenn IsItemMode() sal_True, GetCurItemId() eine Id
+ und IsItemDrag() sal_True zurueckliefert, wurde dieses
+ Item verschoben. Es sollte dann mit GetItemPos() die
+ neue Position abgefragt werden und auch die Daten
+ im dazugehoerigem Control angepasst werden. Ansonsten
+ koennte auch mit GetItemDragPos() die Position abgefragt
+ werden, an welche Stelle das Item verschoben wurde.
+
+
+Weitere Methoden, die fuer die Handler wichtig sind.
+
+GetCurItemId() Liefert die Id vom Item zurueck, fuer welches gerade
+ der Handler gerufen wurde. Liefert nur eine gueltige
+ Id in den Handlern Select(), DoubleClick(), StartDrag(),
+ Drag() und EndDrag(). Im EndDrag-Handler leifert
+ diese Methode die Id vom gedraggten Item zurueck oder
+ 0, wenn der Drag-Vorgang abgebrochen wurde.
+GetItemDragPos() Liefert die Position zurueck, an der ein Item verschoben
+ wird bzw. wurde. HEADERBAR_ITEM_NOTFOUND wird
+ zurueckgeliefert, wenn der Vorgang abgebrochen wurde
+ oder wenn kein ItemDrag aktiv ist.
+IsItemMode() Mit dieser Methode kann abgefragt werden, ob fuer ein
+ Item oder einen Trenner der Handler gerufen wurde.
+ sal_True - Handler wurde fuer das Item gerufen
+ sal_False - Handler wurde fuer den Trenner gerufen
+IsItemDrag() Mit dieser Methode kann abgefragt werden, ob ein
+ Item gedragt oder selektiert wurde.
+ sal_True - Item wird verschoben
+ sal_False - Item wird selektiert
+SetDragSize() Mit dieser Methode wird gesetzt, wir gross der
+ Trennstrich sein soll, der vom Control gemalt wird.
+ Dies sollte so gross sein, wie das angrenzende Fenster
+ hoch ist. Die Hoehe vom HeaderBar wird automatisch
+ dazugerechnet.
+
+--------------------------------------------------------------------------
+
+Weitere Methoden
+
+SetOffset() Mit dieser Methode wird der Offset gesetzt, ab dem
+ die Items ausgegeben werden. Dies wird benoetigt,
+ wenn das dazugehoerige Fenster gescrollt wird.
+CalcWindowSizePixel() Mit dieser Methode kann man die Hoehe des Fensters
+ berechnen, damit der Inhalt der Items ausgegeben
+ werden kann.
+
+--------------------------------------------------------------------------
+
+Tips und Tricks:
+
+1) KontextMenu
+Wenn ein kontextsensitives PopupMenu anzeigt werden soll, muss der
+Command-Handler ueberlagert werden. Mit GetItemId() und bei
+Uebergabe der Mausposition kann ermittelt werden, ob der Mausclick
+ueber einem bzw. ueber welchem Item durchgefuehrt wurde.
+
+2) Letztes Item
+Wenn man ButtonStyle gesetzt hat, sieht es besser aus, wenn man am
+Ende noch ein leeres Item setzt, was den restlichen Platz einnimmt.
+Dazu fuegt man ein Item mit einem leeren String ein und uebergibt als
+Groesse HEADERBAR_FULLSIZE. Bei diesem Item sollte man dann auch
+nicht HIB_CLICKABLE setzen und dafuer HIB_FIXEDPOS.
+
+*************************************************************************/
+
+class Accelerator;
+class ImplHeadItem;
+
+typedef ::std::vector< ImplHeadItem* > ImplHeadItemList;
+
+// -----------
+// - WinBits -
+// -----------
+
+#define WB_BOTTOMBORDER ((WinBits)0x0400)
+#define WB_BUTTONSTYLE ((WinBits)0x0800)
+#define WB_STDHEADERBAR (WB_BUTTONSTYLE | WB_BOTTOMBORDER)
+
+// ---------------------
+// - HeaderBarItemBits -
+// ---------------------
+
+typedef sal_uInt16 HeaderBarItemBits;
+
+// ----------------------------
+// - Bits fuer HeaderBarItems -
+// ----------------------------
+
+#define HIB_LEFT ((HeaderBarItemBits)0x0001)
+#define HIB_CENTER ((HeaderBarItemBits)0x0002)
+#define HIB_RIGHT ((HeaderBarItemBits)0x0004)
+#define HIB_TOP ((HeaderBarItemBits)0x0008)
+#define HIB_VCENTER ((HeaderBarItemBits)0x0010)
+#define HIB_BOTTOM ((HeaderBarItemBits)0x0020)
+#define HIB_LEFTIMAGE ((HeaderBarItemBits)0x0040)
+#define HIB_RIGHTIMAGE ((HeaderBarItemBits)0x0080)
+#define HIB_FIXED ((HeaderBarItemBits)0x0100)
+#define HIB_FIXEDPOS ((HeaderBarItemBits)0x0200)
+#define HIB_CLICKABLE ((HeaderBarItemBits)0x0400)
+#define HIB_FLAT ((HeaderBarItemBits)0x0800)
+#define HIB_DOWNARROW ((HeaderBarItemBits)0x1000)
+#define HIB_UPARROW ((HeaderBarItemBits)0x2000)
+#define HIB_USERDRAW ((HeaderBarItemBits)0x4000)
+#define HIB_STDSTYLE (HIB_LEFT | HIB_LEFTIMAGE | HIB_VCENTER | HIB_CLICKABLE)
+
+// -------------------
+// - HeaderBar-Types -
+// -------------------
+
+#define HEADERBAR_APPEND ((sal_uInt16)0xFFFF)
+#define HEADERBAR_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
+#define HEADERBAR_FULLSIZE ((long)1000000000)
+
+#define HEADERBAR_TEXTOFF 2
+
+// -------------
+// - HeaderBar -
+// -------------
+
+class SVT_DLLPUBLIC HeaderBar : public Window
+{
+private:
+ ImplHeadItemList* mpItemList;
+ long mnBorderOff1;
+ long mnBorderOff2;
+ long mnOffset;
+ long mnDX;
+ long mnDY;
+ long mnDragSize;
+ long mnStartPos;
+ long mnDragPos;
+ long mnMouseOff;
+ sal_uInt16 mnCurItemId;
+ sal_uInt16 mnItemDragPos;
+ sal_Bool mbDragable;
+ sal_Bool mbDrag;
+ sal_Bool mbItemDrag;
+ sal_Bool mbOutDrag;
+ sal_Bool mbButtonStyle;
+ sal_Bool mbItemMode;
+ Link maStartDragHdl;
+ Link maDragHdl;
+ Link maEndDragHdl;
+ Link maSelectHdl;
+ Link maDoubleClickHdl;
+ Link maCreateAccessibleHdl;
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible >
+ mxAccessible;
+
+#ifdef _SV_HEADBAR_CXX
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit( WinBits nWinStyle );
+ SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SVT_DLLPRIVATE long ImplGetItemPos( sal_uInt16 nPos ) const;
+ SVT_DLLPRIVATE Rectangle ImplGetItemRect( sal_uInt16 nPos ) const;
+ using Window::ImplHitTest;
+ SVT_DLLPRIVATE sal_uInt16 ImplHitTest( const Point& rPos, long& nMouseOff, sal_uInt16& nPos ) const;
+ SVT_DLLPRIVATE void ImplInvertDrag( sal_uInt16 nStartPos, sal_uInt16 nEndPos );
+ SVT_DLLPRIVATE void ImplDrawItem( OutputDevice* pDev,
+ sal_uInt16 nPos, sal_Bool bHigh, sal_Bool bDrag,
+ const Rectangle& rItemRect,
+ const Rectangle* pRect,
+ sal_uLong nFlags );
+ SVT_DLLPRIVATE void ImplDrawItem( sal_uInt16 nPos, sal_Bool bHigh = sal_False,
+ sal_Bool bDrag = sal_False,
+ const Rectangle* pRect = NULL );
+ SVT_DLLPRIVATE void ImplUpdate( sal_uInt16 nPos,
+ sal_Bool bEnd = sal_False, sal_Bool bDirect = sal_False );
+ SVT_DLLPRIVATE void ImplStartDrag( const Point& rPos, sal_Bool bCommand );
+ SVT_DLLPRIVATE void ImplDrag( const Point& rPos );
+ SVT_DLLPRIVATE void ImplEndDrag( sal_Bool bCancel );
+#endif
+
+public:
+ HeaderBar( Window* pParent, WinBits nWinBits = WB_STDHEADERBAR );
+ HeaderBar( Window* pParent, const ResId& rResId );
+ ~HeaderBar();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Resize();
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+ virtual void StartDrag();
+ virtual void Drag();
+ virtual void EndDrag();
+ virtual void Select();
+ virtual void DoubleClick();
+
+ void InsertItem( sal_uInt16 nItemId, const XubString& rText,
+ long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE,
+ sal_uInt16 nPos = HEADERBAR_APPEND );
+ void RemoveItem( sal_uInt16 nItemId );
+ void MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos );
+ void Clear();
+
+ void SetOffset( long nNewOffset = 0 );
+ long GetOffset() const { return mnOffset; }
+ inline void SetDragSize( long nNewSize = 0 ) { mnDragSize = nNewSize; }
+ long GetDragSize() const { return mnDragSize; }
+
+ sal_uInt16 GetItemCount() const;
+ sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetItemId( const Point& rPos ) const;
+ Rectangle GetItemRect( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetCurItemId() const { return mnCurItemId; }
+ long GetDragPos() const { return mnDragPos; }
+ sal_uInt16 GetItemDragPos() const { return mnItemDragPos; }
+ sal_Bool IsItemMode() const { return mbItemMode; }
+ sal_Bool IsItemDrag() const { return mbItemDrag; }
+
+ void SetItemSize( sal_uInt16 nItemId, long nNewSize );
+ long GetItemSize( sal_uInt16 nItemId ) const;
+ void SetItemBits( sal_uInt16 nItemId, HeaderBarItemBits nNewBits );
+ HeaderBarItemBits GetItemBits( sal_uInt16 nItemId ) const;
+
+ void SetItemText( sal_uInt16 nItemId, const XubString& rText );
+ XubString GetItemText( sal_uInt16 nItemId ) const;
+
+ XubString GetHelpText( sal_uInt16 nItemId ) const;
+ OString GetHelpId( sal_uInt16 nItemId ) const;
+
+ Size CalcWindowSizePixel() const;
+
+ inline void SetHelpText( const String& rText ) { Window::SetHelpText( rText ); }
+ inline const String& GetHelpText() const { return Window::GetHelpText(); }
+ inline void SetHelpId( const OString& rId ) { Window::SetHelpId( rId ); }
+ inline const OString& GetHelpId() const { return Window::GetHelpId(); }
+
+ inline void SetStartDragHdl( const Link& rLink ) { maStartDragHdl = rLink; }
+ inline const Link& GetStartDragHdl() const { return maStartDragHdl; }
+ inline void SetDragHdl( const Link& rLink ) { maDragHdl = rLink; }
+ inline const Link& GetDragHdl() const { return maDragHdl; }
+ inline void SetEndDragHdl( const Link& rLink ) { maEndDragHdl = rLink; }
+ inline const Link& GetEndDragHdl() const { return maEndDragHdl; }
+ inline void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ inline const Link& GetSelectHdl() const { return maSelectHdl; }
+ inline void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ inline const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+ inline void SetCreateAccessibleHdl( const Link& rLink ) { maCreateAccessibleHdl = rLink; }
+ inline const Link& GetCreateAccessibleHdl() const { return maCreateAccessibleHdl; }
+
+ inline sal_Bool IsDragable() const { return mbDragable; }
+
+ /** Creates and returns the accessible object of the header bar. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+ void SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > );
+};
+
+#endif // _HEADBAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/helpid.hrc b/include/svtools/helpid.hrc
new file mode 100644
index 000000000000..0751c5b70cd7
--- /dev/null
+++ b/include/svtools/helpid.hrc
@@ -0,0 +1,97 @@
+/* -*- 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 _SVT_HELPID_HRC
+#define _SVT_HELPID_HRC
+
+#define HID_FILEDLG_PATHDLG "SVT_HID_FILEDLG_PATHDLG"
+#define HID_FILEDLG_DIR "SVT_HID_FILEDLG_DIR"
+#define HID_FILEDLG_EDIT "SVT_HID_FILEDLG_EDIT"
+#define HID_FILEDLG_DIRS "SVT_HID_FILEDLG_DIRS"
+#define HID_FILEDLG_DRIVE "SVT_HID_FILEDLG_DRIVE"
+#define HID_FILEDLG_DRIVES "SVT_HID_FILEDLG_DRIVES"
+#define HID_FILEDLG_NEWDIR "SVT_HID_FILEDLG_NEWDIR"
+#define HID_FILEDLG_HOME "SVT_HID_FILEDLG_HOME"
+#define HID_FILEDLG_FILE "SVT_HID_FILEDLG_FILE"
+#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"
+#define HID_FILEDLG_MANAGER "SVT_HID_FILEDLG_MANAGER"
+#define HID_FILEDLG_URL "SVT_HID_FILEDLG_URL"
+#define HID_FILEDLG_USE_PASSWD "SVT_HID_FILEDLG_USE_PASSWD"
+#define HID_FILEDLG_READ_ONLY "SVT_HID_FILEDLG_READ_ONLY"
+#define HID_FILEDLG_AUTOCOMPLETEBOX "SVT_HID_FILEDLG_AUTOCOMPLETEBOX"
+#define HID_FILEDLG_SAVE_BTN "SVT_HID_FILEDLG_SAVE_BTN"
+#define HID_FILEDLG_SAVE_FILENAME "SVT_HID_FILEDLG_SAVE_FILENAME"
+#define HID_FILEDLG_SAVE_FILETYPE "SVT_HID_FILEDLG_SAVE_FILETYPE"
+#define HID_FILEDLG_INSERT_BTN "SVT_HID_FILEDLG_INSERT_BTN"
+#define HID_FILEDLG_PATH_BTN "SVT_HID_FILEDLG_PATH_BTN"
+#define HID_FILEDLG_PATH_FILENAME "SVT_HID_FILEDLG_PATH_FILENAME"
+#define HID_FILEDLG_FOLDER_BTN "SVT_HID_FILEDLG_FOLDER_BTN"
+#define HID_FILEDLG_FOLDER_FILENAME "SVT_HID_FILEDLG_FOLDER_FILENAME"
+#define HID_FILEDLG_SRCHFOLDER_BTN "SVT_HID_FILEDLG_SRCHFOLDER_BTN"
+#define HID_FILEDLG_EDIT_FAVORITES_LISTBOX "SVT_HID_FILEDLG_EDIT_FAVORITES_LISTBOX"
+#define HID_FILEDLG_EDIT_FAVORITES_HEADERBAR "SVT_HID_FILEDLG_EDIT_FAVORITES_HEADERBAR"
+
+// Help ids of template dialog
+#define HID_TEMPLATEDLG_DIALOG "SVT_HID_TEMPLATEDLG_DIALOG"
+#define HID_TEMPLATEDLG_ICONCTRL "SVT_HID_TEMPLATEDLG_ICONCTRL"
+#define HID_TEMPLATEDLG_FILEVIEW "SVT_HID_TEMPLATEDLG_FILEVIEW"
+#define HID_TEMPLATEDLG_TB_BACK "SVT_HID_TEMPLATEDLG_TB_BACK"
+#define HID_TEMPLATEDLG_TB_PREV "SVT_HID_TEMPLATEDLG_TB_PREV"
+#define HID_TEMPLATEDLG_TB_PRINT "SVT_HID_TEMPLATEDLG_TB_PRINT"
+#define HID_TEMPLATEDLG_TB_DOCINFO "SVT_HID_TEMPLATEDLG_TB_DOCINFO"
+#define HID_TEMPLATEDLG_TB_PREVIEW "SVT_HID_TEMPLATEDLG_TB_PREVIEW"
+
+// Help ids for the filepicker dialogs
+#define HID_EXPLORERDLG_FILE "SVT_HID_EXPLORERDLG_FILE"
+
+// help ids for fileview contextmenu
+#define HID_FILEVIEW_MENU_DELETE "SVT_HID_FILEVIEW_MENU_DELETE"
+#define HID_FILEVIEW_MENU_RENAME "SVT_HID_FILEVIEW_MENU_RENAME"
+
+// help ids for the different modi of the file picker dialog
+ // FREE
+#define HID_FILESAVE_LEVELUP "SVT_HID_FILESAVE_LEVELUP"
+#define HID_FILESAVE_CREATEDIRECTORY "SVT_HID_FILESAVE_CREATEDIRECTORY"
+#define HID_FILESAVE_DEFAULTDIRECTORY "SVT_HID_FILESAVE_DEFAULTDIRECTORY"
+#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_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_PRINTDIALOG_TOFILE "SVT_HID_PRINTDIALOG_TOFILE"
+
+#define HID_WIZARD_NEXT "SVT_HID_WIZARD_NEXT"
+#define HID_WIZARD_PREVIOUS "SVT_HID_WIZARD_PREVIOUS"
+
+#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 000000000000..6004ab4dd77a
--- /dev/null
+++ b/include/svtools/helpopt.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_HELPOPT_HXX
+#define INCLUDED_SVTOOLS_HELPOPT_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <list>
+#include <tools/string.hxx>
+#include <unotools/options.hxx>
+
+typedef std::list< sal_Int32 > IdList;
+
+class SvtHelpOptions_Impl;
+
+class SVT_DLLPUBLIC SvtHelpOptions: public utl::detail::Options
+{
+ SvtHelpOptions_Impl* pImp;
+
+public:
+ SvtHelpOptions();
+ virtual ~SvtHelpOptions();
+
+ void SetExtendedHelp( sal_Bool b );
+ sal_Bool IsExtendedHelp() const;
+ void SetHelpTips( sal_Bool b );
+ sal_Bool IsHelpTips() const;
+
+ void SetHelpAgentAutoStartMode( sal_Bool b );
+ sal_Bool IsHelpAgentAutoStartMode() const;
+ void SetHelpAgentTimeoutPeriod( sal_Int32 _nSeconds );
+ sal_Int32 GetHelpAgentTimeoutPeriod( ) const;
+
+ const String& GetHelpStyleSheet()const;
+ void SetHelpStyleSheet(const String& rStyleSheet);
+
+ /** resets the help agent's ignore counter for all URL's
+ */
+ void resetAgentIgnoreURLCounter();
+
+ void SetWelcomeScreen( sal_Bool b );
+ sal_Bool IsWelcomeScreen() const;
+
+ String 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 000000000000..62640e2bffe6
--- /dev/null
+++ b/include/svtools/htmlcfg.hxx
@@ -0,0 +1,94 @@
+/* -*- 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 _SVX_HTMLCFG_HXX
+#define _SVX_HTMLCFG_HXX
+
+// -----------------------------------------------------------------------
+
+#include <tools/solar.h>
+#include <unotools/configitem.hxx>
+#include <svtools/svtdllapi.h>
+
+#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
+
+class Link;
+struct HtmlOptions_Impl;
+// -----------------------------------------------------------------------
+
+class SVT_DLLPUBLIC SvxHtmlOptions : public utl::ConfigItem
+{
+ HtmlOptions_Impl*pImp;
+ const com::sun::star::uno::Sequence<OUString>& GetPropertyNames();
+ void Load( const com::sun::star::uno::Sequence< OUString >& rPropertyNames );
+ void CallListeners();
+
+public:
+ SvxHtmlOptions();
+ ~SvxHtmlOptions();
+
+ virtual void Commit();
+ virtual void Notify( const com::sun::star::uno::Sequence< OUString >& _rPropertyNames);
+
+ sal_uInt16 GetFontSize(sal_uInt16 nPos) const;
+ void SetFontSize(sal_uInt16 nPos, sal_uInt16 nSize);
+
+ sal_Bool IsImportUnknown() const;
+ void SetImportUnknown(sal_Bool bSet);
+
+ sal_uInt16 GetExportMode() const;
+ void SetExportMode(sal_uInt16 nSet);
+
+ sal_Bool IsStarBasic() const;
+ void SetStarBasic(sal_Bool bSet);
+
+ sal_Bool IsStarBasicWarning() const;
+ void SetStarBasicWarning(sal_Bool bSet);
+
+ sal_Bool IsSaveGraphicsLocal() const;
+ void SetSaveGraphicsLocal(sal_Bool bSet);
+
+ sal_Bool IsPrintLayoutExtension() const;
+ void SetPrintLayoutExtension(sal_Bool bSet);
+
+ sal_Bool IsIgnoreFontFamily() const;
+ void SetIgnoreFontFamily(sal_Bool bSet);
+
+ sal_Bool IsDefaultTextEncoding() const;
+ rtl_TextEncoding GetTextEncoding() const;
+ void SetTextEncoding( rtl_TextEncoding );
+ static SvxHtmlOptions& Get();
+
+ sal_Bool IsNumbersEnglishUS() const;
+ void SetNumbersEnglishUS(sal_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 000000000000..72b48c417aa3
--- /dev/null
+++ b/include/svtools/htmlkywd.hxx
@@ -0,0 +1,796 @@
+/* -*- 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 _HTMLKYWD_HXX
+#define _HTMLKYWD_HXX
+
+#include "sal/config.h"
+
+#define OOO_STRING_SVTOOLS_HTML_doctype32 \
+ "HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\""
+#define OOO_STRING_SVTOOLS_HTML_doctype40 \
+ "HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\""
+
+// diese werden nur eingeschaltet
+#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_figureoverlay "OVERLAY"
+#define OOO_STRING_SVTOOLS_HTML_horzrule "HR"
+#define OOO_STRING_SVTOOLS_HTML_horztab "TAB"
+#define OOO_STRING_SVTOOLS_HTML_image "IMG"
+#define OOO_STRING_SVTOOLS_HTML_image2 "IMAGE"
+#define OOO_STRING_SVTOOLS_HTML_input "INPUT"
+#define OOO_STRING_SVTOOLS_HTML_isindex "ISINDEX"
+#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_nextid "NEXTID"
+#define OOO_STRING_SVTOOLS_HTML_nobr "NOBR"
+#define OOO_STRING_SVTOOLS_HTML_of "OF"
+#define OOO_STRING_SVTOOLS_HTML_option "OPTION"
+#define OOO_STRING_SVTOOLS_HTML_param "PARAM"
+#define OOO_STRING_SVTOOLS_HTML_range "RANGE"
+#define OOO_STRING_SVTOOLS_HTML_spacer "SPACER"
+#define OOO_STRING_SVTOOLS_HTML_wbr "WBR"
+
+// diese werden wieder abgeschaltet
+#define OOO_STRING_SVTOOLS_HTML_abbreviation "ABBREV"
+#define OOO_STRING_SVTOOLS_HTML_above "ABOVE"
+#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_array "ARRAY"
+#define OOO_STRING_SVTOOLS_HTML_author "AU"
+#define OOO_STRING_SVTOOLS_HTML_banner "BANNER"
+#define OOO_STRING_SVTOOLS_HTML_bar "BAR"
+#define OOO_STRING_SVTOOLS_HTML_basefont "BASEFONT"
+#define OOO_STRING_SVTOOLS_HTML_below "BELOW"
+#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_boldtext "BT"
+#define OOO_STRING_SVTOOLS_HTML_box "BOX"
+#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_dot "DOT"
+#define OOO_STRING_SVTOOLS_HTML_doubledot "DDOT"
+#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_hat "HAT"
+#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_ilayer "ILAYER"
+#define OOO_STRING_SVTOOLS_HTML_insertedtext "INS"
+#define OOO_STRING_SVTOOLS_HTML_italic "I"
+#define OOO_STRING_SVTOOLS_HTML_item "ITEM"
+#define OOO_STRING_SVTOOLS_HTML_keyboard "KBD"
+#define OOO_STRING_SVTOOLS_HTML_language "LANG"
+#define OOO_STRING_SVTOOLS_HTML_layer "LAYER"
+#define OOO_STRING_SVTOOLS_HTML_listheader "LH"
+#define OOO_STRING_SVTOOLS_HTML_map "MAP"
+#define OOO_STRING_SVTOOLS_HTML_math "MATH"
+#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_root "ROOT"
+#define OOO_STRING_SVTOOLS_HTML_row "ROW"
+#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_squareroot "AQRT"
+#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_text "TEXT"
+#define OOO_STRING_SVTOOLS_HTML_textarea "TEXTAREA"
+#define OOO_STRING_SVTOOLS_HTML_textflow "TEXTFLOW"
+#define OOO_STRING_SVTOOLS_HTML_tfoot "TFOOT"
+#define OOO_STRING_SVTOOLS_HTML_thead "THEAD"
+#define OOO_STRING_SVTOOLS_HTML_tilde "TILDE"
+#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"
+#define OOO_STRING_SVTOOLS_HTML_vector "VEC"
+
+// 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_bgsound "BGSOUND"
+#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"
+
+// die Namen fuer alle Zeichen
+#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"
+
+// Netscape kennt noch ein paar in Grossbuchstaben ...
+#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_S_COPY "COPY"
+#define OOO_STRING_SVTOOLS_HTML_S_REG "REG"
+
+// 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_notexist "not 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 Attribut-Token (=Optionen)
+
+// Attribute ohne Wert
+#define OOO_STRING_SVTOOLS_HTML_O_box "BOX"
+#define OOO_STRING_SVTOOLS_HTML_O_checked "CHECKED"
+#define OOO_STRING_SVTOOLS_HTML_O_compact "COMPACT"
+#define OOO_STRING_SVTOOLS_HTML_O_continue "CONTINUE"
+#define OOO_STRING_SVTOOLS_HTML_O_controls "CONTROLS"
+#define OOO_STRING_SVTOOLS_HTML_O_declare "DECLARE"
+#define OOO_STRING_SVTOOLS_HTML_O_disabled "DISABLED"
+#define OOO_STRING_SVTOOLS_HTML_O_folded "FOLDED"
+#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_noflow "NOFLOW"
+#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_plain "PLAIN"
+#define OOO_STRING_SVTOOLS_HTML_O_sdfixed "SDFIXED"
+#define OOO_STRING_SVTOOLS_HTML_O_selected "SELECTED"
+#define OOO_STRING_SVTOOLS_HTML_O_shapes "SHAPES"
+
+// Attribute mit einem String als Wert
+#define OOO_STRING_SVTOOLS_HTML_O_above "ABOVE"
+#define OOO_STRING_SVTOOLS_HTML_O_accesskey "ACCESSKEY"
+#define OOO_STRING_SVTOOLS_HTML_O_accept "ACCEPT"
+#define OOO_STRING_SVTOOLS_HTML_O_add_date "ADD_DATE"
+#define OOO_STRING_SVTOOLS_HTML_O_alt "ALT"
+#define OOO_STRING_SVTOOLS_HTML_O_axes "AXES"
+#define OOO_STRING_SVTOOLS_HTML_O_axis "AXIS"
+#define OOO_STRING_SVTOOLS_HTML_O_below "BELOW"
+#define OOO_STRING_SVTOOLS_HTML_O_char "CHAR"
+#define OOO_STRING_SVTOOLS_HTML_O_class "CLASS"
+#define OOO_STRING_SVTOOLS_HTML_O_clip "CLIP"
+#define OOO_STRING_SVTOOLS_HTML_O_code "CODE"
+#define OOO_STRING_SVTOOLS_HTML_O_codetype "CODETYPE"
+#define OOO_STRING_SVTOOLS_HTML_O_colspec "COLSPEC"
+#define OOO_STRING_SVTOOLS_HTML_O_content "CONTENT"
+#define OOO_STRING_SVTOOLS_HTML_O_coords "COORDS"
+#define OOO_STRING_SVTOOLS_HTML_O_dp "DP"
+#define OOO_STRING_SVTOOLS_HTML_O_enctype "ENCTYPE"
+#define OOO_STRING_SVTOOLS_HTML_O_error "ERROR"
+#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_last_modified "LAST_MODIFIED"
+#define OOO_STRING_SVTOOLS_HTML_O_last_visit "LAST_VISIT"
+#define OOO_STRING_SVTOOLS_HTML_O_md "MD"
+#define OOO_STRING_SVTOOLS_HTML_O_n "N"
+#define OOO_STRING_SVTOOLS_HTML_O_name "NAME"
+#define OOO_STRING_SVTOOLS_HTML_O_notation "NOTATION"
+#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-"
+
+// Attribute mit einem SGML-Identifier als Wert
+#define OOO_STRING_SVTOOLS_HTML_O_from "FROM"
+#define OOO_STRING_SVTOOLS_HTML_O_id "ID"
+#define OOO_STRING_SVTOOLS_HTML_O_target "TARGET"
+#define OOO_STRING_SVTOOLS_HTML_O_to "TO"
+#define OOO_STRING_SVTOOLS_HTML_O_until "UNTIL"
+
+// Attribute mit einem URI als Wert
+#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_dynsrc "DYNSRC"
+#define OOO_STRING_SVTOOLS_HTML_O_dynsync "DYNSYNC"
+#define OOO_STRING_SVTOOLS_HTML_O_imagemap "IMAGEMAP"
+#define OOO_STRING_SVTOOLS_HTML_O_href "HREF"
+#define OOO_STRING_SVTOOLS_HTML_O_lowsrc "LOWSRC"
+#define OOO_STRING_SVTOOLS_HTML_O_script "SCRIPT"
+#define OOO_STRING_SVTOOLS_HTML_O_src "SRC"
+#define OOO_STRING_SVTOOLS_HTML_O_usemap "USEMAP"
+
+// Attribute mit Entity-Namen als Wert
+#define OOO_STRING_SVTOOLS_HTML_O_dingbat "DINGBAT"
+#define OOO_STRING_SVTOOLS_HTML_O_sym "SYM"
+
+// Attribute mit einer Farbe als Wert (alle 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"
+
+// Attribute mit einem numerischen Wert
+#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_indent "INDENT"
+#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_leftmargin "LEFTMARGIN"
+#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_max "MAX"
+#define OOO_STRING_SVTOOLS_HTML_O_maxlength "MAXLENGTH"
+#define OOO_STRING_SVTOOLS_HTML_O_min "MIN"
+#define OOO_STRING_SVTOOLS_HTML_O_pagex "PAGEX"
+#define OOO_STRING_SVTOOLS_HTML_O_pagey "PAGEY"
+#define OOO_STRING_SVTOOLS_HTML_O_pointsize "POINT-SIZE"
+#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_seqnum "SEQNUM"
+#define OOO_STRING_SVTOOLS_HTML_O_skip "SKIP"
+#define OOO_STRING_SVTOOLS_HTML_O_span "SPAN"
+#define OOO_STRING_SVTOOLS_HTML_O_tabindex "TABINDEX"
+#define OOO_STRING_SVTOOLS_HTML_O_top "TOP"
+#define OOO_STRING_SVTOOLS_HTML_O_topmargin "TOPMARGIN"
+#define OOO_STRING_SVTOOLS_HTML_O_vspace "VSPACE"
+#define OOO_STRING_SVTOOLS_HTML_O_weight "WEIGHT"
+#define OOO_STRING_SVTOOLS_HTML_O_width "WIDTH"
+#define OOO_STRING_SVTOOLS_HTML_O_x "X"
+#define OOO_STRING_SVTOOLS_HTML_O_y "Y"
+#define OOO_STRING_SVTOOLS_HTML_O_zindex "Z-INDEX"
+
+// Attribute mit Enum-Werten
+#define OOO_STRING_SVTOOLS_HTML_O_behavior "BEHAVIOR"
+#define OOO_STRING_SVTOOLS_HTML_O_bgproperties "BGPROPERTIES"
+#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_HTML_O_method "METHOD"
+#define OOO_STRING_SVTOOLS_HTML_O_palette "PALETTE"
+#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_visibility "VISIBILITY"
+#define OOO_STRING_SVTOOLS_HTML_O_wrap "WRAP"
+
+// Attribute mit Script-Code als Wert
+#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"
+
+// Attribute mit Kontext-abhaengigen Werten
+#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"
+#define OOO_STRING_SVTOOLS_HTML_O_units "UNITS"
+
+// Werte von <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"
+
+// Werte von <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"
+
+// Werte von <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"
+
+// Werte von <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"
+#define OOO_STRING_SVTOOLS_HTML_AL_none "NONE"
+
+// Werte von <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"
+
+// Werte von <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_SH_default "DEFAULT"
+
+#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"
+
+// ein par Werte fuer unser StarBASIC-Support
+#define OOO_STRING_SVTOOLS_HTML_SB_library "$LIBRARY:"
+#define OOO_STRING_SVTOOLS_HTML_SB_module "$MODULE:"
+
+// Werte von <FORM METHOD=...>
+#define OOO_STRING_SVTOOLS_HTML_METHOD_get "GET"
+#define OOO_STRING_SVTOOLS_HTML_METHOD_post "POST"
+
+// Werte von <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"
+
+// Werte von <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"
+
+// Werte von <FRAMESET SCROLLING=...>
+#define OOO_STRING_SVTOOLS_HTML_SCROLL_yes "YES"
+#define OOO_STRING_SVTOOLS_HTML_SCROLL_no "NO"
+#define OOO_STRING_SVTOOLS_HTML_SCROLL_auto "AUTO"
+
+// Werte von <MULTICOL TYPE=...>
+#define OOO_STRING_SVTOOLS_HTML_MCTYPE_horizontal "HORIZONTAL"
+#define OOO_STRING_SVTOOLS_HTML_MCTYPE_vertical "VERTICAL"
+#define OOO_STRING_SVTOOLS_HTML_MCTYPE_box "BOX"
+
+// Werte von <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"
+
+// Werte von <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"
+
+// interne Grafik-Namen
+#define OOO_STRING_SVTOOLS_HTML_private_image "private:image/"
+#define OOO_STRING_SVTOOLS_HTML_internal_gopher "internal-gopher-"
+#define OOO_STRING_SVTOOLS_HTML_internal_icon "internal-icon-"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_binary "binary"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_image "image"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_index "index"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_menu "menu"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_movie "movie"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_sound "sound"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_telnet "telnet"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_text "text"
+#define OOO_STRING_SVTOOLS_HTML_INT_GOPHER_unknown "unknown"
+#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 000000000000..33c76fed1876
--- /dev/null
+++ b/include/svtools/htmlout.hxx
@@ -0,0 +1,118 @@
+/* -*- 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 _HTMLOUT_HXX
+#define _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 String;
+class SvStream;
+class SvxMacroTableDtor;
+class SvNumberFormatter;
+
+struct HTMLOutEvent
+{
+ const sal_Char *pBasicName;
+ const sal_Char *pJavaName;
+ sal_uInt16 nEvent;
+};
+
+struct SVT_DLLPUBLIC HTMLOutContext
+{
+ rtl_TextEncoding m_eDestEnc;
+ rtl_TextToUnicodeConverter m_hConv;
+ rtl_TextToUnicodeContext m_hContext;
+
+ HTMLOutContext( rtl_TextEncoding eDestEnc );
+ ~HTMLOutContext();
+};
+
+struct HTMLOutFuncs
+{
+#if defined(UNX)
+ static const sal_Char sNewLine; // nur \012 oder \015
+#else
+ static const sal_Char sNewLine[]; // \015\012
+#endif
+
+ SVT_DLLPUBLIC static OString ConvertStringToHTML( const String& sSrc,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+
+ SVT_DLLPUBLIC static SvStream& Out_AsciiTag( SvStream&, const sal_Char* pStr,
+ sal_Bool bOn = sal_True,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252);
+ SVT_DLLPUBLIC static SvStream& Out_Char( SvStream&, sal_Unicode cChar,
+ HTMLOutContext& rContext,
+ String *pNonConvertableChars = 0 );
+ SVT_DLLPUBLIC static SvStream& Out_String( SvStream&, const String&,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+ SVT_DLLPUBLIC static SvStream& Out_Hex( SvStream&, sal_uLong nHex, sal_uInt8 nLen,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 );
+ SVT_DLLPUBLIC static SvStream& Out_Color( SvStream&, const Color&,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 );
+ SVT_DLLPUBLIC static SvStream& Out_ImageMap( SvStream&, const String&, const ImageMap&, const String&,
+ const HTMLOutEvent *pEventTable,
+ sal_Bool bOutStarBasic,
+ const sal_Char *pDelim = 0,
+ const sal_Char *pIndentArea = 0,
+ const sal_Char *pIndentMap = 0,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+ SVT_DLLPUBLIC static SvStream& FlushToAscii( SvStream&, HTMLOutContext& rContext );
+
+ SVT_DLLPUBLIC static SvStream& OutScript( SvStream& rStrm,
+ const String& rBaseURL,
+ const String& rSource,
+ const String& rLanguage,
+ ScriptType eScriptType,
+ const String& rSrc,
+ const String *pSBLibrary = 0,
+ const String *pSBModule = 0,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+
+ // der 3. Parameter ist ein Array von HTMLOutEvents, das mit einem
+ // nur aus 0 bestehen Eintrag terminiert ist.
+ SVT_DLLPUBLIC static SvStream& Out_Events( SvStream&, const SvxMacroTableDtor&,
+ const HTMLOutEvent*, sal_Bool bOutStarBasic,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0 );
+
+ // <TD SDVAL="..." SDNUM="...">
+ SVT_DLLPUBLIC static OString CreateTableDataOptionsValNum(
+ sal_Bool bValue, double fVal, sal_uLong nFormat,
+ SvNumberFormatter& rFormatter,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ String *pNonConvertableChars = 0);
+
+ SVT_DLLPUBLIC static sal_Bool PrivateURLToInternalImg( String& rURL );
+};
+
+#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 000000000000..97e73cb4090a
--- /dev/null
+++ b/include/svtools/htmltokn.h
@@ -0,0 +1,561 @@
+/* -*- 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 _HTMLTOKN_H
+#define _HTMLTOKN_H
+
+#include "svtools/svtdllapi.h"
+#include <sal/types.h>
+#include <tools/solar.h>
+
+class String;
+
+// suche das Char zu dem CharNamen
+sal_Unicode GetHTMLCharName( const String& rName );
+
+// suche die TokenID zu dem Token
+SVT_DLLPUBLIC int GetHTMLToken( const String& rName );
+
+// suche die TokenId zu einemm Attribut-Token
+int GetHTMLOption( const String& rName );
+
+// suche die 24-bit-Farbe zu einem Farbnamen (nicht gefunden = ULONG_MAX)
+SVT_DLLPUBLIC sal_uInt32 GetHTMLColor( const String& rName );
+
+// beginnen immer ab 256, groesser als ein char
+const int HTML_TOKEN_START = 0x100;
+const int HTML_TOKEN_ONOFF = 0x200;
+const int HTML_TOKEN_MICROSOFT = 0x1000;
+
+enum HTML_TOKEN_IDS
+{
+ HTML_TEXTTOKEN = HTML_TOKEN_START,
+ HTML_SINGLECHAR,
+ HTML_NEWPARA,
+ HTML_TABCHAR,
+ HTML_RAWDATA,
+ HTML_LINEFEEDCHAR,
+
+ // diese werden nur eingeschaltet
+ HTML_AREA, // Netscape 2.0
+ HTML_BASE, // HTML 3.0
+ HTML_COMMENT,
+ HTML_DOCTYPE,
+ HTML_EMBED, // Netscape 2.0 </EMBED> ignorieren
+ HTML_FIGUREOVERLAY, // HTML 3.0
+ HTML_HORZRULE, // </HR> ignorieren
+ HTML_HORZTAB, // HTML 3.0
+ HTML_IMAGE, // </IMG> ignorieren
+ HTML_INPUT, // </INPUT> ignorieren
+ HTML_ISINDEX, // HTML 3.0
+ HTML_LINEBREAK, // </BR> -> <BR>
+ HTML_LINK, // HTML 3.0
+ HTML_META, // HTML 3.0 </META> ignorieren
+ HTML_NEXTID, // HTML 3.0
+ HTML_OF, // HTML 3.0
+ HTML_OPTION, // </OPTION> ignorieren
+ HTML_PARAM, // HotJava
+ HTML_RANGE, // HTML 3.0
+ HTML_SPACER, // Netscape 3.0b5 // </SPACER> ignorieren
+ HTML_WBR, // Netscape
+
+ // Tokens, die ueber HTML-Charakter erkannt werden
+ HTML_NONBREAKSPACE,
+ HTML_SOFTHYPH,
+
+ // diese werden wieder abgeschaltet,
+ // der off-Wert liegt immer dahinter (+1) !!
+ HTML_ABBREVIATION_ON = HTML_TOKEN_ONOFF, // HTML 3.0
+ HTML_ABBREVIATION_OFF, // HTML 3.0
+ HTML_ABOVE_ON, // HTML 3.0
+ HTML_ABOVE_OFF, // HTML 3.0
+ HTML_ACRONYM_ON, // HTML 3.0
+ HTML_ACRONYM_OFF, // HTML 3.0
+ HTML_ADDRESS_ON,
+ HTML_ADDRESS_OFF,
+ HTML_ANCHOR_ON,
+ HTML_ANCHOR_OFF,
+ HTML_APPLET_ON, // HotJava
+ HTML_APPLET_OFF, // HotJava
+ HTML_ARRAY_ON, // HTML 3.0
+ HTML_ARRAY_OFF, // HTML 3.0
+ HTML_AUTHOR_ON, // HTML 3.0
+ HTML_AUTHOR_OFF, // HTML 3.0
+ HTML_BANNER_ON, // HTML 3.0
+ HTML_BANNER_OFF, // HTML 3.0
+ HTML_BAR_ON, // HTML 3.0
+ HTML_BAR_OFF, // HTML 3.0
+ HTML_BASEFONT_ON, // Netscape
+ HTML_BASEFONT_OFF, // Netscape
+ HTML_BELOW_ON, // HTML 3.0
+ HTML_BELOW_OFF, // HTML 3.0
+ HTML_BIGPRINT_ON, // HTML 3.0
+ HTML_BIGPRINT_OFF, // HTML 3.0
+ HTML_BLINK_ON, // Netscape
+ HTML_BLINK_OFF, // Netscape
+ HTML_BLOCKQUOTE30_ON, // HTML 3.0
+ HTML_BLOCKQUOTE30_OFF, // HTML 3.0
+ HTML_BLOCKQUOTE_ON,
+ HTML_BLOCKQUOTE_OFF,
+ HTML_BODY_ON,
+ HTML_BODY_OFF,
+ HTML_BOLDTEXT_ON, // HTML 3.0
+ HTML_BOLDTEXT_OFF, // HTML 3.0
+ HTML_BOLD_ON,
+ HTML_BOLD_OFF,
+ HTML_BOX_ON, // HTML 3.0
+ HTML_BOX_OFF, // HTML 3.0
+ HTML_CAPTION_ON, // HTML 3.0
+ HTML_CAPTION_OFF, // HTML 3.0
+ HTML_CENTER_ON, // Netscape
+ HTML_CENTER_OFF, // Netscape
+ HTML_CITIATION_ON,
+ HTML_CITIATION_OFF,
+ HTML_CODE_ON,
+ HTML_CODE_OFF,
+ HTML_COL_ON, // HTML3 Table Model Draft
+ HTML_COL_OFF, // HTML3 Table Model Draft
+ HTML_COLGROUP_ON, // HTML3 Table Model Draft
+ HTML_COLGROUP_OFF, // HTML3 Table Model Draft
+ HTML_CREDIT_ON, // HTML 3.0
+ HTML_CREDIT_OFF, // HTML 3.0
+ HTML_DD_ON,
+ HTML_DD_OFF,
+ HTML_DEFLIST_ON,
+ HTML_DEFLIST_OFF,
+ HTML_DELETEDTEXT_ON, // HTML 3.0
+ HTML_DELETEDTEXT_OFF, // HTML 3.0
+ HTML_DIRLIST_ON,
+ HTML_DIRLIST_OFF,
+ HTML_DIVISION_ON, // HTML 3.0
+ HTML_DIVISION_OFF, // HTML 3.0
+ HTML_DOT_ON, // HTML 3.0
+ HTML_DOT_OFF, // HTML 3.0
+ HTML_DOUBLEDOT_ON, // HTML 3.0
+ HTML_DOUBLEDOT_OFF, // HTML 3.0
+ HTML_DT_ON,
+ HTML_DT_OFF,
+ HTML_EMPHASIS_ON,
+ HTML_EMPHASIS_OFF,
+ HTML_FIGURE_ON, // HTML 3.0
+ HTML_FIGURE_OFF, // HTML 3.0
+ HTML_FONT_ON, // Netscape
+ HTML_FONT_OFF, // Netscape
+ HTML_FOOTNOTE_ON, // HTML 3.0
+ HTML_FOOTNOTE_OFF, // HTML 3.0
+ HTML_FORM_ON,
+ HTML_FORM_OFF,
+ HTML_FRAME_ON, // Netscape 2.0
+ HTML_FRAME_OFF, // Netscape 2.0
+ HTML_FRAMESET_ON, // Netscape 2.0
+ HTML_FRAMESET_OFF, // Netscape 2.0
+ HTML_HAT_ON, // HTML 3.0
+ HTML_HAT_OFF, // HTML 3.0
+ HTML_HEAD1_ON,
+ HTML_HEAD1_OFF,
+ HTML_HEAD2_ON,
+ HTML_HEAD2_OFF,
+ HTML_HEAD3_ON,
+ HTML_HEAD3_OFF,
+ HTML_HEAD4_ON,
+ HTML_HEAD4_OFF,
+ HTML_HEAD5_ON,
+ HTML_HEAD5_OFF,
+ HTML_HEAD6_ON,
+ HTML_HEAD6_OFF,
+ HTML_HEAD_ON,
+ HTML_HEAD_OFF,
+ HTML_HTML_ON,
+ HTML_HTML_OFF,
+ HTML_IFRAME_ON, // IE 3.0b2
+ HTML_IFRAME_OFF, // IE 3.0b2
+ HTML_ILAYER_ON,
+ HTML_ILAYER_OFF,
+ HTML_INSERTEDTEXT_ON, // HTML 3.0
+ HTML_INSERTEDTEXT_OFF, // HTML 3.0
+ HTML_ITALIC_ON,
+ HTML_ITALIC_OFF,
+ HTML_ITEM_ON, // HTML 3.0
+ HTML_ITEM_OFF, // HTML 3.0
+ HTML_KEYBOARD_ON,
+ HTML_KEYBOARD_OFF,
+ HTML_LAYER_ON,
+ HTML_LAYER_OFF,
+ HTML_LANGUAGE_ON, // HTML 3.0
+ HTML_LANGUAGE_OFF, // HTML 3.0
+ HTML_LISTHEADER_ON, // HTML 3.0
+ HTML_LISTHEADER_OFF, // HTML 3.0
+ HTML_LI_ON,
+ HTML_LI_OFF,
+ HTML_MAP_ON, // Netscape 2.0
+ HTML_MAP_OFF, // Netscape 2.0
+ HTML_MATH_ON, // HTML 3.0
+ HTML_MATH_OFF, // HTML 3.0
+ HTML_MENULIST_ON,
+ HTML_MENULIST_OFF,
+ HTML_MULTICOL_ON, // Netscape 3.0b5
+ HTML_MULTICOL_OFF, // Netscape 3.0b5
+ HTML_NOBR_ON, // Netscape
+ HTML_NOBR_OFF, // Netscape
+ HTML_NOEMBED_ON, // Netscape 2.0
+ HTML_NOEMBED_OFF, // Netscape 2.0
+ HTML_NOFRAMES_ON, // Netscape 2.0
+ HTML_NOFRAMES_OFF, // Netscape 2.0
+ HTML_NOSCRIPT_ON, // Netscape 2.0
+ HTML_NOSCRIPT_OFF, // Netscape 3.0
+ HTML_NOTE_ON, // HTML 3.0
+ HTML_NOTE_OFF, // HTML 3.0
+ HTML_OBJECT_ON, // HotJava
+ HTML_OBJECT_OFF, // HotJava
+ HTML_ORDERLIST_ON,
+ HTML_ORDERLIST_OFF,
+ HTML_PARABREAK_ON,
+ HTML_PARABREAK_OFF,
+ HTML_PERSON_ON, // HTML 3.0
+ HTML_PERSON_OFF, // HTML 3.0
+ HTML_PLAINTEXT_ON, // HTML 3.0
+ HTML_PLAINTEXT_OFF, // HTML 3.0
+ HTML_PREFORMTXT_ON,
+ HTML_PREFORMTXT_OFF,
+ HTML_ROOT_ON, // HTML 3.0
+ HTML_ROOT_OFF, // HTML 3.0
+ HTML_ROW_ON, // HTML 3.0
+ HTML_ROW_OFF, // HTML 3.0
+ HTML_SAMPLE_ON,
+ HTML_SAMPLE_OFF,
+ HTML_SCRIPT_ON, // HTML 3.2
+ HTML_SCRIPT_OFF, // HTML 3.2
+ HTML_SELECT_ON,
+ HTML_SELECT_OFF,
+ HTML_SHORTQUOTE_ON, // HTML 3.0
+ HTML_SHORTQUOTE_OFF, // HTML 3.0
+ HTML_SMALLPRINT_ON, // HTML 3.0
+ HTML_SMALLPRINT_OFF, // HTML 3.0
+ HTML_SPAN_ON, // Style Sheets
+ HTML_SPAN_OFF, // Style Sheets
+ HTML_SQUAREROOT_ON, // HTML 3.0
+ HTML_SQUAREROOT_OFF, // HTML 3.0
+ HTML_STRIKETHROUGH_ON, // HTML 3.0
+ HTML_STRIKETHROUGH_OFF, // HTML 3.0
+ HTML_STRONG_ON,
+ HTML_STRONG_OFF,
+ HTML_STYLE_ON, // HTML 3.0
+ HTML_STYLE_OFF, // HTML 3.0
+ HTML_SUBSCRIPT_ON, // HTML 3.0
+ HTML_SUBSCRIPT_OFF, // HTML 3.0
+ HTML_SUPERSCRIPT_ON, // HTML 3.0
+ HTML_SUPERSCRIPT_OFF, // HTML 3.0
+ HTML_TABLE_ON, // HTML 3.0
+ HTML_TABLE_OFF, // HTML 3.0
+ HTML_TABLEDATA_ON, // HTML 3.0
+ HTML_TABLEDATA_OFF, // HTML 3.0
+ HTML_TABLEHEADER_ON, // HTML 3.0
+ HTML_TABLEHEADER_OFF, // HTML 3.0
+ HTML_TABLEROW_ON, // HTML 3.0
+ HTML_TABLEROW_OFF, // HTML 3.0
+ HTML_TBODY_ON, // HTML3 Table Model Draft
+ HTML_TBODY_OFF, // HTML3 Table Model Draft
+ HTML_TELETYPE_ON,
+ HTML_TELETYPE_OFF,
+ HTML_TEXTAREA_ON,
+ HTML_TEXTAREA_OFF,
+ HTML_TEXTFLOW_ON, // HTML 3.2
+ HTML_TEXTFLOW_OFF, // HTML 3.2
+ HTML_TEXT_ON, // HTML 3.0
+ HTML_TEXT_OFF, // HTML 3.0
+ HTML_TFOOT_ON, // HTML3 Table Model Draft
+ HTML_TFOOT_OFF, // HTML3 Table Model Draft
+ HTML_THEAD_ON, // HTML3 Table Model Draft
+ HTML_THEAD_OFF, // HTML3 Table Model Draft
+ HTML_TILDE_ON, // HTML 3.0
+ HTML_TILDE_OFF, // HTML 3.0
+ HTML_TITLE_ON,
+ HTML_TITLE_OFF,
+ HTML_UNDERLINE_ON,
+ HTML_UNDERLINE_OFF,
+ HTML_UNORDERLIST_ON,
+ HTML_UNORDERLIST_OFF,
+ HTML_VARIABLE_ON,
+ HTML_VARIABLE_OFF,
+ HTML_VECTOR_ON, // HTML 3.0
+ HTML_VECTOR_OFF, // HTML 3.0
+
+ // obsolete features
+ HTML_XMP_ON,
+ HTML_XMP_OFF,
+ HTML_LISTING_ON,
+ HTML_LISTING_OFF,
+
+ // proposed features
+ HTML_DEFINSTANCE_ON,
+ HTML_DEFINSTANCE_OFF,
+ HTML_STRIKE_ON,
+ HTML_STRIKE_OFF,
+
+ HTML_UNKNOWNCONTROL_ON,
+ HTML_UNKNOWNCONTROL_OFF,
+
+ HTML_BGSOUND = HTML_TOKEN_MICROSOFT|HTML_TOKEN_START,
+
+ HTML_COMMENT2_ON = HTML_TOKEN_MICROSOFT|HTML_TOKEN_ONOFF, // HTML 2.0 ?
+ HTML_COMMENT2_OFF, // HTML 2.0 ?
+ HTML_MARQUEE_ON,
+ HTML_MARQUEE_OFF,
+ HTML_PLAINTEXT2_ON, // HTML 2.0 ?
+ HTML_PLAINTEXT2_OFF, // HTML 2.0 ?
+
+ HTML_SDFIELD_ON,
+ HTML_SDFIELD_OFF
+};
+
+// HTML Attribut-Token (=Optionen)
+
+// beginnen immer ab 256, groesser als ein char
+const int HTML_OPTION_START = 0x100;
+
+enum HTML_OPTION_IDS
+{
+HTML_OPTION_BOOL_START = HTML_OPTION_START,
+
+// Attribute ohne Wert
+ HTML_O_BOX = HTML_OPTION_BOOL_START,
+ HTML_O_CHECKED,
+ HTML_O_COMPACT,
+ HTML_O_CONTINUE,
+ HTML_O_CONTROLS, // IExplorer 2.0
+ HTML_O_DECLARE, // IExplorer 3.0b5
+ HTML_O_DISABLED,
+ HTML_O_FOLDED, // Netscape internal
+ HTML_O_ISMAP,
+ HTML_O_MAYSCRIPT, // Netcape 3.0
+ HTML_O_MULTIPLE,
+ HTML_O_NOFLOW,
+ HTML_O_NOHREF, // Netscape
+ HTML_O_NORESIZE, // Netscape 2.0
+ HTML_O_NOSHADE, // Netscape
+ HTML_O_NOWRAP,
+ HTML_O_PLAIN,
+ HTML_O_SDFIXED,
+ HTML_O_SELECTED,
+ HTML_O_SHAPES, // IExplorer 3.0b5
+HTML_OPTION_BOOL_END,
+
+// Attribute mit einem String als Wert
+HTML_OPTION_STRING_START = HTML_OPTION_BOOL_END,
+ HTML_O_ABOVE = HTML_OPTION_STRING_START,
+ HTML_O_ACCEPT,
+ HTML_O_ACCESSKEY,
+ HTML_O_ADD_DATE, // Netscape internal
+ HTML_O_ALT,
+ HTML_O_AXES,
+ HTML_O_AXIS,
+ HTML_O_BELOW,
+ HTML_O_CHAR, // HTML3 Table Model Draft
+ HTML_O_CLASS,
+ HTML_O_CLIP,
+ HTML_O_CODE, // HotJava
+ HTML_O_CODETYPE,
+ HTML_O_COLSPEC,
+ HTML_O_CONTENT,
+ HTML_O_COORDS, // Netscape 2.0
+ HTML_O_DP,
+ HTML_O_ENCTYPE,
+ HTML_O_ERROR,
+ HTML_O_FACE, // IExplorer 2.0
+ HTML_O_FRAMEBORDER, // IExplorer 3.0
+ HTML_O_HTTPEQUIV,
+ HTML_O_LANGUAGE, // JavaScript
+ HTML_O_LAST_MODIFIED, // Netscape internal
+ HTML_O_LAST_VISIT, // Netscape internal
+ HTML_O_MD,
+ HTML_O_N,
+ HTML_O_NAME,
+ HTML_O_NOTATION,
+ HTML_O_PROMPT,
+ HTML_O_SHAPE,
+ HTML_O_STANDBY,
+ HTML_O_STYLE, // Style Sheets
+ HTML_O_TITLE,
+ HTML_O_VALUE,
+ HTML_O_SDVAL, // StarDiv NumberValue
+ HTML_O_SDNUM, // StarDiv NumberFormat
+ HTML_O_SDLIBRARY,
+ HTML_O_SDMODULE,
+HTML_OPTION_STRING_END,
+
+// Attribute mit einem SGML-Identifier als Wert
+HTML_OPTION_SGMLID_START = HTML_OPTION_STRING_END,
+ HTML_O_FROM = HTML_OPTION_SGMLID_START,
+ HTML_O_ID,
+ HTML_O_TARGET, // Netscape 2.0
+ HTML_O_TO,
+ HTML_O_UNTIL,
+HTML_OPTION_SGMLID_END,
+
+// Attribute mit einem URI als Wert
+HTML_OPTION_URI_START = HTML_OPTION_SGMLID_END,
+ HTML_O_ACTION = HTML_OPTION_URI_START,
+ HTML_O_ARCHIVE,
+ HTML_O_BACKGROUND,
+ HTML_O_CLASSID,
+ HTML_O_CODEBASE, // HotJava
+ HTML_O_DATA,
+ HTML_O_DYNSRC, // IExplorer 3.0
+ HTML_O_DYNSYNC, // IExplorer 2.0
+ HTML_O_IMAGEMAP,
+ HTML_O_HREF,
+ HTML_O_LOWSRC, // Netscape 3.0
+ HTML_O_SCRIPT,
+ HTML_O_SRC,
+ HTML_O_USEMAP, // Netscape 2.0
+HTML_OPTION_URI_END,
+
+// Attribute mit Entity-Namen als Wert
+HTML_OPTION_ENTITY_START = HTML_OPTION_URI_END,
+ HTML_O_DINGBAT = HTML_OPTION_ENTITY_START,
+ HTML_O_SYM,
+HTML_OPTION_ENTITY_END,
+
+// Attribute mit einer Farbe als Wert (alle Netscape)
+HTML_OPTION_COLOR_START = HTML_OPTION_ENTITY_END,
+ HTML_O_ALINK = HTML_OPTION_COLOR_START,
+ HTML_O_BGCOLOR,
+ HTML_O_BORDERCOLOR, // IExplorer 2.0
+ HTML_O_BORDERCOLORLIGHT, // IExplorer 2.0
+ HTML_O_BORDERCOLORDARK, // IExplorer 2.0
+ HTML_O_COLOR,
+ HTML_O_LINK,
+ HTML_O_TEXT,
+ HTML_O_VLINK,
+HTML_OPTION_COLOR_END,
+
+// Attribute mit einem numerischen Wert
+HTML_OPTION_NUMBER_START = HTML_OPTION_COLOR_END,
+ HTML_O_BORDER = HTML_OPTION_NUMBER_START,
+ HTML_O_CELLSPACING, // HTML3 Table Model Draft
+ HTML_O_CELLPADDING, // HTML3 Table Model Draft
+ HTML_O_CHAROFF, // HTML3 Table Model Draft
+ HTML_O_COLSPAN,
+ HTML_O_FRAMESPACING, // IExplorer 3.0
+ HTML_O_GUTTER, // Netscape 3.0b5
+ HTML_O_INDENT,
+ HTML_O_HEIGHT,
+ HTML_O_HSPACE, // Netscape
+ HTML_O_LEFT,
+ HTML_O_LEFTMARGIN, // IExplorer 2.0
+ HTML_O_LOOP, // IExplorer 2.0
+ HTML_O_MARGINWIDTH, // Netscape 2.0
+ HTML_O_MARGINHEIGHT, // Netscape 2.0
+ HTML_O_MAX,
+ HTML_O_MAXLENGTH,
+ HTML_O_MIN,
+ HTML_O_PAGEX,
+ HTML_O_PAGEY,
+ HTML_O_POINTSIZE,
+ HTML_O_ROWSPAN,
+ HTML_O_SCROLLAMOUNT, // IExplorer 2.0
+ HTML_O_SCROLLDELAY, // IExplorer 2.0
+ HTML_O_SEQNUM,
+ HTML_O_SKIP,
+ HTML_O_SPAN, // HTML3 Table Model Draft
+ HTML_O_TABINDEX,
+ HTML_O_TOP,
+ HTML_O_TOPMARGIN, // IExplorer 2.0
+ HTML_O_VSPACE, // Netscape
+ HTML_O_WEIGHT,
+ HTML_O_WIDTH,
+ HTML_O_X,
+ HTML_O_Y,
+ HTML_O_ZINDEX,
+HTML_OPTION_NUMBER_END,
+
+// Attribute mit Enum-Werten
+HTML_OPTION_ENUM_START = HTML_OPTION_NUMBER_END,
+ HTML_O_BEHAVIOR = HTML_OPTION_ENUM_START, // IExplorer 2.0
+ HTML_O_BGPROPERTIES, // IExplorer 2.0
+ HTML_O_CLEAR,
+ HTML_O_DIR,
+ HTML_O_DIRECTION, // IExplorer 2.0
+ HTML_O_FORMAT,
+ HTML_O_FRAME, // HTML3 Table Model Draft
+ HTML_O_LANG,
+ HTML_O_METHOD,
+ HTML_O_PALETTE,
+ HTML_O_REL,
+ HTML_O_REV,
+ HTML_O_RULES, // HTML3 Table Model Draft
+ HTML_O_SCROLLING, // Netscape 2.0
+ HTML_O_SDREADONLY,
+ HTML_O_SUBTYPE,
+ HTML_O_TYPE,
+ HTML_O_VALIGN,
+ HTML_O_VALUETYPE,
+ HTML_O_VISIBILITY,
+ HTML_O_WRAP,
+HTML_OPTION_ENUM_END,
+
+// Attribute mit Script-Code als Wert
+HTML_OPTION_SCRIPT_START = HTML_OPTION_ENUM_END,
+ HTML_O_ONABORT = HTML_OPTION_SCRIPT_START, // JavaScript
+ HTML_O_ONBLUR, // JavaScript
+ HTML_O_ONCHANGE, // JavaScript
+ HTML_O_ONCLICK, // JavaScript
+ HTML_O_ONERROR, // JavaScript
+ HTML_O_ONFOCUS, // JavaScript
+ HTML_O_ONLOAD, // JavaScript
+ HTML_O_ONMOUSEOUT, // JavaScript
+ HTML_O_ONMOUSEOVER, // JavaScript
+ HTML_O_ONRESET, // JavaScript
+ HTML_O_ONSELECT, // JavaScript
+ HTML_O_ONSUBMIT, // JavaScript
+ HTML_O_ONUNLOAD, // JavaScript
+
+ HTML_O_SDONABORT, // StarBasic
+ HTML_O_SDONBLUR, // StarBasic
+ HTML_O_SDONCHANGE, // StarBasic
+ HTML_O_SDONCLICK, // StarBasic
+ HTML_O_SDONERROR, // StarBasic
+ HTML_O_SDONFOCUS, // StarBasic
+ HTML_O_SDONLOAD, // StarBasic
+ HTML_O_SDONMOUSEOUT, // StarBasic
+ HTML_O_SDONMOUSEOVER, // StarBasic
+ HTML_O_SDONRESET, // StarBasic
+ HTML_O_SDONSELECT, // StarBasic
+ HTML_O_SDONSUBMIT, // StarBasic
+ HTML_O_SDONUNLOAD, // StarBasic
+HTML_OPTION_SCRIPT_END,
+
+// Attribute mit Kontext-abhaengigen Werten
+HTML_OPTION_CONTEXT_START = HTML_OPTION_SCRIPT_END,
+ HTML_O_ALIGN = HTML_OPTION_CONTEXT_START,
+ HTML_O_COLS, // Netscape 2.0 vs HTML 2.0
+ HTML_O_ROWS, // Netscape 2.0 vs HTML 2.0
+ HTML_O_SIZE,
+ HTML_O_START,
+ HTML_O_UNITS,
+HTML_OPTION_CONTEXT_END,
+
+// eine unbekannte Option
+HTML_O_UNKNOWN = HTML_OPTION_CONTEXT_END,
+HTML_OPTION_END
+};
+
+#endif // _HTMLTOKN_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/hyperlabel.hxx b/include/svtools/hyperlabel.hxx
new file mode 100644
index 000000000000..745c50798f1d
--- /dev/null
+++ b/include/svtools/hyperlabel.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 SVTOOLS_HYPERLABEL_HXX
+#define SVTOOLS_HYPERLABEL_HXX
+
+#include <vcl/event.hxx>
+
+
+#include <vcl/fixed.hxx>
+
+#define LABELBASEMAPHEIGHT 8
+
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ class HyperLabelImpl;
+
+ class HyperLabel : public FixedText
+ {
+ protected:
+ HyperLabelImpl* m_pImpl;
+ Link maClickHdl;
+
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+
+ void DeactivateHyperMode(Font aFont, const Color aColor);
+ void ActivateHyperMode(Font aFont, const Color aColor);
+
+ protected:
+ void implInit();
+
+ public:
+ HyperLabel( Window* _pParent, WinBits _nWinStyle = 0 );
+ ~HyperLabel( );
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void SetID( sal_Int16 _ID );
+ sal_Int16 GetID() const;
+
+ void SetIndex( sal_Int32 _Index );
+ sal_Int32 GetIndex() const;
+
+ void SetLabel( const OUString& _rText );
+
+ void ToggleBackgroundColor( const Color& _rGBColor );
+ void SetInteractive( sal_Bool _bInteractive );
+
+ void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
+ const Link& GetClickHdl() const { return maClickHdl; }
+
+ Size CalcMinimumSize( long nMaxWidth = 0 ) const;
+
+ private:
+
+ DECL_LINK(ImplClickHdl, HyperLabel*);
+
+ private:
+ using FixedText::CalcMinimumSize;
+ };
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imagemgr.hrc b/include/svtools/imagemgr.hrc
new file mode 100644
index 000000000000..1d86788e69fe
--- /dev/null
+++ b/include/svtools/imagemgr.hrc
@@ -0,0 +1,147 @@
+/* -*- 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_IMAGEMGR_HRC
+#define _SVTOOLS_IMAGEMGR_HRC
+
+#define IMAGELIST_START 3076 // must match to old Id's in SFX!
+
+#define IMG_IMPRESS (IMAGELIST_START + 47)
+#define IMG_BITMAP (IMAGELIST_START + 49)
+#define IMG_CALC (IMAGELIST_START + 50)
+#define IMG_CALCTEMPLATE (IMAGELIST_START + 51)
+#define IMG_DATABASE (IMAGELIST_START + 53)
+#define IMG_IMPRESSTEMPLATE (IMAGELIST_START + 54)
+#define IMG_GIF (IMAGELIST_START + 61)
+#define IMG_HTML (IMAGELIST_START + 63)
+#define IMG_JPG (IMAGELIST_START + 64)
+#define IMG_MATH (IMAGELIST_START + 68)
+#define IMG_MATHTEMPLATE (IMAGELIST_START + 69)
+#define IMG_FILE (IMAGELIST_START + 74)
+#define IMG_PCD (IMAGELIST_START + 76)
+#define IMG_PCT (IMAGELIST_START + 77)
+#define IMG_PCX (IMAGELIST_START + 78)
+#define IMG_SIM (IMAGELIST_START + 79)
+#define IMG_TEXTFILE (IMAGELIST_START + 80)
+#define IMG_TIFF (IMAGELIST_START + 82)
+#define IMG_WMF (IMAGELIST_START + 84)
+#define IMG_WRITER (IMAGELIST_START + 86)
+#define IMG_WRITERTEMPLATE (IMAGELIST_START + 87)
+#define IMG_FIXEDDEV (IMAGELIST_START + 88)
+#define IMG_REMOVEABLEDEV (IMAGELIST_START + 89)
+#define IMG_CDROMDEV (IMAGELIST_START + 90)
+#define IMG_NETWORKDEV (IMAGELIST_START + 91)
+#define IMG_TABLE (IMAGELIST_START + 112)
+#define IMG_FOLDER (IMAGELIST_START + 113)
+#define IMG_DXF (IMAGELIST_START + 141)
+#define IMG_MET (IMAGELIST_START + 142)
+#define IMG_PNG (IMAGELIST_START + 143)
+#define IMG_SGF (IMAGELIST_START + 144)
+#define IMG_SGV (IMAGELIST_START + 145)
+#define IMG_SVM (IMAGELIST_START + 146)
+#define IMG_GLOBAL_DOC (IMAGELIST_START + 150)
+#define IMG_DRAW (IMAGELIST_START + 151)
+#define IMG_DRAWTEMPLATE (IMAGELIST_START + 152)
+#define IMG_OO_DATABASE_DOC (IMAGELIST_START + 169)
+#define IMG_OO_DRAW_DOC (IMAGELIST_START + 170)
+#define IMG_OO_MATH_DOC (IMAGELIST_START + 171)
+#define IMG_OO_GLOBAL_DOC (IMAGELIST_START + 172)
+#define IMG_OO_IMPRESS_DOC (IMAGELIST_START + 173)
+#define IMG_OO_CALC_DOC (IMAGELIST_START + 174)
+#define IMG_OO_WRITER_DOC (IMAGELIST_START + 175)
+#define IMG_OO_DRAW_TEMPLATE (IMAGELIST_START + 176)
+#define IMG_OO_IMPRESS_TEMPLATE (IMAGELIST_START + 177)
+#define IMG_OO_CALC_TEMPLATE (IMAGELIST_START + 178)
+#define IMG_OO_WRITER_TEMPLATE (IMAGELIST_START + 179)
+#define IMG_EXTENSION (IMAGELIST_START + 180)
+
+#define RID_DESCRIPTION_START 256
+
+#define STR_DESCRIPTION_SOURCEFILE (RID_DESCRIPTION_START + 0)
+#define STR_DESCRIPTION_BOOKMARKFILE (RID_DESCRIPTION_START + 1)
+#define STR_DESCRIPTION_GRAPHIC_DOC (RID_DESCRIPTION_START + 2)
+#define STR_DESCRIPTION_CFGFILE (RID_DESCRIPTION_START + 3)
+#define STR_DESCRIPTION_APPLICATION (RID_DESCRIPTION_START + 4)
+#define STR_DESCRIPTION_DATABASE_TABLE (RID_DESCRIPTION_START + 5)
+#define STR_DESCRIPTION_SYSFILE (RID_DESCRIPTION_START + 6)
+#define STR_DESCRIPTION_WORD_DOC (RID_DESCRIPTION_START + 7)
+#define STR_DESCRIPTION_HELP_DOC (RID_DESCRIPTION_START + 8)
+#define STR_DESCRIPTION_HTMLFILE (RID_DESCRIPTION_START + 9)
+#define STR_DESCRIPTION_ARCHIVFILE (RID_DESCRIPTION_START + 10)
+#define STR_DESCRIPTION_LOGFILE (RID_DESCRIPTION_START + 11)
+#define STR_DESCRIPTION_SMATH_DOC (RID_DESCRIPTION_START + 12)
+#define STR_DESCRIPTION_SCHART_DOC (RID_DESCRIPTION_START + 13)
+#define STR_DESCRIPTION_SDRAW_DOC (RID_DESCRIPTION_START + 14)
+#define STR_DESCRIPTION_SCALC_DOC (RID_DESCRIPTION_START + 15)
+#define STR_DESCRIPTION_SIMPRESS_DOC (RID_DESCRIPTION_START + 16)
+#define STR_DESCRIPTION_SWRITER_DOC (RID_DESCRIPTION_START + 17)
+#define STR_DESCRIPTION_GLOBALDOC (RID_DESCRIPTION_START + 18)
+#define STR_DESCRIPTION_SIMAGE_DOC (RID_DESCRIPTION_START + 19)
+#define STR_DESCRIPTION_TEXTFILE (RID_DESCRIPTION_START + 20)
+#define STR_DESCRIPTION_LINK (RID_DESCRIPTION_START + 21)
+#define STR_DESCRIPTION_SOFFICE_TEMPLATE_DOC (RID_DESCRIPTION_START + 22)
+#define STR_DESCRIPTION_EXCEL_DOC (RID_DESCRIPTION_START + 23)
+#define STR_DESCRIPTION_EXCEL_TEMPLATE_DOC (RID_DESCRIPTION_START + 24)
+#define STR_DESCRIPTION_BATCHFILE (RID_DESCRIPTION_START + 25)
+#define STR_DESCRIPTION_FILE (RID_DESCRIPTION_START + 26)
+#define STR_DESCRIPTION_FOLDER (RID_DESCRIPTION_START + 27)
+#define STR_DESCRIPTION_FACTORY_WRITER (RID_DESCRIPTION_START + 28)
+#define STR_DESCRIPTION_FACTORY_CALC (RID_DESCRIPTION_START + 29)
+#define STR_DESCRIPTION_FACTORY_IMPRESS (RID_DESCRIPTION_START + 30)
+#define STR_DESCRIPTION_FACTORY_DRAW (RID_DESCRIPTION_START + 31)
+#define STR_DESCRIPTION_FACTORY_WRITERWEB (RID_DESCRIPTION_START + 32)
+#define STR_DESCRIPTION_FACTORY_GLOBALDOC (RID_DESCRIPTION_START + 33)
+#define STR_DESCRIPTION_FACTORY_MATH (RID_DESCRIPTION_START + 34)
+#define STR_DESCRIPTION_CALC_TEMPLATE (RID_DESCRIPTION_START + 35)
+#define STR_DESCRIPTION_DRAW_TEMPLATE (RID_DESCRIPTION_START + 36)
+#define STR_DESCRIPTION_IMPRESS_TEMPLATE (RID_DESCRIPTION_START + 37)
+#define STR_DESCRIPTION_WRITER_TEMPLATE (RID_DESCRIPTION_START + 38)
+#define STR_DESCRIPTION_LOCALE_VOLUME (RID_DESCRIPTION_START + 39)
+#define STR_DESCRIPTION_FLOPPY_VOLUME (RID_DESCRIPTION_START + 40)
+#define STR_DESCRIPTION_CDROM_VOLUME (RID_DESCRIPTION_START + 41)
+#define STR_DESCRIPTION_REMOTE_VOLUME (RID_DESCRIPTION_START + 42)
+#define STR_DESCRIPTION_POWERPOINT (RID_DESCRIPTION_START + 43)
+#define STR_DESCRIPTION_POWERPOINT_TEMPLATE (RID_DESCRIPTION_START + 44)
+#define STR_DESCRIPTION_POWERPOINT_SHOW (RID_DESCRIPTION_START + 45)
+#define STR_DESCRIPTION_SXMATH_DOC (RID_DESCRIPTION_START + 46)
+#define STR_DESCRIPTION_SXCHART_DOC (RID_DESCRIPTION_START + 47)
+#define STR_DESCRIPTION_SXDRAW_DOC (RID_DESCRIPTION_START + 48)
+#define STR_DESCRIPTION_SXCALC_DOC (RID_DESCRIPTION_START + 49)
+#define STR_DESCRIPTION_SXIMPRESS_DOC (RID_DESCRIPTION_START + 50)
+#define STR_DESCRIPTION_SXWRITER_DOC (RID_DESCRIPTION_START + 51)
+#define STR_DESCRIPTION_SXGLOBAL_DOC (RID_DESCRIPTION_START + 52)
+#define STR_DESCRIPTION_MATHML_DOC (RID_DESCRIPTION_START + 53)
+#define STR_DESCRIPTION_SDATABASE_DOC (RID_DESCRIPTION_START + 54)
+#define STR_DESCRIPTION_OO_DATABASE_DOC (RID_DESCRIPTION_START + 55)
+#define STR_DESCRIPTION_OO_DRAW_DOC (RID_DESCRIPTION_START + 56)
+#define STR_DESCRIPTION_OO_MATH_DOC (RID_DESCRIPTION_START + 57)
+#define STR_DESCRIPTION_OO_GLOBAL_DOC (RID_DESCRIPTION_START + 58)
+#define STR_DESCRIPTION_OO_IMPRESS_DOC (RID_DESCRIPTION_START + 59)
+#define STR_DESCRIPTION_OO_CALC_DOC (RID_DESCRIPTION_START + 60)
+#define STR_DESCRIPTION_OO_WRITER_DOC (RID_DESCRIPTION_START + 61)
+#define STR_DESCRIPTION_OO_DRAW_TEMPLATE (RID_DESCRIPTION_START + 62)
+#define STR_DESCRIPTION_OO_IMPRESS_TEMPLATE (RID_DESCRIPTION_START + 63)
+#define STR_DESCRIPTION_OO_CALC_TEMPLATE (RID_DESCRIPTION_START + 64)
+#define STR_DESCRIPTION_OO_WRITER_TEMPLATE (RID_DESCRIPTION_START + 65)
+#define STR_DESCRIPTION_FACTORY_DATABASE (RID_DESCRIPTION_START + 66)
+#define STR_DESCRIPTION_EXTENSION (RID_DESCRIPTION_START + 67)
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imagemgr.hxx b/include/svtools/imagemgr.hxx
new file mode 100644
index 000000000000..860190f835a3
--- /dev/null
+++ b/include/svtools/imagemgr.hxx
@@ -0,0 +1,79 @@
+/* -*- 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_IMAGEMGR_HXX
+#define _SVTOOLS_IMAGEMGR_HXX
+
+#include "svtools/svtdllapi.h"
+#include "sal/types.h"
+
+class Image;
+class String;
+class INetURLObject;
+
+namespace svtools {
+
+struct VolumeInfo
+{
+ sal_Bool m_bIsVolume;
+ sal_Bool m_bIsRemote;
+ sal_Bool m_bIsRemoveable;
+ sal_Bool m_bIsFloppy;
+ sal_Bool m_bIsCompactDisc;
+
+ VolumeInfo() :
+ m_bIsVolume ( sal_False ),
+ m_bIsRemote ( sal_False ),
+ m_bIsRemoveable ( sal_False ),
+ m_bIsFloppy ( sal_False ),
+ m_bIsCompactDisc( sal_False ) {}
+
+ VolumeInfo( sal_Bool _bIsVolume,
+ sal_Bool _bIsRemote,
+ sal_Bool _bIsRemoveable,
+ sal_Bool _bIsFloppy,
+ sal_Bool _bIsCompactDisc ) :
+ m_bIsVolume ( _bIsVolume ),
+ m_bIsRemote ( _bIsRemote ),
+ m_bIsRemoveable ( _bIsRemoveable ),
+ m_bIsFloppy ( _bIsFloppy ),
+ m_bIsCompactDisc( _bIsCompactDisc ) {}
+};
+
+}
+
+class SvFileInformationManager
+{
+private:
+ SVT_DLLPRIVATE static String GetDescription_Impl( const INetURLObject& rObject, sal_Bool bDetectFolder );
+
+public:
+ SVT_DLLPUBLIC static Image GetImage( const INetURLObject& rURL, sal_Bool bBig = sal_False );
+ SVT_DLLPUBLIC static Image GetFileImage( const INetURLObject& rURL, sal_Bool bBig = sal_False );
+ SVT_DLLPUBLIC static Image GetImageNoDefault( const INetURLObject& rURL, sal_Bool bBig = sal_False );
+ SVT_DLLPUBLIC static Image GetFolderImage( const svtools::VolumeInfo& rInfo, sal_Bool bBig = sal_False );
+
+ SVT_DLLPUBLIC static String GetDescription( const INetURLObject& rObject );
+ SVT_DLLPUBLIC static String GetFileDescription( const INetURLObject& rObject );
+ SVT_DLLPUBLIC static String 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 000000000000..b8282da72167
--- /dev/null
+++ b/include/svtools/imageresourceaccess.hxx
@@ -0,0 +1,81 @@
+/* -*- 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_INC_IMAGERESOURCEACCESS_HXX
+#define SVTOOLS_INC_IMAGERESOURCEACCESS_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+class SvStream;
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= GraphicAccess
+ //====================================================================
+ /** helper class for obtaining streams (which also can be used with the ImageProducer)
+ from a resource
+ */
+ class GraphicAccess
+ {
+ private:
+ GraphicAccess(); // never implemented
+
+ public:
+ /** determines whether the given URL denotes an image within a resource
+ ( or an image specified by a vnd.sun.star.GraphicObject scheme URL )
+ */
+ SVT_DLLPUBLIC static bool isSupportedURL( const OUString& _rURL );
+
+ /** for a given URL of an image within a resource ( or an image specified by a vnd.sun.star.GraphicObject scheme URL ), this method retrieves
+ an SvStream for this image.
+
+ This method works for arbitrary URLs denoting an image, since the
+ <type scope="com::sun::star::graphics">GraphicsProvider</type> 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.
+ */
+ SVT_DLLPUBLIC static SvStream* getImageStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
+ const OUString& _rImageResourceURL
+ );
+
+ /** for a given URL of an image within a resource ( or an image specified by a vnd.sun.star.GraphicObject scheme URL ), this method retrieves
+ an <type scope="com::sun::star::io">XInputStream</type> for this image.
+ */
+ SVT_DLLPUBLIC static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ getImageXStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
+ const OUString& _rImageResourceURL
+ );
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // DBA14_SVTOOLS_INC_IMAGERESOURCEACCESS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imap.hxx b/include/svtools/imap.hxx
new file mode 100644
index 000000000000..790cdebef60f
--- /dev/null
+++ b/include/svtools/imap.hxx
@@ -0,0 +1,151 @@
+/* -*- 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 _IMAP_HXX
+#define _IMAP_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/string.hxx>
+#include <tools/stream.hxx>
+#include <vector>
+
+class Point;
+class Rectangle;
+class Size;
+class Fraction;
+class IMapObject;
+
+typedef ::std::vector< IMapObject* > IMapObjectList_impl;
+
+class SVT_DLLPUBLIC ImageMap
+{
+private:
+
+ IMapObjectList_impl maList;
+ String aName;
+
+protected:
+
+ // Binaer laden/speichern
+ void ImpWriteImageMap( SvStream& rOStm, const String& ) const ;
+ void ImpReadImageMap( SvStream& rIStm, size_t nCount, const String& );
+
+ // Im-/Export
+ void ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
+ void ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
+ sal_uLong ImpReadCERN( SvStream& rOStm, const String& rBaseURL );
+ sal_uLong ImpReadNCSA( SvStream& rOStm, const String& rBaseURL );
+
+ void ImpReadCERNLine( const OString& rLine, const String& rBaseURL );
+ Point ImpReadCERNCoords( const char** ppStr );
+ long ImpReadCERNRadius( const char** ppStr );
+ String ImpReadCERNURL( const char** ppStr, const String& rBaseURL );
+
+ void ImpReadNCSALine( const OString& rLine, const String& rBaseURL );
+ String ImpReadNCSAURL( const char** ppStr, const String& rBaseURL );
+ Point ImpReadNCSACoords( const char** ppStr );
+
+ sal_uLong ImpDetectFormat( SvStream& rIStm );
+
+public:
+
+ TYPEINFO();
+
+ ImageMap() {};
+ ImageMap( const String& rName );
+ ImageMap( const ImageMap& rImageMap );
+
+ // Der Dtor gibt den intern belegten
+ // Speicher wieder frei;
+ // alle IMapObjekte werden im Dtor zerstoert;
+ virtual ~ImageMap();
+
+ // Zuweisungsoperator
+ ImageMap& operator=( const ImageMap& rImageMap );
+
+ // Vergleichsoperator (es wird alles auf Gleichheit geprueft)
+ sal_Bool operator==( const ImageMap& rImageMap );
+ sal_Bool operator!=( const ImageMap& rImageMap );
+
+ // In die Map wird ein neues IMap-Obkekt ans Ende eingefuegt
+ void InsertIMapObject( const IMapObject& rIMapObject );
+
+ // Zugriff auf einzelne IMapObjekte; die Objekte
+ // duerfen von aussen _nicht_ zerstoert werden
+ IMapObject* GetIMapObject( size_t nPos ) const
+ {
+ return ( nPos < maList.size() ) ? maList[ nPos ] : NULL;
+ }
+
+ // Gibt das Objekt zurueck, das zuerst getroffen wurde oder NULL;
+ // Groessen- und Positionsangaben sind in 1/100mm;
+ // rTotalSize ist die Originalgroesse des Bildes;
+ // rDisplaySize die aktuelle Darstellungsgroesse;
+ // rRelPoint bezieht sich auf die Darstellungsgroesse
+ // und die linke oebere Ecke des Bildes
+ IMapObject* GetHitIMapObject( const Size& rOriginalSize,
+ const Size& rDisplaySize,
+ const Point& rRelHitPoint,
+ sal_uLong nFlags = 0 );
+
+ // Gibt die Gesamtanzahl der IMap-Objekte zurueck
+ size_t GetIMapObjectCount() const { return maList.size(); }
+
+ // Loescht alle internen Objekte
+ void ClearImageMap();
+
+ // liefert die aktuelle Versionsnummer
+ sal_uInt16 GetVersion() const;
+
+ // liefert / setzt den Namen der ImageMap
+ const String& GetName() const { return aName; }
+ void SetName( const String& rName ) { aName = rName; }
+
+ // skaliert alle Objekte der ImageMap entpr. dem uebergebenen Faktor
+ void Scale( const Fraction& rFractX, const Fraction& rFracY );
+
+ // Im-/Export
+ void Write ( SvStream& rOStm, const String& rBaseURL ) const;
+ void Read( SvStream& rIStm, const String& rBaseURL );
+
+ void Write( SvStream& rOStm, sal_uLong nFormat, const String& rBaseURL ) const;
+ sal_uLong Read( SvStream& rIStm, sal_uLong nFormat, const String& rBaseURL );
+};
+
+class IMapCompat
+{
+ SvStream* pRWStm;
+ sal_uLong nCompatPos;
+ sal_uLong nTotalSize;
+ sal_uInt16 nStmMode;
+
+ IMapCompat() {}
+ IMapCompat( const IMapCompat& ) {}
+ IMapCompat& operator=( const IMapCompat& ) { return *this; }
+ sal_Bool operator==( const IMapCompat& ) { return sal_False; }
+
+public:
+
+ IMapCompat( SvStream& rStm, const sal_uInt16 nStreamMode );
+ ~IMapCompat();
+};
+
+#endif // _IMAP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imapcirc.hxx b/include/svtools/imapcirc.hxx
new file mode 100644
index 000000000000..057561adad98
--- /dev/null
+++ b/include/svtools/imapcirc.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 _GOODIES_IMAPCIRC_HXX
+#define _GOODIES_IMAPCIRC_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/gen.hxx>
+#include <svtools/imapobj.hxx>
+
+class Fraction;
+
+class SVT_DLLPUBLIC IMapCircleObject : public IMapObject
+{
+ Point aCenter;
+ sal_Int32 nRadius;
+
+ void ImpConstruct( const Point& rCenter, sal_uLong nRad, sal_Bool bPixel );
+
+protected:
+
+ // Binaer-Im-/Export
+ virtual void WriteIMapObject( SvStream& rOStm ) const;
+ virtual void ReadIMapObject( SvStream& rIStm );
+
+public:
+
+ IMapCircleObject() {};
+ IMapCircleObject( const Point& rCenter, sal_uLong nRad,
+ const String& rURL,
+ const String& rAltText,
+ const String& rDesc,
+ const String& rTarget,
+ const String& rName,
+ sal_Bool bActive = sal_True,
+ sal_Bool bPixelCoords = sal_True );
+ virtual ~IMapCircleObject() {};
+
+ virtual sal_uInt16 GetType() const;
+ virtual sal_Bool IsHit( const Point& rPoint ) const;
+
+ Point GetCenter( sal_Bool bPixelCoords = sal_True ) const;
+ sal_uLong GetRadius( sal_Bool bPixelCoords = sal_True ) const;
+
+ // liefert das BoundRect des Kreis-Objektes in 1/100mm
+ virtual Rectangle GetBoundRect() const;
+
+ void Scale( const Fraction& rFractX, const Fraction& rFracY );
+
+ using IMapObject::IsEqual;
+ sal_Bool IsEqual( const IMapCircleObject& rEqObj );
+
+ // Im-/Export
+ void WriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
+ void WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imapobj.hxx b/include/svtools/imapobj.hxx
new file mode 100644
index 000000000000..e90902bec0f0
--- /dev/null
+++ b/include/svtools/imapobj.hxx
@@ -0,0 +1,145 @@
+/* -*- 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 _GOODIES_IMAPOBJ_HXX
+#define _GOODIES_IMAPOBJ_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/string.hxx>
+#include <svl/macitem.hxx>
+#include <rtl/strbuf.hxx>
+
+class Point;
+class Rectangle;
+class SvStream;
+
+#define IMAP_OBJ_NONE ((sal_uInt16)0x0000)
+#define IMAP_OBJ_RECTANGLE ((sal_uInt16)0x0001)
+#define IMAP_OBJ_CIRCLE ((sal_uInt16)0x0002)
+#define IMAP_OBJ_POLYGON ((sal_uInt16)0x0003)
+#define IMAP_OBJ_VERSION ((sal_uInt16)0x0005)
+
+#define IMAGE_MAP_VERSION ((sal_uInt16)0x0001)
+
+#define IMAPMAGIC "SDIMAP"
+
+#define IMAP_MIRROR_HORZ 0x00000001L
+#define IMAP_MIRROR_VERT 0x00000002L
+
+#define IMAP_FORMAT_BIN 0x00000001L
+#define IMAP_FORMAT_CERN 0x00000002L
+#define IMAP_FORMAT_NCSA 0x00000004L
+#define IMAP_FORMAT_DETECT 0xffffffffL
+
+#define IMAP_ERR_OK 0x00000000L
+#define IMAP_ERR_FORMAT 0x00000001L
+
+class SVT_DLLPUBLIC IMapObject
+{
+ friend class ImageMap;
+
+ String aURL;
+ String aAltText;
+ String aDesc;
+ String aTarget;
+ String aName;
+ SvxMacroTableDtor aEventList;
+ sal_Bool bActive;
+
+protected:
+ sal_uInt16 nReadVersion;
+
+ // Binaer-Im-/Export
+ virtual void WriteIMapObject( SvStream& rOStm ) const = 0;
+ virtual void ReadIMapObject( SvStream& rIStm ) = 0;
+
+ // Hilfsmethoden
+ void AppendCERNCoords(OStringBuffer& rBuf, const Point& rPoint100) const;
+ void AppendCERNURL(OStringBuffer& rBuf, const String& rBaseURL) const;
+ void AppendNCSACoords(OStringBuffer& rBuf, const Point& rPoint100) const;
+ void AppendNCSAURL(OStringBuffer&rBuf, const String& rBaseURL) const;
+
+public:
+
+ static rtl_TextEncoding nActualTextEncoding;
+
+ IMapObject();
+ IMapObject( const String& rURL,
+ const String& rAltText,
+ const String& rDesc,
+ const String& rTarget,
+ const String& rName,
+ sal_Bool bActive );
+ virtual ~IMapObject() {};
+
+ virtual sal_uInt16 GetVersion() const;
+ virtual sal_uInt16 GetType() const = 0;
+ virtual sal_Bool IsHit( const Point& rPoint ) const = 0;
+
+ void Write ( SvStream& rOStm, const String& rBaseURL ) const;
+ void Read( SvStream& rIStm, const String& rBaseURL );
+
+ virtual Rectangle GetBoundRect() const = 0;
+
+ const String& GetURL() const { return aURL; }
+ void SetURL( const String& rURL ) { aURL = rURL; }
+
+ const String& GetAltText() const { return aAltText; }
+ void SetAltText( const String& rAltText) { aAltText = rAltText; }
+
+ const String& GetDesc() const { return aDesc; }
+ void SetDesc( const String& rDesc ) { aDesc = rDesc; }
+
+ const String& GetTarget() const { return aTarget; }
+ void SetTarget( const String& rTarget ) { aTarget = rTarget; }
+
+ const String& GetName() const { return aName; }
+ void SetName( const String& rName ) { aName = rName; }
+
+ sal_Bool IsActive() const { return bActive; }
+ void SetActive( sal_Bool bSetActive = sal_True ) { bActive = bSetActive; }
+
+ sal_Bool IsEqual( const IMapObject& rEqObj );
+
+ // IMap-Events
+ inline const SvxMacroTableDtor& GetMacroTable() const { return aEventList;}
+ inline void SetMacroTable( const SvxMacroTableDtor& rTbl ) { aEventList = rTbl; }
+
+ inline const SvxMacro& GetEvent( sal_uInt16 nEvent ) const;
+ inline sal_Bool HasEvent( sal_uInt16 nEvent ) const;
+ void SetEvent( sal_uInt16 nEvent, const SvxMacro& );
+ inline sal_Bool DelEvent( sal_uInt16 nEvent );
+};
+
+inline sal_Bool IMapObject::HasEvent( sal_uInt16 nEvent ) const
+{
+ return aEventList.IsKeyValid( nEvent );
+}
+inline const SvxMacro& IMapObject::GetEvent( sal_uInt16 nEvent ) const
+{
+ return *(aEventList.Get( nEvent ));
+}
+inline sal_Bool IMapObject::DelEvent( sal_uInt16 nEvent )
+{
+ return aEventList.Erase( nEvent );
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imappoly.hxx b/include/svtools/imappoly.hxx
new file mode 100644
index 000000000000..b4a0eafdb07d
--- /dev/null
+++ b/include/svtools/imappoly.hxx
@@ -0,0 +1,81 @@
+/* -*- 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 _GOODIES_IMAPPOLY_HXX
+#define _GOODIES_IMAPPOLY_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/imapobj.hxx>
+#include <tools/poly.hxx>
+
+class Fraction;
+
+class SVT_DLLPUBLIC IMapPolygonObject : public IMapObject
+{
+ Polygon aPoly;
+ Rectangle aEllipse;
+ sal_Bool bEllipse;
+
+ SVT_DLLPRIVATE void ImpConstruct( const Polygon& rPoly, sal_Bool bPixel );
+
+protected:
+
+ // Binaer-Im-/Export
+ virtual void WriteIMapObject( SvStream& rOStm ) const;
+ virtual void ReadIMapObject( SvStream& rIStm );
+
+ sal_Bool ReadPreProLine( SvStream& rIStm, String& rStr );
+
+public:
+ IMapPolygonObject() {};
+ IMapPolygonObject( const Polygon& rPoly,
+ const String& rURL,
+ const String& rAltText,
+ const String& rDesc,
+ const String& rTarget,
+ const String& rName,
+ sal_Bool bActive = sal_True,
+ sal_Bool bPixelCoords = sal_True );
+ virtual ~IMapPolygonObject() {};
+
+ virtual sal_uInt16 GetType() const;
+ virtual sal_Bool IsHit( const Point& rPoint ) const;
+
+ Polygon GetPolygon( sal_Bool bPixelCoords = sal_True ) const;
+
+ // liefert das BoundRect des Polygon-Objektes in 1/100mm
+ virtual Rectangle GetBoundRect() const { return aPoly.GetBoundRect(); }
+
+ sal_Bool HasExtraEllipse() const { return bEllipse; }
+ const Rectangle& GetExtraEllipse() const { return aEllipse; }
+ void SetExtraEllipse( const Rectangle& rEllipse );
+
+ void Scale( const Fraction& rFractX, const Fraction& rFracY );
+
+ using IMapObject::IsEqual;
+ sal_Bool IsEqual( const IMapPolygonObject& rEqObj );
+
+ // Im-/Export
+ void WriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
+ void WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imaprect.hxx b/include/svtools/imaprect.hxx
new file mode 100644
index 000000000000..b7d6ab54288a
--- /dev/null
+++ b/include/svtools/imaprect.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 _GOODIES_IMAPRECT_HXX
+#define _GOODIES_IMAPRECT_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/imapobj.hxx>
+#include <tools/gen.hxx>
+
+class Fraction;
+
+class SVT_DLLPUBLIC IMapRectangleObject : public IMapObject
+{
+ Rectangle aRect;
+
+ SVT_DLLPRIVATE void ImpConstruct( const Rectangle& rRect, sal_Bool bPixel );
+
+protected:
+
+ // Binaer-Im-/Export
+ virtual void WriteIMapObject( SvStream& rOStm ) const;
+ virtual void ReadIMapObject( SvStream& rIStm );
+
+public:
+
+ IMapRectangleObject() {};
+ IMapRectangleObject( const Rectangle& rRect,
+ const String& rURL,
+ const String& rAltText,
+ const String& rDesc,
+ const String& rTarget,
+ const String& rName,
+ sal_Bool bActive = sal_True,
+ sal_Bool bPixelCoords = sal_True );
+ virtual ~IMapRectangleObject() {};
+
+ virtual sal_uInt16 GetType() const;
+ virtual sal_Bool IsHit( const Point& rPoint ) const;
+
+ Rectangle GetRectangle( sal_Bool bPixelCoords = sal_True ) const;
+
+ // liefert das BoundRect des Rechteck-Objektes in 1/100mm
+ virtual Rectangle GetBoundRect() const { return aRect; }
+
+ void Scale( const Fraction& rFractX, const Fraction& rFracY );
+
+ using IMapObject::IsEqual;
+ sal_Bool IsEqual( const IMapRectangleObject& rEqObj );
+
+ // Im-/Export
+ void WriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
+ void WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/imgdef.hxx b/include/svtools/imgdef.hxx
new file mode 100644
index 000000000000..e243d9fd4231
--- /dev/null
+++ b/include/svtools/imgdef.hxx
@@ -0,0 +1,36 @@
+/* -*- 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_IMGDEF_HXX
+#define _SVTOOLS_IMGDEF_HXX
+
+enum SfxSymbolsSize
+{
+ SFX_SYMBOLS_SIZE_SMALL,
+ SFX_SYMBOLS_SIZE_LARGE,
+ SFX_SYMBOLS_SIZE_AUTO
+};
+
+#define SFX_TOOLBOX_CHANGESYMBOLSET 0x0001
+#define SFX_TOOLBOX_CHANGEOUTSTYLE 0x0002
+#define SFX_TOOLBOX_CHANGEBUTTONTYPE 0x0004
+
+#endif // _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 000000000000..9e2a54a8ef0b
--- /dev/null
+++ b/include/svtools/indexentryres.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 SVTOOLS_INDEXENTRYRESOURCE_HXX
+#define SVTOOLS_INDEXENTRYRESOURCE_HXX
+
+#include "svtools/svtdllapi.h"
+#include <rtl/ustring.hxx>
+
+class IndexEntryResourceData;
+
+class SVT_DLLPUBLIC IndexEntryResource
+{
+ private:
+ IndexEntryResourceData *mp_Data;
+
+ public:
+ IndexEntryResource ();
+ ~IndexEntryResource ();
+ const OUString& GetTranslation (const OUString& r_Algorithm);
+};
+
+#endif /* SVTOOLS_INDEXENTRYRESOURCE_HXX */
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/inetimg.hxx b/include/svtools/inetimg.hxx
new file mode 100644
index 000000000000..f28ac2cdedfe
--- /dev/null
+++ b/include/svtools/inetimg.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 _INETIMG_HXX
+#define _INETIMG_HXX
+
+#include <tools/string.hxx>
+#include <tools/gen.hxx>
+
+class SvData;
+class SotDataObject;
+
+//=========================================================================
+
+class INetImage
+{
+ String aImageURL;
+ String aTargetURL;
+ String aTargetFrame;
+ String aAlternateText;
+ Size aSizePixel;
+
+protected:
+ String CopyExchange() const;
+ void PasteExchange( const String& rString );
+
+ void SetImageURL( const String& rS ) { aImageURL = rS; }
+ void SetTargetURL( const String& rS ) { aTargetURL = rS; }
+ void SetTargetFrame( const String& rS ) { aTargetFrame = rS; }
+ void SetAlternateText( const String& rS ){ aAlternateText = rS; }
+ void SetSizePixel( const Size& rSize ) { aSizePixel = rSize; }
+
+public:
+ INetImage(
+ const String& rImageURL,
+ const String& rTargetURL,
+ const String& rTargetFrame,
+ const String& rAlternateText,
+ const Size& rSizePixel )
+ : aImageURL( rImageURL ),
+ aTargetURL( rTargetURL ),
+ aTargetFrame( rTargetFrame ),
+ aAlternateText( rAlternateText ),
+ aSizePixel( rSizePixel )
+ {}
+ INetImage()
+ {}
+
+ const String& GetImageURL() const { return aImageURL; }
+ const String& GetTargetURL() const { return aTargetURL; }
+ const String& GetTargetFrame() const { return aTargetFrame; }
+ const String& GetAlternateText() const { return aAlternateText; }
+ const Size& GetSizePixel() const { return aSizePixel; }
+
+ // Im-/Export
+ sal_Bool Write( SvStream& rOStm, sal_uLong nFormat ) const;
+ sal_Bool Read( SvStream& rIStm, sal_uLong nFormat );
+};
+
+#endif // #ifndef _INETIMG_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 000000000000..a8e85eaf7647
--- /dev/null
+++ b/include/svtools/inettbc.hxx
@@ -0,0 +1,97 @@
+/* -*- 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_INETTBC_HXX
+#define _SVTOOLS_INETTBC_HXX
+
+#include "rtl/ref.hxx"
+#include "svtools/svtdllapi.h"
+#include <tools/string.hxx>
+#include <tools/urlobj.hxx>
+
+#include <vcl/combobox.hxx>
+
+class IUrlFilter;
+class SvtMatchContext_Impl;
+class SvtURLBox_Impl;
+class SVT_DLLPUBLIC SvtURLBox : public ComboBox
+{
+friend class SvtMatchContext_Impl;
+friend class SvtURLBox_Impl;
+ Link aOpenHdl;
+ String aBaseURL;
+ String aPlaceHolder;
+ rtl::Reference< SvtMatchContext_Impl > pCtx;
+ SvtURLBox_Impl* pImp;
+ INetProtocol eSmartProtocol;
+ sal_Bool bAutoCompleteMode : 1;
+ sal_Bool bOnlyDirectories : 1;
+ sal_Bool bCtrlClick : 1;
+ sal_Bool bHistoryDisabled : 1;
+ sal_Bool bNoSelection : 1;
+ sal_Bool bIsAutoCompleteEnabled : 1;
+
+ SVT_DLLPRIVATE sal_Bool ProcessKey( const KeyCode& rCode );
+ SVT_DLLPRIVATE void TryAutoComplete();
+ SVT_DLLPRIVATE void UpdatePicklistForSmartProtocol_Impl();
+ DECL_DLLPRIVATE_LINK( AutoCompleteHdl_Impl, void* );
+ SVT_DLLPRIVATE void Init(bool bSetDefaultHelpID);
+
+protected:
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void Select();
+ virtual void Modify();
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+public:
+ SvtURLBox( Window* pParent, INetProtocol eSmart = INET_PROT_NOT_VALID, bool bSetDefaultHelpID = true );
+ SvtURLBox( Window* pParent, WinBits _nStyle, INetProtocol eSmart = INET_PROT_NOT_VALID, bool bSetDefaultHelpID = true );
+ SvtURLBox( Window* pParent, const ResId& _rResId, INetProtocol eSmart = INET_PROT_NOT_VALID, bool bSetDefaultHelpID = true );
+ ~SvtURLBox();
+
+ void SetBaseURL( const String& rURL );
+ const String& GetBaseURL() const { return aBaseURL; }
+ void SetOpenHdl( const Link& rLink ) { aOpenHdl = rLink; }
+ const Link& GetOpenHdl() const { return aOpenHdl; }
+ void SetOnlyDirectories( sal_Bool bDir = sal_True );
+ void SetNoURLSelection( sal_Bool bSet = sal_True );
+ INetProtocol GetSmartProtocol() const { return eSmartProtocol; }
+ void SetSmartProtocol( INetProtocol eProt );
+ sal_Bool IsCtrlOpen()
+ { return bCtrlClick; }
+ String GetURL();
+ void DisableHistory();
+
+ void UpdatePickList( );
+
+ static String ParseSmart( String aText, String aBaseURL, String aWorkDir );
+
+ void SetFilter(const String& _sFilter);
+ void SetUrlFilter( const IUrlFilter* _pFilter );
+
+ inline void EnableAutocompletion( sal_Bool _bEnable = sal_True )
+ { bIsAutoCompleteEnabled = _bEnable; }
+ void SetPlaceHolder( const String& sPlaceHolder ) { aPlaceHolder = sPlaceHolder; }
+ String GetPlaceHolder() { return aPlaceHolder; }
+ bool MatchesPlaceHolder( const String& sToMatch ) { return ( ( aPlaceHolder.Len() > 0 ) && ( aPlaceHolder == sToMatch ) ); }
+};
+
+#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 000000000000..241f3cd128d2
--- /dev/null
+++ b/include/svtools/insdlg.hxx
@@ -0,0 +1,79 @@
+/* -*- 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_INSDLG_HXX
+#define _SVTOOLS_INSDLG_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <tools/globname.hxx>
+#include <sot/formats.hxx>
+
+#include <vector>
+#include <svtools/transfer.hxx>
+
+class SvObjectServer
+{
+private:
+ SvGlobalName aClassName;
+ String aHumanName;
+
+public:
+ SvObjectServer( const SvGlobalName & rClassP, const String & rHumanP ) :
+ aClassName( rClassP ),
+ aHumanName( rHumanP ) {}
+
+ const SvGlobalName & GetClassName() const { return aClassName; }
+ const String & GetHumanName() const { return aHumanName; }
+};
+
+typedef ::std::vector< SvObjectServer > SvObjectServerList_impl;
+
+class SVT_DLLPUBLIC SvObjectServerList
+{
+private:
+ SvObjectServerList_impl aObjectServerList;
+
+public:
+ const SvObjectServer * Get( const String & 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 String GetSotFormatUIName( SotFormatStringId nId );
+ static sal_Bool GetEmbeddedName(const TransferableDataHelper& rData, String& _rName, String& _rSource, SotFormatStringId& _nFormat);
+};
+
+#endif // _SVTOOLS_INSDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/itemdel.hxx b/include/svtools/itemdel.hxx
new file mode 100644
index 000000000000..acb2637e04cb
--- /dev/null
+++ b/include/svtools/itemdel.hxx
@@ -0,0 +1,30 @@
+/* -*- 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_ITEMDEL_HXX
+#define _SVTOOLS_ITEMDEL_HXX
+
+#include "svtools/svtdllapi.h"
+
+class SfxPoolItem;
+
+SVT_DLLPUBLIC SfxPoolItem* DeleteItemOnIdle( SfxPoolItem* pItem );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/ivctrl.hxx b/include/svtools/ivctrl.hxx
new file mode 100644
index 000000000000..3c5aafc57848
--- /dev/null
+++ b/include/svtools/ivctrl.hxx
@@ -0,0 +1,353 @@
+/* -*- 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 _ICNVW_HXX
+#define _ICNVW_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/string.hxx>
+#include <vcl/ctrl.hxx>
+#include <tools/link.hxx>
+#include <tools/contnr.hxx>
+#include <vcl/image.hxx>
+#include <vcl/seleng.hxx>
+
+class ResId;
+class Point;
+class SvxIconChoiceCtrl_Impl;
+class Image;
+
+#define ICNVIEW_FLAG_POS_LOCKED 0x0001
+#define ICNVIEW_FLAG_SELECTED 0x0002
+#define ICNVIEW_FLAG_FOCUSED 0x0004
+#define ICNVIEW_FLAG_IN_USE 0x0008
+#define ICNVIEW_FLAG_CURSORED 0x0010 // Rahmen um Image
+#define ICNVIEW_FLAG_POS_MOVED 0x0020 // per D&D verschoben aber nicht gelockt
+#define ICNVIEW_FLAG_DROP_TARGET 0x0040 // im QueryDrop gesetzt
+#define ICNVIEW_FLAG_BLOCK_EMPHASIS 0x0080 // Emphasis nicht painten
+#define ICNVIEW_FLAG_USER1 0x0100
+#define ICNVIEW_FLAG_USER2 0x0200
+#define ICNVIEW_FLAG_PRED_SET 0x0400 // Predecessor wurde umgesetzt
+
+enum SvxIconChoiceCtrlTextMode
+{
+ IcnShowTextFull = 1, // BoundRect nach unten aufplustern
+ IcnShowTextShort, // Abkuerzung mit "..."
+ IcnShowTextSmart, // Text komplett anzeigen, wenn moeglich (n.i.)
+ IcnShowTextDontKnow // Einstellung der View
+};
+
+enum SvxIconChoiceCtrlPositionMode
+{
+ IcnViewPositionModeFree = 0, // freies pixelgenaues Positionieren
+ IcnViewPositionModeAutoArrange = 1, // automatisches Ausrichten
+ IcnViewPositionModeAutoAdjust = 2, // automatisches Anordnen
+ IcnViewPositionModeLast = IcnViewPositionModeAutoAdjust
+};
+
+class SvxIconChoiceCtrlEntry
+{
+ Image aImage;
+
+ OUString aText;
+ String aQuickHelpText;
+ void* pUserData;
+
+ friend class SvxIconChoiceCtrl_Impl;
+ friend class IcnCursor_Impl;
+ friend class EntryList_Impl;
+ friend class IcnGridMap_Impl;
+
+ Rectangle aRect; // Bounding-Rect des Entries
+ Rectangle aGridRect; // nur gesetzt im Grid-Modus
+ sal_uLong nPos;
+
+ // die Eintragsposition in der Eintragsliste entspricht der beim Insert vorgegebenen
+ // [Sortier-]Reihenfolge (->Reihenfolge der Anker in der Ankerliste!). Im AutoArrange-Modus
+ // kann die sichtbare Reihenfolge aber anders sein. Die Eintraege werden deshalb dann
+ // verkettet
+ SvxIconChoiceCtrlEntry* pblink; // backward (linker Nachbar)
+ SvxIconChoiceCtrlEntry* pflink; // forward (rechter Nachbar)
+
+ SvxIconChoiceCtrlTextMode eTextMode;
+ sal_uInt16 nX,nY; // fuer Tastatursteuerung
+ sal_uInt16 nFlags;
+
+ void ClearFlags( sal_uInt16 nMask ) { nFlags &= (~nMask); }
+ void SetFlags( sal_uInt16 nMask ) { nFlags |= nMask; }
+ void AssignFlags( sal_uInt16 _nFlags ) { nFlags = _nFlags; }
+
+ // setzt den linken Nachbarn (A <-> B ==> A <-> this <-> B)
+ void SetBacklink( SvxIconChoiceCtrlEntry* pA )
+ {
+ pA->pflink->pblink = this; // X <- B
+ this->pflink = pA->pflink; // X -> B
+ this->pblink = pA; // A <- X
+ pA->pflink = this; // A -> X
+ }
+ // loest eine Verbindung (A <-> this <-> B ==> A <-> B)
+ void Unlink()
+ {
+ this->pblink->pflink = this->pflink;
+ this->pflink->pblink = this->pblink;
+ this->pflink = 0;
+ this->pblink = 0;
+ }
+
+public:
+ SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, sal_uInt16 nFlags = 0 );
+ ~SvxIconChoiceCtrlEntry () {}
+
+ void SetImage ( const Image& rImage ) { aImage = rImage; }
+ Image GetImage () const { return aImage; }
+ void SetText ( const OUString& rText ) { aText = rText; }
+ OUString GetText () const { return aText; }
+ String SVT_DLLPUBLIC GetDisplayText() const;
+ void SetQuickHelpText( const String& rText ) { aQuickHelpText = rText; }
+ String GetQuickHelpText() const { return aQuickHelpText; }
+ void SetUserData ( void* _pUserData ) { pUserData = _pUserData; }
+ void* GetUserData () { return pUserData; }
+
+ const Rectangle & GetBoundRect() const { return aRect; }
+
+ void SetFocus ( sal_Bool bSet )
+ { nFlags = ( bSet ? nFlags | ICNVIEW_FLAG_FOCUSED : nFlags & ~ICNVIEW_FLAG_FOCUSED ); }
+
+ SvxIconChoiceCtrlTextMode GetTextMode() const { return eTextMode; }
+ sal_uInt16 GetFlags() const { return nFlags; }
+ sal_Bool IsSelected() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_SELECTED) !=0); }
+ sal_Bool IsFocused() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_FOCUSED) !=0); }
+ sal_Bool IsInUse() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_IN_USE) !=0); }
+ sal_Bool IsCursored() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_CURSORED) !=0); }
+ sal_Bool IsDropTarget() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_DROP_TARGET) !=0); }
+ sal_Bool IsBlockingEmphasis() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_BLOCK_EMPHASIS) !=0); }
+ sal_Bool IsPosLocked() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_POS_LOCKED) !=0); }
+
+ // Nur bei AutoArrange gesetzt. Den Kopf der Liste gibts per SvxIconChoiceCtrl::GetPredecessorHead
+ SvxIconChoiceCtrlEntry* GetSuccessor() const { return pflink; }
+ SvxIconChoiceCtrlEntry* GetPredecessor() const { return pblink; }
+
+// sal_Unicode GetMnemonicChar() const;
+};
+
+enum SvxIconChoiceCtrlColumnAlign
+{
+ IcnViewAlignLeft = 1,
+ IcnViewAlignRight,
+ IcnViewAlignCenter
+};
+
+class SvxIconChoiceCtrlColumnInfo
+{
+ OUString aColText;
+ Image aColImage;
+ long nWidth;
+ SvxIconChoiceCtrlColumnAlign eAlignment;
+ sal_uInt16 nSubItem;
+
+public:
+ SvxIconChoiceCtrlColumnInfo( sal_uInt16 nSub, long nWd,
+ SvxIconChoiceCtrlColumnAlign eAlign ) :
+ nWidth( nWd ), eAlignment( eAlign ), nSubItem( nSub ) {}
+ SvxIconChoiceCtrlColumnInfo( const SvxIconChoiceCtrlColumnInfo& );
+
+ void SetText( const OUString& rText ) { aColText = rText; }
+ void SetImage( const Image& rImg ) { aColImage = rImg; }
+ void SetWidth( long nWd ) { nWidth = nWd; }
+ void SetAlignment( SvxIconChoiceCtrlColumnAlign eAlign ) { eAlignment = eAlign; }
+ void SetSubItem( sal_uInt16 nSub) { nSubItem = nSub; }
+
+ const OUString& GetText() const { return aColText; }
+ const Image& GetImage() const { return aColImage; }
+ long GetWidth() const { return nWidth; }
+ SvxIconChoiceCtrlColumnAlign GetAlignment() const { return eAlignment; }
+ sal_uInt16 GetSubItem() const { return nSubItem; }
+};
+
+//###################################################################################################################################
+/*
+ Window-Bits:
+ WB_ICON // Text unter dem Icon
+ WB_SMALL_ICON // Text rechts neben Icon, beliebige Positionierung
+ WB_DETAILS // Text rechts neben Icon, eingeschraenkte Posit.
+ WB_BORDER
+ WB_NOHIDESELECTION // Selektion inaktiv zeichnen, wenn kein Fokus
+ WB_NOHSCROLL
+ WB_NOVSCROLL
+ WB_NOSELECTION
+ WB_SMART_ARRANGE // im Arrange die Vis-Area beibehalten
+ WB_ALIGN_TOP // Anordnung zeilenweise von links nach rechts
+ WB_ALIGN_LEFT // Anordnung spaltenweise von oben nach unten
+ WB_NODRAGSELECTION // Keine Selektion per Tracking-Rect
+ WB_NOCOLUMNHEADER // keine Headerbar in Detailsview (Headerbar not implemented)
+ WB_NOPOINTERFOCUS // Kein GrabFocus im MouseButtonDown
+ WB_HIGHLIGHTFRAME // der unter der Maus befindliche Eintrag wird hervorgehoben
+ WB_NOASYNCSELECTHDL // Selektionshandler synchron aufrufen, d.h. Events nicht sammeln
+*/
+
+#define WB_ICON WB_RECTSTYLE
+#define WB_SMALLICON WB_SMALLSTYLE
+#define WB_DETAILS WB_VCENTER
+#define WB_NOHSCROLL WB_SPIN
+#define WB_NOVSCROLL WB_DRAG
+#define WB_NOSELECTION WB_REPEAT
+#define WB_NODRAGSELECTION WB_PATHELLIPSIS
+#define WB_SMART_ARRANGE WB_PASSWORD
+#define WB_ALIGN_TOP WB_TOP
+#define WB_ALIGN_LEFT WB_LEFT
+#define WB_NOCOLUMNHEADER WB_CENTER
+#define WB_HIGHLIGHTFRAME WB_INFO
+#define WB_NOASYNCSELECTHDL WB_NOLABEL
+
+class MnemonicGenerator;
+
+class SVT_DLLPUBLIC SvtIconChoiceCtrl : public Control
+{
+ friend class SvxIconChoiceCtrl_Impl;
+
+ Link _aClickIconHdl;
+ Link _aDocRectChangedHdl;
+ Link _aVisRectChangedHdl;
+ KeyEvent* _pCurKeyEvent;
+ SvxIconChoiceCtrl_Impl* _pImp;
+ sal_Bool _bAutoFontColor;
+
+protected:
+
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual sal_Bool EditedEntry( SvxIconChoiceCtrlEntry*, const OUString& rNewText, sal_Bool bCancelled );
+ virtual void DocumentRectChanged();
+ virtual void VisibleRectChanged();
+ virtual sal_Bool EditingEntry( SvxIconChoiceCtrlEntry* pEntry );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Resize();
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void ClickIcon();
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void DrawEntryImage(
+ SvxIconChoiceCtrlEntry* pEntry,
+ const Point& rPos,
+ OutputDevice& rDev );
+
+ virtual String GetEntryText(
+ SvxIconChoiceCtrlEntry* pEntry,
+ sal_Bool bInplaceEdit );
+
+ virtual void FillLayoutData() const;
+
+ void CallImplEventListeners(sal_uLong nEvent, void* pData);
+
+public:
+
+ SvtIconChoiceCtrl( Window* pParent, WinBits nWinStyle = WB_ICON | WB_BORDER );
+ virtual ~SvtIconChoiceCtrl();
+
+ void SetStyle( WinBits nWinStyle );
+ WinBits GetStyle() const;
+
+ sal_Bool SetChoiceWithCursor ( sal_Bool bDo = sal_True );
+
+ void SetFont( const Font& rFont );
+ void SetPointFont( const Font& rFont );
+
+ void SetClickHdl( const Link& rLink ) { _aClickIconHdl = rLink; }
+ const Link& GetClickHdl() const { return _aClickIconHdl; }
+
+ using OutputDevice::SetBackground;
+ void SetBackground( const Wallpaper& rWallpaper );
+
+ void ArrangeIcons();
+
+
+ SvxIconChoiceCtrlEntry* InsertEntry( const String& rText,
+ const Image& rImage,
+ sal_uLong nPos = LIST_APPEND,
+ const Point* pPos = 0,
+ sal_uInt16 nFlags = 0
+ );
+
+ /** creates automatic mnemonics for all icon texts in the control
+ */
+ void CreateAutoMnemonics( void );
+
+ /** creates automatic mnemonics for all icon texts in the control
+
+ @param _rUsedMnemonics
+ a <type>MnemonicGenerator</type> at which some other mnemonics are already registered.
+ This can be used if the control needs to share the "mnemonic space" with other elements,
+ such as a menu bar.
+ */
+ void CreateAutoMnemonics( MnemonicGenerator& _rUsedMnemonics );
+
+ sal_Bool DoKeyInput( const KeyEvent& rKEvt );
+
+ sal_Bool IsEntryEditing() const;
+
+ sal_uLong GetEntryCount() const;
+ SvxIconChoiceCtrlEntry* GetEntry( sal_uLong nPos ) const;
+ sal_uLong GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const;
+ using Window::SetCursor;
+ void SetCursor( SvxIconChoiceCtrlEntry* pEntry );
+ SvxIconChoiceCtrlEntry* GetCursor() const;
+
+ // Neu-Berechnung gecachter View-Daten und Invalidierung im Fenster
+ void InvalidateEntry( SvxIconChoiceCtrlEntry* pEntry );
+
+ // bHit==sal_False: Eintrag gilt als getroffen, wenn Position im BoundRect liegt
+ // ==sal_True : Bitmap oder Text muss getroffen sein
+ SvxIconChoiceCtrlEntry* GetEntry( const Point& rPosPixel, sal_Bool bHit = sal_False ) const;
+
+ // in dem sal_uLong wird die Position in der Liste des gefunden Eintrags zurueckgegeben
+ SvxIconChoiceCtrlEntry* GetSelectedEntry( sal_uLong& rPos ) const;
+
+ void SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry* pEntry = 0 );
+
+ virtual sal_Bool HasBackground() const;
+ virtual sal_Bool HasFont() const;
+ virtual sal_Bool HasFontTextColor() const;
+ virtual sal_Bool HasFontFillColor() const;
+
+ void SetFontColorToBackground ( sal_Bool bDo = sal_True ) { _bAutoFontColor = bDo; }
+ sal_Bool AutoFontColor () { return _bAutoFontColor; }
+
+ Point GetPixelPos( const Point& rPosLogic ) const;
+ void SetSelectionMode( SelectionMode eMode );
+
+ Rectangle GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const;
+ Rectangle GetEntryCharacterBounds( const sal_Int32 _nEntryPos, const sal_Int32 _nCharacterIndex ) const;
+
+ void SetNoSelection();
+
+ // ACCESSIBILITY ==========================================================
+
+ /** Creates and returns the accessible object of the Box. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+};
+
+#endif // _ICNVW_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 000000000000..2c81cbf43d42
--- /dev/null
+++ b/include/svtools/javacontext.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 _SVTOOLS_JAVACONTEXT_HXX_
+#define _SVTOOLS_JAVACONTEXT_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <osl/mutex.hxx>
+
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#include <com/sun/star/uno/XCurrentContext.hpp>
+
+
+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 :
+ public com::sun::star::uno::XCurrentContext
+ {
+
+ public:
+ /** The parameter bShowErrorsOnce controls whether a message box is
+ only displayed once for a reocurring 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 com::sun::star::uno::Reference<
+ com::sun::star::uno::XCurrentContext> & ctx,
+ bool bReportErrorOnce = true );
+ virtual ~JavaContext();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
+ const ::com::sun::star::uno::Type& aType )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL acquire() throw ();
+
+ virtual void SAL_CALL release() throw ();
+
+ // XCurrentContext
+ virtual com::sun::star::uno::Any SAL_CALL getValueByName( const OUString& Name )
+ throw (com::sun::star::uno::RuntimeException);
+
+ private:
+ SVT_DLLPRIVATE JavaContext(); //not implemented
+ SVT_DLLPRIVATE JavaContext(JavaContext&); //not implemented
+ SVT_DLLPRIVATE JavaContext& operator = (JavaContext&); //not implemented
+
+ oslInterlockedCount m_aRefCount;
+
+ com::sun::star::uno::Reference<
+ com::sun::star::uno::XCurrentContext > m_xNextContext;
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionHandler> m_xHandler;
+ bool m_bShowErrorsOnce;
+ };
+}
+
+#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 000000000000..fed409f41ec5
--- /dev/null
+++ b/include/svtools/javainteractionhandler.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 _SVTOOLS_JAVAINTERACTION_HXX_
+#define _SVTOOLS_JAVAINTERACTION_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <osl/mutex.hxx>
+#include <sal/types.h>
+
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#include <svtools/javacontext.hxx>
+
+#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:
+ public com::sun::star::task::XInteractionHandler
+{
+public:
+ JavaInteractionHandler(bool bReportErrorOnce = true);
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
+ const ::com::sun::star::uno::Type& aType )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL acquire() throw();
+
+ virtual void SAL_CALL release() throw();
+
+ // XCurrentContext
+ virtual void SAL_CALL handle( const com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionRequest >& Request )
+ throw (com::sun::star::uno::RuntimeException);
+
+private:
+ oslInterlockedCount m_aRefCount;
+ SVT_DLLPRIVATE JavaInteractionHandler(JavaInteractionHandler const&); //not implemented
+ SVT_DLLPRIVATE JavaInteractionHandler& operator = (JavaInteractionHandler const &); //not implemented
+ SVT_DLLPRIVATE virtual ~JavaInteractionHandler();
+ bool m_bShowErrorsOnce;
+ bool m_bJavaDisabled_Handled;
+ bool m_bInvalidSettings_Handled;
+ bool m_bJavaNotFound_Handled;
+ bool m_bVMCreationFailure_Handled;
+ bool m_bRestartRequired_Handled;
+ sal_uInt16 m_nResult_JavaDisabled;
+};
+}
+
+#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 000000000000..1231e6b0e380
--- /dev/null
+++ b/include/svtools/langhelp.hxx
@@ -0,0 +1,30 @@
+/* -*- 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:
+ *
+ */
+
+#ifndef _SVTOOLS_LANGHELP_HXX_
+#define _SVTOOLS_LANGHELP_HXX_
+
+#include <svtools/svtdllapi.h>
+
+#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 );
+
+#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 000000000000..1ef5875d2948
--- /dev/null
+++ b/include/svtools/langtab.hxx
@@ -0,0 +1,57 @@
+/* -*- 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_LANGTAB_HXX_
+#define _SVTOOLS_LANGTAB_HXX_
+
+
+#include <tools/resary.hxx>
+#include <i18nlangtag/lang.h>
+#include <svtools/svtdllapi.h>
+
+//========================================================================
+// class SvtLanguageTable
+//========================================================================
+
+class SVT_DLLPUBLIC SvtLanguageTable : public ResStringArray
+{
+public:
+ SvtLanguageTable();
+ ~SvtLanguageTable();
+
+ /**
+ @param bUserInterfaceSelection
+ If TRUE, don't replace an UI-only locale. Only use for
+ Tools->Options->LanguageSettings->UserInterface listbox.
+ If FALSE, do replace.
+ */
+ const OUString GetString( const LanguageType eType, bool bUserInterfaceSelection = false ) const;
+ LanguageType GetType( const String& rStr ) const;
+
+ sal_uInt32 GetEntryCount() const;
+ LanguageType GetTypeAtIndex( sal_uInt32 nIndex ) const;
+ static String GetLanguageString( const LanguageType eType );
+};
+
+// Add LRE or RLE embedding characters to the string based on the
+// String content (see #i78466#, #i32179#)
+SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/localresaccess.hxx b/include/svtools/localresaccess.hxx
new file mode 100644
index 000000000000..8e80f9462cf2
--- /dev/null
+++ b/include/svtools/localresaccess.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 _SVTOOLS_LOCALRESACCESS_HXX_
+#define _SVTOOLS_LOCALRESACCESS_HXX_
+
+#include <tools/rc.hxx>
+#include <tools/rcid.h>
+#include <osl/diagnose.h>
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ //=========================================================================
+ //= OLocalResourceAccess
+ //=========================================================================
+ /** helper class for acessing local resources
+ */
+ class OLocalResourceAccess : public Resource
+ {
+ protected:
+ ResMgr* m_pManager;
+
+ public:
+ OLocalResourceAccess( const ResId& _rId )
+ :Resource( _rId.SetAutoRelease( sal_False ) )
+ ,m_pManager( _rId.GetResMgr() )
+ {
+ }
+
+ OLocalResourceAccess(const ResId& _rId, RESOURCE_TYPE _rType)
+ :Resource(_rId.SetRT(_rType).SetAutoRelease(sal_False))
+ ,m_pManager(_rId.GetResMgr())
+ {
+ OSL_ENSURE( m_pManager != NULL, "OLocalResourceAccess::OLocalResourceAccess: invalid resource manager!" );
+ }
+
+ ~OLocalResourceAccess()
+ {
+ if ( m_pManager )
+ m_pManager->Increment( m_pManager->GetRemainSize() );
+ FreeResource();
+ }
+
+ inline sal_Bool IsAvailableRes( const ResId& _rId ) const
+ {
+ return Resource::IsAvailableRes( _rId );
+ }
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // _SVTOOLS_LOCALRESACCESS_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/menuoptions.hxx b/include/svtools/menuoptions.hxx
new file mode 100644
index 000000000000..527319c52380
--- /dev/null
+++ b/include/svtools/menuoptions.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_MENUOPTIONS_HXX
+#define INCLUDED_SVTOOLS_MENUOPTIONS_HXX
+
+#include "svtools/svtdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <unotools/options.hxx>
+
+/*-************************************************************************************************************//**
+ @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 neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class Link;
+class SvtMenuOptions_Impl;
+
+/*-************************************************************************************************************//**
+ @short collect information about menu features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class SVT_DLLPUBLIC SAL_WARN_UNUSED SvtMenuOptions: public utl::detail::Options
+{
+ public:
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtMenuOptions();
+ virtual ~SvtMenuOptions();
+
+ void AddListenerLink( const Link& rLink );
+ void RemoveListenerLink( const Link& rLink );
+
+ /*-****************************************************************************************************//**
+ @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"
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsEntryHidingEnabled() const;
+ sal_Int16 GetMenuIconsState() const;
+ void SetMenuIconsState( sal_Int16 bState );
+
+ private:
+
+ /*-****************************************************************************************************//**
+ @short return a reference to a static mutex
+ @descr These class is partially threadsafe (for de-/initialization only).
+ All access methods are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SVT_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtMenuOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // 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 000000000000..85c5b604e689
--- /dev/null
+++ b/include/svtools/miscopt.hxx
@@ -0,0 +1,150 @@
+/* -*- 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 <osl/mutex.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+/*-************************************************************************************************************//**
+ @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 neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtMiscOptions_Impl;
+class Link;
+
+/*-************************************************************************************************************//**
+ @short collect information about misc group
+ @descr -
+
+ @implements -
+ @base -
+
+ @ATTENTION This class is partially threadsafe.
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class SVT_DLLPUBLIC SvtMiscOptions: public utl::detail::Options
+{
+ public:
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtMiscOptions();
+ virtual ~SvtMiscOptions();
+
+ void AddListenerLink( const Link& rLink );
+ void RemoveListenerLink( const Link& rLink );
+
+ sal_Bool UseSystemFileDialog() const;
+ void SetUseSystemFileDialog( sal_Bool bSet );
+ sal_Bool IsUseSystemFileDialogReadOnly() const;
+
+ sal_Bool DisableUICustomization() const;
+
+ sal_Bool IsPluginsEnabled() const;
+
+ sal_Int16 GetSymbolsSize() const;
+ void SetSymbolsSize( sal_Int16 eSet );
+ sal_Int16 GetCurrentSymbolsSize() const;
+ bool AreCurrentSymbolsLarge() const;
+
+ sal_Int16 GetSymbolsStyle() const;
+ void SetSymbolsStyle( sal_Int16 eSet );
+ sal_Int16 GetCurrentSymbolsStyle() const;
+
+ sal_Int16 GetToolboxStyle() const;
+ void SetToolboxStyle( sal_Int16 nStyle );
+
+ sal_Bool IsModifyByPrinting() const;
+ void SetModifyByPrinting(sal_Bool bSet );
+
+ sal_Bool UseSystemPrintDialog() const;
+ void SetUseSystemPrintDialog( sal_Bool bSet );
+
+ sal_Bool ShowLinkWarningDialog() const;
+ void SetShowLinkWarningDialog( sal_Bool bSet );
+ sal_Bool IsShowLinkWarningDialogReadOnly() const;
+
+ void SetSaveAlwaysAllowed( sal_Bool bSet );
+ sal_Bool IsSaveAlwaysAllowed() const;
+
+ void SetExperimentalMode( sal_Bool bSet );
+ sal_Bool IsExperimentalMode() const;
+
+ void SetMacroRecorderMode( sal_Bool bSet );
+ sal_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 are'nt safe!
+ We create a static mutex only for one ime and use at different times.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SVT_DLLPRIVATE static ::osl::Mutex& GetInitMutex();
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtMiscOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtMiscOptions
+
+#endif // #ifndef INCLUDED_SVTOOLS_MISCOPT_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 000000000000..f2d493be21de
--- /dev/null
+++ b/include/svtools/optionsdrawinglayer.hxx
@@ -0,0 +1,198 @@
+/* -*- 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 <osl/mutex.hxx>
+#include <rtl/ustring.hxx>
+#include <tools/color.hxx>
+
+//_________________________________________________________________________________________________________________
+// forward declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @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 neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*//*-*************************************************************************************************************/
+
+class SvtOptionsDrawinglayer_Impl;
+
+/*-************************************************************************************************************//**
+ @short collect information about startup features
+ @descr -
+
+ @implements -
+ @base -
+
+ @devstatus ready to use
+*//*-*************************************************************************************************************/
+
+class SVT_DLLPUBLIC SvtOptionsDrawinglayer
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------------------------------------------
+ // constructor / destructor
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @short standard constructor and destructor
+ @descr This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ @seealso member m_nRefCount
+ @seealso member m_pDataContainer
+
+ @param -
+ @return -
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+
+ SvtOptionsDrawinglayer();
+ ~SvtOptionsDrawinglayer();
+
+ //---------------------------------------------------------------------------------------------------------
+ // interface
+ //---------------------------------------------------------------------------------------------------------
+
+ /*-****************************************************************************************************//**
+ @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"
+ *//*-*****************************************************************************************************/
+
+ sal_Bool IsOverlayBuffer() const;
+ sal_Bool IsPaintBuffer() const;
+ Color GetStripeColorA() const;
+ Color GetStripeColorB() const;
+ sal_uInt16 GetStripeLength() const;
+
+ // #i73602#
+ sal_Bool IsOverlayBuffer_Calc() const;
+ sal_Bool IsOverlayBuffer_Writer() const;
+ sal_Bool IsOverlayBuffer_DrawImpress() const;
+
+ // #i74769#, #i75172#
+ sal_Bool IsPaintBuffer_Calc() const;
+ sal_Bool IsPaintBuffer_Writer() const;
+ sal_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 its disabled
+ // and OutDevSupport_TransparentRect is checked (this hits XRenderExtension, e.g.
+ // currently for SunRay as long as not supported there)
+ sal_Bool IsAAPossibleOnThisSystem() const;
+
+ // primitives
+ sal_Bool IsAntiAliasing() const;
+ sal_Bool IsSnapHorVerLinesToDiscrete() const;
+ sal_Bool IsSolidDragCreate() const;
+ sal_Bool IsRenderDecoratedTextDirect() const;
+ sal_Bool IsRenderSimpleTextDirect() const;
+ sal_uInt32 GetQuadratic3DRenderLimit() const;
+ sal_uInt32 GetQuadraticFormControlRenderLimit() const;
+
+ void SetAntiAliasing( sal_Bool bState );
+
+ // #i97672# selection settings
+ sal_Bool IsTransparentSelection() const;
+ sal_uInt16 GetTransparentSelectionPercent() const;
+ sal_uInt16 GetSelectionMaximumLuminancePercent() const;
+
+ void SetTransparentSelection( sal_Bool bState );
+ void SetTransparentSelectionPercent( sal_uInt16 nPercent );
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+
+ 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.
+
+ @seealso -
+
+ @param -
+ @return A reference to a static mutex member.
+
+ @onerror -
+ *//*-*****************************************************************************************************/
+ SVT_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
+
+ //-------------------------------------------------------------------------------------------------------------
+ // private member
+ //-------------------------------------------------------------------------------------------------------------
+
+ private:
+
+ /*Attention
+
+ Don't initialize these static member in these header!
+ a) Double dfined symbols will be detected ...
+ b) and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+
+ static SvtOptionsDrawinglayer_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; /// internal ref count mechanism
+
+}; // class SvtOptionsDrawinglayer
+
+#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 000000000000..9011dad9a266
--- /dev/null
+++ b/include/svtools/parhtml.hxx
@@ -0,0 +1,289 @@
+/* -*- 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 _PARHTML_HXX
+#define _PARHTML_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/solar.h>
+#include <tools/string.hxx>
+#include <svtools/svparser.hxx>
+
+#include <boost/ptr_container/ptr_vector.hpp>
+
+namespace com { namespace sun { namespace star {
+ namespace document {
+ class XDocumentProperties;
+ }
+} } }
+
+class Color;
+class SvNumberFormatter;
+class SvKeyValueIterator;
+
+#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 HTMLTableFrame { HTML_TF_VOID, HTML_TF_ABOVE, HTML_TF_BELOW,
+ HTML_TF_HSIDES, HTML_TF_LHS, HTML_TF_RHS, HTML_TF_VSIDES, HTML_TF_BOX };
+
+enum HTMLTableRules { HTML_TR_NONE, HTML_TR_GROUPS, HTML_TR_ROWS,
+ HTML_TR_COLS, HTML_TR_ALL };
+
+enum HTMLInputType
+{
+ HTML_IT_TEXT = 0x01,
+ HTML_IT_PASSWORD = 0x02,
+ HTML_IT_CHECKBOX = 0x03,
+ HTML_IT_RADIO = 0x04,
+ HTML_IT_RANGE = 0x05,
+ HTML_IT_SCRIBBLE = 0x06,
+ HTML_IT_FILE = 0x07,
+ HTML_IT_HIDDEN = 0x08,
+ HTML_IT_SUBMIT = 0x09,
+ HTML_IT_IMAGE = 0x0a,
+ HTML_IT_RESET = 0x0b,
+ HTML_IT_BUTTON = 0x0c
+};
+
+enum HTMLScriptLanguage
+{
+ HTML_SL_STARBASIC,
+ HTML_SL_JAVASCRIPT,
+ HTML_SL_UNKNOWN
+};
+
+struct HTMLOptionEnum
+{
+ const sal_Char *pName; // Wert einer HTML-Option
+ sal_uInt16 nValue; // und der dazugehoerige Wert eines Enums
+};
+
+// Repraesentation einer HTML-Option (=Atrribut in einem Start-Tag)
+// Die Werte der Optionen werden immer als String gespeichert.
+// Die Methoden GetNumber, ... duerfen nur aufgerufen werden, wenn
+// die Option auch numerisch, ... ist.
+
+class SVT_DLLPUBLIC HTMLOption
+{
+ String aValue; // der Wert der Option (immer als String)
+ String aToken; // der Name der Option als String
+ sal_uInt16 nToken; // und das entsprechende Token
+
+public:
+
+ HTMLOption( sal_uInt16 nTyp, const String& rToken, const String& rValue );
+
+ // der Name der Option ...
+ sal_uInt16 GetToken() const { return nToken; } // ... als Enum
+ const String& GetTokenString() const { return aToken; } // ... als String
+
+ // der Wert der Option ...
+ const String& GetString() const { return aValue; } // ... als String
+
+ sal_uInt32 GetNumber() const; // ... als Zahl
+ sal_Int32 GetSNumber() const; // ... als Zahl
+ void GetNumbers( std::vector<sal_uInt32> &rNumbers, // ... als Zahlen
+ bool bSpaceDelim=false ) const;
+ void GetColor( Color& ) const; // ... als Farbe
+
+ // ... als Enum pOptEnums ist ein HTMLOptionEnum-Array
+ sal_uInt16 GetEnum( const HTMLOptionEnum *pOptEnums,
+ sal_uInt16 nDflt=0 ) const;
+ bool GetEnum( sal_uInt16 &rEnum, const HTMLOptionEnum *pOptEnums ) const;
+
+ // ... und als ein par spezielle Enums
+ HTMLInputType GetInputType() const; // <INPUT TYPE=...>
+ HTMLTableFrame GetTableFrame() const; // <TABLE FRAME=...>
+ HTMLTableRules GetTableRules() const; // <TABLE RULES=...>
+ //SvxAdjust GetAdjust() const; // <P,TH,TD ALIGN=>
+};
+
+typedef ::boost::ptr_vector<HTMLOption> HTMLOptions;
+
+class SVT_DLLPUBLIC HTMLParser : public SvParser
+{
+private:
+ mutable HTMLOptions maOptions; // die Optionen des Start-Tags
+
+ bool bNewDoc : 1; // neues Doc lesen ?
+ bool bIsInHeader : 1; // scanne Header-Bereich
+ bool bIsInBody : 1; // scanne Body-Bereich
+ bool bReadListing : 1; // Lese Listings
+ bool bReadXMP : 1; // Lese XMP
+ bool bReadPRE : 1; // Lese preformatted Text
+ bool bReadTextArea : 1; // Lese TEXTAREA
+ bool bReadScript : 1; // Lesen von <SCRIPT>
+ bool bReadStyle : 1; // Lesen von <STYLE>
+ bool bEndTokenFound : 1; // </SCRIPT> oder </STYLE> gefunden
+
+ bool bPre_IgnoreNewPara : 1; // Flags fuers lesen von PRE-Absaetzen
+ bool bReadNextChar : 1; // true: NextChar nochmals lesen (JavaScript!)
+ bool bReadComment : 1; // true: NextChar nochmals lesen (JavaScript!)
+
+ sal_uInt32 nPre_LinePos; // Pos in der Line im PRE-Tag
+
+ String aEndToken;
+
+protected:
+ String sSaveToken; // das gelesene Tag als String
+
+ int ScanText( const sal_Unicode cBreak = 0U );
+
+ int _GetNextRawToken();
+
+ // scanne das naechste Token,
+ virtual int _GetNextToken();
+
+ virtual ~HTMLParser();
+
+ void FinishHeader( bool bBody ) { bIsInHeader = false; bIsInBody = bBody; }
+
+public:
+ HTMLParser( SvStream& rIn, bool bReadNewDoc = true );
+
+ virtual SvParserState CallParser(); // Aufruf des Parsers
+
+ bool IsNewDoc() const { return bNewDoc; }
+ bool IsInHeader() const { return bIsInHeader; }
+ bool IsInBody() const { return bIsInBody; }
+ bool IsValidSyntax() const { return true; }
+ 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; }
+
+ void SetReadNextChar() { bReadNextChar = true; }
+
+ // PRE-/LISTING oder XMP-Modus starten/beenden oder Tags entsprechend
+ // filtern
+ inline void StartPRE( bool bRestart=false );
+ void FinishPRE() { bReadPRE = false; }
+ int FilterPRE( int nToken );
+
+ inline void StartListing( bool bRestart=false );
+ void FinishListing() { bReadListing = false; }
+ int FilterListing( int nToken );
+
+ inline void StartXMP( bool bRestart=false );
+ void FinishXMP() { bReadXMP = false; }
+ int FilterXMP( int nToken );
+
+ void FinishTextArea() { bReadTextArea = false; }
+
+ // PRE-/LSITING- und XMP-Modus beenden
+ void FinishPREListingXMP() { bReadPRE = bReadListing = bReadXMP = false; }
+
+ // Das aktuelle Token dem aktuellen Modus (PRE, XMP, ...) entsprechend
+ // Filtern und die Flags setzen. Wird von Continue aufgerufen, bevor
+ // NextToken gerufen wird. Wer eigene Schleifen implementiert bzw.
+ // selbst NextToken aufruft, sollte diese Methode vorher rufen.
+ int FilterToken( int nToken );
+
+ // Scannen eines Scripts beenden (sollte nur unmittelbar nach dem
+ // Lesen eines <SCRIPT> aufgerufen werden
+ void EndScanScript() { bReadScript = false; }
+
+ void ReadRawData( const sal_Char *pEndToken ) { aEndToken.AssignAscii(pEndToken); }
+
+ // Token ohne \-Sequenzen
+ void UnescapeToken();
+
+ // Ermitteln der Optionen. pNoConvertToken ist das optionale Token
+ // einer Option, fuer die CR/LFs nicht aus dem Wert der Option
+ // geloescht werden.
+ const HTMLOptions& GetOptions( sal_uInt16 *pNoConvertToken=0 ) const;
+
+ // fuers asynchrone lesen aus dem SvStream
+ virtual void Continue( int nToken );
+
+
+protected:
+
+ static rtl_TextEncoding GetEncodingByMIME( const String& 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 ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties>&,
+ SvKeyValueIterator*,
+ const HTMLOptions&,
+ rtl_TextEncoding& rEnc );
+
+public:
+ /// overriding method must call this implementation!
+ virtual bool ParseMetaOptions( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties>&,
+ SvKeyValueIterator* );
+
+ // Ist der uebergebene 0-terminierte String (vermutlich) der Anfang
+ // eines HTML-Files? Er sollte mind. 80 Zeichen lang sein.
+ // Mit Ausnahme des Falls, dass SwitchToUCS2==false und
+ // SVPAR_CS_DONTKNOW uebergeben wird muss der String mit zwei(!)
+ // 0-Bytes an einer geraden(!) Position terminiert sein.
+ static bool IsHTMLFormat( const sal_Char* pHeader,
+ bool bSwitchToUCS2 = false,
+ rtl_TextEncoding eEnc=RTL_TEXTENCODING_DONTKNOW );
+
+ bool ParseScriptOptions( String& rLangString, const String&, HTMLScriptLanguage& rLang,
+ String& rSrc, String& rLibrary, String& rModule );
+
+ // Einen Kommentar um den Inhalt von <SCRIPT> oder <STYLE> entfernen
+ // Bei 'bFull' wird ggf. die gesammte Zeile hinter einem "<!--"
+ // entfernt (fuer JavaSript)
+ static void RemoveSGMLComment( String &rString, sal_Bool bFull );
+
+ static bool InternalImgToPrivateURL( String& rURL );
+ static rtl_TextEncoding GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPHeader );
+ bool SetEncodingByHTTPHeader( SvKeyValueIterator *pHTTPHeader );
+};
+
+inline void HTMLParser::StartPRE( bool bRestart )
+{
+ bReadPRE = true;
+ bPre_IgnoreNewPara = !bRestart;
+ nPre_LinePos = 0UL;
+}
+
+inline void HTMLParser::StartListing( bool bRestart )
+{
+ bReadListing = true;
+ bPre_IgnoreNewPara = !bRestart;
+ nPre_LinePos = 0UL;
+}
+
+inline void HTMLParser::StartXMP( bool bRestart )
+{
+ bReadXMP = true;
+ bPre_IgnoreNewPara = !bRestart;
+ nPre_LinePos = 0UL;
+}
+
+#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 000000000000..73e1bdd42c6a
--- /dev/null
+++ b/include/svtools/parrtf.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/.
+ *
+ * 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 _PARRTF_HXX
+#define _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 )
+ {}
+};
+
+typedef std::stack< RtfParserState_Impl > RtfParserStates_Impl;
+
+class SVT_DLLPUBLIC SvRTFParser : public SvParser
+{
+ RtfParserStates_Impl aParserStates;
+
+ int nOpenBrakets;
+ rtl_TextEncoding eCodeSet, eUNICodeSet;
+ sal_uInt8 nUCharOverread;
+
+private:
+ static short _inSkipGroup;
+
+protected:
+ sal_Unicode GetHexValue();
+ void ScanText( const sal_Unicode = 0 );
+ void SkipGroup();
+
+ // scanne das naechste Token,
+ virtual int _GetNextToken();
+
+ virtual void ReadUnknownData();
+ virtual void ReadBitmapData();
+ virtual void ReadOLEData();
+
+ virtual ~SvRTFParser();
+
+ rtl_TextEncoding GetCodeSet() const { return eCodeSet; }
+ void SetEncoding( rtl_TextEncoding eEnc );
+
+ rtl_TextEncoding GetUNICodeSet() const { return eUNICodeSet; }
+ void SetUNICodeSet( rtl_TextEncoding eSet ) { eUNICodeSet = eSet; }
+
+public:
+ SvRTFParser( SvStream& rIn, sal_uInt8 nStackSize = 3 );
+
+ virtual SvParserState CallParser(); // Aufruf des Parsers
+
+ int GetOpenBrakets() const { return nOpenBrakets; }
+
+ // fuers asynchrone lesen aus dem SvStream
+// virtual void SaveState( int nToken );
+// virtual void RestoreState();
+ virtual void Continue( int nToken );
+};
+
+#endif //_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 000000000000..f6ca8cd7f7b0
--- /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 __SVTOOLS_PLACE_HXX__
+#define __SVTOOLS_PLACE_HXX__
+
+#include <tools/urlobj.hxx>
+
+class Place
+{
+private:
+ OUString msName;
+ INetURLObject maUrl;
+
+ bool mbEditable;
+
+public:
+
+ Place( OUString sName, 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( ) { return maUrl.GetMainURL( INetURLObject::NO_DECODE ); }
+ INetURLObject& GetUrlObject( ) { return maUrl; }
+ bool IsLocal( ) { return maUrl.GetProtocol() == INET_PROT_FILE; }
+ bool IsEditable( ) { return mbEditable; }
+};
+
+#endif // __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 000000000000..daddbed7e9fd
--- /dev/null
+++ b/include/svtools/popupmenucontrollerbase.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 __SVTOOLS_POPUPMENUCONTROLLERBASE_HXX_
+#define __SVTOOLS_POPUPMENUCONTROLLERBASE_HXX_
+
+#include "svtools/svtdllapi.h"
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/frame/XFrame.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 <com/sun/star/uri/XUriReferenceFactory.hpp>
+#include <com/sun/star/uri/XUriReference.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+
+#include <toolkit/awt/vclxmenu.hxx>
+#include <cppuhelper/compbase7.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <cppuhelper/weak.hxx>
+#include <rtl/ustring.hxx>
+
+namespace svt
+{
+ struct PopupMenuControllerBaseDispatchInfo;
+
+ typedef ::cppu::WeakComponentImplHelper7<
+ com::sun::star::lang::XServiceInfo ,
+ com::sun::star::frame::XPopupMenuController ,
+ com::sun::star::lang::XInitialization ,
+ com::sun::star::frame::XStatusListener ,
+ com::sun::star::awt::XMenuListener ,
+ com::sun::star::frame::XDispatchProvider ,
+ com::sun::star::frame::XDispatch > PopupMenuControllerBaseType;
+
+ class SVT_DLLPUBLIC PopupMenuControllerBase : protected ::comphelper::OBaseMutex, // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public PopupMenuControllerBaseType
+ {
+ public:
+ PopupMenuControllerBase( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
+ virtual ~PopupMenuControllerBase();
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException) = 0;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException) = 0;
+
+ // XPopupMenuController
+ virtual void SAL_CALL setPopupMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >& PopupMenu ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updatePopupMenu() throw (::com::sun::star::uno::RuntimeException);
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ // XMenuListener
+ virtual void SAL_CALL highlight( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL select( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL activate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL deactivate( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XDispatchProvider
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL, const OUString& sTarget, sal_Int32 nFlags ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches( const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& lDescriptor ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XDispatch
+ virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& seqProperties ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL addStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& xControl, const ::com::sun::star::util::URL& aURL ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL removeStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& xControl, const ::com::sun::star::util::URL& aURL ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ void dispatchCommand( const OUString& sCommandURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs );
+
+ protected:
+ void throwIfDisposed() throw ( ::com::sun::star::uno::RuntimeException );
+
+ /** helper method to cause statusChanged is called once for the given command url */
+ void SAL_CALL updateCommand( const OUString& rCommandURL );
+
+ /** this function is called upon disposing the component
+ */
+ virtual void SAL_CALL disposing();
+
+ virtual void resetPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu );
+ virtual void impl_setPopupMenu();
+ virtual void impl_select(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aURL);
+ OUString determineBaseURL( const OUString& aURL );
+
+ DECL_STATIC_LINK( PopupMenuControllerBase, ExecuteHdl_Impl, PopupMenuControllerBaseDispatchInfo* );
+
+
+ bool m_bInitialized;
+ OUString m_aCommandURL;
+ OUString m_aBaseURL;
+ OUString m_aModuleName;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > m_xDispatch;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu > m_xPopupMenu;
+ };
+}
+
+#endif // __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 000000000000..ec2719cebd5c
--- /dev/null
+++ b/include/svtools/popupwindowcontroller.hxx
@@ -0,0 +1,79 @@
+/* -*- 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_POPUPWINDOWCONTROLLER_HXX_
+#define __SVTOOLS_POPUPWINDOWCONTROLLER_HXX_
+
+#include "svtools/svtdllapi.h"
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+#include "svtools/toolboxcontroller.hxx"
+#include "boost/scoped_ptr.hpp"
+
+class Window;
+
+namespace svt
+{
+class PopupWindowControllerImpl;
+
+class SVT_DLLPUBLIC PopupWindowController : public svt::ToolboxController, public ::com::sun::star::lang::XServiceInfo
+{
+public:
+ PopupWindowController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
+ const OUString& aCommandURL );
+ ~PopupWindowController();
+
+ virtual ::Window* createPopupWindow( ::Window* pParent ) = 0;
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) = 0;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& Parent ) throw (::com::sun::star::uno::RuntimeException);
+private:
+ boost::scoped_ptr< PopupWindowControllerImpl > mpImpl;
+};
+
+} // namespace svt
+
+#endif // __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 000000000000..e3e70e7750e6
--- /dev/null
+++ b/include/svtools/printoptions.hxx
@@ -0,0 +1,120 @@
+/* -*- 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 "svtools/svtdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+class SvtPrintOptions_Impl;
+
+// -----------------------
+// - SvtBasePrintOptions -
+// -----------------------
+
+class PrinterOptions;
+
+class SVT_DLLPUBLIC SvtBasePrintOptions: public utl::detail::Options
+{
+protected:
+
+ SvtPrintOptions_Impl* m_pDataContainer;
+
+ void SetDataContainer( SvtPrintOptions_Impl* pDataContainer ) { m_pDataContainer = pDataContainer; }
+
+public:
+
+ static ::osl::Mutex& GetOwnStaticMutex();
+
+public:
+
+ SvtBasePrintOptions();
+ virtual ~SvtBasePrintOptions();
+
+ sal_Bool IsReduceTransparency() const;
+ sal_Int16 GetReducedTransparencyMode() const;
+ sal_Bool IsReduceGradients() const;
+ sal_Int16 GetReducedGradientMode() const;
+ sal_Int16 GetReducedGradientStepCount() const;
+ sal_Bool IsReduceBitmaps() const;
+ sal_Int16 GetReducedBitmapMode() const;
+ sal_Int16 GetReducedBitmapResolution() const;
+ sal_Bool IsReducedBitmapIncludesTransparency() const;
+ sal_Bool IsConvertToGreyscales() const;
+ sal_Bool IsPDFAsStandardPrintJobFormat() const;
+
+ void SetReduceTransparency( sal_Bool bState );
+ void SetReducedTransparencyMode( sal_Int16 nMode );
+ void SetReduceGradients( sal_Bool bState );
+ void SetReducedGradientMode( sal_Int16 nMode );
+ void SetReducedGradientStepCount( sal_Int16 nStepCount );
+ void SetReduceBitmaps( sal_Bool bState );
+ void SetReducedBitmapMode( sal_Int16 bState );
+ void SetReducedBitmapResolution( sal_Int16 nResolution );
+ void SetReducedBitmapIncludesTransparency( sal_Bool bState );
+ void SetConvertToGreyscales( sal_Bool bState );
+ void SetPDFAsStandardPrintJobFormat( sal_Bool bState );
+
+public:
+
+ void GetPrinterOptions( PrinterOptions& rOptions ) const;
+ void SetPrinterOptions( const PrinterOptions& rOptions );
+};
+
+// ---------------------
+// - SvtPrinterOptions -
+// ---------------------
+
+class SVT_DLLPUBLIC SvtPrinterOptions : public SvtBasePrintOptions
+{
+private:
+
+ static SvtPrintOptions_Impl* m_pStaticDataContainer; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount; /// internal ref count mechanism
+
+public:
+
+ SvtPrinterOptions();
+ virtual ~SvtPrinterOptions();
+};
+
+// -----------------------
+// - SvtPrintFileOptions -
+// -----------------------
+
+class SVT_DLLPUBLIC SvtPrintFileOptions : public SvtBasePrintOptions
+{
+private:
+
+ static SvtPrintOptions_Impl* m_pStaticDataContainer; /// impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount; /// internal ref count mechanism
+
+public:
+
+ SvtPrintFileOptions();
+ virtual ~SvtPrintFileOptions();
+};
+
+#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 000000000000..9999fdb8846b
--- /dev/null
+++ b/include/svtools/prnsetup.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 _SV_PRNSETUP_HXX_
+#define _SV_PRNSETUP_HXX_
+
+#include "svtools/svtdllapi.h"
+
+#include <vcl/dialog.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/button.hxx>
+#include <vcl/group.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/timer.hxx>
+#include <svtools/stdctrl.hxx>
+
+class Printer;
+class QueueInfo;
+
+// ----------------------
+// - PrinterSetupDialog -
+// ----------------------
+
+class SVT_DLLPUBLIC PrinterSetupDialog : public ModalDialog
+{
+private:
+ ListBox* m_pLbName;
+ PushButton* m_pBtnProperties;
+ PushButton* m_pBtnOptions;
+ FixedText* m_pFiStatus;
+ FixedText* m_pFiType;
+ FixedText* m_pFiLocation;
+ FixedText* m_pFiComment;
+ AutoTimer maStatusTimer;
+ Printer* mpPrinter;
+ Printer* mpTempPrinter;
+
+ SVT_DLLPRIVATE void ImplSetInfo();
+
+ DECL_DLLPRIVATE_LINK( ImplPropertiesHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplOptionsHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplChangePrinterHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplStatusHdl, void* );
+
+public:
+ PrinterSetupDialog( Window* pWindow );
+ ~PrinterSetupDialog();
+
+ void SetPrinter( Printer* pNewPrinter ) { mpPrinter = pNewPrinter; }
+ Printer* GetPrinter() const { return mpPrinter; }
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ virtual short Execute();
+
+ void SetOptionsHdl( const Link& rLink );
+};
+
+// --------------------------------------
+// - Hilfsfunktionen fuer Print-Dialoge -
+// --------------------------------------
+
+#define IMPL_PRINTDLG_STATUS_UPDATE 15000
+
+void ImplFillPrnDlgListBox( const Printer* pPrinter,
+ ListBox* pBox, PushButton* pPropBtn );
+void ImplFreePrnDlgListBox( ListBox* pBox, sal_Bool bClear = sal_True );
+Printer* ImplPrnDlgListBoxSelect( ListBox* pBox, PushButton* pPropBtn,
+ Printer* pPrinter, Printer* pTempPrinter );
+Printer* ImplPrnDlgUpdatePrinter( Printer* pPrinter, Printer* pTempPrinter );
+void ImplPrnDlgUpdateQueueInfo( ListBox* pBox, QueueInfo& rInfo );
+XubString ImplPrnDlgGetStatusText( const QueueInfo& rInfo );
+
+#endif // _SV_PRNSETUP_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 000000000000..993b0998aa0b
--- /dev/null
+++ b/include/svtools/restartdialog.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_RESTARTDIALOG_HXX
+#define INCLUDED_SVTOOLS_RESTARTDIALOG_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "svtools/svtdllapi.h"
+
+class Window;
+namespace com { namespace sun { namespace star { namespace uno {
+ class XComponentContext;
+} } } }
+
+namespace svtools {
+
+enum RestartReason {
+ RESTART_REASON_JAVA,
+ // "For the selected Java runtime environment to work properly,
+ // %PRODUCTNAME must be restarted."
+ RESTART_REASON_PDF_AS_STANDARD_JOB_FORMAT,
+ // For the modified default print job format to take effect,
+ // %PRODUCTNAME must be restarted.
+ RESTART_REASON_BIBLIOGRAPHY_INSTALL
+ // "For the bibliography to work properly,
+ // %PRODUCTNAME must be restarted."
+};
+
+// Must be called with the solar mutex locked:
+SVT_DLLPUBLIC void executeRestartDialog(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context,
+ Window * parent, RestartReason reason);
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/roadmap.hxx b/include/svtools/roadmap.hxx
new file mode 100644
index 000000000000..d36a1a3165bb
--- /dev/null
+++ b/include/svtools/roadmap.hxx
@@ -0,0 +1,123 @@
+/* -*- 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_ROADMAP_HXX
+#define _SVTOOLS_ROADMAP_HXX
+
+#include "svtools/svtdllapi.h"
+#include <vcl/ctrl.hxx>
+#include <vcl/imgctrl.hxx>
+
+#include "svtools/hyperlabel.hxx"
+
+
+
+
+class Bitmap;
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ struct RoadmapTypes
+ {
+ public:
+ typedef sal_Int16 ItemId;
+ typedef sal_Int32 ItemIndex;
+ };
+
+ class RoadmapImpl;
+ class RoadmapItem;
+
+ //=====================================================================
+ //= Roadmap
+ //=====================================================================
+ class SVT_DLLPUBLIC ORoadmap : public Control, public RoadmapTypes
+ {
+ protected:
+ RoadmapImpl* m_pImpl;
+ // Window overridables
+ void Paint( const Rectangle& _rRect );
+ void implInit();
+
+ public:
+ ORoadmap( Window* _pParent, WinBits _nWinStyle = 0 );
+ ~ORoadmap( );
+
+ void SetRoadmapBitmap( const BitmapEx& maBitmap, sal_Bool _bInvalidate = sal_True );
+
+ void EnableRoadmapItem( ItemId _nItemId, sal_Bool _bEnable, ItemIndex _nStartIndex = 0 );
+
+ void ChangeRoadmapItemLabel( ItemId _nID, const OUString& sLabel, ItemIndex _nStartIndex = 0 );
+ void ChangeRoadmapItemID( ItemId _nID, ItemId _NewID, ItemIndex _nStartIndex = 0 );
+
+ void SetRoadmapInteractive( sal_Bool _bInteractive );
+ sal_Bool IsRoadmapInteractive();
+
+ void SetRoadmapComplete( sal_Bool _bComplete );
+ sal_Bool IsRoadmapComplete() const;
+
+ ItemIndex GetItemCount() const;
+ ItemId GetItemID( ItemIndex _nIndex ) const;
+
+ void InsertRoadmapItem( ItemIndex _Index, const OUString& _RoadmapItem, ItemId _nUniqueId, sal_Bool _bEnabled = sal_True );
+ void ReplaceRoadmapItem( ItemIndex _Index, const OUString& _RoadmapItem, ItemId _nUniqueId, sal_Bool _bEnabled );
+ void DeleteRoadmapItem( ItemIndex _nIndex );
+
+ ItemId GetCurrentRoadmapItemID() const;
+ sal_Bool SelectRoadmapItemByID( ItemId _nItemID );
+
+ void SetItemSelectHdl( const Link& _rHdl );
+ Link GetItemSelectHdl( ) const;
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void GetFocus();
+
+
+ protected:
+ long PreNotify( NotifyEvent& rNEvt );
+
+ protected:
+ /// called when an item has been selected by any means
+ virtual void Select();
+
+ private:
+ DECL_LINK(ImplClickHdl, HyperLabel*);
+
+ RoadmapItem* GetByIndex( ItemIndex _nItemIndex );
+ const RoadmapItem* GetByIndex( ItemIndex _nItemIndex ) const;
+
+ RoadmapItem* GetByID( ItemId _nID, ItemIndex _nStartIndex = 0 );
+ const RoadmapItem* GetByID( ItemId _nID, ItemIndex _nStartIndex = 0 ) const;
+ RoadmapItem* GetPreviousHyperLabel( ItemIndex _Index);
+
+ void DrawHeadline();
+ void DeselectOldRoadmapItems();
+ ItemId GetNextAvailableItemId( ItemIndex _NewIndex );
+ ItemId GetPreviousAvailableItemId( ItemIndex _NewIndex );
+ RoadmapItem* GetByPointer(Window* pWindow);
+ RoadmapItem* InsertHyperLabel( ItemIndex _Index, const OUString& _aStr, ItemId _RMID, sal_Bool _bEnabled = sal_True );
+ void UpdatefollowingHyperLabels( ItemIndex _Index );
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/roadmapwizard.hxx b/include/svtools/roadmapwizard.hxx
new file mode 100644
index 000000000000..aae7ebfc5d7b
--- /dev/null
+++ b/include/svtools/roadmapwizard.hxx
@@ -0,0 +1,246 @@
+/* -*- 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_INC_ROADMAPWIZARD_HXX
+#define SVTOOLS_INC_ROADMAPWIZARD_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/wizardmachine.hxx>
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ struct RoadmapWizardImpl;
+ class RoadmapWizard;
+
+ struct RoadmapWizardTypes
+ {
+ public:
+ typedef sal_Int16 PathId;
+ typedef ::std::vector< WizardTypes::WizardState > WizardPath;
+ typedef TabPage* (* RoadmapPageFactory)( RoadmapWizard& );
+ };
+
+ //====================================================================
+ //= RoadmapWizard
+ //====================================================================
+ /** is - no, not a wizard for a raodmap, but the base class for wizards
+ <em>supporting</em> a roadmap.
+
+ The basic new concept introduced is a <em>path</em>:<br/>
+ A <em>path</em> is a sequence of states, which are to be executed in a linear order.
+ Elements in the path can be skipped, depending on choices the user makes.
+
+ In the most simple wizards, you will have only one path consisting of <code>n</code> elements,
+ which are to be visited successively.
+
+ In a slightly more complex wizard, you will have one linear path, were certain
+ steps might be skipped due to user input. For instance, the user may decide to not specify
+ certain aspects of the to-be-created object (e.g. by unchecking a check box),
+ and the wizard then will simply disable the step which corresponds to this step.
+
+ In a yet more advanced wizards, you will have several paths of length <code>n1</code> and
+ <code>n2</code>, which share at least the first <code>k</code> states (where <code>k</code>
+ is at least 1), and an arbitrary number of other states.
+ */
+ class SVT_DLLPUBLIC RoadmapWizard : public OWizardMachine, public RoadmapWizardTypes
+ {
+ private:
+ RoadmapWizardImpl* m_pImpl;
+
+ public:
+ RoadmapWizard(
+ Window* _pParent,
+ const ResId& _rRes,
+ sal_uInt32 _nButtonFlags = WZB_NEXT | WZB_PREVIOUS | WZB_FINISH | WZB_CANCEL | WZB_HELP
+ );
+ RoadmapWizard(
+ Window* _pParent,
+ const WinBits i_nStyle,
+ sal_uInt32 _nButtonFlags = WZB_NEXT | WZB_PREVIOUS | WZB_FINISH | WZB_CANCEL | WZB_HELP
+ );
+ ~RoadmapWizard( );
+
+ void SetRoadmapHelpId( const OString& _rId );
+
+ void SetRoadmapInteractive( sal_Bool _bInteractive );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
+
+ // returns whether a given state is enabled
+ bool isStateEnabled( WizardState _nState ) const;
+
+ // WizardDialog overridables
+ virtual bool canAdvance() const;
+ virtual void updateTravelUI();
+
+protected:
+ /** declares a valid path in the wizard
+
+ The very first path which is declared is automatically activated.
+
+ Note that all paths which are declared must have the very first state in
+ common. Also note that due to a restriction of the very base class (<type>WizardDialog</type>),
+ this common first state must be 0.
+
+ You cannot declare new paths once the wizard started, so it's recommended that
+ you do all declarations within your derivee's constructor.
+
+ @see activatePath
+
+ @param _nId
+ the unique id you wish to give this path. This id can later on be used
+ to refer to the path which you just declared
+
+ @param _nFirstState
+ the first state in this path. Must not be WZS_INVALID_STATE.<br/>
+ Declare an arbitrary number of states after this one, and terminate the sequence
+ with a WZS_INVALID_STATE.
+ */
+ void declarePath( PathId _nPathId, WizardState _nFirstState, ... );
+ void declarePath( PathId _nPathId, const WizardPath& _lWizardStates);
+
+ /** provides basic information about a state
+
+ The given display name is used in the default implementation of getStateDisplayName,
+ and the given factory is used in the default implementation of createPage.
+ */
+ void describeState( WizardState _nState, const String& _rStateDisplayName, RoadmapPageFactory _pPageFactory );
+
+ /** activates a path which has previously been declared with <member>declarePath</member>
+
+ You can only activate paths which share the first <code>k</code> states with the path
+ which is previously active (if any), where <code>k</code> is the index of the
+ current state within the current path.
+
+ <example>
+ Say you have paths, <code>(0,1,2,5)</code> and <code>(0,1,4,5)</code>. This means that after
+ step <code>1</code>, you either continue with state <code>2</code> or state <code>4</code>,
+ and after this, you finish in state <code>5</code>.<br/>
+ Now if the first path is active, and your current state is <code>1</code>, then you can
+ easily switch to the second path, since both paths start with <code>(0,1)</code>.<br/>
+ However, if your current state is <code>2</code>, then you can not switch to the second
+ path anymore.
+ </example>
+
+ @param _nPathId
+ the id of the path. The path must have been declared (under this id) with
+ <member>declarePath</member> before it can be activated.
+
+ @param _bDecideForIt
+ If <TRUE/>, the path will be completely activated, even if it is a conflicting path
+ (i.e. there is another path which shares the first <code>k</code> states with
+ the to-be-activated path.)<br/>
+ If <FALSE/>, then the new path is checked for conflicts with other paths. If such
+ conflicts exists, the path is not completely activated, but only up to the point
+ where it does <em>not</em> conflict.<br/>
+ With the paths in the example above, if you activate the second path (when both are
+ already declared), then only steps <code>0</code> and <code>1</code> are activated,
+ since they are common to both paths.
+ */
+ void activatePath( PathId _nPathId, bool _bDecideForIt = false );
+
+ /** determine the next state to travel from the given one
+
+ This method (which is declared in <type>OWizardMachine</type> and overwritten here)
+ ensures that traveling happens along the active path.
+
+ @see activatePath
+ */
+ virtual WizardState determineNextState( WizardState _nCurrentState ) const;
+
+ /** en- or disables a state
+
+ In the wizard's roadmap, states to travel to can be freely chosen. To prevent
+ users from selecting a state which is currently not available, you can declare this
+ state as being disabled.
+
+ A situation where you need this may be when you have a checkbox which, when checked
+ by the user, enables a page with additional settings. As long as this checkbox is
+ not checked, the respective state would be disabled.
+
+ Note that in theory, you can declare multiple paths, instead of disabling states.
+ For instance, if you have a path where one state can be potentially disabled, then
+ you could declare a second path, which does not contain this state. However, the
+ disadvantage is that then, not the complete path would be visible in the roadmap,
+ but only all steps up to the point where the both paths diverge.<br/>
+ Another disadvantage is that the number of needed paths grows exponentially with
+ the number of states which can be potentially disabled.
+
+ @see declarePath
+ */
+ void enableState( WizardState _nState, bool _bEnable = true );
+
+ /** returns true if and only if the given state is known in at least one declared path
+ */
+ bool knowsState( WizardState _nState ) const;
+
+ // OWizardMachine overriables
+ virtual void enterState( WizardState _nState );
+
+ /** returns a human readable name for a given state
+
+ There is a default implementation for this method, which returns the display name
+ as given in a call to describeState. If there is no description for the given state,
+ this is worth an assertion in a non-product build, and then an empty string is
+ returned.
+ */
+ virtual String getStateDisplayName( WizardState _nState ) const;
+
+ /** creates a page for a given state
+
+ This member is inherited from OWizardMachine, and default-implemented in this class
+ for all states which have been described using describeState.
+ */
+ virtual TabPage* createPage( WizardState _nState );
+
+ /** asks for a new label of the wizard page
+
+ */
+ void updateRoadmapItemLabel( WizardState _nState );
+
+ protected:
+#ifdef DBG_UTIL
+ const sal_Char* checkInvariants() const;
+ friend const char* CheckInvariants( const void* pVoid );
+#endif
+
+ private:
+ SVT_DLLPRIVATE void ResizeFixedLine();
+
+ DECL_DLLPRIVATE_LINK( OnRoadmapItemSelected, void* );
+
+ /** updates the roadmap control to show the given path, as far as possible
+ (modulo conflicts with other paths)
+ */
+ SVT_DLLPRIVATE void implUpdateRoadmap( );
+
+ private:
+ SVT_DLLPRIVATE void impl_construct();
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // OOO_SVTOOLS_INC_ROADMAPWIZARD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/rtfkeywd.hxx b/include/svtools/rtfkeywd.hxx
new file mode 100644
index 000000000000..cf4e908a696c
--- /dev/null
+++ b/include/svtools/rtfkeywd.hxx
@@ -0,0 +1,1212 @@
+/* -*- 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 _RTFKEYWD_HXX
+#define _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_BRDRDASHSM "\\brdrdashsm"
+#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_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_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_BRDRDASH "\\brdrdash"
+#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_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"
+
+// neue Tokens zur 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_SP "\\sp"
+#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_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 spezifische Attribute
+#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"
+
+// Attribute fuer die freifliegenden Rahmen
+#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"
+
+#endif // _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 000000000000..9910d8e8115d
--- /dev/null
+++ b/include/svtools/rtfout.hxx
@@ -0,0 +1,58 @@
+/* -*- 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 _RTFOUT_HXX
+#define _RTFOUT_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/solar.h>
+
+#include <rtl/textenc.h>
+
+class String;
+class SvStream;
+
+class SVT_DLLPUBLIC RTFOutFuncs
+{
+public:
+#if defined(UNX)
+ static const sal_Char sNewLine; // nur \012 oder \015
+#else
+ static const sal_Char sNewLine[]; // \015\012
+#endif
+
+ static SvStream& Out_Char( SvStream&, sal_Unicode cChar,
+ int *pUCMode,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ sal_Bool bWriteHelpFile = sal_False );
+ static SvStream& Out_String( SvStream&, const String&,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ sal_Bool bWriteHelpFile = sal_False );
+ static SvStream& Out_Fontname( SvStream&, const String&,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ sal_Bool bWriteHelpFile = sal_False );
+
+ static SvStream& Out_Hex( SvStream&, sal_uLong nHex, sal_uInt8 nLen );
+};
+
+
+#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 000000000000..9a1e3dff167c
--- /dev/null
+++ b/include/svtools/rtftoken.h
@@ -0,0 +1,1265 @@
+/* -*- 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 _RTFTOKEN_H
+#define _RTFTOKEN_H
+
+class String;
+
+// suche die TokenID zu dem Token
+int GetRTFToken( const String& 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,
+
+ // !!! kann hinein verodert werden (Border/Background) !!!!
+ RTF_TABLEDEF = 0x1000,
+
+ // !!! kann hinein verodert werden (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, // Felder
+ 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_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 // _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 000000000000..a06109bca6a0
--- /dev/null
+++ b/include/svtools/ruler.hxx
@@ -0,0 +1,802 @@
+/* -*- 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 _RULER_HXX
+#define _RULER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/link.hxx>
+#include <vcl/window.hxx>
+#include <vcl/virdev.hxx>
+#include <vcl/field.hxx>
+
+class MouseEvent;
+class TrackingEvent;
+class DataChangedEvent;
+
+/*************************************************************************
+
+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:
+
+ FUNIT_MM
+ FUNIT_CM (Default)
+ FUNIT_M
+ FUNIT_KM
+ FUNIT_INCH
+ FUNIT_FOOT
+ FUNIT_MILE
+ FUNIT_POINT
+ FUNIT_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:
+ RULER_BORDER_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.
+ RULER_BORDER_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).
+ RULER_BORDER_VARIABLE
+ Not all of the column spacings are equal
+ RULER_BORDER_TABLE
+ Table border. Whenever this style ist set, the column
+ width must be 0.
+ RULER_BORDER_SNAP
+ Auxiliary line. Whenever this style is set, the
+ column width must be 0.
+ RULER_BORDER_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:
+ RULER_INDENT_TOP (indent of the first line)
+ RULER_INDENT_BOTTOM (left/right indent)
+ RULER_INDENT_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.
+ RULER_TYPE_MARGIN1
+ RULER_TYPE_MARGIN2
+ RULER_TYPE_BORDER
+ RULER_TYPE_INDENT
+ RULER_TYPE_TAB
+
+ - GetDragPos()
+ Returns the pixel position to which the user has moved the mouse
+ relative to the set zero-offset.
+
+ - GetDragAryPos()
+ Liefert den Index im Array zurueck, wenn ein Border, Indent oder ein
+ Tab gedragt wird. Achtung: Es wird die Array-Position waehrend des
+ gesammten Drag-Vorgangs von dem Item im Array was vor dem Drag gesetzt
+ war zurueckgeben. Dadurch ist es zum Beispiel auch moeglich, einen
+ Tab nicht mehr anzuzeigen, wenn die Maus nach unten/rechts aus dem
+ Lineal gezogen wird.
+
+ - GetDragSize()
+ Wenn Borders gedragt werden, kann hierueber abgefragt werden, ob
+ die Groesse bzw. welche Seite oder die Position geaendert werden soll.
+ RULER_DRAGSIZE_MOVE oder 0 - Move
+ RULER_DRAGSIZE_1 - Linke/obere Kante
+ RULER_DRAGSIZE_2 - Rechte/untere Kante
+
+ - IsDragDelete()
+ Mit dieser Methode kann abgefragt werden, ob beim Draggen die
+ Maus unten/rechts aus dem Fenster gezogen wurde. Damit kann
+ zum Beispiel festgestellt werden, ob der Benutzer einen Tab
+ loeschen will.
+
+ - IsDragCanceled()
+ Mit dieser Methode kann im EndDrag-Handler abgefragt werden,
+ ob die Aktion abgebrochen wurde, indem der Anwender die
+ Maus oben/links vom Fenster losgelassen hat oder ESC gedrueckt
+ hat. In diesem Fall werden die Werte nicht uebernommen. Wird
+ waehrend des Draggings die Maus oben/links aus dem Fenster
+ gezogen, werden automatisch die alten Werte dargestellt, ohne das
+ der Drag-Handler gerufen wird.
+ Falls der Benutzer jedoch den Wert auf die alte Position
+ zurueckgeschoben hat, liefert die Methode trotzdem sal_False. Falls
+ dies vermieden werden soll, muss sich die Applikation im StartDrag-
+ Handler den alten Wert merken und im EndDrag-Handler den Wert
+ vergleichen.
+
+ - GetDragScroll()
+ Mit dieser Methode kann abgefragt werden, ob gescrollt werden
+ soll. Es wird einer der folgenden Werte zurueckgegeben:
+ RULER_SCROLL_NO - Drag-Position befindet sich
+ an keinem Rand und somit
+ muss nicht gescrollt werden.
+ RULER_SCROLL_1 - Drag-Position befindet sich
+ am linken/oberen Rand und
+ somit sollte das Programm evt.
+ ein Srcoll ausloesen.
+ RULER_SCROLL_2 - Drag-Position befindet sich
+ am rechten/unteren Rand und
+ somit sollte das Programm evt.
+ ein Srcoll ausloesen.
+
+ - GetDragModifier()
+ Liefert die Modifier-Tasten zurueck, die beim Starten des Drag-
+ Vorgangs gedrueckt waren. Siehe MouseEvent.
+
+ - GetClickPos()
+ Liefert die Pixel-Position bezogen auf den eingestellten Null-Offset
+ zurueck, wo der Anwender die Maus gedrueckt hat.
+
+ - GetClickType()
+ Liefert zurueck, was per DoubleClick betaetigt wird:
+ RULER_TYPE_DONTKNOW (kein Element im Linealbereich)
+ RULER_TYPE_OUTSIDE (ausserhalb des Linealbereichs)
+ RULER_TYPE_MARGIN1 (nur Margin1-Kante)
+ RULER_TYPE_MARGIN2 (nur Margin2-Kante)
+ RULER_TYPE_BORDER (Border: GetClickAryPos())
+ RULER_TYPE_INDENT (Einzug: GetClickAryPos())
+ RULER_TYPE_TAB (Tab: GetClickAryPos())
+
+ - GetClickAryPos()
+ Liefert den Index im Array zurueck, wenn ein Border, Indent oder ein
+ Tab per DoubleClick betaetigt wird.
+
+ - GetType()
+ Mit dieser Methode kann man einen HitTest durchfuehren, um
+ gegebenenfalls ueber das Abfangen des MouseButtonDown-Handlers
+ auch ueber die rechte Maustaste etwas auf ein Item anzuwenden. Als
+ Paramter ueber gibt man die Fensterposition und gegebenenfalls
+ einen Pointer auf einen sal_uInt16, um die Array-Position eines
+ Tabs, Indent oder Borders mitzubekommen. Als Type werden folgende
+ Werte zurueckgegeben:
+ RULER_TYPE_DONTKNOW (kein Element im Linealbereich)
+ RULER_TYPE_OUTSIDE (ausserhalb des Linealbereichs)
+ RULER_TYPE_MARGIN1 (nur Margin1-Kante)
+ RULER_TYPE_MARGIN2 (nur Margin2-Kante)
+ RULER_TYPE_BORDER (Border: GetClickAryPos())
+ RULER_TYPE_INDENT (Einzug: GetClickAryPos())
+ RULER_TYPE_TAB (Tab: GetClickAryPos())
+
+Wenn der Drag-Vorgang abgebrochen werden soll, kann der Drag-Vorgang
+mit CancelDrag() abgebrochen werden. Folgende Methoden gibt es fuer die
+Drag-Steuerung:
+
+ - IsDrag()
+ Liefert sal_True zurueck, wenn sich das Lineal im Drag-Vorgang befindet.
+
+ - CancelDrag()
+ Bricht den Drag-Vorgang ab, falls einer durchgefuehrt wird. Dabei
+ werden die alten Werte wieder hergestellt und der Drag und der
+ EndDrag-Handler gerufen.
+
+Um vom Dokument ein Drag auszuloesen, gibt es folgende Methoden:
+
+ - StartDocDrag()
+ Dieser Methode werden der MouseEvent vom Dokumentfenster und
+ was gedragt werden soll uebergeben. Wenn als DragType
+ RULER_TYPE_DONTKNOW uebergeben wird, bestimmt das Lineal, was
+ verschoben werden soll. Bei den anderen, wird der Drag nur dann
+ gestartet, wenn auch an der uebergebenen Position ein entsprechendes
+ Element gefunden wurde. Dies ist zun Beispiel dann notwendig, wenn
+ zum Beispiel Einzuege und Spalten an der gleichen X-Position liegen.
+ Der Rueckgabewert gibt an, ob der Drag ausgeloest wurde. Wenn ein
+ Drag ausgeloest wird, uebernimmt das Lineal die normale Drag-Steuerung
+ und verhaelt sich dann so, wie als wenn direkt in das Lineal geklickt
+ wurde. So captured das Lineal die Mouse und uebernimmt auch die
+ Steuerung des Cancel (ueber Tastatur, oder wenn die Mouse ueber
+ oder links vom Lineal ruasgeschoben wird). Auch alle Handler werden
+ gerufen (inkl. des StartDrag-Handlers). Wenn ein MouseEvent mit
+ Click-Count 2 uebergeben wird auch der DoubleClick-Handler
+ entsprechend gerufen.
+
+--------------------------------------------------------------------------
+
+Fuer das Extra-Feld kann der Inhalt bestimmt werden und es gibt Handler,
+womit man bestimmte Aktionen abfangen kann.
+
+ - ExtraDown()
+ Dieser Handler wird gerufen, wenn im Extra-Feld die Maus
+ gedrueckt wird.
+
+ - SetExtraType()
+ Mit dieser Methode kann festgelegt werden, was im ExtraFeld
+ dargestellt werden soll.
+ - ExtraType Was im Extrafeld dargestellt werden soll
+ RULER_EXTRA_DONTKNOW (Nichts)
+ RULER_EXTRA_NULLOFFSET (Koordinaaten-Kreuz)
+ RULER_EXTRA_TAB (Tab)
+ - sal_uInt16 nStyle Bitfeld als Style:
+ RULER_STYLE_HIGHLIGHT (selektiert)
+ RULER_TAB_... (ein Tab-Style)
+
+ - GetExtraClick()
+ Liefert die Anzahl der Mausclicks zurueck. Dadurch ist es zum
+ Beispiel auch moeglich, auch durch einen DoubleClick im Extrafeld
+ eine Aktion auszuloesen.
+
+ - GetExtraModifier()
+ Liefert die Modifier-Tasten zurueck, die beim Klicken in das Extra-
+ Feld gedrueckt waren. Siehe MouseEvent.
+
+--------------------------------------------------------------------------
+
+Weitere Hilfsfunktionen:
+
+- static Ruler::DrawTab()
+ Mit dieser Methode kann ein Tab auf einem OutputDevice ausgegeben
+ werden. Dadurch ist es moeglich, auch in Dialogen die Tabs so
+ anzuzeigen, wie Sie im Lineal gemalt werden.
+
+ Diese Methode gibt den Tab zentriert an der uebergebenen Position
+ aus. Die Groesse der Tabs kann ueber die Defines RULER_TAB_WIDTH und
+ RULER_TAB_HEIGHT bestimmt werden.
+
+--------------------------------------------------------------------------
+
+Tips zur Benutzung des Lineals:
+
+- Bei dem Lineal muss weder im Drag-Modus noch sonst das Setzen der Werte
+ in SetUpdateMode() geklammert werden. Denn das Lineal sorgt von sich
+ aus dafuer, das wenn mehrere Werte gesetzt werden, diese automatisch
+ zusammengefast werden und flackerfrei ausgegeben werden.
+
+- Initial sollten beim Lineal zuerst die Groessen, Positionen und Werte
+ gesetzt werden, bevor es angezeigt wird. Dies ist deshalb wichtig, da
+ ansonsten viele Werte unnoetig berechnet werden.
+
+- Wenn das Dokumentfenster, in dem sich das Lineal befindet aktiv bzw.
+ deaktiv wird, sollten die Methoden Activate() und Deactivate() vom
+ Lineal gerufen werden. Denn je nach Einstellungen und System wird die
+ Anzeige entsprechend umgeschaltet.
+
+- Zum Beispiel sollte beim Drag von Tabs und Einzuegen nach Moeglichkeit die
+ alten Positionen noch mit angezeigt werden. Dazu sollte zusaetzlich beim
+ Setzen der Tabs und Einzuege als erstes im Array die alten Positionen
+ eingetragen werden und mit dem Style RULER_STYLE_DONTKNOW verknuepft
+ werden. Danach sollte im Array die restlichen Werte eingetragen werden.
+
+- Bei mehreren markierten Absaetzen und Tabellen-Zellen, sollten die Tabs
+ und Einzuege in grau von der ersten Zelle, bzw. vom ersten Absatz
+ angezeigt werden. Dies kann man auch ueber den Style RULER_STYLE_DONTKNOW
+ erreichen.
+
+- Die Bemassungspfeile sollten immer dann angezeigt, wenn beim Drag die
+ Alt-Taste (WW-Like) gedrueckt wird. Vielleicht sollte diese Einstellung
+ auch immer vornehmbar sein und vielleicht beim Drag immer die
+ Bemassungspfeile dargestellt werden. Bei allen Einstellung sollten die
+ Werte immer auf ein vielfaches eines Wertes gerundet werden, da die
+ Bildschirmausloesung sehr ungenau ist.
+
+- DoppelKlicks sollten folgendermassen behandelt werden (GetClickType()):
+ - RULER_TYPE_DONTKNOW
+ RULER_TYPE_MARGIN1
+ RULER_TYPE_MARGIN2
+ Wenn die Bedingunden GetClickPos() <= GetMargin1() oder
+ GetClickPos() >= GetMargin2() oder der Type gleich
+ RULER_TYPE_MARGIN1 oder RULER_TYPE_MARGIN2 ist, sollte
+ ein SeitenDialog angezeigt werden, wo der Focus auf dem
+ entsprechenden Rand steht
+ - RULER_TYPE_BORDER
+ Es sollte ein Spalten- oder Tabellen-Dialog angezeigt werden,
+ wo der Focus auf der entsprechenden Spalte steht, die mit
+ GetClickAryPos() abgefragt werden kann.
+ - RULER_TYPE_INDENT
+ Es sollte der Dialog angezeigt werden, wo die Einzuege eingestellt
+ werden koennen. Dabei sollte der Focus auf dem Einzug stehen, der
+ mit GetClickAryPos() ermittelt werden kann.
+ - RULER_TYPE_TAB
+ Es sollte ein TabDialog angezeigt werden, wo der Tab selektiert
+ sein sollte, der ueber GetClickAryPos() abgefragt werden kann.
+
+*************************************************************************/
+
+// -----------
+// - WinBits -
+// -----------
+
+#define WB_EXTRAFIELD ((WinBits)0x00004000)
+#define WB_RIGHT_ALIGNED ((WinBits)0x00008000)
+#define WB_STDRULER WB_HORZ
+
+// ---------------
+// - Ruler-Types -
+// ---------------
+
+struct ImplRulerHitTest;
+
+// --------------
+// - Ruler-Type -
+// --------------
+
+enum RulerType { RULER_TYPE_DONTKNOW, RULER_TYPE_OUTSIDE,
+ RULER_TYPE_MARGIN1, RULER_TYPE_MARGIN2,
+ RULER_TYPE_BORDER, RULER_TYPE_INDENT, RULER_TYPE_TAB };
+
+enum RulerExtra { RULER_EXTRA_DONTKNOW,
+ RULER_EXTRA_NULLOFFSET, RULER_EXTRA_TAB };
+
+#define RULER_STYLE_HIGHLIGHT ((sal_uInt16)0x8000)
+#define RULER_STYLE_DONTKNOW ((sal_uInt16)0x4000)
+#define RULER_STYLE_INVISIBLE ((sal_uInt16)0x2000)
+
+#define RULER_DRAGSIZE_MOVE 0
+#define RULER_DRAGSIZE_1 1
+#define RULER_DRAGSIZE_2 2
+
+#define RULER_MOUSE_BORDERMOVE 5
+#define RULER_MOUSE_BORDERWIDTH 5
+#define RULER_MOUSE_MARGINWIDTH 3
+
+#define RULER_SCROLL_NO 0
+#define RULER_SCROLL_1 1
+#define RULER_SCROLL_2 2
+
+// ---------------
+// - RulerMargin -
+// ---------------
+
+#define RULER_MARGIN_SIZEABLE ((sal_uInt16)0x0001)
+
+// ---------------
+// - RulerBorder -
+// ---------------
+
+#define RULER_BORDER_SIZEABLE ((sal_uInt16)0x0001)
+#define RULER_BORDER_MOVEABLE ((sal_uInt16)0x0002)
+#define RULER_BORDER_VARIABLE ((sal_uInt16)0x0004)
+#define RULER_BORDER_TABLE ((sal_uInt16)0x0008)
+#define RULER_BORDER_SNAP ((sal_uInt16)0x0010)
+#define RULER_BORDER_MARGIN ((sal_uInt16)0x0020)
+
+struct RulerBorder
+{
+ long nPos;
+ long nWidth;
+ sal_uInt16 nStyle;
+ //minimum/maximum position, supported for table borders/rows
+ long nMinPos;
+ long nMaxPos;
+};
+
+// ---------------
+// - RulerIndent -
+// ---------------
+
+#define RULER_INDENT_TOP ((sal_uInt16)0x0000)
+#define RULER_INDENT_BOTTOM ((sal_uInt16)0x0001)
+#define RULER_INDENT_BORDER ((sal_uInt16)0x0002)
+#define RULER_INDENT_STYLE ((sal_uInt16)0x000F)
+
+struct RulerIndent
+{
+ long nPos;
+ sal_uInt16 nStyle;
+};
+
+// ------------
+// - RulerTab -
+// ------------
+
+#define RULER_TAB_LEFT ((sal_uInt16)0x0000)
+#define RULER_TAB_RIGHT ((sal_uInt16)0x0001)
+#define RULER_TAB_DECIMAL ((sal_uInt16)0x0002)
+#define RULER_TAB_CENTER ((sal_uInt16)0x0003)
+#define RULER_TAB_DEFAULT ((sal_uInt16)0x0004)
+#define RULER_TAB_STYLE ((sal_uInt16)0x000F)
+#define RULER_TAB_RTL ((sal_uInt16)0x0010)
+
+struct RulerTab
+{
+ long nPos;
+ sal_uInt16 nStyle;
+};
+
+#define RULER_TAB_WIDTH 7
+#define RULER_TAB_HEIGHT 6
+
+// -------------
+// - RulerLine -
+// -------------
+
+struct RulerLine
+{
+ long nPos;
+ sal_uInt16 nStyle;
+};
+
+class ImplRulerData;
+// ---------
+// - Ruler -
+// ---------
+
+class SVT_DLLPUBLIC Ruler : public Window
+{
+private:
+ 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;
+ sal_uLong mnUpdateEvtId;
+ ImplRulerData* mpSaveData;
+ ImplRulerData* mpData;
+ ImplRulerData* mpDragData;
+ Rectangle maExtraRect;
+ WinBits mnWinStyle;
+ sal_uInt16 mnUnitIndex;
+ sal_uInt16 mnDragAryPos;
+ sal_uInt16 mnDragSize;
+ sal_uInt16 mnDragScroll;
+ sal_uInt16 mnDragModifier;
+ sal_uInt16 mnExtraStyle;
+ sal_uInt16 mnExtraClicks;
+ sal_uInt16 mnExtraModifier;
+ long mnCharWidth;
+ long mnLineHeight;
+
+ RulerExtra meExtraType;
+ RulerType meDragType;
+ MapUnit meSourceUnit;
+ FieldUnit meUnit;
+ Fraction maZoom;
+ sal_Bool mbCalc;
+ sal_Bool mbFormat;
+ sal_Bool mbDrag;
+ sal_Bool mbDragDelete;
+ sal_Bool mbDragCanceled;
+ sal_Bool mbAutoWinWidth;
+ sal_Bool mbActive;
+ sal_uInt8 mnUpdateFlags;
+ Link maStartDragHdl;
+ Link maDragHdl;
+ Link maEndDragHdl;
+ Link maClickHdl;
+ Link maDoubleClickHdl;
+ Link maExtraDownHdl;
+
+#ifdef _SV_RULER_CXX
+ SVT_DLLPRIVATE void ImplVDrawLine( long nX1, long nY1, long nX2, long nY2 );
+ SVT_DLLPRIVATE void ImplVDrawRect( long nX1, long nY1, long nX2, long nY2 );
+ SVT_DLLPRIVATE void ImplVDrawText( long nX, long nY, const String& rText, long nMin = LONG_MIN, long nMax = LONG_MAX );
+
+ SVT_DLLPRIVATE void ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter );
+ SVT_DLLPRIVATE void ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom );
+ SVT_DLLPRIVATE void ImplDrawIndent( const Polygon& rPoly, sal_uInt16 nStyle );
+ SVT_DLLPRIVATE void ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom );
+ SVT_DLLPRIVATE void ImplDrawTab( OutputDevice* pDevice, const Point& rPos, sal_uInt16 nStyle );
+ SVT_DLLPRIVATE void ImplDrawTabs( long nMin, long nMax, long nVirTop, long nVirBottom );
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit( WinBits nWinBits );
+ SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SVT_DLLPRIVATE void ImplCalc();
+ SVT_DLLPRIVATE void ImplFormat();
+ SVT_DLLPRIVATE void ImplInitExtraField( sal_Bool bUpdate );
+ SVT_DLLPRIVATE void ImplInvertLines( sal_Bool bErase = sal_False );
+ SVT_DLLPRIVATE void ImplDraw();
+ SVT_DLLPRIVATE void ImplDrawExtra( sal_Bool bPaint = sal_False );
+ SVT_DLLPRIVATE void ImplUpdate( sal_Bool bMustCalc = sal_False );
+ using Window::ImplHitTest;
+ SVT_DLLPRIVATE sal_Bool ImplHitTest( const Point& rPos,
+ ImplRulerHitTest* pHitTest,
+ sal_Bool bRequiredStyle = sal_False,
+ sal_uInt16 nRequiredStyle = 0 ) const;
+ SVT_DLLPRIVATE sal_Bool ImplDocHitTest( const Point& rPos, RulerType eDragType, ImplRulerHitTest* pHitTest ) const;
+ SVT_DLLPRIVATE sal_Bool ImplStartDrag( ImplRulerHitTest* pHitTest, sal_uInt16 nModifier );
+ SVT_DLLPRIVATE void ImplDrag( const Point& rPos );
+ SVT_DLLPRIVATE void ImplEndDrag();
+ DECL_DLLPRIVATE_LINK( ImplUpdateHdl, void* );
+#endif
+
+ // Forbidden and not implemented.
+ Ruler (const Ruler &);
+ Ruler & operator= (const Ruler &);
+
+protected:
+ long GetRulerVirHeight() const;
+
+public:
+ Ruler( Window* pParent, WinBits nWinStyle = WB_STDRULER );
+ virtual ~Ruler();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual long StartDrag();
+ virtual void Drag();
+ virtual void EndDrag();
+ virtual void Click();
+ virtual void DoubleClick();
+ virtual void ExtraDown();
+
+ void Activate();
+ void Deactivate();
+ sal_Bool IsActive() const { return mbActive; }
+
+ void SetWinPos( long nOff = 0, long nWidth = 0 );
+ long GetWinOffset() const { return mnWinOff; }
+ long GetWinWidth() const { return mnWinWidth; }
+ void SetPagePos( long nOff = 0, long nWidth = 0 );
+ long GetPageOffset() const;
+ long GetPageWidth() const;
+ void SetBorderPos( long nOff = 0 );
+ long GetBorderOffset() const { return mnBorderOff; }
+ Rectangle GetExtraRect() const { return maExtraRect; }
+
+ void SetUnit( FieldUnit eNewUnit );
+ FieldUnit GetUnit() const { return meUnit; }
+ void SetZoom( const Fraction& rNewZoom );
+ Fraction GetZoom() const { return maZoom; }
+
+ void SetSourceUnit( MapUnit eNewUnit ) { meSourceUnit = eNewUnit; }
+ MapUnit GetSourceUnit() const { return meSourceUnit; }
+
+ void SetExtraType( RulerExtra eNewExtraType, sal_uInt16 nStyle = 0 );
+ RulerExtra GetExtraType() const { return meExtraType; }
+ sal_uInt16 GetExtraStyle() const { return mnExtraStyle; }
+ sal_uInt16 GetExtraClicks() const { return mnExtraClicks; }
+ sal_uInt16 GetExtraModifier() const { return mnExtraModifier; }
+
+ sal_Bool StartDocDrag( const MouseEvent& rMEvt,
+ RulerType eDragType = RULER_TYPE_DONTKNOW );
+ RulerType GetDragType() const { return meDragType; }
+ long GetDragPos() const { return mnDragPos; }
+ sal_uInt16 GetDragAryPos() const { return mnDragAryPos; }
+ sal_uInt16 GetDragSize() const { return mnDragSize; }
+ sal_Bool IsDragDelete() const { return mbDragDelete; }
+ sal_Bool IsDragCanceled() const { return mbDragCanceled; }
+ sal_uInt16 GetDragScroll() const { return mnDragScroll; }
+ sal_uInt16 GetDragModifier() const { return mnDragModifier; }
+ sal_Bool IsDrag() const { return mbDrag; }
+ void CancelDrag();
+ long GetClickPos() const { return mnDragPos; }
+ RulerType GetClickType() const { return meDragType; }
+ sal_uInt16 GetClickAryPos() const { return mnDragAryPos; }
+ using Window::GetType;
+ RulerType GetType( const Point& rPos,
+ sal_uInt16* pAryPos = NULL ) const;
+
+ void SetNullOffset( long nPos );
+ long GetNullOffset() const;
+ void SetMargin1() { SetMargin1( 0, RULER_STYLE_INVISIBLE ); }
+ void SetMargin1( long nPos, sal_uInt16 nMarginStyle = RULER_MARGIN_SIZEABLE );
+ long GetMargin1() const;
+ void SetMargin2() { SetMargin2( 0, RULER_STYLE_INVISIBLE ); }
+ void SetMargin2( long nPos, sal_uInt16 nMarginStyle = RULER_MARGIN_SIZEABLE );
+ long GetMargin2() const;
+
+ void SetLines( sal_uInt16 n = 0, const RulerLine* pLineAry = NULL );
+
+ void SetBorders( sal_uInt16 n = 0, const RulerBorder* pBrdAry = NULL );
+
+ void SetIndents( sal_uInt16 n = 0, const RulerIndent* pIndentAry = NULL );
+
+ void SetTabs( sal_uInt16 n = 0, const RulerTab* pTabAry = NULL );
+ sal_uInt16 GetTabCount() const;
+ const RulerTab* GetTabs() const;
+
+ static void DrawTab( OutputDevice* pDevice,
+ const Point& rPos, sal_uInt16 nStyle );
+
+ void SetStyle( WinBits nStyle );
+ WinBits GetStyle() const { return mnWinStyle; }
+
+ void SetStartDragHdl( const Link& rLink ) { maStartDragHdl = rLink; }
+ const Link& GetStartDragHdl() const { return maStartDragHdl; }
+ void SetDragHdl( const Link& rLink ) { maDragHdl = rLink; }
+ const Link& GetDragHdl() const { return maDragHdl; }
+ void SetEndDragHdl( const Link& rLink ) { maEndDragHdl = rLink; }
+ const Link& GetEndDragHdl() const { return maEndDragHdl; }
+ void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
+ const Link& GetClickHdl() const { return maClickHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+ void SetExtraDownHdl( const Link& rLink ) { maExtraDownHdl = rLink; }
+ const Link& GetExtraDownHdl() const { return maExtraDownHdl; }
+
+ //set text direction right-to-left
+ void SetTextRTL(sal_Bool bRTL);
+
+ void SetCharWidth( long nWidth ) { mnCharWidth = nWidth ; }
+ void SetLineHeight( long nHeight ) { mnLineHeight = nHeight ; }
+
+ void DrawTicks();
+};
+
+#endif // _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 000000000000..9d491cf449bd
--- /dev/null
+++ b/include/svtools/sampletext.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:
+ *
+ */
+#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 <com/sun/star/i18n/ScriptType.hpp>
+#include <vcl/fontcapabilities.hxx>
+
+class OutputDevice;
+class Font;
+
+SVT_DLLPUBLIC UScriptCode otCoverageToScript(vcl::UnicodeCoverage::UnicodeCoverageEnum eOTCoverage);
+
+SVT_DLLPUBLIC bool isSymbolFont(const Font &rFont);
+SVT_DLLPUBLIC bool isOpenSymbolFont(const Font &rFont);
+
+SVT_DLLPUBLIC bool canRenderNameOfSelectedFont(OutputDevice &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"
+SVT_DLLPUBLIC OUString makeShortRepresentativeSymbolTextForSelectedFont(OutputDevice &rDevice);
+SVT_DLLPUBLIC OUString makeShortRepresentativeTextForSelectedFont(OutputDevice &rDevice);
+SVT_DLLPUBLIC OUString makeShortRepresentativeTextForScript(UScriptCode eScript);
+//For the cases where the font doesn't fully support a script, but has partial support
+//for a useful subset
+SVT_DLLPUBLIC 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 Font &rFont);
+SVT_DLLPUBLIC OUString makeRepresentativeTextForLanguage(LanguageType eLang);
+SVT_DLLPUBLIC OUString makeRepresentativeTextForScript(UScriptCode eScript);
+SVT_DLLPUBLIC OUString makeMinimalTextForScript(UScriptCode eScript);
+
+
+#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 000000000000..7e3928640dfe
--- /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 _SVTOOLS_SCRIPTEDTEXT_HXX
+#define _SVTOOLS_SCRIPTEDTEXT_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/i18n/XBreakIterator.hpp>
+
+
+class OutputDevice;
+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
+{
+private:
+ SvtScriptedTextHelper_Impl* mpImpl; /// Implementation of class functionality.
+
+ /** Assignment operator not implemented to prevent usage. */
+ SvtScriptedTextHelper& operator=( const SvtScriptedTextHelper& );
+
+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. */
+ virtual ~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( Font* _pLatinFont, Font* _pAsianFont, Font* _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 ::com::sun::star::uno::Reference< ::com::sun::star::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 000000000000..f9af5b9aa620
--- /dev/null
+++ b/include/svtools/scrwin.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 _SCRWIN_HXX
+#define _SCRWIN_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <vcl/scrbar.hxx>
+
+class DataChangedEvent;
+
+// -------------------------
+// - ScrollableWindow-Type -
+// -------------------------
+
+typedef sal_uInt16 ScrollableWindowFlags;
+
+#define SCRWIN_THUMBDRAGGING 1
+#define SCRWIN_VCENTER 2
+#define SCRWIN_HCENTER 4
+#define SCRWIN_DEFAULT (SCRWIN_THUMBDRAGGING | SCRWIN_VCENTER | SCRWIN_HCENTER)
+
+// --------------------
+// - ScrollableWindow -
+// --------------------
+
+class SVT_DLLPUBLIC ScrollableWindow: public 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;
+
+ ScrollBar aVScroll; // the scrollbars
+ ScrollBar aHScroll;
+ ScrollBarBox aCornerWin; // window in the bottom right corner
+ sal_Bool bScrolling:1, // user controlled scrolling
+ bHandleDragging:1, // scroll window while dragging
+ bHCenter:1,
+ bVCenter:1;
+
+#ifdef _SVT_SCRWIN_CXX
+ SVT_DLLPRIVATE void ImpInitialize( ScrollableWindowFlags nFlags );
+ DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar * );
+ DECL_DLLPRIVATE_LINK( EndScrollHdl, ScrollBar * );
+#endif
+
+public:
+ ScrollableWindow( Window* pParent, WinBits nBits = 0,
+ ScrollableWindowFlags = SCRWIN_DEFAULT );
+
+ virtual void Resize();
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void DataChanged( const DataChangedEvent& rDEvt );
+
+ virtual void StartScroll();
+ virtual void EndScroll( long nDeltaX, long nDeltaY );
+
+ using OutputDevice::SetMapMode;
+ virtual void SetMapMode( const MapMode& rNewMapMode );
+ virtual MapMode GetMapMode() const;
+
+ void SetTotalSize( const Size& rNewSize );
+ Size GetTotalSize() { return PixelToLogic( aTotPixSz ); }
+
+ using Window::Scroll;
+ virtual void Scroll( long nDeltaX, long nDeltaY, sal_uInt16 nFlags = 0 );
+
+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 000000000000..e5b4026a0ec0
--- /dev/null
+++ b/include/svtools/sfxecode.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 _SFXECODE_HXX
+#define _SFXECODE_HXX
+
+#include <tools/errcode.hxx>
+
+#define ERRCODE_SFX_NOSTDTEMPLATE (ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|1)
+#define ERRCODE_SFX_NOTATEMPLATE (ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|2)
+#define ERRCODE_SFX_GENERAL (ERRCODE_AREA_SFX|ERRCODE_CLASS_GENERAL|3)
+#define ERRCODE_SFX_DOLOADFAILED (ERRCODE_AREA_SFX|ERRCODE_CLASS_READ|4)
+#define ERRCODE_SFX_DOSAVECOMPLETEDFAILED (ERRCODE_AREA_SFX|ERRCODE_CLASS_WRITE|5)
+#define ERRCODE_SFX_COMMITFAILED (ERRCODE_AREA_SFX|ERRCODE_CLASS_WRITE|6)
+#define ERRCODE_SFX_HANDSOFFFAILED (ERRCODE_AREA_SFX|ERRCODE_CLASS_GENERAL|7)
+#define ERRCODE_SFX_DOINITNEWFAILED (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|8)
+#define ERRCODE_SFX_CANTREADDOCINFO (ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|9)
+#define ERRCODE_SFX_ALREADYOPEN (ERRCODE_AREA_SFX|ERRCODE_CLASS_ALREADYEXISTS|10)
+#define ERRCODE_SFX_WRONGPASSWORD (ERRCODE_AREA_SFX|ERRCODE_CLASS_READ|11)
+#define ERRCODE_SFX_DOCUMENTREADONLY (ERRCODE_AREA_SFX|ERRCODE_CLASS_WRITE|12)
+#define ERRCODE_SFX_OLEGENERAL (ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|14)
+#define ERRCODE_SFXMSG_STYLEREPLACE (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|13)
+#define ERRCODE_SFX_TEMPLATENOTFOUND (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|15)
+#define ERRCODE_SFX_ISRELATIVE (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|16)
+#define ERRCODE_SFX_FORCEDOCLOAD (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|17)
+
+#define ERRCODE_SFX_CANTFINDORIGINAL (ERRCODE_AREA_SFX|ERRCODE_CLASS_GENERAL|19)
+#define ERRCODE_SFX_RESTART (ERRCODE_AREA_SFX|ERRCODE_CLASS_GENERAL|20)
+#define ERRCODE_SFX_CANTCREATECONTENT (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|21)
+#define ERRCODE_SFX_CANTCREATELINK (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|22)
+#define ERRCODE_SFX_WRONGBMKFORMAT (ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|23)
+#define ERRCODE_SFX_WRONGICONFILE (ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|24)
+#define ERRCODE_SFX_CANTDELICONFILE (ERRCODE_AREA_SFX|ERRCODE_CLASS_ACCESS|25)
+#define ERRCODE_SFX_CANTWRITEICONFILE (ERRCODE_AREA_SFX|ERRCODE_CLASS_ACCESS|26)
+#define ERRCODE_SFX_CANTRENAMECONTENT (ERRCODE_AREA_SFX|ERRCODE_CLASS_ACCESS|27)
+#define ERRCODE_SFX_INVALIDBMKPATH (ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|28)
+#define ERRCODE_SFX_CANTWRITEURLCFGFILE (ERRCODE_AREA_SFX|ERRCODE_CLASS_ACCESS|29)
+#define ERRCODE_SFX_WRONGURLCFGFORMAT (ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|30)
+#define ERRCODE_SFX_NODOCUMENT (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|31)
+#define ERRCODE_SFX_INVALIDLINK (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|32)
+#define ERRCODE_SFX_INVALIDTRASHPATH (ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|33)
+#define ERRCODE_SFX_NOTRESTORABLE (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|34)
+#define ERRCODE_SFX_NOTRASH (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|35)
+#define ERRCODE_SFX_INVALIDSYNTAX (ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|36)
+#define ERRCODE_SFX_CANTCREATEFOLDER (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|37)
+#define ERRCODE_SFX_CANTRENAMEFOLDER (ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|38)
+#define ERRCODE_SFX_WRONG_CDF_FORMAT (ERRCODE_AREA_SFX| ERRCODE_CLASS_READ | 39)
+#define ERRCODE_SFX_EMPTY_SERVER (ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|40)
+#define ERRCODE_SFX_NO_ABOBOX (ERRCODE_AREA_SFX| ERRCODE_CLASS_READ | 41)
+#define ERRCODE_SFX_CANTGETPASSWD (ERRCODE_AREA_SFX| ERRCODE_CLASS_READ | 42)
+#define ERRCODE_SFX_TARGETFILECORRUPTED (ERRCODE_AREA_SFX| ERRCODE_CLASS_READ | 43)
+#define ERRCODE_SFX_NOMOREDOCUMENTSALLOWED (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 44)
+#define ERRCODE_SFX_NOFILTER (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|45)
+#define ERRCODE_SFX_FORCEQUIET (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|47)
+#define ERRCODE_SFX_CONSULTUSER (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|48)
+#define ERRCODE_SFX_NEVERCHECKCONTENT (ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|49)
+#define ERRCODE_SFX_CANTCREATEBACKUP (ERRCODE_AREA_SFX | ERRCODE_CLASS_CREATE | 50)
+#define ERRCODE_SFX_MACROS_SUPPORT_DISABLED (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 51)
+#define ERRCODE_SFX_DOCUMENT_MACRO_DISABLED (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 52)
+#define ERRCODE_SFX_BROKENSIGNATURE (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 53)
+#define ERRCODE_SFX_SHARED_NOPASSWORDCHANGE (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 54)
+#define ERRCODE_SFX_INCOMPLETE_ENCRYPTION (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 55)
+#define ERRCODE_SFX_DOCUMENT_MACRO_DISABLED_MAC (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 56)
+#define ERRCODE_SFX_FORMAT_ROWCOL (ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 57)
+#define ERRCODE_SFX_VBASIC_CANTSAVE_STORAGE (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 58)
+
+
+//Dies und das
+#define ERRCTX_ERROR 21
+#define ERRCTX_WARNING 22
+
+//Documentkontexte
+#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
+
+//Appkontexte
+#define ERRCTX_SFX_DOCMANAGER 50
+#define ERRCTX_SFX_OPENDOC 51
+#define ERRCTX_SFX_NEWDOCDIRECT 52
+#define ERRCTX_SFX_NEWDOC 53
+
+//Organizerkontexte
+#define ERRCTX_SFX_CREATEOBJSH 70
+
+//BASIC-Kontexte
+#define ERRCTX_SFX_LOADBASIC 80
+
+//Addressbook contexts
+#define ERRCTX_SFX_SEARCHADDRESS 90
+
+#endif // #ifndef _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 000000000000..cb2d996fb03b
--- /dev/null
+++ b/include/svtools/slidesorterbaropt.hxx
@@ -0,0 +1,98 @@
+/* -*- 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 <sal/types.h>
+#include <osl/mutex.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+/** 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 neccessary. 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: public utl::detail::Options
+{
+ public:
+ /** standard constructor and destructor
+
+ This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ \sa member m_nRefCount
+ \sa member m_pDataContainer
+ */
+ SvtSlideSorterBarOptions();
+ virtual ~SvtSlideSorterBarOptions();
+
+ 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 are'nt 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:
+
+ /**
+ \attention
+ Don't initialize these static member in these header!
+ \li Double defined symbols will be detected ...
+ \li and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+ static SvtSlideSorterBarOptions_Impl* m_pDataContainer ; ///< impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount ; ///< internal ref count mechanism
+
+};
+
+#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 000000000000..e6d366327744
--- /dev/null
+++ b/include/svtools/soerr.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 _SOERR_HXX
+#define _SOERR_HXX
+
+#include <tools/errcode.hxx>
+
+// Fehler Codes
+#define RID_SO_ERROR_HANDLER 32000
+
+#define SO_ERR() (ERRCODE_AREA_SO | ERRCODE_CLASS_SO)
+#define SO_WRN() (ERRCODE_AREA_SO | ERRCODE_CLASS_SO | ERRCODE_WARNING_MASK)
+
+#define ERRCODE_SO_GENERALERROR (SO_ERR() | 1)
+#define ERRCODE_SO_CANT_BINDTOSOURCE (SO_ERR() | 2)
+#define ERRCODE_SO_NOCACHE_UPDATED (SO_ERR() | 3)
+#define ERRCODE_SO_SOMECACHES_NOTUPDATED (SO_WRN() | 4)
+#define ERRCODE_SO_MK_UNAVAILABLE (SO_ERR() | 5)
+#define ERRCODE_SO_E_CLASSDIFF (SO_ERR() | 6)
+#define ERRCODE_SO_MK_NO_OBJECT (SO_ERR() | 7)
+#define ERRCODE_SO_MK_EXCEEDED_DEADLINE (SO_ERR() | 8)
+#define ERRCODE_SO_MK_CONNECT_MANUALLY (SO_ERR() | 9)
+#define ERRCODE_SO_MK_INTERMEDIATE_INTERFACE_NOT_SUPPORTED (SO_ERR() | 10)
+#define ERRCODE_SO_NO_INTERFACE (SO_ERR() | 11)
+#define ERRCODE_SO_OUT_OF_MEMORY (SO_ERR() | 12)
+#define ERRCODE_SO_MK_SYNTAX (SO_ERR() | 13)
+#define ERRCODE_SO_MK_REDUCED_TO_SELF (SO_WRN() | 14)
+#define ERRCODE_SO_MK_NO_INVERSE (SO_ERR() | 15)
+#define ERRCODE_SO_MK_NO_PREFIX (SO_ERR() | 16)
+#define ERRCODE_SO_MK_HIM (SO_WRN() | 17)
+#define ERRCODE_SO_MK_US (SO_WRN() | 18)
+#define ERRCODE_SO_MK_ME (SO_WRN() | 19)
+#define ERRCODE_SO_MK_NOT_BINDABLE (SO_ERR() | 20)
+#define ERRCODE_SO_NOT_IMPLEMENTED (SO_ERR() | 21)
+#define ERRCODE_SO_MK_NO_STORAGE (SO_ERR() | 22)
+#define ERRCODE_SO_FALSE (SO_WRN() | 23)
+#define ERRCODE_SO_MK_NEED_GENERIC (SO_ERR() | 24)
+#define ERRCODE_SO_PENDING (SO_ERR() | 25)
+#define ERRCODE_SO_NOT_INPLACEACTIVE (SO_ERR() | 26)
+#define ERRCODE_SO_LINDEX (SO_ERR() | 27)
+#define ERRCODE_SO_CANNOT_DOVERB_NOW (SO_WRN() | 28)
+#define ERRCODE_SO_OLEOBJ_INVALIDHWND (SO_WRN() | 29)
+#define ERRCODE_SO_NOVERBS (SO_ERR() | 30)
+#define ERRCODE_SO_INVALIDVERB (SO_WRN() | 31)
+#define ERRCODE_SO_MK_CONNECT (SO_ERR() | 32)
+#define ERRCODE_SO_NOTIMPL (SO_ERR() | 33)
+#define ERRCODE_SO_MK_CANTOPENFILE (SO_ERR() | 34)
+
+// Fehler Contexte
+#define RID_SO_ERRCTX 32001
+
+#define ERRCTX_SO_DOVERB 1
+
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/sores.hxx b/include/svtools/sores.hxx
new file mode 100644
index 000000000000..4264f2197f62
--- /dev/null
+++ b/include/svtools/sores.hxx
@@ -0,0 +1,103 @@
+/* -*- 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 .
+ */
+
+// Strings
+#define STR_ERROR_OBJNOCREATE 32014
+#define STR_ERROR_OBJNOCREATE_FROM_FILE 32015
+#define STR_ERROR_OBJNOCREATE_PLUGIN 32018
+#define STR_FURTHER_OBJECT 32026
+#define STR_UNKNOWN_SOURCE 32027
+
+#define BMP_PLUGIN 32000
+#define BMP_OLEOBJ 32001
+#define MB_PLUGIN 32000
+#define MI_PLUGIN 32000
+#define MI_PLUGIN_DEACTIVATE 1
+
+// Sot Format Strings
+#define STR_FORMAT_START 32100
+#define STR_FORMAT_STRING (STR_FORMAT_START + 1)
+#define STR_FORMAT_BITMAP (STR_FORMAT_START + 2)
+#define STR_FORMAT_GDIMETAFILE (STR_FORMAT_START + 3)
+#define STR_FORMAT_RTF (STR_FORMAT_START + 7)
+#define STR_FORMAT_ID_DRAWING (STR_FORMAT_START + 8)
+#define STR_FORMAT_ID_SVXB (STR_FORMAT_START + 9)
+#define STR_FORMAT_ID_INTERNALLINK_STATE (STR_FORMAT_START + 13)
+#define STR_FORMAT_ID_SOLK (STR_FORMAT_START + 14)
+#define STR_FORMAT_ID_NETSCAPE_BOOKMARK (STR_FORMAT_START + 15)
+#define STR_FORMAT_ID_STARSERVER (STR_FORMAT_START + 19)
+#define STR_FORMAT_ID_STAROBJECT (STR_FORMAT_START + 20)
+#define STR_FORMAT_ID_APPLETOBJECT (STR_FORMAT_START + 21)
+#define STR_FORMAT_ID_PLUGIN_OBJECT (STR_FORMAT_START + 22)
+#define STR_FORMAT_ID_STARWRITER_30 (STR_FORMAT_START + 23)
+#define STR_FORMAT_ID_STARWRITER_40 (STR_FORMAT_START + 24)
+#define STR_FORMAT_ID_STARWRITER_50 (STR_FORMAT_START + 25)
+#define STR_FORMAT_ID_STARWRITERWEB_40 (STR_FORMAT_START + 26)
+#define STR_FORMAT_ID_STARWRITERWEB_50 (STR_FORMAT_START + 27)
+#define STR_FORMAT_ID_STARWRITERGLOB_40 (STR_FORMAT_START + 28)
+#define STR_FORMAT_ID_STARWRITERGLOB_50 (STR_FORMAT_START + 29)
+#define STR_FORMAT_ID_STARDRAW (STR_FORMAT_START + 30)
+#define STR_FORMAT_ID_STARDRAW_40 (STR_FORMAT_START + 31)
+#define STR_FORMAT_ID_STARIMPRESS_50 (STR_FORMAT_START + 32)
+#define STR_FORMAT_ID_STARDRAW_50 (STR_FORMAT_START + 33)
+#define STR_FORMAT_ID_STARCALC (STR_FORMAT_START + 34)
+#define STR_FORMAT_ID_STARCALC_40 (STR_FORMAT_START + 35)
+#define STR_FORMAT_ID_STARCALC_50 (STR_FORMAT_START + 36)
+#define STR_FORMAT_ID_STARCHART (STR_FORMAT_START + 37)
+#define STR_FORMAT_ID_STARCHART_40 (STR_FORMAT_START + 38)
+#define STR_FORMAT_ID_STARCHART_50 (STR_FORMAT_START + 39)
+#define STR_FORMAT_ID_STARIMAGE (STR_FORMAT_START + 40)
+#define STR_FORMAT_ID_STARIMAGE_40 (STR_FORMAT_START + 41)
+#define STR_FORMAT_ID_STARIMAGE_50 (STR_FORMAT_START + 42)
+#define STR_FORMAT_ID_STARMATH (STR_FORMAT_START + 43)
+#define STR_FORMAT_ID_STARMATH_40 (STR_FORMAT_START + 44)
+#define STR_FORMAT_ID_STARMATH_50 (STR_FORMAT_START + 45)
+#define STR_FORMAT_ID_STAROBJECT_PAINTDOC (STR_FORMAT_START + 46)
+#define STR_FORMAT_ID_HTML (STR_FORMAT_START + 48)
+#define STR_FORMAT_ID_HTML_SIMPLE (STR_FORMAT_START + 49)
+#define STR_FORMAT_ID_BIFF_5 (STR_FORMAT_START + 52)
+#define STR_FORMAT_ID_BIFF_8 (STR_FORMAT_START + 53)
+#define STR_FORMAT_ID_SYLK (STR_FORMAT_START + 54)
+#define STR_FORMAT_ID_LINK (STR_FORMAT_START + 56)
+#define STR_FORMAT_ID_DIF (STR_FORMAT_START + 57)
+#define STR_FORMAT_ID_MSWORD_DOC (STR_FORMAT_START + 60)
+#define STR_FORMAT_ID_STAR_FRAMESET_DOC (STR_FORMAT_START + 61)
+#define STR_FORMAT_ID_OFFICE_DOC (STR_FORMAT_START + 62)
+#define STR_FORMAT_ID_NOTES_DOCINFO (STR_FORMAT_START + 63)
+#define STR_FORMAT_ID_SFX_DOC (STR_FORMAT_START + 66)
+#define STR_FORMAT_ID_FILEGRPDESCRIPTOR (STR_FORMAT_START + 86)
+#define STR_FORMAT_ID_STARCHARTDOCUMENT_50 (STR_FORMAT_START + 102)
+#define STR_FORMAT_ID_GRAPHOBJ (STR_FORMAT_START + 103)
+#define STR_FORMAT_ID_STARWRITER_60 (STR_FORMAT_START + 104)
+#define STR_FORMAT_ID_STARWRITERWEB_60 (STR_FORMAT_START + 105)
+#define STR_FORMAT_ID_STARWRITERGLOB_60 (STR_FORMAT_START + 106)
+#define STR_FORMAT_ID_STARDRAW_60 (STR_FORMAT_START + 107)
+#define STR_FORMAT_ID_STARIMPRESS_60 (STR_FORMAT_START + 108)
+#define STR_FORMAT_ID_STARCALC_60 (STR_FORMAT_START + 109)
+#define STR_FORMAT_ID_STARCHART_60 (STR_FORMAT_START + 110)
+#define STR_FORMAT_ID_STARMATH_60 (STR_FORMAT_START + 111)
+#define STR_FORMAT_ID_WMF (STR_FORMAT_START + 112)
+#define STR_FORMAT_ID_DBACCESS_QUERY (STR_FORMAT_START + 113)
+#define STR_FORMAT_ID_DBACCESS_TABLE (STR_FORMAT_START + 114)
+#define STR_FORMAT_ID_DBACCESS_COMMAND (STR_FORMAT_START + 115)
+#define STR_FORMAT_ID_DIALOG_60 (STR_FORMAT_START + 116)
+#define STR_FORMAT_ID_HTML_NO_COMMENT (STR_FORMAT_START + 119)
+#define STR_FORMAT_END (STR_FORMAT_ID_HTML_NO_COMMENT)
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/statusbarcontroller.hxx b/include/svtools/statusbarcontroller.hxx
new file mode 100644
index 000000000000..eba45e543525
--- /dev/null
+++ b/include/svtools/statusbarcontroller.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 _SVTOOLS_STATUSBARCONTROLLER_HXX
+#define _SVTOOLS_STATUSBARCONTROLLER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/util/XUpdatable.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <com/sun/star/frame/XStatusbarController.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/broadcasthelper.hxx>
+
+#include <boost/unordered_map.hpp>
+
+#include <tools/gen.hxx>
+
+namespace svt
+{
+
+class SVT_DLLPUBLIC StatusbarController : public ::com::sun::star::frame::XStatusListener,
+ public ::com::sun::star::frame::XStatusbarController,
+ public ::com::sun::star::lang::XInitialization,
+ public ::com::sun::star::util::XUpdatable,
+ public ::com::sun::star::lang::XComponent,
+ public ::comphelper::OBaseMutex,
+ public ::cppu::OWeakObject
+{
+ public:
+ StatusbarController( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
+ const OUString& aCommandURL,
+ unsigned short nID );
+ StatusbarController();
+ virtual ~StatusbarController();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > getFrameInterface() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > getURLTransformer() const;
+
+ ::Rectangle getControlRect() const;
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XUpdatable
+ virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XStatusbarController
+ virtual ::sal_Bool SAL_CALL mouseButtonDown( const ::com::sun::star::awt::MouseEvent& aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL mouseMove( const ::com::sun::star::awt::MouseEvent& aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL mouseButtonUp( const ::com::sun::star::awt::MouseEvent& aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL command( const ::com::sun::star::awt::Point& aPos,
+ ::sal_Int32 nCommand,
+ ::sal_Bool bMouseEvent,
+ const ::com::sun::star::uno::Any& aData ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
+ const ::com::sun::star::awt::Rectangle& rOutputRectangle,
+ ::sal_Int32 nItemId, ::sal_Int32 nStyle ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
+
+ protected:
+ struct Listener
+ {
+ Listener( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& rDispatch ) :
+ aURL( rURL ), xDispatch( rDispatch ) {}
+
+ ::com::sun::star::util::URL aURL;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
+ };
+
+ typedef ::boost::unordered_map< OUString,
+ com::sun::star::uno::Reference< com::sun::star::frame::XDispatch >,
+ OUStringHash,
+ ::std::equal_to< OUString > > 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 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs );
+ void execute( const OUString& aCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs );
+
+ sal_Bool m_bInitialized : 1,
+ m_bDisposed : 1;
+ unsigned short m_nID;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xParentWindow;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
+ OUString m_aCommandURL;
+ URLToDispatchMap m_aListenerMap;
+ ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
+};
+
+}
+
+#endif // _SVTOOLS_TOOLBOXCONTROLLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/stdctrl.hxx b/include/svtools/stdctrl.hxx
new file mode 100644
index 000000000000..77ca119ab363
--- /dev/null
+++ b/include/svtools/stdctrl.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 _STDCTRL_HXX
+#define _STDCTRL_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <vcl/edit.hxx>
+#include <vcl/fixed.hxx>
+
+// -------------
+// - FixedInfo -
+// -------------
+
+class SVT_DLLPUBLIC FixedInfo : public FixedText
+{
+public:
+ FixedInfo( Window* pParent, WinBits nWinStyle = WB_LEFT );
+ FixedInfo( Window* pParent, const ResId& rResId );
+};
+
+#endif // _STDCTRL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/stdmenu.hxx b/include/svtools/stdmenu.hxx
new file mode 100644
index 000000000000..4c968db36842
--- /dev/null
+++ b/include/svtools/stdmenu.hxx
@@ -0,0 +1,161 @@
+/* -*- 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 _STDMENU_HXX
+#define _STDMENU_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/link.hxx>
+#include <vcl/menu.hxx>
+
+class FontList;
+class FontInfo;
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class FontNameMenu
+
+Beschreibung
+
+Erlaubt die Auswahl von Fonts. Das Menu wird ueber Fill mit den FontNamen
+gefuellt. Fill sortiert automatisch die FontNamen (inkl. aller Umlaute und
+sprachabhaengig). Mit SetCurName()/GetCurName() kann der aktuelle Fontname
+gesetzt/abgefragt werden. Wenn SetCurName() mit einem leeren String
+aufgerufen wird, wird kein Eintrag als aktueller angezeigt (fuer DontKnow).
+Vor dem Selectaufruf wird der ausgewaehlte Name automatisch als aktueller
+gesetzt und wuerde beim naechsten Aufruf auch als aktueller Name angezeigt
+werden. Deshalb sollte vor PopupMenu::Execute() gegebenenfalls mit
+SetCurName() der aktuelle Fontname gesetzt werden.
+
+Da die Id's und der interne Aufbau des Menus nicht bekannt ist, muss ein
+Select-Handler gesetzt werden, um die Auswahl eines Namens mitzubekommen.
+
+In dieses Menu koennen keine weiteren Items eingefuegt werden.
+
+Spaeter soll auch das Menu die gleichen Bitmaps anzeigen, wie die
+FontNameBox. Auf den Systemen, wo Menues nicht automatisch scrollen,
+wird spaeter wohl ein A-Z Menu ziwschengeschaltet. Da ein Menu bei vielen
+installierten Fonts bisher schon immer lange gebraucht hat, sollte dieses
+Menu schon jetzt nur einmal erzeugt werden (da sonst das Kontextmenu bis
+zu 10-Sekunden fuer die Erzeugung brauchen koennte).
+
+Querverweise
+
+FontList; FontSizeMenu; FontNameBox
+
+--------------------------------------------------------------------------
+
+class FontSizeMenu
+
+Beschreibung
+
+Erlaubt die Auswahl von Fontgroessen. Ueber Fill wird das FontSizeMenu
+gefuellt und ueber GetCurHeight() kann die ausgewaehlte Fontgroesse
+abgefragt werden. Mit SetCurHeight()/GetCurHeight() kann die aktuelle
+Fontgroesse gesetzt/abgefragt werden. Wenn SetCurHeight() mit 0 aufgerufen
+wird, wird kein Eintrag als aktueller angezeigt (fuer DontKnow). Vor dem
+Selectaufruf wird die ausgewaehlte Groesse automatisch als aktuelle gesetzt
+und wuerde beim naechsten Aufruf auch als aktuelle Groesse angezeigt werden.
+Deshalb sollte vor PopupMenu::Execute() gegebenenfalls mit SetCurHeight()
+die aktuelle Groesse gesetzt werden. Da die Groessen vom ausgewaehlten Font
+abhaengen, sollte nach einer Aenderung des Fontnamen das Menu mit Fill mit
+den Groessen des Fonts neu gefuellt werden.
+
+Da die Id's und der interne Aufbau des Menus nicht bekannt ist, muss ein
+Select-Handler gesetzt werden, um die Auswahl einer Groesse mitzubekommen.
+
+Alle Groessen werden in 10tel Point angegeben.
+
+In dieses Menu koennen keine weiteren Items eingefuegt werden.
+
+Spaeter soll das Menu je nach System die Groessen anders darstelllen. Zum
+Beispiel koennte der Mac spaeter vielleicht einmal die Groessen als Outline
+darstellen, die als Bitmap-Fonts vorhanden sind.
+
+Querverweise
+
+FontList; FontNameMenu; FontSizeBox
+
+*************************************************************************/
+
+// ----------------
+// - FontNameMenu -
+// ----------------
+
+class SVT_DLLPUBLIC FontNameMenu : public PopupMenu
+{
+private:
+ OUString maCurName;
+ Link maSelectHdl;
+ Link maHighlightHdl;
+
+public:
+ FontNameMenu();
+ virtual ~FontNameMenu();
+
+ virtual void Select();
+ virtual void Highlight();
+
+ void Fill( const FontList* pList );
+
+ void SetCurName( const OUString& rName );
+ const OUString& GetCurName() const { return maCurName; }
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetHighlightHdl( const Link& rLink ) { maHighlightHdl = rLink; }
+ const Link& GetHighlightHdl() const { return maHighlightHdl; }
+};
+
+// ----------------
+// - FontSizeMenu -
+// ----------------
+
+class SVT_DLLPUBLIC FontSizeMenu : public PopupMenu
+{
+private:
+ long* mpHeightAry;
+ long mnCurHeight;
+ Link maSelectHdl;
+ Link maHighlightHdl;
+
+public:
+ FontSizeMenu();
+ ~FontSizeMenu();
+
+ virtual void Select();
+ virtual void Highlight();
+
+ void Fill( const FontInfo& rInfo, const FontList* pList );
+
+ void SetCurHeight( long nHeight );
+ long GetCurHeight() const { return mnCurHeight; }
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetHighlightHdl( const Link& rLink ) { maHighlightHdl = rLink; }
+ const Link& GetHighlightHdl() const { return maHighlightHdl; }
+};
+
+#endif // _STDMENU_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/stringtransfer.hxx b/include/svtools/stringtransfer.hxx
new file mode 100644
index 000000000000..c496b34b1361
--- /dev/null
+++ b/include/svtools/stringtransfer.hxx
@@ -0,0 +1,76 @@
+/* -*- 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_STRINGTRANSFER_HXX_
+#define _SVTOOLS_STRINGTRANSFER_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <svtools/transfer.hxx>
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= OStringTransferable
+ //====================================================================
+ class SVT_DLLPUBLIC OStringTransferable : public TransferableHelper
+ {
+ protected:
+ OUString m_sContent;
+
+ public:
+ OStringTransferable(const OUString& _rContent);
+
+ protected:
+ // TransferableHelper overridables
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& _rFlavor );
+ };
+
+ //====================================================================
+ //= 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, Window* _pWindow = NULL );
+
+ /** 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 sal_Bool PasteString( OUString& _rContent, Window* _pWindow = NULL );
+
+ /** starts dragging a simple string
+ */
+ SVT_DLLPUBLIC static void StartStringDrag( const OUString& _rContent, Window* _pWindow, sal_Int8 _nDragSourceActions );
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // _SVTOOLS_STRINGTRANSFER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svlbitm.hxx b/include/svtools/svlbitm.hxx
new file mode 100644
index 000000000000..14784835fa6b
--- /dev/null
+++ b/include/svtools/svlbitm.hxx
@@ -0,0 +1,257 @@
+/* -*- 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 _SVLBOXITM_HXX
+#define _SVLBOXITM_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <tools/link.hxx>
+
+#include <vcl/image.hxx>
+#include <svtools/treelistbox.hxx>
+
+class SvTreeListEntry;
+
+
+#define SV_BMP_UNCHECKED 0
+#define SV_BMP_CHECKED 1
+#define SV_BMP_TRISTATE 2
+#define SV_BMP_HIUNCHECKED 3
+#define SV_BMP_HICHECKED 4
+#define SV_BMP_HITRISTATE 5
+#define SV_BMP_STATICIMAGE 6
+
+struct SvLBoxButtonData_Impl;
+
+class SVT_DLLPUBLIC SvLBoxButtonData
+{
+private:
+ Link aLink;
+ long nWidth;
+ long nHeight;
+ SvLBoxButtonData_Impl* pImpl;
+ sal_Bool bDataOk;
+ SvButtonState eState;
+
+ SVT_DLLPRIVATE void SetWidthAndHeight();
+ SVT_DLLPRIVATE void InitData( sal_Bool bImagesFromDefault,
+ bool _bRadioBtn, const Control* pControlForSettings = NULL );
+public:
+ // include creating default images (CheckBox or RadioButton)
+ SvLBoxButtonData( const Control* pControlForSettings );
+ SvLBoxButtonData( const Control* pControlForSettings, bool _bRadioBtn );
+
+ ~SvLBoxButtonData();
+
+ sal_uInt16 GetIndex( sal_uInt16 nItemState );
+ long Width();
+ long Height();
+ void SetLink( const Link& rLink) { aLink=rLink; }
+ const Link& GetLink() const { return aLink; }
+ sal_Bool IsRadio();
+ // weil Buttons nicht von LinkHdl abgeleitet sind
+ void CallLink();
+
+ void StoreButtonState( SvTreeListEntry* pEntry, sal_uInt16 nItemFlags );
+ SvButtonState ConvertToButtonState( sal_uInt16 nItemFlags ) const;
+
+ SvButtonState GetActButtonState() const
+ {
+ return eState;
+ }
+
+ SvTreeListEntry* GetActEntry() const;
+
+ Image aBmps[24]; // Indizes siehe Konstanten BMP_ ....
+
+ void SetDefaultImages( const Control* pControlForSettings = NULL );
+ // set images acording to the color scheeme of the Control
+ // pControlForSettings == NULL: settings are taken from Application
+ sal_Bool HasDefaultImages( void ) const;
+};
+
+// **********************************************************************
+
+class SVT_DLLPUBLIC SvLBoxString : public SvLBoxItem
+{
+protected:
+ OUString maText;
+public:
+ SvLBoxString(SvTreeListEntry*, sal_uInt16 nFlags, const OUString& rStr);
+ SvLBoxString();
+ virtual ~SvLBoxString();
+ virtual sal_uInt16 GetType() const;
+ virtual void InitViewData(SvTreeListBox*, SvTreeListEntry*, SvViewDataItem*);
+ OUString GetText() const { return maText; }
+ void SetText( const OUString& rText ) { maText = rText; }
+
+ virtual void Paint(
+ const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
+
+ virtual SvLBoxItem* Create() const;
+ virtual void Clone( SvLBoxItem* pSource );
+};
+
+class SvLBoxBmp : public SvLBoxItem
+{
+ Image aBmp;
+public:
+ SvLBoxBmp();
+ virtual ~SvLBoxBmp();
+ virtual sal_uInt16 GetType() const;
+ virtual void InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* );
+ virtual void Paint(
+ const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
+ virtual SvLBoxItem* Create() const;
+ virtual void Clone( SvLBoxItem* pSource );
+};
+
+
+#define SV_ITEMSTATE_UNCHECKED 0x0001
+#define SV_ITEMSTATE_CHECKED 0x0002
+#define SV_ITEMSTATE_TRISTATE 0x0004
+#define SV_ITEMSTATE_HILIGHTED 0x0008
+#define SV_STATE_MASK 0xFFF8 // zum Loeschen von UNCHECKED,CHECKED,TRISTATE
+
+class SVT_DLLPUBLIC SvLBoxButton : public SvLBoxItem
+{
+ SvLBoxButtonData* pData;
+ SvLBoxButtonKind eKind;
+ sal_uInt16 nItemFlags;
+ sal_uInt16 nBaseOffs;
+
+ void ImplAdjustBoxSize( Size& io_rCtrlSize, ControlType i_eType, Window* pParent );
+public:
+ // An SvLBoxButton can be of three different kinds: an
+ // enabled checkbox (the normal kind), a disabled checkbox
+ // (which cannot be modified via UI), or a static image
+ // (see SV_BMP_STATICIMAGE; nFlags are effectively ignored
+ // for that kind).
+ SvLBoxButton( SvTreeListEntry* pEntry,
+ SvLBoxButtonKind eTheKind, sal_uInt16 nFlags,
+ SvLBoxButtonData* pBData );
+ SvLBoxButton();
+ virtual ~SvLBoxButton();
+ virtual void InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* );
+ virtual sal_uInt16 GetType() const;
+ virtual sal_Bool ClickHdl(SvTreeListBox* pView, SvTreeListEntry* );
+ virtual void Paint(
+ const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
+ virtual SvLBoxItem* Create() const;
+ virtual void Clone( SvLBoxItem* pSource );
+ sal_uInt16 GetButtonFlags() const { return nItemFlags; }
+ sal_Bool IsStateChecked() const { return (sal_Bool)(nItemFlags & SV_ITEMSTATE_CHECKED)!=0; }
+ sal_Bool IsStateUnchecked() const { return (sal_Bool)(nItemFlags & SV_ITEMSTATE_UNCHECKED)!=0; }
+ sal_Bool IsStateTristate() const { return (sal_Bool)(nItemFlags & SV_ITEMSTATE_TRISTATE)!=0; }
+ sal_Bool IsStateHilighted() const { return (sal_Bool)(nItemFlags & SV_ITEMSTATE_HILIGHTED)!=0; }
+ void SetStateChecked();
+ void SetStateUnchecked();
+ void SetStateTristate();
+ void SetStateHilighted( sal_Bool bHilight );
+
+ SvLBoxButtonKind GetKind() const { return eKind; }
+
+ void SetBaseOffs( sal_uInt16 nOffs ) { nBaseOffs = nOffs; }
+ sal_uInt16 GetBaseOffs() const { return nBaseOffs; }
+
+ // Check whether this button can be modified via UI
+ bool CheckModification() const;
+};
+
+inline void SvLBoxButton::SetStateChecked()
+{
+ nItemFlags &= SV_STATE_MASK;
+ nItemFlags |= SV_ITEMSTATE_CHECKED;
+}
+inline void SvLBoxButton::SetStateUnchecked()
+{
+ nItemFlags &= SV_STATE_MASK;
+ nItemFlags |= SV_ITEMSTATE_UNCHECKED;
+}
+inline void SvLBoxButton::SetStateTristate()
+{
+ nItemFlags &= SV_STATE_MASK;
+ nItemFlags |= SV_ITEMSTATE_TRISTATE;
+}
+inline void SvLBoxButton::SetStateHilighted( sal_Bool bHilight )
+{
+ if ( bHilight )
+ nItemFlags |= SV_ITEMSTATE_HILIGHTED;
+ else
+ nItemFlags &= ~SV_ITEMSTATE_HILIGHTED;
+}
+
+
+struct SvLBoxContextBmp_Impl;
+class SVT_DLLPUBLIC SvLBoxContextBmp : public SvLBoxItem
+{
+ SvLBoxContextBmp_Impl* m_pImpl;
+public:
+ SvLBoxContextBmp(
+ SvTreeListEntry* pEntry, sal_uInt16 nItemFlags, Image aBmp1, Image aBmp2, bool bExpanded);
+ SvLBoxContextBmp();
+
+ virtual ~SvLBoxContextBmp();
+ virtual sal_uInt16 GetType() const;
+ virtual void InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* );
+ virtual void Paint(
+ const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
+ virtual SvLBoxItem* Create() const;
+ virtual void Clone( SvLBoxItem* pSource );
+
+
+ sal_Bool SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2 );
+ void GetModeImages( Image& _rBitmap1, Image& _rBitmap2 ) const;
+
+ inline void SetBitmap1( const Image& _rImage );
+ inline void SetBitmap2( const Image& _rImage );
+ inline const Image& GetBitmap1( ) const;
+ inline const Image& GetBitmap2( ) const;
+
+private:
+ Image& implGetImageStore( sal_Bool _bFirst );
+};
+
+inline void SvLBoxContextBmp::SetBitmap1( const Image& _rImage )
+{
+ implGetImageStore( sal_True ) = _rImage;
+}
+
+inline void SvLBoxContextBmp::SetBitmap2( const Image& _rImage )
+{
+ implGetImageStore( sal_False ) = _rImage;
+}
+
+inline const Image& SvLBoxContextBmp::GetBitmap1( ) const
+{
+ Image& rImage = const_cast< SvLBoxContextBmp* >( this )->implGetImageStore( sal_True );
+ return rImage;
+}
+
+inline const Image& SvLBoxContextBmp::GetBitmap2( ) const
+{
+ Image& rImage = const_cast< SvLBoxContextBmp* >( this )->implGetImageStore( sal_False );
+ return rImage;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svmedit.hxx b/include/svtools/svmedit.hxx
new file mode 100644
index 000000000000..c0672a520824
--- /dev/null
+++ b/include/svtools/svmedit.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 _SVEDIT_HXX
+#define _SVEDIT_HXX
+
+#include <vcl/svapp.hxx>
+#include <vcl/vclmedit.hxx>
+
+#include <comphelper/syntaxhighlight.hxx>
+#include <svtools/svtdllapi.h>
+#include <svtools/colorcfg.hxx>
+
+
+
+class SVT_DLLPUBLIC MultiLineEdit : public VclMultiLineEdit
+{
+public:
+ MultiLineEdit( Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER );
+ MultiLineEdit( Window* pParent, const ResId& rResId );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
+ GetComponentInterface(sal_Bool bCreate = sal_True);
+};
+
+
+#endif //_SVEDIT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svmedit2.hxx b/include/svtools/svmedit2.hxx
new file mode 100644
index 000000000000..68b754163e19
--- /dev/null
+++ b/include/svtools/svmedit2.hxx
@@ -0,0 +1,46 @@
+/* -*- 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_SVMEDIT2_HXX
+#define _SVTOOLS_SVMEDIT2_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/svmedit.hxx>
+
+class TextAttrib;
+
+class SVT_DLLPUBLIC ExtMultiLineEdit : public MultiLineEdit
+{
+public:
+ ExtMultiLineEdit( Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER );
+ ExtMultiLineEdit( Window* pParent, const ResId& rResId );
+ ~ExtMultiLineEdit();
+
+ // methods of TextView
+ void InsertText( const String& rNew, sal_Bool bSelect = sal_False );
+ void SetAutoScroll( sal_Bool bAutoScroll );
+
+ // methods of TextEngine
+ void SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd );
+ void SetLeftMargin( sal_uInt16 nLeftMargin );
+ sal_uLong GetParagraphCount() const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svparser.hxx b/include/svtools/svparser.hxx
new file mode 100644
index 000000000000..bd2ee966469a
--- /dev/null
+++ b/include/svtools/svparser.hxx
@@ -0,0 +1,278 @@
+/* -*- 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 _SVPARSER_HXX
+#define _SVPARSER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/link.hxx>
+#include <tools/string.hxx>
+#include <tools/ref.hxx>
+#include <rtl/textenc.h>
+#include <boost/ptr_container/ptr_vector.hpp>
+#include <boost/utility.hpp>
+#include <vector>
+
+struct SvParser_Impl;
+class SvStream;
+
+enum SvParserState
+{
+ SVPAR_ACCEPTED = 0,
+ SVPAR_NOTSTARTED,
+ SVPAR_WORKING,
+ SVPAR_PENDING,
+ SVPAR_WAITFORDATA,
+ SVPAR_ERROR
+};
+
+class SVT_DLLPUBLIC SvParser : public SvRefBase
+{
+ DECL_STATIC_LINK( SvParser, NewDataRead, void* );
+
+protected:
+ SvStream& rInput;
+ String aToken; // gescanntes Token
+ sal_uLong nlLineNr; // akt. Zeilen Nummer
+ sal_uLong nlLinePos; // akt. Spalten Nummer
+
+ SvParser_Impl *pImplData; // interne Daten
+ long nTokenValue; // zusaetzlicher Wert (RTF)
+ sal_Bool bTokenHasValue; // indicates whether nTokenValue is valid
+ SvParserState eState; // Status auch in abgl. Klassen
+
+ rtl_TextEncoding eSrcEnc; // Source encoding
+
+ sal_uLong nNextChPos;
+ sal_Unicode nNextCh; // Akt. Zeichen fuer die "lex"
+
+
+ sal_Bool bDownloadingFile : 1;// sal_True: Es wird gerade ein externes
+ // File geladen. d.h. alle
+ // DataAvailable Links muessen
+ // ignoriert werden.
+ // Wenn keibes der folgenden
+ // Flags gesetzt ist, wird der
+ // Stream als ANSI gelesen,
+ // aber als CharSet DONTKNOW
+ // zurueckgegeben.
+ sal_Bool bUCS2BSrcEnc : 1; // oder als big-endian UCS2
+ sal_Bool bSwitchToUCS2 : 1; // Umschalten des ist erlaubt
+
+ sal_Bool bRTF_InTextRead : 1; // only for RTF-Parser!!!
+
+ struct TokenStackType
+ {
+ String sToken;
+ long nTokenValue;
+ sal_Bool bTokenHasValue;
+ int nTokenId;
+
+ inline TokenStackType() { nTokenId = 0; }
+ inline ~TokenStackType() { }
+ };
+
+ // Methoden fuer Token-Stack
+ int SkipToken( short nCnt = -1 ); // n Tokens zurueck "skippen"
+ TokenStackType* GetStackPtr( short nCnt );
+ inline sal_uInt8 GetStackPos() const;
+
+ // scanne das naechste Token:
+ // Tokenstack abarbeiten und ggfs. _GetNextToken() rufen. Diese
+ // ist fuers erkennen von neuen Token verantwortlich
+ int GetNextToken();
+ virtual int _GetNextToken() = 0;
+
+ // wird fuer jedes Token gerufen, das in CallParser erkannt wird
+ virtual void NextToken( int nToken );
+
+ // zu Zeiten der SvRefBase-Ableitung darf nicht jeder loeschen
+ virtual ~SvParser();
+
+ void ClearTxtConvContext();
+
+private:
+ TokenStackType* pTokenStack;
+ TokenStackType *pTokenStackPos;
+ sal_uInt8 nTokenStackSize, nTokenStackPos;
+
+public:
+ // Konstruktor
+ SvParser( SvStream& rIn, sal_uInt8 nStackSize = 3 );
+
+ virtual SvParserState CallParser() = 0; // Aufruf des Parsers
+
+ inline SvParserState GetStatus() const { return eState; } // StatusInfo
+
+ inline sal_uLong GetLineNr() const { return nlLineNr; }
+ inline sal_uLong GetLinePos() const { return nlLinePos; }
+ inline sal_uLong IncLineNr() { return ++nlLineNr; }
+ inline sal_uLong IncLinePos() { return ++nlLinePos; }
+ inline sal_uLong SetLineNr( sal_uLong nlNum ); // inline unten
+ inline sal_uLong SetLinePos( sal_uLong nlPos ); // inline unten
+
+ sal_Unicode GetNextChar();
+ void RereadLookahead();
+
+ inline int IsParserWorking() const { return SVPAR_WORKING == eState; }
+
+ Link GetAsynchCallLink() const
+ { return STATIC_LINK( this, SvParser, NewDataRead ); }
+
+ long CallAsyncCallLink() { return NewDataRead( this, 0 ); }
+
+ // fuers asynchrone lesen aus dem SvStream
+ /*virtual*/ void SaveState( int nToken );
+ /*virtual*/ void RestoreState();
+ virtual void Continue( int nToken );
+
+ inline void SetDownloadingFile( sal_Bool bSet ) { bDownloadingFile = bSet; }
+ inline sal_Bool IsDownloadingFile() const { return bDownloadingFile; }
+
+ // 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 { return eSrcEnc; }
+
+ void SetSrcUCS2BEncoding( sal_Bool bSet ) { bUCS2BSrcEnc = bSet; }
+ sal_Bool IsSrcUCS2BEncoding() const { return bUCS2BSrcEnc; }
+
+ // Darf der Zeichensatz auf UCS/2 umgeschaltet werden, wenn
+ // in den ersten beiden Zeichen im Stream eine BOM steht?
+ void SetSwitchToUCS2( sal_Bool bSet ) { bSwitchToUCS2 = bSet; }
+ sal_Bool IsSwitchToUCS2() const { return bSwitchToUCS2; }
+
+ // Aus wie vielen Bytes betseht ein Zeichen
+ inline sal_uInt16 GetCharSize() const;
+
+ int GetSaveToken() const;
+
+ // Aufbau einer Which-Map 'rWhichMap' aus einem Array von
+ // 'pWhichIds' von Which-Ids. Es hat die Lange 'nWhichIds'.
+ // Die Which-Map wird nicht geloescht.
+ static void BuildWhichTbl( std::vector<sal_uInt16> &rWhichMap,
+ sal_uInt16 *pWhichIds,
+ sal_uInt16 nWhichIds );
+};
+
+
+#ifndef GOODIES_DECL_SVPARSER_DEFINED
+#define GOODIES_DECL_SVPARSER_DEFINED
+SV_DECL_REF(SvParser)
+#endif
+SV_IMPL_REF(SvParser)
+
+
+
+inline sal_uLong SvParser::SetLineNr( sal_uLong nlNum )
+{ sal_uLong nlOld = nlLineNr; nlLineNr = nlNum; return nlOld; }
+
+inline sal_uLong SvParser::SetLinePos( sal_uLong nlPos )
+{ sal_uLong nlOld = nlLinePos; nlLinePos = nlPos; return nlOld; }
+
+inline sal_uInt8 SvParser::GetStackPos() const
+{ return nTokenStackPos; }
+
+inline sal_uInt16 SvParser::GetCharSize() const
+{
+ return (RTL_TEXTENCODING_UCS2 == eSrcEnc) ? 2 : 1;
+}
+
+
+/*========================================================================
+ *
+ * SvKeyValue.
+ *
+ *======================================================================*/
+
+SV_DECL_REF(SvKeyValueIterator)
+
+class SvKeyValue
+{
+ /** Representation.
+ */
+ String m_aKey;
+ String m_aValue;
+
+public:
+ /** Construction.
+ */
+ SvKeyValue (void)
+ {}
+
+ SvKeyValue (const String &rKey, const String &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 &rOther)
+ {
+ m_aKey = rOther.m_aKey;
+ m_aValue = rOther.m_aValue;
+ return *this;
+ }
+
+ /** Operation.
+ */
+ const String& GetKey (void) const { return m_aKey; }
+ const String& GetValue (void) const { return m_aValue; }
+
+ void SetKey (const String &rKey ) { m_aKey = rKey; }
+ void SetValue (const String &rValue) { m_aValue = rValue; }
+};
+
+/*========================================================================
+ *
+ * SvKeyValueIterator.
+ *
+ *======================================================================*/
+
+typedef boost::ptr_vector<SvKeyValue> SvKeyValueList_Impl;
+
+class SVT_DLLPUBLIC SvKeyValueIterator : public SvRefBase,
+ private boost::noncopyable
+{
+ /** Representation.
+ */
+ SvKeyValueList_Impl* m_pList;
+ sal_uInt16 m_nPos;
+
+public:
+ /** Construction/Destruction.
+ */
+ SvKeyValueIterator (void);
+ virtual ~SvKeyValueIterator (void);
+
+ /** Operation.
+ */
+ virtual sal_Bool GetFirst (SvKeyValue &rKeyVal);
+ virtual sal_Bool GetNext (SvKeyValue &rKeyVal);
+ virtual void Append (const SvKeyValue &rKeyVal);
+};
+
+SV_IMPL_REF(SvKeyValueIterator);
+
+#endif //_SVPARSER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svtabbx.hxx b/include/svtools/svtabbx.hxx
new file mode 100644
index 000000000000..7bcd0591b2d1
--- /dev/null
+++ b/include/svtools/svtabbx.hxx
@@ -0,0 +1,255 @@
+/* -*- 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 _SVTABBX_HXX
+#define _SVTABBX_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/treelistbox.hxx>
+#include <svtools/accessibletableprovider.hxx>
+
+#include <vector>
+
+enum SvTabJustify
+{
+ AdjustRight = SV_LBOXTAB_ADJUST_RIGHT,
+ AdjustLeft = SV_LBOXTAB_ADJUST_LEFT,
+ AdjustCenter = SV_LBOXTAB_ADJUST_CENTER,
+ AdjustNumeric = SV_LBOXTAB_ADJUST_NUMERIC
+};
+
+struct TabListBoxEventData
+{
+ SvTreeListEntry* m_pEntry;
+ sal_uInt16 m_nColumn;
+ String m_sOldText;
+
+ TabListBoxEventData( SvTreeListEntry* pEntry, sal_uInt16 nColumn, const String& rOldText ) :
+ m_pEntry( pEntry ), m_nColumn( nColumn ), m_sOldText( rOldText ) {}
+};
+
+class SVT_DLLPUBLIC SvTabListBox : public SvTreeListBox
+{
+private:
+ SvLBoxTab* pTabList;
+ sal_uInt16 nTabCount;
+ XubString aCurEntry;
+
+protected:
+ SvTreeListEntry* pViewParent;
+
+ static const sal_Unicode* GetToken( const sal_Unicode* pPtr, sal_uInt16& rLen );
+
+ virtual void SetTabs();
+ virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind);
+
+ String GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const;
+ SvTreeListEntry* GetEntryOnPos( sal_uLong _nEntryPos ) const;
+ SvTreeListEntry* GetChildOnPos( SvTreeListEntry* _pParent, sal_uLong _nEntryPos, sal_uLong& _rPos ) const;
+
+public:
+ SvTabListBox( Window* pParent, WinBits = WB_BORDER );
+ SvTabListBox( Window* pParent, const ResId& );
+ ~SvTabListBox();
+ void SetTabs( long* pTabs, MapUnit = MAP_APPFONT );
+ sal_uInt16 TabCount() const { return (sal_uInt16)nTabCount; }
+ using SvTreeListBox::GetTab;
+ long GetTab( sal_uInt16 nTab ) const;
+ void SetTab( sal_uInt16 nTab, long nValue, MapUnit = MAP_APPFONT );
+ long GetLogicTab( sal_uInt16 nTab );
+
+ virtual SvTreeListEntry* InsertEntry( const XubString& rText, SvTreeListEntry* pParent = 0,
+ sal_Bool bChildrenOnDemand = sal_False,
+ sal_uLong nPos=LIST_APPEND, void* pUserData = 0,
+ SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
+
+ virtual SvTreeListEntry* InsertEntry( const XubString& rText,
+ const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp,
+ SvTreeListEntry* pParent = 0,
+ sal_Bool bChildrenOnDemand = sal_False,
+ sal_uLong nPos = LIST_APPEND, void* pUserData = 0,
+ SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
+
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, sal_uLong nPos = LIST_APPEND,
+ sal_uInt16 nCol = 0xffff, void* pUserData = NULL );
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, SvTreeListEntry* pParent,
+ sal_uLong nPos, sal_uInt16 nCol, void* pUserData = NULL );
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp, SvTreeListEntry* pParent = NULL,
+ sal_uLong nPos = LIST_APPEND, sal_uInt16 nCol = 0xffff, void* pUserData = NULL );
+
+ virtual String GetEntryText( SvTreeListEntry* pEntry ) const;
+ String GetEntryText( SvTreeListEntry*, sal_uInt16 nCol ) const;
+ String GetEntryText( sal_uLong nPos, sal_uInt16 nCol = 0xffff ) const;
+ using SvTreeListBox::SetEntryText;
+ void SetEntryText( const XubString&, sal_uLong, sal_uInt16 nCol=0xffff );
+ void SetEntryText(const XubString&,SvTreeListEntry*,sal_uInt16 nCol=0xffff);
+ String GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const;
+ sal_uLong GetEntryPos( const XubString&, sal_uInt16 nCol = 0xffff );
+ sal_uLong GetEntryPos( const SvTreeListEntry* pEntry ) const;
+
+ virtual void Resize();
+ void SetTabJustify( sal_uInt16 nTab, SvTabJustify );
+};
+
+inline long SvTabListBox::GetTab( sal_uInt16 nTab ) const
+{
+ DBG_ASSERT( nTab < nTabCount, "GetTabPos:Invalid Tab" );
+ return pTabList[nTab].GetPos();
+}
+
+// class SvHeaderTabListBox ---------------------------------------------------
+
+class HeaderBar;
+namespace svt {
+ class AccessibleTabListBox;
+ class IAccessibleTabListBox;
+ struct SvHeaderTabListBoxImpl;
+}
+
+class SVT_DLLPUBLIC SvHeaderTabListBox : public SvTabListBox, public svt::IAccessibleTableProvider
+{
+private:
+ typedef ::std::vector< css::uno::Reference< css::accessibility::XAccessible > > AccessibleChildren;
+
+ sal_Bool m_bFirstPaint;
+ ::svt::SvHeaderTabListBoxImpl* m_pImpl;
+ ::svt::IAccessibleTabListBox* m_pAccessible;
+ AccessibleChildren m_aAccessibleChildren;
+
+ DECL_DLLPRIVATE_LINK( ScrollHdl_Impl, void* );
+ DECL_DLLPRIVATE_LINK( CreateAccessibleHdl_Impl, void* );
+
+ void RecalculateAccessibleChildren();
+
+public:
+ SvHeaderTabListBox( Window* pParent, WinBits nBits );
+ SvHeaderTabListBox( Window* pParent, const ResId& );
+ ~SvHeaderTabListBox();
+
+ virtual void Paint( const Rectangle& );
+
+ void InitHeaderBar( HeaderBar* pHeaderBar );
+ sal_Bool IsItemChecked( SvTreeListEntry* pEntry, sal_uInt16 nCol ) const;
+
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, sal_uLong nPos = LIST_APPEND,
+ sal_uInt16 nCol = 0xffff, void* pUserData = NULL );
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, SvTreeListEntry* pParent,
+ sal_uLong nPos, sal_uInt16 nCol, void* pUserData = NULL );
+ virtual SvTreeListEntry* InsertEntryToColumn( const XubString&, const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp, SvTreeListEntry* pParent = NULL,
+ sal_uLong nPos = LIST_APPEND, sal_uInt16 nCol = 0xffff, void* pUserData = NULL );
+ virtual sal_uLong Insert( SvTreeListEntry* pEnt,SvTreeListEntry* pPar,sal_uLong nPos=LIST_APPEND);
+ virtual sal_uLong Insert( SvTreeListEntry* pEntry, sal_uLong nRootPos = LIST_APPEND );
+ void RemoveEntry( SvTreeListEntry* _pEntry );
+ void Clear();
+
+ // Accessible -------------------------------------------------------------
+
+ inline void DisableTransientChildren() { SetChildrenNotTransient(); }
+ inline sal_Bool IsTransientChildrenDisabled() const { return !AreChildrenTransient(); }
+
+ sal_Bool IsCellCheckBox( long _nRow, sal_uInt16 _nColumn, TriState& _rState );
+
+ /** @return The count of the rows. */
+ virtual long GetRowCount() const;
+ /** @return The count of the columns. */
+ virtual sal_uInt16 GetColumnCount() const;
+
+ /** @return The position of the current row. */
+ virtual sal_Int32 GetCurrRow() const;
+ /** @return The position of the current column. */
+ virtual sal_uInt16 GetCurrColumn() const;
+
+ /** @return The description of a row.
+ @param _nRow The row which description is in demand. */
+ virtual OUString GetRowDescription( sal_Int32 _nRow ) const;
+ /** @return The description of a column.
+ @param _nColumn The column which description is in demand. */
+ virtual OUString GetColumnDescription( sal_uInt16 _nColumn ) const;
+
+ /** @return <TRUE/>, if the object has a row header. */
+ virtual sal_Bool HasRowHeader() const; //GetColumnId
+ /** @return <TRUE/>, if the object can focus a cell. */
+ virtual sal_Bool IsCellFocusable() const;
+ virtual sal_Bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn );
+
+ virtual void SetNoSelection();
+ using SvListView::SelectAll;
+ virtual void SelectAll();
+ virtual void SelectAll( sal_Bool bSelect, sal_Bool bPaint = sal_True );
+ virtual void SelectRow( long _nRow, sal_Bool _bSelect = sal_True, sal_Bool bExpand = sal_True );
+ virtual void SelectColumn( sal_uInt16 _nColumn, sal_Bool _bSelect = sal_True );
+ virtual sal_Int32 GetSelectedRowCount() const;
+ virtual sal_Int32 GetSelectedColumnCount() const;
+ /** @return <TRUE/>, if the row is selected. */
+ virtual bool IsRowSelected( long _nRow ) const;
+ virtual sal_Bool IsColumnSelected( long _nColumn ) const;
+ virtual void GetAllSelectedRows( css::uno::Sequence< sal_Int32 >& _rRows ) const;
+ virtual void GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& _rColumns ) const;
+
+ /** @return <TRUE/>, if the cell is visible. */
+ virtual sal_Bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumn ) const;
+ virtual String GetAccessibleCellText( long _nRow, sal_uInt16 _nColumnPos ) const;
+
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumn, sal_Bool _bIsHeader, sal_Bool _bOnScreen = sal_True );
+
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumn );
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleRowHeader( sal_Int32 _nRow );
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleColumnHeader( sal_uInt16 _nColumnPos );
+
+ virtual sal_Int32 GetAccessibleControlCount() const;
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex );
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint );
+
+ virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_uInt16& _rnColPos, const Point& _rPoint );
+ virtual sal_Bool ConvertPointToRowHeader( sal_Int32& _rnRow, const Point& _rPoint );
+ virtual sal_Bool ConvertPointToColumnHeader( sal_uInt16& _rnColPos, const Point& _rPoint );
+
+ virtual OUString GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const;
+ virtual OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos = -1 ) const;
+ virtual Window* GetWindowInstance();
+
+ using SvTreeListBox::FillAccessibleStateSet;
+ virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& _rStateSet, ::svt::AccessibleBrowseBoxObjType _eType ) const;
+ virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumn ) const;
+ virtual void GrabTableFocus();
+
+ // OutputDevice
+ virtual sal_Bool GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector );
+
+ // Window
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
+ virtual void GrabFocus();
+ virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True );
+ virtual Window* GetAccessibleParentWindow() const;
+
+ /** Creates and returns the accessible object of the whole BrowseBox. */
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible();
+
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex);
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
+};
+
+#endif // #ifndef _SVTABBX_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 000000000000..d8c01a464f45
--- /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_SVTDLLAPI_H
+#define INCLUDED_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_SVTDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svtools.hrc b/include/svtools/svtools.hrc
new file mode 100644
index 000000000000..ea04f469df35
--- /dev/null
+++ b/include/svtools/svtools.hrc
@@ -0,0 +1,324 @@
+/* -*- 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_HRC
+#define _SVTOOLS_HRC
+
+#include <svl/solar.hrc>
+
+#define RID_SVTOOLS_BITMAP_START (RID_SVTOOLS_START + 0)
+#define RID_SVTOOLS_IMAGELIST_START (RID_SVTOOLS_START + 0)
+
+//.............................................................................
+// various unsorted stuff
+
+#define DLG_SVT_QUERYDELETE (RID_SVTOOLS_START+6)
+
+#define STR_SVT_AUTOMATIC_COLOR (RID_SVTOOLS_START+16)
+
+#define STR_SVT_FILEVIEW_COLUMN_TITLE (RID_SVTOOLS_START + 20)
+#define STR_SVT_FILEVIEW_COLUMN_SIZE (RID_SVTOOLS_START + 21)
+#define STR_SVT_FILEVIEW_COLUMN_DATE (RID_SVTOOLS_START + 22)
+#define STR_SVT_FILEVIEW_ERR_MAKEFOLDER (RID_SVTOOLS_START + 24)
+#define STR_SVT_BYTES (RID_SVTOOLS_START + 25)
+#define STR_SVT_KB (RID_SVTOOLS_START + 26)
+#define STR_SVT_MB (RID_SVTOOLS_START + 27)
+#define STR_SVT_GB (RID_SVTOOLS_START + 28)
+#define STR_SVT_FILEVIEW_COLUMN_TYPE (RID_SVTOOLS_START + 29)
+#define STR_FILTERNAME_ALL (RID_SVTOOLS_START + 30)
+#define RID_FILEVIEW_CONTEXTMENU (RID_SVTOOLS_START + 31)
+#define STR_SVT_1BIT_THRESHOLD (RID_SVTOOLS_START + 32)
+#define STR_SVT_1BIT_DITHERED (RID_SVTOOLS_START + 33)
+#define STR_SVT_4BIT_GRAYSCALE (RID_SVTOOLS_START + 34)
+#define STR_SVT_4BIT_COLOR_PALETTE (RID_SVTOOLS_START + 35)
+#define STR_SVT_8BIT_GRAYSCALE (RID_SVTOOLS_START + 36)
+#define STR_SVT_8BIT_COLOR_PALETTE (RID_SVTOOLS_START + 37)
+#define STR_SVT_24BIT_TRUE_COLOR (RID_SVTOOLS_START + 38)
+#define STR_SVT_ESTIMATED_SIZE_PIX_1 (RID_SVTOOLS_START + 39)
+#define STR_SVT_ESTIMATED_SIZE_PIX_2 (RID_SVTOOLS_START + 40)
+#define STR_SVT_ESTIMATED_SIZE_VEC (RID_SVTOOLS_START + 41)
+
+// doc template dialog
+#define DLG_DOCTEMPLATE (RID_SVTOOLS_START+50)
+#define CTRL_FILEVIEW (RID_SVTOOLS_START+51)
+#define STR_SVT_NEWDOC (RID_SVTOOLS_START+52)
+#define STR_SVT_MYDOCS (RID_SVTOOLS_START+53)
+#define STR_SVT_TEMPLATES (RID_SVTOOLS_START+54)
+#define STR_SVT_SAMPLES (RID_SVTOOLS_START+55)
+#define TB_SVT_FILEVIEW (RID_SVTOOLS_START+56)
+#define TB_SVT_FRAMEWIN (RID_SVTOOLS_START+57)
+#define STRARY_SVT_DOCINFO (RID_SVTOOLS_START+58)
+#define STR_SVT_NEWDOC_HELP (RID_SVTOOLS_START+63)
+#define STR_SVT_MYDOCS_HELP (RID_SVTOOLS_START+64)
+#define STR_SVT_TEMPLATES_HELP (RID_SVTOOLS_START+65)
+#define STR_SVT_SAMPLES_HELP (RID_SVTOOLS_START+66)
+
+#define STR_BASICKEY_FORMAT_ON (RID_SVTOOLS_START+103)
+#define STR_BASICKEY_FORMAT_OFF (RID_SVTOOLS_START+104)
+#define STR_BASICKEY_FORMAT_YES (RID_SVTOOLS_START+105)
+#define STR_BASICKEY_FORMAT_NO (RID_SVTOOLS_START+106)
+#define STR_BASICKEY_FORMAT_TRUE (RID_SVTOOLS_START+107)
+#define STR_BASICKEY_FORMAT_FALSE (RID_SVTOOLS_START+108)
+#define STR_UNDO (RID_SVTOOLS_START+110)
+#define STR_REDO (RID_SVTOOLS_START+111)
+#define STR_REPEAT (RID_SVTOOLS_START+112)
+
+#define STR_BASICKEY_FORMAT_CURRENCY (RID_SVTOOLS_START+130)
+
+#define STR_SVT_PRNDLG_START (RID_SVTOOLS_START+141)
+
+#define STR_SVT_PRNDLG_READY (STR_SVT_PRNDLG_START+2)
+#define STR_SVT_PRNDLG_PAUSED (STR_SVT_PRNDLG_START+3)
+#define STR_SVT_PRNDLG_PENDING (STR_SVT_PRNDLG_START+4)
+#define STR_SVT_PRNDLG_BUSY (STR_SVT_PRNDLG_START+5)
+#define STR_SVT_PRNDLG_INITIALIZING (STR_SVT_PRNDLG_START+6)
+#define STR_SVT_PRNDLG_WAITING (STR_SVT_PRNDLG_START+7)
+#define STR_SVT_PRNDLG_WARMING_UP (STR_SVT_PRNDLG_START+8)
+#define STR_SVT_PRNDLG_PROCESSING (STR_SVT_PRNDLG_START+9)
+#define STR_SVT_PRNDLG_PRINTING (STR_SVT_PRNDLG_START+10)
+#define STR_SVT_PRNDLG_OFFLINE (STR_SVT_PRNDLG_START+11)
+#define STR_SVT_PRNDLG_ERROR (STR_SVT_PRNDLG_START+12)
+#define STR_SVT_PRNDLG_SERVER_UNKNOWN (STR_SVT_PRNDLG_START+13)
+#define STR_SVT_PRNDLG_PAPER_JAM (STR_SVT_PRNDLG_START+14)
+#define STR_SVT_PRNDLG_PAPER_OUT (STR_SVT_PRNDLG_START+15)
+#define STR_SVT_PRNDLG_MANUAL_FEED (STR_SVT_PRNDLG_START+16)
+#define STR_SVT_PRNDLG_PAPER_PROBLEM (STR_SVT_PRNDLG_START+17)
+#define STR_SVT_PRNDLG_IO_ACTIVE (STR_SVT_PRNDLG_START+18)
+#define STR_SVT_PRNDLG_OUTPUT_BIN_FULL (STR_SVT_PRNDLG_START+19)
+#define STR_SVT_PRNDLG_TONER_LOW (STR_SVT_PRNDLG_START+20)
+#define STR_SVT_PRNDLG_NO_TONER (STR_SVT_PRNDLG_START+21)
+#define STR_SVT_PRNDLG_PAGE_PUNT (STR_SVT_PRNDLG_START+22)
+#define STR_SVT_PRNDLG_USER_INTERVENTION (STR_SVT_PRNDLG_START+23)
+#define STR_SVT_PRNDLG_OUT_OF_MEMORY (STR_SVT_PRNDLG_START+24)
+#define STR_SVT_PRNDLG_DOOR_OPEN (STR_SVT_PRNDLG_START+25)
+#define STR_SVT_PRNDLG_POWER_SAVE (STR_SVT_PRNDLG_START+26)
+#define STR_SVT_PRNDLG_DEFPRINTER (STR_SVT_PRNDLG_START+27)
+#define STR_SVT_PRNDLG_JOBCOUNT (STR_SVT_PRNDLG_START+28)
+#define STR_SVT_PRNDLG_END (RID_IMG_PRNDLG_NOCOLLATE)
+
+#define STR_SVT_CALENDAR_START (STR_SVT_PRNDLG_END+1)
+#define STR_SVT_CALENDAR_DAY (STR_SVT_CALENDAR_START+0)
+#define STR_SVT_CALENDAR_WEEK (STR_SVT_CALENDAR_START+1)
+#define STR_SVT_CALENDAR_TODAY (STR_SVT_CALENDAR_START+2)
+#define STR_SVT_CALENDAR_NONE (STR_SVT_CALENDAR_START+3)
+#define STR_SVT_CALENDAR_END (STR_SVT_CALENDAR_NONE)
+
+#define STR_SVT_PVER_START (STR_SVT_CALENDAR_END+1)
+#define STR_SVT_PVER_OEM_PROFESSIONAL (STR_SVT_PVER_START+16)
+#define STR_SVT_PVER_END (STR_SVT_PVER_OEM_PROFESSIONAL)
+
+#define STR_SVT_STYLE_START (STR_SVT_PVER_END+1)
+#define STR_SVT_STYLE_LIGHT (STR_SVT_STYLE_START+0)
+#define STR_SVT_STYLE_LIGHT_ITALIC (STR_SVT_STYLE_START+1)
+#define STR_SVT_STYLE_NORMAL (STR_SVT_STYLE_START+2)
+#define STR_SVT_STYLE_NORMAL_ITALIC (STR_SVT_STYLE_START+3)
+#define STR_SVT_STYLE_BOLD (STR_SVT_STYLE_START+4)
+#define STR_SVT_STYLE_BOLD_ITALIC (STR_SVT_STYLE_START+5)
+#define STR_SVT_STYLE_BLACK (STR_SVT_STYLE_START+6)
+#define STR_SVT_STYLE_BLACK_ITALIC (STR_SVT_STYLE_START+7)
+#define STR_SVT_STYLE_END (STR_SVT_STYLE_BLACK_ITALIC)
+
+#define STR_SVT_FONTMAP_START (STR_SVT_STYLE_END+1)
+#define STR_SVT_FONTMAP_BOTH (STR_SVT_FONTMAP_START+0)
+#define STR_SVT_FONTMAP_PRINTERONLY (STR_SVT_FONTMAP_START+1)
+#define STR_SVT_FONTMAP_SCREENONLY (STR_SVT_FONTMAP_START+2)
+#define STR_SVT_FONTMAP_SIZENOTAVAILABLE (STR_SVT_FONTMAP_START+3)
+#define STR_SVT_FONTMAP_STYLENOTAVAILABLE (STR_SVT_FONTMAP_START+4)
+#define STR_SVT_FONTMAP_NOTAVAILABLE (STR_SVT_FONTMAP_START+5)
+#define STR_SVT_FONTMAP_END (STR_SVT_FONTMAP_NOTAVAILABLE)
+
+#define STR_SVT_ERRORCONTEXT_START (STR_SVT_FONTMAP_END+1)
+#define STR_ERR_HDLMESS (STR_SVT_ERRORCONTEXT_START+0)
+#define RID_ERRHDL_CLASS (STR_SVT_ERRORCONTEXT_START+1)
+#define RID_ERRCTX (STR_SVT_ERRORCONTEXT_START+2)
+#define RID_ERRHDL (STR_SVT_ERRORCONTEXT_START+3)
+#define STR_SVT_ERRORCONTEXT_END (RID_ERRHDL)
+
+#define STR_WIZARDDIALOG_START (STR_SVT_ERRORCONTEXT_END + 1)
+#define STR_WIZDLG_FINISH (STR_WIZARDDIALOG_START + 0)
+#define STR_WIZDLG_NEXT (STR_WIZARDDIALOG_START + 1)
+#define STR_WIZDLG_PREVIOUS (STR_WIZARDDIALOG_START + 2)
+#define STR_WIZDLG_ROADMAP_TITLE (STR_WIZARDDIALOG_START + 3)
+#define STR_WIZARDDIALOG_END (STR_WIZDLG_ROADMAP_TITLE)
+
+#define STR_SVT_COLLATE_START (STR_WIZARDDIALOG_END+1)
+#define STR_SVT_COLLATE_NORMAL (STR_SVT_COLLATE_START+0)
+#define STR_SVT_COLLATE_DICTIONARY (STR_SVT_COLLATE_START+1)
+#define STR_SVT_COLLATE_PINYIN (STR_SVT_COLLATE_START+2)
+#define STR_SVT_COLLATE_STROKE (STR_SVT_COLLATE_START+3)
+#define STR_SVT_COLLATE_RADICAL (STR_SVT_COLLATE_START+4)
+#define STR_SVT_COLLATE_CHARSET (STR_SVT_COLLATE_START+5)
+#define STR_SVT_COLLATE_ZHUYIN (STR_SVT_COLLATE_START+6)
+#define STR_SVT_COLLATE_ALPHANUMERIC (STR_SVT_COLLATE_START+7)
+#define STR_SVT_COLLATE_UNICODE (STR_SVT_COLLATE_START+8)
+#define STR_SVT_COLLATE_PHONEBOOK (STR_SVT_COLLATE_START+9)
+#define STR_SVT_COLLATE_PHONETIC_F (STR_SVT_COLLATE_START+10)
+#define STR_SVT_COLLATE_PHONETIC_L (STR_SVT_COLLATE_START+11)
+#define STR_SVT_COLLATE_END (STR_SVT_COLLATE_PHONETIC_L)
+
+// String-Ids for accessibility
+#define STR_SVT_ACC_BEGIN (STR_SVT_COLLATE_END+1)
+#define STR_SVT_TOOL_PANEL_BUTTON_FWD (STR_SVT_ACC_BEGIN+0)
+#define STR_SVT_TOOL_PANEL_BUTTON_BACK (STR_SVT_ACC_BEGIN+1)
+#define STR_SVT_ACC_DESC_TABLISTBOX (STR_SVT_ACC_BEGIN+2)
+#define STR_SVT_ACC_DESC_FILEVIEW (STR_SVT_ACC_BEGIN+3)
+#define STR_SVT_ACC_DESC_FOLDER (STR_SVT_ACC_BEGIN+4)
+#define STR_SVT_ACC_DESC_FILE (STR_SVT_ACC_BEGIN+5)
+#define STR_SVT_ACC_EMPTY_FIELD (STR_SVT_ACC_BEGIN+6)
+//IAccessible2 implementation
+#define STR_SVT_ACC_RULER_HORZ_NAME (STR_SVT_ACC_BEGIN+9)
+#define STR_SVT_ACC_END (STR_SVT_ACC_RULER_HORZ_NAME)
+
+#define STR_SVT_INDEXENTRY_START (STR_SVT_ACC_END + 1)
+#define STR_SVT_INDEXENTRY_ALPHANUMERIC (STR_SVT_INDEXENTRY_START+0)
+#define STR_SVT_INDEXENTRY_DICTIONARY (STR_SVT_INDEXENTRY_START+1)
+#define STR_SVT_INDEXENTRY_PINYIN (STR_SVT_INDEXENTRY_START+2)
+#define STR_SVT_INDEXENTRY_RADICAL (STR_SVT_INDEXENTRY_START+3)
+#define STR_SVT_INDEXENTRY_STROKE (STR_SVT_INDEXENTRY_START+4)
+#define STR_SVT_INDEXENTRY_ZHUYIN (STR_SVT_INDEXENTRY_START+5)
+#define STR_SVT_INDEXENTRY_PHONETIC_FS (STR_SVT_INDEXENTRY_START+6)
+#define STR_SVT_INDEXENTRY_PHONETIC_FC (STR_SVT_INDEXENTRY_START+7)
+#define STR_SVT_INDEXENTRY_PHONETIC_LS (STR_SVT_INDEXENTRY_START+8)
+#define STR_SVT_INDEXENTRY_PHONETIC_LC (STR_SVT_INDEXENTRY_START+9)
+#define STR_SVT_INDEXENTRY_END (STR_SVT_INDEXENTRY_PHONETIC_LC)
+
+//String - Ids for Java errors, messages
+//These strings come from project desktop
+//There was no time for translation, therefore the defines needed to
+//remain the same.
+#define STR_SVT_JAVAERROR_START (STR_SVT_INDEXENTRY_END + 1)
+#define STR_QUESTION_JAVADISABLED (STR_SVT_JAVAERROR_START+0)
+#define STR_ERROR_JVMCREATIONFAILED (STR_SVT_JAVAERROR_START+1)
+#define STR_WARNING_JAVANOTFOUND (STR_SVT_JAVAERROR_START+2)
+#define STR_WARNING_INVALIDJAVASETTINGS (STR_SVT_JAVAERROR_START+3)
+// STR_SVT_JAVAERROR_START + 4 unused
+#define STR_SVT_JAVAERROR_END (STR_SVT_JAVAERROR_START+4)
+
+// String array to match UI language names to LanguageType values and vice versa
+#define STR_ARR_SVT_LANGUAGE_TABLE_START (STR_SVT_JAVAERROR_END + 1)
+#define STR_ARR_SVT_LANGUAGE_TABLE (STR_ARR_SVT_LANGUAGE_TABLE_START + 0)
+//due to some horror wizards/com/sun/star/wizards/letter/LocaleCodes.java needs to be kept
+//manually in sync with STR_ARR_SVT_LANGUAGE_TABLE
+#define STR_ARR_SVT_LANGUAGE_TABLE_END (STR_ARR_SVT_LANGUAGE_TABLE)
+
+#define STR_SVT_ADDRESSTEMPLATE_START (STR_ARR_SVT_LANGUAGE_TABLE_END+1)
+#define STR_NO_FIELD_SELECTION (STR_SVT_ADDRESSTEMPLATE_START+0)
+#define STR_FIELD_COMPANY (STR_SVT_ADDRESSTEMPLATE_START+1)
+#define STR_FIELD_DEPARTMENT (STR_SVT_ADDRESSTEMPLATE_START+2)
+#define STR_FIELD_FIRSTNAME (STR_SVT_ADDRESSTEMPLATE_START+3)
+#define STR_FIELD_LASTNAME (STR_SVT_ADDRESSTEMPLATE_START+4)
+#define STR_FIELD_STREET (STR_SVT_ADDRESSTEMPLATE_START+5)
+#define STR_FIELD_COUNTRY (STR_SVT_ADDRESSTEMPLATE_START+6)
+#define STR_FIELD_ZIPCODE (STR_SVT_ADDRESSTEMPLATE_START+7)
+#define STR_FIELD_CITY (STR_SVT_ADDRESSTEMPLATE_START+8)
+#define STR_FIELD_TITLE (STR_SVT_ADDRESSTEMPLATE_START+9)
+#define STR_FIELD_POSITION (STR_SVT_ADDRESSTEMPLATE_START+10)
+#define STR_FIELD_ADDRFORM (STR_SVT_ADDRESSTEMPLATE_START+11)
+#define STR_FIELD_INITIALS (STR_SVT_ADDRESSTEMPLATE_START+12)
+#define STR_FIELD_SALUTATION (STR_SVT_ADDRESSTEMPLATE_START+13)
+#define STR_FIELD_HOMETEL (STR_SVT_ADDRESSTEMPLATE_START+14)
+#define STR_FIELD_WORKTEL (STR_SVT_ADDRESSTEMPLATE_START+15)
+#define STR_FIELD_FAX (STR_SVT_ADDRESSTEMPLATE_START+16)
+#define STR_FIELD_EMAIL (STR_SVT_ADDRESSTEMPLATE_START+17)
+#define STR_FIELD_URL (STR_SVT_ADDRESSTEMPLATE_START+18)
+#define STR_FIELD_NOTE (STR_SVT_ADDRESSTEMPLATE_START+19)
+#define STR_FIELD_USER1 (STR_SVT_ADDRESSTEMPLATE_START+20)
+#define STR_FIELD_USER2 (STR_SVT_ADDRESSTEMPLATE_START+21)
+#define STR_FIELD_USER3 (STR_SVT_ADDRESSTEMPLATE_START+22)
+#define STR_FIELD_USER4 (STR_SVT_ADDRESSTEMPLATE_START+23)
+#define STR_FIELD_ID (STR_SVT_ADDRESSTEMPLATE_START+24)
+#define STR_FIELD_STATE (STR_SVT_ADDRESSTEMPLATE_START+25)
+#define STR_FIELD_OFFICETEL (STR_SVT_ADDRESSTEMPLATE_START+26)
+#define STR_FIELD_PAGER (STR_SVT_ADDRESSTEMPLATE_START+27)
+#define STR_FIELD_MOBILE (STR_SVT_ADDRESSTEMPLATE_START+28)
+#define STR_FIELD_TELOTHER (STR_SVT_ADDRESSTEMPLATE_START+29)
+#define STR_FIELD_CALENDAR (STR_SVT_ADDRESSTEMPLATE_START+30)
+#define STR_FIELD_INVITE (STR_SVT_ADDRESSTEMPLATE_START+31)
+#define STR_LOGICAL_FIELD_NAMES (STR_SVT_ADDRESSTEMPLATE_START+32)
+#define STR_SVT_ADDRESSTEMPLATE_END (STR_LOGICAL_FIELD_NAMES)
+
+
+
+//.............................................................................
+// dialogs
+
+#define DLG_LOGIN (RID_SVTOOLS_START+113)
+#define DLG_ADDRESSBOOKSOURCE (RID_SVTOOLS_START+114)
+
+//.............................................................................
+// bitmaps
+
+#define BMP_HELP_AGENT_IMAGE (RID_SVTOOLS_BITMAP_START + 1)
+#define BMP_HELP_AGENT_CLOSER (RID_SVTOOLS_BITMAP_START + 2)
+#define BMP_PLUGIN (RID_SVTOOLS_BITMAP_START + 3)
+#define BMP_LIST_ADD (RID_SVTOOLS_BITMAP_START + 4)
+
+//.............................................................................
+// image lists
+
+#define RID_SVTOOLS_IMAGELIST_BIG (RID_SVTOOLS_IMAGELIST_START + 1)
+#define RID_SVTOOLS_IMAGELIST_SMALL (RID_SVTOOLS_IMAGELIST_START + 2)
+#define RID_SVTOOLS_IMAGELIST_EDITBROWSEBOX (RID_SVTOOLS_IMAGELIST_START + 3)
+
+// Java message boxes
+//These strings come from project desktop
+//There was no time for translation, therefore the defines needed to
+//remain the same.
+#define QBX_JAVADISABLED (RID_SVTOOLS_START+20)
+#define ERRORBOX_JVMCREATIONFAILED (RID_SVTOOLS_START+21)
+#define WARNINGBOX_JAVANOTFOUND (RID_SVTOOLS_START+22)
+#define WARNINGBOX_INVALIDJAVASETTINGS (RID_SVTOOLS_START+23)
+// RID_SVTOOLS_START + 24 unused
+#define WARNINGBOX_INVALIDJAVASETTINGS_MAC (RID_SVTOOLS_START+25)
+#define ERRORBOX_JVMCREATIONFAILED_MAC (RID_SVTOOLS_START+26)
+
+//.............................................................................
+// images
+#define RID_IMG_TREENODE_COLLAPSED (RID_SVTOOLS_START + 0)
+#define RID_IMG_TREENODE_EXPANDED (RID_SVTOOLS_START + 1)
+
+#define IMG_TRIANGLE_RIGHT (RID_SVTOOLS_START + 18)
+#define IMG_TRIANGLE_DOWN (RID_SVTOOLS_START + 20)
+
+#define IMG_SVT_FOLDER (RID_SVTOOLS_START + 42)
+
+#define IMG_SVT_NEWDOC (RID_SVTOOLS_START + 52)
+#define IMG_SVT_MYDOCS (RID_SVTOOLS_START + 53)
+#define IMG_SVT_TEMPLATES (RID_SVTOOLS_START + 54)
+#define IMG_SVT_SAMPLES (RID_SVTOOLS_START + 55)
+
+#define IMG_SVT_DOCTEMPLATE_BACK_SMALL (RID_SVTOOLS_START + 70)
+#define IMG_SVT_DOCTEMPLATE_BACK_LARGE (RID_SVTOOLS_START + 71)
+#define IMG_SVT_DOCTEMPLATE_PREV_SMALL (RID_SVTOOLS_START + 72)
+#define IMG_SVT_DOCTEMPLATE_PREV_LARGE (RID_SVTOOLS_START + 73)
+#define IMG_SVT_DOCTEMPLATE_PRINT_SMALL (RID_SVTOOLS_START + 74)
+#define IMG_SVT_DOCTEMPLATE_PRINT_LARGE (RID_SVTOOLS_START + 75)
+#define IMG_SVT_DOCTEMPLATE_DOCINFO_SMALL (RID_SVTOOLS_START + 76)
+#define IMG_SVT_DOCTEMPLATE_DOCINFO_LARGE (RID_SVTOOLS_START + 77)
+#define IMG_SVT_DOCTEMPLATE_PREVIEW_SMALL (RID_SVTOOLS_START + 78)
+#define IMG_SVT_DOCTEMPLATE_PREVIEW_LARGE (RID_SVTOOLS_START + 79)
+
+#define RID_IMG_PRNDLG_NOCOLLATE (STR_SVT_PRNDLG_START + 30)
+
+// IAccessible2 implementation in 2009
+#define STR_PARAGRAPH_START (STR_SVT_PRNDLG_START + 50)
+#define STR_PARAGRAPH (STR_PARAGRAPH_START + 0)
+
+#endif // #ifndef _SVTOOLS_HRC
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svtresid.hxx b/include/svtools/svtresid.hxx
new file mode 100644
index 000000000000..0340a1bd7c5d
--- /dev/null
+++ b/include/svtools/svtresid.hxx
@@ -0,0 +1,38 @@
+/* -*- 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_SVTRESID_HXX
+#define _SVTOOLS_SVTRESID_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/resid.hxx>
+#include <com/sun/star/lang/Locale.hpp>
+
+class SVT_DLLPUBLIC SvtResId: public ResId
+{
+public:
+ SvtResId(sal_uInt16 nId);
+ static void DeleteResMgr();
+};
+
+#define SVT_RESSTR(i) SvtResId(i).toString()
+
+#endif // _SVTOOLS_SVTRESID_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/svxbox.hxx b/include/svtools/svxbox.hxx
new file mode 100644
index 000000000000..4ccc566fd74d
--- /dev/null
+++ b/include/svtools/svxbox.hxx
@@ -0,0 +1,178 @@
+/* -*- 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 _SVX_BOX_HXX
+#define _SVX_BOX_HXX
+
+#include <tools/string.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/combobox.hxx>
+#include <svtools/svtdllapi.h>
+
+// forward ---------------------------------------------------------------
+
+class SvxBoxEntry;
+
+typedef std::vector<SvxBoxEntry*> SvxEntryLst;
+
+// class SvxBoxEntry -----------------------------------------------------
+
+class SVT_DLLPUBLIC SvxBoxEntry
+{
+ friend class SvxListBox;
+ friend class SvxComboBox;
+
+public:
+ SvxBoxEntry( const String& aName, sal_uInt16 nId=0 );
+ SvxBoxEntry( const SvxBoxEntry& rOrg );
+ SvxBoxEntry();
+
+ String aName;
+ sal_uInt16 nId;
+
+private:
+ sal_Bool bModified;
+ sal_Bool bNew;
+};
+
+// class SvxListBox ------------------------------------------------------
+
+class SVT_DLLPUBLIC SvxListBox : public ListBox
+{
+ using ListBox::InsertEntry;
+ using ListBox::RemoveEntry;
+ using ListBox::GetEntryPos;
+ using ListBox::IsEntrySelected;
+ using ListBox::SelectEntry;
+
+public:
+ SvxListBox( Window* pParent, WinBits nBits = WB_BORDER );
+ SvxListBox( Window* pParent, const ResId& rId );
+ ~SvxListBox();
+
+ void InsertNewEntry( const SvxBoxEntry& rEntry );
+ void InsertEntry( const SvxBoxEntry& rEntry,
+ sal_uInt16 nId = LISTBOX_ENTRY_NOTFOUND );
+
+ void RemoveEntry( sal_uInt16 nPos );
+ void RemoveEntry( const SvxBoxEntry& rEntry );
+
+ void Clear();
+
+ sal_uInt16 GetEntryPos( const SvxBoxEntry& rEntry ) const;
+ const SvxBoxEntry& GetSvxBoxEntry( sal_uInt16 nIdx ) const;
+
+ inline sal_Bool IsEntrySelected( const SvxBoxEntry& rEntry ) const;
+ const SvxBoxEntry& GetSelectSvxBoxEntry( sal_uInt16 nIdx = 0 ) const;
+ inline void SelectEntry( const SvxBoxEntry& rEntry,
+ sal_Bool bSelect = sal_True );
+
+ void ModifyEntry( sal_uInt16 nPos, const String& aName );
+ sal_uInt16 GetModifiedCount() const;
+ const SvxBoxEntry& GetModifiedEntry( sal_uInt16 nPos ) const;
+
+ sal_uInt16 GetRemovedCount() const;
+ const SvxBoxEntry& GetRemovedEntry( sal_uInt16 nPos ) const;
+
+ sal_uInt16 GetNewCount() const;
+ const SvxBoxEntry& GetNewEntry( sal_uInt16 nPos ) const;
+
+private:
+ SvxEntryLst aEntryLst;
+ SvxEntryLst aDelEntryLst;
+ SvxBoxEntry aDefault;
+
+ void InitListBox();
+ void InsertSorted( SvxBoxEntry* pEntry );
+};
+
+// inlines ---------------------------------------------------------------
+
+inline sal_Bool SvxListBox::IsEntrySelected( const SvxBoxEntry& aEntry ) const
+ { return ListBox::IsEntrySelected( aEntry.aName ); }
+
+inline void SvxListBox::SelectEntry( const SvxBoxEntry& aEntry, sal_Bool bSelect )
+ { ListBox::SelectEntry( aEntry.aName, bSelect ); }
+
+// enum SvxComboBoxStyle -------------------------------------------------
+
+enum SvxComboBoxStyle
+{
+ SVX_CBS_UPPER = 0x01,
+ SVX_CBS_LOWER = 0x02,
+ SVX_CBS_ALL = 0x04,
+ SVX_CBS_FILENAME = 0x08,
+ SVX_CBS_SW_FILENAME = SVX_CBS_FILENAME
+};
+
+// class SvxComboBox -----------------------------------------------------
+
+class SVT_DLLPUBLIC SvxComboBox : public ComboBox
+{
+ using ComboBox::InsertEntry;
+ using ComboBox::RemoveEntry;
+ using ComboBox::GetEntryPos;
+ using Window::SetStyle;
+
+public:
+ SvxComboBox( Window* pParent,
+ WinBits nBits = WB_BORDER, sal_uInt16 nStyleBits = SVX_CBS_ALL );
+ SvxComboBox( Window* pParent, const ResId& rId, sal_uInt16 nStyleBits = SVX_CBS_ALL );
+ ~SvxComboBox();
+
+ void InsertNewEntry( const SvxBoxEntry& );
+ void InsertEntry( const SvxBoxEntry& );
+
+ void RemoveEntry( sal_uInt16 nPos );
+ void RemoveEntry( const SvxBoxEntry& rEntry );
+
+ void Clear();
+
+ sal_uInt16 GetEntryPos( const SvxBoxEntry& rEntry ) const;
+ const SvxBoxEntry& GetEntry( sal_uInt16 nIdx ) const;
+
+ void ModifyEntry( sal_uInt16 nPos, const String& aName );
+ sal_uInt16 GetModifiedCount() const;
+ const SvxBoxEntry& GetModifiedEntry( sal_uInt16 nPos ) const;
+
+ sal_uInt16 GetRemovedCount() const;
+ const SvxBoxEntry& GetRemovedEntry( sal_uInt16 nPos ) const;
+
+ sal_uInt16 GetNewCount() const;
+ const SvxBoxEntry& GetNewEntry( sal_uInt16 nPos ) const;
+
+ sal_uInt16 GetStyle() const { return nStyle; }
+ void SetStyle( const sal_uInt16 nSt ) { nStyle = nSt; }
+
+ OUString GetText() const;
+
+private:
+ SvxEntryLst aEntryLst;
+ SvxEntryLst aDelEntryLst;
+ SvxBoxEntry aDefault;
+ sal_uInt16 nStyle;
+
+ virtual void KeyInput( const KeyEvent& rKEvt );
+
+ void InitComboBox();
+ void InsertSorted( SvxBoxEntry* pEntry );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/tabbar.hxx b/include/svtools/tabbar.hxx
new file mode 100644
index 000000000000..265723ecf8b8
--- /dev/null
+++ b/include/svtools/tabbar.hxx
@@ -0,0 +1,557 @@
+/* -*- 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 _TABBAR_HXX
+#define _TABBAR_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/link.hxx>
+#include <vcl/window.hxx>
+#include <vector>
+
+class MouseEvent;
+class TrackingEvent;
+class DataChangedEvent;
+class ImplTabButton;
+class ImplTabSizer;
+class TabBarEdit;
+
+struct ImplTabBarItem;
+typedef ::std::vector< ImplTabBarItem* > ImplTabBarList;
+
+// -----------------
+// - Dokumentation -
+// -----------------
+
+/*
+
+Erlaubte StyleBits
+------------------
+
+WB_SCROLL - Die Tabs koennen ueber ein Extra-Feld gescrollt werden
+WB_MINSCROLL - Die Tabs koennen ueber 2 zusaetzliche Buttons gescrollt werden
+WB_RANGESELECT - Zusammenhaengende Bereiche koennen selektiert werden
+WB_MULTISELECT - Einzelne Tabs koennen selektiert werden
+WB_BORDER - Oben und unten wird ein Strich gezeichnet
+WB_TOPBORDER - Oben wird ein Border gezeichnet
+WB_3DTAB - Die Tabs und der Border werden in 3D gezeichnet
+WB_DRAG - Vom TabBar wird ein StartDrag-Handler gerufen, wenn
+ Drag and Drop gestartet werden soll. Es wird ausserdem
+ im TabBar mit EnableDrop() Drag and Drop eingeschaltet.
+WB_SIZEABLE - Vom TabBar wird ein Split-Handler gerufen, wenn der Anwender
+ den TabBar in der Breite aendern will
+WB_STDTABBAR - WB_BORDER
+
+Wenn man den TabBar zum Beispiel als Property-Bar benutzen moechte, sollten
+die WinBits WB_TOPBORDER und WB_3DTAB anstatt WB_BORDER gesetzt werden.
+
+
+Erlaubte PageBits
+-----------------
+
+TPB_SPECIAL - Andere Darstellung des TabTextes, zum Beispiel fuer
+ Szenario-Seiten.
+
+
+Handler
+-------
+
+Select - Wird gerufen, wenn eine Tab selektiert oder
+ deselektiert wird
+DoubleClick - Wird gerufen, wenn ein DoubleClick im TabBar ausgeloest
+ wurde. Innerhalb des Handlers liefert GetCurPageId() die
+ angeklickte Tab zurueck oder 0, wenn keine Tab angeklickt
+ wurde
+ActivatePage - Wird gerufen, wenn eine andere Seite aktiviert wird.
+ GetCurPageId() gibt die aktivierte Seite zurueck.
+DeactivatePage - Wird gerufen, wenn eine Seite deaktiviert wird. Wenn
+ eine andere Seite aktiviert werden darf, muss sal_True
+ zurueckgegeben werden, wenn eine andere Seite von
+ der Aktivierung ausgeschlossen werden soll, muss
+ sal_False zurueckgegeben werden. GetCurPageId() gibt die
+ zu deaktivierende Seite zurueck.
+
+
+
+Drag and Drop
+-------------
+
+Fuer Drag and Drop muss das WinBit WB_DRAG gesetzt werden. Ausserdem
+muss der Command-, QueryDrop-Handler und der Drop-Handler ueberlagert
+werden. Dabei muss in den Handlern folgendes implementiert werden:
+
+Command - Wenn in diesem Handler das Dragging gestartet werden
+ soll, muss StartDrag() gerufen werden. Diese Methode
+ selektiert dann den entsprechenden Eintrag oder gibt
+ sal_False zurueck, wenn das Dragging nicht durchgefuhert
+ werden kann.
+
+QueryDrop - Dieser Handler wird von StarView immer dann gerufen, wenn
+ bei einem Drag-Vorgang die Maus ueber das Fenster gezogen
+ wird (siehe dazu auch SV-Doku). In diesem Handler muss
+ festgestellt werden, ob ein Drop moeglich ist. Die
+ Drop-Position kann im TabBar mit ShowDropPos() angezeigt
+ werden. Beim Aufruf muss die Position vom Event uebergeben
+ werden. Wenn sich die Position am linken oder rechten
+ Rand befindet, wird automatisch im TabBar gescrollt.
+ Diese Methode gibt auch die entsprechende Drop-Position
+ zurueck, die auch fuer ein Drop gebraucht wird. Wenn das
+ Fenster beim Drag verlassen wird, kann mit HideDropPos()
+ die DropPosition wieder weggenommen werden. Es ist dadurch
+ auch moeglich, ein von ausserhalb des TabBars ausgeloestes
+ Drag zu verarbeiten.
+
+Drop - Im Drop-Handler muessen dann die Pages verschoben werden,
+ oder die neuen Pages eingefuegt werden. Die entsprechende
+ Drop-Postion kann mit ShowDropPos() ermittelt werden.
+
+Folgende Methoden werden fuer Drag and Drop gebraucht und muessen von
+den Handlern gerufen werden:
+
+StartDrag - Muss aus dem Commnad-Handler gerufen werden. Als Parameter
+ muss der CommandEvent uebergeben werden und eine Referenz
+ auf eine Region. Diese Region muss dann bei ExecuteDrag()
+ uebergeben werden, wenn der Rueckgabewert sagt, das
+ ExecuteDrag durchgefuehrt werden soll. Falls der Eintrag
+ nicht selektiert ist, wird er vorher als aktueller
+ Eintrag gesetzt. Es ist daher darauf zu achten, das aus
+ dieser Methode heraus der Select-Handler gerufen werden
+ kann.
+
+ShowDropPos - Diese Methode muss vom QueryDrop-Handler gerufen werden,
+ damit der TabBar anzeigt, wo die Tabs eingefuegt werden.
+ Diese Methode kann auch im Drop-Handler benutzt werden,
+ um die Position zu ermitteln wo die Tabs eingefuegt werden
+ sollen. In der Methode muss die Position vom Event
+ uebergeben werden. Diese Methode gibt die Position zurueck,
+ wo die Tabs eingefuegt werden sollen.
+
+HideDropPos - Diese Methode nimmt die vorher mit ShowDropPos() angezeigte
+ DropPosition wieder zurueck. Diese Methode sollte dann
+ gerufen werden, wenn bei QueryDrop() das Fenster verlassen
+ wird oder der Dragvorgang beendet wurde.
+
+Folgende Methoden koennen eingesetzt werden, wenn bei D&D die Seiten
+umgeschaltet werden sollen:
+
+SwitchPage - Diese Methode muss vom QueryDrop-Handler gerufen werden,
+ wenn die Seite ueber der sich der Mousepointer befindet,
+ umgeschaltet werden soll. Diese Methode sollte jedesmal
+ gerufen werden, wenn der QueryDrop-Handler gerufen wird.
+ Das umschalten der Seite passiert zeitverzoegert (500 ms)
+ und wird automatisch von dieser Methode verwaltet.
+ In der Methode muss die Position vom Event uebergeben
+ werden. Diese Methode gibt sal_True zurueck, wenn die Page
+ umgeschaltet wurde.
+
+EndSwitchPage - Diese Methode setzt die Daten fuer das umschalten der
+ Seiten zurueck. Diese Methode sollte dann gerufen werden,
+ wenn bei QueryDrop() das Fenster verlassen wird oder
+ der Dragvorgang beendet wurde.
+
+IsInSwitching - Mit dieser Methode kann im ActivatePage()/DeactivatePage()
+ abgefragt werden, ob dies durch SwitchPage() veranlasst
+ wurde. So kann dann beispielsweise in DeactivatePage()
+ das Umschalten ohne eine Fehlerbox verhindert werden.
+
+
+Fenster-Resize
+--------------
+
+Wenn das Fenster vom Anwender in der Breite geaendert werden kann, dann
+muss das WinBit WB_SIZEABLE gesetzt werden. In diesem Fall muss noch
+folgender Handler ueberlagert werden:
+
+Split - Wenn dieser Handler gerufen wird, sollte das Fenster
+ auf die Breite angepasst werden, die von GetSplitSize()
+ zurueckgegeben wird. Dabei wird keine minimale und
+ maximale Breite beruecksichtig. Eine minimale Breite
+ kann mit GetMinSize() abgefragt werden und die maximale
+ Breite muss von der Anwendung selber berechnet werden.
+ Da nur Online-Resize unterstuetzt wird, muss das Fenster
+ innerhalb dieses Handlers in der Breite geaendert
+ werden und eventuell abhaengige Fenster ebenfalls. Fuer
+ diesen Handler kann auch mit SetSplitHdl() ein
+ Link gesetzt werden.
+
+Folgende Methoden liefern beim Splitten weitere Informationen:
+
+GetSplitSize() - Liefert die Breite des TabBars zurueck, auf die der
+ Anwender das Fenster resizen will. Dabei wird keine
+ minimale oder maximale Breite beruecksichtigt. Es wird
+ jedoch nie eine Breite < 5 zurueckgeliefert. Diese Methode
+ liefert nur solange richtige Werte, wie Splitten aktiv
+ ist.
+
+GetMinSize() - Mit dieser Methode kann eine minimale Fensterbreite
+ abgefragt werden, so das min. etwas eines Tabs sichtbar
+ ist. Jedoch kann der TabBar immer noch schmaler gesetzt
+ werden, als die Breite, die diese Methode zurueckliefert.
+ Diese Methode kann auch aufgerufen werden, wenn kein
+ Splitten aktiv ist.
+
+
+Edit-Modus
+----------
+
+Der Tabbar bietet auch Moeglichkeiten, das der Anwender in den Tabreitern
+die Namen aendern kann.
+
+EnableEditMode - Damit kann eingestellt werden, das bei Alt+LeftClick
+ StartEditMode() automatisch vom TabBar gerufen wird.
+ Im StartRenaming()-Handler kann dann das Umbenennen
+ noch abgelehnt werden.
+StartEditMode - Mit dieser Methode wird der EditModus auf einem
+ Tab gestartet. sal_False wird zurueckgegeben, wenn
+ der Editmodus schon aktiv ist, mit StartRenaming()
+ der Modus abgelehnt wurde oder kein Platz zum
+ Editieren vorhanden ist.
+EndEditMode - Mit dieser Methode wird der EditModus beendet.
+SetEditText - Mit dieser Methode kann der Text im AllowRenaming()-
+ Handler noch durch einen anderen Text ersetzt werden.
+GetEditText - Mit dieser Methode kann im AllowRenaming()-Handler
+ der Text abgefragt werden, den der Anwender eingegeben
+ hat.
+IsInEditMode - Mit dieser Methode kann abgefragt werden, ob der
+ Editmodus aktiv ist.
+IsEditModeCanceled - Mit dieser Methode kann im EndRenaming()-
+ Handler abgefragt werden, ob die Umbenenung
+ abgebrochen wurde.
+GetEditPageId - Mit dieser Methode wird in den Renaming-Handlern
+ abgefragt, welcher Tab umbenannt wird/wurde.
+
+StartRenaming() - Dieser Handler wird gerufen, wenn ueber StartEditMode()
+ der Editmodus gestartet wurde. Mit GetEditPageId()
+ kann abgefragt werden, welcher Tab umbenannt werden
+ soll. sal_False sollte zurueckgegeben werden, wenn
+ der Editmodus nicht gestartet werden soll.
+AllowRenaming() - Dieser Handler wird gerufen, wenn der Editmodus
+ beendet wird (nicht bei Cancel). In diesem Handler
+ kann dann getestet werden, ob der Text OK ist.
+ Mit GetEditPageId() kann abgefragt werden, welcher Tab
+ umbenannt wurde.
+ Es sollte einer der folgenden Werte zurueckgegeben
+ werden:
+ TAB_RENAMING_YES
+ Der Tab wird umbenannt.
+ TAB_RENAMING_NO
+ Der Tab wird nicht umbenannt, der Editmodus bleibt
+ jedoch aktiv, so das der Anwender den Namen
+ entsprechent anpassen kann.
+ TAB_RENAMING_CANCEL
+ Der Editmodus wird abgebrochen und der alte
+ Text wieder hergestellt.
+EndRenaming() - Dieser Handler wird gerufen, wenn der Editmodus
+ beendet wurde. Mit GetEditPageId() kann abgefragt
+ werden, welcher Tab umbenannt wurde. Mit
+ IsEditModeCanceled() kann abgefragt werden, ob der
+ Modus abgebrochen wurde und der Name dadurch nicht
+ geaendert wurde.
+
+
+Maximale Pagebreite
+-------------------
+
+Die Pagebreite der Tabs kann begrenzt werden, damit ein einfacheres
+Navigieren ueber diese moeglich ist. Wenn der Text dann nicht komplett
+angezeigt werden kann, wird er mit ... abgekuerzt und in der Tip-
+oder der aktiven Hilfe (wenn kein Hilfetext gesetzt ist) wird dann der
+ganze Text angezeigt. Mit EnableAutoMaxPageWidth() kann eingestellt
+werden, ob die maximale Pagebreite sich nach der gerade sichtbaren
+Breite richten soll (ist der default). Ansonsten kann auch die
+maximale Pagebreite mit SetMaxPageWidth() (in Pixeln) gesetzt werden
+(die AutoMaxPageWidth wird dann ignoriert).
+
+
+KontextMenu
+-----------
+
+Wenn ein kontextsensitives PopupMenu anzeigt werden soll, muss der
+Command-Handler ueberlagert werden. Mit GetPageId() und bei
+Uebergabe der Mausposition kann ermittelt werden, ob der Mausclick
+ueber einem bzw. ueber welchem Item durchgefuehrt wurde.
+*/
+
+// -----------
+// - WinBits -
+// -----------
+
+#define WB_RANGESELECT ((WinBits)0x00200000)
+#define WB_MULTISELECT ((WinBits)0x00400000)
+#define WB_TOPBORDER ((WinBits)0x04000000)
+#define WB_3DTAB ((WinBits)0x08000000)
+#define WB_MINSCROLL ((WinBits)0x20000000)
+#define WB_INSERTTAB ((WinBits)0x40000000)
+#define WB_STDTABBAR WB_BORDER
+
+// ------------------
+// - TabBarPageBits -
+// ------------------
+
+typedef sal_uInt16 TabBarPageBits;
+
+// -------------------------
+// - Bits fuer TabBarPages -
+// -------------------------
+
+#define TPB_SPECIAL ((TabBarPageBits)0x0001)
+
+// ----------------
+// - TabBar-Types -
+// ----------------
+
+#define TABBAR_RENAMING_YES ((long)sal_True)
+#define TABBAR_RENAMING_NO ((long)sal_False)
+#define TABBAR_RENAMING_CANCEL ((long)2)
+
+// ----------
+// - TabBar -
+// ----------
+struct TabBar_Impl;
+struct ImplTabBarItem;
+
+class SVT_DLLPUBLIC TabBar : public Window
+{
+ friend class ImplTabButton;
+ friend class ImplTabSizer;
+
+private:
+ ImplTabBarList* mpItemList;
+ ImplTabButton* mpFirstBtn;
+ ImplTabButton* mpPrevBtn;
+ ImplTabButton* mpNextBtn;
+ ImplTabButton* mpLastBtn;
+ TabBar_Impl* mpImpl;
+ TabBarEdit* mpEdit;
+ OUString maEditText;
+ Color maSelColor;
+ Color maSelTextColor;
+ Size maWinSize;
+ long mnMaxPageWidth;
+ long mnCurMaxWidth;
+ long mnOffX;
+ long mnOffY;
+ long mnLastOffX;
+ long mnSplitSize;
+ sal_uLong mnSwitchTime;
+ WinBits mnWinStyle;
+ sal_uInt16 mnCurPageId;
+ sal_uInt16 mnFirstPos;
+ sal_uInt16 mnDropPos;
+ sal_uInt16 mnSwitchId;
+ sal_uInt16 mnEditId;
+ sal_Bool mbFormat;
+ sal_Bool mbFirstFormat;
+ sal_Bool mbSizeFormat;
+ sal_Bool mbAutoMaxWidth;
+ sal_Bool mbInSwitching;
+ sal_Bool mbAutoEditMode;
+ sal_Bool mbEditCanceled;
+ sal_Bool mbDropPos;
+ sal_Bool mbInSelect;
+ sal_Bool mbSelColor;
+ sal_Bool mbSelTextColor;
+ bool mbMirrored;
+ bool mbHasInsertTab; // if true, the tab bar has an extra tab at the end.
+ Link maSelectHdl;
+ Link maDoubleClickHdl;
+ Link maSplitHdl;
+ Link maActivatePageHdl;
+ Link maDeactivatePageHdl;
+ Link maStartRenamingHdl;
+ Link maAllowRenamingHdl;
+ Link maEndRenamingHdl;
+ size_t maCurrentItemList;
+
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit( WinBits nWinStyle );
+ SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bBackground );
+ SVT_DLLPRIVATE void ImplGetColors( Color& rFaceColor, Color& rFaceTextColor,
+ Color& rSelectColor, Color& rSelectTextColor );
+ SVT_DLLPRIVATE void ImplShowPage( sal_uInt16 nPos );
+ SVT_DLLPRIVATE sal_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 long ImplDeactivatePage();
+ SVT_DLLPRIVATE void ImplPrePaint();
+ SVT_DLLPRIVATE ImplTabBarItem* ImplGetLastTabBarItem( sal_uInt16 nItemCount );
+ SVT_DLLPRIVATE Rectangle ImplGetInsertTabRect(ImplTabBarItem* pItem) const;
+ DECL_DLLPRIVATE_LINK( ImplClickHdl, ImplTabButton* );
+
+ ImplTabBarItem* seek( size_t i );
+ ImplTabBarItem* prev();
+ ImplTabBarItem* next();
+
+public:
+ static const sal_uInt16 APPEND;
+ static const sal_uInt16 PAGE_NOT_FOUND;
+ static const sal_uInt16 INSERT_TAB_POS;
+
+ TabBar( Window* pParent, WinBits nWinStyle = WB_STDTABBAR );
+ virtual ~TabBar();
+
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Select();
+ virtual void DoubleClick();
+ virtual void Split();
+ virtual void ActivatePage();
+ virtual long DeactivatePage();
+ virtual long StartRenaming();
+ virtual long AllowRenaming();
+ virtual void EndRenaming();
+ virtual void Mirror();
+
+ void InsertPage( sal_uInt16 nPageId, const OUString& rText,
+ TabBarPageBits nBits = 0,
+ 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 );
+ sal_Bool IsDefaultTabBgColor( sal_uInt16 nPageId );
+
+ void Clear();
+
+ sal_Bool IsPageEnabled( sal_uInt16 nPageId ) const;
+
+ void SetPageBits( sal_uInt16 nPageId, TabBarPageBits nBits = 0 );
+ 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 GetPageId( const Point& rPos, bool bCheckInsTab = false ) const;
+ Rectangle GetPageRect( sal_uInt16 nPageId ) const;
+ // returns the rectangle in which page tabs are drawn
+ Rectangle GetPageArea() const;
+
+ void SetCurPageId( sal_uInt16 nPageId );
+ sal_uInt16 GetCurPageId() const { return mnCurPageId; }
+
+ void SetFirstPageId( sal_uInt16 nPageId );
+ sal_uInt16 GetFirstPageId() const { return GetPageId( mnFirstPos ); }
+ void MakeVisible( sal_uInt16 nPageId );
+
+ void SelectPage( sal_uInt16 nPageId, sal_Bool bSelect = sal_True );
+ sal_uInt16 GetSelectPageCount() const;
+ sal_Bool IsPageSelected( sal_uInt16 nPageId ) const;
+
+ void EnableAutoMaxPageWidth( sal_Bool bEnable = sal_True ) { mbAutoMaxWidth = bEnable; }
+ sal_Bool IsAutoMaxPageWidthEnabled() const { return mbAutoMaxWidth; }
+ void SetMaxPageWidth( long nMaxWidth );
+ long GetMaxPageWidth() const { return mnMaxPageWidth; }
+ void ResetMaxPageWidth() { SetMaxPageWidth( 0 ); }
+ sal_Bool IsMaxPageWidth() const { return mnMaxPageWidth != 0; }
+
+ void EnableEditMode( sal_Bool bEnable = sal_True ) { mbAutoEditMode = bEnable; }
+ sal_Bool IsEditModeEnabled() const { return mbAutoEditMode; }
+ sal_Bool StartEditMode( sal_uInt16 nPageId );
+ void EndEditMode( sal_Bool bCancel = sal_False );
+ void SetEditText( const OUString& rText ) { maEditText = rText; }
+ const OUString& GetEditText() const { return maEditText; }
+ sal_Bool IsInEditMode() const { return (mpEdit != NULL); }
+ sal_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 = true);
+ /** Returns sal_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;
+
+ sal_Bool StartDrag( const CommandEvent& rCEvt, Region& rRegion );
+ sal_uInt16 ShowDropPos( const Point& rPos );
+ void HideDropPos();
+ sal_Bool SwitchPage( const Point& rPos );
+ void EndSwitchPage();
+ sal_Bool IsInSwitching() { return mbInSwitching; }
+
+ const Color& GetSelectColor() const { return maSelColor; }
+ sal_Bool IsSelectColor() const { return mbSelColor; }
+ const Color& GetSelectTextColor() const { return maSelTextColor; }
+ sal_Bool IsSelectTextColor() const { return mbSelTextColor; }
+
+ void SetPageText( sal_uInt16 nPageId, const OUString& rText );
+ OUString GetPageText( sal_uInt16 nPageId ) const;
+ XubString GetHelpText( sal_uInt16 nPageId ) const;
+ OString GetHelpId( sal_uInt16 nPageId ) const;
+
+ long GetSplitSize() const { return mnSplitSize; }
+
+ void SetHelpText( const XubString& rText )
+ { Window::SetHelpText( rText ); }
+ XubString GetHelpText() const
+ { return Window::GetHelpText(); };
+ void SetHelpId( const OString& rId )
+ { Window::SetHelpId( rId ); }
+ const OString& GetHelpId() const
+ { return Window::GetHelpId(); }
+
+ void SetStyle( WinBits nStyle );
+ WinBits GetStyle() const { return mnWinStyle; }
+
+ Size CalcWindowSizePixel() const;
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+ void SetSplitHdl( const Link& rLink ) { maSplitHdl = rLink; }
+ const Link& GetSplitHdl() const { return maSplitHdl; }
+ void SetActivatePageHdl( const Link& rLink ) { maActivatePageHdl = rLink; }
+ const Link& GetActivatePageHdl() const { return maActivatePageHdl; }
+ void SetDeactivatePageHdl( const Link& rLink ) { maDeactivatePageHdl = rLink; }
+ const Link& GetDeactivatePageHdl() const { return maDeactivatePageHdl; }
+ void SetStartRenamingHdl( const Link& rLink ) { maStartRenamingHdl = rLink; }
+ const Link& GetStartRenamingHdl() const { return maStartRenamingHdl; }
+ void SetAllowRenamingHdl( const Link& rLink ) { maAllowRenamingHdl = rLink; }
+ const Link& GetAllowRenamingHdl() const { return maAllowRenamingHdl; }
+ void SetEndRenamingHdl( const Link& rLink ) { maEndRenamingHdl = rLink; }
+ const Link& GetEndRenamingHdl() const { return maEndRenamingHdl; }
+
+ // accessibility
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+};
+
+#endif // _TABBAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/defaultinputhandler.hxx b/include/svtools/table/defaultinputhandler.hxx
new file mode 100644
index 000000000000..021b523f1bda
--- /dev/null
+++ b/include/svtools/table/defaultinputhandler.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 SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
+#define SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
+
+#include "svtools/table/tableinputhandler.hxx"
+#include "svtools/table/tabletypes.hxx"
+
+#include <boost/scoped_ptr.hpp>
+
+//......................................................................................................................
+namespace svt { namespace table
+{
+//......................................................................................................................
+
+ struct DefaultInputHandler_Impl;
+
+ //==================================================================================================================
+ //= DefaultInputHandler
+ //==================================================================================================================
+ class DefaultInputHandler : public ITableInputHandler
+ {
+ private:
+ ::boost::scoped_ptr< DefaultInputHandler_Impl > m_pImpl;
+
+ public:
+ DefaultInputHandler();
+ ~DefaultInputHandler();
+
+ virtual bool MouseMove ( ITableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool MouseButtonDown ( ITableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool MouseButtonUp ( ITableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool KeyInput ( ITableControl& _rControl, const KeyEvent& rKEvt );
+ virtual bool GetFocus ( ITableControl& _rControl );
+ virtual bool LoseFocus ( ITableControl& _rControl );
+ virtual bool RequestHelp ( ITableControl& _rControl, const HelpEvent& rHEvt );
+ virtual bool Command ( ITableControl& _rControl, const CommandEvent& rCEvt );
+ virtual bool PreNotify ( ITableControl& _rControl, NotifyEvent& rNEvt );
+ virtual bool Notify ( ITableControl& _rControl, NotifyEvent& rNEvt );
+ };
+
+//......................................................................................................................
+} } // namespace svt::table
+//......................................................................................................................
+
+#endif // SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/gridtablerenderer.hxx b/include/svtools/table/gridtablerenderer.hxx
new file mode 100644
index 000000000000..21a096268fe1
--- /dev/null
+++ b/include/svtools/table/gridtablerenderer.hxx
@@ -0,0 +1,121 @@
+/* -*- 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_INC_TABLE_GRIDTABLERENDERER_HXX
+#define SVTOOLS_INC_TABLE_GRIDTABLERENDERER_HXX
+
+#include <svtools/table/tablemodel.hxx>
+
+#include <boost/scoped_ptr.hpp>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ struct GridTableRenderer_Impl;
+
+ //====================================================================
+ //= GridTableRenderer
+ //====================================================================
+ /** a default implementation for the ->ITableRenderer interface
+
+ This class is able to paint a table grid, table headers, and cell
+ backgrounds according to the selected/active state of cells.
+ */
+ class GridTableRenderer : public ITableRenderer
+ {
+ private:
+ ::boost::scoped_ptr< GridTableRenderer_Impl > m_pImpl;
+
+ public:
+ /** creates a table renderer associated with the given model
+
+ @param _rModel
+ the model which should be rendered. The caller is responsible
+ for lifetime control, that is, the model instance must live
+ at least as long as the renderer instance lives
+ */
+ GridTableRenderer( ITableModel& _rModel );
+ ~GridTableRenderer();
+
+ /** determines whether or not to paint grid lines
+ */
+ bool useGridLines() const;
+
+ /** controls whether or not to paint grid lines
+ */
+ void useGridLines( bool const i_use );
+
+ public:
+ // ITableRenderer overridables
+ virtual void PaintHeaderArea(
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ bool _bIsColHeaderArea, bool _bIsRowHeaderArea,
+ const StyleSettings& _rStyle );
+ virtual void PaintColumnHeader( ColPos _nCol, bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle );
+ virtual void PrepareRow( RowPos _nRow, bool i_hasControlFocus, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rRowArea,
+ const StyleSettings& _rStyle );
+ virtual void PaintRowHeader(
+ bool i_hasControlFocus, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle );
+ virtual void PaintCell( ColPos const i_col,
+ bool i_hasControlFocus, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle );
+ virtual void ShowCellCursor( Window& _rView, const Rectangle& _rCursorRect);
+ virtual void HideCellCursor( Window& _rView, const Rectangle& _rCursorRect);
+ virtual bool FitsIntoCell(
+ ::com::sun::star::uno::Any const & i_cellContent,
+ ColPos const i_colPos, RowPos const i_rowPos,
+ bool const i_active, bool const i_selected,
+ OutputDevice& i_targetDevice, Rectangle const & i_targetArea
+ ) const;
+ virtual bool GetFormattedCellString(
+ ::com::sun::star::uno::Any const & i_cellValue,
+ ColPos const i_colPos, RowPos const i_rowPos,
+ OUString & o_cellString
+ ) const;
+
+ private:
+ struct CellRenderContext;
+
+ void impl_paintCellContent(
+ CellRenderContext const & i_context
+ );
+ void impl_paintCellImage(
+ CellRenderContext const & i_context,
+ Image const & i_image
+ );
+ void impl_paintCellText(
+ CellRenderContext const & i_context,
+ OUString const & i_text
+ );
+ };
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_GRIDTABLERENDERER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/tablecontrol.hxx b/include/svtools/table/tablecontrol.hxx
new file mode 100644
index 000000000000..a170a38a4648
--- /dev/null
+++ b/include/svtools/table/tablecontrol.hxx
@@ -0,0 +1,218 @@
+/* -*- 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_INC_TABLE_TABLECONTROL_HXX
+#define SVTOOLS_INC_TABLE_TABLECONTROL_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/table/tablemodel.hxx"
+#include "svtools/accessibletable.hxx"
+#include "svtools/accessiblefactory.hxx"
+
+#include <vcl/ctrl.hxx>
+#include <vcl/seleng.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
+
+//........................................................................
+
+namespace svt { namespace table
+{
+//........................................................................
+
+ class TableControl_Impl;
+
+ //====================================================================
+ //= TableControl
+ //====================================================================
+ /** a basic control which manages table-like data, i.e. a number of cells
+ organized in <code>m</code> rows and <code>n</code> columns.
+
+ The control itself does not do any assumptions about the concrete data
+ it displays, this is encapsulated in an instance supporting the
+ ->ITableModel interface.
+
+ Also, the control does not do any assumptions about how the model's
+ content is rendered. This is the responsibility of a component
+ supporting the ->ITableRenderer interface (the renderer is obtained from
+ the model).
+
+ The control supports the concept of a <em>current</em> (or <em>active</em>
+ cell).
+ The control supports accessibility, this is encapsulated in IAccessibleTable
+ */
+ class SVT_DLLPUBLIC TableControl : public Control, public IAccessibleTable
+ {
+ private:
+ ::boost::shared_ptr< TableControl_Impl > m_pImpl;
+
+
+ public:
+ TableControl( Window* _pParent, WinBits _nStyle );
+ ~TableControl();
+
+ /// sets a new table model
+ void SetModel( PTableModel _pModel );
+ /// retrieves the current table model
+ PTableModel GetModel() const;
+
+ /** retrieves the current row
+
+ The current row is the one which contains the active cell.
+
+ @return
+ the row index of the active cell, or ->ROW_INVALID
+ if there is no active cell, e.g. because the table does
+ not contain any rows or columns.
+ */
+ sal_Int32 GetCurrentRow() const;
+
+ ITableControl&
+ getTableControlInterface();
+
+ /** retrieves the current column
+
+ The current col is the one which contains the active cell.
+
+ @return
+ the column index of the active cell, or ->COL_INVALID
+ if there is no active cell, e.g. because the table does
+ not contain any rows or columns.
+ */
+ sal_Int32 GetCurrentColumn() const;
+
+ /** activates the cell at the given position
+
+ @return
+ <sal_True/> if the move was successful, <FALSE/> otherwise. Usual
+ failure conditions include some other instance vetoing the move,
+ or impossibility to execute the move at all (for instance because
+ of invalid coordinates).
+ */
+ bool GoTo( ColPos _nColumnPos, RowPos _nRow);
+
+ /** moves the active cell to the given column, by keeping the active row
+
+ @return
+ <sal_True/> if the move was successful, <FALSE/> otherwise. Usual
+ failure conditions include some other instance vetoing the move,
+ or impossibility to execute the move at all (for instance because
+ of invalid coordinates).
+ */
+ inline bool GoToColumn( ColPos _nColumn )
+ {
+ return GoTo( _nColumn, GetCurrentRow() );
+ }
+
+ /** moves the active cell to the given row, by keeping the active column
+
+ @return
+ <sal_True/> if the move was successful, <FALSE/> otherwise. Usual
+ failure conditions include some other instance vetoing the move,
+ or impossibility to execute the move at all (for instance because
+ of invalid coordinates).
+ */
+ bool GoToRow( RowPos _nRow )
+ {
+ return GoTo( GetCurrentColumn(), _nRow );
+ }
+
+ SVT_DLLPRIVATE virtual void Resize();
+ virtual void Select();
+
+ /**after removing a row, updates the vector which contains the selected rows
+ if the row, which should be removed, is selected, it will be erased from the vector
+ */
+ SelectionEngine* getSelEngine();
+ Window& getDataWindow();
+
+ // Window overridables
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void StateChanged( StateChangedType i_nStateChange );
+
+ /** Creates and returns the accessible object of the whole GridControl. */
+ SVT_DLLPRIVATE virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible();
+ SVT_DLLPRIVATE virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex );
+ SVT_DLLPRIVATE virtual OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const;
+ SVT_DLLPRIVATE virtual sal_Bool GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow );
+ SVT_DLLPRIVATE virtual OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType, sal_Int32 _nPosition = -1) const;
+ SVT_DLLPRIVATE virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet, AccessibleTableControlObjType eObjType ) const;
+
+ // temporary methods
+ // Those do not really belong into the public API - they're intended for firing A11Y-related events. However,
+ // firing those events should be an implementation internal to the TableControl resp. TableControl_Impl,
+ // instead of something triggered externally.
+ void commitCellEventIfAccessibleAlive( sal_Int16 const i_eventID, const css::uno::Any& i_newValue, const css::uno::Any& i_oldValue );
+ void commitTableEventIfAccessibleAlive( sal_Int16 const i_eventID, const css::uno::Any& i_newValue, const css::uno::Any& i_oldValue );
+
+ // .............................................................................................................
+ // IAccessibleTable
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
+ virtual void GrabFocus();
+ virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True );
+ virtual Window* GetAccessibleParentWindow() const;
+ virtual Window* GetWindowInstance();
+ virtual sal_Int32 GetAccessibleControlCount() const;
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint );
+ virtual long GetRowCount() const;
+ virtual long GetColumnCount() const;
+ virtual sal_Bool HasRowHeader() const;
+ virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint );
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle calcHeaderCellRect( sal_Bool _bIsColumnBar, sal_Int32 nPos);
+ virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle calcCellRect( sal_Int32 _nRowPos, sal_Int32 _nColPos );
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex);
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
+ virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const;
+ virtual OUString GetRowDescription( sal_Int32 _nRow ) const;
+ virtual OUString GetRowName(sal_Int32 _nIndex) const;
+ virtual OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const;
+ virtual OUString GetColumnName( sal_Int32 _nIndex ) const;
+ virtual css::uno::Any GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
+ virtual sal_Bool HasRowHeader();
+ virtual sal_Bool HasColHeader();
+ virtual OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
+
+ virtual sal_Int32 GetSelectedRowCount() const;
+ virtual sal_Int32 GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const;
+ virtual bool IsRowSelected( sal_Int32 const i_rowIndex ) const;
+ virtual void SelectRow( sal_Int32 const i_rowIndex, bool const i_select );
+ virtual void SelectAllRows( bool const i_select );
+ // .............................................................................................................
+
+ private:
+ DECL_DLLPRIVATE_LINK( ImplSelectHdl, void* );
+
+ private:
+ TableControl(); // never implemented
+ TableControl( const TableControl& ); // never implemented
+ TableControl& operator=( const TableControl& ); // never implemented
+ };
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLECONTROL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/tablecontrolinterface.hxx b/include/svtools/table/tablecontrolinterface.hxx
new file mode 100644
index 000000000000..a95cc282985c
--- /dev/null
+++ b/include/svtools/table/tablecontrolinterface.hxx
@@ -0,0 +1,257 @@
+/* -*- 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_INC_TABLE_ABSTRACTTABLECONTROL_HXX
+#define SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
+
+#include <sal/types.h>
+#include <vcl/event.hxx>
+#include <vcl/seleng.hxx>
+
+#include "svtools/table/tabletypes.hxx"
+#include "svtools/table/tablemodel.hxx"
+
+class Pointer;
+
+//......................................................................................................................
+namespace svt { namespace table
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= TableControlAction
+ //==================================================================================================================
+ enum TableControlAction
+ {
+ /// moves the cursor in the table control one row up, if possible, by keeping the current column
+ cursorUp,
+ /// moves the cursor in the table control one row down, if possible, by keeping the current column
+ cursorDown,
+ /// moves the cursor in the table control one column to the left, if possible, by keeping the current row
+ cursorLeft,
+ /// moves the cursor in the table control one column to the right, if possible, by keeping the current row
+ cursorRight,
+ /// moves the cursor to the beginning of the current line
+ cursorToLineStart,
+ /// moves the cursor to the end of the current line
+ cursorToLineEnd,
+ /// moves the cursor to the first row, keeping the current column
+ cursorToFirstLine,
+ /// moves the cursor to the last row, keeping the current column
+ cursorToLastLine,
+ /// moves the cursor one page up, keeping the current column
+ cursorPageUp,
+ /// moves the cursor one page down, keeping the current column
+ cursorPageDown,
+ /// moves the cursor to the top-most, left-most cell
+ cursorTopLeft,
+ /// moves the cursor to the bottom-most, right-most cell
+ cursorBottomRight,
+ /// selects the row, where the actual cursor is
+ cursorSelectRow,
+ /// selects the rows, above the actual cursor is
+ cursorSelectRowUp,
+ /// selects the row, beneath the actual cursor is
+ cursorSelectRowDown,
+ /// selects the row, from the actual cursor till top
+ cursorSelectRowAreaTop,
+ /// selects the row, from the actual cursor till bottom
+ cursorSelectRowAreaBottom,
+
+ /// invalid and final enumeration value, not to be actually used
+ invalidTableControlAction
+ };
+
+ //==================================================================================================================
+ //= TableCellArea
+ //==================================================================================================================
+ enum TableCellArea
+ {
+ CellContent,
+ ColumnDivider
+ };
+
+ //==================================================================================================================
+ //= TableCell
+ //==================================================================================================================
+ struct TableCell
+ {
+ ColPos nColumn;
+ RowPos nRow;
+ TableCellArea eArea;
+
+ TableCell()
+ :nColumn( COL_INVALID )
+ ,nRow( ROW_INVALID )
+ ,eArea( CellContent )
+ {
+ }
+
+ TableCell( ColPos const i_column, RowPos const i_row )
+ :nColumn( i_column )
+ ,nRow( i_row )
+ ,eArea( CellContent )
+ {
+ }
+ };
+
+ //==================================================================================================================
+ //= ColumnMetrics
+ //==================================================================================================================
+ struct ColumnMetrics
+ {
+ /** the start of the column, in pixels. Might be negative, in case the column is scrolled out of the visible
+ area. Note: see below.
+ */
+ long nStartPixel;
+
+ /** the end of the column, in pixels, plus 1. Effectively, this is the accumulated width of a all columns
+ up to the current one.
+
+ Huh? Earlier you said that the nStartPixel of columns
+ scrolled out (to the left) of the visible area is
+ negative. Also, where is the promise that there is no gap
+ between columns? The above claim would be true only if the
+ first column always started at zero, and there is never a
+ gap. So these doc comments are inconsistent. How
+ surprising.
+ */
+ long nEndPixel;
+
+ ColumnMetrics()
+ :nStartPixel(0)
+ ,nEndPixel(0)
+ {
+ }
+
+ ColumnMetrics( long const i_start, long const i_end )
+ :nStartPixel( i_start )
+ ,nEndPixel( i_end )
+ {
+ }
+ };
+
+ //==================================================================================================================
+ //= TableArea
+ //==================================================================================================================
+ enum TableArea
+ {
+ TableAreaColumnHeaders,
+ TableAreaRowHeaders,
+ TableAreaDataArea,
+ TableAreaAll
+ };
+
+ //==================================================================================================================
+ //= ITableControl
+ //==================================================================================================================
+ /** defines a callback interface to be implemented by a concrete table control
+ */
+ class SAL_NO_VTABLE ITableControl
+ {
+ public:
+ /** hides the cell cursor
+
+ The method cares for successive calls, that is, for every call to
+ ->hideCursor(), you need one call to ->showCursor. Only if the number
+ of both calls matches, the cursor is really shown.
+
+ @see showCursor
+ */
+ virtual void hideCursor() = 0;
+
+ /** shows the cell cursor
+
+ @see hideCursor
+ */
+ virtual void showCursor() = 0;
+
+ /** dispatches an action to the table control
+
+ @return
+ <TRUE/> if the action could be dispatched successfully, <FALSE/> otherwise. Usual
+ failure conditions include some other instance vetoing the action, or impossibility
+ to execute the action at all (for instance moving up one row when already positioned
+ on the very first row).
+
+ @see TableControlAction
+ */
+ virtual bool dispatchAction( TableControlAction _eAction ) = 0;
+
+ /** returns selection engine*/
+ virtual SelectionEngine* getSelEngine() = 0;
+
+ /** returns the table model
+
+ The returned model is guaranteed to not be <NULL/>.
+ */
+ virtual PTableModel getModel() const = 0;
+
+ /// returns the index of the currently active column
+ virtual ColPos getCurrentColumn() const = 0;
+
+ /// returns the index of the currently active row
+ virtual RowPos getCurrentRow() const = 0;
+
+ /// activates the given cell
+ virtual bool activateCell( ColPos const i_col, RowPos const i_row ) = 0;
+
+ /// retrieves the size of the table window, in pixels
+ virtual ::Size getTableSizePixel() const = 0;
+
+ /// sets a new mouse pointer for the table window
+ virtual void setPointer( Pointer const & i_pointer ) = 0;
+
+ /// captures the mouse to the table window
+ virtual void captureMouse() = 0;
+
+ /// releases the mouse, after it had previously been captured
+ virtual void releaseMouse() = 0;
+
+ /// invalidates the table window
+ virtual void invalidate( TableArea const i_what ) = 0;
+
+ /// calculates a width, given in pixels, into a AppFont-based width
+ virtual long pixelWidthToAppFont( long const i_pixels ) const = 0;
+
+ /// shows a trackign rectangle
+ virtual void showTracking( Rectangle const & i_location, sal_uInt16 const i_flags ) = 0;
+
+ /// hides a prviously shown tracking rectangle
+ virtual void hideTracking() = 0;
+
+ /// does a hit test for the given pixel coordinates
+ virtual TableCell hitTest( const Point& rPoint ) const = 0;
+
+ /// retrieves the metrics for a given column
+ virtual ColumnMetrics getColumnMetrics( ColPos const i_column ) const = 0;
+
+ /// determines whether a given row is selected
+ virtual bool isRowSelected( RowPos _nRow ) const = 0;
+
+ virtual ~ITableControl() {};
+ };
+
+//......................................................................................................................
+} } // namespace svt::table
+//......................................................................................................................
+
+#endif // SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/tableinputhandler.hxx b/include/svtools/table/tableinputhandler.hxx
new file mode 100644
index 000000000000..2158d573bb2d
--- /dev/null
+++ b/include/svtools/table/tableinputhandler.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 SVTOOLS_INC_TABLE_TABLEINPUTHANDLER_HXX
+#define SVTOOLS_INC_TABLE_TABLEINPUTHANDLER_HXX
+
+#include <boost/shared_ptr.hpp>
+
+class MouseEvent;
+class KeyEvent;
+class HelpEvent;
+class CommandEvent;
+class NotifyEvent;
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ class ITableControl;
+
+ //====================================================================
+ //= ITableInputHandler
+ //====================================================================
+ /** interface for components handling input in a ->TableControl
+ */
+ class ITableInputHandler
+ {
+ public:
+ // all those methods have the same semantics as the equal-named methods of ->Window,
+ // with the additional option to return a boolean value indicating whether
+ // the event should be further processed by the ->Window implementations (<FALSE/>),
+ // or whether it has been sufficiently handled by the ->ITableInputHandler instance
+ // (<FALSE/>).
+
+ virtual bool MouseMove ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool MouseButtonDown ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool MouseButtonUp ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool KeyInput ( ITableControl& _rControl, const KeyEvent& rKEvt ) = 0;
+ virtual bool GetFocus ( ITableControl& _rControl ) = 0;
+ virtual bool LoseFocus ( ITableControl& _rControl ) = 0;
+ virtual bool RequestHelp ( ITableControl& _rControl, const HelpEvent& rHEvt ) = 0;
+ virtual bool Command ( ITableControl& _rControl, const CommandEvent& rCEvt ) = 0;
+ virtual bool PreNotify ( ITableControl& _rControl, NotifyEvent& rNEvt ) = 0;
+ virtual bool Notify ( ITableControl& _rControl, NotifyEvent& rNEvt ) = 0;
+
+ virtual ~ITableInputHandler() { }
+ };
+ typedef ::boost::shared_ptr< ITableInputHandler > PTableInputHandler;
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLEINPUTHANDLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/tablemodel.hxx b/include/svtools/table/tablemodel.hxx
new file mode 100644
index 000000000000..cae54efb0ef0
--- /dev/null
+++ b/include/svtools/table/tablemodel.hxx
@@ -0,0 +1,539 @@
+/* -*- 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_INC_TABLE_TABLEMODEL_HXX
+#define SVTOOLS_INC_TABLE_TABLEMODEL_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/table/tabletypes.hxx"
+#include "svtools/table/tablerenderer.hxx"
+#include "svtools/table/tableinputhandler.hxx"
+#include "svtools/table/tablesort.hxx"
+
+#include <com/sun/star/util/Color.hpp>
+#include <com/sun/star/style/VerticalAlignment.hpp>
+#include <com/sun/star/style/HorizontalAlignment.hpp>
+
+#include <rtl/ref.hxx>
+#include <sal/types.h>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
+#include <boost/enable_shared_from_this.hpp>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+
+ //====================================================================
+ //= ScrollbarVisibility
+ //====================================================================
+ enum ScrollbarVisibility
+ {
+ /** enumeration value denoting that a scrollbar should never be visible, even
+ if needed normally
+ */
+ ScrollbarShowNever,
+ /** enumeration value denoting that a scrollbar should be visible when needed only
+ */
+ ScrollbarShowSmart,
+ /** enumeration value denoting that a scrollbar should always be visible, even
+ if not needed normally
+ */
+ ScrollbarShowAlways
+ };
+
+ //====================================================================
+ //= ITableModelListener
+ //====================================================================
+ typedef sal_Int32 ColumnAttributeGroup;
+ #define COL_ATTRS_NONE (0x00000000)
+ /// denotes column attributes related to the width of the column
+ #define COL_ATTRS_WIDTH (0x00000001)
+ /// denotes column attributes related to the appearance of the column, i.e. those relevant for rendering
+ #define COL_ATTRS_APPEARANCE (0x00000002)
+ /// denotes the entirety of column attributes
+ #define COL_ATTRS_ALL (0x7FFFFFFF)
+
+ //====================================================================
+ //= ITableModelListener
+ //====================================================================
+ /** declares an interface to be implemented by components interested in
+ changes in an ->ITableModel
+ */
+ class SAL_NO_VTABLE ITableModelListener : public ::boost::enable_shared_from_this< ITableModelListener >
+ {
+ public:
+ /** notifies the listener that one or more rows have been inserted into
+ the table
+
+ @param first
+ the index of the first newly inserted row
+ @param last
+ the index of the last newly inserted row. Must not be smaller
+ than ->first
+ */
+ virtual void rowsInserted( RowPos first, RowPos last ) = 0;
+
+ /** notifies the listener that one or more rows have been removed from
+ the table
+
+ @param first
+ the old index of the first removed row. If this is <code>-1</code>, then all
+ rows have been removed from the model.
+ @param last
+ the old index of the last removed row. Must not be smaller
+ than ->first
+ */
+ virtual void rowsRemoved( RowPos first, RowPos last ) = 0;
+
+ /** notifies the listener that one or more columns have been inserted into
+ the table
+
+ @param first
+ the index of the first newly inserted row
+ @param last
+ the index of the last newly inserted row. Must not be smaller
+ than ->first
+ */
+ virtual void columnInserted( ColPos const i_colIndex ) = 0;
+
+ /** notifies the listener that one or more columns have been removed from
+ the table
+
+ @param i_colIndex
+ the old index of the removed column
+ */
+ virtual void columnRemoved( ColPos const i_colIndex ) = 0;
+
+ /** notifies the listener that all columns have been removed form the model
+ */
+ virtual void allColumnsRemoved() = 0;
+
+ /** notifies the listener that a rectangular cell range in the table
+ has been updated
+
+ Listeners are required to discard any possibly cached information
+ they have about the cells in question, in particular any possibly
+ cached cell values.
+ */
+ virtual void cellsUpdated( ColPos const i_firstCol, ColPos i_lastCol, RowPos const i_firstRow, RowPos const i_lastRow ) = 0;
+
+ /** notifies the listener that attributes of a given column changed
+
+ @param i_column
+ the position of the column whose attributes changed
+ @param i_attributeGroup
+ a combination of one or more <code>COL_ATTRS_*</code> flags, denoting the attribute group(s)
+ in which changes occurred.
+ */
+ virtual void columnChanged( ColPos const i_column, ColumnAttributeGroup const i_attributeGroup ) = 0;
+
+ /** notifies the listener that the metrics of the table changed.
+
+ Metrics here include the column header height, the row header width, the row height, and the presence
+ of both the row and column header.
+ */
+ virtual void tableMetricsChanged() = 0;
+
+ /// deletes the listener instance
+ virtual ~ITableModelListener(){};
+ };
+ typedef ::boost::shared_ptr< ITableModelListener > PTableModelListener;
+
+ //====================================================================
+ //= IColumnModel
+ //====================================================================
+ /** interface to be implemented by table column models
+ */
+ class SAL_NO_VTABLE IColumnModel
+ {
+ public:
+ /** retrieves the ID of the column
+
+ The semantics of a column id is not defined. It's up to the
+ implementor of the ->IColumnModel, respectively the ->ITableModel
+ which provides the column models, to define such a semantics.
+
+ @return
+ the ID of the column. May be 0 if the table which the column
+ belongs to does not need and support column ids.
+
+ @see setID
+ */
+ virtual ::com::sun::star::uno::Any
+ getID() const = 0;
+
+ /** sets a new column ID
+
+ @return
+ <TRUE/> if setting the new ID was successful. A possible error
+ conditions is if you try to set an ID which is already used
+ by another column within the same table.
+
+ @see getID
+ */
+ virtual void setID( const ::com::sun::star::uno::Any& _nID ) = 0;
+
+ /** returns the name of the column
+
+ Column names should be human-readable, but not necessarily unique
+ within a given table.
+
+ @see setName
+ */
+ virtual String getName() const = 0;
+
+ /** sets a new name for the column
+
+ @see getName
+ */
+ virtual void setName( const String& _rName ) = 0;
+
+ /** retrieves the help text to be displayed for the column.
+ */
+ virtual String getHelpText() const = 0;
+
+ /** sets a new the help text to be displayed for the column.
+ */
+ virtual void setHelpText( const String& i_helpText ) = 0;
+
+ /** determines whether the column can be interactively resized
+
+ @see getMinWidth
+ @see getMaxWidth
+ @see getWidth
+ */
+ virtual bool isResizable() const = 0;
+
+ /** declares the column as resizable or fixed in width
+
+ @see getMinWidth
+ @see getMaxWidth
+ @see getWidth
+ */
+ virtual void setResizable( bool _bResizable ) = 0;
+
+ /** denotes the relative flexibility of the column
+
+ This flexibility is taken into account when a table control auto-resizes its columns, because the available
+ space changed. In this case, the columns grow or shrink according to their flexibility.
+
+ A value of 0 means the column is not auto-resized at all.
+ */
+ virtual sal_Int32 getFlexibility() const = 0;
+
+ /** sets a new flexibility value for the column
+
+ @see getFlexibility
+ */
+ virtual void setFlexibility( sal_Int32 const i_flexibility ) = 0;
+
+ /** returns the width of the column, in app-font unitss
+
+ The returned value must be a positive ->TableMetrics value.
+
+ @see setWidth
+ @see getMinWidth
+ @see getMaxWidth
+ */
+ virtual TableMetrics getWidth() const = 0;
+
+ /** sets a new width for the column
+
+ @param _nWidth
+ the new width, app-font units
+
+ @see getWidth
+ */
+ virtual void setWidth( TableMetrics _nWidth ) = 0;
+
+ /** returns the minimum width of the column, in app-font units, or 0 if the column
+ does not have a minimal width
+
+ @see setMinWidth
+ @see getMaxWidth
+ @see getWidth
+ */
+ virtual TableMetrics getMinWidth() const = 0;
+
+ /** sets the minimum width of the column, in app-font units
+
+ @see getMinWidth
+ @see setMaxWidth
+ @see setWidth
+ */
+ virtual void setMinWidth( TableMetrics _nMinWidth ) = 0;
+
+ /** returns the maximum width of the column, in app-font units, or 0 if the column
+ does not have a minimal width
+
+ @see setMaxWidth
+ @see getMinWidth
+ @see getWidth
+ */
+ virtual TableMetrics getMaxWidth() const = 0;
+
+ /** sets the maximum width of the column, in app-font units
+
+ @see getMaxWidth
+ @see setMinWidth
+ @see setWidth
+ */
+ virtual void setMaxWidth( TableMetrics _nMaxWidth ) = 0;
+
+ /** retrieves the horizontal alignment to be used for content in this cell
+ */
+ virtual ::com::sun::star::style::HorizontalAlignment getHorizontalAlign() = 0;
+
+ /** sets a new the horizontal alignment to be used for content in this cell
+ */
+ virtual void setHorizontalAlign(::com::sun::star::style::HorizontalAlignment _xAlign) = 0;
+
+ /// deletes the column model instance
+ virtual ~IColumnModel() { }
+ };
+ typedef ::boost::shared_ptr< IColumnModel > PColumnModel;
+
+ //====================================================================
+ //= ITableModel
+ //====================================================================
+ /** declares the interface to implement by an abtract table model
+ */
+ class SAL_NO_VTABLE SVT_DLLPUBLIC ITableModel
+ {
+ public:
+ /** returns the number of columns in the table
+ */
+ virtual TableSize getColumnCount() const = 0;
+
+ /** returns the number of rows in the table
+ */
+ virtual TableSize getRowCount() const = 0;
+
+ /** determines whether the table has column headers
+
+ If this method returns <TRUE/>, the renderer returned by
+ ->getRenderer must be able to render column headers.
+
+ @see IColumnRenderer
+ */
+ virtual bool hasColumnHeaders() const = 0;
+
+ /** determines whether the table has row headers
+
+ If this method returns <TRUE/>, the renderer returned by
+ ->getRenderer must be able to render row headers.
+
+ @see IColumnRenderer
+ */
+ virtual bool hasRowHeaders() const = 0;
+
+ /** determines whether the given cell is editable
+
+ @see ICellEditor
+ @todo
+ */
+ virtual bool isCellEditable( ColPos col, RowPos row ) const = 0;
+
+ /** returns a model for a certain column
+
+ @param column
+ the index of the column in question. Must be greater than or
+ equal 0, and smaller than the return value of ->getColumnCount()
+
+ @return
+ the model of the column in question. Must not be <NULL/>
+ */
+ virtual PColumnModel getColumnModel( ColPos column ) = 0;
+
+ /** returns a renderer which is able to paint the table represented
+ by this table model
+
+ @return the renderer to use. Must not be <NULL/>
+ */
+ virtual PTableRenderer getRenderer() const = 0;
+
+ /** returns the component handling input in a view associated with the model
+ */
+ virtual PTableInputHandler getInputHandler() const = 0;
+
+ /** determines the height of rows in the table.
+
+ @return
+ the logical height of rows in the table, in app-font units. The height must be
+ greater 0.
+ */
+ virtual TableMetrics getRowHeight() const = 0;
+
+ /** determines the height of the column header row
+
+ This method is not to be called if ->hasColumnHeaders()
+ returned <FALSE/>.
+
+ @return
+ the logical height of the column header row, in app-font units.
+ Must be greater than 0.
+ */
+ virtual TableMetrics getColumnHeaderHeight() const = 0;
+
+ /** determines the width of the row header column
+
+ This method is not to be called if ->hasRowHeaders()
+ returned <FALSE/>.
+
+ @return
+ the logical width of the row header column, in app-font units.
+ Must be greater than 0.
+ */
+ virtual TableMetrics getRowHeaderWidth() const = 0;
+
+ /** returns the visibilit mode of the vertical scrollbar
+ */
+ virtual ScrollbarVisibility getVerticalScrollbarVisibility() const = 0;
+
+ /** returns the visibilit mode of the horizontal scrollbar
+ */
+ virtual ScrollbarVisibility getHorizontalScrollbarVisibility() const = 0;
+
+ /** adds a listener to be notified of changes in the table model
+ */
+ virtual void addTableModelListener( const PTableModelListener& i_listener ) = 0;
+
+ /** remove a listener to be notified of changes in the table model
+ */
+ virtual void removeTableModelListener( const PTableModelListener& i_listener ) = 0;
+
+ /** retrieves the content of the given cell
+ */
+ virtual void getCellContent( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any& o_cellContent ) = 0;
+
+ /** returns an object which should be displayed as tooltip for the given cell
+
+ At the moment, only string-convertible values are supported here. In the future, one might imagine displaying
+ scaled-down versions of a graphic in a cell, and a larger version of that very graphic as tooltip.
+
+ If no tooltip object is provided, then the cell content is used, and displayed as tooltip for the cell
+ if and only if it doesn't fit into the cell's space itself.
+
+ @param i_col
+ The column index of the cell in question. COL_ROW_HEADERS is a valid argument here.
+ @param i_row
+ The row index of the cell in question.
+ @param o_cellToolTip
+ takes the tooltip object upon return.
+ */
+ virtual void getCellToolTip( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any & o_cellToolTip ) = 0;
+
+ /** retrieves title of a given row
+ */
+ virtual ::com::sun::star::uno::Any getRowHeading( RowPos const i_rowPos ) const = 0;
+
+ /** returns the color to be used for rendering the grid lines.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getLineColor() const = 0;
+
+ /** returns the color to be used for rendering the header background.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getHeaderBackgroundColor() const = 0;
+
+ /** returns the color to be used for rendering the header text.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getHeaderTextColor() const = 0;
+
+ /** returns the color to be used for the background of selected cells, when the control has the focus
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getActiveSelectionBackColor() const = 0;
+
+ /** returns the color to be used for the background of selected cells, when the control does not have the focus
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getInactiveSelectionBackColor() const = 0;
+
+ /** returns the color to be used for the text of selected cells, when the control has the focus
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getActiveSelectionTextColor() const = 0;
+
+ /** returns the color to be used for the text of selected cells, when the control does not have the focus
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getInactiveSelectionTextColor() const = 0;
+
+ /** returns the color to be used for rendering cell texts.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getTextColor() const = 0;
+
+ /** returns the color to be used for text lines (underline, strikethrough) when rendering cell text.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getTextLineColor() const = 0;
+
+ /** returns the colors to be used for the row backgrounds.
+
+ If this value is not set, every second row will have a background color derived from the style settings's
+ selection color, the other rows will not have a special background at all.
+
+ If this value is an empty sequence, the rows will not have a special background at all, instead the
+ normal background of the complete control will be used.
+
+ If value is a non-empty sequence, then rows will have the background colors as specified in the sequence,
+ in alternating order.
+ */
+ virtual ::boost::optional< ::std::vector< ::Color > >
+ getRowBackgroundColors() const = 0;
+
+ /** determines the vertical alignment of content within a cell
+ */
+ virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign() const = 0;
+
+ /** returns an adapter to the sorting functionality of the model
+
+ It is legitimate to return <NULL/> here, in this case, the table model does not support sorting.
+ */
+ virtual ITableDataSort* getSortAdapter() = 0;
+
+ /// destroys the table model instance
+ virtual ~ITableModel() { }
+ };
+ typedef ::boost::shared_ptr< ITableModel > PTableModel;
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLEMODEL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/tablerenderer.hxx b/include/svtools/table/tablerenderer.hxx
new file mode 100644
index 000000000000..05ee87571c4c
--- /dev/null
+++ b/include/svtools/table/tablerenderer.hxx
@@ -0,0 +1,285 @@
+/* -*- 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_INC_TABLE_TABLERENDERER_HXX
+#define SVTOOLS_INC_TABLE_TABLERENDERER_HXX
+
+#include <svtools/table/tabletypes.hxx>
+
+#include <vcl/outdev.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+
+ //====================================================================
+ //= ITableRenderer
+ //====================================================================
+ /** interface to implement by components rendering a ->TableControl
+ */
+ class SAL_NO_VTABLE ITableRenderer
+ {
+ public:
+
+ /** paints a (part of) header area
+
+ There are two header areas in a table control:
+ <ul><li>The row containing all column headers, i.e. <em>above</em> all rows containing the data</li>
+ <li>The column containing all row headers. i.e. <em>left of</em> all columns containing the data</li>
+ </ul>
+
+ A header area is more than the union of the single column/row headers.
+
+ First, there might be less columns than fit into the view - in this case, right
+ beside the right-most column, there's still room which belongs to the column header
+ area, but is not occupied by any particular column header.<br/>
+ An equivalent statement holds for the row header area, if there are less rows than
+ fit into the view.
+
+ Second, if the table control has both a row header and a column header,
+ the intersection between those both belongs to both the column header area and the
+ row header area, but not to any particular column or row header.
+
+ There are two flags specifying whether the to-be-painted area is part of the column
+ and/or row header area.
+ <ul><li>If both are <TRUE/>, the intersection of both areas is to be painted.</li>
+ <li>If ->_bIsColHeaderArea is <TRUE/> and ->_bIsRowHeaderArea is <FALSE/>,
+ then ->_rArea denotes the column header area <em>excluding</em> the
+ intersection between row and column header area.</li>
+ <li>Equivalently for ->_bIsColHeaderArea being <FALSE/> and ->_bIsRowHeaderArea
+ being <TRUE/></li>
+ </ul>
+ Note that it's not possible for both ->_bIsColHeaderArea and ->_bIsRowHeaderArea
+ to be <FALSE/> at the same time.
+
+ @param _rDevice
+ the device to paint onto
+ @param _rArea
+ the area to paint into
+ @param _bIsColHeaderArea
+ <TRUE/> if and only if ->_rArea is part of the column header area.
+ @param _bIsRowHeaderArea
+ <TRUE/> if and only if ->_rArea is part of the row header area.
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PaintHeaderArea(
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ bool _bIsColHeaderArea, bool _bIsRowHeaderArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** paints the header for a given column
+
+ @param _nCol
+ the index of the column to paint
+ @param _bActive
+ <TRUE/> if and only if the column whose column is to be painted
+ contains the active cell.
+ @param _bSelected
+ <TRUE/> if and only if the column whose column is to be painted
+ is selected currently.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rArea
+ the are into which the column header should be painted
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PaintColumnHeader( ColPos _nCol, bool _bActive, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** prepares a row for painting
+
+ Painting a table means painting rows as necessary, in an increasing
+ order. The assumption is that retrieving data for two different rows
+ is (potentially) more expensive than retrieving data for two different
+ columns. Thus, the renderer will get the chance to "seek" to a certain
+ row, and then has to render all cells in this row, before another
+ row is going to be painted.
+
+ @param _nRow
+ the row which is going to be painted. The renderer should
+ at least remember this row, since subsequent calls to
+ ->PaintRowHeader(), ->PaintCell(), and ->FinishRow() will
+ not pass this parameter again.
+
+ However, the renderer is also allowed to render any
+ cell-independent content of this row.
+
+ @param i_hasControlFocus
+ <TRUE/> if and only if the table control currently has the focus
+ @param _bSelected
+ <TRUE/> if and only if the row to be prepared is
+ selected currently.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rRowArea
+ the are into which the row should be painted. This excludes
+ the row header area, if applicable.
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PrepareRow( RowPos _nRow, bool i_hasControlFocus, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rRowArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** paints the header of a row
+
+ The row to be painted is denoted by the most recent call to
+ ->PrepareRow.
+
+ @param i_hasControlFocus
+ <TRUE/> if and only if the table control currently has the focus
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convinience
+ only.
+ @param _bSelected
+ <TRUE/> if and only if the row whose header cell is to be
+ painted is selected currently.
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convinience
+ only.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rArea
+ the are into which the row header should be painted
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PaintRowHeader( bool i_hasControlFocus, bool _bSelected,
+ OutputDevice& _rDevice, Rectangle const & _rArea,
+ StyleSettings const & _rStyle ) = 0;
+
+ /** paints a certain cell
+
+ The row to be painted is denoted by the most recent call to
+ ->PrepareRow.
+
+ @param _bSelected
+ <TRUE/> if and only if the cell to be painted is
+ selected currently. This is the case if either
+ the row or the column of the cell is currently selected.
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convinience
+ only.
+ @param i_hasControlFocus
+ <TRUE/> if and only if the table control currently has the focus
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convinience
+ only.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rArea
+ the are into which the cell should be painted
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PaintCell( ColPos const i_col,
+ bool i_hasControlFocus, bool _bSelected,
+ OutputDevice& _rDevice, const Rectangle& _rArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** draws a cell cursor in the given rectangle
+
+ The cell cursor is used to indicate the active/current cell
+ of a table control.
+ */
+ virtual void ShowCellCursor( Window& _rView, const Rectangle& _rCursorRect) = 0;
+
+ /** hides the cell cursor previously drawn into the given rectangle
+
+ The cell cursor is used to indicate the active/current cell
+ of a table control.
+ */
+ virtual void HideCellCursor( Window& _rView, const Rectangle& _rCursorRect) = 0;
+
+ /** checks whether a given cell content fits into a given target area on a given device.
+
+ @param i_colPos
+ denotes the column which the cell content would be painted into. Your renderer implementation
+ would only need this parameter if rendering is done differently for different columns.
+
+ @param i_rowPos
+ denotes the row which the cell content would be painted into. Your renderer implementation
+ would only need this parameter if rendering is done differently for different rows.
+
+ @param i_active
+ is <TRUE/> if and only if the renderer should assume the cell content would be painted for the active
+ cell.
+
+ @param i_selected
+ is <TRUE/> if and only if the renderer should assume the cell content would be painted for a selected
+ cell.
+
+ @param i_targetDevice
+ denotes the target device for the assumed rendering operation
+
+ @param i_targetArea
+ denotes the area within the target device for the assumed rendering operation.
+
+ @return
+ <TRUE/> if and only if the given cell content could be rendered into the given device and the
+ given area.
+ */
+ virtual bool FitsIntoCell(
+ ::com::sun::star::uno::Any const & i_cellContent,
+ ColPos const i_colPos, RowPos const i_rowPos,
+ bool const i_active, bool const i_selected,
+ OutputDevice& i_targetDevice, Rectangle const & i_targetArea
+ ) const = 0;
+
+ /** attempts to format the content of the given cell as string
+
+ @param i_cellValue
+ the value for which an attempt for a string conversion should be made
+ @param i_colPos
+ the column position of the cell in question
+ @param i_rowPos
+ the row position of the cell in question
+ @param o_cellString
+ the cell content, formatted as string
+ @return
+ <TRUE/> if and only if the content could be formatted as string
+ */
+ virtual bool GetFormattedCellString(
+ ::com::sun::star::uno::Any const & i_cellValue,
+ ColPos const i_colPos, RowPos const i_rowPos,
+ OUString & o_cellString
+ ) const = 0;
+
+ /// deletes the renderer instance
+ virtual ~ITableRenderer() { }
+ };
+ typedef ::boost::shared_ptr< ITableRenderer > PTableRenderer;
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLERENDERER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/tablesort.hxx b/include/svtools/table/tablesort.hxx
new file mode 100644
index 000000000000..072e088cb3ee
--- /dev/null
+++ b/include/svtools/table/tablesort.hxx
@@ -0,0 +1,89 @@
+/* -*- 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_TABLESORT_HXX
+#define SVTOOLS_TABLESORT_HXX
+
+#include "svtools/table/tabletypes.hxx"
+
+//......................................................................................................................
+namespace svt { namespace table
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= ColumnSortDirection
+ //==================================================================================================================
+ enum ColumnSortDirection
+ {
+ ColumnSortAscending,
+ ColumnSortDescending
+ };
+
+ //==================================================================================================================
+ //= ColumnSort
+ //==================================================================================================================
+ struct ColumnSort
+ {
+ ColPos nColumnPos;
+ ColumnSortDirection eSortDirection;
+
+ ColumnSort()
+ :nColumnPos( COL_INVALID )
+ ,eSortDirection( ColumnSortAscending )
+ {
+ }
+
+ ColumnSort( ColPos const i_columnPos, ColumnSortDirection const i_sortDirection )
+ :nColumnPos( i_columnPos )
+ ,eSortDirection( i_sortDirection )
+ {
+ }
+ };
+
+ //==================================================================================================================
+ //= ITableDataSort
+ //==================================================================================================================
+ /** provides sorting functionality for the datta underlying an ITableModel
+ */
+ class SAL_NO_VTABLE ITableDataSort
+ {
+ public:
+ /** sorts the rows in the model by the given column's data, in the given direction.
+ */
+ virtual void sortByColumn( ColPos const i_column, ColumnSortDirection const i_sortDirection ) = 0;
+
+ /** retrieves the current sort order of the data
+
+ If the <code>nColumnIndex</code> member of the returned srtructure is <code>COL_INVALID</code>, then
+ the data is currently not sorted.
+ */
+ virtual ColumnSort getCurrentSortOrder() const = 0;
+
+ protected:
+ ~ITableDataSort() {}
+ };
+
+//......................................................................................................................
+} } // namespace svt::table
+//......................................................................................................................
+
+#endif // SVTOOLS_TABLESORT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/table/tabletypes.hxx b/include/svtools/table/tabletypes.hxx
new file mode 100644
index 000000000000..f0333a9a49d7
--- /dev/null
+++ b/include/svtools/table/tabletypes.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 SVTOOLS_INC_TABLE_TABLETYPES_HXX
+#define SVTOOLS_INC_TABLE_TABLETYPES_HXX
+
+#include <sal/types.h>
+
+//........................................................................
+namespace svt { namespace table
+{
+//........................................................................
+ /// a value denoting the size of a table
+ typedef sal_Int32 TableSize;
+
+ /// a value denoting a column position within a table
+ typedef sal_Int32 ColPos;
+ /// a value denoting a row position within a table
+ typedef sal_Int32 RowPos;
+
+ /** a value denoting an arbitrary coordinate value of a position within
+ a table
+
+ Values of this type are guaranteed to be large enough to hold column
+ positions as well as row positions.
+ */
+ typedef sal_Int32 AnyPos;
+
+ typedef sal_Int32 TableMetrics;
+
+/// denotes the column containing the row headers
+#define COL_ROW_HEADERS ((::svt::table::ColPos)-1)
+/// denotes the row containing the column headers
+#define ROW_COL_HEADERS ((::svt::table::RowPos)-1)
+
+/// denotes an invalid column index
+#define COL_INVALID ((::svt::table::ColPos)-2)
+/// denotes an invalid row index
+#define ROW_INVALID ((::svt::table::RowPos)-2)
+
+
+//........................................................................
+} } // namespace svt::table
+//........................................................................
+
+#endif // SVTOOLS_INC_TABLE_TABLETYPES_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 000000000000..9000c3e8d7db
--- /dev/null
+++ b/include/svtools/templatefoldercache.hxx
@@ -0,0 +1,102 @@
+/* -*- 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 SFX2_TEMPLATEFOLDERCACHE_HXX
+#define SFX2_TEMPLATEFOLDERCACHE_HXX
+
+#include "svtools/svtdllapi.h"
+#include <sal/types.h>
+
+//.........................................................................
+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 a 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 SVT_DLLPUBLIC TemplateFolderCache
+ {
+ private:
+ 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 epplicitly 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( sal_Bool _bAutoStoreState = sal_False );
+ ~TemplateFolderCache( );
+
+ /** determines whether or not the template configuration needs to be updated
+ @param _bForceCheck
+ set this to <TRUE/> if you want the object to rescan the template folders in every case. The default (<FALSE/>)
+ means that once the information has been retrieved in a first call, every second call returns the same result
+ as the first one, even if in the meantime the template folders changed.
+ @return
+ <TRUE/> if the template configuration needs to be updated
+ */
+ sal_Bool needsUpdate( sal_Bool _bForceCheck = sal_False );
+
+ /** stores the current state of the template folders in the cache
+ @param _bForceRetrieval
+ if set to <TRUE/>, the current state of the template folders is retrieved again, even if it is already known.
+ Usually, you set this to <FALSE/>: After calling <method>needsUpdate</method>, the state is know and does not
+ need to be read again.
+ */
+ void storeState( sal_Bool _bForceRetrieval = sal_False );
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // SFX2_TEMPLATEFOLDERCACHE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/templdlg.hxx b/include/svtools/templdlg.hxx
new file mode 100644
index 000000000000..d8eeaa884845
--- /dev/null
+++ b/include/svtools/templdlg.hxx
@@ -0,0 +1,81 @@
+/* -*- 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_TEMPLDLG_HXX
+#define _SVTOOLS_TEMPLDLG_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/fixedhyper.hxx>
+
+struct SvtTmplDlg_Impl;
+
+// class SvtDocumentTemplateDialog ---------------------------------------
+
+class SvtTemplateWindow;
+
+class SVT_DLLPUBLIC SvtDocumentTemplateDialog : public ModalDialog
+{
+private:
+ FixedHyperlink aMoreTemplatesLink;
+ FixedLine aLine;
+ PushButton aManageBtn;
+ PushButton aPackageBtn;
+ PushButton aEditBtn;
+ OKButton aOKBtn;
+ CancelButton aCancelBtn;
+ HelpButton aHelpBtn;
+
+ SvtTmplDlg_Impl* pImpl;
+
+ DECL_DLLPRIVATE_LINK( SelectHdl_Impl, void* );
+ DECL_DLLPRIVATE_LINK( DoubleClickHdl_Impl, void* );
+ DECL_DLLPRIVATE_LINK( NewFolderHdl_Impl, void* );
+ DECL_DLLPRIVATE_LINK( SendFocusHdl_Impl, void* );
+ DECL_DLLPRIVATE_LINK( OKHdl_Impl, PushButton* );
+ DECL_DLLPRIVATE_LINK( OrganizerHdl_Impl, void* );
+ DECL_DLLPRIVATE_LINK( PackageHdl_Impl, void* );
+ DECL_DLLPRIVATE_LINK( UpdateHdl_Impl, Timer* );
+ DECL_DLLPRIVATE_LINK( OpenLinkHdl_Impl, void* );
+
+public:
+ SvtDocumentTemplateDialog( Window* pParent );
+
+ /** ctor for calling the dialog for <em>selection</em> only, not for <em>opening</em> a document
+ <p>If you use this ctor, the dialog will behave differently in the following areas:
+ <ul><li>The <em>Edit</em> button will be hidden.</li>
+ <li>Upon pressing em>Open</em>, the selected file will not be opened. Instead, it's
+ URL is available (see <method>GetSelectedFileURL</method>).</li>
+ </ul>
+
+ */
+ ~SvtDocumentTemplateDialog();
+
+ void SelectTemplateFolder();
+
+private:
+ SVT_DLLPRIVATE void InitImpl( );
+ SVT_DLLPRIVATE sal_Bool CanEnableEditBtn() const;
+};
+
+#endif // _SVTOOLS_TEMPLDLG_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 000000000000..21de95eaa89c
--- /dev/null
+++ b/include/svtools/textwindowpeer.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_TEXTWINDOWPEER_HXX
+#define INCLUDED_SVTOOLS_TEXTWINDOWPEER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <toolkit/awt/vclxwindow.hxx>
+
+#include <memory>
+
+class TextEngine;
+class TextView;
+
+namespace svt
+{
+ class AccessibleFactoryAccess ;
+
+class TextWindowPeer: public ::VCLXWindow
+{
+public:
+ SVT_DLLPUBLIC TextWindowPeer(::TextView & rView, bool bCompoundControlChild = false);
+
+ virtual ~TextWindowPeer();
+
+private:
+ // VCLXWindow inherits funny copy constructor and assignment operator from
+ // ::cppu::OWeakObject, so override them here:
+
+ TextWindowPeer(TextWindowPeer &); // not implemented
+
+ void operator =(TextWindowPeer); // not implemented
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleContext >
+ CreateAccessibleContext();
+
+ ::TextEngine & m_rEngine;
+ ::TextView & m_rView;
+ bool m_bCompoundControlChild;
+
+ ::std::auto_ptr< ::svt::AccessibleFactoryAccess > m_pFactoryAccess;
+};
+
+}
+
+#endif // INCLUDED_SVTOOLS_TEXTWINDOWPEER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolbarmenu.hxx b/include/svtools/toolbarmenu.hxx
new file mode 100644
index 000000000000..247483440947
--- /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 _SVTOOLS_TOOLBARMENU_HXX_
+#define _SVTOOLS_TOOLBARMENU_HXX_
+
+#include "svtools/svtdllapi.h"
+
+#include <com/sun/star/frame/FeatureStateEvent.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+
+#include <vector>
+
+#include <rtl/ref.hxx>
+
+#include <vcl/ctrl.hxx>
+#include <vcl/menu.hxx>
+#include <vcl/dockwin.hxx>
+
+class ValueSet;
+
+namespace svtools {
+
+class ToolbarMenuEntry;
+struct ToolbarMenu_Impl;
+
+class SVT_DLLPUBLIC ToolbarMenu : public DockingWindow
+{
+ friend class ToolbarMenuStatusListener;
+ friend struct ToolbarMenu_Impl;
+public:
+ ToolbarMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ Window* pParentWindow,
+ WinBits nBits );
+
+ ToolbarMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
+ Window* pParentWindow,
+ const ResId& rResId );
+
+ ~ToolbarMenu();
+
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvent );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+
+ void appendEntry( int nEntryId, const String& rStr, MenuItemBits nItemBits = 0 );
+ void appendEntry( int nEntryId, const String& rStr, const Image& rImage, MenuItemBits nItemBits = 0 );
+ void appendEntry( int nEntryId, Control* pControl, MenuItemBits nItemBits = 0 );
+ void appendSeparator();
+
+ /** creates an empty ValueSet that is initialized and can be inserted with appendEntry. */
+ ValueSet* createEmptyValueSetControl();
+
+ void checkEntry( int nEntryId, bool bCheck = true );
+
+ void enableEntry( int nEntryId, bool bEnable = true );
+
+ void setEntryText( int nEntryId, const String& rStr );
+
+ void setEntryImage( int nEntryId, const Image& rImage );
+
+ const Size& getMenuSize() const;
+
+ void SetSelectHdl( const Link& rLink );
+
+ int getSelectedEntryId() const;
+ int getHighlightedEntryId() const;
+
+ void highlightFirstEntry();
+
+protected:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+
+ // todo: move to new base class that will replace SfxPopupWindow
+ void AddStatusListener( const OUString& rCommandURL );
+
+ bool IsInPopupMode();
+ void EndPopupMode();
+
+ // XStatusListener (subclasses must override this one to get the status updates
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ void StateChanged( StateChangedType nType );
+ void DataChanged( const DataChangedEvent& rDCEvt );
+
+private:
+ DECL_LINK( HighlightHdl, Control * );
+
+ void initStatusListener();
+
+ void implInit( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
+ void initWindow();
+
+ Size implCalcSize();
+
+ void appendEntry( ToolbarMenuEntry* pEntry );
+
+ void implPaint( ToolbarMenuEntry* pThisOnly = NULL, bool bHighlight = false );
+
+ void implHighlightEntry( int nHighlightEntry, bool bHighlight );
+ void implHighlightEntry( const MouseEvent& rMEvt, bool bMBDown );
+
+ void implChangeHighlightEntry( int nEntry );
+ void implSelectEntry( int nSelectedEntry );
+
+ ToolbarMenuEntry* implCursorUpDown( bool bUp, bool bHomeEnd );
+ ToolbarMenuEntry* implGetEntry( int nEntry ) const;
+ ToolbarMenuEntry* implSearchEntry( int nEntryId ) const;
+
+ ToolbarMenu_Impl* mpImpl;
+};
+
+} // namespace svtools
+
+#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 000000000000..6bccf935be9c
--- /dev/null
+++ b/include/svtools/toolboxcontroller.hxx
@@ -0,0 +1,162 @@
+/* -*- 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_TOOLBOXCONTROLLER_HXX
+#define _SVTOOLS_TOOLBOXCONTROLLER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <com/sun/star/frame/XToolbarController.hpp>
+#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/util/XUpdatable.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <comphelper/proparrhlp.hxx>
+#include <comphelper/property.hxx>
+#include <comphelper/propertycontainer.hxx>
+#include <cppuhelper/propshlp.hxx>
+
+#include <boost/unordered_map.hpp>
+
+class ToolBox;
+
+namespace svt
+{
+struct ToolboxController_Impl;
+
+class SVT_DLLPUBLIC ToolboxController : public ::com::sun::star::frame::XStatusListener,
+ public ::com::sun::star::frame::XToolbarController,
+ public ::com::sun::star::lang::XInitialization,
+ public ::com::sun::star::util::XUpdatable,
+ public ::com::sun::star::lang::XComponent,
+ public ::comphelper::OMutexAndBroadcastHelper,//shizhoubo
+ public ::comphelper::OPropertyContainer,//shizhoubo
+ public ::comphelper::OPropertyArrayUsageHelper< ToolboxController >,//shizhoubo
+ public ::cppu::OWeakObject
+{
+ private:
+ sal_Bool m_bSupportVisible; //shizhoubo
+ public:
+ ToolboxController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
+ const OUString& aCommandURL );
+ ToolboxController();
+ virtual ~ToolboxController();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > getFrameInterface() const;
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& getContext() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager > getLayoutManager() const;
+
+ void updateStatus( const OUString aCommandURL );
+ void updateStatus();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XUpdatable
+ virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ using cppu::OPropertySetHelper::disposing;
+ virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& Parent ) throw (::com::sun::star::uno::RuntimeException);
+ // OPropertySetHelper //shizhoubo
+ virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const com::sun::star::uno::Any& rValue ) throw(com::sun::star::uno::Exception);
+ virtual sal_Bool SAL_CALL convertFastPropertyValue( com::sun::star::uno::Any& rConvertedValue, com::sun::star::uno::Any& rOldValue, sal_Int32 nHandle, const com::sun::star::uno::Any& rValue) throw(com::sun::star::lang::IllegalArgumentException);
+ // XPropertySet //shizhoubo
+ virtual ::com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ // OPropertyArrayUsageHelper //shizhoubo
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
+
+
+ const OUString& getCommandURL() const { return m_aCommandURL; }
+ const OUString& getModuleName() const;
+
+ void dispatchCommand( const OUString& sCommandURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs );
+
+ void enable( bool bEnable );
+
+ protected:
+ bool getToolboxId( sal_uInt16& rItemId, ToolBox** ppToolBox );
+ void setSupportVisibleProperty(sal_Bool bValue); //shizhoubo
+ struct Listener
+ {
+ Listener( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& rDispatch ) :
+ aURL( rURL ), xDispatch( rDispatch ) {}
+
+ ::com::sun::star::util::URL aURL;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
+ };
+
+ typedef ::boost::unordered_map< OUString,
+ com::sun::star::uno::Reference< com::sun::star::frame::XDispatch >,
+ OUStringHash,
+ ::std::equal_to< OUString > > 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();
+ sal_Bool isBound() const;
+ sal_Bool hasBigImages() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > getURLTransformer() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > getParent() const;
+
+ sal_Bool m_bInitialized : 1,
+ m_bDisposed : 1;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
+ ToolboxController_Impl* m_pImpl;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ OUString m_aCommandURL;
+ URLToDispatchMap m_aListenerMap;
+ ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
+};
+
+}
+
+#endif // _SVTOOLS_TOOLBOXCONTROLLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/decklayouter.hxx b/include/svtools/toolpanel/decklayouter.hxx
new file mode 100644
index 000000000000..08022018ed38
--- /dev/null
+++ b/include/svtools/toolpanel/decklayouter.hxx
@@ -0,0 +1,99 @@
+/* -*- 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 SVT_DECKLAYOUTER_HXX
+#define SVT_DECKLAYOUTER_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <rtl/ref.hxx>
+
+#include <boost/optional.hpp>
+
+namespace com { namespace sun { namespace star { namespace accessibility {
+ class XAccessible;
+} } } }
+class Rectangle;
+class Point;
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= IDeckLayouter
+ //====================================================================
+ class IDeckLayouter : public ::rtl::IReference
+ {
+ public:
+ /** re-arranges the elements of the tool deck, taking into account the
+ available space for the complete deck.
+
+ @param i_rDeckPlayground
+ the playground for the complete tool panel deck
+ @return
+ the content area for a single tool panel
+ */
+ virtual ::Rectangle Layout( const ::Rectangle& i_rDeckPlayground ) = 0;
+
+ /** destroys the instance
+
+ Since the layouter is ref-counted, but might keep references to non-ref-counted objects
+ (in particular, the ToolPanelDeck, which is a VCL-Window, and thus cannot be ref-counted),
+ Destroy is the definitive way to dispose the instance. Technically, it's still alive afterwards,
+ but non-functional.
+ */
+ virtual void Destroy() = 0;
+
+ /** assuming that a layouter neesds to provide some kind of panel selector control, this method
+ requests to set the focus to this control.
+ */
+ virtual void SetFocusToPanelSelector() = 0;
+
+ /** returns the number of components in the XAccessible hierarchy which are needed to represent all elements
+ the layouter is responsible form.
+
+ Note that the implementation must guarantee that the count is fixed over the life time of the layouter.
+ */
+ virtual size_t GetAccessibleChildCount() const = 0;
+
+ /** retrieves the XAccessible implementation for the <code>i_nChildIndex</code>'th child in the XAccessible
+ hierarchy.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ GetAccessibleChild(
+ const size_t i_nChildIndex,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ ) = 0;
+
+ virtual ~IDeckLayouter()
+ {
+ }
+ };
+
+ typedef ::rtl::Reference< IDeckLayouter > PDeckLayouter;
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_DECKLAYOUTER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/drawerlayouter.hxx b/include/svtools/toolpanel/drawerlayouter.hxx
new file mode 100644
index 000000000000..0ee0560a8873
--- /dev/null
+++ b/include/svtools/toolpanel/drawerlayouter.hxx
@@ -0,0 +1,97 @@
+/* -*- 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 SVT_DRAWERLAYOUTER_HXX
+#define SVT_DRAWERLAYOUTER_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/toolpanel/refbase.hxx"
+#include "svtools/toolpanel/toolpaneldeck.hxx"
+#include "svtools/toolpanel/decklayouter.hxx"
+
+#include <boost/shared_ptr.hpp>
+
+//......................................................................................................................
+namespace svt
+{
+//......................................................................................................................
+
+ class ToolPanelViewShell;
+ class ToolPanelDrawer;
+ typedef ::boost::shared_ptr< ToolPanelDrawer > PToolPanelDrawer;
+
+ //==================================================================================================================
+ //= ToolPanelDrawer
+ //==================================================================================================================
+ /** a class which implements a tool panel selector in the form of the classical drawers
+ */
+ class SVT_DLLPUBLIC DrawerDeckLayouter :public RefBase
+ ,public IDeckLayouter
+ ,public IToolPanelDeckListener
+ {
+ public:
+ DrawerDeckLayouter(
+ ::Window& i_rParentWindow,
+ IToolPanelDeck& i_rPanels
+ );
+ ~DrawerDeckLayouter();
+
+ // IReference
+ DECLARE_IREFERENCE()
+
+ // IDeckLayouter
+ virtual Rectangle Layout( const Rectangle& i_rDeckPlayground );
+ virtual void Destroy();
+ virtual void SetFocusToPanelSelector();
+ virtual size_t GetAccessibleChildCount() const;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ GetAccessibleChild(
+ const size_t i_nChildIndex,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ );
+
+ // IToolPanelDeckListener
+ virtual void PanelInserted( const PToolPanel& i_pPanel, const size_t i_nPosition );
+ virtual void PanelRemoved( const size_t i_nPosition );
+ virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive );
+ virtual void LayouterChanged( const PDeckLayouter& i_rNewLayouter );
+ virtual void Dying();
+
+ private:
+ // triggers a re-arrance of the panel deck elements
+ void impl_triggerRearrange() const;
+ size_t impl_getPanelPositionFromWindow( const Window* i_pDrawerWindow ) const;
+ void impl_removeDrawer( const size_t i_nPosition );
+
+ DECL_LINK( OnWindowEvent, VclSimpleEvent* );
+
+private:
+ Window& m_rParentWindow;
+ IToolPanelDeck& m_rPanelDeck;
+ ::std::vector< PToolPanelDrawer > m_aDrawers;
+ ::boost::optional< size_t > m_aLastKnownActivePanel;
+ };
+
+//......................................................................................................................
+} // namespace svt
+//......................................................................................................................
+
+#endif // SVT_DRAWERLAYOUTER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/paneltabbar.hxx b/include/svtools/toolpanel/paneltabbar.hxx
new file mode 100644
index 000000000000..0b534f88ed9b
--- /dev/null
+++ b/include/svtools/toolpanel/paneltabbar.hxx
@@ -0,0 +1,96 @@
+/* -*- 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 SVT_PANELTABBAR_HXX
+#define SVT_PANELTABBAR_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/toolpanel/tabalignment.hxx"
+#include "svtools/toolpanel/tabitemcontent.hxx"
+
+#include <vcl/ctrl.hxx>
+
+#include <memory>
+#include <boost/optional.hpp>
+
+class PushButton;
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ class PanelTabBar_Impl;
+ class IToolPanelDeck;
+
+ //====================================================================
+ //= PanelTabBar
+ //====================================================================
+ /** a tab bar for selecting panels
+
+ At the moment, this control aligns the tabs vertically, this might be extended to also support a horizontal
+ layout in the future.
+ */
+ class SVT_DLLPUBLIC PanelTabBar : public Control
+ {
+ public:
+ PanelTabBar( Window& i_rParentWindow, IToolPanelDeck& i_rPanelDeck, const TabAlignment i_eAlignment, const TabItemContent i_eItemContent );
+ ~PanelTabBar();
+
+ // attribute access
+ TabItemContent GetTabItemContent() const;
+ void SetTabItemContent( const TabItemContent& i_eItemContent );
+
+ ::boost::optional< size_t > GetFocusedPanelItem() const;
+ void FocusPanelItem( const size_t i_nItemPos );
+ Rectangle GetItemScreenRect( const size_t i_nItemPos ) const;
+ bool IsVertical() const;
+ IToolPanelDeck& GetPanelDeck() const;
+ PushButton& GetScrollButton( const bool i_bForward );
+
+ // Window overridables
+ virtual Size GetOptimalSize() const;
+
+ protected:
+ // Window overridables
+ virtual void Paint( const Rectangle& i_rRect );
+ virtual void Resize();
+ virtual void MouseMove( const MouseEvent& i_rMouseEvent );
+ virtual void MouseButtonDown( const MouseEvent& i_rMouseEvent );
+ virtual void MouseButtonUp( const MouseEvent& i_rMouseEvent );
+ virtual void RequestHelp( const HelpEvent& i_rHelpEvent );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void KeyInput( const KeyEvent& i_rKeyEvent );
+ virtual void DataChanged( const DataChangedEvent& i_rDataChanedEvent );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
+ GetComponentInterface( sal_Bool i_bCreate );
+
+ private:
+ ::std::auto_ptr< PanelTabBar_Impl > m_pImpl;
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_PANELTABBAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/refbase.hxx b/include/svtools/toolpanel/refbase.hxx
new file mode 100644
index 000000000000..18f86edbfbab
--- /dev/null
+++ b/include/svtools/toolpanel/refbase.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 SVT_REFBASE_HXX
+#define SVT_REFBASE_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <rtl/ref.hxx>
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= RefBase
+ //====================================================================
+ class SVT_DLLPUBLIC RefBase : public ::rtl::IReference
+ {
+ protected:
+ RefBase()
+ :m_refCount( 0 )
+ {
+ }
+
+ virtual ~RefBase()
+ {
+ }
+
+ virtual oslInterlockedCount SAL_CALL acquire();
+ virtual oslInterlockedCount SAL_CALL release();
+
+ private:
+ oslInterlockedCount m_refCount;
+ };
+
+#define DECLARE_IREFERENCE() \
+ virtual oslInterlockedCount SAL_CALL acquire(); \
+ virtual oslInterlockedCount SAL_CALL release();
+
+
+#define IMPLEMENT_IREFERENCE( classname ) \
+ oslInterlockedCount classname::acquire() \
+ { \
+ return RefBase::acquire(); \
+ } \
+ oslInterlockedCount classname::release() \
+ { \
+ return RefBase::release(); \
+ }
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_REFBASE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/tabalignment.hxx b/include/svtools/toolpanel/tabalignment.hxx
new file mode 100644
index 000000000000..e626d03dc267
--- /dev/null
+++ b/include/svtools/toolpanel/tabalignment.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 SVT_TABALIGNMENT_HXX
+#define SVT_TABALIGNMENT_HXX
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ enum TabAlignment
+ {
+ TABS_LEFT,
+ TABS_RIGHT,
+ TABS_TOP,
+ TABS_BOTTOM
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_TABALIGNMENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/tabitemcontent.hxx b/include/svtools/toolpanel/tabitemcontent.hxx
new file mode 100644
index 000000000000..07c7eeedc9fd
--- /dev/null
+++ b/include/svtools/toolpanel/tabitemcontent.hxx
@@ -0,0 +1,43 @@
+/* -*- 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 SVT_TABITEMCONTENT_HXX
+#define SVT_TABITEMCONTENT_HXX
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ enum TabItemContent
+ {
+ TABITEM_IMAGE_AND_TEXT,
+ TABITEM_IMAGE_ONLY,
+ TABITEM_TEXT_ONLY,
+
+ TABITEM_AUTO
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_TABITEMCONTENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/tablayouter.hxx b/include/svtools/toolpanel/tablayouter.hxx
new file mode 100644
index 000000000000..cf76879a4566
--- /dev/null
+++ b/include/svtools/toolpanel/tablayouter.hxx
@@ -0,0 +1,99 @@
+/* -*- 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 SVT_TABLAYOUTER_HXX
+#define SVT_TABLAYOUTER_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/toolpanel/decklayouter.hxx"
+#include "svtools/toolpanel/tabalignment.hxx"
+#include "svtools/toolpanel/tabitemcontent.hxx"
+#include "svtools/toolpanel/refbase.hxx"
+
+#include <memory>
+
+#include <boost/noncopyable.hpp>
+
+class Window;
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ class IToolPanelDeck;
+
+ struct TabDeckLayouter_Data;
+
+ //====================================================================
+ //= TabDeckLayouter
+ //====================================================================
+ class SVT_DLLPUBLIC TabDeckLayouter :public RefBase
+ ,public IDeckLayouter
+ ,public ::boost::noncopyable
+ {
+ public:
+ /** creates a new layouter
+ @param i_rParent
+ is the parent window for any VCL windows the layouter needs to create.
+ @param i_rPanels
+ is the panel deck which the layouter is responsible for.
+ @param i_eAlignment
+ specifies the alignment of the panel selector
+ @param TabItemContent
+ specifies the content to show on the tab items
+ */
+ TabDeckLayouter(
+ Window& i_rParent,
+ IToolPanelDeck& i_rPanels,
+ const TabAlignment i_eAlignment,
+ const TabItemContent i_eItemContent
+ );
+ ~TabDeckLayouter();
+
+ // attribute access
+ TabItemContent GetTabItemContent() const;
+ void SetTabItemContent( const TabItemContent& i_eItemContent );
+ TabAlignment GetTabAlignment() const;
+
+ // IDeckLayouter
+ virtual Rectangle Layout( const Rectangle& i_rDeckPlayground );
+ virtual void Destroy();
+ virtual void SetFocusToPanelSelector();
+ virtual size_t GetAccessibleChildCount() const;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ GetAccessibleChild(
+ const size_t i_nChildIndex,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ );
+
+ // IReference
+ DECLARE_IREFERENCE()
+
+ private:
+ ::std::auto_ptr< TabDeckLayouter_Data > m_pData;
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_TABLAYOUTER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/toolpanel.hxx b/include/svtools/toolpanel/toolpanel.hxx
new file mode 100644
index 000000000000..4c2d0f736ba0
--- /dev/null
+++ b/include/svtools/toolpanel/toolpanel.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 SVT_TOOLPANEL_HXX
+#define SVT_TOOLPANEL_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/toolpanel/refbase.hxx"
+
+#include <rtl/ustring.hxx>
+#include <vcl/image.hxx>
+
+#include <boost/noncopyable.hpp>
+
+class Rectangle;
+class Window;
+namespace com { namespace sun { namespace star { namespace accessibility {
+ class XAccessible;
+} } } }
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ //====================================================================
+ //= IToolPanel
+ //====================================================================
+ /** abstract interface for a single tool panel
+ */
+ class SVT_DLLPUBLIC IToolPanel : public ::rtl::IReference
+ {
+ public:
+ /// retrieves the display name of the panel
+ virtual OUString GetDisplayName() const = 0;
+
+ /// retrieves the image associated with the panel, if any
+ virtual Image GetImage() const = 0;
+
+ /// retrieves the help ID associated with the panel, if any.
+ virtual OString GetHelpID() const = 0;
+
+ /** activates the panel
+
+ Usually, this means the panel's Window is created (if not previosly done so) and shown.
+
+ @param i_rParentWindow
+ the parent window to anchor the panel window at. Subsequent calls to the Activate
+ method will always get the same parent window. The complete area of this window is
+ available, and should be used, for the panel window.
+ */
+ virtual void Activate( Window& i_rParentWindow ) = 0;
+
+ /** deactivates the panel
+
+ There are different ways how an implementation could deactivate a panel. The easiest way
+ would be to simply hide the associated Window. Alternatively, you could completely destroy it,
+ or decide to cache it by re-parenting it to another (temporary, invisible) window.
+ */
+ virtual void Deactivate() = 0;
+
+ /** sets a new size for the panel's Window
+
+ The panel window is always expected to be positioned at (0,0), relative to the parent window
+ which was passed to the Activate member. Resizing the panel window is necessary when the size of
+ this parent window changes. Effectively, this method is a means of convenience, to relief panel
+ implementations from reacting on size changes of their parent window themselves.
+ */
+ virtual void SetSizePixel( const Size& i_rPanelWindowSize ) = 0;
+
+ /// sets the focus to the panel window
+ virtual void GrabFocus() = 0;
+
+ /** release any resources associated with the panel.
+
+ In particular, implementations should ultimately destroy the VCL window which implements the panel
+ window. No subsequent calls to any other method will happen after Destroy has been called.
+ */
+ virtual void Dispose() = 0;
+
+ /** creates an XAccessible for the tool panel
+
+ Implementations are allowed to create a new instance each time this method is called, the caller
+ is responsible for caching the XAccessible implementation, if this is desired.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ CreatePanelAccessible(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ ) = 0;
+
+ virtual ~IToolPanel()
+ {
+ }
+ };
+
+ typedef ::rtl::Reference< IToolPanel > PToolPanel;
+
+ //====================================================================
+ //= ToolPanelBase
+ //====================================================================
+ /** base class for tool panel implementations, adding ref count implementation to the IToolPanel interface,
+ but still being abstract
+ */
+ class SVT_DLLPUBLIC ToolPanelBase :public IToolPanel
+ ,public RefBase
+ ,public ::boost::noncopyable
+ {
+ protected:
+ ToolPanelBase();
+ ~ToolPanelBase();
+
+ public:
+ DECLARE_IREFERENCE()
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_TOOLPANEL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/toolpaneldeck.hxx b/include/svtools/toolpanel/toolpaneldeck.hxx
new file mode 100644
index 000000000000..d293aca8d017
--- /dev/null
+++ b/include/svtools/toolpanel/toolpaneldeck.hxx
@@ -0,0 +1,194 @@
+/* -*- 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 SVT_TOOLPANELDECK_HXX
+#define SVT_TOOLPANELDECK_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/toolpanel/toolpanel.hxx"
+#include "svtools/toolpanel/decklayouter.hxx"
+
+#include <vcl/ctrl.hxx>
+
+#include <boost/optional.hpp>
+#include <memory>
+
+//........................................................................
+namespace svt
+{
+//........................................................................
+
+ class ToolPanelCollection;
+ class ToolPanelDeck_Impl;
+
+ //====================================================================
+ //= IToolPanelDeckListener
+ //====================================================================
+ class SAL_NO_VTABLE IToolPanelDeckListener
+ {
+ public:
+ /** called when a panel has been inserted into the deck
+ */
+ virtual void PanelInserted( const PToolPanel& i_pPanel, const size_t i_nPosition ) = 0;
+
+ /** called when a panel has been removed from the deck
+ */
+ virtual void PanelRemoved( const size_t i_nPosition ) = 0;
+
+ /** called when the active panel of the deck changed
+ */
+ virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ) = 0;
+
+ /** called when a new layouter has been set at a tool panel deck.
+
+ The method is called after the old layouter has been disposed (i.e. its Destroy method has been
+ invoked), and after the complete deck has been re-layouter.
+ */
+ virtual void LayouterChanged( const PDeckLayouter& i_rNewLayouter ) = 0;
+
+ /** called when the tool panel deck which the listener registered at is dying. The listener is required to
+ release all references to the deck then.
+ */
+ virtual void Dying() = 0;
+
+ protected:
+ ~IToolPanelDeckListener() {}
+ };
+
+ //====================================================================
+ //= IToolPanelDeck
+ //====================================================================
+ class SVT_DLLPUBLIC IToolPanelDeck
+ {
+ public:
+ /** returns the number of panels in the container
+ */
+ virtual size_t GetPanelCount() const = 0;
+
+ /** retrieves the panel with the given index. Invalid indexes will be reported via an assertion in the
+ non-product version, and silently ignored in the product version, with a NULL panel being returned.
+ */
+ virtual PToolPanel GetPanel( const size_t i_nPos ) const = 0;
+
+ /** returns the number of the currently active panel.
+ */
+ virtual ::boost::optional< size_t >
+ GetActivePanel() const = 0;
+
+ /** activates the panel with the given number. If the given number is larger or equal to the number of panels
+ in the deck, this will be reported via an assertion in non-product builds, and otherwise ignored.
+ @param i_rPanel
+ the number of the panel to activate. If this is not set, the currently active panel is de-activated,
+ and no new panel is activated at all. Whether or not this makes sense for your application is at
+ your own discretion.
+ */
+ virtual void ActivatePanel( const ::boost::optional< size_t >& i_rPanel ) = 0;
+
+ /** inserts a new panel into the container. NULL panels are not allowed, as are positions greater than the
+ current panel count. Violations of this will be reported via an assertion in the non-product version, and
+ silently ignored in the product version.
+ */
+ virtual size_t InsertPanel( const PToolPanel& i_pPanel, const size_t i_nPosition ) = 0;
+
+ /** removes a panel specified by its position.
+
+ Note: It is the responsibility of the caller to ensure that the panel is destroyed appropriately. That is,
+ the tool panel deck will <em>not</em> invoke <member>IToolPanel::Dispose</member> on the removed panel.
+ The advantage is that the panel might be re-used later, with the disadvantage that the owner of the panel
+ deck must know whether Dispose must be invoked after removal, or whether the panel will properly
+ dispose itself when its ref count drops to 0.
+ */
+ virtual PToolPanel RemovePanel( const size_t i_nPosition ) = 0;
+
+ /** adds a new listener to be notified when the container content changes. The caller is responsible
+ for life time control, i.e. removing the listener before it actually dies.
+ */
+ virtual void AddListener( IToolPanelDeckListener& i_rListener ) = 0;
+
+ /** removes a container listener previously added via addListener.
+ */
+ virtual void RemoveListener( IToolPanelDeckListener& i_rListener ) = 0;
+
+ protected:
+ ~IToolPanelDeck() {}
+ };
+
+ //====================================================================
+ //= ToolPanelDeck
+ //====================================================================
+ class SVT_DLLPUBLIC ToolPanelDeck :public Control
+ ,public IToolPanelDeck
+ {
+ public:
+ ToolPanelDeck( Window& i_rParent, const WinBits i_nStyle = WB_DIALOGCONTROL );
+ ~ToolPanelDeck();
+
+ // attributes
+ PDeckLayouter GetLayouter() const;
+ void SetLayouter( const PDeckLayouter& i_pNewLayouter );
+
+ /** returns the window which acts as anchor for the panel windows.
+
+ This is a single dedicated window, which is passed to the IToolPanel::ActivatePanel method
+ whenever a panel is activated, to act as parent window for the panel's VCL-Window.
+ */
+ ::Window& GetPanelWindowAnchor();
+ const ::Window& GetPanelWindowAnchor() const;
+
+ /** sets the window which should act as parent in the A11Y object hierarchy.
+
+ Calling this method has no effect if CreateAccessible had always been called.
+ */
+ void SetAccessibleParentWindow( ::Window* i_pAccessibleParent );
+ ::Window* GetAccessibleParentWindow() const;
+
+ // IToolPanelDeck
+ virtual size_t GetPanelCount() const;
+ virtual PToolPanel GetPanel( const size_t i_nPos ) const;
+ virtual ::boost::optional< size_t >
+ GetActivePanel() const;
+ virtual void ActivatePanel( const ::boost::optional< size_t >& i_rPanel );
+ virtual size_t InsertPanel( const PToolPanel& i_pPanel, const size_t i_nPosition );
+ virtual PToolPanel RemovePanel( const size_t i_nPosition );
+ virtual void AddListener( IToolPanelDeckListener& i_rListener );
+ virtual void RemoveListener( IToolPanelDeckListener& i_rListener );
+
+ protected:
+ // Window overridables
+ virtual void Resize();
+ virtual long Notify( NotifyEvent& i_rNotifyEvent );
+ virtual void GetFocus();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
+ GetComponentInterface( sal_Bool i_bCreate );
+
+ private:
+ ::std::auto_ptr< ToolPanelDeck_Impl > m_pImpl;
+
+ private:
+ using Window::GetAccessibleParentWindow;
+ };
+
+//........................................................................
+} // namespace svt
+//........................................................................
+
+#endif // SVT_TOOLPANELDECK_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanelopt.hxx b/include/svtools/toolpanelopt.hxx
new file mode 100644
index 000000000000..9ca4f6fe239a
--- /dev/null
+++ b/include/svtools/toolpanelopt.hxx
@@ -0,0 +1,99 @@
+/* -*- 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_TOOLPANELOPT_HXX
+#define INCLUDED_SVTOOLS_TOOLPANELOPT_HXX
+
+#include "svtools/svtdllapi.h"
+#include <sal/types.h>
+#include <osl/mutex.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <rtl/ustring.hxx>
+#include <unotools/options.hxx>
+
+/** 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 neccessary. The class which use these mechanism
+ is faster and smaller then a complete implementation!
+*/
+class SvtToolPanelOptions_Impl;
+class Link;
+
+/** collect information about sidebar group
+
+ \attention This class is partially threadsafe.
+*/
+class SVT_DLLPUBLIC SvtToolPanelOptions: public utl::detail::Options
+{
+ public:
+ /** standard constructor and destructor
+
+ This will initialize an instance with default values.
+ We implement these class with a refcount mechanism! Every instance of this class increase it
+ at create and decrease it at delete time - but all instances use the same data container!
+ He is implemented as a static member ...
+
+ \sa member m_nRefCount
+ \sa member m_pDataContainer
+ */
+ SvtToolPanelOptions();
+ virtual ~SvtToolPanelOptions();
+
+ 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 are'nt 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:
+
+ /**
+ \attention
+ Don't initialize these static member in these header!
+ \li Double defined symbols will be detected ...
+ \li and unresolved externals exist at linking time.
+ Do it in your source only.
+ */
+ static SvtToolPanelOptions_Impl* m_pDataContainer; ///< impl. data container as dynamic pointer for smaller memory requirements!
+ static sal_Int32 m_nRefCount; ///< internal ref count mechanism
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/transfer.hxx b/include/svtools/transfer.hxx
new file mode 100644
index 000000000000..5d63d166bfa5
--- /dev/null
+++ b/include/svtools/transfer.hxx
@@ -0,0 +1,521 @@
+/* -*- 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 _TRANSFER_HXX
+#define _TRANSFER_HXX
+
+#include "svtools/svtdllapi.h"
+#include <tools/globname.hxx>
+#include <tools/gen.hxx>
+#include <sot/formats.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase4.hxx>
+#include <com/sun/star/frame/XTerminateListener.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/datatransfer/XTransferable.hpp>
+#include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
+#include <com/sun/star/datatransfer/dnd/DNDConstants.hpp>
+#include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
+#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
+#include <com/sun/star/datatransfer/dnd/DropTargetDragEvent.hpp>
+#include <com/sun/star/datatransfer/dnd/DropTargetDropEvent.hpp>
+#include <com/sun/star/datatransfer/dnd/XDragSourceListener.hpp>
+#include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
+#include <com/sun/star/embed/Aspects.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+
+class Bitmap;
+class GDIMetaFile;
+class Graphic;
+class ImageMap;
+class SotStorageStreamRef;
+class INetBookmark;
+class INetImage;
+class FileList;
+class Window;
+class Link;
+
+// Drag&Drop defines
+
+#define DND_ACTION_NONE ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_NONE
+#define DND_ACTION_COPY ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_COPY
+#define DND_ACTION_MOVE ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_MOVE
+#define DND_ACTION_COPYMOVE ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE
+#define DND_ACTION_LINK ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_LINK
+
+#define DND_POINTER_NONE 0
+#define DND_IMAGE_NONE 0
+
+struct TransferableObjectDescriptor
+{
+ SvGlobalName maClassName;
+ sal_uInt16 mnViewAspect;
+ Point maDragStartPos;
+ Size maSize;
+ sal_uInt32 mnOle2Misc;
+ OUString maTypeName;
+ OUString maDisplayName;
+ sal_Bool mbCanLink;
+
+ TransferableObjectDescriptor()
+ : mnViewAspect(::com::sun::star::embed::Aspects::MSOLE_CONTENT)
+ , mnOle2Misc(0)
+ , mbCanLink(false)
+ {}
+
+ SVT_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, TransferableObjectDescriptor& rObjDesc );
+ SVT_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStm, const TransferableObjectDescriptor& rObjDesc );
+};
+
+struct AcceptDropEvent
+{
+ sal_Int8 mnAction;
+ Point maPosPixel;
+ const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent maDragEvent;
+ sal_Bool mbLeaving;
+ sal_Bool mbDefault;
+
+ AcceptDropEvent() :
+ mnAction( DND_ACTION_NONE ),
+ mbLeaving( sal_False ),
+ mbDefault( sal_False ) {}
+
+ AcceptDropEvent( sal_Int8 nAction,
+ const Point& rPosPixel,
+ const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& rDragEvent,
+ sal_Bool bLeaving = sal_False ) :
+ mnAction( nAction ),
+ maPosPixel( rPosPixel ),
+ maDragEvent( rDragEvent ),
+ mbLeaving( bLeaving ),
+ mbDefault( sal_False ) {}
+};
+
+struct ExecuteDropEvent
+{
+ sal_Int8 mnAction;
+ Point maPosPixel;
+ const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent maDropEvent;
+ sal_Bool mbDefault;
+
+ ExecuteDropEvent() :
+ mnAction( DND_ACTION_NONE ),
+ mbDefault( sal_False ) {}
+
+ ExecuteDropEvent( sal_Int8 nAction,
+ const Point& rPosPixel,
+ const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& rDropEvent ) :
+ mnAction( nAction ),
+ maPosPixel( rPosPixel ),
+ maDropEvent( rDropEvent ),
+ mbDefault( sal_False ) {}
+};
+
+class SVT_DLLPUBLIC TransferableHelper : public ::cppu::WeakImplHelper4< ::com::sun::star::datatransfer::XTransferable,
+ ::com::sun::star::datatransfer::clipboard::XClipboardOwner,
+ ::com::sun::star::datatransfer::dnd::XDragSourceListener,
+ ::com::sun::star::lang::XUnoTunnel >
+{
+private:
+
+ // nested class to implement the XTerminateListener interface
+ class TerminateListener : public ::cppu::WeakImplHelper1< ::com::sun::star::frame::XTerminateListener >
+ {
+ private:
+
+ TransferableHelper& mrParent;
+
+ private:
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XTerminateListener
+ virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw( ::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw( ::com::sun::star::uno::RuntimeException );
+
+ public:
+
+ TerminateListener( TransferableHelper& rDropTargetHelper );
+ virtual ~TerminateListener();
+ };
+
+ friend class TransferableHelper::TerminateListener;
+
+private:
+
+ ::com::sun::star::uno::Any maAny;
+ OUString maLastFormat;
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxClipboard;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTerminateListener > mxTerminateListener;
+ DataFlavorExVector* mpFormats;
+ TransferableObjectDescriptor* mpObjDesc;
+
+protected:
+ inline const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >&
+ getOwnClipboard() const { return mxClipboard; }
+
+private:
+
+ // XTransferable
+ virtual ::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) throw(::com::sun::star::datatransfer::UnsupportedFlavorException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XDragSourceListener
+ virtual void SAL_CALL dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& dsde ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent& dse ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw(::com::sun::star::uno::RuntimeException);
+
+private:
+
+ // XClipboardOwner
+ virtual void SAL_CALL lostOwnership( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& xClipboard, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans ) throw(::com::sun::star::uno::RuntimeException);
+
+protected:
+ // derivees need to access lostOwnership in case hey override it
+ // on windows, changing the access rights to a method gives unresolved externals, so we introduce
+ // this impl-method here 'til the next incompatible update
+ inline void implCallOwnLostOwnership(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& _rxClipboard,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& _rxTrans
+ )
+ {
+ TransferableHelper::lostOwnership( _rxClipboard, _rxTrans );
+ }
+
+
+private:
+
+ SVT_DLLPRIVATE void ImplFlush();
+
+protected:
+
+ virtual ~TransferableHelper();
+
+ void AddFormat( SotFormatStringId nFormat );
+ void AddFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ void RemoveFormat( SotFormatStringId nFormat );
+ void RemoveFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool HasFormat( SotFormatStringId nFormat );
+ inline sal_Bool HasFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) { return isDataFlavorSupported( rFlavor ); }
+ void ClearFormats();
+
+ sal_Bool SetAny( const ::com::sun::star::uno::Any& rAny, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetString( const OUString& rString, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetBitmap( const Bitmap& rBitmap, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetGDIMetaFile( const GDIMetaFile& rMtf, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetGraphic( const Graphic& rGraphic, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetImageMap( const ImageMap& rIMap, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetTransferableObjectDescriptor( const TransferableObjectDescriptor& rDesc, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetINetBookmark( const INetBookmark& rBmk, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetINetImage( const INetImage& rINtImg, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ sal_Bool SetObject( void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+
+protected:
+
+ virtual void AddSupportedFormats() = 0;
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) = 0;
+ virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual void DragFinished( sal_Int8 nDropAction );
+ virtual void ObjectReleased();
+
+public:
+
+ TransferableHelper();
+
+ void PrepareOLE( const TransferableObjectDescriptor& rObjDesc );
+
+ void CopyToClipboard( Window *pWindow ) const;
+ void CopyToSelection( Window *pWindow ) const;
+ void StartDrag( Window* pWindow, sal_Int8 nDragSourceActions,
+ sal_Int32 nDragPointer = DND_POINTER_NONE,
+ sal_Int32 nDragImage = DND_IMAGE_NONE );
+
+ static void ClearSelection( Window *pWindow );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > GetSystemClipboard();
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
+
+public:
+
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( ::com::sun::star::uno::RuntimeException );
+};
+
+struct TransferableDataHelper_Impl;
+
+class SVT_DLLPUBLIC TransferableDataHelper
+{
+ friend class DropTargetHelper;
+
+private:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > mxTransfer;
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxClipboard;
+ DataFlavorExVector* mpFormats;
+ TransferableObjectDescriptor* mpObjDesc;
+ TransferableDataHelper_Impl* mpImpl;
+
+protected:
+ void InitFormats();
+
+public:
+
+ static void FillDataFlavorExVector( const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& rDataFlavorSeq,
+ DataFlavorExVector& rDataFlavorExVector );
+
+ TransferableDataHelper();
+ TransferableDataHelper( const TransferableDataHelper& rDataHelper );
+ TransferableDataHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable );
+ ~TransferableDataHelper();
+
+ TransferableDataHelper& operator=( const TransferableDataHelper& rDataHelper );
+
+ const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& GetTransferable() const { return mxTransfer; }
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > GetXTransferable() const;
+
+ sal_Bool HasFormat( SotFormatStringId nFormat ) const;
+ sal_Bool HasFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) const;
+
+ sal_uInt32 GetFormatCount() const;
+
+ SotFormatStringId GetFormat( sal_uInt32 nFormat ) const;
+ ::com::sun::star::datatransfer::DataFlavor GetFormatDataFlavor( sal_uInt32 nFormat ) const;
+
+ DataFlavorExVector& GetDataFlavorExVector() const {return *mpFormats; }
+
+ sal_Bool StartClipboardListening( );
+ void StopClipboardListening( );
+
+ void Rebind( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& _rxNewData );
+
+public:
+
+ ::com::sun::star::uno::Any GetAny( SotFormatStringId nFormat ) const;
+ ::com::sun::star::uno::Any GetAny( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) const;
+
+ sal_Bool GetString( SotFormatStringId nFormat, String& rStr );
+ sal_Bool GetString( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, String& rStr );
+
+ sal_Bool GetString( SotFormatStringId nFormat, OUString& rStr );
+ sal_Bool GetString( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, OUString& rStr );
+
+ sal_Bool GetBitmap( SotFormatStringId nFormat, Bitmap& rBmp );
+ sal_Bool GetBitmap( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, Bitmap& rBmp );
+
+ sal_Bool GetGDIMetaFile( SotFormatStringId nFormat, GDIMetaFile& rMtf );
+ sal_Bool GetGDIMetaFile( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, GDIMetaFile& rMtf );
+
+ sal_Bool GetGraphic( SotFormatStringId nFormat, Graphic& rGraphic );
+ sal_Bool GetGraphic( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, Graphic& rGraphic );
+
+ sal_Bool GetImageMap( SotFormatStringId nFormat, ImageMap& rIMap );
+ sal_Bool GetImageMap( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ImageMap& rImap );
+
+ sal_Bool GetTransferableObjectDescriptor( SotFormatStringId nFormat, TransferableObjectDescriptor& rDesc );
+ sal_Bool GetTransferableObjectDescriptor( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, TransferableObjectDescriptor& rDesc );
+
+ sal_Bool GetINetBookmark( SotFormatStringId nFormat, INetBookmark& rBmk );
+ sal_Bool GetINetBookmark( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, INetBookmark& rBmk );
+
+ sal_Bool GetINetImage( SotFormatStringId nFormat, INetImage& rINtImg );
+ sal_Bool GetINetImage( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, INetImage& rINtImg );
+
+ sal_Bool GetFileList( SotFormatStringId nFormat, FileList& rFileList );
+ sal_Bool GetFileList( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, FileList& rFileList );
+
+ sal_Bool GetSequence( SotFormatStringId nFormat, ::com::sun::star::uno::Sequence< sal_Int8 >& rSeq );
+ sal_Bool GetSequence( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Sequence< sal_Int8 >& rSeq );
+
+ sal_Bool GetSotStorageStream( SotFormatStringId nFormat, SotStorageStreamRef& rStreamRef );
+ sal_Bool GetSotStorageStream( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, SotStorageStreamRef& rStreamRef );
+
+ sal_Bool GetInputStream( SotFormatStringId nFormat, ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& xStream );
+ sal_Bool GetInputStream( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& xStream );
+
+ sal_Bool GetInterface( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rIf );
+
+public:
+
+ static TransferableDataHelper CreateFromSystemClipboard( Window * pWindow );
+ static TransferableDataHelper CreateFromSelection( Window * pWindow );
+ static sal_Bool IsEqual( const ::com::sun::star::datatransfer::DataFlavor& rInternalFlavor,
+ const ::com::sun::star::datatransfer::DataFlavor& rRequestFlavor,
+ sal_Bool bCompareParameters = sal_False );
+};
+
+class SVT_DLLPUBLIC DragSourceHelper
+{
+private:
+
+ // nested class to implement the XDragGestureListener interface
+ class DragGestureListener : public ::cppu::WeakImplHelper1< ::com::sun::star::datatransfer::dnd::XDragGestureListener >
+ {
+ private:
+
+ DragSourceHelper& mrParent;
+
+ private:
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XDragGestureListener
+ virtual void SAL_CALL dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& rDGE ) throw( ::com::sun::star::uno::RuntimeException );
+
+ public:
+
+ DragGestureListener( DragSourceHelper& rDragSourceHelper );
+ ~DragGestureListener();
+ };
+
+ friend class DragSourceHelper::DragGestureListener;
+
+private:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer > mxDragGestureRecognizer;
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureListener > mxDragGestureListener;
+
+ // not available
+ DragSourceHelper();
+ DragSourceHelper& operator=( const DragSourceHelper& rDragSourceHelper );
+ sal_Bool operator==( const DragSourceHelper& rDragSourceHelper ) const;
+
+public:
+
+ // to be overridden by the application
+ virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
+
+ DragSourceHelper( Window* pWindow );
+ virtual ~DragSourceHelper();
+};
+
+class SVT_DLLPUBLIC DropTargetHelper
+{
+private:
+
+ // nested class to implement the XDropTargetListener interface
+ class DropTargetListener : public ::cppu::WeakImplHelper1< ::com::sun::star::datatransfer::dnd::XDropTargetListener >
+ {
+ private:
+
+ DropTargetHelper& mrParent;
+ AcceptDropEvent* mpLastDragOverEvent;
+
+ private:
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XDropTargetListener
+ virtual void SAL_CALL drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
+
+ public:
+
+ DropTargetListener( DropTargetHelper& rDropTargetHelper );
+ ~DropTargetListener();
+ };
+
+ friend class DropTargetHelper::DropTargetListener;
+
+private:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget > mxDropTarget;
+ ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener > mxDropTargetListener;
+ DataFlavorExVector* mpFormats;
+
+ // not available
+ DropTargetHelper();
+ DropTargetHelper& operator=( const DropTargetHelper& rDropTargetHelper );
+ sal_Bool operator==( const DropTargetHelper& rDropTargetHelper ) const;
+
+ void ImplConstruct();
+
+ // called by our own implementation of XDropTargetListener (DropTargetListener instance)
+ void ImplBeginDrag( const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& rSupportedDataFlavors );
+ void ImplEndDrag();
+
+public:
+
+ // to be overridden by the application
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
+
+ DropTargetHelper( Window* pWindow );
+ DropTargetHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget >& rxDropTarget );
+
+ virtual ~DropTargetHelper();
+
+ // typically called by the application in ::AcceptDrop and ::ExecuteDrop and (see above)
+ sal_Bool IsDropFormatSupported( SotFormatStringId nFormat );
+ sal_Bool IsDropFormatSupported( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+
+ DataFlavorExVector& GetDataFlavorExVector() const {return *mpFormats; }
+
+};
+
+struct TransferDataContainer_Impl;
+
+class SVT_DLLPUBLIC TransferDataContainer : public TransferableHelper
+{
+ TransferDataContainer_Impl* pImpl;
+
+protected:
+
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual void DragFinished( sal_Int8 nDropAction );
+
+public:
+
+ TransferDataContainer();
+ ~TransferDataContainer();
+
+ void CopyINetBookmark( const INetBookmark& rBkmk );
+ void CopyINetImage( const INetImage& rINtImg );
+ void CopyImageMap( const ImageMap& rImgMap );
+ void CopyGraphic( const Graphic& rGrf );
+ void CopyString( const String& rStr );
+ void CopyString( sal_uInt16 nFmt, const String& rStr );
+ void CopyAny( sal_uInt16 nFmt, const ::com::sun::star::uno::Any& rAny );
+
+ void CopyByteString( sal_uLong nFormatId, const OString& rStr );
+ void CopyAnyData( sal_uLong nFormatId, const sal_Char* pData, sal_uLong nLen );
+
+ sal_Bool HasAnyData() const;
+
+ using TransferableHelper::StartDrag;
+ void StartDrag( Window* pWindow, sal_Int8 nDragSourceActions,
+ const Link& rCallbck,
+ sal_Int32 nDragPointer = DND_POINTER_NONE,
+ sal_Int32 nDragImage = DND_IMAGE_NONE );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/treelist.hxx b/include/svtools/treelist.hxx
new file mode 100644
index 000000000000..220b2f4c7f88
--- /dev/null
+++ b/include/svtools/treelist.hxx
@@ -0,0 +1,366 @@
+/* -*- 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 _SVTREELIST_HXX
+#define _SVTREELIST_HXX
+
+#include "svtools/svtdllapi.h"
+#include "svtools/treelistentries.hxx"
+#include "svtools/viewdataentry.hxx"
+
+#include <tools/solar.h>
+#include <tools/link.hxx>
+#include <tools/string.hxx>
+#include <tools/debug.hxx>
+
+#include <limits.h>
+#include <vector>
+#include <boost/ptr_container/ptr_map.hpp>
+
+#define LISTACTION_INSERTED 1
+#define LISTACTION_REMOVING 2
+#define LISTACTION_REMOVED 3
+#define LISTACTION_MOVING 4
+#define LISTACTION_MOVED 5
+#define LISTACTION_CLEARING 6
+#define LISTACTION_INSERTED_TREE 7
+#define LISTACTION_INVALIDATE_ENTRY 8
+#define LISTACTION_RESORTING 9
+#define LISTACTION_RESORTED 10
+#define LISTACTION_CLEARED 11
+
+class SvTreeListEntry;
+class SvListView;
+
+enum SvSortMode { SortAscending, SortDescending, SortNone };
+
+// For the return values of Sortlink:
+// See International::Compare( pLeft, pRight )
+// ( Compare(a,b) ==> b.Compare(a) ==> strcmp(a,b) )
+struct SvSortData
+{
+ const SvTreeListEntry* pLeft;
+ const SvTreeListEntry* pRight;
+};
+
+class SVT_DLLPUBLIC SvTreeList
+{
+ typedef std::vector<SvListView*> ListViewsType;
+
+ friend class SvListView;
+
+ ListViewsType aViewList;
+ sal_uLong nEntryCount;
+
+ Link aCloneLink;
+ Link aCompareLink;
+ SvSortMode eSortMode;
+
+ sal_uInt16 nRefCount;
+
+ sal_Bool bAbsPositionsValid;
+
+ SvTreeListEntry* FirstVisible() const { return First(); }
+ SvTreeListEntry* NextVisible( const SvListView*,SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) const;
+ SvTreeListEntry* PrevVisible( const SvListView*,SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) const;
+ SvTreeListEntry* LastVisible( const SvListView*,sal_uInt16* pDepth=0 ) const;
+ SvTreeListEntry* NextVisible( const SvListView*,SvTreeListEntry* pEntry, sal_uInt16& rDelta ) const;
+ SvTreeListEntry* PrevVisible( const SvListView*,SvTreeListEntry* pEntry, sal_uInt16& rDelta ) const;
+
+ sal_Bool IsEntryVisible( const SvListView*,SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* GetEntryAtVisPos( const SvListView*,sal_uLong nVisPos ) const;
+ sal_uLong GetVisiblePos( const SvListView*,SvTreeListEntry* pEntry ) const;
+ sal_uLong GetVisibleCount( SvListView* ) const;
+ sal_uLong GetVisibleChildCount( const SvListView*,SvTreeListEntry* pParent ) const;
+
+ SvTreeListEntry* FirstSelected( const SvListView*) const;
+ SvTreeListEntry* NextSelected( const SvListView*,SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* PrevSelected( const SvListView*,SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* LastSelected( const SvListView*) const;
+
+ sal_Bool Select( SvListView*,SvTreeListEntry* pEntry, sal_Bool bSelect=sal_True );
+ void SelectAll( SvListView*,sal_Bool bSelect ); // Does not call Select Handler
+ sal_uLong GetChildSelectionCount( const SvListView*,SvTreeListEntry* pParent ) const;
+
+ void Expand( SvListView*,SvTreeListEntry* pParent );
+ void Collapse( SvListView*,SvTreeListEntry* pParent );
+
+ SVT_DLLPRIVATE void SetAbsolutePositions();
+
+ SVT_DLLPRIVATE void CloneChildren(
+ SvTreeListEntries& rDst, sal_uLong& rCloneCount, SvTreeListEntries& rSrc, SvTreeListEntry* pNewParent) const;
+
+ /**
+ * Invalidate the cached position data to have them re-generated before
+ * the next access.
+ */
+ SVT_DLLPRIVATE void SetListPositions( SvTreeListEntries& rEntries );
+
+ // rPos is not changed for SortModeNone
+ SVT_DLLPRIVATE void GetInsertionPos(
+ SvTreeListEntry* pEntry,
+ SvTreeListEntry* pParent,
+ sal_uLong& rPos
+ );
+
+ SVT_DLLPRIVATE void ResortChildren( SvTreeListEntry* pParent );
+
+ SvTreeList(const SvTreeList&); // disabled
+ SvTreeList& operator= (const SvTreeList&); // disabled
+
+protected:
+ SvTreeListEntry* pRootItem;
+
+public:
+
+ SvTreeList();
+ virtual ~SvTreeList();
+
+ void InsertView( SvListView* );
+ void RemoveView( SvListView* );
+ sal_uLong GetViewCount() const
+ { return aViewList.size(); }
+
+ SvListView* GetView( sal_uLong nPos ) const
+ { return ( nPos < aViewList.size() ) ? aViewList[ nPos ] : NULL; }
+
+ void Broadcast(
+ sal_uInt16 nActionId,
+ SvTreeListEntry* pEntry1=0,
+ SvTreeListEntry* pEntry2=0,
+ sal_uLong nPos=0
+ );
+
+ // Notify all Listeners
+ void InvalidateEntry( SvTreeListEntry* );
+
+ sal_uLong GetEntryCount() const { return nEntryCount; }
+ SvTreeListEntry* First() const;
+ SvTreeListEntry* Next( SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) const;
+ SvTreeListEntry* Prev( SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) const;
+ SvTreeListEntry* Last() const;
+
+ SvTreeListEntry* FirstChild( SvTreeListEntry* pParent ) const;
+ SvTreeListEntry* NextSibling( SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* PrevSibling( SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* LastSibling( SvTreeListEntry* pEntry ) const;
+
+ sal_uLong Insert( SvTreeListEntry* pEntry,SvTreeListEntry* pPar,sal_uLong nPos=ULONG_MAX);
+ sal_uLong Insert( SvTreeListEntry* pEntry,sal_uLong nRootPos = ULONG_MAX )
+ { return Insert(pEntry, pRootItem, nRootPos ); }
+
+ void InsertTree( SvTreeListEntry* pTree, SvTreeListEntry* pTargetParent, sal_uLong nListPos );
+
+ // Entries need to be in the same Model!
+ void Move( SvTreeListEntry* pSource, SvTreeListEntry* pTarget );
+
+ // Creates ChildList if needed
+ sal_uLong Move( SvTreeListEntry* pSource, SvTreeListEntry* pTargetParent, sal_uLong nListPos);
+ void Copy( SvTreeListEntry* pSource, SvTreeListEntry* pTarget );
+ sal_uLong Copy( SvTreeListEntry* pSource, SvTreeListEntry* pTargetParent, sal_uLong nListPos);
+
+ bool Remove( const SvTreeListEntry* pEntry );
+ void Clear();
+
+ bool HasChildren( const SvTreeListEntry* pEntry ) const;
+ bool HasParent( const SvTreeListEntry* pEntry ) const;
+
+ bool IsChild(const SvTreeListEntry* pParent, const SvTreeListEntry* pChild) const;
+ SvTreeListEntry* GetEntry( SvTreeListEntry* pParent, sal_uLong nPos ) const;
+ SvTreeListEntry* GetEntry( sal_uLong nRootPos ) const;
+ SvTreeListEntry* GetEntryAtAbsPos( sal_uLong nAbsPos ) const;
+
+ const SvTreeListEntry* GetParent( const SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* GetParent( SvTreeListEntry* pEntry );
+
+ SvTreeListEntry* GetRootLevelParent( SvTreeListEntry* pEntry ) const;
+ const SvTreeListEntries& GetChildList( SvTreeListEntry* pParent ) const;
+ SvTreeListEntries& GetChildList( SvTreeListEntry* pParent );
+
+ std::pair<SvTreeListEntries::iterator, SvTreeListEntries::iterator>
+ GetChildIterators(SvTreeListEntry* pParent);
+
+ sal_uLong GetAbsPos( const SvTreeListEntry* pEntry ) const;
+ sal_uLong GetRelPos( const SvTreeListEntry* pChild ) const;
+
+ sal_uLong GetChildCount( const SvTreeListEntry* pParent ) const;
+ sal_uInt16 GetDepth( const SvTreeListEntry* pEntry ) const;
+ bool IsAtRootDepth( const SvTreeListEntry* pEntry ) const;
+
+ // The Model calls the Clone Link to clone Entries.
+ // Thus we do not need to derive from the Model if we derive from SvTreeListEntry.
+ // Declaration of the Clone Handler:
+ // DECL_LINK(CloneHdl,SvTreeListEntry*);
+ // The Handler needs to return a SvTreeListEntry*
+ SvTreeListEntry* Clone( SvTreeListEntry* pEntry, sal_uLong& nCloneCount ) const;
+ void SetCloneLink( const Link& rLink )
+ { aCloneLink=rLink; }
+
+ const Link& GetCloneLink() const
+ { return aCloneLink; }
+
+ virtual SvTreeListEntry* CloneEntry( SvTreeListEntry* pSource ) const; // Calls the Clone Link
+ virtual SvTreeListEntry* CreateEntry() const; // To create Entries
+
+ sal_uInt16 GetRefCount() const { return nRefCount; }
+ void SetRefCount( sal_uInt16 nRef ) { nRefCount = nRef; }
+
+ void SetSortMode( SvSortMode eMode ) { eSortMode = eMode; }
+ SvSortMode GetSortMode() const { return eSortMode; }
+ StringCompare Compare(const SvTreeListEntry* pLeft, const SvTreeListEntry* pRight) const;
+ void SetCompareHdl( const Link& rLink ) { aCompareLink = rLink; }
+ const Link& GetCompareHdl() const { return aCompareLink; }
+ void Resort();
+};
+
+class SVT_DLLPUBLIC SvListView
+{
+ friend class SvTreeList;
+
+ typedef boost::ptr_map<SvTreeListEntry*, SvViewDataEntry> SvDataTable;
+
+ sal_uLong nVisibleCount;
+ sal_uLong nSelectionCount;
+ sal_Bool bVisPositionsValid;
+
+ SVT_DLLPRIVATE void InitTable();
+ SVT_DLLPRIVATE void RemoveViewData( SvTreeListEntry* pParent );
+
+ SvDataTable maDataTable; // Mapping SvTreeListEntry -> ViewData
+
+ void ActionMoving( SvTreeListEntry* pEntry,SvTreeListEntry* pTargetPrnt,sal_uLong nChildPos);
+ void ActionMoved( SvTreeListEntry* pEntry,SvTreeListEntry* pTargetPrnt,sal_uLong nChildPos);
+ void ActionInserted( SvTreeListEntry* pEntry );
+ void ActionInsertedTree( SvTreeListEntry* pEntry );
+ void ActionRemoving( SvTreeListEntry* pEntry );
+ void ActionRemoved( SvTreeListEntry* pEntry );
+ void ActionClear();
+
+protected:
+ SvTreeList* pModel;
+
+public:
+ SvListView(); // Sets the Model to 0
+ virtual ~SvListView();
+ void Clear();
+ virtual void SetModel( SvTreeList* );
+ virtual void ModelNotification(
+ sal_uInt16 nActionId,
+ SvTreeListEntry* pEntry1,
+ SvTreeListEntry* pEntry2,
+ sal_uLong nPos
+ );
+
+ sal_uLong GetVisibleCount() const
+ { return pModel->GetVisibleCount( (SvListView*)this ); }
+
+ SvTreeListEntry* FirstVisible() const
+ { return pModel->FirstVisible(); }
+
+ SvTreeListEntry* NextVisible( SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) const
+ { return pModel->NextVisible(this,pEntry,pDepth); }
+
+ SvTreeListEntry* PrevVisible( SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) const
+ { return pModel->PrevVisible(this,pEntry,pDepth); }
+
+ SvTreeListEntry* LastVisible( sal_uInt16* pDepth=0 ) const
+ { return pModel->LastVisible(this,pDepth); }
+
+ SvTreeListEntry* NextVisible( SvTreeListEntry* pEntry, sal_uInt16& rDelta ) const
+ { return pModel->NextVisible(this,pEntry,rDelta); }
+
+ SvTreeListEntry* PrevVisible( SvTreeListEntry* pEntry, sal_uInt16& rDelta ) const
+ { return pModel->PrevVisible(this,pEntry,rDelta); }
+
+ sal_uLong GetSelectionCount() const
+ { return nSelectionCount; }
+
+ SvTreeListEntry* FirstSelected() const
+ { return pModel->FirstSelected(this); }
+
+ SvTreeListEntry* NextSelected( SvTreeListEntry* pEntry ) const
+ { return pModel->NextSelected(this,pEntry); }
+
+ SvTreeListEntry* PrevSelected( SvTreeListEntry* pEntry ) const
+ { return pModel->PrevSelected(this,pEntry); }
+
+ SvTreeListEntry* LastSelected() const
+ { return pModel->LastSelected(this); }
+ SvTreeListEntry* GetEntryAtAbsPos( sal_uLong nAbsPos ) const
+ { return pModel->GetEntryAtAbsPos(nAbsPos); }
+
+ SvTreeListEntry* GetEntryAtVisPos( sal_uLong nVisPos ) const
+ { return pModel->GetEntryAtVisPos((SvListView*)this,nVisPos); }
+
+ sal_uLong GetAbsPos( SvTreeListEntry* pEntry ) const
+ { return pModel->GetAbsPos(pEntry); }
+
+ sal_uLong GetVisiblePos( SvTreeListEntry* pEntry ) const
+ { return pModel->GetVisiblePos((SvListView*)this,pEntry); }
+
+ sal_uLong GetVisibleChildCount(SvTreeListEntry* pParent ) const
+ { return pModel->GetVisibleChildCount((SvListView*)this,pParent); }
+
+ sal_uLong GetChildSelectionCount( SvTreeListEntry* pParent ) const
+ { return pModel->GetChildSelectionCount((SvListView*)this,pParent); }
+
+ void Expand( SvTreeListEntry* pParent )
+ { pModel->Expand((SvListView*)this,pParent); }
+
+ void Collapse( SvTreeListEntry* pParent )
+ { pModel->Collapse((SvListView*)this,pParent); }
+
+ sal_Bool Select( SvTreeListEntry* pEntry, sal_Bool bSelect=sal_True )
+ { return pModel->Select((SvListView*)this,pEntry,bSelect); }
+
+ // Does not call the Select Handler
+ virtual void SelectAll( sal_Bool bSelect, sal_Bool )
+ { pModel->SelectAll((SvListView*)this, bSelect); }
+
+ sal_Bool IsEntryVisible( SvTreeListEntry* pEntry ) const
+ { return pModel->IsEntryVisible((SvListView*)this,pEntry); }
+
+ sal_Bool IsExpanded( SvTreeListEntry* pEntry ) const;
+ sal_Bool IsSelected( SvTreeListEntry* pEntry ) const;
+ void SetEntryFocus( SvTreeListEntry* pEntry, sal_Bool bFocus );
+ const SvViewDataEntry* GetViewData( const SvTreeListEntry* pEntry ) const;
+ SvViewDataEntry* GetViewData( SvTreeListEntry* pEntry );
+ sal_Bool HasViewData() const
+ { return maDataTable.size() > 1; } // There's always a ROOT
+
+ virtual SvViewDataEntry* CreateViewData( SvTreeListEntry* pEntry );
+ virtual void InitViewData( SvViewDataEntry*, SvTreeListEntry* pEntry );
+
+ virtual void ModelHasCleared();
+ virtual void ModelHasInserted( SvTreeListEntry* pEntry );
+ virtual void ModelHasInsertedTree( SvTreeListEntry* pEntry );
+ virtual void ModelIsMoving(
+ SvTreeListEntry* pSource,
+ SvTreeListEntry* pTargetParent,
+ sal_uLong nPos
+ );
+ virtual void ModelHasMoved( SvTreeListEntry* pSource );
+ virtual void ModelIsRemoving( SvTreeListEntry* pEntry );
+ virtual void ModelHasRemoved( SvTreeListEntry* pEntry );
+ virtual void ModelHasEntryInvalidated( SvTreeListEntry* pEntry );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
new file mode 100644
index 000000000000..180050560bf9
--- /dev/null
+++ b/include/svtools/treelistbox.hxx
@@ -0,0 +1,806 @@
+/* -*- 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_TREELISTBOX_HXX__
+#define __SVTOOLS_TREELISTBOX_HXX__
+
+#include "svtools/svtdllapi.h"
+
+#include <deque>
+#include <vector>
+
+#include <vcl/ctrl.hxx>
+#include <vcl/seleng.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/timer.hxx>
+#include <vcl/accel.hxx>
+#include <vcl/mnemonicengine.hxx>
+#include <vcl/quickselectionengine.hxx>
+#include <vcl/image.hxx>
+#include <tools/gen.hxx>
+#include <tools/contnr.hxx>
+#include <svtools/treelist.hxx>
+#include <svtools/transfer.hxx>
+
+class Application;
+class SvTreeListBox;
+class SvTreeListEntry;
+struct SvViewDataItem;
+class SvViewDataEntry;
+class SvInplaceEdit2;
+class SvLBoxString;
+class SvLBoxButton;
+class SvLBoxContextBmp;
+class SvLBoxBmp;
+class SvImpLBox;
+class SvLBoxButtonData;
+struct SvLBoxDDInfo;
+
+namespace utl {
+ class AccessibleStateSetHelper;
+}
+
+enum SvLBoxButtonKind
+{
+ SvLBoxButtonKind_enabledCheckbox,
+ SvLBoxButtonKind_disabledCheckbox,
+ SvLBoxButtonKind_staticImage
+};
+
+enum SvButtonState { SV_BUTTON_UNCHECKED, SV_BUTTON_CHECKED, SV_BUTTON_TRISTATE };
+
+// *********************************************************************
+// *************************** Tabulators ******************************
+// *********************************************************************
+
+#define SV_LBOXTAB_DYNAMIC 0x0001 // Item's output column changes according to the Child Depth
+#define SV_LBOXTAB_ADJUST_RIGHT 0x0002 // Item's right margin at the tabulator
+#define SV_LBOXTAB_ADJUST_LEFT 0x0004 // Left margin
+#define SV_LBOXTAB_ADJUST_CENTER 0x0008 // Center the item at the tabulator
+#define SV_LBOXTAB_ADJUST_NUMERIC 0x0010 // Decimal point at the tabulator (strings)
+
+// Is not supported anymore! The focus is now controlled by selection!
+#define SV_LBOXTAB_SHOW_FOCUS 0x0020 // Visualize focus
+
+#define SV_LBOXTAB_SHOW_SELECTION 0x0040 // Visualize selection state
+ // Item needs to be able to return the surrounding polygon (D'n'D cursor)
+#define SV_LBOXTAB_EDITABLE 0x0100 // Item editable at the tabulator
+#define SV_LBOXTAB_PUSHABLE 0x0200 // Item acts like a Button
+#define SV_LBOXTAB_INV_ALWAYS 0x0400 // Always delete the background
+#define SV_LBOXTAB_FORCE 0x0800 // Switch off the default calculation of the first tabulator
+ // (on which Abo Tabpage/Extras/Option/Customize, etc. rely on)
+ // The first tab's position corresponds precisely to the Flags set
+ // and column widths
+
+#define SV_TAB_BORDER 8
+
+#define SV_ENTRYHEIGHTOFFS_PIXEL 2
+
+#define TREEFLAG_CHKBTN 0x0001
+#define TREEFLAG_USESEL 0x0002
+#define TREEFLAG_MANINS 0x0004
+#define TREEFLAG_RECALCTABS 0x0008
+
+typedef sal_Int64 ExtendedWinBits;
+
+// disable the behavior of automatically selecting a "CurEntry" upon painting the control
+#define EWB_NO_AUTO_CURENTRY 0x00000001
+
+#define SV_ITEM_ID_LBOXSTRING 1
+#define SV_ITEM_ID_LBOXBMP 2
+#define SV_ITEM_ID_LBOXBUTTON 3
+#define SV_ITEM_ID_LBOXCONTEXTBMP 4
+
+class SvLBoxTab
+{
+ long nPos;
+ void* pUserData;
+public:
+ SvLBoxTab();
+ SvLBoxTab( long nPos, sal_uInt16 nFlags=SV_LBOXTAB_ADJUST_LEFT );
+ SvLBoxTab( const SvLBoxTab& );
+ ~SvLBoxTab();
+
+ sal_uInt16 nFlags;
+
+ void SetUserData( void* pPtr ) { pUserData = pPtr; }
+ void* GetUserData() const { return pUserData; }
+ sal_Bool IsDynamic() const { return (sal_Bool)((nFlags & SV_LBOXTAB_DYNAMIC)!=0); }
+ void SetPos( long nNewPos) { nPos = nNewPos; }
+ long GetPos() const { return nPos; }
+ long CalcOffset( long nItemLength, long nTabWidth );
+ // long CalcOffset( const String&, const OutputDevice& );
+ sal_Bool IsEditable() const { return (sal_Bool)((nFlags & SV_LBOXTAB_EDITABLE)!=0); }
+ sal_Bool IsPushable() const { return (sal_Bool)((nFlags & SV_LBOXTAB_PUSHABLE)!=0); }
+};
+
+// *********************************************************************
+// ****************************** Items ********************************
+// *********************************************************************
+
+class SVT_DLLPUBLIC SvLBoxItem
+{
+public:
+ SvLBoxItem( SvTreeListEntry*, sal_uInt16 nFlags );
+ SvLBoxItem();
+ virtual ~SvLBoxItem();
+ virtual sal_uInt16 GetType() const = 0;
+ const Size& GetSize(const SvTreeListBox* pView, const SvTreeListEntry* pEntry) const;
+ const Size& GetSize(const SvViewDataEntry* pData, sal_uInt16 nItemPos) const;
+
+ virtual void Paint(
+ const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) = 0;
+
+ virtual void InitViewData( SvTreeListBox* pView, SvTreeListEntry* pEntry,
+ // If != 0: this Pointer must be used!
+ // If == 0: it needs to be retrieved via the View
+ SvViewDataItem* pViewData = 0) = 0;
+ virtual SvLBoxItem* Create() const = 0;
+ // View-dependent data is not cloned
+ virtual void Clone( SvLBoxItem* pSource ) = 0;
+};
+
+inline SvLBoxItem* new_clone(const SvLBoxItem& rSrc)
+{
+ SvLBoxItem* p = rSrc.Create();
+ p->Clone(const_cast<SvLBoxItem*>(&rSrc));
+ return p;
+}
+
+inline void delete_clone(const SvLBoxItem* p)
+{
+ delete p;
+}
+
+// *********************************************************************
+// ****************************** SvTreeListBox ************************
+// *********************************************************************
+
+#define WB_FORCE_SELECTION ((WinBits)0x8000)
+
+#define DragDropMode sal_uInt16
+#define SV_DRAGDROP_NONE (DragDropMode)0x0000
+#define SV_DRAGDROP_CTRL_MOVE (DragDropMode)0x0001
+#define SV_DRAGDROP_CTRL_COPY (DragDropMode)0x0002
+#define SV_DRAGDROP_APP_MOVE (DragDropMode)0x0004
+#define SV_DRAGDROP_APP_COPY (DragDropMode)0x0008
+#define SV_DRAGDROP_APP_DROP (DragDropMode)0x0010
+// Entries may be dropped via the uppermost Entry
+// The DropTarget is 0 in that case
+#define SV_DRAGDROP_ENABLE_TOP (DragDropMode)0x0020
+
+#define SVLISTBOX_ID_LBOX 0 // for SvTreeListBox::GetType()
+
+#define SVLBOX_IN_EDT 0x0001
+#define SVLBOX_EDT_ENABLED 0x0002
+#define SVLBOX_IS_EXPANDING 0x0004
+#define SVLBOX_IS_TRAVELSELECT 0x0008
+#define SVLBOX_TARGEMPH_VIS 0x0010
+#define SVLBOX_EDTEND_CALLED 0x0020
+
+struct SvTreeListBoxImpl;
+
+class SVT_DLLPUBLIC SvTreeListBox
+ :public Control
+ ,public SvListView
+ ,public DropTargetHelper
+ ,public DragSourceHelper
+ ,public ::vcl::IMnemonicEntryList
+ ,public ::vcl::ISearchableStringList
+{
+ friend class SvImpLBox;
+ friend class TreeControlPeer;
+
+ SvTreeListBoxImpl* mpImpl;
+ SvImpLBox* pImp;
+ Link aCheckButtonHdl;
+ Link aScrolledHdl;
+ Link aExpandedHdl;
+ Link aExpandingHdl;
+ Link aSelectHdl;
+ Link aDeselectHdl;
+
+ Accelerator aInpEditAcc;
+ Image aPrevInsertedExpBmp;
+ Image aPrevInsertedColBmp;
+ Image aCurInsertedExpBmp;
+ Image aCurInsertedColBmp;
+
+ short nContextBmpWidthMax;
+ short nEntryHeight;
+ short nEntryHeightOffs;
+ short nIndent;
+ short nFocusWidth;
+ sal_uInt16 nFirstSelTab;
+ sal_uInt16 nLastSelTab;
+ long mnCheckboxItemWidth;
+ bool mbContextBmpExpanded;
+
+ SvTreeListEntry* pHdlEntry;
+ SvLBoxItem* pHdlItem;
+
+ DragDropMode nDragDropMode;
+ DragDropMode nOldDragMode;
+ SelectionMode eSelMode;
+ sal_Int8 nDragOptions;
+
+ SvTreeListEntry* pEdEntry;
+ SvLBoxItem* pEdItem;
+
+protected:
+ Link aDoubleClickHdl;
+ SvTreeListEntry* pTargetEntry;
+ SvLBoxButtonData* pCheckButtonData;
+ std::vector<SvLBoxTab*> aTabs;
+ sal_uInt16 nTreeFlags;
+ sal_uInt16 nImpFlags;
+ // Move/CopySelection: Position of the current Entry in SelectionList
+ sal_uInt16 nCurEntrySelPos;
+
+private:
+ void SetBaseModel(SvTreeList* pNewModel);
+
+ DECL_DLLPRIVATE_LINK( CheckButtonClick, SvLBoxButtonData * );
+ DECL_DLLPRIVATE_LINK( TextEditEndedHdl_Impl, void * );
+ // Handler that is called by TreeList to clone an Entry
+ DECL_DLLPRIVATE_LINK( CloneHdl_Impl, SvTreeListEntry* );
+
+ // Handler and methods for Drag - finished handler.
+ // The Handle retrieved by GetDragFinishedHdl can be set on the
+ // TransferDataContainer. This link is a callback for the DragFinished
+ // call. The AddBox method is called from the GetDragFinishedHdl() and the
+ // remove is called in the link callback and in the dtor. So it can't be
+ // called for a deleted object.
+ SVT_DLLPRIVATE static void AddBoxToDDList_Impl( const SvTreeListBox& rB );
+ SVT_DLLPRIVATE static void RemoveBoxFromDDList_Impl( const SvTreeListBox& rB );
+ DECL_DLLPRIVATE_STATIC_LINK( SvTreeListBox, DragFinishHdl_Impl, sal_Int8* );
+
+protected:
+
+ sal_Bool CheckDragAndDropMode( SvTreeListBox* pSource, sal_Int8 );
+ void ImplShowTargetEmphasis( SvTreeListEntry* pEntry, sal_Bool bShow);
+ void EnableSelectionAsDropTarget( sal_Bool bEnable = sal_True,
+ sal_Bool bWithChildren = sal_True );
+ // Standard impl returns 0; must be overloaded by derived classes which support D'n'D
+ using Window::GetDropTarget;
+ virtual SvTreeListEntry* GetDropTarget( const Point& );
+
+ // Put View-specific data into the Dragserver
+ // Is called at the SourceView (in BeginDrag Handler)
+ virtual void WriteDragServerInfo( const Point&, SvLBoxDDInfo* );
+ // Is called at the TargetView (in Drop Handler)
+ virtual void ReadDragServerInfo( const Point&,SvLBoxDDInfo* );
+
+ // Invalidate children on enable/disable
+ virtual void StateChanged( StateChangedType eType );
+
+ virtual sal_uLong Insert( SvTreeListEntry* pEnt,SvTreeListEntry* pPar,sal_uLong nPos=LIST_APPEND);
+ virtual sal_uLong Insert( SvTreeListEntry* pEntry,sal_uLong nRootPos = LIST_APPEND );
+
+ // In-place editing
+ SvInplaceEdit2* pEdCtrl;
+ void EditText( const String&, const Rectangle&,const Selection&);
+ void EditText( const String&, const Rectangle&,const Selection&, sal_Bool bMulti);
+ void EditTextMultiLine( const String&, const Rectangle&,const Selection&);
+ void CancelTextEditing();
+ sal_Bool EditingCanceled() const;
+ bool IsEmptyTextAllowed() const;
+
+ // Return value must be derived from SvViewDataEntry!
+ virtual SvViewDataEntry* CreateViewData( SvTreeListEntry* );
+ // InitViewData is called right after CreateViewData
+ // The Entry is has not yet been added to the View in InitViewData!
+ virtual void InitViewData( SvViewDataEntry*, SvTreeListEntry* pEntry );
+ // Calls InitViewData for all Items
+ void RecalcViewData();
+ // Callback of RecalcViewData
+ virtual void ViewDataInitialized( SvTreeListEntry* );
+
+ // Handler and methods for Drag - finished handler. This link can be set
+ // to the TransferDataContainer. The AddBox/RemoveBox methods must be
+ // called before the StartDrag call.
+ // The Remove will be called from the handler, which then calls DragFinish.
+ // The Remove is also called in the DTOR of the SvTreeListBox -
+ // so it can't be called for a deleted object.
+ Link GetDragFinishedHdl() const;
+
+ // For asynchronous D'n'D
+ sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt, SvTreeListBox* pSourceView );
+
+ void OnCurrentEntryChanged();
+
+ // IMnemonicEntryList
+ virtual const void* FirstSearchEntry( String& _rEntryText ) const;
+ virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const;
+ virtual void SelectSearchEntry( const void* _pEntry );
+ virtual void ExecuteSearchEntry( const void* _pEntry ) const;
+
+ // ISearchableStringList
+ virtual ::vcl::StringEntryIdentifier CurrentEntry( String& _out_entryText ) const;
+ virtual ::vcl::StringEntryIdentifier NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const;
+ virtual void SelectEntry( ::vcl::StringEntryIdentifier _entry );
+
+public:
+
+ SvTreeListBox( Window* pParent, WinBits nWinStyle=0 );
+ SvTreeListBox( Window* pParent, const ResId& rResId );
+ virtual ~SvTreeListBox();
+
+ SvTreeList* GetModel() const { return pModel; }
+ using SvListView::SetModel;
+ void SetModel(SvTreeList* pNewModel);
+
+ sal_uLong GetEntryCount() const {return pModel->GetEntryCount();}
+ SvTreeListEntry* First() const { return pModel->First(); }
+ SvTreeListEntry* Next( SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) const { return pModel->Next(pEntry,pDepth); }
+ SvTreeListEntry* Prev( SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) const { return pModel->Prev(pEntry,pDepth); }
+ SvTreeListEntry* Last() const { return pModel->Last(); }
+
+ SvTreeListEntry* FirstChild( SvTreeListEntry* pParent ) const;
+ SvTreeListEntry* NextSibling( SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* PrevSibling( SvTreeListEntry* pEntry ) const;
+
+ sal_Bool CopySelection( SvTreeListBox* pSource, SvTreeListEntry* pTarget );
+ sal_Bool MoveSelection( SvTreeListBox* pSource, SvTreeListEntry* pTarget );
+ sal_Bool MoveSelectionCopyFallbackPossible( SvTreeListBox* pSource, SvTreeListEntry* pTarget, sal_Bool bAllowCopyFallback );
+ void RemoveSelection();
+
+ DragDropMode GetDragDropMode() const { return nDragDropMode; }
+ SelectionMode GetSelectionMode() const { return eSelMode; }
+
+ // pParent == 0 -> Root level
+ SvTreeListEntry* GetEntry( SvTreeListEntry* pParent, sal_uLong nPos ) const;
+ SvTreeListEntry* GetEntry( sal_uLong nRootPos ) const;
+
+ SvTreeListEntry* GetEntryFromPath( const ::std::deque< sal_Int32 >& _rPath ) const;
+ void FillEntryPath( SvTreeListEntry* pEntry, ::std::deque< sal_Int32 >& _rPath ) const;
+
+ using Window::GetParent;
+ const SvTreeListEntry* GetParent( const SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* GetParent( SvTreeListEntry* pEntry ) const;
+ SvTreeListEntry* GetRootLevelParent(SvTreeListEntry* pEntry ) const;
+
+ using Window::GetChildCount;
+ sal_uLong GetChildCount( SvTreeListEntry* pParent ) const;
+ sal_uLong GetLevelChildCount( SvTreeListEntry* pParent ) const;
+
+ SvViewDataEntry* GetViewDataEntry( SvTreeListEntry* pEntry ) const;
+ SvViewDataItem* GetViewDataItem(SvTreeListEntry*, SvLBoxItem*);
+ const SvViewDataItem* GetViewDataItem(const SvTreeListEntry*, const SvLBoxItem*) const;
+
+ bool IsInplaceEditingEnabled() const { return ((nImpFlags & SVLBOX_EDT_ENABLED) != 0); }
+ bool IsEditingActive() const { return ((nImpFlags & SVLBOX_IN_EDT) != 0); }
+ void EndEditing( bool bCancel = false );
+ void ForbidEmptyText();
+
+ void Clear();
+
+ /** Enables or disables mnemonic characters in the entry texts.
+
+ If mnemonics are enabled, then entries are selected and made current when
+ there mnemonic character is pressed. If there are multiple entries with the
+ same mnemonic, the selection cycles between them.
+
+ Entries with an collapsed ancestor are not included in the calculation of
+ mnemonics. That is, if you press the accelerator key of an invisible
+ entry, then this entry is *not* selected.
+
+ Be aware that enabling mnemonics gets more expensive as you add to the list.
+ */
+ void EnableEntryMnemonics( bool _bEnable = true );
+ bool IsEntryMnemonicsEnabled() const;
+
+ /** Handles the given key event.
+
+ At the moment this merely checks for accelerator keys, if entry mnemonics
+ are enabled.
+
+ This method may come in handy if you want to use keyboard acceleration
+ while the control does not have the focus.
+
+ If the key event describes the pressing of a shortcut for an entry,
+ then SelectSearchEntry resp. ExecuteSearchEntry are called.
+
+ @see IMnemonicEntryList
+ @see MnemonicEngine
+
+ @return
+ <TRUE/> if the event has been consumed, <FALSE/> otherwise.
+ */
+ bool HandleKeyInput( const KeyEvent& rKEvt );
+
+ void SetSelectHdl( const Link& rNewHdl ) {aSelectHdl=rNewHdl; }
+ void SetDeselectHdl( const Link& rNewHdl ) {aDeselectHdl=rNewHdl; }
+ void SetDoubleClickHdl(const Link& rNewHdl) {aDoubleClickHdl=rNewHdl;}
+ const Link& GetSelectHdl() const { return aSelectHdl; }
+ const Link& GetDeselectHdl() const { return aDeselectHdl; }
+ const Link& GetDoubleClickHdl() const { return aDoubleClickHdl; }
+ void SetExpandingHdl(const Link& rNewHdl){aExpandingHdl=rNewHdl;}
+ void SetExpandedHdl(const Link& rNewHdl){aExpandedHdl=rNewHdl;}
+ const Link& GetExpandingHdl() const { return aExpandingHdl; }
+
+ virtual void ExpandedHdl();
+ virtual long ExpandingHdl();
+ virtual void SelectHdl();
+ virtual void DeselectHdl();
+ virtual sal_Bool DoubleClickHdl();
+ sal_Bool IsTravelSelect() const { return (sal_Bool)((nImpFlags&SVLBOX_IS_TRAVELSELECT)!=0);}
+ SvTreeListEntry* GetHdlEntry() const { return pHdlEntry; }
+ SvLBoxItem* GetHdlItem() const;
+
+ // Is called for an Entry that gets expanded with the Flag
+ // ENTRYFLAG_CHILDREN_ON_DEMAND set.
+ virtual void RequestingChildren( SvTreeListEntry* pParent );
+
+ // Drag & Drop
+ // New D'n'D API
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
+ virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
+ virtual DragDropMode NotifyStartDrag( TransferDataContainer& rData,
+ SvTreeListEntry* );
+ virtual void DragFinished( sal_Int8 nDropAction );
+ virtual sal_Bool NotifyAcceptDrop( SvTreeListEntry* );
+
+ void SetDragOptions( sal_Int8 nOptions ) { nDragOptions = nOptions; }
+ sal_Int8 GetDragOptions() const { return nDragOptions; }
+
+ SvTreeListBox* GetSourceView() const;
+
+ virtual void NotifyRemoving( SvTreeListEntry* );
+ virtual SvTreeListEntry* CloneEntry( SvTreeListEntry* pSource );
+ virtual SvTreeListEntry* CreateEntry() const; // To create new Entries
+
+ // Return value: sal_True == Ok, sal_False == Cancel
+ virtual sal_Bool NotifyMoving(
+ SvTreeListEntry* pTarget, // D'n'D DropPosition in this->GetModel()
+ SvTreeListEntry* pEntry, // Entry to be moved from GetSourceListBox()->GetModel()
+ SvTreeListEntry*& rpNewParent, // New TargetParent
+ sal_uLong& rNewChildPos); // The TargetParent's position in Childlist
+
+ // Return value: sal_True == Ok, sal_False == Cancel
+ virtual sal_Bool NotifyCopying(
+ SvTreeListEntry* pTarget, // D'n'D DropPosition in this->GetModel()
+ SvTreeListEntry* pEntry, // Entry to be copied from GetSourceListBox()->GetModel()
+ SvTreeListEntry*& rpNewParent, // New TargetParent
+ sal_uLong& rNewChildPos); // The TargetParent's position in Childlist
+
+ // ACCESSIBILITY ==========================================================
+
+ /** Creates and returns the accessible object of the Box. */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+
+ /** Fills the StateSet with all states (except DEFUNC, done by the accessible object). */
+ virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet ) const;
+
+ /** Fills the StateSet of one entry. */
+ virtual void FillAccessibleEntryStateSet( SvTreeListEntry* pEntry, ::utl::AccessibleStateSetHelper& rStateSet ) const;
+
+ /** Calculate and return the bounding rectangle of an entry.
+ @param pEntry
+ The entry.
+ @return The bounding rectangle of an entry. */
+ virtual Rectangle GetBoundingRect( SvTreeListEntry* pEntry );
+
+ /** Enables, that one cell of a tablistbox entry can be focused */
+ void EnableCellFocus();
+
+protected:
+ using SvListView::Expand;
+ using SvListView::Collapse;
+ using SvListView::Select;
+ using SvListView::SelectAll;
+
+ SVT_DLLPRIVATE short GetHeightOffset( const Image& rBmp, Size& rLogicSize);
+ SVT_DLLPRIVATE short GetHeightOffset( const Font& rFont, Size& rLogicSize);
+
+ SVT_DLLPRIVATE void SetEntryHeight( SvTreeListEntry* pEntry );
+ SVT_DLLPRIVATE void AdjustEntryHeight( const Image& rBmp );
+ SVT_DLLPRIVATE void AdjustEntryHeight( const Font& rFont );
+
+ SVT_DLLPRIVATE void ImpEntryInserted( SvTreeListEntry* pEntry );
+ SVT_DLLPRIVATE long PaintEntry1( SvTreeListEntry*, long nLine,
+ sal_uInt16 nTabFlagMask=0xffff,
+ sal_Bool bHasClipRegion=sal_False );
+
+ SVT_DLLPRIVATE void InitTreeView();
+ SVT_DLLPRIVATE SvLBoxItem* GetItem_Impl( SvTreeListEntry*, long nX, SvLBoxTab** ppTab,
+ sal_uInt16 nEmptyWidth );
+ SVT_DLLPRIVATE void ImplInitStyle();
+
+protected:
+
+ void EditItemText( SvTreeListEntry* pEntry, SvLBoxString* pItem,
+ const Selection& );
+ void EditedText( const XubString& );
+
+ // Recalculate all tabs depending on TreeListStyle and Bitmap sizes
+ // Is called automatically when inserting/changing Bitmaps, changing the Model etc.
+ virtual void SetTabs();
+ void SetTabs_Impl();
+ void AddTab( long nPos,sal_uInt16 nFlags=SV_LBOXTAB_ADJUST_LEFT,
+ void* pUserData = 0 );
+ sal_uInt16 TabCount() const { return aTabs.size(); }
+ SvLBoxTab* GetFirstDynamicTab() const;
+ SvLBoxTab* GetFirstDynamicTab( sal_uInt16& rTabPos ) const;
+ SvLBoxTab* GetFirstTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos );
+ SvLBoxTab* GetLastTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos );
+ SvLBoxTab* GetTab( SvTreeListEntry*, SvLBoxItem* ) const;
+ void ClearTabList();
+
+ virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind);
+
+ virtual void NotifyBeginScroll();
+ virtual void NotifyEndScroll();
+ // nLines == 0 => horizontal Scrolling
+ virtual void NotifyScrolling( long nLines );
+ virtual void NotifyScrolled();
+ void SetScrolledHdl( const Link& rLink ) { aScrolledHdl = rLink; }
+ const Link& GetScrolledHdl() const { return aScrolledHdl; }
+ long GetXOffset() const { return GetMapMode().GetOrigin().X(); }
+
+ // Is called _before_ Areas in the Control are invalidated.
+ // This can be used to hide Elements which are painted from outside into the Control
+ virtual void NotifyInvalidating();
+
+ virtual void Command( const CommandEvent& rCEvt );
+
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void CursorMoved( SvTreeListEntry* pNewCursor );
+ virtual void PreparePaint( SvTreeListEntry* );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void InitSettings(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground);
+ sal_Bool IsCellFocusEnabled() const;
+ bool SetCurrentTabPos( sal_uInt16 _nNewPos );
+ sal_uInt16 GetCurrentTabPos() const;
+ void CallImplEventListeners(sal_uLong nEvent, void* pData);
+
+ void ImplEditEntry( SvTreeListEntry* pEntry );
+
+ sal_Bool AreChildrenTransient() const;
+ void SetChildrenNotTransient();
+
+public:
+
+ void SetExtendedWinBits( ExtendedWinBits _nBits );
+
+ void DisconnectFromModel();
+
+ void EnableCheckButton( SvLBoxButtonData* );
+ void SetCheckButtonData( SvLBoxButtonData* );
+ void SetNodeBitmaps( const Image& rCollapsedNodeBmp, const Image& rExpandedNodeBmp );
+
+ /** Returns the default image which clients should use for expanded nodes, to have a consistent user
+ interface experience in the whole product.
+ */
+ static const Image& GetDefaultExpandedNodeImage( );
+
+ /** Returns the default image which clients should use for expanded nodes, to have a consistent user
+ interface experience in the whole product.
+ */
+ static const Image& GetDefaultCollapsedNodeImage( );
+
+ /** Sets default bitmaps for collapsed and expanded nodes.
+ */
+ inline void SetNodeDefaultImages( )
+ {
+ SetNodeBitmaps(
+ GetDefaultCollapsedNodeImage( ),
+ GetDefaultExpandedNodeImage( )
+ );
+ }
+
+ virtual SvTreeListEntry* InsertEntry( const XubString& rText, SvTreeListEntry* pParent = 0,
+ sal_Bool bChildrenOnDemand = sal_False,
+ sal_uLong nPos=LIST_APPEND, void* pUserData = 0,
+ SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
+
+ virtual SvTreeListEntry* InsertEntry( const XubString& rText,
+ const Image& rExpandedEntryBmp,
+ const Image& rCollapsedEntryBmp,
+ SvTreeListEntry* pParent = 0,
+ sal_Bool bChildrenOnDemand = sal_False,
+ sal_uLong nPos = LIST_APPEND, void* pUserData = 0,
+ SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
+
+ const Image& GetDefaultExpandedEntryBmp( ) const;
+ const Image& GetDefaultCollapsedEntryBmp( ) const;
+
+ void SetDefaultExpandedEntryBmp( const Image& rBmp );
+ void SetDefaultCollapsedEntryBmp( const Image& rBmp );
+
+ void SetCheckButtonState( SvTreeListEntry*, SvButtonState );
+ SvButtonState GetCheckButtonState( SvTreeListEntry* ) const;
+
+ void SetEntryText(SvTreeListEntry*, const XubString& );
+ void SetExpandedEntryBmp( SvTreeListEntry* _pEntry, const Image& _rImage );
+ void SetCollapsedEntryBmp( SvTreeListEntry* _pEntry, const Image& _rImage );
+
+ virtual String GetEntryText( SvTreeListEntry* pEntry ) const;
+ String SearchEntryText( SvTreeListEntry* pEntry ) const;
+ const Image& GetExpandedEntryBmp(const SvTreeListEntry* _pEntry ) const;
+ const Image& GetCollapsedEntryBmp(const SvTreeListEntry* _pEntry ) const;
+
+ void SetCheckButtonHdl( const Link& rLink ) { aCheckButtonHdl=rLink; }
+ Link GetCheckButtonHdl() const { return aCheckButtonHdl; }
+ virtual void CheckButtonHdl();
+
+ void SetSublistOpenWithReturn( sal_Bool bMode = sal_True ); // open/close sublist with return/enter
+ void SetSublistOpenWithLeftRight( sal_Bool bMode = sal_True ); // open/close sublist with cursor left/right
+
+ void EnableInplaceEditing( bool bEnable );
+ // Edits the Entry's first StringItem, 0 == Cursor
+ void EditEntry( SvTreeListEntry* pEntry = NULL );
+ virtual sal_Bool EditingEntry( SvTreeListEntry* pEntry, Selection& );
+ virtual sal_Bool EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewText );
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Resize();
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ void SetUpdateMode( sal_Bool );
+
+ virtual void ModelHasCleared();
+ virtual void ModelHasInserted( SvTreeListEntry* pEntry );
+ virtual void ModelHasInsertedTree( SvTreeListEntry* pEntry );
+ virtual void ModelIsMoving(SvTreeListEntry* pSource,
+ SvTreeListEntry* pTargetParent, sal_uLong nChildPos );
+ virtual void ModelHasMoved(SvTreeListEntry* pSource );
+ virtual void ModelIsRemoving( SvTreeListEntry* pEntry );
+ virtual void ModelHasRemoved( SvTreeListEntry* pEntry );
+ void ModelHasEntryInvalidated( SvTreeListEntry* pEntry );
+
+ void ShowTargetEmphasis( SvTreeListEntry*, sal_Bool bShow );
+ void ScrollOutputArea( short nDeltaEntries );
+
+ short GetEntryHeight() const { return nEntryHeight; }
+ void SetEntryHeight( short nHeight, sal_Bool bAlways = sal_False );
+ Size GetOutputSizePixel() const;
+ short GetIndent() const { return nIndent; }
+ void SetIndent( short nIndent );
+ void SetSpaceBetweenEntries( short nSpace );
+ short GetSpaceBetweenEntries() const {return nEntryHeightOffs;}
+ Point GetEntryPosition( SvTreeListEntry* ) const;
+ void ShowEntry( SvTreeListEntry* ); // !!!OBSOLETE, use MakeVisible
+ void MakeVisible( SvTreeListEntry* pEntry );
+ void MakeVisible( SvTreeListEntry* pEntry, sal_Bool bMoveToTop );
+
+ void SetCollapsedNodeBmp( const Image& );
+ void SetExpandedNodeBmp( const Image& );
+ Image GetExpandedNodeBmp( ) const;
+
+ void SetFont( const Font& rFont );
+
+ using Window::SetCursor;
+ void SetCursor( SvTreeListEntry* pEntry, sal_Bool bForceNoSelect = sal_False );
+
+ SvTreeListEntry* GetEntry( const Point& rPos, sal_Bool bHit = sal_False ) const;
+
+ void PaintEntry( SvTreeListEntry* );
+ long PaintEntry( SvTreeListEntry*, long nLine,
+ sal_uInt16 nTabFlagMask=0xffff );
+ virtual Rectangle GetFocusRect( SvTreeListEntry*, long nLine );
+ // Respects indentation
+ virtual long GetTabPos( SvTreeListEntry*, SvLBoxTab* );
+ void InvalidateEntry( SvTreeListEntry* );
+ SvLBoxItem* GetItem( SvTreeListEntry*, long nX, SvLBoxTab** ppTab);
+ SvLBoxItem* GetItem( SvTreeListEntry*, long nX );
+
+ void SetDragDropMode( DragDropMode );
+ void SetSelectionMode( SelectionMode );
+
+ sal_Bool Expand( SvTreeListEntry* pParent );
+ sal_Bool Collapse( SvTreeListEntry* pParent );
+ sal_Bool Select( SvTreeListEntry* pEntry, sal_Bool bSelect=sal_True );
+ sal_uLong SelectChildren( SvTreeListEntry* pParent, sal_Bool bSelect );
+ virtual void SelectAll( sal_Bool bSelect, sal_Bool bPaint = sal_True );
+
+ void SetCurEntry( SvTreeListEntry* _pEntry );
+ SvTreeListEntry* GetCurEntry() const;
+
+ using Window::Invalidate;
+ virtual void Invalidate( sal_uInt16 nFlags = 0);
+ virtual void Invalidate( const Rectangle&, sal_uInt16 nFlags = 0 );
+
+ void SetHighlightRange(sal_uInt16 nFirstTab=0,sal_uInt16 nLastTab=0xffff);
+
+ // A Parent's Children are turned into Children of the Parent which comes next in hierarchy
+ void RemoveParentKeepChildren( SvTreeListEntry* pParent );
+
+ DECL_LINK( DefaultCompare, SvSortData* );
+ virtual void ModelNotification( sal_uInt16 nActionId, SvTreeListEntry* pEntry1,
+ SvTreeListEntry* pEntry2, sal_uLong nPos );
+
+ void EndSelection();
+ void RepaintScrollBars() const;
+ ScrollBar* GetVScroll();
+ ScrollBar* GetHScroll();
+ void EnableAsyncDrag( sal_Bool b );
+
+ SvTreeListEntry* GetFirstEntryInView() const;
+ SvTreeListEntry* GetNextEntryInView(SvTreeListEntry*) const;
+ SvTreeListEntry* GetLastEntryInView() const;
+ void ScrollToAbsPos( long nPos );
+
+ void ShowFocusRect( const SvTreeListEntry* pEntry );
+ void InitStartEntry();
+
+ virtual PopupMenu* CreateContextMenu( void );
+ virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry );
+
+ void EnableContextMenuHandling( void );
+ void EnableContextMenuHandling( sal_Bool bEnable );
+ sal_Bool IsContextMenuHandlingEnabled( void ) const;
+
+ void EnableList( bool _bEnable );
+
+ long getPreferredDimensions(std::vector<long> &rWidths) const;
+
+ virtual Size GetOptimalSize() const;
+};
+
+#define SV_LBOX_DD_FORMAT "SV_LBOX_DD_FORMAT"
+struct SvLBoxDDInfo
+{
+ Application* pApp;
+ SvTreeListBox* pSource;
+ SvTreeListEntry* pDDStartEntry;
+ // Relative position in the Entry at DragBeginn (IconView)
+ long nMouseRelX,nMouseRelY;
+ sal_uLong nRes1,nRes2,nRes3,nRes4;
+};
+
+class SvInplaceEdit2
+{
+ Link aCallBackHdl;
+ Accelerator aAccReturn;
+ Accelerator aAccEscape;
+ Timer aTimer;
+ Edit* pEdit;
+ sal_Bool bCanceled;
+ sal_Bool bAlreadyInCallBack;
+
+ void CallCallBackHdl_Impl();
+ DECL_LINK( Timeout_Impl, void * );
+ DECL_LINK( ReturnHdl_Impl, void * );
+ DECL_LINK( EscapeHdl_Impl, void * );
+
+public:
+ SvInplaceEdit2( Window* pParent, const Point& rPos, const Size& rSize,
+ const String& rData, const Link& rNotifyEditEnd,
+ const Selection&, sal_Bool bMultiLine = sal_False );
+ ~SvInplaceEdit2();
+ sal_Bool KeyInput( const KeyEvent& rKEvt );
+ void LoseFocus();
+ sal_Bool EditingCanceled() const { return bCanceled; }
+ OUString GetText() const;
+ String GetSavedValue() const;
+ void StopEditing( sal_Bool bCancel = sal_False );
+ void Hide();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/treelistentries.hxx b/include/svtools/treelistentries.hxx
new file mode 100755
index 000000000000..d52d09aac107
--- /dev/null
+++ b/include/svtools/treelistentries.hxx
@@ -0,0 +1,20 @@
+/* -*- 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 __SVTOOLS_TREELISTENTRIES_HXX__
+#define __SVTOOLS_TREELISTENTRIES_HXX__
+
+#include <boost/ptr_container/ptr_vector.hpp>
+
+class SvTreeListEntry;
+typedef boost::ptr_vector<SvTreeListEntry> SvTreeListEntries;
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/treelistentry.hxx b/include/svtools/treelistentry.hxx
new file mode 100644
index 000000000000..dfea2651eb0e
--- /dev/null
+++ b/include/svtools/treelistentry.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/.
+ *
+ * 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_TREELISTENTRY_HXX__
+#define __SVTOOLS_TREELISTENTRY_HXX__
+
+#include "svtdllapi.h"
+#include "tools/solar.h"
+#include "treelistbox.hxx"
+#include "treelistentries.hxx"
+
+#include <boost/ptr_container/ptr_vector.hpp>
+
+// Flags, die am Model haengen
+#define SV_ENTRYFLAG_CHILDREN_ON_DEMAND 0x0001
+#define SV_ENTRYFLAG_DISABLE_DROP 0x0002
+#define SV_ENTRYFLAG_IN_USE 0x0004
+// wird gesetzt, wenn RequestingChildren keine Children gestzt hat
+#define SV_ENTRYFLAG_NO_NODEBMP 0x0008
+// Eintrag hatte oder hat Kinder
+#define SV_ENTRYFLAG_HAD_CHILDREN 0x0010
+
+#define SV_ENTRYFLAG_USER_FLAGS 0xF000
+#define SV_ENTRYFLAG_SEMITRANSPARENT 0x8000 // draw semi-transparent entry bitmaps
+
+
+class SVT_DLLPUBLIC SvTreeListEntry
+{
+ friend class SvTreeList;
+ friend class SvListView;
+ friend class SvTreeListBox;
+
+ typedef boost::ptr_vector<SvLBoxItem> ItemsType;
+
+ SvTreeListEntry* pParent;
+ SvTreeListEntries maChildren;
+ sal_uLong nAbsPos;
+ sal_uLong nListPos;
+ ItemsType maItems;
+ void* pUserData;
+ sal_uInt16 nEntryFlags;
+
+private:
+ void ClearChildren();
+ void SetListPositions();
+ void InvalidateChildrensListPositions();
+
+public:
+ static size_t ITEM_NOT_FOUND;
+
+ SvTreeListEntry();
+ SvTreeListEntry(const SvTreeListEntry& r);
+ virtual ~SvTreeListEntry();
+
+ bool HasChildren() const;
+ bool HasChildListPos() const;
+ sal_uLong GetChildListPos() const;
+
+ SvTreeListEntries& GetChildEntries();
+ const SvTreeListEntries& GetChildEntries() const;
+
+ void Clone(SvTreeListEntry* pSource);
+
+ size_t ItemCount() const;
+
+ // DARF NUR GERUFEN WERDEN, WENN DER EINTRAG NOCH NICHT IM MODEL
+ // EINGEFUEGT IST, DA SONST FUER DAS ITEM KEINE VIEW-ABHAENGIGEN
+ // DATEN ALLOZIERT WERDEN!
+ void AddItem( SvLBoxItem* pItem );
+ void ReplaceItem( SvLBoxItem* pNewItem, size_t nPos );
+ const SvLBoxItem* GetItem( size_t nPos ) const;
+ SvLBoxItem* GetItem( size_t nPos );
+ const SvLBoxItem* GetFirstItem( sal_uInt16 nId ) const;
+ SvLBoxItem* GetFirstItem( sal_uInt16 nId );
+ size_t GetPos( const SvLBoxItem* pItem ) const;
+ void* GetUserData() const;
+ void SetUserData( void* pPtr );
+ void EnableChildrenOnDemand( bool bEnable=true );
+ bool HasChildrenOnDemand() const;
+ bool HasInUseEmphasis() const;
+
+ sal_uInt16 GetFlags() const;
+ void SetFlags( sal_uInt16 nFlags );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/unitconv.hxx b/include/svtools/unitconv.hxx
new file mode 100644
index 000000000000..637f575eb9ee
--- /dev/null
+++ b/include/svtools/unitconv.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 _SVT_UNITCONV_HXX
+#define _SVT_UNITCONV_HXX
+
+#include <vcl/field.hxx>
+#include "svtools/svtdllapi.h"
+#include <svl/poolitem.hxx>
+
+// macro -----------------------------------------------------------------
+
+// typedef ---------------------------------------------------------------
+
+typedef long (*FUNC_CONVERT)(long);
+
+// Functions -------------------------------------------------------------
+
+SVT_DLLPUBLIC void SetFieldUnit( MetricField& rCtrl, FieldUnit eUnit, sal_Bool bAll = sal_False );
+SVT_DLLPUBLIC void SetFieldUnit( MetricBox& rCtrl, FieldUnit eUnit, sal_Bool bAll = sal_False );
+
+SVT_DLLPUBLIC long CalcToUnit( float nIn, SfxMapUnit eUnit );
+SVT_DLLPUBLIC long CalcToPoint( long nIn, SfxMapUnit eUnit, sal_uInt16 nFaktor );
+
+SVT_DLLPUBLIC long ItemToControl( long nIn, SfxMapUnit eItem, SfxFieldUnit eCtrl );
+SVT_DLLPUBLIC long ControlToItem( long nIn, SfxFieldUnit eCtrl, SfxMapUnit eItem );
+
+SVT_DLLPUBLIC FieldUnit MapToFieldUnit( const SfxMapUnit eUnit );
+
+SVT_DLLPUBLIC void SetMetricValue( MetricField& rField, long lCoreValue, SfxMapUnit eUnit );
+SVT_DLLPUBLIC long GetCoreValue( const MetricField& rField, SfxMapUnit 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 000000000000..581df582a64e
--- /dev/null
+++ b/include/svtools/unoevent.hxx
@@ -0,0 +1,320 @@
+/* -*- 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_UNOEVENT_HXX_
+#define _SVTOOLS_UNOEVENT_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/container/XNameReplace.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XInterface.hpp>
+#include <cppuhelper/implbase2.hxx>
+
+class SvxMacroTableDtor;
+class SvxMacroItem;
+class SvxMacro;
+
+/** 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
+{
+ sal_uInt16 mnEvent;
+ const sal_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::WeakImplHelper2
+<
+ ::com::sun::star::container::XNameReplace,
+ ::com::sun::star::lang::XServiceInfo
+>
+{
+ const OUString sEventType;
+ const OUString sMacroName;
+ const OUString sLibrary;
+ const OUString sStarBasic;
+ const OUString sJavaScript;
+ const OUString sScript;
+ const OUString sNone;
+
+
+ /// name of own service
+ const OUString sServiceName;
+
+protected:
+ const OUString sEmpty;
+
+ /// last element is 0, 0
+ const SvEventDescription* mpSupportedMacroItems;
+ sal_Int16 mnMacroItems;
+
+public:
+
+ SvBaseEventDescriptor(const SvEventDescription* pSupportedMacroItems);
+
+ virtual ~SvBaseEventDescriptor();
+
+
+ // XNameReplace
+ /// calls replaceByName(const sal_uInt16, const SvxMacro&)
+ virtual void SAL_CALL replaceByName(
+ const OUString& rName, /// API name of event
+ const ::com::sun::star::uno::Any& rElement ) /// event (PropertyValues)
+ throw(
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ // XNameAccess (via XNameReplace)
+ /// calls getByName(sal_uInt16)
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName(
+ const OUString& rName ) /// API name of event
+ throw(
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ // XNameAxcess (via XNameReplace)
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
+ getElementNames()
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XNameAccess (via XNameReplace)
+ virtual sal_Bool SAL_CALL hasByName(
+ const OUString& rName )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XElementAccess (via XNameReplace)
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XElementAccess (via XNameReplace)
+ virtual sal_Bool SAL_CALL hasElements()
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ /// must be implemented in subclass
+ virtual OUString SAL_CALL getImplementationName(void)
+ throw( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ // XServiceInfo
+ virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName)
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ // XServiceInfo
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
+ getSupportedServiceNames(void)
+ throw( ::com::sun::star::uno::RuntimeException );
+
+protected:
+
+ /// Must be implemented in subclass.
+ virtual void replaceByName(
+ const sal_uInt16 nEvent, /// item ID of event
+ const SvxMacro& rMacro) /// event (will be copied)
+ throw(
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException) = 0;
+
+ /// Must be implemented in subclass.
+ virtual void getByName(
+ SvxMacro& rMacro,
+ const sal_uInt16 nEvent )
+ throw(
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException) = 0;
+
+ /// convert an API event name to the event ID as used by SvxMacroItem
+ sal_uInt16 mapNameToEventID(const OUString& rName) const;
+
+ /// get the event ID for the name; return 0 if not supported
+ sal_uInt16 getMacroID(const OUString& rName) const;
+
+ /// create PropertyValues and Any from macro
+ void getAnyFromMacro(
+ ::com::sun::star::uno::Any& aAny, // Any to be filled by Macro values
+ const SvxMacro& rMacro);
+
+ /// create macro from PropertyValues (in an Any)
+ void getMacroFromAny(
+ SvxMacro& aMacro, // reference to be filled by Any
+ const ::com::sun::star::uno::Any& rAny)
+ throw (
+ ::com::sun::star::lang::IllegalArgumentException);
+
+};
+
+
+
+
+/**
+ * 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 it's 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
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface > xParentRef;
+
+public:
+
+ SvEventDescriptor(::com::sun::star::uno::XInterface& rParent,
+ const SvEventDescription* pSupportedMacroItems);
+
+ virtual ~SvEventDescriptor();
+
+
+protected:
+
+
+ using SvBaseEventDescriptor::replaceByName;
+ virtual void replaceByName(
+ const sal_uInt16 nEvent, /// item ID of event
+ const SvxMacro& rMacro) /// event (will be copied)
+ throw(
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ using SvBaseEventDescriptor::getByName;
+ virtual void getByName(
+ SvxMacro& rMacros, /// macro to be filled with values
+ const sal_uInt16 nEvent ) /// item ID of event
+ throw(
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+
+ /// 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]
+ SvxMacro** aMacros;
+
+ const OUString sImplName;
+
+public:
+
+ SvDetachedEventDescriptor(const SvEventDescription* pSupportedMacroItems);
+
+ virtual ~SvDetachedEventDescriptor();
+
+ //XServiceInfo
+ virtual OUString SAL_CALL getImplementationName(void)
+ throw( ::com::sun::star::uno::RuntimeException );
+
+protected:
+
+ sal_Int16 getIndex(const sal_uInt16 nID) const;
+
+ using SvBaseEventDescriptor::replaceByName;
+ virtual void replaceByName(
+ const sal_uInt16 nEvent, /// item ID of event
+ const SvxMacro& rMacro) /// event (will be copied)
+ throw(
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ using SvBaseEventDescriptor::getByName;
+ virtual void getByName(
+ SvxMacro& rMacro, /// macro to be filled
+ const sal_uInt16 nEvent ) /// item ID of event
+ throw(
+ ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ /// do we have an event?
+ /// return sal_True: we have a macro for the event
+ /// return sal_False: no macro; getByName() will return an empty macro
+ /// IllegalArgumentException: the event is not supported
+ using SvBaseEventDescriptor::hasByName;
+ virtual sal_Bool hasByName(
+ const sal_uInt16 nEvent ) const /// item ID of event
+ throw(
+ ::com::sun::star::lang::IllegalArgumentException);
+
+};
+
+class SVT_DLLPUBLIC SvMacroTableEventDescriptor : public SvDetachedEventDescriptor
+{
+public:
+
+ SvMacroTableEventDescriptor(const SvEventDescription* pSupportedMacroItems);
+ SvMacroTableEventDescriptor(const SvxMacroTableDtor& aFmt,
+ const SvEventDescription* pSupportedMacroItems);
+
+ virtual ~SvMacroTableEventDescriptor();
+
+ void copyMacrosFromTable(const SvxMacroTableDtor& aFmt);
+ 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 000000000000..03fd3ea3e84b
--- /dev/null
+++ b/include/svtools/unoimap.hxx
@@ -0,0 +1,39 @@
+/* -*- 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_UNOIMAP_HXX
+#define _SVTOOLS_UNOIMAP_HXX
+
+#include "svtools/svtdllapi.h"
+#include <com/sun/star/uno/XInterface.hpp>
+
+class ImageMap;
+struct SvEventDescription;
+
+SVT_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SvUnoImageMapRectangleObject_createInstance( const SvEventDescription* pSupportedMacroItems );
+SVT_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SvUnoImageMapCircleObject_createInstance( const SvEventDescription* pSupportedMacroItems );
+SVT_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SvUnoImageMapPolygonObject_createInstance( const SvEventDescription* pSupportedMacroItems );
+
+SVT_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SvUnoImageMap_createInstance( const SvEventDescription* pSupportedMacroItems );
+SVT_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SvUnoImageMap_createInstance( const ImageMap& rMap, const SvEventDescription* pSupportedMacroItems );
+SVT_DLLPUBLIC sal_Bool SvUnoImageMap_fillImageMap( com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xImageMap, ImageMap& rMap );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/urlcontrol.hxx b/include/svtools/urlcontrol.hxx
new file mode 100644
index 000000000000..682573855000
--- /dev/null
+++ b/include/svtools/urlcontrol.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 SVTOOLS_URLCONTROL_HXX
+#define SVTOOLS_URLCONTROL_HXX
+
+#include "svtools/svtdllapi.h"
+#include <svtools/inettbc.hxx>
+
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+ //=====================================================================
+ //= OFileURLControl
+ //=====================================================================
+ class SVT_DLLPUBLIC OFileURLControl : public SvtURLBox
+ {
+ protected:
+ String m_sPreservedText;
+
+ public:
+ OFileURLControl(Window* _pParent, const ResId& _rId);
+
+ protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // SVTOOLS_URLCONTROL_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 000000000000..ff032fd3baa4
--- /dev/null
+++ b/include/svtools/valueset.hxx
@@ -0,0 +1,391 @@
+/* -*- 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 _VALUESET_HXX
+#define _VALUESET_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <vcl/ctrl.hxx>
+#include <vcl/virdev.hxx>
+#include <vcl/timer.hxx>
+#include <vector>
+
+class MouseEvent;
+class TrackingEvent;
+class HelpEvent;
+class KeyEvent;
+class DataChangedEvent;
+class ScrollBar;
+
+struct ValueSetItem;
+typedef ::std::vector< ValueSetItem* > ValueItemList;
+
+#ifdef _SV_VALUESET_CXX
+class ValueSetAcc;
+class ValueItemAcc;
+#endif
+
+/*************************************************************************
+
+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 overloaded. 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
+ ImageRadioButton. 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
+ GetSelectItemId() 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 scroolbar 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 colums 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 underlayed. 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 overloaded. 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 overloaded 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().
+
+*************************************************************************/
+
+// ------------------
+// - ValueSet types -
+// ------------------
+
+#define WB_RADIOSEL ((WinBits)0x00008000)
+#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)
+
+// ------------
+// - ValueSet -
+// ------------
+
+#define VALUESET_APPEND ((sal_uInt16)-1)
+#define VALUESET_ITEM_NOTFOUND ((sal_uInt16)-1)
+
+class SVT_DLLPUBLIC ValueSet : public Control
+{
+private:
+
+ VirtualDevice maVirDev;
+ Timer maTimer;
+ ValueItemList mItemList;
+ ValueSetItem* mpNoneItem;
+ ScrollBar* mpScrBar;
+ Rectangle maNoneItemRect;
+ Rectangle maItemListRect;
+ long mnItemWidth;
+ long mnItemHeight;
+ long mnTextOffset;
+ long mnVisLines;
+ long mnLines;
+ long mnUserItemWidth;
+ long mnUserItemHeight;
+ sal_uInt16 mnSelItemId;
+ sal_uInt16 mnHighItemId;
+ sal_uInt16 mnCols;
+ sal_uInt16 mnCurCol;
+ sal_uInt16 mnUserCols;
+ sal_uInt16 mnUserVisLines;
+ sal_uInt16 mnFirstLine;
+ sal_uInt16 mnSpacing;
+ sal_uInt16 mnFrameStyle;
+ bool mbFormat : 1;
+ bool mbHighlight : 1;
+ bool mbSelection : 1;
+ bool mbNoSelection : 1;
+ bool mbDrawSelection : 1;
+ bool mbBlackSel : 1;
+ bool mbDoubleSel : 1;
+ bool mbScroll : 1;
+ bool mbFullMode : 1;
+ bool mbIsTransientChildrenDisabled : 1;
+ bool mbHasVisibleItems : 1;
+ Color maColor;
+ Link maDoubleClickHdl;
+ Link maSelectHdl;
+ Link maHighlightHdl;
+
+#ifdef _SV_VALUESET_CXX
+ friend class ValueSetAcc;
+ friend class ValueItemAcc;
+ using Control::ImplInitSettings;
+ using Window::ImplInit;
+ SVT_DLLPRIVATE void ImplInit();
+ SVT_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
+ SVT_DLLPRIVATE void ImplInitScrollBar();
+ SVT_DLLPRIVATE void ImplDeleteItems();
+ SVT_DLLPRIVATE void ImplFormatItem( ValueSetItem* pItem, Rectangle aRect );
+ SVT_DLLPRIVATE void ImplDrawItemText(const OUString& rStr);
+ SVT_DLLPRIVATE void ImplDrawSelect( sal_uInt16 nItemId, const bool bFocus, const bool bDrawSel );
+ SVT_DLLPRIVATE void ImplDrawSelect();
+ SVT_DLLPRIVATE void ImplHideSelect( sal_uInt16 nItemId );
+ SVT_DLLPRIVATE void ImplHighlightItem( sal_uInt16 nItemId, bool bIsSelection = true );
+ SVT_DLLPRIVATE void ImplDraw();
+ using Window::ImplScroll;
+ SVT_DLLPRIVATE bool ImplScroll( const Point& rPos );
+ SVT_DLLPRIVATE size_t ImplGetItem( const Point& rPoint, bool bMove = false ) const;
+ SVT_DLLPRIVATE ValueSetItem* ImplGetItem( size_t nPos );
+ SVT_DLLPRIVATE ValueSetItem* ImplGetFirstItem();
+ SVT_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const;
+ SVT_DLLPRIVATE ValueSetItem* ImplGetVisibleItem( sal_uInt16 nVisiblePos );
+ SVT_DLLPRIVATE void ImplInsertItem( ValueSetItem *const pItem, const size_t nPos );
+ SVT_DLLPRIVATE Rectangle ImplGetItemRect( size_t nPos ) const;
+ SVT_DLLPRIVATE void ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue );
+ SVT_DLLPRIVATE bool ImplHasAccessibleListeners();
+ SVT_DLLPRIVATE void ImplTracking( const Point& rPos, bool bRepeat );
+ SVT_DLLPRIVATE void ImplEndTracking( const Point& rPos, bool bCancel );
+ DECL_DLLPRIVATE_LINK( ImplScrollHdl, ScrollBar* );
+ DECL_DLLPRIVATE_LINK( ImplTimerHdl, void* );
+#endif
+
+ // Forbidden and not implemented.
+ ValueSet (const ValueSet &);
+ ValueSet & operator= (const ValueSet &);
+
+protected:
+
+ bool StartDrag( const CommandEvent& rCEvt, Region& rRegion );
+
+protected:
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+
+public:
+ ValueSet( Window* pParent, WinBits nWinStyle, bool bDisableTransientChildren = false );
+ ValueSet( Window* pParent, const ResId& rResId, bool bDisableTransientChildren = false );
+ ~ValueSet();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void Resize();
+ virtual Size GetOptimalSize() const;
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Select();
+ virtual void DoubleClick();
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ void InsertItem( sal_uInt16 nItemId, const Image& rImage,
+ size_t nPos = VALUESET_APPEND );
+ void InsertItem( sal_uInt16 nItemId, const Color& rColor,
+ size_t nPos = VALUESET_APPEND );
+ void InsertItem( sal_uInt16 nItemId,
+ const Image& rImage, const OUString& rStr,
+ size_t nPos = VALUESET_APPEND );
+ void InsertItem( sal_uInt16 nItemId,
+ const Color& rColor, const OUString& rStr,
+ size_t nPos = VALUESET_APPEND );
+ void InsertItem( sal_uInt16 nItemId,
+ size_t nPos = VALUESET_APPEND );
+ 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;
+ Rectangle GetItemRect( sal_uInt16 nItemId ) const;
+
+ void EnableFullItemMode( bool bFullMode = true );
+ bool IsFullItemModeEnabled() const { return mbFullMode; }
+ 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 = 0 );
+ long GetItemWidth() const { return mnUserItemWidth; }
+ void SetItemHeight( long nLineHeight = 0 );
+ long GetItemHeight() const { return mnUserItemHeight; }
+ sal_uInt16 GetFirstLine() const { return mnFirstLine; }
+
+ void SelectItem( sal_uInt16 nItemId );
+ sal_uInt16 GetSelectItemId() const { return mnSelItemId; }
+ bool IsItemSelected( sal_uInt16 nItemId ) const
+ { return !mbNoSelection && (nItemId == mnSelItemId); }
+ void SetNoSelection();
+ bool IsNoSelection() const { return mbNoSelection; }
+
+ 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( Color( COL_TRANSPARENT ) ); }
+ Color GetColor() const { return maColor; }
+ bool IsColor() const { return maColor.GetTransparency() == 0; }
+
+ void SetExtraSpacing( sal_uInt16 nNewSpacing );
+ sal_uInt16 GetExtraSpacing() { return mnSpacing; }
+
+ void Format();
+
+ void StartSelection();
+ void EndSelection();
+
+ Size CalcWindowSizePixel( const Size& rItemSize,
+ sal_uInt16 nCalcCols = 0,
+ sal_uInt16 nCalcLines = 0 ) const;
+ Size CalcItemSizePixel( const Size& rSize, bool bOut = true ) const;
+ long GetScrollWidth() const;
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+
+ void SetHighlightHdl( const Link& rLink );
+};
+
+#endif // _VALUESET_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/viewdataentry.hxx b/include/svtools/viewdataentry.hxx
new file mode 100644
index 000000000000..3800b293fd2b
--- /dev/null
+++ b/include/svtools/viewdataentry.hxx
@@ -0,0 +1,81 @@
+/* -*- 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_VIEWDATAENTRY_HXX__
+#define __SVTOOLS_VIEWDATAENTRY_HXX__
+
+#include "svtdllapi.h"
+#include "tools/solar.h"
+#include "tools/gen.hxx"
+
+#include <vector>
+
+struct SvViewDataItem
+{
+ Size maSize;
+};
+
+/**
+ * View-dependent data for a tree list entry created in the virtual function
+ * SvTreeListBox::CreateViewData(). The item array contains the same number
+ * of items as that of the items in its corresponding tree list entry.
+ *
+ * When an entry is selected, it is logically selected and visually
+ * highlighted. When an entry is only highlighted, it looks visually
+ * highlighted, but not logically selected.
+ */
+class SVT_DLLPUBLIC SvViewDataEntry
+{
+ friend class SvTreeList;
+
+ std::vector<SvViewDataItem> maItems;
+ sal_uLong nVisPos;
+ bool mbSelected:1;
+ bool mbHighlighted:1;
+ bool mbExpanded:1;
+ bool mbFocused:1;
+ bool mbCursored:1;
+ bool mbSelectable:1;
+
+public:
+ SvViewDataEntry();
+ SvViewDataEntry( const SvViewDataEntry& );
+ ~SvViewDataEntry();
+
+ bool IsSelected() const;
+ bool IsHighlighted() const;
+ bool IsExpanded() const;
+ bool HasFocus() const;
+ bool IsCursored() const;
+ bool IsSelectable() const;
+ void SetFocus( bool bFocus );
+ void SetSelected( bool bSelected );
+ void SetHighlighted( bool bHighlighted );
+ void SetExpanded( bool bExpanded );
+ void SetSelectable( bool bSelectable );
+
+ void Init(size_t nSize);
+
+ const SvViewDataItem* GetItem(size_t nPos) const;
+ SvViewDataItem* GetItem(size_t nPos);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/wizardmachine.hxx b/include/svtools/wizardmachine.hxx
new file mode 100644
index 000000000000..8283b131007d
--- /dev/null
+++ b/include/svtools/wizardmachine.hxx
@@ -0,0 +1,385 @@
+/* -*- 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_WIZARDMACHINE_HXX_
+#define _SVTOOLS_WIZARDMACHINE_HXX_
+
+#include "svtools/svtdllapi.h"
+#include <svtools/wizdlg.hxx>
+#include <vcl/button.hxx>
+#include <vcl/tabpage.hxx>
+#include <comphelper/stl_types.hxx>
+
+class Bitmap;
+//.........................................................................
+namespace svt
+{
+//.........................................................................
+
+// wizard buttons
+#define WZB_NONE 0x0000
+#define WZB_NEXT 0x0001
+#define WZB_PREVIOUS 0x0002
+#define WZB_FINISH 0x0004
+#define WZB_CANCEL 0x0008
+#define WZB_HELP 0x0010
+
+// wizard states
+#define WZS_INVALID_STATE ((WizardState)-1)
+
+ //=====================================================================
+ //= WizardTypes
+ //=====================================================================
+ struct WizardTypes
+ {
+ typedef sal_Int16 WizardState;
+ enum CommitPageReason
+ {
+ eTravelForward, // traveling forward (maybe with skipping pages)
+ eTravelBackward, // traveling backward (maybe with skipping pages)
+ eFinish, // the wizard is about to be finished
+ eValidate // the data should be validated only, no traveling wll happen
+ };
+ };
+
+ class SAL_NO_VTABLE IWizardPageController
+ {
+ public:
+ //-----------------------------------------------------------------
+ // This methods behave somewhat different than ActivatePage/DeactivatePage
+ // The latter are handled by the base class itself whenever changing the pages is in the offing,
+ // i.e., when it's already decided which page is the next.
+ // We may have situations where the next page depends on the state of the current, which needs
+ // to be committed for this.
+ // So initializePage and commitPage are designated to initialitzing/committing data on the page.
+ virtual void initializePage() = 0;
+ virtual sal_Bool commitPage( WizardTypes::CommitPageReason _eReason ) = 0;
+
+ /** determines whether or not it is allowed to advance to a next page
+
+ You should make this dependent on the current state of the page only, not on
+ states on other pages of the whole dialog.
+
+ The default implementation always returns <TRUE/>.
+ */
+ virtual bool canAdvance() const = 0;
+
+ protected:
+ ~IWizardPageController() {}
+ };
+
+ //=====================================================================
+ //= OWizardPage
+ //=====================================================================
+ class OWizardMachine;
+ struct WizardPageImplData;
+
+ class SVT_DLLPUBLIC OWizardPage : public TabPage, public IWizardPageController
+ {
+ private:
+ WizardPageImplData* m_pImpl;
+
+ public:
+ /** @param _pParent
+ if the OWizardPage is used in an OWizardMachine, this parameter
+ must be the OWizardMachine (which is derived from Window)
+ */
+ OWizardPage( Window* _pParent, const ResId& _rResId );
+ ~OWizardPage();
+
+ // IWizardPageController overridables
+ virtual void initializePage();
+ virtual sal_Bool commitPage( WizardTypes::CommitPageReason _eReason );
+ virtual bool canAdvance() const;
+
+ protected:
+ // TabPage overridables
+ virtual void ActivatePage();
+
+ /** updates the travel-related UI elements of the OWizardMachine we live in (if any)
+
+ If the parent of the tab page is a OWizardMachine, then updateTravelUI at this instance
+ is called. Otherwise, nothing happens.
+ */
+ void updateDialogTravelUI();
+ };
+
+ //=====================================================================
+ //= OWizardMachine
+ //=====================================================================
+ struct WizardMachineImplData;
+ /** implements some kind of finite automata, where the states of the automata exactly correlate
+ with tab pages.
+
+ That is, the machine can have up to n states, where at each point in time exactly one state is
+ the current one. A state being current is represented as one of n tab pages being displayed
+ currently.
+
+ The class handles the UI for traveling between the states (e.g. it administrates the <em>Next</em> and
+ <em>Previous</em> buttons which you usually find in a wizard.
+
+ Derived classes have to implement the travel logic by overriding <member>determineNextState</member>,
+ which has to determine the state which follows the current state. Since this may depend
+ on the actual data presented in the wizard (e.g. checkboxes checked, or something like this),
+ they can implement non-linear traveling this way.
+ */
+
+ class SVT_DLLPUBLIC OWizardMachine : public WizardDialog, public WizardTypes
+ {
+ private:
+ // restrict access to some aspects of our base class
+ SVT_DLLPRIVATE void AddPage( TabPage* pPage ) { WizardDialog::AddPage(pPage); }
+ SVT_DLLPRIVATE void RemovePage( TabPage* pPage ) { WizardDialog::RemovePage(pPage); }
+ SVT_DLLPRIVATE void SetPage( sal_uInt16 nLevel, TabPage* pPage ) { WizardDialog::SetPage(nLevel, pPage); }
+ // TabPage* GetPage( sal_uInt16 nLevel ) const { return WizardDialog::GetPage(nLevel); }
+ // TODO: probably the complete page handling (next, previous etc.) should be prohibited ...
+
+ // IMPORTANT:
+ // traveling pages should not be done by calling these base class member, some mechanisms of this class
+ // here (e.g. committing page data) depend on having full control over page traveling.
+ // So use the travelXXX methods if you need to travel
+
+ protected:
+ OKButton* m_pFinish;
+ CancelButton* m_pCancel;
+ PushButton* m_pNextPage;
+ PushButton* m_pPrevPage;
+ HelpButton* m_pHelp;
+
+ private:
+ WizardMachineImplData*
+ m_pImpl;
+ // hold members in this structure to allow keeping compatible when members are added
+
+ SVT_DLLPRIVATE void addButtons(Window* _pParent, sal_uInt32 _nButtonFlags);
+
+ public:
+ /** ctor
+
+ The ctor does not call FreeResource, this is the resposibility of the derived class.
+
+ For the button flags, use any combination of the WZB_* flags.
+ */
+ OWizardMachine(Window* _pParent, const ResId& _rRes, sal_uInt32 _nButtonFlags );
+ OWizardMachine(Window* _pParent, const WinBits i_nStyle, sal_uInt32 _nButtonFlags );
+ ~OWizardMachine();
+
+ /// enable (or disable) buttons
+ void enableButtons(sal_uInt32 _nWizardButtonFlags, sal_Bool _bEnable);
+ /// set the default style for a button
+ void defaultButton(sal_uInt32 _nWizardButtonFlags);
+ /// set the default style for a button
+ void defaultButton(PushButton* _pNewDefButton);
+
+ /// set the base of the title to use - the title of the current page is appended
+ void setTitleBase(const String& _rTitleBase);
+
+ /// determines whether there is a next state to which we can advance
+ virtual bool canAdvance() const;
+
+ /** updates the user interface which deals with traveling in the wizard
+
+ The default implementation simply checks whether both the current page and the wizard
+ itself allow to advance to the next state (<code>canAdvance</code>), and enables the "Next"
+ button if and only if this is the case.
+ */
+ virtual void updateTravelUI();
+
+ protected:
+ // WizardDialog overridables
+ virtual void ActivatePage();
+ virtual long DeactivatePage();
+
+ // our own overridables
+
+ /// to override to create new pages
+ virtual TabPage* createPage(WizardState _nState) = 0;
+
+ /// will be called when a new page is about to be displayed
+ virtual void enterState(WizardState _nState);
+
+ /** will be called when the current state is about to be left for the given reason
+
+ The base implementation in this class will simply call <member>OWizardPage::commitPage</member>
+ for the current page, and return whatever this call returns.
+
+ @param _eReason
+ The reason why the state is to be left.
+ @return
+ <TRUE/> if and only if the page is allowed to be left
+ */
+ virtual sal_Bool prepareLeaveCurrentState( CommitPageReason _eReason );
+
+ /** will be called when the given state is left
+
+ This is the very last possibility for derived classes to veto the deactivation
+ of a page.
+
+ @todo Normally, we would not need the return value here - derived classes now have
+ the possibility to veto page deactivations in <member>prepareLeaveCurrentState</member>. However,
+ changing this return type is too incompatible at the moment ...
+
+ @return
+ <TRUE/> if and only if the page is allowed to be left
+ */
+ virtual sal_Bool leaveState( WizardState _nState );
+
+ /** determine the next state to travel from the given one
+
+ The default behaviour is linear traveling, overwrite this to change it
+
+ Return WZS_INVALID_STATE to prevent traveling.
+ */
+ virtual WizardState determineNextState( WizardState _nCurrentState ) const;
+
+ /** called when the finish button is pressed
+ <p>By default, only the base class' Finnish method (which is not virtual) is called</p>
+ */
+ virtual sal_Bool onFinish();
+
+ /// travel to the next state
+ sal_Bool travelNext();
+
+ /// travel to the previous state
+ sal_Bool travelPrevious();
+
+ /** enables the automatic enabled/disabled state of the "Next" button
+
+ If this is <TRUE/>, then upon entering a new state, the "Next" button will automatically be
+ enabled if and only if determineNextState does not return WZS_INVALID_STATE.
+ */
+ void enableAutomaticNextButtonState( bool _bEnable = true );
+ bool isAutomaticNextButtonStateEnabled() const;
+
+ /** removes a page from the history. Should be called when the page is being disabled
+ */
+ void removePageFromHistory( WizardState nToRemove );
+
+ /** skip a state
+
+ The method behaves as if from the current state, <arg>_nSteps</arg> <method>travelNext</method>s were
+ called, but without actually creating or displaying the íntermediate pages. Only the
+ (<arg>_nSteps</arg> + 1)th page is created.
+
+ The skipped states appear in the state history, so <method>travelPrevious</method> will make use of them.
+
+ A very essential precondition for using this method is that your <method>determineNextState</method>
+ method is able to determine the next state without actually having the page of the current state.
+
+ @return
+ <TRUE/> if and only if traveling was successful
+
+ @see skipUntil
+ @see skipBackwardUntil
+ */
+ sal_Bool skip( sal_Int32 _nSteps = 1 );
+
+ /** skips one or more states, until a given state is reached
+
+ The method behaves as if from the current state, <method>travelNext</method>s were called
+ successively, until <arg>_nTargetState</arg> is reached, but without actually creating or
+ displaying the íntermediate pages.
+
+ The skipped states appear in the state history, so <method>travelPrevious</method> will make use of them.
+
+ @return
+ <TRUE/> if and only if traveling was successful
+
+ @see skip
+ @see skipBackwardUntil
+ */
+ sal_Bool skipUntil( WizardState _nTargetState );
+
+ /** moves back one or more states, until a given state is reached
+
+ This method allows traveling backwards more than one state without actually showing the intermediate
+ states.
+
+ For instance, if you want to travel two steps backward at a time, you could used
+ two travelPrevious calls, but this would <em>show</em> both pages, which is not necessary,
+ since you're interested in the target page only. Using <member>skipBackwardUntil</member> reliefs
+ you from this.
+
+ @return
+ <TRUE/> if and only if traveling was successful
+
+ @see skipUntil
+ @see skip
+ */
+ sal_Bool skipBackwardUntil( WizardState _nTargetState );
+
+ /** returns the current state of the machine
+
+ Vulgo, this is the identifier of the current tab page :)
+ */
+ WizardState getCurrentState() const { return WizardDialog::GetCurLevel(); }
+
+ virtual IWizardPageController*
+ getPageController( TabPage* _pCurrentPage ) const;
+
+ /** retrieves a copy of the state history, i.e. all states we already visited
+ */
+ void getStateHistory( ::std::vector< WizardState >& _out_rHistory );
+
+ public:
+ class AccessGuard { friend class WizardTravelSuspension; private: AccessGuard() { } };
+
+ void suspendTraveling( AccessGuard );
+ void resumeTraveling( AccessGuard );
+ bool isTravelingSuspended() const;
+
+ protected:
+ TabPage* GetOrCreatePage( const WizardState i_nState );
+
+ private:
+ // long OnNextPage( PushButton* );
+ DECL_DLLPRIVATE_LINK(OnNextPage, void*);
+ DECL_DLLPRIVATE_LINK(OnPrevPage, void*);
+ DECL_DLLPRIVATE_LINK(OnFinish, void*);
+
+ SVT_DLLPRIVATE void implResetDefault(Window* _pWindow);
+ SVT_DLLPRIVATE void implUpdateTitle();
+ SVT_DLLPRIVATE void implConstruct( const sal_uInt32 _nButtonFlags );
+ };
+
+ /// helper class to temporarily suspend any traveling in the wizard
+ class WizardTravelSuspension
+ {
+ public:
+ WizardTravelSuspension( OWizardMachine& _rWizard )
+ :m_rWizard( _rWizard )
+ {
+ m_rWizard.suspendTraveling( OWizardMachine::AccessGuard() );
+ }
+
+ ~WizardTravelSuspension()
+ {
+ m_rWizard.resumeTraveling( OWizardMachine::AccessGuard() );
+ }
+
+ private:
+ OWizardMachine& m_rWizard;
+ };
+
+//.........................................................................
+} // namespace svt
+//.........................................................................
+
+#endif // _SVTOOLS_WIZARDMACHINE_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/wizdlg.hxx b/include/svtools/wizdlg.hxx
new file mode 100644
index 000000000000..f161b7339ff7
--- /dev/null
+++ b/include/svtools/wizdlg.hxx
@@ -0,0 +1,301 @@
+/* -*- 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 _SVT_WIZDLG_HXX
+#define _SVT_WIZDLG_HXX
+
+#include "svtools/svtdllapi.h"
+
+#include <vcl/dialog.hxx>
+
+class TabPage;
+class Button;
+class PushButton;
+class FixedLine;
+struct ImplWizPageData;
+struct ImplWizButtonData;
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class WizardDialog
+
+Diese Klasse dient als Basis fuer einen WizardDialog. Als
+Basisfunktionalitaet wird das Anordnen der Controls angeboten und
+Hilfesmethoden fuer das Umschalten von TabPages. Der Dialog
+ordnet bei einer Groessenanderung die Controls auch wieder
+entsprechend an.
+
+--------------------------------------------------------------------------
+
+Mit SetPageSizePixel() kann als Groesse die Groesse der groessten
+TabPage vorgegeben werden. Wenn der Dialog angezeigt wird, wird
+zu dem Zeitpunkt wenn noch keine Groesse gesetzt wurde, dafuer
+die entsprechende Dialoggroesse berechnet und gesetzt. Wenn mit
+SetPageSizePixel() keine Groesse gesetzt wurde, wird als Groesse
+die maximale Groesse der zu diesem Zeitpunkt zugewiesenen TabPages
+berechnet und genommen.
+
+ShowPrevPage()/ShowNextPage() zeigt die vorherige/naechste TabPage
+an. Dazu wird zuerst der Deactivate-Handler vom Dialog gerufen und
+wenn dieser sal_True zurueckgegeben hat, wird der Acivate-Handler
+vom Dialog gerufen und die entsprechende TabPage angezeigt.
+Finnsh() kann gerufen werden, wenn der Finnish-Button betaetigt
+wird. Dort wird dann auch noch der Deactivate-Page-Handler vom
+Dialog und der aktuellen TabPage gerufen und dann der Dialog
+beendet (Close() oder EndDialog()).
+
+Mit AddPage()/RemovePage()/SetPage() koennen die TabPages dem Wizard
+bekannt gemacht werden. Es wird immer die TabPage des aktuellen Levels
+angezeigt, wenn fuer den aktuellen Level keine TabPage zugewiesen
+ist, wird die TabPages des hoechsten Levels angezeigt. Somit kann auch
+immer die aktuelle TabPage ausgetauscht werden, wobei zu
+beruecksichtigen ist, das im Activate-Handler die aktuelle TabPage
+nicht zerstoert werden darf.
+
+Mit SetPrevButton()/SetNextButton() werden der Prev-Button und der
+Next-Button dem Dialog bekannt gemacht. In dem Fall loest der
+Dialog bei Ctr+Tab, Shift+Ctrl+Tab den entsprechenden Click-Handler
+am zugewiesenen Button aus. Die Button werden nicht vom WizardDialog
+disablte. Eine entsprechende Steuerung muss der Benutzer dieses
+Dialoges selber programieren.
+
+Mit AddButton()/RemoveButton() koennen Buttons dem Wizard bekannt
+gemacht werden, die in der Reihenfolge der Hinzufuegung angeordnet
+werden. Die Buttons werden unabhengig von ihrem sichtbarkeitsstatus
+angeordnet, so das auch spaeter ein entsprechender Button angezeigt/
+gehidet werden kann. Der Offset wird in Pixeln angegeben und bezieht
+sich immer auf den nachfolgenden Button. Damit der Abstand zwischen
+den Buttons bei allen Dialogen gleich ist, gibt es das Define
+WIZARDDIALOG_BUTTON_STDOFFSET_X, welches als Standard-Offset genommen
+werden sollte.
+
+Mit ShowButtonFixedLine() kann gesteuert werden, ob die zwischen den
+Buttons und der TabPage eine Trennlinie angezeigt werden soll.
+
+Mit SetViewWindow() und SetViewAlign() kann ein Control gesetzt werden,
+welches als PreView-Window oder fuer die Anzeige von schoenen Bitmaps
+genutzt werden kann.
+
+--------------------------------------------------------------------------
+
+Der ActivatePage()-Handler wird gerufen, wenn eine neue TabPages
+angezeigt wird. In diesem Handler kann beispielsweise die neue
+TabPage erzeugt werden, wenn diese zu diesem Zeitpunkt noch nicht
+erzeugt wurde. Der Handler kann auch als Link gesetzt werden. Mit
+GetCurLevel() kann die aktuelle ebene abgefragt werden, wobei
+Level 0 die erste Seite ist.
+
+Der DeactivatePage()-Handler wird gerufen, wenn eine neue TabPage
+angezeigt werden soll. In diesem Handler kann noch eine Fehler-
+ueberprufung stattfinden und das Umschalten gegebenenfalls verhindert
+werden, indem sal_False zurueckgegeben wird. Der Handler kann auch als
+Link gesetzt werden. Die Defaultimplementierung ruft den Link und
+gibt den Rueckgabewert des Links zurueck und wenn kein Link gesetzt
+ist, wird sal_True zurueckgegeben.
+
+--------------------------------------------------------------------------
+
+Beispiel:
+
+MyWizardDlg-Ctor
+----------------
+
+// add buttons
+AddButton( &maHelpBtn, WIZARDDIALOG_BUTTON_STDOFFSET_X );
+AddButton( &maCancelBtn, WIZARDDIALOG_BUTTON_STDOFFSET_X );
+AddButton( &maPrevBtn );
+AddButton( &maNextBtn, WIZARDDIALOG_BUTTON_STDOFFSET_X );
+AddButton( &maFinnishBtn );
+SetPrevButton( &maPrevBtn );
+SetNextButton( &maNextBtn );
+
+// SetHandler
+maPrevBtn.SetClickHdl( LINK( this, MyWizardDlg, ImplPrevHdl ) );
+maNextBtn.SetClickHdl( LINK( this, MyWizardDlg, ImplNextHdl ) );
+
+// Set PreviewWindow
+SetViewWindow( &maPreview );
+
+// Show line between Buttons and Page
+ShowButtonFixedLine( sal_True );
+
+// Call ActivatePage, because the first page should be created an activated
+ActivatePage();
+
+
+MyWizardDlg-ActivatePage-Handler
+--------------------------------
+
+void MyWizardDlg::ActivatePage()
+{
+ WizardDialog::ActivatePage();
+
+ // Test, if Page is created already
+ if ( !GetPage( GetCurLevel() ) )
+ {
+ // Create and add new page
+ TabPage* pNewTabPage;
+ switch ( GetCurLevel() )
+ {
+ case 0:
+ pNewTabPage = CreateIntroPage();
+ break;
+ case 1:
+ pNewTabPage = CreateSecondPage();
+ break;
+ case 2:
+ pNewTabPage = CreateThirdPage();
+ break;
+ case 3:
+ pNewTabPage = CreateFinnishedPage();
+ break;
+
+ }
+ AddPage( pNewTabPage );
+ }
+}
+
+
+MyWizardDlg-Prev/Next-Handler
+-----------------------------
+
+IMPL_LINK( MyWizardDlg, ImplPrevHdl, PushButton*, pBtn )
+{
+ ShowPrevPage();
+ if ( !GetCurLevel() )
+ pBtn->Disable();
+ return 0;
+}
+
+IMPL_LINK( MyWizardDlg, ImplNextHdl, PushButton*, pBtn )
+{
+ ShowNextPage();
+ if ( GetCurLevel() < 3 )
+ pBtn->Disable();
+ return 0;
+}
+
+*************************************************************************/
+
+// ----------------------
+// - WizardDialog-Types -
+// ----------------------
+
+#define WIZARDDIALOG_BUTTON_STDOFFSET_X 6
+#define WIZARDDIALOG_BUTTON_SMALLSTDOFFSET_X 3
+
+// ----------------
+// - WizardDialog -
+// ----------------
+
+class SVT_DLLPUBLIC WizardDialog : public ModalDialog
+{
+private:
+ Size maPageSize;
+ ImplWizPageData* mpFirstPage;
+ ImplWizButtonData* mpFirstBtn;
+ FixedLine* mpFixedLine;
+ TabPage* mpCurTabPage;
+ PushButton* mpPrevBtn;
+ PushButton* mpNextBtn;
+ Window* mpViewWindow;
+ sal_uInt16 mnCurLevel;
+ WindowAlign meViewAlign;
+ Link maActivateHdl;
+ Link maDeactivateHdl;
+ sal_Int16 mnLeftAlignCount;
+ bool mbEmptyViewMargin;
+
+protected:
+ long LogicalCoordinateToPixel(int iCoordinate);
+ /**sets the number of buttons which should be left-aligned. Normally, buttons are right-aligned.
+
+ only to be used during construction, before any layouting happened
+ */
+ void SetLeftAlignedButtonCount( sal_Int16 _nCount );
+ /** declares the view area to have an empty margin
+
+ Normally, the view area has a certain margin to the top/left/bottom/right of the
+ dialog. By calling this method, you can reduce this margin to 0.
+ */
+ void SetEmptyViewMargin();
+
+#ifdef _SVT_WIZDLG_CXX
+private:
+ SVT_DLLPRIVATE void ImplInitData();
+ SVT_DLLPRIVATE void ImplCalcSize( Size& rSize );
+ SVT_DLLPRIVATE void ImplPosCtrls();
+ SVT_DLLPRIVATE void ImplPosTabPage();
+ SVT_DLLPRIVATE void ImplShowTabPage( TabPage* pPage );
+ SVT_DLLPRIVATE TabPage* ImplGetPage( sal_uInt16 nLevel ) const;
+#endif
+
+public:
+ WizardDialog( Window* pParent, WinBits nStyle = WB_STDTABDIALOG );
+ WizardDialog( Window* pParent, const ResId& rResId );
+ ~WizardDialog();
+
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ virtual void ActivatePage();
+ virtual long DeactivatePage();
+
+ sal_Bool ShowPrevPage();
+ sal_Bool ShowNextPage();
+ sal_Bool ShowPage( sal_uInt16 nLevel );
+ sal_Bool Finnish( long nResult = 0 );
+ sal_uInt16 GetCurLevel() const { return mnCurLevel; }
+
+ void AddPage( TabPage* pPage );
+ void RemovePage( TabPage* pPage );
+ void SetPage( sal_uInt16 nLevel, TabPage* pPage );
+ TabPage* GetPage( sal_uInt16 nLevel ) const;
+
+ void AddButton( Button* pButton, long nOffset = 0 );
+ void RemoveButton( Button* pButton );
+
+ void SetPrevButton( PushButton* pButton ) { mpPrevBtn = pButton; }
+ PushButton* GetPrevButton() const { return mpPrevBtn; }
+ void SetNextButton( PushButton* pButton ) { mpNextBtn = pButton; }
+ PushButton* GetNextButton() const { return mpNextBtn; }
+
+ void ShowButtonFixedLine( sal_Bool bVisible );
+
+ void SetViewWindow( Window* pWindow ) { mpViewWindow = pWindow; }
+ Window* GetViewWindow() const { return mpViewWindow; }
+ void SetViewAlign( WindowAlign eAlign ) { meViewAlign = eAlign; }
+ WindowAlign GetViewAlign() const { return meViewAlign; }
+
+ void SetPageSizePixel( const Size& rSize ) { maPageSize = rSize; }
+ const Size& GetPageSizePixel() const { return maPageSize; }
+
+ void SetActivatePageHdl( const Link& rLink ) { maActivateHdl = rLink; }
+ const Link& GetActivatePageHdl() const { return maActivateHdl; }
+ void SetDeactivatePageHdl( const Link& rLink ) { maDeactivateHdl = rLink; }
+ const Link& GetDeactivatePageHdl() const { return maDeactivateHdl; }
+};
+
+#endif // _SVT_WIZDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/xwindowitem.hxx b/include/svtools/xwindowitem.hxx
new file mode 100644
index 000000000000..fd7a8cd40ff9
--- /dev/null
+++ b/include/svtools/xwindowitem.hxx
@@ -0,0 +1,58 @@
+/* -*- 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 _XWINDOWITEM_HXX_
+#define _XWINDOWITEM_HXX_
+
+
+#include "svtools/svtdllapi.h"
+
+#include <svl/poolitem.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+
+#include <com/sun/star/awt/XWindow.hpp>
+
+class Window;
+
+//////////////////////////////////////////////////////////////////////
+
+class SVT_DLLPUBLIC XWindowItem : public SfxPoolItem
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xWin;
+
+ // disallow use assignment operator
+ XWindowItem & operator = ( const XWindowItem & );
+
+public:
+ TYPEINFO();
+ XWindowItem();
+ XWindowItem( const XWindowItem &rItem );
+ ~XWindowItem();
+
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
+ virtual int operator == ( const SfxPoolItem& rAttr ) const;
+
+ Window * GetWindowPtr() const { return VCLUnoHelper::GetWindow( m_xWin ); }
+ com::sun::star::uno::Reference< com::sun::star::awt::XWindow > GetXWindow() const { return m_xWin; }
+};
+
+//////////////////////////////////////////////////////////////////////
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */