LibreOffice Module dtrans (master)  1
clipboardmanager.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_DTRANS_SOURCE_GENERIC_CLIPBOARDMANAGER_HXX
21 #define INCLUDED_DTRANS_SOURCE_GENERIC_CLIPBOARDMANAGER_HXX
22 
23 #include <cppuhelper/compbase.hxx>
24 
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>
28 
29 #include <map>
30 
31 #define CLIPBOARDMANAGER_IMPLEMENTATION_NAME "com.sun.star.comp.datatransfer.ClipboardManager"
32 
33 typedef std::map< OUString, css::uno::Reference< css::datatransfer::clipboard::XClipboard > > ClipboardMap;
34 
35 namespace dtrans
36 {
37 
38  class ClipboardManager : public ::cppu::WeakComponentImplHelper <
39  css::datatransfer::clipboard::XClipboardManager,
40  css::lang::XEventListener,
41  css::lang::XServiceInfo >
42  {
44  ::osl::Mutex m_aMutex;
45 
46  const OUString m_aDefaultName;
47 
48  virtual ~ClipboardManager() override;
49  protected:
50  using WeakComponentImplHelperBase::disposing;
51  public:
52 
54 
55  /*
56  * XServiceInfo
57  */
58 
59  virtual OUString SAL_CALL getImplementationName( ) override;
60 
61  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
62 
63  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
64 
65  /*
66  * XComponent
67  */
68 
69  virtual void SAL_CALL dispose() override;
70 
71  /*
72  * XEventListener
73  */
74 
75  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
76 
77  /*
78  * XClipboardManager
79  */
80 
81  virtual css::uno::Reference< css::datatransfer::clipboard::XClipboard > SAL_CALL getClipboard( const OUString& aName ) override;
82 
83  virtual void SAL_CALL addClipboard( const css::uno::Reference< css::datatransfer::clipboard::XClipboard >& xClipboard ) override;
84 
85  virtual void SAL_CALL removeClipboard( const OUString& aName ) override;
86 
87  virtual css::uno::Sequence< OUString > SAL_CALL listClipboardNames( ) override;
88 
89  };
90 
91 }
92 
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);
96 
97 #endif
98 
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual ~ClipboardManager() override
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
css::uno::Reference< css::uno::XInterface > ClipboardManager_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > &xMultiServiceFactory)
std::map< OUString, css::uno::Reference< css::datatransfer::clipboard::XClipboard > > ClipboardMap
css::uno::Sequence< OUString > ClipboardManager_getSupportedServiceNames()
unsigned char sal_Bool
virtual void SAL_CALL removeClipboard(const OUString &aName) override
virtual void SAL_CALL addClipboard(const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &xClipboard) override
virtual css::uno::Sequence< OUString > SAL_CALL listClipboardNames() override
virtual void SAL_CALL dispose() override
virtual css::uno::Reference< css::datatransfer::clipboard::XClipboard > SAL_CALL getClipboard(const OUString &aName) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override