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

tdeui

  • tdeui
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 TDEPopupMenu;
29 
30 #include <tdelibs_export.h>
31 
44 class TDEUI_EXPORT KPixmapRegionSelectorWidget : public TQWidget
45 {
46  TQ_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 TDEPopupMenu *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 
KImageEffect::RotateDirection
RotateDirection
KPixmapRegionSelectorWidget
KPixmapRegionSelectorWidget is a widget that shows a picture and provides the user with a friendly wa...
Definition: kpixmapregionselectorwidget.h:45
KPixmapRegionSelectorWidget::pixmap
TQPixmap pixmap() const
Definition: kpixmapregionselectorwidget.h:69
TDEPopupMenu
A menu with title items.
Definition: tdepopupmenu.h:123

tdeui

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

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.1
This website is maintained by Timothy Pearson.