bump product version to 4.1.6.2
[LibreOffice.git] / sd / source / ui / unoidl / unocpres.hxx
blob84f102f8a2c312137bcaea2d36224842d861b884
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 .
19 #ifndef _SD_UNOCPRES_HXX
20 #define _SD_UNOCPRES_HXX
22 #include <com/sun/star/lang/XComponent.hpp>
23 #include <com/sun/star/container/XIndexContainer.hpp>
24 #include <com/sun/star/container/XNamed.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <com/sun/star/lang/XUnoTunnel.hpp>
27 #include <cppuhelper/interfacecontainer.h>
28 #include <osl/mutex.hxx>
30 #include <cppuhelper/implbase5.hxx>
31 #include <comphelper/servicehelper.hxx>
33 ///////////////////////////////////////////////////////////////////////////////
35 class SdXImpressDocument;
36 class SdCustomShow;
38 class SdXCustomPresentation : public ::cppu::WeakImplHelper5< ::com::sun::star::container::XIndexContainer,
39 ::com::sun::star::container::XNamed,
40 ::com::sun::star::lang::XUnoTunnel,
41 ::com::sun::star::lang::XComponent,
42 ::com::sun::star::lang::XServiceInfo >
44 private:
45 SdCustomShow* mpSdCustomShow;
46 SdXImpressDocument* mpModel;
48 // for xComponent
49 ::osl::Mutex aDisposeContainerMutex;
50 ::cppu::OInterfaceContainerHelper aDisposeListeners;
51 sal_Bool bDisposing;
53 public:
54 SdXCustomPresentation() throw();
55 SdXCustomPresentation( SdCustomShow* mpSdCustomShow, SdXImpressDocument* pMyModel) throw();
56 virtual ~SdXCustomPresentation() throw();
58 // internal
59 void Invalidate() { mpSdCustomShow = NULL; }
60 SdCustomShow* GetSdCustomShow() const throw() { return mpSdCustomShow; }
61 void SetSdCustomShow( SdCustomShow* pShow ) throw() { mpSdCustomShow = pShow; }
62 SdXImpressDocument* GetModel() const throw() { return mpModel; }
64 // uno helper
65 UNO3_GETIMPLEMENTATION_DECL(SdXCustomPresentation)
67 // XServiceInfo
68 virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
69 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
70 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
72 // XIndexContainer
73 virtual void SAL_CALL insertByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
74 virtual void SAL_CALL removeByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
76 // XIndexReplace
77 virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
79 // XElementAccess
80 virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException);
81 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
83 // XIndexAccess
84 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException) ;
85 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
87 // XNamed
88 virtual OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
89 virtual void SAL_CALL setName( const OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
91 // XComponent
92 virtual void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
93 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
94 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
97 // --------------------------------------------------------------------------
98 #include <com/sun/star/container/XNameContainer.hpp>
99 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
101 #include <cppuhelper/implbase3.hxx>
103 #include "unomodel.hxx"
104 #include "drawdoc.hxx"
106 class List;
108 class SdXCustomPresentationAccess : public ::cppu::WeakImplHelper3< ::com::sun::star::container::XNameContainer,
109 ::com::sun::star::lang::XSingleServiceFactory,
110 ::com::sun::star::lang::XServiceInfo >
112 private:
113 SdXImpressDocument& mrModel;
115 // intern
116 inline SdCustomShowList* GetCustomShowList() const throw();
117 SdCustomShow * getSdCustomShow( const OUString& Name ) const throw();
119 public:
120 SdXCustomPresentationAccess(SdXImpressDocument& rMyModel) throw();
121 ~SdXCustomPresentationAccess() throw();
123 // XServiceInfo
124 virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
125 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
126 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
128 // XSingleServiceFactory
129 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
130 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
132 // XNameContainer
133 virtual void SAL_CALL insertByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
134 virtual void SAL_CALL removeByName( const OUString& Name ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
136 // XNameReplace
137 virtual void SAL_CALL replaceByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
139 // XNameAccess
140 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
141 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames() throw(::com::sun::star::uno::RuntimeException);
142 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
144 // XElementAccess
145 virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException);
146 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
149 inline SdCustomShowList* SdXCustomPresentationAccess::GetCustomShowList() const throw()
151 if(mrModel.GetDoc())
152 return mrModel.GetDoc()->GetCustomShowList(sal_False);
153 else
154 return NULL;
157 #endif
160 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */