kivio_icon_view.h
1/*
2 * Kivio - Visual Modelling and Flowcharting
3 * Copyright (C) 2000-2001 theKompany.com & Dave Marotti
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19#ifndef KIVIO_ICON_VIEW_H
20#define KIVIO_ICON_VIEW_H
21
22#include <tqdom.h>
23#include <tqiconview.h>
24#include <tqptrlist.h>
25#include <tqpainter.h>
26#include <tqpalette.h>
27#include <tqpixmap.h>
28#include <tqdragobject.h>
29
30class KivioStencilSpawnerSet;
31class KivioStencilSpawner;
32
33class KivioIconView : public TQIconView
34{
35 TQ_OBJECT
36
37 protected:
38 KivioStencilSpawnerSet *m_pSpawnerSet;
39 static KivioStencilSpawner *m_pCurDrag;
40
41 TQDragObject *dragObject();
42
43 protected slots:
44 void slotDoubleClicked(TQIconViewItem*);
45 void slotClicked(TQIconViewItem* item);
46
47 signals:
48 void createNewStencil(KivioStencilSpawner * );
49 void stencilSelected(KivioStencilSpawner*);
50
51 public:
52 KivioIconView( bool _readWrite,TQWidget *parent=0, const char *name=0 );
53 virtual ~KivioIconView();
54
55 static void clearCurrentDrag();
56 static KivioStencilSpawner *curDragSpawner() { return m_pCurDrag; }
57
58 void setStencilSpawnerSet(KivioStencilSpawnerSet*);
59 KivioStencilSpawnerSet *spawnerSet() { return m_pSpawnerSet; }
60
61 private:
62 static TQPtrList<KivioIconView> objList;
63 bool isReadWrite;
64};
65
66class KivioIconViewItem : public TQIconViewItem
67{
68 friend class KivioIconView;
69
70 protected:
71 KivioStencilSpawner *m_pSpawner;
72
73 public:
74 KivioIconViewItem( TQIconView *parent );
75 virtual ~KivioIconViewItem();
76
77 void setStencilSpawner(KivioStencilSpawner*);
78 KivioStencilSpawner *spawner() { return m_pSpawner; }
79
80 virtual bool acceptDrop( const TQMimeSource *e ) const;
81};
82
83
84#endif
85