kchart

KDFrame.cpp
1/*
2 KD Tools - a set of useful widgets for TQt
3*/
4
5/****************************************************************************
6** Copyright (C) 2001-2003 Klarälvdalens Datakonsult AB. All rights reserved.
7**
8** This file is part of the KD Tools library.
9**
10** This file may be distributed and/or modified under the terms of the
11** GNU General Public License version 2 as published by the Free Software
12** Foundation and appearing in the file LICENSE.GPL included in the
13** packaging of this file.
14**
15** Licensees holding valid commercial KD Tools licenses may use this file in
16** accordance with the KD Tools Commercial License Agreement provided with
17** the Software.
18**
19** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21**
22** See http://www.klaralvdalens-datakonsult.se/?page=products for
23** information about KD Tools Commercial License Agreements.
24**
25** Contact info@klaralvdalens-datakonsult.se if any conditions of this
26** licensing are not clear to you.
27**
28**********************************************************************/
29
30#include <tqpainter.h>
31#include <tqbrush.h>
32
33#include <KDFrame.h>
34#include <KDFrameProfileSection.h>
35#include <KDXMLTools.h>
36
37#if defined( SUN7 ) || defined( _SGIAPI )
38#include <math.h>
39#else
40#include <cmath>
41#endif
42#ifdef TQ_WS_WIN
43#define M_PI 3.14159265358979323846
44#endif
45
46
48{
49 _profileSections.clear(); // is ignored if auto-deletion is disabled
50}
51
53{
54 // Intentionally left blank for now.
55}
56
57
58
59
60
61void KDFrame::paintBackground( TQPainter& painter, const TQRect& innerRect ) const
62{
63 /* first draw the brush (may contain a pixmap)*/
64 if( TQt::NoBrush != _background.style() ) {
65 TQPen oldPen( painter.pen() );
66 TQPoint oldOrig( painter.brushOrigin() );
67 TQBrush oldBrush( painter.brush() );
68 painter.setPen( TQt::NoPen );
69 const TQPoint newTopLeft( painter.xForm( innerRect.topLeft() ) );
70 painter.setBrushOrigin( newTopLeft.x(), newTopLeft.y() );
71 painter.setBrush( _background );
72 painter.drawRect( innerRect.x(), innerRect.y(),
73 innerRect.width(), innerRect.height() );
74 painter.setPen( oldPen );
75 painter.setBrushOrigin( oldOrig );
76 painter.setBrush( oldBrush );
77 }
78 /* next draw the backPixmap over the brush */
79 if( ! _backPixmap.isNull() ) {
80 TQPoint ol = innerRect.topLeft();
81 if( PixCentered == _backPixmapMode )
82 {
83 ol.setX( innerRect.center().x() - _backPixmap.width() / 2 );
84 ol.setY( innerRect.center().y() - _backPixmap.height()/ 2 );
85 bitBlt( painter.device(), ol, &_backPixmap );
86 } else {
87 TQWMatrix m;
88 double zW = (double)innerRect.width() / (double)_backPixmap.width();
89 double zH = (double)innerRect.height() / (double)_backPixmap.height();
90 switch ( _backPixmapMode ) {
91 case PixCentered:
92 break;
93 case PixScaled: {
94 double z;
95 z = TQMIN( zW, zH );
96 m.scale( z, z );
97 }
98 break;
99 case PixStretched:
100 m.scale( zW, zH );
101 break;
102 }
103 TQPixmap pm = _backPixmap.xForm( m );
104 ol.setX( innerRect.center().x() - pm.width() / 2 );
105 ol.setY( innerRect.center().y() - pm.height()/ 2 );
106 bitBlt( painter.device(), ol, &pm );
107 }
108 }
109}
110
111
112void KDFrame::paintEdges( TQPainter& painter, const TQRect& innerRect ) const
113 {
114
115/*
116 Note: The following code OF COURSE is only dummy-code and will be replaced.
117
118 At the moment it is used to draw the simple frames which were set by
119 the setSimpleFrame() function.
120*/
121 if( !_topProfile.isEmpty() ){
122
123 KDFrameProfileSection* section;
124 for ( section = ((KDFrameProfile)_topProfile).last(); section; section = ((KDFrameProfile)_topProfile).prev() ){
125 const TQPen oldPen = painter.pen();
126 const TQBrush oldBrush = painter.brush();
127 TQPen thePen;
128 thePen = section->pen();
129 int penWidth = TQMAX(thePen.width(), 1) * TQMAX(section->width(), 1);
130//tqDebug("paintEdges: thePen.width() = %i", thePen.width());
131//tqDebug("paintEdges: section->width() = %i", section->width());
132//tqDebug("paintEdges: penWidth = %i", penWidth);
133 thePen.setWidth( penWidth );
134 painter.setPen( thePen );
135 painter.setBrush( TQt::NoBrush );
136 painter.drawRect( innerRect.x()-penWidth,
137 innerRect.y()-penWidth,
138 innerRect.width() +2*penWidth,
139 innerRect.height() +2*penWidth );
140 painter.setBrush( oldBrush );
141 painter.setPen( oldPen );
142 }
143 }
144}
145
146
147void KDFrame::paintCorners( TQPainter& /*painter*/, const TQRect& /*innerRect*/ ) const
148{
149 // At the moment nothing is done here since the setSimpleFrame() function
150 // does not allow specifying corners: all predefined frames have normal
151 // (default) corners.
152 ;
153}
154
155
156void KDFrame::paint( TQPainter* painter,
157 KDFramePaintSteps steps,
158 TQRect innerRect ) const
159{
160 if( painter ) {
161 const TQRect& rect = innerRect.isValid() ? innerRect : _innerRect;
162 switch( steps ) {
163 case PaintBackground:
164 paintBackground( *painter, rect );
165 break;
166 case PaintEdges:
167 paintEdges( *painter, rect );
168 break;
169 case PaintCorners:
170 paintCorners( *painter, rect );
171 break;
172 case PaintBorder:
173 paintEdges( *painter, rect );
174 paintCorners( *painter, rect );
175 break;
176 case PaintAll:
177 paintBackground( *painter, rect );
178 paintEdges( *painter, rect );
179 paintCorners( *painter, rect );
180 break;
181 }
182 }
183}
184
185
187{
188 switch( name ) {
189 case ProfileTop: _topProfile.clear();
190 break;
191 case ProfileRight: _rightProfile.clear();
192 break;
193 case ProfileBottom:_bottomProfile.clear();
194 break;
195 case ProfileLeft: _leftProfile.clear();
196 break;
197 }
198}
199
201 int wid,
202 TQPen pen,
205{
206 switch( name ) {
207 case ProfileTop: _topProfile.append( new KDFrameProfileSection( dir, curv, wid, pen ) );
208 break;
209 case ProfileRight: _rightProfile.append( new KDFrameProfileSection( dir, curv, wid, pen ) );
210 break;
211 case ProfileBottom:_bottomProfile.append(new KDFrameProfileSection( dir, curv, wid, pen ) );
212 break;
213 case ProfileLeft: _leftProfile.append( new KDFrameProfileSection( dir, curv, wid, pen ) );
214 break;
215 }
216}
217
218void KDFrame::setProfile( ProfileName name, const KDFrameProfile& profile )
219{
220 switch( name ) {
221 case ProfileTop: _topProfile = profile;
222 break;
223 case ProfileRight: _rightProfile = profile;
224 break;
225 case ProfileBottom:_bottomProfile = profile;
226 break;
227 case ProfileLeft: _leftProfile = profile;
228 break;
229 }
230}
231
232const KDFrameProfile& KDFrame::profile( ProfileName name ) const
233{
234 switch( name ) {
235 case ProfileTop: return _topProfile;
236 break;
237 case ProfileRight: return _rightProfile;
238 break;
239 case ProfileBottom:return _bottomProfile;
240 break;
241 default: return _leftProfile;
242 }
243
244 return _leftProfile;
245}
246
247
249 int lineWidth,
250 int midLineWidth,
251 TQPen pen,
252 TQBrush background,
253 const TQPixmap* backPixmap,
254 BackPixmapMode backPixmapMode )
255{
256 _profileSections.clear();
257 _topProfile.clear();
258 _rightProfile.clear();
259 _bottomProfile.clear();
260 _leftProfile.clear();
261 _background = background;
262 _backPixmap = backPixmap ? *backPixmap : TQPixmap();
263 _backPixmapMode = backPixmapMode;
264 if( FrameFlat == frame ) {
265 //tqDebug("_profileSections.count() before = %i", _profileSections.count());
266 KDFrameProfileSection* newsection =
267 new KDFrameProfileSection( KDFrameProfileSection::DirPlain,
268 KDFrameProfileSection::CvtPlain,
269 lineWidth, pen );
270 _profileSections.append( newsection );
271 //tqDebug( "_profileSections.count() after = %i, lineWidth = %i",
272 // _profileSections.count(),
273 // lineWidth );
274 _topProfile.append( newsection );
275 _rightProfile = _topProfile;
276 _bottomProfile = _topProfile;
277 _leftProfile = _topProfile;
278 }
279 else {
280 switch( frame ) {
281 case FrameElegance: {
282 int line1 = lineWidth / 8;
283 int line2 = lineWidth / 16;
284 int line3 = line2;
285 int gap2 = line2 * 4;
286 int gap1 = lineWidth - line1 - line2 - line3 - gap2;
287 TQPen noP( TQt::NoPen );
288 KDFrameProfileSection* newsection;
289 newsection = new KDFrameProfileSection( KDFrameProfileSection::DirPlain,
290 KDFrameProfileSection::CvtPlain,
291 line1, pen );
292 _profileSections.append( newsection );
293 _topProfile.append( newsection );
294 newsection = new KDFrameProfileSection( KDFrameProfileSection::DirPlain,
295 KDFrameProfileSection::CvtPlain,
296 gap1, noP );
297 _profileSections.append( newsection );
298 _topProfile.append( newsection );
299 newsection = new KDFrameProfileSection( KDFrameProfileSection::DirPlain,
300 KDFrameProfileSection::CvtPlain,
301 line2, pen );
302 _profileSections.append( newsection );
303 _topProfile.append( newsection );
304 newsection = new KDFrameProfileSection( KDFrameProfileSection::DirPlain,
305 KDFrameProfileSection::CvtPlain,
306 gap2, noP );
307 _profileSections.append( newsection );
308 _topProfile.append( newsection );
309 newsection = new KDFrameProfileSection( KDFrameProfileSection::DirPlain,
310 KDFrameProfileSection::CvtPlain,
311 line3, pen );
312 _profileSections.append( newsection );
313 _topProfile.append( newsection );
314 }
315 break;
316 case FrameBoxRaized:
317 {
318 KDFrameProfileSection* newsection;
319 newsection = new KDFrameProfileSection( KDFrameProfileSection::DirRaising,
320 KDFrameProfileSection::CvtPlain,
321 lineWidth, pen );
322 _profileSections.append( newsection );
323 _topProfile.append( newsection );
324 newsection = new KDFrameProfileSection( KDFrameProfileSection::DirPlain,
325 KDFrameProfileSection::CvtPlain,
326 midLineWidth, pen );
327 _profileSections.append( newsection );
328 _topProfile.append( newsection );
329 newsection = new KDFrameProfileSection( KDFrameProfileSection::DirSinking,
330 KDFrameProfileSection::CvtPlain,
331 lineWidth, pen );
332 _profileSections.append( newsection );
333 _topProfile.append( newsection );
334 break;
335 }
336 case FrameBoxSunken:
337 {
338 KDFrameProfileSection* newsection;
339 newsection = new KDFrameProfileSection( KDFrameProfileSection::DirSinking,
340 KDFrameProfileSection::CvtPlain,
341 lineWidth, pen );
342 _profileSections.append( newsection );
343 _topProfile.append( newsection );
344 newsection = new KDFrameProfileSection( KDFrameProfileSection::DirPlain,
345 KDFrameProfileSection::CvtPlain,
346 midLineWidth, pen );
347 _profileSections.append( newsection );
348 _topProfile.append( newsection );
349 newsection = new KDFrameProfileSection( KDFrameProfileSection::DirRaising,
350 KDFrameProfileSection::CvtPlain,
351 lineWidth, pen );
352 _profileSections.append( newsection );
353 _topProfile.append( newsection );
354 }
355 break;
356 case FramePanelRaized:
357 {
358 KDFrameProfileSection* newsection;
359 newsection = new KDFrameProfileSection( KDFrameProfileSection::DirRaising,
360 KDFrameProfileSection::CvtPlain,
361 lineWidth, pen );
362 _profileSections.append( newsection );
363 _topProfile.append( newsection );
364 break;
365 }
366 case FramePanelSunken:
367 {
368 KDFrameProfileSection* newsection;
369 newsection = new KDFrameProfileSection( KDFrameProfileSection::DirSinking,
370 KDFrameProfileSection::CvtPlain,
371 lineWidth, pen );
372 _profileSections.append( newsection );
373 _topProfile.append( newsection );
374 }
375 break;
376 case FrameSemicircular:
377 {
378 KDFrameProfileSection* newsection;
379 newsection = new KDFrameProfileSection( KDFrameProfileSection::DirRaising,
380 KDFrameProfileSection::CvtConvex,
381 lineWidth, pen );
382 _profileSections.append( newsection );
383 _topProfile.append( newsection );
384 newsection = new KDFrameProfileSection( KDFrameProfileSection::DirPlain,
385 KDFrameProfileSection::CvtPlain,
386 midLineWidth, pen );
387 _profileSections.append( newsection );
388 _topProfile.append( newsection );
389 newsection = new KDFrameProfileSection( KDFrameProfileSection::DirSinking,
390 KDFrameProfileSection::CvtConcave,
391 lineWidth, pen );
392 _profileSections.append( newsection );
393 _topProfile.append( newsection );
394 }
395 break;
396 default:
397 break;
398 }
399 }
400 _rightProfile = _topProfile;
401 _bottomProfile = _topProfile;
402 _leftProfile = _topProfile;
403 setCorners( CornerNormal, 0 );
404}
405
406
407void KDFrame::createFrameNode( TQDomDocument& document, TQDomNode& parent,
408 const TQString& elementName,
409 const KDFrame& frame )
410{
411 TQDomElement frameElement = document.createElement( elementName );
412 parent.appendChild( frameElement );
413 KDXML::createIntNode( document, frameElement, "ShadowWidth",
414 frame._shadowWidth );
415 KDXML::createStringNode( document, frameElement, "CornerName",
416 cornerNameToString( frame._sunPos ) );
417
418 KDXML::createBrushNode( document, frameElement, "Background",
419 frame._background );
420 KDXML::createPixmapNode( document, frameElement, "BackPixmap",
421 frame._backPixmap );
422 KDXML::createStringNode( document, frameElement, "BackPixmapMode",
423 backPixmapModeToString( frame._backPixmapMode ) );
424
425 KDXML::createRectNode( document, frameElement, "InnerRect",
426 frame._innerRect );
427 createFrameProfileNode( document, frameElement, "TopProfile",
428 frame._topProfile );
429 createFrameProfileNode( document, frameElement, "RightProfile",
430 frame._rightProfile );
431 createFrameProfileNode( document, frameElement, "BottomProfile",
432 frame._bottomProfile );
433 createFrameProfileNode( document, frameElement, "LeftProfile",
434 frame._leftProfile );
435 KDFrameCorner::createFrameCornerNode( document, frameElement, "CornerTL",
436 frame._cornerTL );
437 KDFrameCorner::createFrameCornerNode( document, frameElement, "CornerTR",
438 frame._cornerTR );
439 KDFrameCorner::createFrameCornerNode( document, frameElement, "CornerBL",
440 frame._cornerBL );
441 KDFrameCorner::createFrameCornerNode( document, frameElement, "CornerBR",
442 frame._cornerBR );
443}
444
445void KDFrame::createFrameProfileNode( TQDomDocument& document, TQDomNode& parent,
446 const TQString& elementName,
447 KDFrameProfile profile )
448{
449 TQDomElement profileElement = document.createElement( elementName );
450 parent.appendChild( profileElement );
451 for( const KDFrameProfileSection* section = profile.first(); section != 0;
452 section = profile.next() )
454 profileElement,
455 "ProfileSection",
456 section );
457}
458
459
461 TQDomNode& parent,
462 const TQString& elementName,
463 const KDFrameCorner& corner )
464{
465 TQDomElement cornerElement = document.createElement( elementName );
466 parent.appendChild( cornerElement );
467 KDXML::createStringNode( document, cornerElement, "Style",
468 KDFrame::cornerStyleToString( corner._style ) );
469 KDXML::createIntNode( document, cornerElement, "Width",
470 corner._width );
471 createFrameProfileNode( document, cornerElement, "Profile",
472 corner._profile );
473}
474
475bool KDFrame::readFrameNode( const TQDomElement& element, KDFrame& frame )
476{
477 bool ok = true;
478 int tempShadowWidth;
479 CornerName tempCornerName=CornerTopLeft;
480 TQBrush tempBackground;
481 TQPixmap tempBackPixmap;
482 BackPixmapMode tempBackPixmapMode=PixStretched;
483 TQRect tempInnerRect;
484 KDFrameProfile tempTopProfile, tempRightProfile,
485 tempBottomProfile, tempLeftProfile;
486 KDFrameCorner tempCornerTL, tempCornerTR, tempCornerBL, tempCornerBR;
487 TQDomNode node = element.firstChild();
488 while( !node.isNull() ) {
489 TQDomElement element = node.toElement();
490 if( !element.isNull() ) { // was really an element
491 TQString tagName = element.tagName();
492 if( tagName == "ShadowWidth" ) {
493 ok = ok & KDXML::readIntNode( element, tempShadowWidth );
494 } else if( tagName == "CornerName" ) {
495 TQString value;
496 ok = ok & KDXML::readStringNode( element, value );
497 tempCornerName = stringToCornerName( value );
498 } else if( tagName == "Background" ) {
499 ok = ok & KDXML::readBrushNode( element, tempBackground );
500 } else if( tagName == "BackPixmap" ) {
501 ok = ok & KDXML::readPixmapNode( element, tempBackPixmap );
502 } else if( tagName == "BackPixmapMode" ) {
503 TQString value;
504 ok = ok & KDXML::readStringNode( element, value );
505 tempBackPixmapMode = stringToBackPixmapMode( value );
506 } else if( tagName == "InnerRect" ) {
507 ok = ok & KDXML::readRectNode( element, tempInnerRect );
508 } else if( tagName == "TopProfile" ) {
509 ok = ok & readFrameProfileNode( element, tempTopProfile );
510 } else if( tagName == "RightProfile" ) {
511 ok = ok & readFrameProfileNode( element, tempRightProfile );
512 } else if( tagName == "BottomProfile" ) {
513 ok = ok & readFrameProfileNode( element, tempBottomProfile );
514 } else if( tagName == "LeftProfile" ) {
515 ok = ok & readFrameProfileNode( element, tempLeftProfile );
516 } else if( tagName == "CornerTL" ) {
517 ok = ok & KDFrameCorner::readFrameCornerNode( element,
518 tempCornerTL );
519 } else if( tagName == "CornerTR" ) {
520 ok = ok & KDFrameCorner::readFrameCornerNode( element,
521 tempCornerTR );
522 } else if( tagName == "CornerBL" ) {
523 ok = ok & KDFrameCorner::readFrameCornerNode( element,
524 tempCornerBL );
525 } else if( tagName == "CornerBR" ) {
526 ok = ok & KDFrameCorner::readFrameCornerNode( element,
527 tempCornerBR );
528 } else {
529 tqDebug( "Unknown tag in frame" );
530 }
531 }
532 node = node.nextSibling();
533 }
534
535 if( ok ) {
536 frame._shadowWidth = tempShadowWidth;
537 frame._sunPos = tempCornerName;
538 frame._background = tempBackground;
539 frame._backPixmap = tempBackPixmap;
540 frame._backPixmapMode = tempBackPixmapMode;
541 frame._innerRect = tempInnerRect;
542 frame._topProfile = tempTopProfile;
543 frame._rightProfile = tempRightProfile;
544 frame._bottomProfile = tempBottomProfile;
545 frame._leftProfile = tempLeftProfile;
546 frame._cornerTL = tempCornerTL;
547 frame._cornerTR = tempCornerTR;
548 frame._cornerBL = tempCornerBL;
549 frame._cornerBR = tempCornerBR;
550 }
551
552 return ok;
553}
554
555
556bool KDFrame::readFrameProfileNode( const TQDomElement& element,
557 KDFrameProfile& profile )
558{
559 TQDomNode node = element.firstChild();
560 while( !node.isNull() ) {
561 TQDomElement element = node.toElement();
562 if( !element.isNull() ) { // was really an element
563 TQString tagName = element.tagName();
564 if( tagName == "ProfileSection" ) {
567 section );
568 profile.append( section );
569 } else {
570 tqDebug( "Unknown tag in double map" );
571 return false;
572 }
573 }
574 node = node.nextSibling();
575 }
576
577 return true;
578}
579
580
581bool KDFrame::KDFrameCorner::readFrameCornerNode( const TQDomElement& element,
582 KDFrameCorner& corner )
583{
584 bool ok = true;
585 CornerStyle tempStyle=CornerNormal;
586 int tempWidth;
587 KDFrameProfile tempProfile;
588 TQDomNode node = element.firstChild();
589 while( !node.isNull() ) {
590 TQDomElement element = node.toElement();
591 if( !element.isNull() ) { // was really an element
592 TQString tagName = element.tagName();
593 if( tagName == "Style" ) {
594 TQString value;
595 ok = ok & KDXML::readStringNode( element, value );
596 tempStyle = stringToCornerStyle( value );
597 } else if( tagName == "Width" ) {
598 ok = ok & KDXML::readIntNode( element, tempWidth );
599 } else if( tagName == "Profile" ) {
600 KDFrameProfile profile;
601 ok = ok & readFrameProfileNode( element, profile );
602 } else {
603 tqDebug( "Unknown tag in frame" );
604 }
605 }
606 node = node.nextSibling();
607 }
608
609 if( ok ) {
610 corner._style = tempStyle;
611 corner._width = tempWidth;
612 corner._profile = tempProfile;
613 }
614
615 return ok;
616}
617
618#include "KDFrame.moc"
Header of the KDFrame class providing highly configurable rectangular frame drawing.
Settings for one profile section of one side of the frame.
static void createFrameProfileSectionNode(TQDomDocument &document, TQDomNode &parent, const TQString &elementName, const KDFrameProfileSection *section)
Creates a DOM element node that represents a frame profile section for use in a DOM document.
Curvature
Profile Curvature Mode: specifying the shape of a frame profile section.
Direction
Profile Direction Mode: specifying whether a part of a profile looks embossed or engraved in comparis...
static bool readFrameProfileSectionNode(const TQDomElement &element, KDFrameProfileSection *section)
Reads data from a DOM element node that represents a frame profile section and fills a KDFrameProfile...
virtual ~KDFrameCorner()
Destructor.
Definition KDFrame.cpp:52
static void createFrameCornerNode(TQDomDocument &document, TQDomNode &parent, const TQString &elementName, const KDFrameCorner &corner)
Definition KDFrame.cpp:460
static bool readFrameCornerNode(const TQDomElement &element, KDFrameCorner &corner)
Definition KDFrame.cpp:581
const KDFrameProfile & profile(ProfileName name) const
Definition KDFrame.cpp:232
static BackPixmapMode stringToBackPixmapMode(const TQString &string)
Converts the specified string to a background pixmap mode enum value.
Definition KDFrame.h:140
BackPixmapMode
These are ways how to display a pixmap that might be painted into the inner area.
Definition KDFrame.h:109
void addProfileSection(ProfileName name, int wid, TQPen pen, KDFrameProfileSection::Direction dir=KDFrameProfileSection::DirPlain, KDFrameProfileSection::Curvature curv=KDFrameProfileSection::CvtPlain)
Definition KDFrame.cpp:200
KDFramePaintSteps
The different steps taken to paint the frame: first paint the background then the edges then the corn...
Definition KDFrame.h:843
TQRect innerRect() const
Returns the position and the size of the frame.
Definition KDFrame.h:797
KDFrame(TQRect innerRect=TQRect(0, 0, 0, 0), SimpleFrame frame=FrameFlat, int lineWidth=1, int midLineWidth=0, TQPen pen=TQPen(), TQBrush background=TQBrush(), const TQPixmap *backPixmap=0, BackPixmapMode backPixmapMode=PixStretched, int shadowWidth=0, CornerName sunPos=CornerTopLeft)
Default Constructor.
Definition KDFrame.h:917
SimpleFrame
These simple frames are pre-defined for your convenience.
Definition KDFrame.h:177
virtual void paint(TQPainter *painter, KDFramePaintSteps steps=PaintAll, TQRect innerRect=TQRect(0, 0, 0, 0)) const
Paint methode actually drawing the frame.
Definition KDFrame.cpp:156
static void createFrameNode(TQDomDocument &document, TQDomNode &parent, const TQString &elementName, const KDFrame &frame)
Creates a DOM element node that represents a frame for use in a DOM document.
Definition KDFrame.cpp:407
void clearProfile(ProfileName name)
Definition KDFrame.cpp:186
static CornerName stringToCornerName(const TQString &string)
Definition KDFrame.h:394
static TQString cornerStyleToString(CornerStyle type)
Definition KDFrame.h:440
virtual void paintCorners(TQPainter &painter, const TQRect &innerRect) const
Paint methode drawing the corners (if any) of the frame.
Definition KDFrame.cpp:147
void setProfile(ProfileName name, const KDFrameProfile &profile)
Definition KDFrame.cpp:218
virtual ~KDFrame()
Destructor.
Definition KDFrame.cpp:47
static void createFrameProfileNode(TQDomDocument &document, TQDomNode &parent, const TQString &elementName, KDFrameProfile profile)
Creates a DOM element node that represents a frame profile for use in a DOM document.
Definition KDFrame.cpp:445
virtual void paintEdges(TQPainter &painter, const TQRect &innerRect) const
Paint methode drawing the edges (if any) of the frame.
Definition KDFrame.cpp:112
static bool readFrameNode(const TQDomElement &element, KDFrame &frame)
Reads data from a DOM element node that represents a frame object and fills a KDFrame object with the...
Definition KDFrame.cpp:475
static TQString cornerNameToString(CornerName type)
Definition KDFrame.h:366
void setSimpleFrame(SimpleFrame frame, int lineWidth, int midLineWidth, TQPen pen, TQBrush background=TQBrush(), const TQPixmap *backPixmap=0, BackPixmapMode backPixmapMode=PixStretched)
Definition KDFrame.cpp:248
static TQString backPixmapModeToString(BackPixmapMode type)
Converts the specified background pixmap mode enum to a string representation.
Definition KDFrame.h:120
ProfileName
Definition KDFrame.h:241
static bool readFrameProfileNode(const TQDomElement &element, KDFrameProfile &profile)
Reads data from a DOM element node that represents a frame profile and fills a KDFrameProfile object ...
Definition KDFrame.cpp:556
void setCorners(CornerStyle style, int width, KDFrameProfile *const profile=0)
Definition KDFrame.h:615
static CornerStyle stringToCornerStyle(const TQString &string)
Definition KDFrame.h:464
CornerStyle
Definition KDFrame.h:425
virtual void paintBackground(TQPainter &painter, const TQRect &innerRect) const
Paint methode drawing the background (if any) of the frame.
Definition KDFrame.cpp:61
const TQBrush & background(const TQPixmap *&backPixmap, BackPixmapMode &backPixmapMode) const
Returns the brush that is used to fill the inner area of this frame, or a TQBrush( \cNoBrush ) if no ...
Definition KDFrame.h:763