xref: /AOO41X/main/sfx2/source/appl/fileobj.hxx (revision 353d8f4d17010cd2d0ea815067cad67e477f2bee)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _FILEOBJ_HXX
24 #define _FILEOBJ_HXX
25 
26 #include <tools/string.hxx>
27 #include <sfx2/linksrc.hxx>
28 #include <sfx2/docfile.hxx>
29 #include <sfx2/linkmgr.hxx>
30 
31 class Graphic;
32 struct Impl_DownLoadData;
33 namespace sfx2 { class FileDialogHelper; }
34 
35 class SvFileObject : public sfx2::SvLinkSource
36 {
37     String              sFileNm;
38     String              sFilter;
39     String              sReferer;
40     Link                aEndEditLink;
41     SfxMediumRef        xMed;
42     Impl_DownLoadData*  pDownLoadData;
43     Window*             pOldParent;
44 
45     sal_uInt8 nType;
46 
47     sal_Bool bLoadAgain : 1;
48     sal_Bool bSynchron : 1;
49     sal_Bool bLoadError : 1;
50     sal_Bool bWaitForData : 1;
51     sal_Bool bInNewData : 1;
52     sal_Bool bDataReady : 1;
53     sal_Bool bMedUseCache : 1;
54     sal_Bool bNativFormat : 1;
55     sal_Bool bClearMedium : 1;
56     sal_Bool bStateChangeCalled : 1;
57     sal_Bool bInCallDownLoad : 1;
58 
59     sal_Bool GetGraphic_Impl( Graphic&, SvStream* pStream = 0 );
60     sal_Bool LoadFile_Impl();
61     void SendStateChg_Impl( sfx2::LinkManager::LinkState nState );
62 
63     DECL_STATIC_LINK( SvFileObject, DelMedium_Impl, SfxMediumRef* );
64     DECL_STATIC_LINK( SvFileObject, LoadGrfReady_Impl, void* );
65     DECL_STATIC_LINK( SvFileObject, LoadGrfNewData_Impl, void* );
66     DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* );
67 
68 protected:
69     virtual ~SvFileObject();
70 
71 public:
72     SvFileObject();
73 
74     virtual sal_Bool GetData( ::com::sun::star::uno::Any & rData /*out param*/,
75                             const String & rMimeType,
76                             sal_Bool bSynchron = sal_False );
77 
78     virtual sal_Bool    Connect( sfx2::SvBaseLink* );
79     virtual void    Edit( Window *, sfx2::SvBaseLink *, const Link& rEndEditHdl );
80 
81     // erfrage ob das man direkt auf die Daten zugreifen kann oder ob das
82     // erst angestossen werden muss
83     virtual sal_Bool IsPending() const;
84     virtual sal_Bool IsDataComplete() const;
85 
86     void CancelTransfers();
87 };
88 
89 
90 #endif
91 
92