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/.
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>
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
;
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
;
39 SfxBluetoothModel::SendMailResult
SfxBluetoothModel::Send( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& /*xFrame*/ )
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
;
50 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */