add more spacing
[personal-kdebase.git] / workspace / plasma / applets / kickoff / core / favoritesmodel.h
blobceb1673de7a25382ddd2de10a396a262968af7b9
1 /*
2 Copyright 2007 Robert Knight <robertknight@gmail.com>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
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 FAVORITESMODEL_H
21 #define FAVORITESMODEL_H
23 #include "core/kickoff_export.h"
24 #include "core/kickoffmodel.h"
26 namespace Kickoff
29 /**
30 * A model which provides an ordered list of 'favorite' items chosen by the user.
31 * The items may represent documents, folders, applications, devices or anything else
32 * identified by a URL.
34 * The information persists between sessions.
36 class KICKOFF_EXPORT FavoritesModel : public KickoffModel
38 Q_OBJECT
40 public:
41 FavoritesModel(QObject *parent);
42 virtual ~FavoritesModel();
44 /** Add a new item for @p url to the user's favorites list. */
45 static void add(const QString& url);
46 /** Remove the item associated with @p url from the user's favorites list. */
47 static void remove(const QString& url);
48 /** Returns true if @p url is in the list of the user's favorite URLs. */
49 static void move(int startRow, int destRow);
50 static int numberOfFavorites();
51 static void sortFavorites(Qt::SortOrder order);
52 static bool isFavorite(const QString& url);
54 virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action,
55 int row, int column, const QModelIndex & parent);
57 public Q_SLOTS:
58 void sortFavoritesAscending();
59 void sortFavoritesDescending();
61 private:
62 class Private;
63 Private * const d;
68 #endif // FAVORITESMODEL_H