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 _DTRANS_CLIPBOARDMANAGER_HXX_
21 #define _DTRANS_CLIPBOARDMANAGER_HXX_
23 #include <cppuhelper/compbase3.hxx>
25 #include <com/sun/star/datatransfer/clipboard/XClipboardManager.hpp>
26 #include <com/sun/star/lang/XServiceInfo.hpp>
30 // ------------------------------------------------------------------------
32 #define CLIPBOARDMANAGER_IMPLEMENTATION_NAME "com.sun.star.comp.datatransfer.ClipboardManager"
34 // ------------------------------------------------------------------------
36 typedef ::std::map
< OUString
, ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboard
> > ClipboardMap
;
38 // ------------------------------------------------------------------------
43 class ClipboardManager
: public ::cppu::WeakComponentImplHelper3
<
44 ::com::sun::star::datatransfer::clipboard::XClipboardManager
,
45 ::com::sun::star::lang::XEventListener
,
46 ::com::sun::star::lang::XServiceInfo
>
48 ClipboardMap m_aClipboardMap
;
49 ::osl::Mutex m_aMutex
;
51 const OUString m_aDefaultName
;
53 virtual ~ClipboardManager();
55 using WeakComponentImplHelperBase::disposing
;
64 virtual OUString SAL_CALL
getImplementationName( )
65 throw(::com::sun::star::uno::RuntimeException
);
67 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
)
68 throw(::com::sun::star::uno::RuntimeException
);
70 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( )
71 throw(::com::sun::star::uno::RuntimeException
);
77 virtual void SAL_CALL
dispose()
78 throw(::com::sun::star::uno::RuntimeException
);
84 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
)
85 throw(::com::sun::star::uno::RuntimeException
);
91 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboard
> SAL_CALL
getClipboard( const OUString
& aName
)
92 throw(::com::sun::star::container::NoSuchElementException
,
93 ::com::sun::star::uno::RuntimeException
);
95 virtual void SAL_CALL
addClipboard( const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboard
>& xClipboard
)
96 throw(::com::sun::star::lang::IllegalArgumentException
,
97 ::com::sun::star::container::ElementExistException
,
98 ::com::sun::star::uno::RuntimeException
);
100 virtual void SAL_CALL
removeClipboard( const OUString
& aName
)
101 throw(::com::sun::star::uno::RuntimeException
);
103 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
listClipboardNames( )
104 throw(::com::sun::star::uno::RuntimeException
);
111 // ------------------------------------------------------------------------
113 ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
ClipboardManager_getSupportedServiceNames();
114 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
ClipboardManager_createInstance(
115 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> & xMultiServiceFactory
);
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */