• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Nepomuk

  • sources
  • kde-4.12
  • kdelibs
  • nepomuk
  • utils
searchwidget.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010 Oszkar Ambrus <aoszkar@gmail.com>
3  Copyright (C) 2010 Sebastian Trueg <trueg@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) version 3, or any
9  later version accepted by the membership of KDE e.V. (or its
10  successor approved by the membership of KDE e.V.), which shall
11  act as a proxy defined in Section 6 of version 3 of the license.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 #ifndef RESOURCESEARCHWIDGET_H
23 #define RESOURCESEARCHWIDGET_H
24 
25 #include <QWidget>
26 #include <QAbstractItemView>
27 
28 #include "query.h"
29 #include "nepomukutils_export.h"
30 
31 namespace Nepomuk {
32  class Resource;
33 
34  namespace Utils {
35  class FacetWidget;
36 
54  class NEPOMUKUTILS_EXPORT SearchWidget : public QWidget
55  {
56  Q_OBJECT
57 
58  public:
62  SearchWidget(QWidget *parent = 0);
63 
67  ~SearchWidget();
68 
73  enum ConfigFlag {
75  NoConfigFlags = 0x0,
76 
78  ShowFacets = 0x1,
79 
81  SearchWhileYouType = 0x2,
82 
84  DefaultConfigFlags = ShowFacets
85  };
86  Q_DECLARE_FLAGS( ConfigFlags, ConfigFlag )
87 
88 
93  void setConfigFlags( ConfigFlags flags );
94 
98  ConfigFlags configFlags() const;
99 
103  void setSelectionMode(QAbstractItemView::SelectionMode mode);
104 
108  QAbstractItemView::SelectionMode selectionMode () const;
109 
113  Query::Query baseQuery() const;
114 
119  Query::Query query() const;
120 
124  Resource currentResource() const;
125 
129  QList<Resource> selectedResources() const;
130 
136  FacetWidget* facetWidget() const;
137 
145  static Nepomuk::Resource searchResource( QWidget* parent = 0,
146  const Nepomuk::Query::Query& baseQuery = Nepomuk::Query::Query(),
147  SearchWidget::ConfigFlags flags = SearchWidget::DefaultConfigFlags );
148 
156  static QList<Nepomuk::Resource> searchResources( QWidget* parent = 0,
157  const Nepomuk::Query::Query& baseQuery = Nepomuk::Query::Query(),
158  SearchWidget::ConfigFlags flags = SearchWidget::DefaultConfigFlags );
159 
160  public Q_SLOTS:
169  Nepomuk::Query::Query setQuery( const Nepomuk::Query::Query& query );
170 
182  void setBaseQuery( const Nepomuk::Query::Query& query );
183 
184  Q_SIGNALS:
189  void selectionChanged();
190 
194  void currentResourceChanged(const Nepomuk::Resource & previous, const Nepomuk::Resource & current );
195 
196 
197  private:
198  class SearchWidgetPrivate;
199  SearchWidgetPrivate * const d_ptr;
200 
201  Q_DECLARE_PRIVATE(SearchWidget)
202 
205  Q_PRIVATE_SLOT( d_ptr, void _k_forwardCurrentChanged( const QModelIndex &, const QModelIndex &));
206  Q_PRIVATE_SLOT( d_ptr, void _k_queryComponentChanged() )
207  Q_PRIVATE_SLOT( d_ptr, void _k_listingFinished() )
208  };
209  }
210 }
211 
212 Q_DECLARE_OPERATORS_FOR_FLAGS( Nepomuk::Utils::SearchWidget::ConfigFlags )
213 
214 #endif // RESOURCESEARCHWIDGET_H
Nepomuk::Resource
Resource is the central object type in Nepomuk.
Definition: resource.h:94
QWidget
query.h
NEPOMUKUTILS_EXPORT
#define NEPOMUKUTILS_EXPORT
Definition: nepomukutils_export.h:36
Nepomuk::Utils::SearchWidget
Provides a GUI for searching files or resources of any type.
Definition: searchwidget.h:54
nepomukutils_export.h
Nepomuk::Utils::SearchWidget::ConfigFlag
ConfigFlag
The config flags can be used to configure the search widget to fit the needs of the application...
Definition: searchwidget.h:73
Nepomuk::Utils::FacetWidget
A widget providing a list of facets to add filters to a query.
Definition: facetwidget.h:57
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk

Skip menu "Nepomuk"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal