1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: generic_clipboard.hxx,v $
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_GENERIC_CLIPBOARD_HXX_
32 #define _DTRANS_GENERIC_CLIPBOARD_HXX_
34 #include <cppuhelper/compbase4.hxx>
36 #ifndef _COM_SUN_STAR_DATATRANSFER_CLIPBAORD_XCLIPBOARDEX_HPP_
37 #include <com/sun/star/datatransfer/clipboard/XClipboardEx.hpp>
40 #ifndef _COM_SUN_STAR_DATATRANSFER_CLIPBAORD_XCLIPBOARDNOTIFIER_HPP_
41 #include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp>
43 #include <com/sun/star/lang/XServiceInfo.hpp>
44 #include <com/sun/star/lang/XInitialization.hpp>
46 // ------------------------------------------------------------------------
48 #define GENERIC_CLIPBOARD_IMPLEMENTATION_NAME "com.sun.star.comp.datatransfer.clipboard.GenericClipboard"
50 // ------------------------------------------------------------------------
55 class GenericClipboard
: public ::cppu::WeakComponentImplHelper4
< \
56 ::com::sun::star::datatransfer::clipboard::XClipboardEx
, \
57 ::com::sun::star::datatransfer::clipboard::XClipboardNotifier
, \
58 ::com::sun::star::lang::XServiceInfo
, \
59 ::com::sun::star::lang::XInitialization
>
61 ::osl::Mutex m_aMutex
;
62 ::rtl::OUString m_aName
;
64 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::XTransferable
> m_aContents
;
65 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboardOwner
> m_aOwner
;
67 sal_Bool m_bInitialized
;
68 virtual ~GenericClipboard();
78 virtual void SAL_CALL
initialize( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
)
79 throw(::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
85 virtual ::rtl::OUString SAL_CALL
getImplementationName( )
86 throw(::com::sun::star::uno::RuntimeException
);
88 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
)
89 throw(::com::sun::star::uno::RuntimeException
);
91 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames( )
92 throw(::com::sun::star::uno::RuntimeException
);
98 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::XTransferable
> SAL_CALL
getContents()
99 throw(::com::sun::star::uno::RuntimeException
);
101 virtual void SAL_CALL
setContents(
102 const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::XTransferable
>& xTrans
,
103 const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboardOwner
>& xClipboardOwner
)
104 throw(::com::sun::star::uno::RuntimeException
);
106 virtual ::rtl::OUString SAL_CALL
getName()
107 throw(::com::sun::star::uno::RuntimeException
);
113 virtual sal_Int8 SAL_CALL
getRenderingCapabilities()
114 throw(::com::sun::star::uno::RuntimeException
);
120 virtual void SAL_CALL
addClipboardListener(
121 const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboardListener
>& listener
)
122 throw(::com::sun::star::uno::RuntimeException
);
124 virtual void SAL_CALL
removeClipboardListener(
125 const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboardListener
>& listener
)
126 throw(::com::sun::star::uno::RuntimeException
);
132 // ------------------------------------------------------------------------
134 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
GenericClipboard_getSupportedServiceNames();
135 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
GenericClipboard_createInstance(
136 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> & xMultiServiceFactory
);