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 / kpixmapregionselectordialog.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-10-08  |  3.9 KB  |  108 lines

  1. /* This file is part of the KDE libraries
  2.     Copyright (C) 2004 Antonio Larrosa <larrosa@kde.org
  3.  
  4.     This library is free software; you can redistribute it and/or
  5.     modify it under the terms of the GNU Library General Public
  6.     License as published by the Free Software Foundation; either
  7.     version 2 of the License, or (at your option) any later version.
  8.  
  9.     This library is distributed in the hope that it will be useful,
  10.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.     Library General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU Library General Public License
  15.     along with this library; see the file COPYING.LIB.  If not, write to
  16.     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.     Boston, MA 02110-1301, USA.
  18. */
  19.  
  20. #ifndef __KPIXMAPREGIONSELECTORDIALOG_H__
  21. #define __KPIXMAPREGIONSELECTORDIALOG_H__
  22.  
  23. #include <qimage.h>
  24.  
  25. #include <kdialogbase.h>
  26. #include <kpixmapregionselectorwidget.h>
  27.  
  28. /**
  29.  * A dialog that uses a KPixmapRegionSelectorWidget to allow the user
  30.  * to select a region of an image. If you want to use special features
  31.  * like forcing the selected area to have a fixed aspect ratio, you can use
  32.  * @see pixmapRegionSelectorWidget() to get the pointer to the 
  33.  * KPixmapRegionSelectorWidget object and set the desired options there.
  34.  * 
  35.  * There are some convenience methods that allow to easily show a dialog
  36.  * for the user to select a region of an image, and just care about the selected
  37.  * image.
  38.  *
  39.  * @author Antonio Larrosa <larrosa@kde.org>
  40.  * @since 3.4
  41.  */ 
  42. class KDEUI_EXPORT KPixmapRegionSelectorDialog : public KDialogBase
  43. {
  44. public:
  45.    /**
  46.     * The constructor of an empty KPixmapRegionSelectorDialog, you have to call
  47.     * later the setPixmap method of the KPixmapRegionSelectorWidget widget of
  48.     * the new object.
  49.     */
  50.    KPixmapRegionSelectorDialog(QWidget *parent=0L, const char *name=0L,
  51.                       bool modal = false );
  52.    /**
  53.     * The destructor of the dialog
  54.     */
  55.    ~KPixmapRegionSelectorDialog();
  56.  
  57.    /**
  58.     * @returns the KPixmapRegionSelectorWidget widget so that additional
  59.     * parameters can be set by using it.
  60.     */
  61.    KPixmapRegionSelectorWidget *pixmapRegionSelectorWidget() const 
  62.       { return m_pixmapSelectorWidget; }
  63.    
  64.    /**
  65.     * Creates a modal dialog, lets the user to select a region of the @p pixmap
  66.     * and returns when the dialog is closed.
  67.     *
  68.     * @returns the selected rectangle, or an invalid rectangle if the user 
  69.     * pressed the Cancel button.
  70.     */
  71.    static QRect getSelectedRegion(const QPixmap &pixmap, QWidget *parent = 0L );
  72.  
  73.    /**
  74.     * Creates a modal dialog, lets the user to select a region of the @p pixmap
  75.     * with the same aspect ratio than @p aspectRatioWidth x @p aspectRatioHeight
  76.     * and returns when the dialog is closed.
  77.     *
  78.     * @returns the selected rectangle, or an invalid rectangle if the user 
  79.     * pressed the Cancel button.
  80.     */
  81.    static QRect getSelectedRegion(const QPixmap &pixmap, int aspectRatioWidth, int aspectRatioHeight, QWidget *parent = 0L );
  82.  
  83.    /**
  84.     * Creates a modal dialog, lets the user to select a region of the @p pixmap
  85.     * and returns when the dialog is closed.
  86.     *
  87.     * @returns the selected image, or an invalid image if the user 
  88.     * pressed the Cancel button.
  89.     */
  90.    static QImage getSelectedImage(const QPixmap &pixmap, QWidget *parent = 0L );
  91.  
  92.    /**
  93.     * Creates a modal dialog, lets the user to select a region of the @p pixmap
  94.     * with the same aspect ratio than @p aspectRatioWidth x @p aspectRatioHeight
  95.     * and returns when the dialog is closed.
  96.     *
  97.     * @returns the selected image, or an invalid image if the user 
  98.     * pressed the Cancel button.
  99.     */
  100.    static QImage getSelectedImage(const QPixmap &pixmap, int aspectRatioWidth, int aspectRatioHeight, QWidget *parent = 0L );
  101.  
  102. protected:
  103.    KPixmapRegionSelectorWidget *m_pixmapSelectorWidget;
  104. };
  105.  
  106.  
  107. #endif
  108.