Get the style color and number just once
[LibreOffice.git] / include / svx / sdr / contact / viewobjectcontactofsdrobj.hxx
blob5989559c758eb6ca7be1615f453de6772351dc5f
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 #ifndef INCLUDED_SVX_SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX
21 #define INCLUDED_SVX_SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX
23 #include <svx/sdr/contact/viewobjectcontact.hxx>
25 class SdrObject;
26 class SdrLayerIDSet;
27 class OutputDevice;
29 namespace sdr::contact
31 class SVXCORE_DLLPUBLIC ViewObjectContactOfSdrObj : public ViewObjectContact
33 /** Test whether the primitive is visible on any layer from @c aLayers
35 This should be overridden by ViewObjectContacts of SDR classes
36 that have subparts which can be on different layers (that is,
37 SdrObjGroup .-)
39 virtual bool isPrimitiveVisibleOnAnyLayer(const SdrLayerIDSet& aLayers) const;
41 protected:
42 const SdrObject& getSdrObject() const;
44 public:
45 ViewObjectContactOfSdrObj(ObjectContact& rObjectContact, ViewContact& rViewContact);
46 virtual ~ViewObjectContactOfSdrObj() override;
48 virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const override;
50 /** retrieves the device which a PageView belongs to, starting from its ObjectContactOfPageView
52 Since #i72752#, the PaintWindow (and thus the OutputDevice) associated with a PageView is not
53 constant over its lifetime. Instead, during some paint operations, the PaintWindow/OutputDevice
54 might be temporarily patched.
56 This method cares for this, by retrieving the very original OutputDevice.
58 const OutputDevice* getPageViewOutputDevice() const;
62 #endif // INCLUDED_SVX_SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */