Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

tableview.h

Go to the documentation of this file.
00001 /*
00002                              This file is part of the Opie Project
00003 
00004                              Copyright (C) Opie Team <opie-devel@handhelds.org>
00005               =.
00006             .=l.
00007            .>+-=
00008  _;:,     .>    :=|.         This program is free software; you can
00009 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00010 :`=1 )Y*s>-.--   :           the terms of the GNU Library General Public
00011 .="- .-=="i,     .._         License as published by the Free Software
00012  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00013      ._= =}       :          or (at your option) any later version.
00014     .%`+i>       _;_.
00015     .i_,=:_.      -<s.       This program is distributed in the hope that
00016      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00017     : ..    .:,     . . .    without even the implied warranty of
00018     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00019   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00020 ..}^=.=       =       ;      Library General Public License for more
00021 ++=   -.     .`     .:       details.
00022 :     =  ...= . :.=-
00023  -.   .:....=;==+<;          You should have received a copy of the GNU
00024   -_. . .   )=.  =           Library General Public License along with
00025     --        :-=`           this library; see the file COPYING.LIB.
00026                              If not, write to the Free Software Foundation,
00027                              Inc., 59 Temple Place - Suite 330,
00028                              Boston, MA 02111-1307, USA.
00029 */
00030 
00031 #ifndef OPIE_TABLE_VIEW_H
00032 #define OPIE_TABLE_VIEW_H
00033 
00034 #include <qtable.h>
00035 #include <qmap.h>
00036 #include <qpixmap.h>
00037 
00038 #include "todoview.h"
00039 
00040 class QTimer;
00041 
00042 namespace Todo {
00043     class CheckItem;
00044     class DueTextItem;
00045     class TableView : public QTable, public TodoView {
00046         Q_OBJECT
00047     public:
00048         TableView( MainWindow*, QWidget* parent );
00049         ~TableView();
00050 
00051 
00052         QString type()const;
00053         int current();
00054         QString currentRepresentation();
00055         int next();
00056         int prev();
00057 
00058         void clear();
00059         void showOverDue( bool );
00060         void updateView();
00061         void setTodo( int uid, const OPimTodo& );
00062         void addEvent( const OPimTodo& event );
00063         void replaceEvent( const OPimTodo& );
00064         void removeEvent( int uid );
00065         void setShowCompleted( bool );
00066         void setShowDeadline( bool );
00067 
00068         void setShowCategory(const QString& =QString::null );
00069         void newDay();
00070         QWidget* widget();
00071         void sortColumn(int, bool, bool );
00072 
00073         /*
00074          * we do our drawing ourselves
00075          * because we don't want to have
00076          * 40.000 QTableItems for 10.000
00077          * OPimTodos where we only show 10 at a time!
00078          */
00079         void paintCell(QPainter* p, int row, int col,  const QRect&, bool );
00080     private:
00081         /* reimplented for internal reasons */
00082         void viewportPaintEvent( QPaintEvent* );
00083         bool m_enablePaint:1;
00084         QString m_oleCat;
00085         bool m_first : 1;
00086 
00087         QPixmap m_pic_completed;
00088         QPixmap m_pic_priority[ 5 ];
00089 
00090     protected:
00091         void keyPressEvent( QKeyEvent* );
00092         void contentsMouseReleaseEvent( QMouseEvent *e );
00093         void contentsMousePressEvent( QMouseEvent *e );
00094         void timerEvent( QTimerEvent* e );
00095         QWidget* createEditor(int row, int col, bool initFromCell )const;
00096         void setCellContentFromEditor( int row, int col );
00101         struct EditorWidget {
00102             EditorWidget();
00103             void setCellWidget(QWidget*, int row, int col );
00104             void releaseCellWidget();
00105             QWidget* cellWidget()const;
00106             int cellRow()const;
00107             int cellCol()const;
00108         private:
00109             QWidget* m_wid;
00110             int m_row, m_col;
00111         };
00112         EditorWidget m_editorWidget;
00113 
00114 private slots:
00115         void slotClicked(int, int, int,
00116                          const QPoint& );
00117         void slotPriority();
00118     private:
00119         void initConfig();
00120         int m_completeStrokeWidth;
00121         bool m_row : 1;
00122         QPoint m_prevP;
00123     };
00124 };
00125 
00126 #endif

Generated on Sat Nov 5 16:15:55 2005 for OPIE by  doxygen 1.4.2