Blokkal
an Extendable KDE Blogging Client
SourceForge.net Logo

checkboxview.h

00001 /***************************************************************************
00002  *   Copyright (C) 2007 - 2008 by Martin Mueller                           *
00003  *   orvio@orvio.de                                                        *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program 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         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef BLOKKALUICHECKBOXVIEW_H
00021 #define BLOKKALUICHECKBOXVIEW_H
00022 
00023 #include <QtGui/QTreeView>
00024 
00025 #include "../blokkal_export.h"
00026 
00027 namespace Blokkal {
00028 namespace Ui {
00029 class CheckBoxDelegate;
00030 
00037 class BLOKKAL_EXPORT CheckBoxView : public QTreeView
00038 {
00039 Q_OBJECT
00040 public:
00046         CheckBoxView( CheckBoxDelegate * delegate, QWidget * parent = 0 );
00047         virtual ~CheckBoxView( void );
00048 
00054         bool isChecked( const QModelIndex & index ) const;
00055 
00062         void setChecked( const QModelIndex & index, bool check );
00063 
00064 protected Q_SLOTS:
00071         virtual void rowsAboutToBeRemoved( const QModelIndex & parent, int start, int end );
00072 
00073 private Q_SLOTS:
00074         void updateIndexId( int id );
00075 
00076 private:
00077         friend class CheckBoxDelegate;
00078         friend class BlogDelegate;
00083         bool toogleBlinkState( const QModelIndex & index );
00084 
00090         void connectIndex( const QModelIndex & index, int msecs );
00091 
00097         void disconnectIndex( const QModelIndex & index );
00098         
00099         class Private;
00100         Private * const d;
00101 };
00102 
00114 class BLOKKAL_EXPORT BlogView : public Blokkal::Ui::CheckBoxView
00115 {
00116 Q_OBJECT
00117 public:
00123         BlogView( QWidget * parent = 0, unsigned int displayOptions = 0 );
00124         virtual ~BlogView( void );
00125 };
00126 }
00127 }
00128 
00129 #endif