Adjust includes
[LibreOffice.git] / svx / source / unodraw / unodtabl.cxx
blob0fa393fc2ee633a09c217ddeeb9702529ed15842
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 <com/sun/star/drawing/LineDash.hpp>
21 #include <svl/itempool.hxx>
22 #include <svl/itemset.hxx>
24 #include <vector>
25 #include "UnoNameItemTable.hxx"
26 #include <svx/xlndsit.hxx>
27 #include <svx/unomid.hxx>
29 #include <svx/xdash.hxx>
30 #include <svx/svdmodel.hxx>
31 #include <svx/unofill.hxx>
33 using namespace ::com::sun::star;
34 using namespace ::cppu;
36 class SvxUnoDashTable : public SvxUnoNameItemTable
38 public:
39 explicit SvxUnoDashTable( SdrModel* pModel ) throw();
41 virtual NameOrIndex* createItem() const throw() override;
43 // XServiceInfo
44 virtual OUString SAL_CALL getImplementationName( ) override;
45 virtual uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
47 // XElementAccess
48 virtual uno::Type SAL_CALL getElementType( ) override;
51 SvxUnoDashTable::SvxUnoDashTable( SdrModel* pModel ) throw()
52 : SvxUnoNameItemTable( pModel, XATTR_LINEDASH, MID_LINEDASH )
56 OUString SAL_CALL SvxUnoDashTable::getImplementationName()
58 return OUString("SvxUnoDashTable");
61 uno::Sequence< OUString > SAL_CALL SvxUnoDashTable::getSupportedServiceNames( )
63 uno::Sequence<OUString> aSNS { "com.sun.star.drawing.DashTable" };
64 return aSNS;
67 NameOrIndex* SvxUnoDashTable::createItem() const throw()
69 XLineDashItem* pNewItem = new XLineDashItem();
70 pNewItem->SetWhich( XATTR_LINEDASH ); // set which id for pooling
71 return pNewItem;
74 // XElementAccess
75 uno::Type SAL_CALL SvxUnoDashTable::getElementType( )
77 return cppu::UnoType<drawing::LineDash>::get();
80 /**
81 * Create a gradienttable
83 uno::Reference< uno::XInterface > SvxUnoDashTable_createInstance( SdrModel* pModel )
85 return *new SvxUnoDashTable(pModel);
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */