~didrocks/unity/launcher-bug-fix-fest

« back to all changes in this revision

Viewing changes to src/IndicatorObjectFactory.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 INDICATOR_OBJECT_FACTORY_H
 
20
#define INDICATOR_OBJECT_FACTORY_H
 
21
 
 
22
#include <string>
 
23
#include <vector>
 
24
#include <sigc++/signal.h>
 
25
 
 
26
#include "IndicatorObjectProxy.h"
 
27
 
 
28
class IndicatorObjectFactory
 
29
{
 
30
public:
 
31
 
 
32
  // This could be empty, if the loading of Indicators is async, so you
 
33
  // should be listening to the signals too
 
34
  virtual std::vector<IndicatorObjectProxy *>& GetIndicatorObjects () = 0;
 
35
 
 
36
  // If the implementation supports it, you'll get a refreshed list of
 
37
  // Indicators (probably though a bunch of removed/added events)
 
38
  virtual void ForceRefresh () = 0;
 
39
 
 
40
  // Signals
 
41
  sigc::signal<void, IndicatorObjectProxy *> OnObjectAdded;
 
42
  sigc::signal<void, IndicatorObjectProxy *> OnObjectRemoved;
 
43
 
 
44
protected:
 
45
  std::vector<IndicatorObjectProxy *>_indicators;
 
46
};
 
47
 
 
48
#endif // INDICATOR_OBJECT_FACTORY_H