1*353d8f4dSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*353d8f4dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*353d8f4dSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*353d8f4dSAndrew Rist * distributed with this work for additional information 6*353d8f4dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*353d8f4dSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*353d8f4dSAndrew Rist * "License"); you may not use this file except in compliance 9*353d8f4dSAndrew Rist * with the License. You may obtain a copy of the License at 10*353d8f4dSAndrew Rist * 11*353d8f4dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*353d8f4dSAndrew Rist * 13*353d8f4dSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*353d8f4dSAndrew Rist * software distributed under the License is distributed on an 15*353d8f4dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*353d8f4dSAndrew Rist * KIND, either express or implied. See the License for the 17*353d8f4dSAndrew Rist * specific language governing permissions and limitations 18*353d8f4dSAndrew Rist * under the License. 19*353d8f4dSAndrew Rist * 20*353d8f4dSAndrew Rist *************************************************************/ 21*353d8f4dSAndrew Rist 22*353d8f4dSAndrew Rist 23cdf0e10cSrcweir #ifndef INCLUDED_SFX_MAILMODEL_HXX 24cdf0e10cSrcweir #define INCLUDED_SFX_MAILMODEL_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp> 27cdf0e10cSrcweir 28cdf0e10cSrcweir // class SfxMailModel_Impl ----------------------------------------------- 29cdf0e10cSrcweir 30cdf0e10cSrcweir class AddressList_Impl; 31cdf0e10cSrcweir 32cdf0e10cSrcweir class SfxMailModel_Impl 33cdf0e10cSrcweir { 34cdf0e10cSrcweir public: 35cdf0e10cSrcweir enum MailPriority 36cdf0e10cSrcweir { 37cdf0e10cSrcweir PRIO_HIGHEST, 38cdf0e10cSrcweir PRIO_HIGH, 39cdf0e10cSrcweir PRIO_NORMAL, 40cdf0e10cSrcweir PRIO_LOW, 41cdf0e10cSrcweir PRIO_LOWEST 42cdf0e10cSrcweir }; 43cdf0e10cSrcweir 44cdf0e10cSrcweir enum AddressRole 45cdf0e10cSrcweir { 46cdf0e10cSrcweir ROLE_TO, 47cdf0e10cSrcweir ROLE_CC, 48cdf0e10cSrcweir ROLE_BCC 49cdf0e10cSrcweir }; 50cdf0e10cSrcweir 51cdf0e10cSrcweir enum MailDocType 52cdf0e10cSrcweir { 53cdf0e10cSrcweir TYPE_SELF, 54cdf0e10cSrcweir TYPE_ASPDF 55cdf0e10cSrcweir }; 56cdf0e10cSrcweir 57cdf0e10cSrcweir private: 58cdf0e10cSrcweir enum SaveResult 59cdf0e10cSrcweir { 60cdf0e10cSrcweir SAVE_SUCCESSFULL, 61cdf0e10cSrcweir SAVE_CANCELLED, 62cdf0e10cSrcweir SAVE_ERROR 63cdf0e10cSrcweir }; 64cdf0e10cSrcweir 65cdf0e10cSrcweir AddressList_Impl* mpToList; 66cdf0e10cSrcweir AddressList_Impl* mpCcList; 67cdf0e10cSrcweir AddressList_Impl* mpBccList; 68cdf0e10cSrcweir String maFromAddress; 69cdf0e10cSrcweir String maSubject; 70cdf0e10cSrcweir MailPriority mePriority; 71cdf0e10cSrcweir 72cdf0e10cSrcweir sal_Bool mbLoadDone; 73cdf0e10cSrcweir 74cdf0e10cSrcweir void ClearList( AddressList_Impl* pList ); 75cdf0e10cSrcweir void MakeValueList( AddressList_Impl* pList, String& rValueList ); 76cdf0e10cSrcweir SaveResult SaveDocumentAsFormat( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const rtl::OUString& rType, rtl::OUString& rFileNamePath ); 77cdf0e10cSrcweir 78cdf0e10cSrcweir DECL_LINK( DoneHdl, void* ); 79cdf0e10cSrcweir 80cdf0e10cSrcweir public: 81cdf0e10cSrcweir enum SendMailResult 82cdf0e10cSrcweir { 83cdf0e10cSrcweir SEND_MAIL_OK, 84cdf0e10cSrcweir SEND_MAIL_CANCELLED, 85cdf0e10cSrcweir SEND_MAIL_ERROR 86cdf0e10cSrcweir }; 87cdf0e10cSrcweir 88cdf0e10cSrcweir SfxMailModel_Impl(); 89cdf0e10cSrcweir ~SfxMailModel_Impl(); 90cdf0e10cSrcweir 91cdf0e10cSrcweir void AddAddress( const String& rAddress, AddressRole eRole ); SetFromAddress(const String & rAddress)92cdf0e10cSrcweir void SetFromAddress( const String& rAddress ) { maFromAddress = rAddress; } SetSubject(const String & rSubject)93cdf0e10cSrcweir void SetSubject( const String& rSubject ) { maSubject = rSubject; } SetPriority(MailPriority ePrio)94cdf0e10cSrcweir void SetPriority( MailPriority ePrio ) { mePriority = ePrio; } 95cdf0e10cSrcweir 96cdf0e10cSrcweir SendMailResult Send( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const rtl::OUString& rType ); 97cdf0e10cSrcweir }; 98cdf0e10cSrcweir 99cdf0e10cSrcweir sal_Bool CreateFromAddress_Impl( String& rFrom ); 100cdf0e10cSrcweir 101cdf0e10cSrcweir #endif // INCLUDED_SFX_MAILMODEL_HXX 102