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

Nepomuk

  • nepomuk
  • ui
tagwidget.h
Go to the documentation of this file.
1/*
2 * This file is part of the Nepomuk KDE project.
3 * Copyright (C) 2006-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 Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef _NEPOMUK_TAG_WIDGET_H_
22#define _NEPOMUK_TAG_WIDGET_H_
23
24#include "nepomuk_export.h"
25
26#include <QtGui/QWidget>
27
28namespace Nepomuk {
29 class Resource;
30 class Tag;
31 class TagWidgetPrivate;
32
48 class NEPOMUK_EXPORT TagWidget : public QWidget
49 {
50 Q_OBJECT
51
52 public:
57 explicit TagWidget( const Resource& resource, QWidget* parent = 0 );
58
62 TagWidget( QWidget* parent = 0 );
63
67 ~TagWidget();
68
73 QList<Resource> taggedResources() const;
74
78#ifndef KDE_NO_DEPRECATED
79 KDE_DEPRECATED QList<Tag> assignedTags() const;
80#endif
81
93 QList<Nepomuk::Tag> selectedTags() const;
94
105 int maxTagsShown() const;
106
112 Qt::Alignment alignment() const;
113
119 enum ModeFlag {
125 MiniMode = 0x1,
126
132 StandardMode = 0x2,
133
138 ReadOnly = 0x4,
139
145 DisableTagClicking = 0x8
146 };
147 Q_DECLARE_FLAGS( ModeFlags, ModeFlag )
148
149
156 ModeFlags modeFlags() const;
157
158 Q_SIGNALS:
162 void tagClicked( Nepomuk::Tag );
163
169 void selectionChanged( const QList<Nepomuk::Tag>& tags );
170
171 public Q_SLOTS:
176 void setTaggedResource( const Resource& resource );
177
182 void setTaggedResources( const QList<Resource>& resources );
183
187#ifndef KDE_NO_DEPRECATED
188 KDE_DEPRECATED void setAssignedTags( const QList<Nepomuk::Tag>& tags );
189#endif
190
198 void setSelectedTags( const QList<Nepomuk::Tag>& tags );
199
212 void setMaxTagsShown( int max );
213
220 void setAlignment( Qt::Alignment alignment );
221
227 void setModeFlags( ModeFlags flags );
228
229 private Q_SLOTS:
230 void slotShowAll();
231 void slotTagUpdateDone();
232 void slotTagStateChanged( const Nepomuk::Tag&, int );
233 void slotKEditTagDialogFinished( int result );
234
235 private:
236 TagWidgetPrivate* const d;
237 };
238}
239
240Q_DECLARE_OPERATORS_FOR_FLAGS( Nepomuk::TagWidget::ModeFlags )
241
242#endif
Nepomuk::Resource
Resource is the central object type in Nepomuk.
Definition: resource.h:95
Nepomuk::TagWidget
Allows to change a selection of tags.
Definition: tagwidget.h:49
Nepomuk::TagWidget::ModeFlag
ModeFlag
Flags to configure the widget.
Definition: tagwidget.h:119
Nepomuk::TagWidget::alignment
Qt::Alignment alignment() const
The alignment of the tags in the widget.
Nepomuk::TagWidget::~TagWidget
~TagWidget()
Destructor.
Nepomuk::TagWidget::setMaxTagsShown
void setMaxTagsShown(int max)
By default the TagWidget shows the most often used tags in the main window and allows access to all t...
Nepomuk::TagWidget::setAssignedTags
void setAssignedTags(const QList< Nepomuk::Tag > &tags)
Nepomuk::TagWidget::TagWidget
TagWidget(QWidget *parent=0)
Constructor.
Nepomuk::TagWidget::taggedResources
QList< Resource > taggedResources() const
Nepomuk::TagWidget::assignedTags
QList< Tag > assignedTags() const
Nepomuk::TagWidget::setSelectedTags
void setSelectedTags(const QList< Nepomuk::Tag > &tags)
Set the list of selected tags.
Nepomuk::TagWidget::TagWidget
TagWidget(const Resource &resource, QWidget *parent=0)
Creates a new TagWidget for resource.
Nepomuk::TagWidget::setAlignment
void setAlignment(Qt::Alignment alignment)
Set the alignment to use.
Nepomuk::TagWidget::maxTagsShown
int maxTagsShown() const
By default the TagWidget shows the most often used tags in the main window and allows access to all t...
Nepomuk::TagWidget::setModeFlags
void setModeFlags(ModeFlags flags)
Set flags to change the behaviour and look of the tag widget.
Nepomuk::TagWidget::selectedTags
QList< Nepomuk::Tag > selectedTags() const
The list of selected tags.
Nepomuk::Tag
A Tag can be assigned to any Thing.
Definition: tag.h:39
QWidget
Nepomuk
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