LibreOffice Module oox (master) 1
modelobjecthelper.hxx
Go to the documentation of this file.
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#ifndef INCLUDED_OOX_HELPER_MODELOBJECTHELPER_HXX
21#define INCLUDED_OOX_HELPER_MODELOBJECTHELPER_HXX
22
23#include <com/sun/star/uno/Any.hxx>
24#include <com/sun/star/uno/Reference.hxx>
25#include <oox/dllapi.h>
26#include <rtl/ustring.hxx>
27#include <sal/types.h>
28
29namespace com::sun::star {
30 namespace awt { struct Gradient;
31 class XBitmap; }
32 namespace graphic { class XGraphic; }
33 namespace container { class XNameContainer; }
34 namespace drawing { struct LineDash; }
35 namespace drawing { struct Hatch; }
36 namespace drawing { struct PolyPolygonBezierCoords; }
37 namespace lang { class XMultiServiceFactory; }
38}
39
40namespace oox {
41
42
46{
47public:
48 explicit ObjectContainer(
49 const css::uno::Reference< css::lang::XMultiServiceFactory >& rxModelFactory,
50 OUString aServiceName );
52
54 bool hasObject( const OUString& rObjName ) const;
55
56 css::uno::Any getObject( const OUString& rObjName ) const;
57
59 OUString insertObject(
60 const OUString& rObjName,
61 const css::uno::Any& rObj,
62 bool bInsertByUnusedName );
63
64private:
65 void createContainer() const;
66
67private:
68 mutable css::uno::Reference< css::lang::XMultiServiceFactory >
70 mutable css::uno::Reference< css::container::XNameContainer >
72 OUString maServiceName;
73 sal_Int32 mnIndex;
74};
75
76
85{
86public:
87 explicit ModelObjectHelper(
88 const css::uno::Reference< css::lang::XMultiServiceFactory >& rxModelFactory );
89
91 bool hasLineMarker( const OUString& rMarkerName ) const;
92
95 bool insertLineMarker(
96 const OUString& rMarkerName,
97 const css::drawing::PolyPolygonBezierCoords& rMarker );
98
101 OUString insertLineDash( const css::drawing::LineDash& rDash );
102
105 OUString insertFillGradient( const css::awt::Gradient& rGradient );
106
107 OUString insertTransGrandient( const css::awt::Gradient& rGradient );
108
109 OUString insertFillHatch( const css::drawing::Hatch& rHatch );
110
113 OUString insertFillBitmapXGraphic(css::uno::Reference<css::graphic::XGraphic> const & rxGraphic);
114
115 css::uno::Reference<css::awt::XBitmap> getFillBitmap(OUString const & rGraphicName);
116
117private:
124};
125
126
127} // namespace oox
128
129#endif
130
131/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Contains tables for named drawing objects for a document model.
ObjectContainer maBitmapUrlContainer
Contains all named fill bitmap URLs.
ObjectContainer maHatchContainer
Contains all named fill hatches.
ObjectContainer maMarkerContainer
Contains all named line markers (line end polygons).
ObjectContainer maDashContainer
Contains all named line dashes.
ObjectContainer maTransGradContainer
Contains all named transparency Gradients.
ObjectContainer maGradientContainer
Contains all named fill gradients.
This helper manages named objects in a container, which is created on demand.
OUString maServiceName
Service name to create the container.
css::uno::Reference< css::lang::XMultiServiceFactory > mxModelFactory
Factory to create the container.
css::uno::Reference< css::container::XNameContainer > mxContainer
Container for the objects.
sal_Int32 mnIndex
Index to create unique identifiers.
#define OOX_DLLPUBLIC
Definition: dllapi.h:28
@ LineDash
Explicit line dash or name of a line dash stored in a global container.