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 struct Gradient2;
32 class XBitmap; }
33 namespace graphic { class XGraphic; }
34 namespace container { class XNameContainer; }
35 namespace drawing { struct LineDash; }
36 namespace drawing { struct Hatch; }
37 namespace drawing { struct PolyPolygonBezierCoords; }
38 namespace lang { class XMultiServiceFactory; }
39}
40
41namespace oox {
42
43
47{
48public:
49 explicit ObjectContainer(
50 const css::uno::Reference< css::lang::XMultiServiceFactory >& rxModelFactory,
51 OUString aServiceName );
53
55 bool hasObject( const OUString& rObjName ) const;
56
57 css::uno::Any getObject( const OUString& rObjName ) const;
58
60 OUString insertObject(
61 const OUString& rObjName,
62 const css::uno::Any& rObj,
63 bool bInsertByUnusedName );
64
65private:
66 void createContainer() const;
67
68private:
69 mutable css::uno::Reference< css::lang::XMultiServiceFactory >
71 mutable css::uno::Reference< css::container::XNameContainer >
73 OUString maServiceName;
74 sal_Int32 mnIndex;
75};
76
77
86{
87public:
88 explicit ModelObjectHelper(
89 const css::uno::Reference< css::lang::XMultiServiceFactory >& rxModelFactory );
90
92 bool hasLineMarker( const OUString& rMarkerName ) const;
93
96 bool insertLineMarker(
97 const OUString& rMarkerName,
98 const css::drawing::PolyPolygonBezierCoords& rMarker );
99
102 OUString insertLineDash( const css::drawing::LineDash& rDash );
103
106 OUString insertFillGradient( const css::awt::Gradient2& rGradient );
107 OUString insertFillGradient( const css::awt::Gradient& rGradient );
108
109 OUString insertTransGrandient( const css::awt::Gradient2& rGradient );
110 OUString insertTransGrandient( const css::awt::Gradient& rGradient );
111
112 OUString insertFillHatch( const css::drawing::Hatch& rHatch );
113
116 OUString insertFillBitmapXGraphic(css::uno::Reference<css::graphic::XGraphic> const & rxGraphic);
117
118 css::uno::Reference<css::awt::XBitmap> getFillBitmap(OUString const & rGraphicName);
119
120private:
127};
128
129
130} // namespace oox
131
132#endif
133
134/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Contains tables for named drawing objects for a document model.
OUString insertTransGrandient(const css::awt::Gradient2 &rGradient)
ObjectContainer maBitmapUrlContainer
Contains all named fill bitmap URLs.
OUString insertFillGradient(const css::awt::Gradient &rGradient)
OUString insertTransGrandient(const css::awt::Gradient &rGradient)
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.
OUString insertFillGradient(const css::awt::Gradient2 &rGradient)
Inserts a new named fill gradient, returns the gradient name, based on an internal constant name with...
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.