[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenonbeta/klink/lib
From:       Scott Wheeler <wheeler () kde ! org>
Date:       2004-09-06 0:01:23
Message-ID: 20040906000123.466681CF0 () office ! kde ! org
[Download RAW message or body]

CVS commit by wheeler: 

Adding KLinkGroup to encapsulate a group of related links that will allow
for application-domain specific searches.

Also decided that since the rest of the API doesn't allow for specifying
the database that it doesn't make sense to have it in the search API.


  A            klinkgroup.h   1.1 [LGPL]
  M +3 -0      klink.h   1.4
  M +15 -8     klinksearch.h   1.2


--- kdenonbeta/klink/lib/klink.h  #1.3:1.4
@@ -23,4 +23,7 @@
 #include "klinktarget.h"
 
+#include <qvaluelist.h>
+#include <qstring.h>
+
 class KLink
 {

--- kdenonbeta/klink/lib/klinksearch.h  #1.1:1.2
@@ -23,13 +23,17 @@
 #include "klink.h"
 
+/**
+ * A simple type to return the relevance and list of links for a given search.
+ */
+typedef QValueList< QPair<float, KLink> > KLinkSearchResults;
+
 class KLinkSearchInterface
 {
 public:
     virtual ~KLinkSearchInterface();
-    virtual KLinkList results();
+    virtual KLinkSearchResults results();
 
 protected:
-    KLinkSearchInterface(KLinkDatabase *db);
-    KLinkDatabase *database() const;
+    KLinkSearchInterface();
 
 private:
@@ -43,8 +47,8 @@ public:
     KLinkSearch(const QString &term,
                 const KMimeType::List &mimeTypes = KMimeType::List(),
-                KLinkDatabase *db = KLinkDatabase::instance(),
+                const KLinkGroupList &groups = KLinkGroupList(),
                 unsigned int max = 0);
 
-    virtual KLinkList results();
+    virtual KLinkSearchResults results();
 
 private:
@@ -59,8 +63,8 @@ public:
                       const KLinkAnchor &anchor,
                       const KMimeType::List &mimeTypes = KMimeType::List(),
-                      KLinkDatabase *db = KLinkDatabase::instance(),
+                      const KLinkGroupList &groups = KLinkGroupList(),
                       unsigned int max = 0);
 
-    virtual KLinkList results();    
+    virtual KLinkSearchResults results();    
 
 private:
@@ -75,6 +79,9 @@ public:
                       const KLinkAnchor &anchor,
                       const KMimeType::List &mimeTypes = KMimeType::List(),
-                      KLinkDatabase *db = KLinkDatabase::instance(),
+                      const KLinkGroupList &groups = KLinkGroupList(),
                       unsigned int max = 0);
+
+    virtual KLinkSearchResults results();    
+
 private:
     class Private;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic