-rw-r--r-- | korganizer/koagendaview.h | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index cbe86b6..e9e85cc 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h @@ -12,52 +12,77 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef KOAGENDAVIEW_H #define KOAGENDAVIEW_H #include <qscrollview.h> #include <qdatetime.h> +#include <qpushbutton.h> #include <qlayout.h> #ifndef DESKTOP_VERSION #include <qksplitter.h> #else #include <qsplitter.h> #endif #include <qmemarray.h> #include "koeventview.h" - class QHBox; class QFrame; class QLabel; class QPushButton; class CalendarView; class KOAgenda; class KOAgendaItem; class KConfig; class KDGanttMinimizeSplitter; + +class KOAgendaButton : public QPushButton +{ + Q_OBJECT + public: + KOAgendaButton( QWidget *parent=0, const char *name=0 ) : + QPushButton( parent, name ) + { + mNum = -3; + setFlat( true ); + setFocusPolicy(NoFocus); + setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding )); + connect( this, SIGNAL( clicked() ), this, SLOT ( bClicked() ) ); + }; + + QSize sizeHint () const { return QSize( 5,5) ;} + void setNum( int n) { mNum = n; } +private slots: + void bClicked() {emit numClicked( mNum);} +signals: + void numClicked( int ); +private: + int mNum; +}; + class TimeLabels : public QScrollView { Q_OBJECT public: TimeLabels(int rows,QWidget *parent=0,const char *name=0,WFlags f=0); void setCellHeight(int height); /** Calculates the minimum width */ virtual int minimumWidth() const; /** updates widget's internal state */ void updateConfig(); /** */ void setAgenda(KOAgenda* agenda); @@ -177,51 +202,51 @@ class KOAgendaView : public KOEventView { void setContentsPos(int y); void setExpandedButton( bool expanded ); void scrollOneHourUp(); void scrollOneHourDown(); void addToCalSlot(Incidence *, Incidence *); signals: void showDateView( int, QDate ); void newTodoSignal( QDateTime ,bool ); void toggleExpand(); void todoMoved( Todo *, int ); void incidenceChanged(Incidence * , int ); // void cloneIncidenceSignal(Incidence *); protected: - QPushButton* getNewDaylabel(); + KOAgendaButton* getNewDaylabel(); bool mBlockUpdating; int mUpcomingWidth; /** Fill agenda beginning with date startDate */ void fillAgenda(const QDate &startDate); void resizeEvent( QResizeEvent* e ); /** Fill agenda using the current set value for the start date */ void fillAgenda(); /** Create labels for the selected dates. */ void createDayLabels(); /** Set the masks on the agenda widgets indicating, which days are holidays. */ void setHolidayMasks(); protected slots: - void slotDaylabelClicked(); + void slotDaylabelClicked( int ); /** Update event belonging to agenda item */ void updateEventDates(KOAgendaItem *item, int mode = -1); //void updateMovedTodo(); void updateEventIndicatorTop(int newY); void updateEventIndicatorBottom(int newY); /** Updates data for selected timespan */ void newTimeSpanSelected(int gxStart, int gyStart, int gxEnd, int gyEnd); /** Updates data for selected timespan for all day event*/ void newTimeSpanSelectedAllDay(int gxStart, int gyStart, int gxEnd, int gyEnd); private: // view widgets QFrame *mDayLabels; QHBox *mDayLabelsFrame; @@ -241,24 +266,24 @@ class KOAgendaView : public KOEventView { bool mWeekStartsMonday; int mStartHour; KOEventPopupMenu *mAgendaPopup; KOEventPopupMenu *mAllDayAgendaPopup; EventIndicator *mEventIndicatorTop; EventIndicator *mEventIndicatorBottom; QMemArray<int> mMinY; QMemArray<int> mMaxY; QMemArray<bool> mHolidayMask; QPixmap mExpandedPixmap; QPixmap mNotExpandedPixmap; - QPtrList<QPushButton> mDayLabelsList; + QPtrList<KOAgendaButton> mDayLabelsList; QDateTime mTimeSpanBegin; QDateTime mTimeSpanEnd; bool mTimeSpanInAllDay; void keyPressEvent ( QKeyEvent * e ); }; #endif // KOAGENDAVIEW_H |