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.
23 #include <kparts/browserextension.h>
24 #include <kparts/part.h>
25 #include <kfileitem.h>
33 class KFindPart
: public KParts::ReadOnlyPart
35 friend class KFindPartBrowserExtension
;
37 Q_PROPERTY( bool showsResult READ showsResult
)
39 KFindPart( QWidget
* parentWidget
, QObject
*parent
, const QStringList
& /*args*/ );
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;}
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
);
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
&);
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
& ){}
88 Kfind
* m_kfindWidget
;
90 bool m_bShowsResult
; // whether the dirpart shows the results of a search or not
92 * The internal storage of file items
94 KFileItemList m_lstFileItems
;