Back to index

unity  6.0.0
HomeLens.h
Go to the documentation of this file.
00001 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
00002 /*
00003  * Copyright (C) 2012 Canonical Ltd
00004  *
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License version 3 as
00007  * published by the Free Software Foundation.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  *
00017  * Authored by: Mikkel Kamstrup Erlandsen <mikkel.kamstrup@canonical.com>
00018  */
00019 
00020 #ifndef UNITY_HOME_LENS_H
00021 #define UNITY_HOME_LENS_H
00022 
00023 #include <vector>
00024 #include <memory>
00025 #include <sigc++/signal.h>
00026 #include <sigc++/trackable.h>
00027 
00028 #include "Lenses.h"
00029 #include "Lens.h"
00030 
00031 namespace unity
00032 {
00033 namespace dash
00034 {
00035 
00044 class HomeLens : public Lens, public Lenses
00045 {
00046 public:
00047   typedef std::shared_ptr<HomeLens> Ptr;
00048 
00053   HomeLens(std::string const& name, std::string const& description, std::string const& search_hint);
00054   virtual ~HomeLens();
00055 
00056   void AddLenses(Lenses& lenses);
00057 
00058   Lenses::LensList GetLenses() const;
00059   Lens::Ptr GetLens(std::string const& lens_id) const;
00060   Lens::Ptr GetLensAtIndex(std::size_t index) const;
00061 
00062   void GlobalSearch(std::string const& search_string);
00063   void Search(std::string const& search_string);
00064   void Activate(std::string const& uri);
00065   void Preview(std::string const& uri);
00066 
00067 private:
00068   class Impl;
00069   class ModelMerger;
00070   class ResultsMerger;
00071   class CategoryMerger;
00072   class FiltersMerger;
00073   class CategoryRegistry;
00074   Impl* pimpl;
00075 };
00076 
00077 }
00078 }
00079 
00080 #endif