Update ooo320-m1
[ooovba.git] / dtrans / source / generic / clipboardmanager.hxx
blob019a02f35a7f3040c0387a6395fdada9888b3e41
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: clipboardmanager.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _DTRANS_CLIPBOARDMANAGER_HXX_
32 #define _DTRANS_CLIPBOARDMANAGER_HXX_
34 #include <cppuhelper/compbase3.hxx>
36 #ifndef _COM_SUN_STAR_DATATRANSFER_CLIPBAORD_XCLIPBOARDMANAGER_HPP_
37 #include <com/sun/star/datatransfer/clipboard/XClipboardManager.hpp>
38 #endif
39 #include <com/sun/star/lang/XServiceInfo.hpp>
41 #include <map>
43 // ------------------------------------------------------------------------
45 #define CLIPBOARDMANAGER_IMPLEMENTATION_NAME "com.sun.star.comp.datatransfer.ClipboardManager"
47 // ------------------------------------------------------------------------
49 typedef ::std::map< ::rtl::OUString, ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > > ClipboardMap;
51 // ------------------------------------------------------------------------
53 namespace dtrans
56 class ClipboardManager : public ::cppu::WeakComponentImplHelper3 < \
57 ::com::sun::star::datatransfer::clipboard::XClipboardManager, \
58 ::com::sun::star::lang::XEventListener, \
59 ::com::sun::star::lang::XServiceInfo >
61 ClipboardMap m_aClipboardMap;
62 ::osl::Mutex m_aMutex;
64 const ::rtl::OUString m_aDefaultName;
66 virtual ~ClipboardManager();
67 protected:
68 using WeakComponentImplHelperBase::disposing;
69 public:
71 ClipboardManager();
74 * XServiceInfo
77 virtual ::rtl::OUString SAL_CALL getImplementationName( )
78 throw(::com::sun::star::uno::RuntimeException);
80 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
81 throw(::com::sun::star::uno::RuntimeException);
83 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
84 throw(::com::sun::star::uno::RuntimeException);
87 * XComponent
90 virtual void SAL_CALL dispose()
91 throw(::com::sun::star::uno::RuntimeException);
94 * XEventListener
97 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
98 throw(::com::sun::star::uno::RuntimeException);
101 * XClipboardManager
104 virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > SAL_CALL getClipboard( const ::rtl::OUString& aName )
105 throw(::com::sun::star::container::NoSuchElementException,
106 ::com::sun::star::uno::RuntimeException);
108 virtual void SAL_CALL addClipboard( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& xClipboard )
109 throw(::com::sun::star::lang::IllegalArgumentException,
110 ::com::sun::star::container::ElementExistException,
111 ::com::sun::star::uno::RuntimeException);
113 virtual void SAL_CALL removeClipboard( const ::rtl::OUString& aName )
114 throw(::com::sun::star::uno::RuntimeException);
116 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL listClipboardNames( )
117 throw(::com::sun::star::uno::RuntimeException);
124 // ------------------------------------------------------------------------
126 ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL ClipboardManager_getSupportedServiceNames();
127 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ClipboardManager_createInstance(
128 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMultiServiceFactory);
130 #endif