home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / KoPen.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-30  |  2.0 KB  |  69 lines

  1. /* This file is part of the KDE project
  2.    Copyright (C) 2005 Peter Simonsson
  3.    Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
  4.  
  5.    This library is free software; you can redistribute it and/or
  6.    modify it under the terms of the GNU Library General Public
  7.    License as published by the Free Software Foundation; either
  8.    version 2 of the License, or (at your option) any later version.
  9.  
  10.    This library is distributed in the hope that it will be useful,
  11.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.    Library General Public License for more details.
  14.  
  15.    You should have received a copy of the GNU Library General Public License
  16.    along with this library; see the file COPYING.LIB.  If not, write to
  17.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18.  * Boston, MA 02110-1301, USA.
  19. */
  20. #ifndef KOPEN_H
  21. #define KOPEN_H
  22.  
  23. #include <qpen.h>
  24.  
  25. class KoZoomHandler;
  26.  
  27. /**
  28.  * Pen that handles line widths in points
  29.  */
  30. class KoPen : public QPen
  31. {
  32.   public:
  33.     KoPen();
  34.     KoPen(const QColor& _color, double _pointWidth, Qt::PenStyle _style);
  35.     KoPen(const QColor& _color);
  36.     ~KoPen();
  37.     
  38.     /**
  39.      * @brief Compare pens if they are equal
  40.      * 
  41.      * Two pens are equal if they have equal styles, widths and colors. 
  42.      *
  43.      * @return true if the pens are equal, false otherwise
  44.      */
  45.     bool operator==( const KoPen &p ) const;
  46.  
  47.     /**
  48.      * @brief Compare pens if they differ
  49.      *
  50.      * Two pens are different if they have different styles, widths or colors.
  51.      *
  52.      * @return true if the pens are different, false otherwise
  53.      */
  54.     bool operator!=( const KoPen &p ) const;
  55.  
  56.     /// Set the pen width in points
  57.     void setPointWidth(double width);
  58.     /// KoPen width in points
  59.     double pointWidth() const { return m_pointWidth; }
  60.  
  61.     /// Returns a zoomed QPen
  62.     QPen zoomedPen(KoZoomHandler* zoomHandler);
  63.  
  64.   private:
  65.     double m_pointWidth;
  66. };
  67.  
  68. #endif
  69.