Freya  0.0.1
A Gtk3 MPD Client
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
src/Browser/AbstractBrowser.hh
Go to the documentation of this file.
00001 /***********************************************************
00002 * This file is part of Freya
00003 * - A free MPD Gtk3 MPD Client -
00004 *
00005 * Authors: Christopher Pahl, Christoph Piechula,
00006 *          Eduard Schneider
00007 *
00008 * Copyright (C) [2011-2012]
00009 * Hosted at: https://github.com/studentkittens/Freya
00010 *
00011 *              __..--''``---....___   _..._    __
00012 *    /// //_.-'    .-/";  `        ``<._  ``.''_ `. / // /
00013 *   ///_.-' _..--.'_                        `( ) ) // //
00014 *   / (_..-' // (< _     ;_..__               ; `' / ///
00015 *    / // // //  `-._,_)' // / ``--...____..-' /// / //
00016 *  Ascii-Art by Felix Lee <flee@cse.psu.edu>
00017 *
00018 * Freya is free software: you can redistribute it and/or modify
00019 * it under the terms of the GNU General Public License as published by
00020 * the Free Software Foundation, either version 3 of the License, or
00021 * (at your option) any later version.
00022 *
00023 * Freya is distributed in the hope that it will be useful,
00024 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00025 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00026 * GNU General Public License for more details.
00027 *
00028 * You should have received a copy of the GNU General Public License
00029 * along with Freya. If not, see <http://www.gnu.org/licenses/>.
00030 **************************************************************/
00031 #ifndef FREYA_ABSTRACT_BROWSER
00032 #define FREYA_ABSTRACT_BROWSER
00033 
00034 #include "../ui_includes.hh"
00035 #include <iostream>
00036 #include "../GManager/BrowserList.hh"
00037 
00041 class AbstractBrowser
00042 {
00043     public:
00044 
00045         friend class GManager::BrowserList;
00046 
00055         AbstractBrowser(const char * name,
00056                 bool is_visible,
00057                 bool needs_connection,
00058                 Gtk::StockID icon)
00059             : m_Name(name),
00060             m_IconId(icon),
00061             m_NeedsConnection(needs_connection),
00062             m_IsVisible(is_visible),
00063             m_IsActive(false)
00064     {}
00065 
00073         virtual Gtk::Widget * get_container() = 0; /* No Impl. */
00074 
00082         Glib::ustring& get_name()
00083         {
00084             return m_Name;
00085         }
00086 
00092         Gtk::StockID get_icon_stock_id()
00093         {
00094             return m_IconId;
00095         }
00096 
00102         bool is_visible()
00103         {
00104             return m_IsVisible;
00105         }
00106 
00112         bool needs_connection()
00113         {
00114             return m_NeedsConnection;
00115         }
00116 
00117         bool is_active()
00118         {
00119             return m_IsActive;
00120         }
00121 
00122         void on_getting_active() {};
00123 
00124     private:
00125 
00126         Glib::ustring m_Name;
00127         Gtk::StockID m_IconId;
00128         bool m_NeedsConnection;
00129         bool m_IsVisible;
00130         bool m_IsActive;
00131 };
00132 
00133 #endif