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 .
20 #ifndef INCLUDED_SC_INC_TARGUNO_HXX
21 #define INCLUDED_SC_INC_TARGUNO_HXX
23 #include <svl/lstner.hxx>
24 #include <com/sun/star/document/XLinkTargetSupplier.hpp>
25 #include <com/sun/star/lang/XServiceName.hpp>
26 #include <com/sun/star/lang/XServiceInfo.hpp>
27 #include <com/sun/star/beans/PropertyValues.hpp>
28 #include <com/sun/star/beans/XPropertySet.hpp>
29 #include <com/sun/star/beans/PropertyValue.hpp>
30 #include <com/sun/star/beans/PropertyState.hpp>
31 #include <com/sun/star/beans/XPropertySetInfo.hpp>
32 #include <com/sun/star/beans/XMultiPropertySet.hpp>
33 #include <com/sun/star/beans/XFastPropertySet.hpp>
34 #include <com/sun/star/beans/XVetoableChangeListener.hpp>
35 #include <com/sun/star/beans/XPropertyState.hpp>
36 #include <com/sun/star/beans/XPropertyStateChangeListener.hpp>
37 #include <com/sun/star/beans/PropertyAttribute.hpp>
38 #include <com/sun/star/beans/XPropertiesChangeListener.hpp>
39 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
40 #include <com/sun/star/beans/XPropertyAccess.hpp>
41 #include <com/sun/star/beans/XPropertyContainer.hpp>
42 #include <com/sun/star/beans/PropertyStateChangeEvent.hpp>
43 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
44 #include <com/sun/star/container/XEnumerationAccess.hpp>
45 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
46 #include <com/sun/star/container/XNameAccess.hpp>
47 #include <com/sun/star/container/XContentEnumerationAccess.hpp>
48 #include <com/sun/star/container/XEnumeration.hpp>
49 #include <com/sun/star/container/XElementAccess.hpp>
50 #include <com/sun/star/container/XIndexAccess.hpp>
51 #include <cppuhelper/implbase.hxx>
55 #define SC_LINKTARGETTYPE_SHEET 0
56 #define SC_LINKTARGETTYPE_RANGENAME 1
57 #define SC_LINKTARGETTYPE_DBAREA 2
59 #define SC_LINKTARGETTYPE_COUNT 3
61 #define SCLINKTARGET_SERVICE "com.sun.star.document.LinkTarget"
63 //! Graphic / OleObject (need separate collections!)
65 class ScLinkTargetTypesObj
: public ::cppu::WeakImplHelper
<
66 css::container::XNameAccess
,
67 css::lang::XServiceInfo
>,
71 ScDocShell
* pDocShell
;
72 OUString aNames
[SC_LINKTARGETTYPE_COUNT
];
75 ScLinkTargetTypesObj(ScDocShell
* pDocSh
);
76 virtual ~ScLinkTargetTypesObj() override
;
78 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
80 // css::container::XNameAccess
81 virtual css::uno::Any SAL_CALL
getByName(const OUString
& aName
) override
;
82 virtual css::uno::Sequence
< OUString
> SAL_CALL
getElementNames() override
;
83 virtual sal_Bool SAL_CALL
hasByName(const OUString
& aName
) override
;
85 // css::container::XElementAccess
86 virtual css::uno::Type SAL_CALL
getElementType() override
;
87 virtual sal_Bool SAL_CALL
hasElements() override
;
89 // css::lang::XServiceInfo
90 virtual OUString SAL_CALL
getImplementationName() override
;
91 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
92 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
95 class ScLinkTargetTypeObj
: public ::cppu::WeakImplHelper
<
96 css::beans::XPropertySet
,
97 css::document::XLinkTargetSupplier
,
98 css::lang::XServiceInfo
>,
102 ScDocShell
* pDocShell
;
107 ScLinkTargetTypeObj(ScDocShell
* pDocSh
, sal_uInt16 nT
);
108 virtual ~ScLinkTargetTypeObj() override
;
110 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
112 static void SetLinkTargetBitmap( css::uno::Any
& rRet
, sal_uInt16 nType
);
114 // css::beans::XPropertySet
115 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo() override
;
116 virtual void SAL_CALL
setPropertyValue(const OUString
& aPropertyName
,
117 const css::uno::Any
& aValue
) override
;
118 virtual css::uno::Any SAL_CALL
getPropertyValue(const OUString
& PropertyName
) override
;
119 virtual void SAL_CALL
addPropertyChangeListener(const OUString
& aPropertyName
,
120 const css::uno::Reference
< css::beans::XPropertyChangeListener
> & xListener
) override
;
121 virtual void SAL_CALL
removePropertyChangeListener(const OUString
& aPropertyName
,
122 const css::uno::Reference
< css::beans::XPropertyChangeListener
> & aListener
) override
;
123 virtual void SAL_CALL
addVetoableChangeListener(const OUString
& PropertyName
,
124 const css::uno::Reference
< css::beans::XVetoableChangeListener
> & aListener
) override
;
125 virtual void SAL_CALL
removeVetoableChangeListener(const OUString
& PropertyName
,
126 const css::uno::Reference
< css::beans::XVetoableChangeListener
> & aListener
) override
;
128 // css::document::XLinkTargetSupplier
129 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
getLinks() override
;
131 // css::lang::XServiceInfo
132 virtual OUString SAL_CALL
getImplementationName() override
;
133 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
134 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
137 class ScLinkTargetsObj
: public ::cppu::WeakImplHelper
<
138 css::container::XNameAccess
,
139 css::lang::XServiceInfo
>
142 css::uno::Reference
< css::container::XNameAccess
> xCollection
;
145 ScLinkTargetsObj( const css::uno::Reference
< css::container::XNameAccess
> & rColl
);
146 virtual ~ScLinkTargetsObj() override
;
148 // css::container::XNameAccess
149 virtual css::uno::Any SAL_CALL
getByName(const OUString
& aName
) override
;
150 virtual css::uno::Sequence
< OUString
> SAL_CALL
getElementNames() override
;
151 virtual sal_Bool SAL_CALL
hasByName(const OUString
& aName
) override
;
153 // css::container::XElementAccess
154 virtual css::uno::Type SAL_CALL
getElementType() override
;
155 virtual sal_Bool SAL_CALL
hasElements() override
;
157 // css::lang::XServiceInfo
158 virtual OUString SAL_CALL
getImplementationName() override
;
159 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
160 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
165 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */