navigatorbar.h
00001 /* 00002 This file is part of KOrganizer. 00003 00004 Copyright (c) 2003 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 NAVIGATORBAR_H 00025 #define NAVIGATORBAR_H 00026 00027 #include <libkcal/incidencebase.h> 00028 00029 #include <tqlabel.h> 00030 00031 class TQPushButton; 00032 class TQFrame; 00033 00034 class ActiveLabel : public TQLabel 00035 { 00036 Q_OBJECT 00037 TQ_OBJECT 00038 public: 00039 ActiveLabel( TQWidget *parent, const char *name = 0 ); 00040 00041 signals: 00042 void clicked(); 00043 00044 protected: 00045 void mouseReleaseEvent ( TQMouseEvent * e ); 00046 }; 00047 00048 00049 class NavigatorBar: public TQWidget 00050 { 00051 Q_OBJECT 00052 TQ_OBJECT 00053 public: 00054 NavigatorBar( TQWidget *parent = 0, const char *name = 0 ); 00055 ~NavigatorBar(); 00056 00057 void showButtons( bool left, bool right ); 00058 00059 public slots: 00060 void selectDates( const KCal::DateList & ); 00061 00062 signals: 00063 void nextMonthClicked(); 00064 void prevMonthClicked(); 00065 void nextYearClicked(); 00066 void prevYearClicked(); 00067 void monthSelected( int month ); 00068 void yearSelected( int year ); 00069 00070 private slots: 00071 void selectMonthFromMenu(); 00072 void selectYearFromMenu(); 00073 00074 private: 00075 bool mHasMinWidth; 00076 00077 TQDate mDate; 00078 00079 TQPushButton *mPrevYear; 00080 TQPushButton *mPrevMonth; 00081 ActiveLabel *mMonth; 00082 ActiveLabel *mYear; 00083 TQPushButton *mNextMonth; 00084 TQPushButton *mNextYear; 00085 }; 00086 00087 #endif