kivio

kiviostencilsetaction.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 Peter Simonsson <psn@linux.se>,
00003    theKompany.com & Dave Marotti
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018    Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KIVIOSTENCILSETACTION_H
00022 #define KIVIOSTENCILSETACTION_H
00023 
00024 
00025 #include <kaction.h>
00026 
00027 #include <qptrlist.h>
00028 #include <qvaluelist.h>
00029 #include <qstringlist.h>
00030 
00031 class KPopupMenu;
00032 class QPixmap;
00033 
00034 class KivioStencilSetAction : public KAction
00035 {
00036   Q_OBJECT
00037   public:
00038     KivioStencilSetAction(const QString &text, const QString &pix,
00039       KActionCollection *parent, const char *name);
00040 
00041     virtual ~KivioStencilSetAction();
00042 
00043     KPopupMenu* popupMenu() const;
00044     void popup( const QPoint& global );
00045 
00046     virtual int plug( QWidget* widget, int index = -1 );
00047 
00048   public slots:
00049     void updateMenu();
00050 
00051   protected slots:
00052     void slotActivated(int);
00053 
00054   signals:
00055     void activated( const QString& );
00056     void showDialog();
00057 
00058   protected:
00059     QPixmap dirtPixmap( const QString& dir );
00060     void loadCollections( const QString& rootDirStr );
00061     void loadSet( KPopupMenu* menu, const QString& rootDirStr );
00062     void clearCollectionMenuList();
00063 
00064   protected:
00065     KPopupMenu* m_popup;
00066     uint m_ssId;
00067     QPtrList<QString> m_pathList;
00068     QStringList m_collectionIdList;
00069     QValueList<KPopupMenu*> m_collectionMenuList;
00070 };
00071 
00072 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys