xref: /AOO41X/main/sfx2/source/appl/fileobj.hxx (revision 353d8f4d17010cd2d0ea815067cad67e477f2bee)
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
10cdf0e10cSrcweir  *
11*353d8f4dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
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.
19cdf0e10cSrcweir  *
20*353d8f4dSAndrew Rist  *************************************************************/
21*353d8f4dSAndrew Rist 
22*353d8f4dSAndrew Rist 
23cdf0e10cSrcweir #ifndef _FILEOBJ_HXX
24cdf0e10cSrcweir #define _FILEOBJ_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <tools/string.hxx>
27cdf0e10cSrcweir #include <sfx2/linksrc.hxx>
28cdf0e10cSrcweir #include <sfx2/docfile.hxx>
29cdf0e10cSrcweir #include <sfx2/linkmgr.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir class Graphic;
32cdf0e10cSrcweir struct Impl_DownLoadData;
33cdf0e10cSrcweir namespace sfx2 { class FileDialogHelper; }
34cdf0e10cSrcweir 
35cdf0e10cSrcweir class SvFileObject : public sfx2::SvLinkSource
36cdf0e10cSrcweir {
37cdf0e10cSrcweir     String              sFileNm;
38cdf0e10cSrcweir     String              sFilter;
39cdf0e10cSrcweir     String              sReferer;
40cdf0e10cSrcweir     Link                aEndEditLink;
41cdf0e10cSrcweir     SfxMediumRef        xMed;
42cdf0e10cSrcweir     Impl_DownLoadData*  pDownLoadData;
43cdf0e10cSrcweir     Window*             pOldParent;
44cdf0e10cSrcweir 
45cdf0e10cSrcweir 	sal_uInt8 nType;
46cdf0e10cSrcweir 
47cdf0e10cSrcweir 	sal_Bool bLoadAgain : 1;
48cdf0e10cSrcweir 	sal_Bool bSynchron : 1;
49cdf0e10cSrcweir 	sal_Bool bLoadError : 1;
50cdf0e10cSrcweir 	sal_Bool bWaitForData : 1;
51cdf0e10cSrcweir 	sal_Bool bInNewData : 1;
52cdf0e10cSrcweir 	sal_Bool bDataReady : 1;
53cdf0e10cSrcweir 	sal_Bool bMedUseCache : 1;
54cdf0e10cSrcweir 	sal_Bool bNativFormat : 1;
55cdf0e10cSrcweir 	sal_Bool bClearMedium : 1;
56cdf0e10cSrcweir 	sal_Bool bStateChangeCalled : 1;
57cdf0e10cSrcweir 	sal_Bool bInCallDownLoad : 1;
58cdf0e10cSrcweir 
59cdf0e10cSrcweir 	sal_Bool GetGraphic_Impl( Graphic&, SvStream* pStream = 0 );
60cdf0e10cSrcweir 	sal_Bool LoadFile_Impl();
61cdf0e10cSrcweir 	void SendStateChg_Impl( sfx2::LinkManager::LinkState nState );
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 	DECL_STATIC_LINK( SvFileObject, DelMedium_Impl, SfxMediumRef* );
64cdf0e10cSrcweir 	DECL_STATIC_LINK( SvFileObject, LoadGrfReady_Impl, void* );
65cdf0e10cSrcweir 	DECL_STATIC_LINK( SvFileObject, LoadGrfNewData_Impl, void* );
66cdf0e10cSrcweir     DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* );
67cdf0e10cSrcweir 
68cdf0e10cSrcweir protected:
69cdf0e10cSrcweir 	virtual ~SvFileObject();
70cdf0e10cSrcweir 
71cdf0e10cSrcweir public:
72cdf0e10cSrcweir 	SvFileObject();
73cdf0e10cSrcweir 
74cdf0e10cSrcweir 	virtual sal_Bool GetData( ::com::sun::star::uno::Any & rData /*out param*/,
75cdf0e10cSrcweir 							const String & rMimeType,
76cdf0e10cSrcweir 							sal_Bool bSynchron = sal_False );
77cdf0e10cSrcweir 
78cdf0e10cSrcweir     virtual sal_Bool    Connect( sfx2::SvBaseLink* );
79cdf0e10cSrcweir     virtual void    Edit( Window *, sfx2::SvBaseLink *, const Link& rEndEditHdl );
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 	// erfrage ob das man direkt auf die Daten zugreifen kann oder ob das
82cdf0e10cSrcweir 	// erst angestossen werden muss
83cdf0e10cSrcweir 	virtual sal_Bool IsPending() const;
84cdf0e10cSrcweir 	virtual sal_Bool IsDataComplete() const;
85cdf0e10cSrcweir 
86cdf0e10cSrcweir 	void CancelTransfers();
87cdf0e10cSrcweir };
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 
90cdf0e10cSrcweir #endif
91cdf0e10cSrcweir 
92