• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdeui
 

kdeui

  • kdeui
kpixmapregionselectorwidget.h
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 __KPIXMAPREGIONSELECTORWIDGET_H__
21 #define __KPIXMAPREGIONSELECTORWIDGET_H__
22 #include <tqvbox.h>
23 #include <tqpixmap.h>
24 #include <tqrect.h>
25 #include <tqlabel.h>
26 #include <kimageeffect.h>
27 
28 class KPopupMenu;
29 
30 #include <kdelibs_export.h>
31 
44 class KDEUI_EXPORT KPixmapRegionSelectorWidget : public TQWidget
45 {
46  Q_OBJECT
47 public:
51  KPixmapRegionSelectorWidget( TQWidget *parent = 0L, const char *name=0L);
52 
56  ~KPixmapRegionSelectorWidget();
57 
63  void setPixmap( const TQPixmap &pixmap );
64 
69  TQPixmap pixmap() const { return m_unzoomedPixmap; }
70 
74  void setSelectedRegion(const TQRect &rect);
75 
79  TQRect selectedRegion() const;
80 
84  TQRect unzoomedSelectedRegion() const;
85 
89  void resetSelection();
90 
95  TQImage selectedImage() const;
96 
102  void setSelectionAspectRatio(int width, int height);
103 
109  void setFreeSelectionAspectRatio();
110 
116  void setMaximumWidgetSize( int width, int height );
117 
124  void rotate(KImageEffect::RotateDirection direction);
125 
126 public slots:
130  void rotateClockwise();
134  void rotateCounterclockwise();
135 
136 protected:
140  virtual KPopupMenu *createPopupMenu();
141 
142 private:
143  bool eventFilter(TQObject *obj, TQEvent *ev);
144 
149  void updatePixmap();
150 
151  TQRect calcSelectionRectangle( const TQPoint &startPoint, const TQPoint & endPoint );
152 
153  enum CursorState { None=0, Resizing, Moving };
154  CursorState m_state;
155 
156  TQPixmap m_unzoomedPixmap;
157  TQPixmap m_originalPixmap;
158  TQPixmap m_linedPixmap;
159  TQRect m_selectedRegion;
160  TQLabel *m_label;
161 
162  TQPoint m_tempFirstClick;
163  double m_forcedAspectRatio;
164 
165  int m_maxWidth, m_maxHeight;
166  double m_zoomFactor;
167 };
168 
169 #endif
170 

kdeui

Skip menu "kdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeui

Skip menu "kdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdeui by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |