1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3
* Copyright (C) 2010 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 TRASHLAUNCHERICON_H
21
#define TRASHLAUNCHERICON_H
23
#include "SimpleLauncherIcon.h"
25
class TrashLauncherIcon : public SimpleLauncherIcon
29
TrashLauncherIcon(Launcher* launcher);
32
virtual nux::Color BackgroundColor();
33
virtual nux::Color GlowColor();
36
void UpdateTrashIcon();
38
nux::DndAction OnQueryAcceptDrop(std::list<char*> uris);
39
void OnAcceptDrop(std::list<char*> uris);
42
gulong _on_trash_changed_handler_id;
43
gulong _on_confirm_dialog_close_id;
44
GFileMonitor* m_TrashMonitor;
46
GtkWidget* _confirm_dialog;
48
void ActivateLauncherIcon(ActionArg arg);
49
std::list<DbusmenuMenuitem*> GetMenus();
51
static void UpdateTrashIconCb(GObject* source, GAsyncResult* res, gpointer data);
52
static void OnTrashChanged(GFileMonitor* monitor, GFile* file, GFile* other_file,
53
GFileMonitorEvent event_type, gpointer data);
54
static void OnEmptyTrash(DbusmenuMenuitem* item, int time, TrashLauncherIcon* self);
55
static void OnConfirmDialogClose(GtkDialog* dialog, gint response, gpointer user_data);
56
static void EmptyTrashAction();
57
static void RecursiveDelete(GFile* location);
61
#endif // TRASHLAUNCHERICON_H