fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / svx / source / engine3d / objfac3d.cxx
blob4eb26d7f7d8cbdec35eb27c47c864704bac2f1ea
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 <svx/svdpage.hxx>
21 #include "svx/globl3d.hxx"
22 #include <svx/polysc3d.hxx>
23 #include <svx/cube3d.hxx>
24 #include <svx/sphere3d.hxx>
25 #include <svx/extrud3d.hxx>
26 #include <svx/lathe3d.hxx>
27 #include <svx/polygn3d.hxx>
28 #include "svx/objfac3d.hxx"
29 #include <svx/svdobj.hxx>
31 static bool bInit = false;
33 E3dObjFactory::E3dObjFactory()
35 if ( !bInit )
37 SdrObjFactory::InsertMakeObjectHdl(LINK(this, E3dObjFactory, MakeObject));
38 bInit = true;
42 E3dObjFactory::~E3dObjFactory()
46 // Generate chart internal objects
48 IMPL_LINK( E3dObjFactory, MakeObject, SdrObjFactory*, pObjFactory)
50 if ( pObjFactory->nInventor == E3dInventor )
52 switch ( pObjFactory->nIdentifier )
54 case E3D_POLYSCENE_ID:
55 pObjFactory->pNewObj = new E3dPolyScene();
56 break;
57 case E3D_POLYGONOBJ_ID :
58 pObjFactory->pNewObj = new E3dPolygonObj();
59 break;
60 case E3D_CUBEOBJ_ID :
61 pObjFactory->pNewObj = new E3dCubeObj();
62 break;
63 case E3D_SPHEREOBJ_ID:
64 // Gets the dummy constructor, as this is only called when
65 // loading documents. The actual number of segments is however
66 // determined only after loading the members. This will result
67 // in that the first sphere will be immediately destroyed,
68 // although it was never used.
69 pObjFactory->pNewObj = new E3dSphereObj(123);
70 break;
71 case E3D_EXTRUDEOBJ_ID:
72 pObjFactory->pNewObj = new E3dExtrudeObj();
73 break;
74 case E3D_LATHEOBJ_ID:
75 pObjFactory->pNewObj = new E3dLatheObj();
76 break;
77 case E3D_COMPOUNDOBJ_ID:
78 pObjFactory->pNewObj = new E3dCompoundObject();
79 break;
82 return 0;
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */