Branch libreoffice-5-0-4
[LibreOffice.git] / vcl / osx / service_entry.cxx
bloba8ac53c58e8ea2d14c39bb4bda006f497b1ef739
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 #include "osl/diagnose.h"
22 #include "vcl/svapp.hxx"
24 #include "osx/saldata.hxx"
25 #include "osx/salinst.h"
27 #include "DragSource.hxx"
28 #include "DropTarget.hxx"
29 #include "clipboard.hxx"
31 using namespace ::osl;
32 using namespace ::com::sun::star;
33 using namespace ::com::sun::star::uno;
34 using namespace ::cppu;
35 using namespace ::com::sun::star::lang;
36 using namespace ::com::sun::star::datatransfer::clipboard;
38 uno::Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< Any >& i_rArguments )
40 if ( Application::IsHeadlessModeEnabled() )
41 return SalInstance::CreateClipboard( i_rArguments );
43 SalData* pSalData = GetSalData();
44 if( ! pSalData->mxClipboard.is() )
45 pSalData->mxClipboard = uno::Reference<XInterface>(static_cast< XClipboard* >(new AquaClipboard()), UNO_QUERY);
46 return pSalData->mxClipboard;
49 uno::Reference<XInterface> AquaSalInstance::CreateDragSource()
51 if ( Application::IsHeadlessModeEnabled() )
52 return SalInstance::CreateDragSource();
54 return uno::Reference<XInterface>(static_cast< XInitialization* >(new DragSource()), UNO_QUERY);
57 uno::Reference<XInterface> AquaSalInstance::CreateDropTarget()
59 if ( Application::IsHeadlessModeEnabled() )
60 return SalInstance::CreateDropTarget();
62 return uno::Reference<XInterface>(static_cast< XInitialization* >(new DropTarget()), UNO_QUERY);
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */