korganizer

timespanwidget.h

00001 /*
00002     This file is part of KOrganizer.
00003 
00004     Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of TQt, and distribute the resulting executable,
00022     without including the source code for TQt in the source distribution.
00023 */
00024 #ifndef TimeSpanWidget_H
00025 #define TimeSpanWidget_H
00026 
00027 #include <tqwidget.h>
00028 
00029 namespace KCal {
00030 class Event;
00031 }
00032 
00033 class TQSplitter;
00034 class TQListView;
00035 class LineView;
00036 class TimeLine;
00037 
00038 class TimeSpanWidget : public TQWidget
00039 {
00040     Q_OBJECT
00041   TQ_OBJECT
00042   public:
00043     TimeSpanWidget( TQWidget *parent=0, const char *name=0 );
00044     virtual ~TimeSpanWidget();
00045     
00046     void addItem( KCal::Event * );
00047 
00048     TQValueList<int> splitterSizes();
00049     void setSplitterSizes( TQValueList<int> );
00050     
00051     void clear();
00052     
00053     void setDateRange( const TQDateTime &start, const TQDateTime &end );
00054     
00055     TQDateTime startDateTime();
00056     TQDateTime endDateTime();
00057 
00058   public slots:
00059     void updateView();
00060 
00061     void zoomIn();
00062     void zoomOut();
00063     void centerView();
00064     
00065   signals:
00066     void dateRangeChanged();
00067     
00068   private:
00069     TQSplitter *mSplitter;
00070     TQListView *mList;
00071     TimeLine *mTimeLine;
00072     LineView *mLineView;
00073     
00074     TQDateTime mStartDate;
00075     TQDateTime mEndDate;
00076     int mSecsPerPixel;
00077 };
00078 
00079 #endif