1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3
* Copyright (C) 2011 Canonical Ltd
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 3 as
7
* published by the Free Software Foundation.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Authored by: Jason Smith <jason.smith@canonical.com>
20
#ifndef SWITCHERCONTROLLER_H
21
#define SWITCHERCONTROLLER_H
23
#include "SwitcherModel.h"
24
#include "SwitcherView.h"
26
#include <boost/shared_ptr.hpp>
27
#include <sigc++/sigc++.h>
30
#include <Nux/BaseWindow.h>
31
#include <Nux/WindowCompositor.h>
38
class SwitcherController : public sigc::trackable
55
virtual ~SwitcherController();
57
nux::Property<int> timeout_length;
59
nux::Property<bool> detail_on_timeout;
60
nux::Property<int> detail_timeout_length;
62
void Show(ShowMode show, SortMode sort, bool reverse, std::vector<AbstractLauncherIcon*> results);
63
void Hide(bool accept_state=true);
73
void SetDetail(bool detail);
75
void SelectFirstItem();
77
void SetWorkspace(nux::Geometry geo);
79
SwitcherView * GetView ();
81
LayoutWindowList ExternalRenderTargets ();
93
void OnModelSelectionChanged(AbstractLauncherIcon *icon);
95
int WindowsRelatedToSelection();
97
static void OnBackgroundUpdate (GVariant *data, SwitcherController *self);
99
SwitcherModel::Ptr model_;
102
nux::Geometry workarea_;
104
nux::BaseWindow* view_window_;
109
nux::Color bg_color_;
110
DetailMode detail_mode_;
112
static gboolean OnShowTimer(gpointer data);
113
static gboolean OnDetailTimer(gpointer data);
115
static bool CompareSwitcherItemsPriority(AbstractLauncherIcon* first, AbstractLauncherIcon* second);
122
#endif // SWITCHERCONTROLLER_H