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 / KoGuideLineDia.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-30  |  3.0 KB  |  97 lines

  1. // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
  2. /* This file is part of the KDE project
  3.    Copyright (C)  2002 Montel Laurent <lmontel@mandrakesoft.com>
  4.    Copyright (C)  2005 Thorsten Zachmann <zachmann@kde.org>
  5.  
  6.    This library is free software; you can redistribute it and/or
  7.    modify it under the terms of the GNU Library General Public
  8.    License as published by the Free Software Foundation; either
  9.    version 2 of the License, or (at your option) any later version.
  10.  
  11.    This library is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.    Library General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU Library General Public License
  17.    along with this library; see the file COPYING.LIB.  If not, write to
  18.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  19.  * Boston, MA 02110-1301, USA.
  20. */
  21.  
  22. #ifndef KOGUIDELINEDIA_H
  23. #define KOGUIDELINEDIA_H
  24.  
  25. #include <kdialogbase.h>
  26. #include <KoUnit.h>
  27. #include "KoRect.h"
  28. #include "KoPoint.h"
  29.  
  30.  
  31. class KoUnitDoubleSpinBox;
  32. class QRadioButton;
  33.  
  34. /**
  35.  * @brief Class for setting a guide line position.
  36.  */
  37. class KoGuideLineDia : public KDialogBase
  38. {
  39.     Q_OBJECT
  40. public:
  41.     /**
  42.      * @brief Constructor
  43.      *
  44.      * @param parent The parent widget
  45.      * @param pos the actual position of the guide line
  46.      * @param minPos the minimal position of the guide line
  47.      * @param maxPos the maximal position of the guide line
  48.      * @param unit The unit used in the document
  49.      * @param name The name is send to the QObject constructor
  50.      */
  51.     KoGuideLineDia( QWidget *parent, double pos, double minPos, double maxPos,
  52.                     KoUnit::Unit unit, const char *name = 0L );
  53.  
  54.     /**
  55.      * @brief Constructor
  56.      *
  57.      * This shows a dialog to add a guide line. As long the position is not changed 
  58.      * and the orientation of the guide line is changed the value will be set to pos.x()
  59.      * or pos.y() according to the orientation.
  60.      *
  61.      * @param parent the parent widget
  62.      * @param pos the actual position of cursor
  63.      * @param rect the rect in where the guide can be placed
  64.      * @param unit the unit used in the document
  65.      * @param name the name is send to the QObject constructor
  66.      */
  67.     KoGuideLineDia( QWidget *parent, KoPoint &pos, KoRect &rect,
  68.                     KoUnit::Unit unit, const char *name = 0L );
  69.     /**
  70.      * @brief the position
  71.      *
  72.      * @return the value of the position input
  73.      */
  74.     double pos() const;
  75.  
  76.     /**
  77.      * @brief the orientation
  78.      *
  79.      * @return the orientation of the added guide line
  80.      */
  81.     Qt::Orientation orientation() const;
  82.  
  83. protected slots:
  84.     void slotOrientationChanged();
  85.     void slotPositionChanged();
  86.  
  87. protected:
  88.     KoRect m_rect;
  89.     KoPoint m_pos;
  90.     bool m_positionChanged;
  91.     QRadioButton * m_hButton;
  92.     QRadioButton * m_vButton;
  93.     KoUnitDoubleSpinBox* m_position;
  94. };
  95.  
  96. #endif // KOGUIDELINEDIA_H
  97.