1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _FILEOBJ_HXX 28 #define _FILEOBJ_HXX 29 30 #include <tools/string.hxx> 31 #include <sfx2/linksrc.hxx> 32 #include <sfx2/docfile.hxx> 33 #include <sfx2/linkmgr.hxx> 34 35 class Graphic; 36 struct Impl_DownLoadData; 37 namespace sfx2 { class FileDialogHelper; } 38 39 class SvFileObject : public sfx2::SvLinkSource 40 { 41 String sFileNm; 42 String sFilter; 43 String sReferer; 44 Link aEndEditLink; 45 SfxMediumRef xMed; 46 Impl_DownLoadData* pDownLoadData; 47 Window* pOldParent; 48 49 sal_uInt8 nType; 50 51 sal_Bool bLoadAgain : 1; 52 sal_Bool bSynchron : 1; 53 sal_Bool bLoadError : 1; 54 sal_Bool bWaitForData : 1; 55 sal_Bool bInNewData : 1; 56 sal_Bool bDataReady : 1; 57 sal_Bool bMedUseCache : 1; 58 sal_Bool bNativFormat : 1; 59 sal_Bool bClearMedium : 1; 60 sal_Bool bStateChangeCalled : 1; 61 sal_Bool bInCallDownLoad : 1; 62 63 sal_Bool GetGraphic_Impl( Graphic&, SvStream* pStream = 0 ); 64 sal_Bool LoadFile_Impl(); 65 void SendStateChg_Impl( sfx2::LinkManager::LinkState nState ); 66 67 DECL_STATIC_LINK( SvFileObject, DelMedium_Impl, SfxMediumRef* ); 68 DECL_STATIC_LINK( SvFileObject, LoadGrfReady_Impl, void* ); 69 DECL_STATIC_LINK( SvFileObject, LoadGrfNewData_Impl, void* ); 70 DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* ); 71 72 protected: 73 virtual ~SvFileObject(); 74 75 public: 76 SvFileObject(); 77 78 virtual sal_Bool GetData( ::com::sun::star::uno::Any & rData /*out param*/, 79 const String & rMimeType, 80 sal_Bool bSynchron = sal_False ); 81 82 virtual sal_Bool Connect( sfx2::SvBaseLink* ); 83 virtual void Edit( Window *, sfx2::SvBaseLink *, const Link& rEndEditHdl ); 84 85 // erfrage ob das man direkt auf die Daten zugreifen kann oder ob das 86 // erst angestossen werden muss 87 virtual sal_Bool IsPending() const; 88 virtual sal_Bool IsDataComplete() const; 89 90 void CancelTransfers(); 91 }; 92 93 94 #endif 95 96