1 /***************************************************************************
2 finddialog.h - K Desktop Planetarium
5 copyright : (C) 2001 by Jason Harris
6 email : jharris@30doradus.org
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
24 #include <kdialogbase.h>
35 class SkyObjectNameListItem
;
38 *Dialog window for finding SkyObjects by name. The dialog contains
39 *a QListBox showing the list of named objects, a QLineEdit for filtering
40 *the list by name, and a QCombobox for filtering the list by object type.
42 *@short Find Object Dialog
47 class FindDialog
: public KDialogBase
{
51 /**Constructor. Creates all widgets and packs them in QLayouts. Connects
52 *Signals and Slots. Runs initObjectList().
54 FindDialog( QWidget
* parent
= 0 );
60 /**@return the currently-selected item from the listbox of named objects
62 SkyObjectNameListItem
* currentItem() const { return currentitem
; }
65 /**When Text is entered in the QLineEdit, filter the List of objects
66 *so that only objects which start with the filter text are shown.
70 /**When the selection of the object type QComboBox is changed, filter
71 *the List of objects so that only objects of the selected Type are shown.
75 /**Overloading the Standard KDialogBase slotOk() to show a "sorry" message
76 *box if no object is selected when the user presses Ok. The window is
77 *not closed in this case.
82 /**Init object list after opening dialog.
86 /**Set the selected item in the list to the item specified.
88 void updateSelection (QListBoxItem
*);
90 /**Change current filter options.
92 void setFilter( int f
);
95 /**Process Keystrokes. The Up and Down arrow keys are used to select the
96 *Previous/Next item in the listbox of named objects.
97 *@param e The QKeyEvent pointer
99 void keyPressEvent( QKeyEvent
*e
);
103 *Automatically select the first item in the list
105 void setListItemEnabled();
109 QListBox
*SearchList
;
110 QLineEdit
*SearchBox
;
111 QLabel
*filterTypeLabel
;
112 QComboBox
*filterType
;
114 SkyObjectNameListItem
*currentitem
;