]>
cloud.milkyroute.net Git - dolphin.git/blob - src/tagcloud/tagcloud.h
2 This file is part of the Nepomuk KDE project.
3 Copyright (C) 2007 Sebastian Trueg <trueg@kde.org>
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 version 2 as published by the Free Software Foundation.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef _NEPOMUK_TAG_CLOUD_H_
21 #define _NEPOMUK_TAG_CLOUD_H_
23 #include <QtGui/QFrame>
24 #include <QtCore/QList>
26 #include <nepomuk/tag.h>
28 #include <Soprano/Statement>
36 class TagCloud
: public QFrame
41 TagCloud( QWidget
* parent
= 0 );
50 int heightForWidth( int w
) const;
51 QSize
sizeHint() const;
52 QSize
minimumSizeHint() const;
54 bool zoomEnabled() const;
58 * Set the maximum used font size. The default is 0
59 * which means to calculate proper values from the KDE
62 void setMaxFontSize( int size
);
65 * Set the minimum used font size. The default is 0
66 * which means to calculate proper values from the KDE
69 void setMinFontSize( int size
);
72 * Set the maximum number of displayed tags. The default is 0
73 * which means to display all tags.
77 void setMaxNumberDisplayedTags( int n
);
80 * Allow selection of tags, i.e. enabling and disabling of tags.
82 void setSelectionEnabled( bool enabled
);
84 void setNewTagButtonEnabled( bool enabled
);
85 void setContextMenuEnabled( bool enabled
);
86 void setAlignment( Qt::Alignment alignment
);
88 void setZoomEnabled( bool zoom
);
91 * Default: SortAlpabetically
93 void setSorting( Sorting
);
96 * Will reset tags set via showTags()
101 * Set the tags to be shown in the tag cloud.
102 * If the new tag button is enabled (setEnableNewTagButton())
103 * new tags will automatically be added to the list of shown tags.
105 void showTags( const QList
<Tag
>& tags
);
107 void showResourceTags( const Resource
& resource
);
110 * Select or deselect a tag. This does only make sense
111 * if selection is enabled and \p tag is actually
114 * \sa setSelectionEnabled
116 void setTagSelected( const Tag
& tag
, bool selected
);
118 void setCustomNewTagAction( QAction
* action
);
121 void tagClicked( const Nepomuk::Tag
& tag
);
122 void tagAdded( const Nepomuk::Tag
& tag
);
123 void tagToggled( const Nepomuk::Tag
& tag
, bool enabled
);
126 void resizeEvent( QResizeEvent
* e
);
127 void paintEvent( QPaintEvent
* e
);
128 void mousePressEvent( QMouseEvent
* );
129 void mouseMoveEvent( QMouseEvent
* );
130 void leaveEvent( QEvent
* );
133 void slotStatementAdded( const Soprano::Statement
& s
);
134 void slotStatementRemoved( const Soprano::Statement
& s
);