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 SD_SLIDESORTER_PAGE_OBJECT_VIEW_CONTACT_HXX
25 #define SD_SLIDESORTER_PAGE_OBJECT_VIEW_CONTACT_HXX
26 
27 #include "model/SlsSharedPageDescriptor.hxx"
28 #include <svx/sdtakitm.hxx>
29 #include <svx/sdr/contact/viewcontactofpageobj.hxx>
30 
31 class SdrPageObj;
32 
33 namespace sdr {namespace contact {
34 class ViewObjectContact;
35 class ObjectContact;
36 } }
37 
38 namespace sd { namespace slidesorter { namespace view {
39 
40 /** Details:
41     This class has to provide the bounding box but can not determine it
42     fully because it has no access to the output device.  It therefore
43     retrieves some of the necessary data, the border, from the
44     PageDescriptor which acts here as persistent storage.
45 */
46 class PageObjectViewContact
47     : public ::sdr::contact::ViewContactOfPageObj
48 {
49 public:
50     PageObjectViewContact (
51         SdrPageObj& rPageObj,
52         const model::SharedPageDescriptor& rpDescriptor);
53     ~PageObjectViewContact (void);
54 
55     /** Create a ViewObjectContact object that buffers its output in a
56         bitmap.
57         @return
58             Ownership of the new object passes to the caller.
59     */
60     virtual ::sdr::contact::ViewObjectContact&
61         CreateObjectSpecificViewObjectContact(
62             ::sdr::contact::ObjectContact& rObjectContact);
63 
64     const SdrPage* GetPage (void) const;
65 
66     SdrPageObj& GetPageObject (void) const;
67 
68     virtual void ActionChanged (void);
69 
70 protected:
71 	// create graphical visualisation data
72 	virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
73 
74 private:
75     /** This flag is set to <TRUE/> when the destructor is called to
76         indicate that further calls made to it must not call outside.
77     */
78     bool mbInDestructor;
79 
80     model::SharedPageDescriptor mpDescriptor;
81 };
82 
83 } } } // end of namespace ::sd::slidesorter::view
84 
85 #endif
86