2
* Copyright (C) 2010 Canonical Ltd
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Neil Jagdish Patel <neil.patel@canonical.com>
19
#ifndef FAVORITE_STORE_H
20
#define FAVORITE_STORE_H
22
#include <NuxCore/NuxCore.h>
23
#include <NuxCore/ObjectType.h>
24
#include <NuxCore/Object.h>
26
#include <sigc++/signal.h>
30
// An abstract object that facilitates getting and modifying the list of favorites
31
// Use GetDefault () to get the correct store for the session
33
class FavoriteStore : public nux::Object
39
// Returns a referenced FavoriteStore, make sure to UnReference () it
40
static FavoriteStore * GetDefault ();
44
// Get's a GSList of char * desktop paths
46
// DO NOT RELY ON THE CHAR *, STRDUP THEM
47
virtual GSList * GetFavorites () = 0;
49
// These will emit the relevant signals, so bare that in mind
50
virtual void AddFavorite (const char *desktop_path, guint32 position) = 0;
51
virtual void RemoveFavorite (const char *desktop_path) = 0;
52
virtual void MoveFavorite (const char *desktop_path, guint32 position) = 0;
55
//desktop_path, position
56
sigc::signal<void, const char *, guint32> favorite_added;
59
sigc::signal<void, const char *> favorite_removed;
61
sigc::signal<void> reordered;
66
#endif // FAVORITE_STORE_H