File indexing completed on 2024-04-21 04:02:57

0001 //
0002 // C++ Interface: clistviewer
0003 //
0004 // Description: 
0005 //
0006 /*
0007 Copyright 2008-2011 Tomas Mecir <kmuddy@kmuddy.com>
0008 
0009 This program is free software; you can redistribute it and/or
0010 modify it under the terms of the GNU General Public License as
0011 published by the Free Software Foundation; either version 2 of 
0012 the License, or (at your option) any later version.
0013 
0014 This program is distributed in the hope that it will be useful,
0015 but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017 GNU General Public License for more details.
0018 
0019 You should have received a copy of the GNU General Public License
0020 along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021 */
0022 
0023 #ifndef CLISTVIEWER_H
0024 #define CLISTVIEWER_H
0025 
0026 #include <kmuddy_export.h>
0027 
0028 #include <QTreeView>
0029 
0030 class cList;
0031 class cListObject;
0032 
0033 class KActionCollection;
0034 
0035 class KMUDDY_EXPORT cListViewer: public QTreeView {
0036  Q_OBJECT
0037  public:
0038   /** constructor */
0039   cListViewer (QWidget *parent);
0040   /** destructor */
0041   ~cListViewer () override;
0042 
0043   void setList (cList *l);
0044   void selectObject (cListObject *obj);
0045 
0046   KActionCollection *actionCollection ();
0047 
0048  signals:
0049   /** An object has been selected. */
0050   void itemActivated (cListObject *obj);
0051  public slots:
0052   void deleteObject ();
0053   void addGroup ();
0054   void addObject ();
0055   void moveDown ();
0056   void moveUp ();
0057   void moveLeft ();
0058   void moveRight ();
0059  protected slots:
0060   void currentChanged (const QModelIndex &current, const QModelIndex &previous) override;
0061  protected:
0062   /** Context menu handler. */
0063   void contextMenuEvent (QContextMenuEvent *event) override;
0064  private:
0065   struct Private;
0066   Private *d;
0067 };
0068 
0069 
0070 #endif  // CLISTVIEWER_H