Bump version to 4.1-6
[LibreOffice.git] / sfx2 / source / dialog / bluthsnd.cxx
blobfb538526ab38c1218e1e255e9e675417be944806
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/.
8 */
10 #include <com/sun/star/beans/PropertyValue.hpp>
11 #include <com/sun/star/beans/XPropertyAccess.hpp>
12 #include <com/sun/star/frame/XFrame.hpp>
13 #include <com/sun/star/frame/XModel.hpp>
14 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
16 #include <stdio.h>
18 #include "bluthsndapi.hxx"
20 SfxBluetoothModel::SendMailResult SfxBluetoothModel::SaveAndSend( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
21 const OUString& rType )
23 SaveResult eSaveResult;
24 SendMailResult eResult = SEND_MAIL_ERROR;
25 OUString aFileName;
27 eSaveResult = SaveDocumentAsFormat( OUString(), xFrame, rType, aFileName );
28 if( eSaveResult == SAVE_SUCCESSFULL )
30 maAttachedDocuments.push_back( aFileName );
31 return Send( xFrame );
33 else if( eSaveResult == SAVE_CANCELLED )
34 eResult = SEND_MAIL_CANCELLED;
36 return eResult;
39 SfxBluetoothModel::SendMailResult SfxBluetoothModel::Send( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& /*xFrame*/ )
41 char bthsend[300];
42 SendMailResult eResult = SEND_MAIL_OK;
43 OUString aFileName = maAttachedDocuments[0];
44 snprintf(bthsend,300,"bluetooth-sendto %s",OUStringToOString( aFileName, RTL_TEXTENCODING_UTF8).getStr() );
45 if( !system( bthsend ) )
46 eResult = SEND_MAIL_ERROR;
47 return eResult;
50 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */