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 _SDR_MASTERPAGEDESCRIPTOR_HXX
25 #define _SDR_MASTERPAGEDESCRIPTOR_HXX
26 
27 #include <svx/sdrpageuser.hxx>
28 #include <svx/svdsob.hxx>
29 
30 //////////////////////////////////////////////////////////////////////////////
31 // predeclarations
32 class SdrObject;
33 class SfxItemSet;
34 class SdrPageProperties;
35 
36 namespace sdr
37 {
38 	namespace contact
39 	{
40 		class ViewContact;
41 	} // end of namespace contact
42 } // end of namespace sdr
43 
44 //////////////////////////////////////////////////////////////////////////////
45 
46 namespace sdr
47 {
48 	class MasterPageDescriptor : public sdr::PageUser
49 	{
50     private:
51 		SdrPage&										maOwnerPage;
52 		SdrPage&										maUsedPage;
53 		SetOfByte										maVisibleLayers;
54 
55 		// ViewContact part
56 		sdr::contact::ViewContact*						mpViewContact;
57 
58 		// assignment operator defined, but not implemented
59 		void operator=(const MasterPageDescriptor& rCandidate);
60 
61     protected:
62 		virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
63 
64     public:
65 		MasterPageDescriptor(SdrPage& aOwnerPage, SdrPage& aUsedPage);
66 		virtual ~MasterPageDescriptor();
67 
68 		// ViewContact part
69 		sdr::contact::ViewContact& GetViewContact() const;
70 
71 		// this method is called form the destructor of the referenced page.
72 		// do all necessary action to forget the page. It is not necessary to call
73 		// RemovePageUser(), that is done form the destructor.
74 		virtual void PageInDestruction(const SdrPage& rPage);
75 
76 		// member access to UsedPage
GetUsedPage() const77 		SdrPage& GetUsedPage() const { return maUsedPage; }
78 
79 		// member access to OwnerPage
GetOwnerPage() const80 		SdrPage& GetOwnerPage() const { return maOwnerPage; }
81 
82 		// member access to VisibleLayers
GetVisibleLayers() const83 		const SetOfByte& GetVisibleLayers() const { return maVisibleLayers; }
84 		void SetVisibleLayers(const SetOfByte& rNew);
85 
86 		// operators
87 		sal_Bool operator==(const MasterPageDescriptor& rCandidate) const;
88 		sal_Bool operator!=(const MasterPageDescriptor& rCandidate) const;
89 
90         const SdrPageProperties* getCorrectSdrPageProperties() const;
91 	};
92 } // end of namespace sdr
93 
94 //////////////////////////////////////////////////////////////////////////////
95 
96 #endif //_SDR_MASTERPAGEDESCRIPTOR_HXX
97 // eof
98