~3v1n0/unity/overlay-border-scale

« back to all changes in this revision

Viewing changes to UnityCore/FilesystemLenses.h

  • Committer: Daniel van Vugt
  • Date: 2012-03-14 06:24:18 UTC
  • mfrom: (2108 unity)
  • mto: This revision was merged to the branch mainline in revision 2146.
  • Revision ID: daniel.van.vugt@canonical.com-20120314062418-nprucpbr0m7qky5e
MergedĀ latestĀ lp:unity

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2
2
/*
3
 
 * Copyright (C) 2011 Canonical Ltd
 
3
 * Copyright (C) 2011-2012 Canonical Ltd
4
4
 *
5
5
 * This program is free software: you can redistribute it and/or modify
6
6
 * it under the terms of the GNU General Public License version 3 as
31
31
namespace dash
32
32
{
33
33
 
 
34
class LensDirectoryReader : public sigc::trackable
 
35
{
 
36
public:
 
37
  struct LensFileData
 
38
  {
 
39
    LensFileData(GKeyFile* file, const gchar *lens_id);
 
40
    static bool IsValid(GKeyFile* file, glib::Error& error);
 
41
 
 
42
    glib::String id;
 
43
    glib::String domain;
 
44
    glib::String dbus_name;
 
45
    glib::String dbus_path;
 
46
    glib::String name;
 
47
    glib::String icon;
 
48
    glib::String description;
 
49
    glib::String search_hint;
 
50
    bool         visible;
 
51
    glib::String shortcut;
 
52
  };
 
53
 
 
54
  typedef std::shared_ptr<LensDirectoryReader> Ptr;
 
55
  typedef std::vector<LensFileData*> DataList;
 
56
 
 
57
  LensDirectoryReader(std::string const& directory);
 
58
  ~LensDirectoryReader();
 
59
 
 
60
  static LensDirectoryReader::Ptr GetDefault();
 
61
 
 
62
  bool IsDataLoaded() const;
 
63
  DataList GetLensData() const;
 
64
 
 
65
  sigc::signal<void> load_finished;
 
66
 
 
67
private:
 
68
  class Impl;
 
69
  Impl* pimpl;
 
70
};
 
71
 
34
72
// Reads Lens information from the filesystem, as per-specification, and creates
35
73
// Lens instances using this data
36
74
class FilesystemLenses : public Lenses
39
77
  typedef std::shared_ptr<FilesystemLenses> Ptr;
40
78
 
41
79
  FilesystemLenses();
42
 
  FilesystemLenses(std::string const& lens_directory);
43
 
 
44
 
  void Init();
 
80
  FilesystemLenses(LensDirectoryReader::Ptr const& reader);
45
81
 
46
82
  ~FilesystemLenses();
47
83
 
53
89
  sigc::signal<void> lenses_loaded;
54
90
 
55
91
private:
 
92
  void Init();
 
93
 
56
94
  class Impl;
57
95
  Impl* pimpl;
58
96
};