Back to index

unity  6.0.0
DesktopLauncherIcon.cpp
Go to the documentation of this file.
00001 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
00002 /*
00003  * Copyright (C) 2010 Canonical Ltd
00004  *
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License version 3 as
00007  * published by the Free Software Foundation.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  *
00017  * Authored by: Jason Smith <jason.smith@canonical.com>
00018  */
00019 
00020 #include "DesktopLauncherIcon.h"
00021 #include "unity-shared/WindowManager.h"
00022 
00023 #include <glib/gi18n-lib.h>
00024 
00025 namespace unity
00026 {
00027 namespace launcher
00028 {
00029 
00030 DesktopLauncherIcon::DesktopLauncherIcon()
00031   :   SimpleLauncherIcon()
00032   ,   show_in_switcher_(true)
00033 {
00034   tooltip_text = _("Show Desktop");
00035   icon_name = "desktop";
00036   SetQuirk(QUIRK_VISIBLE, true);
00037   SetQuirk(QUIRK_RUNNING, false);
00038   SetIconType(TYPE_DESKTOP);
00039 }
00040 
00041 DesktopLauncherIcon::~DesktopLauncherIcon()
00042 {
00043 }
00044 
00045 void
00046 DesktopLauncherIcon::ActivateLauncherIcon(ActionArg arg)
00047 {
00048   SimpleLauncherIcon::ActivateLauncherIcon(arg);
00049   WindowManager::Default()->ShowDesktop();
00050 }
00051 
00052 std::string DesktopLauncherIcon::GetName() const
00053 {
00054   return "DesktopLauncherIcon";
00055 }
00056 
00057 } // namespace launcher
00058 } // namespace unity