diff options
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 5 | ||||
-rw-r--r-- | sc/uiconfig/scalc/menubar/menubar.xml | 1 | ||||
-rw-r--r-- | sfx2/Library_sfx.mk | 1 | ||||
-rw-r--r-- | sfx2/inc/bluthsndapi.hxx | 54 | ||||
-rw-r--r-- | sfx2/inc/sfx2/mailmodelapi.hxx | 13 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sfxsids.hrc | 3 | ||||
-rw-r--r-- | sfx2/sdi/sfx.sdi | 28 | ||||
-rw-r--r-- | sfx2/sdi/viwslots.sdi | 5 | ||||
-rw-r--r-- | sfx2/source/dialog/bluthsnd.cxx | 70 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 21 | ||||
-rw-r--r-- | svx/inc/globlmn_tmpl.hrc | 5 | ||||
-rw-r--r-- | sw/sdi/wviewsh.sdi | 4 | ||||
-rw-r--r-- | sw/uiconfig/sglobal/menubar/menubar.xml | 1 | ||||
-rw-r--r-- | sw/uiconfig/sweb/menubar/menubar.xml | 1 | ||||
-rw-r--r-- | sw/uiconfig/swreport/menubar/menubar.xml | 1 | ||||
-rw-r--r-- | sw/uiconfig/swriter/menubar/menubar.xml | 1 | ||||
-rw-r--r-- | sw/uiconfig/swxform/menubar/menubar.xml | 1 |
17 files changed, 208 insertions, 7 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index 8525bee0444b..bf1242a65c94 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -4109,6 +4109,11 @@ <value xml:lang="en-US">E-mail as P~DF...</value> </prop> </node> + <node oor:name=".uno:SendViaBluetooth" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Send Via ~Bluetooth...</value> + </prop> + </node> <node oor:name=".uno:ExportToPDF" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Export as P~DF...</value> diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml index 5a95a265a4e6..3108d0a1d8de 100644 --- a/sc/uiconfig/scalc/menubar/menubar.xml +++ b/sc/uiconfig/scalc/menubar/menubar.xml @@ -25,6 +25,7 @@ <menu:menuitem menu:id=".uno:SendMailDocAsOOo"/> <menu:menuitem menu:id=".uno:SendMailDocAsMS"/> <menu:menuitem menu:id=".uno:SendMailDocAsPDF"/> + <menu:menuitem menu:id=".uno:SendViaBluetooth"/> </menu:menupopup> </menu:menu> <menu:menuseparator/> diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk index 96d79dfe7be4..06f64d072861 100644 --- a/sfx2/Library_sfx.mk +++ b/sfx2/Library_sfx.mk @@ -155,6 +155,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\ sfx2/source/dialog/itemconnect \ sfx2/source/dialog/inputdlg \ sfx2/source/dialog/mailmodel \ + sfx2/source/dialog/bluthsnd \ sfx2/source/dialog/mgetempl \ sfx2/source/dialog/navigat \ sfx2/source/dialog/newstyle \ diff --git a/sfx2/inc/bluthsndapi.hxx b/sfx2/inc/bluthsndapi.hxx new file mode 100644 index 000000000000..6768ccc449fe --- /dev/null +++ b/sfx2/inc/bluthsndapi.hxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * SUSE. + * + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Muthu Subramanian <sumuthu@suse.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef INCLUDED_SFX_BLUETOOTHL_HXX +#define INCLUDED_SFX_BLUETOOTH_HXX + +#include <vector> +#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XModel.hpp> +#include "tools/link.hxx" +#include <tools/string.hxx> +#include "sfx2/dllapi.h" +#include "mailmodelapi.hxx" + + +// class SfxBluetoothModel_Impl ----------------------------------------------- + +class SFX2_DLLPUBLIC SfxBluetoothModel:public SfxMailModel +{ +public: + SendMailResult SaveAndSend( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, + const rtl::OUString& rType ); + SendMailResult Send( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame ); +}; + +#endif // INCLUDED_SFX_BLUETOOTH_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/mailmodelapi.hxx b/sfx2/inc/sfx2/mailmodelapi.hxx index 19515c597098..47bae9b7b870 100644 --- a/sfx2/inc/sfx2/mailmodelapi.hxx +++ b/sfx2/inc/sfx2/mailmodelapi.hxx @@ -57,15 +57,20 @@ public: TYPE_ASPDF }; -private: +protected: enum SaveResult { SAVE_SUCCESSFULL, SAVE_CANCELLED, SAVE_ERROR }; - ::std::vector< ::rtl::OUString > maAttachedDocuments; + SaveResult SaveDocumentAsFormat( const rtl::OUString& aSaveFileName, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xFrameOrModel, + const rtl::OUString& rType, + rtl::OUString& rFileNamePath ); + +private: AddressList_Impl* mpToList; AddressList_Impl* mpCcList; AddressList_Impl* mpBccList; @@ -76,10 +81,6 @@ private: sal_Bool mbLoadDone; void ClearList( AddressList_Impl* pList ); - SaveResult SaveDocumentAsFormat( const rtl::OUString& aSaveFileName, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xFrameOrModel, - const rtl::OUString& rType, - rtl::OUString& rFileNamePath ); SaveResult ShowFilterOptionsDialog( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMGR, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel, const ::rtl::OUString& rFilterName, diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index a74b3af10df0..f627d08931b6 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -276,8 +276,9 @@ #define SID_PASSWORDINTERACTION (SID_SFX_START + 1723) #define SID_GOTOLINE (SID_SFX_START + 1724) #define SID_SHOWLINES (SID_SFX_START + 1725) +#define SID_BLUETOOTH_SENDDOC (SID_SFX_START + 1726) -// SID_SFX_free_START (SID_SFX_START + 1726) +// SID_SFX_free_START (SID_SFX_START + 1727) // SID_SFX_free_END (SID_SFX_START + 3999) #define SID_OPEN_NEW_VIEW (SID_SFX_START + 520) diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 8817513657da..92af180aedf3 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -5923,6 +5923,34 @@ SfxBoolItem SendMailDocAsPDF SID_MAIL_SENDDOCASPDF GroupId = GID_DOCUMENT; ] +SfxBoolItem SendViaBluetooth SID_BLUETOOTH_SENDDOC +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = TRUE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + /* status: */ + SlotType = SfxStringItem + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DOCUMENT; +] + + SfxBoolItem SendMailDocAsFormat SID_MAIL_SENDDOCASFORMAT (SfxStringItem Recipient SID_MAIL_RECIPIENT,SfxStringItem Subject SID_MAIL_SUBJECT,SfxStringItem MailText SID_MAIL_TEXT,SfxUInt16Item Priority SID_MAIL_PRIORITY,SfxStringItem TypeName SID_TYPE_NAME) [ diff --git a/sfx2/sdi/viwslots.sdi b/sfx2/sdi/viwslots.sdi index ee7dd883df0a..bfc770cb6503 100644 --- a/sfx2/sdi/viwslots.sdi +++ b/sfx2/sdi/viwslots.sdi @@ -52,6 +52,11 @@ interface View ExecMethod = ExecMisc_Impl ; StateMethod = GetState_Impl ; ] + SID_BLUETOOTH_SENDDOC // ole(no) api(todo) + [ + ExecMethod = ExecMisc_Impl ; + StateMethod = GetState_Impl ; + ] //--------------------------------------------------------------------- SID_PRINTDOC // ole(no) api(play/rec) [ diff --git a/sfx2/source/dialog/bluthsnd.cxx b/sfx2/source/dialog/bluthsnd.cxx new file mode 100644 index 000000000000..e7266622ce8d --- /dev/null +++ b/sfx2/source/dialog/bluthsnd.cxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * SUSE. + * + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Muthu Subramanian <sumuthu@suse.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/beans/XPropertyAccess.hpp> +#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +#include <stdio.h> + +#include "bluthsndapi.hxx" + +SfxBluetoothModel::SendMailResult SfxBluetoothModel::SaveAndSend( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, + const rtl::OUString& rType ) +{ + SaveResult eSaveResult; + SendMailResult eResult = SEND_MAIL_ERROR; + rtl::OUString aFileName; + + eSaveResult = SaveDocumentAsFormat( rtl::OUString(), xFrame, rType, aFileName ); + if( eSaveResult == SAVE_SUCCESSFULL ) + { + maAttachedDocuments.push_back( aFileName ); + return Send( xFrame ); + } + else if( eSaveResult == SAVE_CANCELLED ) + eResult = SEND_MAIL_CANCELLED; + + return eResult; +} + +SfxBluetoothModel::SendMailResult SfxBluetoothModel::Send( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& /*xFrame*/ ) +{ + char bthsend[300]; + SendMailResult eResult = SEND_MAIL_OK; + rtl::OUString aFileName = maAttachedDocuments[0]; + snprintf(bthsend,300,"bluetooth-sendto %s",rtl::OUStringToOString( aFileName, RTL_TEXTENCODING_UTF8).getStr() ); + if( !system( bthsend ) ) + eResult = SEND_MAIL_ERROR; + return eResult; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 6686b09df463..e1d0210c70e5 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -67,6 +67,7 @@ #include "sfxlocal.hrc" #include <sfx2/sfxbasecontroller.hxx> #include "sfx2/mailmodelapi.hxx" +#include "bluthsndapi.hxx" #include <sfx2/viewfrm.hxx> #include <sfx2/event.hxx> #include <sfx2/fcontnr.hxx> @@ -595,6 +596,26 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) break; } + case SID_BLUETOOTH_SENDDOC: + { + SfxBluetoothModel aModel; + SfxObjectShell* pDoc = GetObjectShell(); + if ( pDoc && pDoc->QueryHiddenInformation( + WhenSaving, &GetViewFrame()->GetWindow() ) != RET_YES ) + break; + uno::Reference < frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() ); + SfxMailModel::SendMailResult eResult = aModel.SaveAndSend( xFrame, rtl::OUString() ); + if( eResult == SfxMailModel::SEND_MAIL_ERROR ) + { + InfoBox aBox( SFX_APP()->GetTopWindow(), SfxResId( MSG_ERROR_SEND_MAIL )); + aBox.Execute(); + rReq.Ignore(); + } + else + rReq.Done(); + } + break; + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case SID_WEBHTML: { diff --git a/svx/inc/globlmn_tmpl.hrc b/svx/inc/globlmn_tmpl.hrc index 0f56324958ee..03c6dbecdef0 100644 --- a/svx/inc/globlmn_tmpl.hrc +++ b/svx/inc/globlmn_tmpl.hrc @@ -441,6 +441,11 @@ Identifier = SID_OBJECT_ROTATE ; \ Command = ".uno:ToggleObjectRotateMode" ; \ +#define ITEM_FILE_BLUETOOTH_SENDDOC \ + Identifier = SID_BLUETOOTH_SENDDOC ; \ + Command = ".uno:SendViaBluetooth" ; \ + HelpID = SID_BLUETOOTH_SENDDOC ; \ + Text [ en-US ] = "Document via ~Bluetooth..." ; \ #define ITEM_TRANSLITERATE_MENU\ MenuItem\ diff --git a/sw/sdi/wviewsh.sdi b/sw/sdi/wviewsh.sdi index 4c600694116a..8c9949636b0b 100644 --- a/sw/sdi/wviewsh.sdi +++ b/sw/sdi/wviewsh.sdi @@ -161,6 +161,10 @@ interface WebSourceView [ StateMethod = GetState ; ] + SID_BLUETOOTH_SENDDOC + [ + StateMethod = GetState ; + ] SID_EXPORTDOC [ StateMethod = GetState ; diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml index 6e9c79a69b75..b82b494baae0 100644 --- a/sw/uiconfig/sglobal/menubar/menubar.xml +++ b/sw/uiconfig/sglobal/menubar/menubar.xml @@ -22,6 +22,7 @@ <menu:menupopup> <menu:menuitem menu:id=".uno:SendMail"/> <menu:menuitem menu:id=".uno:SendMailDocAsPDF"/> + <menu:menuitem menu:id=".uno:SendViaBluetooth"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:NewGlobalDoc"/> <menu:menuitem menu:id=".uno:NewHtmlDoc"/> diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml index 501094488851..1f0efd7b8623 100644 --- a/sw/uiconfig/sweb/menubar/menubar.xml +++ b/sw/uiconfig/sweb/menubar/menubar.xml @@ -19,6 +19,7 @@ <menu:menupopup> <menu:menuitem menu:id=".uno:SendMail"/> <menu:menuitem menu:id=".uno:SendMailDocAsPDF"/> + <menu:menuitem menu:id=".uno:SendViaBluetooth"/> </menu:menupopup> </menu:menu> <menu:menuseparator/> diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml index e42fc69d01db..f794feec93f1 100644 --- a/sw/uiconfig/swreport/menubar/menubar.xml +++ b/sw/uiconfig/swreport/menubar/menubar.xml @@ -24,6 +24,7 @@ <menu:menuitem menu:id=".uno:SendMailDocAsOOo"/> <menu:menuitem menu:id=".uno:SendMailDocAsMS"/> <menu:menuitem menu:id=".uno:SendMailDocAsPDF"/> + <menu:menuitem menu:id=".uno:SendViaBluetooth"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:NewGlobalDoc"/> <menu:menuitem menu:id=".uno:NewHtmlDoc"/> diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml index 569240afbd55..12f19b0a35c0 100644 --- a/sw/uiconfig/swriter/menubar/menubar.xml +++ b/sw/uiconfig/swriter/menubar/menubar.xml @@ -24,6 +24,7 @@ <menu:menuitem menu:id=".uno:SendMailDocAsOOo"/> <menu:menuitem menu:id=".uno:SendMailDocAsMS"/> <menu:menuitem menu:id=".uno:SendMailDocAsPDF"/> + <menu:menuitem menu:id=".uno:SendViaBluetooth"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:NewGlobalDoc"/> <menu:menuitem menu:id=".uno:NewHtmlDoc"/> diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml index 49bcfb4f7f77..fd90dc45648f 100644 --- a/sw/uiconfig/swxform/menubar/menubar.xml +++ b/sw/uiconfig/swxform/menubar/menubar.xml @@ -24,6 +24,7 @@ <menu:menuitem menu:id=".uno:SendMailDocAsOOo"/> <menu:menuitem menu:id=".uno:SendMailDocAsMS"/> <menu:menuitem menu:id=".uno:SendMailDocAsPDF"/> + <menu:menuitem menu:id=".uno:SendViaBluetooth"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:NewGlobalDoc"/> <menu:menuitem menu:id=".uno:NewHtmlDoc"/> |