// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
/*
* Copyright (C) 2011 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Authored by: Neil Jagdish Patel
*/
#ifndef UNITY_LENS_H
#define UNITY_LENS_H
#include
#include
#include
#include
#include "Variant.h"
#include "Categories.h"
#include "Filters.h"
#include "Preview.h"
#include "Results.h"
namespace unity
{
namespace dash
{
enum HandledType
{
NOT_HANDLED=0,
SHOW_DASH,
HIDE_DASH,
GOTO_DASH_URI
};
enum ViewType
{
HIDDEN=0,
HOME_VIEW,
LENS_VIEW
};
class Lens : public sigc::trackable, boost::noncopyable
{
public:
typedef std::shared_ptr Ptr;
typedef std::map Hints;
Lens(std::string const& id,
std::string const& dbus_name,
std::string const& dbus_path,
std::string const& name,
std::string const& icon,
std::string const& description = "",
std::string const& search_hint = "",
bool visible = true,
std::string const& shortcut = "");
Lens(std::string const& id,
std::string const& dbus_name,
std::string const& dbus_path,
std::string const& name,
std::string const& icon,
std::string const& description,
std::string const& search_hint,
bool visible,
std::string const& shortcut,
ModelType model_type);
virtual ~Lens();
virtual void GlobalSearch(std::string const& search_string);
virtual void Search(std::string const& search_string);
virtual void Activate(std::string const& uri);
virtual void Preview(std::string const& uri);
nux::RWProperty id;
nux::RWProperty dbus_name;
nux::RWProperty dbus_path;
nux::RWProperty name;
nux::RWProperty icon_hint;
nux::RWProperty description;
nux::RWProperty search_hint;
nux::RWProperty visible;
nux::RWProperty search_in_global;
nux::RWProperty shortcut;
nux::RWProperty results;
nux::RWProperty global_results;
nux::RWProperty categories;
nux::RWProperty filters;
nux::RWProperty connected;
nux::Property view_type;
sigc::signal search_finished;
sigc::signal global_search_finished;
sigc::signal activated;
sigc::signal preview_ready;
private:
class Impl;
Impl* pimpl;
};
}
}
#endif