1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
19 #include "dlgedfac.hxx"
20 #include "uistrings.hrc"
21 #include "RptObject.hxx"
23 #include <com/sun/star/container/XNameContainer.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/beans/PropertyValue.hpp>
26 #include <com/sun/star/beans/XPropertySet.hpp>
27 #include <com/sun/star/awt/ScrollBarOrientation.hpp>
28 #include <svx/svdoole2.hxx>
31 using namespace ::com::sun::star
;
35 DlgEdFactory::DlgEdFactory()
37 SdrObjFactory::InsertMakeObjectHdl( LINK(this, DlgEdFactory
, MakeObject
) );
42 DlgEdFactory::~DlgEdFactory()
44 SdrObjFactory::RemoveMakeObjectHdl( LINK(this, DlgEdFactory
, MakeObject
) );
50 DlgEdFactory
, MakeObject
, SdrObjFactory
*, pObjFactory
)
52 if ( pObjFactory
->nInventor
== ReportInventor
)
54 switch( pObjFactory
->nIdentifier
)
56 case OBJ_DLG_FIXEDTEXT
:
57 pObjFactory
->pNewObj
= new OUnoObject( SERVICE_FIXEDTEXT
58 ,OUString("com.sun.star.form.component.FixedText")
61 case OBJ_DLG_IMAGECONTROL
:
62 pObjFactory
->pNewObj
= new OUnoObject( SERVICE_IMAGECONTROL
63 ,OUString("com.sun.star.form.component.DatabaseImageControl")
64 ,OBJ_DLG_IMAGECONTROL
);
66 case OBJ_DLG_FORMATTEDFIELD
:
67 pObjFactory
->pNewObj
= new OUnoObject( SERVICE_FORMATTEDFIELD
68 ,OUString("com.sun.star.form.component.FormattedField")
69 ,OBJ_DLG_FORMATTEDFIELD
);
71 case OBJ_DLG_VFIXEDLINE
:
72 case OBJ_DLG_HFIXEDLINE
:
74 OUnoObject
* pObj
= new OUnoObject( SERVICE_FIXEDLINE
75 ,OUString("com.sun.star.awt.UnoControlFixedLineModel")
76 ,pObjFactory
->nIdentifier
);
77 pObjFactory
->pNewObj
= pObj
;
78 if ( pObjFactory
->nIdentifier
== OBJ_DLG_HFIXEDLINE
)
80 uno::Reference
<beans::XPropertySet
> xProp
= pObj
->getAwtComponent();
81 xProp
->setPropertyValue( PROPERTY_ORIENTATION
, uno::makeAny(sal_Int32(0)) );
86 pObjFactory
->pNewObj
= new OCustomShape(SERVICE_SHAPE
);
88 case OBJ_DLG_SUBREPORT
:
89 pObjFactory
->pNewObj
= new OOle2Obj(SERVICE_REPORTDEFINITION
,OBJ_DLG_SUBREPORT
);
92 pObjFactory
->pNewObj
= new OOle2Obj(OUString("com.sun.star.chart2.ChartDocument"),OBJ_OLE2
);
95 OSL_FAIL("Unknown object id");
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */