00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KICKOFF_SEARCH_PLUGIN_H
00022 #define KICKOFF_SEARCH_PLUGIN_H
00023
00024 #include "kickoffsearchinterface.h"
00025
00026 #include <tqobject.h>
00027 #include <kurl.h>
00028 #include <kservice.h>
00029
00030 typedef enum {
00031 ACTIONS = 0,
00032 APPS,
00033 BOOKMARKS,
00034 NOTES,
00035 MAILS,
00036 FILES,
00037 MUSIC,
00038 WEBHIST,
00039 CHATS,
00040 FEEDS,
00041 PICS,
00042 VIDEOS,
00043 DOCS,
00044 OTHER,
00045 num_categories
00046 } CATEGORY;
00047
00048 class HitMenuItem
00049 {
00050 public:
00051 HitMenuItem (int id, int category)
00052 : id (id), category (category),score(0) { }
00053 HitMenuItem (TQString name, TQString info, KURL uri, TQString mimetype, int id, int category, TQString icon=TQString::null, int score = 0)
00054 : display_name (name)
00055 , display_info (info)
00056 , uri (uri)
00057 , mimetype (mimetype)
00058 , id (id)
00059 , category (category)
00060 , icon (icon)
00061 , score (score)
00062 , service (NULL) { }
00063
00064 ~HitMenuItem () { }
00065
00066 bool operator< (HitMenuItem item)
00067 {
00068 return ((category == item.category && score > item.score) || (category == item.category && id < item.id) ||
00069 (category < item.category));
00070 }
00071
00072
00073 TQString display_name;
00074 TQString display_info;
00075 KURL uri;
00076 TQString mimetype;
00077 int id;
00078 int category;
00079 TQString icon;
00080 int score;
00081 KService::Ptr service;
00082
00083 TQString quotedPath () const
00084 {
00085 return uri.path ().replace ('"', "\\\"");
00086 }
00087 };
00088
00089 namespace KickoffSearch {
00090
00091 class Plugin : public TQObject
00092 {
00093 Q_OBJECT
00094
00095 public:
00096 Plugin(TQObject *parent, const char* name=0);
00097 virtual ~Plugin();
00098
00099 virtual bool daemonRunning()=0;
00100 virtual void query(TQString,bool)=0;
00101
00102 KickoffSearchInterface * kickoffSearchInterface();
00103 };
00104 };
00105
00106 #endif