// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
/*
* Copyright (C) 2014 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: Marco Trevisan
*/
#ifndef __UNITY_INDICATOR_MANAGER__
#define __UNITY_INDICATOR_MANAGER__
#include
#include
#include
#include "KeyGrabber.h"
namespace unity
{
namespace menu
{
struct any_true
{
typedef bool result_type;
template result_type operator()(IT it, IT end)
{
for (; it != end; ++it) if (*it) return true;
return false;
}
};
class Manager : public sigc::trackable
{
public:
typedef std::shared_ptr Ptr;
nux::Property show_menus;
nux::Property menu_open;
nux::Property integrated_menus;
nux::Property show_menus_wait;
nux::Property always_show_menus;
nux::Property fadein;
nux::Property fadeout;
nux::Property discovery;
nux::Property discovery_fadein;
nux::Property discovery_fadeout;
Manager(indicator::Indicators::Ptr const&, key::Grabber::Ptr const&);
virtual ~Manager();
bool HasAppMenu() const;
indicator::Indicators::Ptr const& Indicators() const;
indicator::AppmenuIndicator::Ptr const& AppMenu() const;
key::Grabber::Ptr const& KeyGrabber() const;
sigc::signal appmenu_added;
sigc::signal appmenu_removed;
sigc::signal::accumulated open_first;
sigc::signal::accumulated key_activate_entry;
private:
Manager(Manager const&) = delete;
Manager& operator=(Manager const&) = delete;
struct Impl;
std::unique_ptr impl_;
};
} // menu namespace
} // unity namespace
#endif // __UNITY_INDICATOR_MANAGER__