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 .
21 #include <vcl/svapp.hxx>
22 #include <dndhelper.hxx>
23 #include <vcl/sysdata.hxx>
25 #include <osx/saldata.hxx>
26 #include <osx/salinst.h>
28 #include "DragSource.hxx"
29 #include "DropTarget.hxx"
30 #include "clipboard.hxx"
32 using namespace ::osl
;
33 using namespace ::com::sun::star
;
34 using namespace ::com::sun::star::uno
;
35 using namespace ::cppu
;
36 using namespace ::com::sun::star::lang
;
37 using namespace ::com::sun::star::datatransfer::clipboard
;
39 uno::Reference
< XInterface
> AquaSalInstance::CreateClipboard( const Sequence
< Any
>& i_rArguments
)
41 if ( Application::IsHeadlessModeEnabled() || IsRunningUnitTest() )
42 return SalInstance::CreateClipboard( i_rArguments
);
44 SalData
* pSalData
= GetSalData();
45 if( ! pSalData
->mxClipboard
.is() )
46 pSalData
->mxClipboard
.set(static_cast< XClipboard
* >(new AquaClipboard(nullptr, true)), UNO_QUERY
);
47 return pSalData
->mxClipboard
;
50 uno::Reference
<XInterface
> AquaSalInstance::ImplCreateDragSource(const SystemEnvData
* pSysEnv
)
52 return vcl::OleDnDHelper(new DragSource(), reinterpret_cast<sal_IntPtr
>(pSysEnv
->mpNSView
),
53 vcl::DragOrDrop::Drag
);
56 uno::Reference
<XInterface
> AquaSalInstance::ImplCreateDropTarget(const SystemEnvData
* pSysEnv
)
58 return vcl::OleDnDHelper(new DropTarget(), reinterpret_cast<sal_IntPtr
>(pSysEnv
->mpNSView
),
59 vcl::DragOrDrop::Drop
);
62 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */