korganizer

searchdialog.h

00001 /*
00002     This file is part of KOrganizer.
00003 
00004     Copyright (c) 1998 Preston Brown <pbrown@kde.org>
00005     Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
00006     Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00007 
00008     This program is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     This program is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with this program; if not, write to the Free Software
00020     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00021 
00022     As a special exception, permission is given to link this program
00023     with any edition of TQt, and distribute the resulting executable,
00024     without including the source code for TQt in the source distribution.
00025 */
00026 #ifndef SEARCHDIALOG_H
00027 #define SEARCHDIALOG_H
00028 
00029 #include <tqregexp.h>
00030 
00031 #include <kdialogbase.h>
00032 
00033 #include <libkcal/incidence.h>
00034 
00035 namespace KCal {
00036 class Calendar;
00037 }
00038 class KDateEdit;
00039 class TQCheckBox;
00040 class TQLineEdit;
00041 class TQLabel;
00042 class KOListView;
00043 
00044 using namespace KCal;
00045 
00046 class SearchDialog : public KDialogBase
00047 {
00048     Q_OBJECT
00049   
00050   public:
00051     SearchDialog(Calendar *calendar,TQWidget *parent=0);
00052     virtual ~SearchDialog();
00053 
00054     void updateView();
00055 
00056   public slots:
00057     void changeIncidenceDisplay(Incidence *, int) { updateView(); }
00058 
00059   protected slots:
00060     void doSearch();
00061     void searchTextChanged( const TQString &_text );
00062 
00063   signals:
00064     void showIncidenceSignal( Incidence *, const TQDate & );
00065     void editIncidenceSignal( Incidence *, const TQDate & );
00066     void deleteIncidenceSignal( Incidence * );
00067 
00068   private:
00069     void search(const TQRegExp &);
00070 
00071     Calendar *mCalendar;
00072 
00073     Incidence::List mMatchedEvents;
00074 
00075     TQLabel *searchLabel;
00076     TQLineEdit *searchEdit;
00077     KOListView *listView;
00078 
00079     TQCheckBox *mEventsCheck;
00080     TQCheckBox *mTodosCheck;
00081     TQCheckBox *mJournalsCheck;
00082 
00083     KDateEdit *mStartDate;
00084     KDateEdit *mEndDate;
00085 
00086     TQCheckBox *mInclusiveCheck;
00087     TQCheckBox *mIncludeUndatedTodos;
00088 
00089     TQCheckBox *mSummaryCheck;
00090     TQCheckBox *mDescriptionCheck;
00091     TQCheckBox *mCategoryCheck;
00092 };
00093 
00094 #endif