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

Nepomuk

  • 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
31namespace 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
212Q_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:95
Nepomuk::Utils::FacetWidget
A widget providing a list of facets to add filters to a query.
Definition: facetwidget.h:58
Nepomuk::Utils::SearchWidget
Provides a GUI for searching files or resources of any type.
Definition: searchwidget.h:55
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::SearchWidget::SearchWidget
SearchWidget(QWidget *parent=0)
Constructor.
Nepomuk::Utils::SearchWidget::~SearchWidget
~SearchWidget()
Destructor.
QWidget
Nepomuk
nepomukutils_export.h
NEPOMUKUTILS_EXPORT
#define NEPOMUKUTILS_EXPORT
Definition: nepomukutils_export.h:36
query.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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