xref: /AOO41X/main/svx/inc/svx/sdr/contact/viewcontactofgraphic.hxx (revision c0d661f194b04ae0fa5b5c4673be6f92b21a19f8)
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_CONTACT_VIEWCONTACTOFGRAPHIC_HXX
25 #define _SDR_CONTACT_VIEWCONTACTOFGRAPHIC_HXX
26 
27 #include <sal/types.h>
28 #include <svx/sdr/contact/viewcontactoftextobj.hxx>
29 
30 //////////////////////////////////////////////////////////////////////////////
31 // predeclarations
32 
33 class SdrGrafObj;
34 namespace drawinglayer { namespace attribute { class SdrLineFillShadowTextAttribute; }}
35 class GraphicAttr;
36 
37 //////////////////////////////////////////////////////////////////////////////
38 
39 namespace sdr
40 {
41     namespace contact
42     {
43         class ViewContactOfGraphic : public ViewContactOfTextObj
44         {
45         private:
46             // helpers for constructing various primitive visualisations in various states
47             drawinglayer::primitive2d::Primitive2DSequence createVIP2DSForPresObj(
48                 const basegfx::B2DHomMatrix& rObjectMatrix,
49                 const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute) const;
50             drawinglayer::primitive2d::Primitive2DSequence createVIP2DSForDraft(
51                 const basegfx::B2DHomMatrix& rObjectMatrix,
52                 const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute) const;
53 
54         protected:
55             // Create a Object-Specific ViewObjectContact, set ViewContact and
56             // ObjectContact. Always needs to return something.
57             virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
58 
59         public:
60             // access to SdrObject
GetGrafObject() const61             SdrGrafObj& GetGrafObject() const
62             {
63                 return ((SdrGrafObj&)GetSdrObject());
64             }
65 
66             // basic constructor, destructor
67             ViewContactOfGraphic(SdrGrafObj& rGrafObj);
68             virtual ~ViewContactOfGraphic();
69 
70             // #i102380#
71             void flushGraphicObjects();
72 
73             // helpers for viusualisation state
74             bool visualisationUsesPresObj() const;
75             bool visualisationUsesDraft() const;
76 
77         protected:
78             // This method is responsible for creating the graphical visualisation data
79             // ONLY based on model data
80             virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
81         };
82     } // end of namespace contact
83 } // end of namespace sdr
84 
85 //////////////////////////////////////////////////////////////////////////////
86 
87 #endif //_SDR_CONTACT_VIEWCONTACTOFGRAPHIC_HXX
88 
89 // eof
90