LCOV - code coverage report
Current view: top level - sd/source/ui/app - sddll.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 144 145 99.3 %
Date: 2015-06-13 12:38:46 Functions: 6 6 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      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 .
      18             :  */
      19             : 
      20             : #include <avmedia/mediaplayer.hxx>
      21             : #include <avmedia/mediatoolbox.hxx>
      22             : #include <editeng/eeitem.hxx>
      23             : #include <editeng/editeng.hxx>
      24             : #include <svx/svdobj.hxx>
      25             : #include <unotools/moduleoptions.hxx>
      26             : #include <svx/fmobjfac.hxx>
      27             : #include <svx/svdfield.hxx>
      28             : #include <svx/objfac3d.hxx>
      29             : #include <vcl/svapp.hxx>
      30             : 
      31             : #include "registerinterfaces.hxx"
      32             : #include "sddll.hxx"
      33             : #include "app.hrc"
      34             : #include "AnimationChildWindow.hxx"
      35             : #include "BezierObjectBar.hxx"
      36             : #include "diactrl.hxx"
      37             : #include "DrawDocShell.hxx"
      38             : #include "FactoryIds.hxx"
      39             : #include "gluectrl.hxx"
      40             : #include "GraphicDocShell.hxx"
      41             : #include "GraphicObjectBar.hxx"
      42             : #include "GraphicViewShell.hxx"
      43             : #include "GraphicViewShellBase.hxx"
      44             : #include "ImpressViewShellBase.hxx"
      45             : #include "PresentationViewShell.hxx"
      46             : #include "PresentationViewShellBase.hxx"
      47             : #include "MediaObjectBar.hxx"
      48             : #include "NavigatorChildWindow.hxx"
      49             : #include "OutlineViewShell.hxx"
      50             : #include "OutlineViewShellBase.hxx"
      51             : #include "PaneChildWindows.hxx"
      52             : #include "sdresid.hxx"
      53             : #include "sdobjfac.hxx"
      54             : #include "cfgids.hxx"
      55             : #include "SpellDialogChildWindow.hxx"
      56             : #include "SlideSorterViewShell.hxx"
      57             : #include "SlideSorterViewShellBase.hxx"
      58             : #include "strmname.h"
      59             : #include "SdShapeTypes.hxx"
      60             : #include "tbx_ww.hxx"
      61             : #include "TextObjectBar.hxx"
      62             : #include "tmplctrl.hxx"
      63             : 
      64             : #include <svx/svxids.hrc>
      65             : #include <svx/bmpmask.hxx>
      66             : #include <svx/clipboardctl.hxx>
      67             : #include <svx/f3dchild.hxx>
      68             : #include <svx/fillctrl.hxx>
      69             : #include <svx/fntctl.hxx>
      70             : #include <svx/fntszctl.hxx>
      71             : #include <svx/fontwork.hxx>
      72             : #include <svx/fontworkgallery.hxx>
      73             : #include <svx/formatpaintbrushctrl.hxx>
      74             : #include <svx/ParaLineSpacingPopup.hxx>
      75             : #include <svx/grafctrl.hxx>
      76             : #include <svx/hyperdlg.hxx>
      77             : #include <svx/imapdlg.hxx>
      78             : #include <svx/layctrl.hxx>
      79             : #include <svx/lboxctrl.hxx>
      80             : #include <svx/linectrl.hxx>
      81             : #include <svx/modctrl.hxx>
      82             : #include <svx/pszctrl.hxx>
      83             : #include <svx/srchdlg.hxx>
      84             : #include <svx/subtoolboxcontrol.hxx>
      85             : #include <svx/SvxColorChildWindow.hxx>
      86             : #include <svx/SvxShapeTypes.hxx>
      87             : #include <svx/tbcontrl.hxx>
      88             : #include <svx/tbxcustomshapes.hxx>
      89             : #include <svx/verttexttbxctrl.hxx>
      90             : #include <svx/xmlsecctrl.hxx>
      91             : #include <svx/zoomctrl.hxx>
      92             : #include <svx/zoomsliderctrl.hxx>
      93             : #include <sfx2/docfilt.hxx>
      94             : #include <sfx2/docfile.hxx>
      95             : #include <sfx2/fcontnr.hxx>
      96             : #include <sfx2/sidebar/SidebarChildWindow.hxx>
      97             : #include <vcl/FilterConfigItem.hxx>
      98             : #include <comphelper/processfactory.hxx>
      99             : 
     100             : using namespace ::com::sun::star;
     101             : 
     102             : // Register all Factories
     103          21 : void SdDLL::RegisterFactorys()
     104             : {
     105          21 :     if (SvtModuleOptions().IsImpress())
     106             :     {
     107             :         ::sd::ImpressViewShellBase::RegisterFactory (
     108          21 :             ::sd::IMPRESS_FACTORY_ID);
     109             :         ::sd::SlideSorterViewShellBase::RegisterFactory (
     110          21 :             ::sd::SLIDE_SORTER_FACTORY_ID);
     111             :         ::sd::OutlineViewShellBase::RegisterFactory (
     112          21 :             ::sd::OUTLINE_FACTORY_ID);
     113             :         ::sd::PresentationViewShellBase::RegisterFactory (
     114          21 :             ::sd::PRESENTATION_FACTORY_ID);
     115             :     }
     116          21 :     if (SvtModuleOptions().IsDraw())
     117             :     {
     118          21 :         ::sd::GraphicViewShellBase::RegisterFactory (::sd::DRAW_FACTORY_ID);
     119             :     }
     120          21 : }
     121             : 
     122             : // Register all Interfaces
     123             : 
     124          21 : void SdDLL::RegisterInterfaces()
     125             : {
     126             :     // Module
     127          21 :     SfxModule* pMod = SD_MOD();
     128          21 :     SdModule::RegisterInterface(pMod);
     129             : 
     130             :     // View shell base.
     131          21 :     ::sd::ViewShellBase::RegisterInterface(pMod);
     132             : 
     133             :     // DocShells
     134          21 :     ::sd::DrawDocShell::RegisterInterface(pMod);
     135          21 :     ::sd::GraphicDocShell::RegisterInterface(pMod);
     136             : 
     137             :     // Impress ViewShells
     138          21 :     ::sd::DrawViewShell::RegisterInterface(pMod);
     139          21 :     ::sd::OutlineViewShell::RegisterInterface(pMod);
     140          21 :     ::sd::PresentationViewShell::RegisterInterface(pMod);
     141             : 
     142             :     // Draw ViewShell
     143          21 :     ::sd::GraphicViewShell::RegisterInterface(pMod);
     144             : 
     145             :     // Impress ObjectShells
     146          21 :     ::sd::BezierObjectBar::RegisterInterface(pMod);
     147          21 :     ::sd::TextObjectBar::RegisterInterface(pMod);
     148          21 :     ::sd::GraphicObjectBar::RegisterInterface(pMod);
     149             : 
     150             :     // Media ObjectShell
     151          21 :     ::sd::MediaObjectBar::RegisterInterface(pMod);
     152             : 
     153             :     // Table ObjectShell
     154          21 :     ::sd::ui::table::RegisterInterfaces(pMod);
     155             : 
     156             :     // View shells for the side panes.
     157          21 :     ::sd::slidesorter::SlideSorterViewShell::RegisterInterface (pMod);
     158          21 : }
     159             : 
     160             : // Register all Controllers
     161             : 
     162          21 : void SdDLL::RegisterControllers()
     163             : {
     164          21 :     SfxModule* pMod = SD_MOD();
     165             : 
     166             :     // ToolBoxControls registrieren
     167          21 :     SdTbxControl::RegisterControl( SID_OBJECT_ALIGN, pMod );
     168          21 :     SdTbxControl::RegisterControl( SID_ZOOM_TOOLBOX, pMod );
     169          21 :     SdTbxControl::RegisterControl( SID_OBJECT_CHOOSE_MODE, pMod );
     170          21 :     SdTbxControl::RegisterControl( SID_POSITION, pMod );
     171          21 :     SdTbxControl::RegisterControl( SID_DRAWTBX_TEXT, pMod );
     172          21 :     SdTbxControl::RegisterControl( SID_DRAWTBX_RECTANGLES, pMod );
     173          21 :     SdTbxControl::RegisterControl( SID_DRAWTBX_ELLIPSES, pMod );
     174          21 :     SdTbxControl::RegisterControl( SID_DRAWTBX_LINES, pMod );
     175          21 :     SdTbxControl::RegisterControl( SID_DRAWTBX_ARROWS, pMod );
     176          21 :     SdTbxControl::RegisterControl( SID_DRAWTBX_3D_OBJECTS, pMod );
     177          21 :     SdTbxControl::RegisterControl( SID_DRAWTBX_CONNECTORS, pMod );
     178          21 :     SdTbxControl::RegisterControl( SID_DRAWTBX_INSERT, pMod );
     179             : 
     180          21 :     SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_BASIC, pMod );
     181          21 :     SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_SYMBOL, pMod );
     182          21 :     SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_ARROW, pMod );
     183          21 :     SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_FLOWCHART, pMod );
     184          21 :     SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_CALLOUT, pMod );
     185          21 :     SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_STAR, pMod );
     186             : 
     187          21 :     SdTbxCtlDiaPages::RegisterControl( SID_PAGES_PER_ROW, pMod );
     188          21 :     SdTbxCtlGlueEscDir::RegisterControl( SID_GLUE_ESCDIR, pMod );
     189             : 
     190          21 :     ::sd::AnimationChildWindow::RegisterChildWindow(false, pMod);
     191          21 :     ::sd::NavigatorChildWindow::RegisterChildWindowContext( (sal_uInt16) ::sd::DrawViewShell::GetInterfaceId(), pMod );
     192          21 :     ::sd::NavigatorChildWindow::RegisterChildWindowContext( (sal_uInt16) ::sd::GraphicViewShell::GetInterfaceId(), pMod );
     193             : 
     194          21 :     Svx3DChildWindow::RegisterChildWindow(false, pMod);
     195          21 :     SvxFontWorkChildWindow::RegisterChildWindow(false, pMod);
     196          21 :     SvxColorChildWindow::RegisterChildWindow(false, pMod, SfxChildWindowFlags::TASK);
     197          21 :     SvxSearchDialogWrapper::RegisterChildWindow(false, pMod);
     198          21 :     SvxBmpMaskChildWindow::RegisterChildWindow(false, pMod);
     199          21 :     SvxIMapDlgChildWindow::RegisterChildWindow(false, pMod);
     200          21 :     SvxHlinkDlgWrapper::RegisterChildWindow(false, pMod);
     201          21 :     ::sd::SpellDialogChildWindow::RegisterChildWindow(false, pMod);
     202          21 :     ::avmedia::MediaPlayer::RegisterChildWindow(false, pMod);
     203          21 :     ::sd::LeftPaneImpressChildWindow::RegisterChildWindow(false, pMod);
     204          21 :     ::sd::LeftPaneDrawChildWindow::RegisterChildWindow(false, pMod);
     205          21 :     ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod);
     206             : 
     207          21 :     SvxFillToolBoxControl::RegisterControl(0, pMod);
     208          21 :     SvxLineStyleToolBoxControl::RegisterControl(0, pMod);
     209          21 :     SvxLineWidthToolBoxControl::RegisterControl(0, pMod);
     210          21 :     SvxColorToolBoxControl::RegisterControl(SID_ATTR_LINE_COLOR, pMod);
     211          21 :     SvxColorToolBoxControl::RegisterControl(SID_ATTR_FILL_COLOR, pMod);
     212             : 
     213          21 :     SvxLineEndToolBoxControl::RegisterControl( SID_ATTR_LINEEND_STYLE, pMod );
     214             : 
     215          21 :     SvxStyleToolBoxControl::RegisterControl(0, pMod);
     216          21 :     SvxFontNameToolBoxControl::RegisterControl(0, pMod);
     217          21 :     SvxColorToolBoxControl::RegisterControl( SID_ATTR_CHAR_COLOR, pMod );
     218          21 :     SvxColorToolBoxControl::RegisterControl( SID_ATTR_CHAR_BACK_COLOR, pMod );
     219             : 
     220          21 :     SvxGrafFilterToolBoxControl::RegisterControl( SID_GRFFILTER, pMod );
     221          21 :     SvxGrafModeToolBoxControl::RegisterControl( SID_ATTR_GRAF_MODE, pMod );
     222          21 :     SvxGrafRedToolBoxControl::RegisterControl( SID_ATTR_GRAF_RED, pMod );
     223          21 :     SvxGrafGreenToolBoxControl::RegisterControl( SID_ATTR_GRAF_GREEN, pMod );
     224          21 :     SvxGrafBlueToolBoxControl::RegisterControl( SID_ATTR_GRAF_BLUE, pMod );
     225          21 :     SvxGrafLuminanceToolBoxControl::RegisterControl( SID_ATTR_GRAF_LUMINANCE, pMod );
     226          21 :     SvxGrafContrastToolBoxControl::RegisterControl( SID_ATTR_GRAF_CONTRAST, pMod );
     227          21 :     SvxGrafGammaToolBoxControl::RegisterControl( SID_ATTR_GRAF_GAMMA, pMod );
     228          21 :     SvxGrafTransparenceToolBoxControl::RegisterControl( SID_ATTR_GRAF_TRANSPARENCE, pMod );
     229          21 :     SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_TOP_TO_BOTTOM, pMod);
     230          21 :     SvxVertTextTbxCtrl::RegisterControl(SID_TEXTDIRECTION_LEFT_TO_RIGHT, pMod);
     231          21 :     SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_CAPTION_VERTICAL, pMod);
     232          21 :     SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_FONTWORK_VERTICAL, pMod);
     233          21 :     SvxVertTextTbxCtrl::RegisterControl(SID_DRAW_TEXT_VERTICAL, pMod);
     234          21 :     SvxVertTextTbxCtrl::RegisterControl(SID_TEXT_FITTOSIZE_VERTICAL, pMod);
     235          21 :     SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_LEFT_TO_RIGHT, pMod);
     236          21 :     SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_RIGHT_TO_LEFT, pMod);
     237             : 
     238             :     // register StatusBarControls
     239          21 :     SvxZoomPageStatusBarControl::RegisterControl( SID_ZOOM_ENTIRE_PAGE, pMod );
     240          21 :     SvxZoomStatusBarControl::RegisterControl( SID_ATTR_ZOOM, pMod );
     241          21 :     SvxPosSizeStatusBarControl::RegisterControl( SID_ATTR_SIZE, pMod );
     242          21 :     SvxModifyControl::RegisterControl( SID_DOC_MODIFIED, pMod );
     243          21 :     SvxZoomSliderControl::RegisterControl( SID_ATTR_ZOOMSLIDER, pMod );
     244             : 
     245             :     // MenuControls for PopupMenu
     246          21 :     SvxFontMenuControl::RegisterControl( SID_ATTR_CHAR_FONT, pMod );
     247          21 :     SvxFontSizeMenuControl::RegisterControl( SID_ATTR_CHAR_FONTHEIGHT, pMod );
     248             : 
     249          21 :     SfxMenuControl::RegisterControl( SID_SET_SNAPITEM, pMod );
     250          21 :     SfxMenuControl::RegisterControl( SID_DELETE_SNAPITEM, pMod );
     251          21 :     SfxMenuControl::RegisterControl( SID_BEZIER_CLOSE, pMod );
     252             : 
     253             :     // #UndoRedo#
     254          21 :     SvxUndoRedoControl::RegisterControl( SID_UNDO , pMod );
     255          21 :     SvxUndoRedoControl::RegisterControl( SID_REDO , pMod );
     256             : 
     257          21 :     svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH, pMod );
     258             : 
     259          21 :     SvxClipBoardControl::RegisterControl( SID_PASTE, pMod );
     260          21 :     SvxClipBoardControl::RegisterControl( SID_PASTE_UNFORMATTED, pMod );
     261             : 
     262          21 :     SvxColorToolBoxControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod );
     263          21 :     svx::FontWorkShapeTypeControl::RegisterControl( SID_FONTWORK_SHAPE_TYPE, pMod );
     264          21 :     svx::ParaLineSpacingPopup::RegisterControl(SID_ATTR_PARA_LINESPACE, pMod);
     265             : 
     266          21 :     ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod );
     267          21 :     XmlSecStatusBarControl::RegisterControl( SID_SIGNATURE, pMod );
     268          21 :     SdTemplateControl::RegisterControl( SID_STATUS_LAYOUT, pMod );
     269          21 :     SvxTableToolBoxControl::RegisterControl(SID_INSERT_TABLE, pMod );
     270          21 :     SvxFrameLineStyleToolBoxControl::RegisterControl(SID_FRAME_LINESTYLE, pMod );
     271          21 :     SvxColorToolBoxControl::RegisterControl(SID_FRAME_LINECOLOR, pMod );
     272          21 :     SvxFrameToolBoxControl::RegisterControl(SID_ATTR_BORDER, pMod );
     273          21 :     SvxSubToolBoxControl::RegisterControl(SID_OPTIMIZE_TABLE, pMod);
     274          21 : }
     275             : 
     276         218 : void SdDLL::Init()
     277             : {
     278         218 :     if ( SD_MOD() )
     279         415 :         return;
     280             : 
     281          21 :     SfxObjectFactory* pDrawFact = NULL;
     282          21 :     SfxObjectFactory* pImpressFact = NULL;
     283             : 
     284          21 :     if (SvtModuleOptions().IsImpress())
     285          21 :         pImpressFact = &::sd::DrawDocShell::Factory();
     286             : 
     287          21 :     if (SvtModuleOptions().IsDraw())
     288          21 :         pDrawFact = &::sd::GraphicDocShell::Factory();
     289             : 
     290             :     // the SdModule must be created
     291          21 :      SdModule** ppShlPtr = reinterpret_cast<SdModule**>(GetAppData(SHL_DRAW));
     292             : 
     293             :      // #i46427#
     294             :      // The SfxModule::SfxModule stops when the first given factory
     295             :      // is 0, so we must not give a 0 as first factory
     296          21 :      if( pImpressFact )
     297             :      {
     298          21 :         (*ppShlPtr) = new SdModule( pImpressFact, pDrawFact );
     299             :      }
     300             :      else
     301             :      {
     302           0 :         (*ppShlPtr) = new SdModule( pDrawFact, pImpressFact );
     303             :      }
     304             : 
     305          21 :     if (SvtModuleOptions().IsImpress())
     306             :     {
     307             :         // Register the Impress shape types in order to make the shapes accessible.
     308          21 :         ::accessibility::RegisterImpressShapeTypes ();
     309          21 :         ::sd::DrawDocShell::Factory().SetDocumentServiceName( "com.sun.star.presentation.PresentationDocument" );
     310             :     }
     311             : 
     312          21 :     if (SvtModuleOptions().IsDraw())
     313             :     {
     314          21 :         ::sd::GraphicDocShell::Factory().SetDocumentServiceName( "com.sun.star.drawing.DrawingDocument" );
     315             :     }
     316             : 
     317             :     // register your view-factories here
     318          21 :     RegisterFactorys();
     319             : 
     320             :     // register your shell-interfaces here
     321          21 :     RegisterInterfaces();
     322             : 
     323             :     // register your controllers here
     324          21 :     RegisterControllers();
     325             : 
     326             :     // register SvDraw-Fields
     327          21 :     SdrRegisterFieldClasses();
     328             : 
     329             :     // register 3D-Objekt-Factory
     330          21 :     E3dObjFactory();
     331             : 
     332             :     // register ::com::sun::star::form::component::Form-Object-Factory
     333          21 :     FmFormObjFactory();
     334             : 
     335             :     // register Object-Factory
     336          21 :     SdrObjFactory::InsertMakeUserDataHdl(LINK(&aSdObjectFactory, SdObjectFactory, MakeUserData));
     337             : 
     338             :     // register your exotic remote controls here
     339             : #ifdef ENABLE_SDREMOTE
     340          21 :     if ( !Application::IsHeadlessModeEnabled() )
     341           2 :         RegisterRemotes();
     342             : #endif
     343          66 : }
     344             : 
     345             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11