1*0d63794cSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*0d63794cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*0d63794cSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*0d63794cSAndrew Rist * distributed with this work for additional information 6*0d63794cSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*0d63794cSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*0d63794cSAndrew Rist * "License"); you may not use this file except in compliance 9*0d63794cSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*0d63794cSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*0d63794cSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*0d63794cSAndrew Rist * software distributed under the License is distributed on an 15*0d63794cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*0d63794cSAndrew Rist * KIND, either express or implied. See the License for the 17*0d63794cSAndrew Rist * specific language governing permissions and limitations 18*0d63794cSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*0d63794cSAndrew Rist *************************************************************/ 21*0d63794cSAndrew Rist 22*0d63794cSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #pragma once 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <rtl/string.hxx> 27cdf0e10cSrcweir #include <unx/saldisp.hxx> 28cdf0e10cSrcweir #include <unx/salgdi.h> 29cdf0e10cSrcweir 30cdf0e10cSrcweir #define Region QtXRegion 31cdf0e10cSrcweir #include <QImage> 32cdf0e10cSrcweir #undef Region 33cdf0e10cSrcweir 34cdf0e10cSrcweir /** handles graphics drawings requests and performs the needed drawing operations */ 35cdf0e10cSrcweir class KDESalGraphics : public X11SalGraphics 36cdf0e10cSrcweir { 37cdf0e10cSrcweir QImage* m_image; 38cdf0e10cSrcweir 39cdf0e10cSrcweir public: 40cdf0e10cSrcweir KDESalGraphics(); 41cdf0e10cSrcweir virtual ~KDESalGraphics(); 42cdf0e10cSrcweir 43cdf0e10cSrcweir /** 44cdf0e10cSrcweir What widgets can be drawn the native way. 45cdf0e10cSrcweir @param type Type of the widget. 46cdf0e10cSrcweir @param part Specification of the widget's part if it consists of more than one. 47cdf0e10cSrcweir @return true if the platform supports native drawing of the widget type defined by part. 48cdf0e10cSrcweir */ 49cdf0e10cSrcweir virtual sal_Bool IsNativeControlSupported( ControlType type, ControlPart part ); 50cdf0e10cSrcweir 51cdf0e10cSrcweir /** Test whether the position is in the native widget. 52cdf0e10cSrcweir If the return value is TRUE, bIsInside contains information whether 53cdf0e10cSrcweir aPos was or was not inside the native widget specified by the 54cdf0e10cSrcweir type/part combination. 55cdf0e10cSrcweir */ 56cdf0e10cSrcweir virtual sal_Bool hitTestNativeControl( ControlType type, ControlPart part, 57cdf0e10cSrcweir const Rectangle& rControlRegion, const Point& aPos, 58cdf0e10cSrcweir sal_Bool& rIsInside ); 59cdf0e10cSrcweir /** Draw the requested control described by part/nControlState. 60cdf0e10cSrcweir 61cdf0e10cSrcweir @param rControlRegion 62cdf0e10cSrcweir The bounding Rectangle of the complete control in VCL frame coordinates. 63cdf0e10cSrcweir 64cdf0e10cSrcweir @param aValue 65cdf0e10cSrcweir An optional value (tristate/numerical/string). 66cdf0e10cSrcweir 67cdf0e10cSrcweir @param aCaption 68cdf0e10cSrcweir A caption or title string (like button text etc.) 69cdf0e10cSrcweir */ 70cdf0e10cSrcweir virtual sal_Bool drawNativeControl( ControlType type, ControlPart part, 71cdf0e10cSrcweir const Rectangle& rControlRegion, ControlState nControlState, 72cdf0e10cSrcweir const ImplControlValue& aValue, 73cdf0e10cSrcweir const rtl::OUString& aCaption ); 74cdf0e10cSrcweir 75cdf0e10cSrcweir /** Draw text on the widget. 76cdf0e10cSrcweir OPTIONAL. Draws the requested text for the control described by part/nControlState. 77cdf0e10cSrcweir Used if text is not drawn by DrawNativeControl(). 78cdf0e10cSrcweir 79cdf0e10cSrcweir @param rControlRegion The bounding region of the complete control in VCL frame coordinates. 80cdf0e10cSrcweir @param aValue An optional value (tristate/numerical/string) 81cdf0e10cSrcweir @param aCaption A caption or title string (like button text etc.) 82cdf0e10cSrcweir */ drawNativeControlText(ControlType,ControlPart,const Rectangle &,ControlState,const ImplControlValue &,const rtl::OUString &)83cdf0e10cSrcweir virtual sal_Bool drawNativeControlText( ControlType, ControlPart, 84cdf0e10cSrcweir const Rectangle&, ControlState, 85cdf0e10cSrcweir const ImplControlValue&, 86cdf0e10cSrcweir const rtl::OUString& ) { return false; } 87cdf0e10cSrcweir /** Check if the bounding regions match. 88cdf0e10cSrcweir 89cdf0e10cSrcweir If the return value is TRUE, rNativeBoundingRegion 90cdf0e10cSrcweir contains the true bounding region covered by the control 91cdf0e10cSrcweir including any adornment, while rNativeContentRegion contains the area 92cdf0e10cSrcweir within the control that can be safely drawn into without drawing over 93cdf0e10cSrcweir the borders of the control. 94cdf0e10cSrcweir 95cdf0e10cSrcweir @param rControlRegion 96cdf0e10cSrcweir The bounding region of the control in VCL frame coordinates. 97cdf0e10cSrcweir 98cdf0e10cSrcweir @param aValue 99cdf0e10cSrcweir An optional value (tristate/numerical/string) 100cdf0e10cSrcweir 101cdf0e10cSrcweir @param aCaption 102cdf0e10cSrcweir A caption or title string (like button text etc.) 103cdf0e10cSrcweir */ 104cdf0e10cSrcweir virtual sal_Bool getNativeControlRegion( ControlType type, ControlPart part, 105cdf0e10cSrcweir const Rectangle& rControlRegion, ControlState nControlState, 106cdf0e10cSrcweir const ImplControlValue& aValue, 107cdf0e10cSrcweir const rtl::OUString& aCaption, 108cdf0e10cSrcweir Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion ); 109cdf0e10cSrcweir }; 110