delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / apps / kfind / kfindpart.h
bloba9bcd7f8ce591295cbd1391579296b5ad07f1981
1 /* This file is part of the KDE projects
2 Copyright (C) 2000 David Faure <faure@kde.org>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; see the file COPYING. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef kfindpart__h
21 #define kfindpart__h
23 #include <kparts/browserextension.h>
24 #include <kparts/part.h>
25 #include <kfileitem.h>
26 #include <kdebug.h>
28 class KQuery;
29 class KAboutData;
30 class KAction;
31 class Kfind;
33 class KFindPart : public KParts::ReadOnlyPart
35 friend class KFindPartBrowserExtension;
36 Q_OBJECT
37 Q_PROPERTY( bool showsResult READ showsResult )
38 public:
39 KFindPart( QWidget * parentWidget, QObject *parent, const QStringList & /*args*/ );
40 virtual ~KFindPart();
42 static KAboutData *createAboutData();
44 virtual bool openUrl( const KUrl &url );
45 virtual bool closeUrl() { return true; }
46 virtual bool openFile() { return false; }
48 bool showsResult() const { return m_bShowsResult; }
50 virtual void saveState( QDataStream &stream );
51 virtual void restoreState( QDataStream &stream );
53 // "Cut" icons : disable those whose URL is in lst, enable the rest //added for konqdirpart
54 //virtual void disableIcons( const KUrl::List & ){}
55 //virtual const KFileItem * currentItem(){return 0;}
57 Q_SIGNALS:
58 // Konqueror connects directly to those signals
59 void started(); // started a search
60 void clear(); // delete all items
61 void newItems(const KFileItemList&); // found this/these item(s)
62 void finished(); // finished searching
63 void canceled(); // the user canceled the search
64 void findClosed(); // close us
65 void deleteItem( const KFileItem &item);
67 protected Q_SLOTS:
68 void slotStarted();
69 void slotDestroyMe();
70 void addFile(const KFileItem &item, const QString& matchingLine);
71 /* An item has been removed, so update konqueror's view */
72 void removeFile(const KFileItem &item);
73 void slotResult(int errorCode);
74 void newFiles(const KFileItemList&);
75 #if 0
76 // slots connected to the directory lister //added for konqdirpart
77 // virtual void slotStarted();
78 virtual void slotCanceled(){}
79 virtual void slotCompleted(){}
80 virtual void slotNewItems( const KFileItemList& ){}
81 virtual void slotDeleteItem( const KFileItem& ){}
82 virtual void slotRefreshItems( const QList<QPair<KFileItem, KFileItem> >& ){}
83 virtual void slotClear(){}
84 virtual void slotRedirection( const KUrl & ){}
85 #endif
87 private:
88 Kfind * m_kfindWidget;
89 KQuery *query;
90 bool m_bShowsResult; // whether the dirpart shows the results of a search or not
91 /**
92 * The internal storage of file items
94 KFileItemList m_lstFileItems;
97 #endif