Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / dtrans / source / generic / clipboardmanager.hxx
blobe3217f6bf6bb3dcffeab99ddef43005b9ec14a76
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 .
20 #ifndef INCLUDED_DTRANS_SOURCE_GENERIC_CLIPBOARDMANAGER_HXX
21 #define INCLUDED_DTRANS_SOURCE_GENERIC_CLIPBOARDMANAGER_HXX
23 #include <cppuhelper/compbase.hxx>
25 #include <com/sun/star/datatransfer/clipboard/XClipboardManager.hpp>
26 #include <com/sun/star/lang/XServiceInfo.hpp>
27 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
29 #include <map>
31 #define CLIPBOARDMANAGER_IMPLEMENTATION_NAME "com.sun.star.comp.datatransfer.ClipboardManager"
33 typedef std::map< OUString, css::uno::Reference< css::datatransfer::clipboard::XClipboard > > ClipboardMap;
35 namespace dtrans
38 class ClipboardManager : public ::cppu::WeakComponentImplHelper <
39 css::datatransfer::clipboard::XClipboardManager,
40 css::lang::XEventListener,
41 css::lang::XServiceInfo >
43 ClipboardMap m_aClipboardMap;
44 ::osl::Mutex m_aMutex;
46 const OUString m_aDefaultName;
48 virtual ~ClipboardManager() override;
49 protected:
50 using WeakComponentImplHelperBase::disposing;
51 public:
53 ClipboardManager();
56 * XServiceInfo
59 virtual OUString SAL_CALL getImplementationName( ) override;
61 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
63 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
66 * XComponent
69 virtual void SAL_CALL dispose() override;
72 * XEventListener
75 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
78 * XClipboardManager
81 virtual css::uno::Reference< css::datatransfer::clipboard::XClipboard > SAL_CALL getClipboard( const OUString& aName ) override;
83 virtual void SAL_CALL addClipboard( const css::uno::Reference< css::datatransfer::clipboard::XClipboard >& xClipboard ) override;
85 virtual void SAL_CALL removeClipboard( const OUString& aName ) override;
87 virtual css::uno::Sequence< OUString > SAL_CALL listClipboardNames( ) override;
93 css::uno::Sequence< OUString > ClipboardManager_getSupportedServiceNames();
94 css::uno::Reference< css::uno::XInterface > ClipboardManager_createInstance(
95 const css::uno::Reference< css::lang::XMultiServiceFactory > & xMultiServiceFactory);
97 #endif
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */