~ken-vandine/unity/make-quicklists-work-again

« back to all changes in this revision

Viewing changes to src/FavoriteStore.h

Import the work done so far with Compiz

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* Copyright (C) 2010 Canonical Ltd
 
3
*
 
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.
 
7
*
 
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.
 
12
*
 
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/>.
 
15
*
 
16
* Authored by: Neil Jagdish Patel <neil.patel@canonical.com>
 
17
*/
 
18
 
 
19
#ifndef FAVORITE_STORE_H
 
20
#define FAVORITE_STORE_H
 
21
 
 
22
#include <NuxCore/NuxCore.h>
 
23
#include <NuxCore/ObjectType.h>
 
24
#include <NuxCore/Object.h>
 
25
#include <string>
 
26
#include <sigc++/signal.h>
 
27
 
 
28
#include <glib.h>
 
29
 
 
30
// An abstract object that facilitates getting and modifying the list of favorites
 
31
// Use GetDefault () to get the correct store for the session
 
32
 
 
33
class FavoriteStore : public nux::Object
 
34
{
 
35
public:
 
36
  FavoriteStore ();
 
37
  ~FavoriteStore ();
 
38
 
 
39
  // Returns a referenced FavoriteStore, make sure to UnReference () it
 
40
  static FavoriteStore * GetDefault ();
 
41
 
 
42
  // Methods
 
43
 
 
44
  // Get's a GSList of char * desktop paths
 
45
  // DO NOT FREE
 
46
  // DO NOT RELY ON THE CHAR *, STRDUP THEM
 
47
  virtual GSList * GetFavorites () = 0;
 
48
  
 
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;
 
53
 
 
54
  // Signals
 
55
  //desktop_path, position
 
56
  sigc::signal<void, const char *, guint32> favorite_added;
 
57
 
 
58
  //desktop_path
 
59
  sigc::signal<void, const char *> favorite_removed;
 
60
 
 
61
  sigc::signal<void> reordered;
 
62
 
 
63
private:
 
64
};
 
65
 
 
66
#endif // FAVORITE_STORE_H