Main Page   Class Hierarchy   Compound List   File List   Compound Members  

channeleditor.h

00001 // -*- c++ -*-
00002 
00003 /*
00004  *
00005  * Copyright (C) 2002 Richard Moore <rich@kde.org>
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Library General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Library General Public License
00018  * along with this library; see the file COPYING.LIB.  If not, write to
00019  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020  * Boston, MA 02111-1307, USA.
00021  */
00022 
00023 #ifndef CHANNELEDITOR_H
00024 #define CHANNELEDITOR_H
00025 
00026 #include <klistview.h>
00027 
00028 class ChannelStore;
00029 class Channel;
00030 
00031 class ChannelListItem : public QObject, public KListViewItem {
00032 Q_OBJECT
00033 public:
00034         ChannelListItem(KListView* parent, Channel* ch, bool);
00035         virtual ~ChannelListItem();
00036 
00037         virtual int compare(QListViewItem *i, int col, bool ascending) const;
00038 
00039         QString _num, _name;
00040 
00041         virtual int rtti() const;
00042         Channel *c;
00043 
00044 public slots:
00045         void updateFields();
00046 private:
00047     bool _showSelectedOnly;
00048 };
00049 
00050 
00054 class ChannelEditor : public KListView
00055 {
00056     Q_OBJECT
00057 
00058 public:
00059     ChannelEditor(QWidget* parent = 0, const char* name = 0, bool showSelectedOnly = true);
00060     ~ChannelEditor();
00061 
00062 public slots:
00063     void setChannels( ChannelStore *chans );
00064     void renameItem( QListViewItem *item, const QString &str, int col );
00065     void ensureSelected( Channel *ch );
00066     void reloadChannels();
00067     void slotSetShowSelectedOnly(bool);
00068 
00069 private slots:
00070     void requestChange( QListViewItem *item );
00071     void storeCurrentChannel();
00072     void restoreCurrentChannel();
00073 
00074 signals:
00075     void channelModified( Channel *chan );
00076     void channelSelected( Channel *chan );
00077 
00078 protected:
00079     void createItems();
00080 
00081 private:
00082     ChannelStore *cs;
00083     bool _showSelectedOnly;
00084     int prev;
00085 };
00086 
00087 #endif // CHANNELEDITOR_H
00088 

Generated at Thu Jan 30 02:56:02 2003 for QtVision by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001