cURL: follow redirects
[LibreOffice.git] / starmath / source / smdll.cxx
blob64e16de81ec650e9fef7320856092a59028952b9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/config.h>
22 #include <svx/svxids.hrc>
23 #include <svx/modctrl.hxx>
24 #include <svx/zoomctrl.hxx>
25 #include <svx/zoomsliderctrl.hxx>
26 #include <sfx2/docfac.hxx>
27 #include <svx/lboxctrl.hxx>
28 #include <sfx2/docfile.hxx>
29 #include <sfx2/docfilt.hxx>
30 #include <sfx2/app.hxx>
32 #include <smdll.hxx>
33 #include <document.hxx>
34 #include <view.hxx>
36 #include <ElementsDockingWindow.hxx>
38 #include <starmath.hrc>
40 #include <svx/xmlsecctrl.hxx>
41 #include <o3tl/make_unique.hxx>
43 namespace
45 class SmDLL
47 public:
48 SmDLL();
49 ~SmDLL();
52 SmDLL::SmDLL()
54 if ( SfxApplication::GetModule(SfxToolsModule::Math) ) // Module already active
55 return;
57 SfxObjectFactory& rFactory = SmDocShell::Factory();
59 auto pUniqueModule = o3tl::make_unique<SmModule>(&rFactory);
60 SmModule* pModule = pUniqueModule.get();
61 SfxApplication::SetModule(SfxToolsModule::Math, std::move(pUniqueModule));
63 rFactory.SetDocumentServiceName( "com.sun.star.formula.FormulaProperties" );
65 SmModule::RegisterInterface(pModule);
66 SmDocShell::RegisterInterface(pModule);
67 SmViewShell::RegisterInterface(pModule);
69 SmViewShell::RegisterFactory(1);
71 SvxZoomStatusBarControl::RegisterControl(SID_ATTR_ZOOM, pModule);
72 SvxZoomSliderControl::RegisterControl(SID_ATTR_ZOOMSLIDER, pModule);
73 SvxModifyControl::RegisterControl(SID_TEXTSTATUS, pModule);
74 SvxUndoRedoControl::RegisterControl(SID_UNDO, pModule);
75 SvxUndoRedoControl::RegisterControl(SID_REDO, pModule);
76 XmlSecStatusBarControl::RegisterControl(SID_SIGNATURE, pModule);
78 SmCmdBoxWrapper::RegisterChildWindow(true);
79 SmElementsDockingWindowWrapper::RegisterChildWindow(true);
82 SmDLL::~SmDLL()
86 struct theSmDLLInstance : public rtl::Static<SmDLL, theSmDLLInstance> {};
89 namespace SmGlobals
91 void ensure()
93 theSmDLLInstance::get();
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */