chalk

imageviewer.h
1/***************************************************************************
2 * Copyright (C) 2005 Eyal Lotem <eyal.lotem@gmail.com> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program 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 *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
19#ifndef PIXMAPVIEWER_H
20#define PIXMAPVIEWER_H
21
22#include <tqscrollview.h>
23#include <tqimage.h>
24
25class TQLabel;
26
33class ImageViewer : public TQScrollView {
34 TQ_OBJECT
35
36
37public:
38 ImageViewer(TQWidget *widget, const char * name = 0);
39
40 void setImage(TQImage & image);
41
42 void contentsMousePressEvent(TQMouseEvent *event);
43 void contentsMouseReleaseEvent(TQMouseEvent *event);
44 void contentsMouseMoveEvent(TQMouseEvent *event);
45 void wheelEvent(TQWheelEvent * event) { event->ignore(); };
46private:
47 TQLabel* m_label;
48 bool m_isDragging;
49 TQPoint m_currentPos;
50 TQPixmap m_image;
51};
52
53#endif