xref: /aoo4110/main/sc/source/ui/inc/areasave.hxx (revision b1cdbd2c)
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 
24 #ifndef SC_AREASAVE_HXX
25 #define SC_AREASAVE_HXX
26 
27 #include "collect.hxx"
28 #include "global.hxx"
29 #include "address.hxx"
30 
31 class ScDocument;
32 class ScAreaLink;
33 
34 
35 class ScAreaLinkSaver : public ScDataObject
36 {
37 private:
38 	String		aFileName;
39 	String		aFilterName;
40 	String		aOptions;
41 	String		aSourceArea;
42 	ScRange		aDestArea;
43     sal_uLong       nRefresh;
44 
45 public:
46 				ScAreaLinkSaver( const ScAreaLink& rSource );
47 				ScAreaLinkSaver( const ScAreaLinkSaver& rCopy );
48 	virtual		~ScAreaLinkSaver();
49 
50 	virtual	ScDataObject*	Clone() const;
51 
52 	sal_Bool		IsEqual( const ScAreaLink& rCompare ) const;
53 	sal_Bool		IsEqualSource( const ScAreaLink& rCompare ) const;
54 
55 	void		WriteToLink( ScAreaLink& rLink ) const;
56 	void        InsertNewLink( ScDocument* pDoc ) const;
57 };
58 
59 
60 class ScAreaLinkSaveCollection : public ScCollection
61 {
62 public:
63 				ScAreaLinkSaveCollection();
64 				ScAreaLinkSaveCollection( const ScAreaLinkSaveCollection& rCopy );
65 	virtual		~ScAreaLinkSaveCollection();
66 
67 	virtual	ScDataObject*	Clone() const;
68 
operator [](sal_uInt16 nIndex) const69 	ScAreaLinkSaver*	operator[](sal_uInt16 nIndex) const {return (ScAreaLinkSaver*)At(nIndex);}
70 
71 	sal_Bool		IsEqual( const ScDocument* pDoc ) const;
72 	void		Restore( ScDocument* pDoc ) const;
73 
74 	// returns NULL if empty
75 	static ScAreaLinkSaveCollection* CreateFromDoc( const ScDocument* pDoc );
76 };
77 
78 
79 #endif
80 
81