702.3.1
by Michael Terry
add modelines and fix up some inconsistent tabbings |
1 |
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
|
572.1.11
by Neil Jagdish Patel
Import the work done so far with Compiz |
2 |
/*
|
3 |
* Copyright (C) 2010 Canonical Ltd
|
|
4 |
*
|
|
5 |
* This program is free software: you can redistribute it and/or modify
|
|
6 |
* it under the terms of the GNU General Public License version 3 as
|
|
7 |
* published by the Free Software Foundation.
|
|
8 |
*
|
|
9 |
* This program 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
|
|
12 |
* GNU General Public License for more details.
|
|
13 |
*
|
|
14 |
* You should have received a copy of the GNU General Public License
|
|
15 |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16 |
*
|
|
17 |
* Authored by: Neil Jagdish Patel <neil.patel@canonical.com>
|
|
18 |
*/
|
|
19 |
||
20 |
#ifndef FAVORITE_STORE_H
|
|
21 |
#define FAVORITE_STORE_H
|
|
22 |
||
23 |
#include <NuxCore/NuxCore.h> |
|
24 |
#include <NuxCore/ObjectType.h> |
|
25 |
#include <NuxCore/Object.h> |
|
26 |
#include <string> |
|
27 |
#include <sigc++/signal.h> |
|
28 |
||
29 |
#include <glib.h> |
|
30 |
||
31 |
// An abstract object that facilitates getting and modifying the list of favorites
|
|
32 |
// Use GetDefault () to get the correct store for the session
|
|
33 |
||
34 |
class FavoriteStore : public nux::Object |
|
35 |
{
|
|
36 |
public: |
|
37 |
FavoriteStore (); |
|
38 |
~FavoriteStore (); |
|
39 |
||
40 |
// Returns a referenced FavoriteStore, make sure to UnReference () it
|
|
41 |
static FavoriteStore * GetDefault (); |
|
42 |
||
43 |
// Methods
|
|
44 |
||
45 |
// Get's a GSList of char * desktop paths
|
|
46 |
// DO NOT FREE
|
|
47 |
// DO NOT RELY ON THE CHAR *, STRDUP THEM
|
|
48 |
virtual GSList * GetFavorites () = 0; |
|
49 |
||
620.1.2
by Neil Jagdish Patel
update some docs |
50 |
// These will NOT emit the relevant signals, so bare that in mind
|
51 |
// i.e. don't hope that you can add stuff and hook the view up to
|
|
52 |
// favorite_added events to update the view. The signals only emit if
|
|
53 |
// there has been a change on the GSettings object from an external
|
|
54 |
// source
|
|
620.1.1
by Neil Jagdish Patel
- Add support for paths in favorites like "/foo" |
55 |
virtual void AddFavorite (const char *desktop_path, gint position) = 0; |
572.1.11
by Neil Jagdish Patel
Import the work done so far with Compiz |
56 |
virtual void RemoveFavorite (const char *desktop_path) = 0; |
620.1.5
by Neil Jagdish Patel
Make MoveFavorite work and add some initial tests |
57 |
virtual void MoveFavorite (const char *desktop_path, gint position) = 0; |
679.5.10
by Jason Smith
save our re-ordering |
58 |
virtual void SetFavorites (std::list<const char*> desktop_paths) = 0; |
572.1.11
by Neil Jagdish Patel
Import the work done so far with Compiz |
59 |
|
60 |
// Signals
|
|
620.1.2
by Neil Jagdish Patel
update some docs |
61 |
// Therse only emit if something has changed the GSettings object externally
|
62 |
||
572.1.11
by Neil Jagdish Patel
Import the work done so far with Compiz |
63 |
//desktop_path, position
|
64 |
sigc::signal<void, const char *, guint32> favorite_added; |
|
65 |
||
66 |
//desktop_path
|
|
67 |
sigc::signal<void, const char *> favorite_removed; |
|
68 |
||
69 |
sigc::signal<void> reordered; |
|
70 |
||
71 |
private: |
|
72 |
};
|
|
73 |
||
74 |
#endif // FAVORITE_STORE_H |