fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / svx / source / sdr / contact / viewcontactofmasterpagedescriptor.cxx
blob96f7c1d3afa97723bd2bf1711f556b4c8cdcb3d3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <svx/sdr/contact/viewcontactofmasterpagedescriptor.hxx>
21 #include <svx/sdr/contact/viewobjectcontact.hxx>
22 #include <svx/svdpage.hxx>
23 #include <svx/sdr/contact/displayinfo.hxx>
24 #include <svx/svdobj.hxx>
25 #include <svx/sdr/contact/objectcontactofobjlistpainter.hxx>
26 #include <vcl/timer.hxx>
27 #include <svx/svdpagv.hxx>
28 #include <svx/svdview.hxx>
29 #include <svx/sdr/contact/viewcontactofsdrpage.hxx>
30 #include <svx/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx>
31 #include <svx/sdr/primitive2d/sdrattributecreator.hxx>
32 #include <basegfx/polygon/b2dpolygontools.hxx>
33 #include <basegfx/matrix/b2dhommatrix.hxx>
34 #include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
35 #include <drawinglayer/attribute/sdrfillattribute.hxx>
36 #include <basegfx/polygon/b2dpolygon.hxx>
37 #include <drawinglayer/attribute/fillgradientattribute.hxx>
39 //////////////////////////////////////////////////////////////////////////////
41 namespace sdr
43 namespace contact
45 ViewObjectContact& ViewContactOfMasterPageDescriptor::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
47 return *(new ViewObjectContactOfMasterPageDescriptor(rObjectContact, *this));
50 drawinglayer::primitive2d::Primitive2DSequence ViewContactOfMasterPageDescriptor::createViewIndependentPrimitive2DSequence() const
52 drawinglayer::primitive2d::Primitive2DSequence xRetval;
53 drawinglayer::attribute::SdrFillAttribute aFill;
54 const SdrPageProperties* pCorrectProperties = GetMasterPageDescriptor().getCorrectSdrPageProperties();
56 if(pCorrectProperties)
58 // create page fill attributes when correct properties were identified
59 aFill = drawinglayer::primitive2d::createNewSdrFillAttribute(pCorrectProperties->GetItemSet());
62 if(!aFill.isDefault())
64 // direct model data is the page size, get and use it
65 const SdrPage& rOwnerPage = GetMasterPageDescriptor().GetOwnerPage();
66 const basegfx::B2DRange aInnerRange(
67 rOwnerPage.GetLftBorder(), rOwnerPage.GetUppBorder(),
68 rOwnerPage.GetWdt() - rOwnerPage.GetRgtBorder(),
69 rOwnerPage.GetHgt() - rOwnerPage.GetLwrBorder());
70 const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
71 const basegfx::B2DHomMatrix aEmptyTransform;
72 const drawinglayer::primitive2d::Primitive2DReference xReference(
73 drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
74 basegfx::B2DPolyPolygon(aInnerPolgon),
75 aEmptyTransform,
76 aFill,
77 drawinglayer::attribute::FillGradientAttribute()));
79 xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
82 return xRetval;
85 // basic constructor
86 ViewContactOfMasterPageDescriptor::ViewContactOfMasterPageDescriptor(sdr::MasterPageDescriptor& rDescriptor)
87 : ViewContact(),
88 mrMasterPageDescriptor(rDescriptor)
92 // The destructor.
93 ViewContactOfMasterPageDescriptor::~ViewContactOfMasterPageDescriptor()
97 sal_uInt32 ViewContactOfMasterPageDescriptor::GetObjectCount() const
99 return GetMasterPageDescriptor().GetUsedPage().GetObjCount();
102 ViewContact& ViewContactOfMasterPageDescriptor::GetViewContact(sal_uInt32 nIndex) const
104 return GetMasterPageDescriptor().GetUsedPage().GetObj(nIndex)->GetViewContact();
107 ViewContact* ViewContactOfMasterPageDescriptor::GetParentContact() const
109 return &(GetMasterPageDescriptor().GetOwnerPage().GetViewContact());
111 } // end of namespace contact
112 } // end of namespace sdr
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */