kivio

kiviostencilsetaction.h
1/* This file is part of the KDE project
2 Copyright (C) 2003 Peter Simonsson <psn@linux.se>,
3 theKompany.com & Dave Marotti
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library 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 GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KIVIOSTENCILSETACTION_H
22#define KIVIOSTENCILSETACTION_H
23
24
25#include <tdeaction.h>
26
27#include <tqptrlist.h>
28#include <tqvaluelist.h>
29#include <tqstringlist.h>
30
31class TDEPopupMenu;
32class TQPixmap;
33
34class KivioStencilSetAction : public TDEAction
35{
36 TQ_OBJECT
37
38 public:
39 KivioStencilSetAction(const TQString &text, const TQString &pix,
40 TDEActionCollection *parent, const char *name);
41
42 virtual ~KivioStencilSetAction();
43
44 TDEPopupMenu* popupMenu() const;
45 void popup( const TQPoint& global );
46
47 virtual int plug( TQWidget* widget, int index = -1 );
48
49 public slots:
50 void updateMenu();
51
52 protected slots:
53 void slotActivated(int);
54
55 signals:
56 void activated( const TQString& );
57 void showDialog();
58
59 protected:
60 TQPixmap dirtPixmap( const TQString& dir );
61 void loadCollections( const TQString& rootDirStr );
62 void loadSet( TDEPopupMenu* menu, const TQString& rootDirStr );
63 void clearCollectionMenuList();
64
65 protected:
66 TDEPopupMenu* m_popup;
67 uint m_ssId;
68 TQPtrList<TQString> m_pathList;
69 TQStringList m_collectionIdList;
70 TQValueList<TDEPopupMenu*> m_collectionMenuList;
71};
72
73#endif