// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
/*
* Copyright (C) 2013 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: Nick Dedekind
*/
#ifndef UNITY_SCOPE_PROXY_INTERFACE_H
#define UNITY_SCOPE_PROXY_INTERFACE_H
#include "GLibWrapper.h"
#include
#include
#include "Results.h"
#include "Filters.h"
#include "Categories.h"
#include "GLibWrapper.h"
#include "ScopeData.h"
namespace unity
{
namespace dash
{
enum ScopeHandledType
{
NOT_HANDLED=0,
SHOW_DASH,
HIDE_DASH,
GOTO_DASH_URI,
SHOW_PREVIEW,
PERFORM_SEARCH
};
enum ScopeViewType
{
HIDDEN=0,
HOME_VIEW,
SCOPE_VIEW
};
typedef std::function SearchCallback;
typedef std::function ActivateCallback;
class ScopeProxyInterface : public sigc::trackable, boost::noncopyable
{
public:
typedef std::shared_ptr Ptr;
virtual ~ScopeProxyInterface() {}
nux::ROProperty dbus_name;
nux::ROProperty dbus_path;
nux::ROProperty connected;
nux::ROProperty channel;
nux::ROProperty visible;
nux::ROProperty is_master;
nux::ROProperty results_dirty;
nux::ROProperty search_hint;
nux::RWProperty view_type;
nux::Property form_factor;
nux::ROProperty results;
nux::ROProperty filters;
nux::ROProperty categories;
nux::ROProperty> category_order;
nux::ROProperty name;
nux::ROProperty description;
nux::ROProperty icon_hint;
nux::ROProperty category_icon_hint;
nux::ROProperty> keywords;
nux::ROProperty type;
nux::ROProperty query_pattern;
nux::ROProperty shortcut;
virtual void ConnectProxy() = 0;
virtual void DisconnectProxy() = 0;
typedef std::function SearchCallback;
virtual void Search(std::string const& search_hint, glib::HintsMap const&, SearchCallback const& callback, GCancellable* cancellable) = 0;
typedef std::function ActivateCallback;
virtual void Activate(LocalResult const& result, uint activate_type, glib::HintsMap const& hints, ActivateCallback const& callback, GCancellable* cancellable) = 0;
virtual Results::Ptr GetResultsForCategory(unsigned category) const = 0;
};
} // namespace dash
} // namespace unity
#endif // UNITY_SCOPE_PROXY_INTERFACE_H