Back to index

unity  6.0.0
FilterGenreWidget.h
Go to the documentation of this file.
00001 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
00002 /*
00003  * Copyright 2011 Canonical Ltd.
00004  *
00005  * This program is free software: you can redistribute it and/or modify it
00006  * under the terms of the GNU Lesser 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, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranties of
00011  * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
00012  * PURPOSE.  See the applicable version of the GNU Lesser General Public
00013  * License for more details.
00014  *
00015  * You should have received a copy of both the GNU Lesser General Public
00016  * License version 3 along with this program.  If not, see
00017  * <http://www.gnu.org/licenses/>
00018  *
00019  * Authored by: Gordon Allott <gord.allott@canonical.com>
00020  *
00021  */
00022 
00023 #ifndef UNITYSHELL_FILTERGENREWIDGET_H
00024 #define UNITYSHELL_FILTERGENREWIDGET_H
00025 
00026 #include <Nux/Nux.h>
00027 #include <Nux/GridHLayout.h>
00028 #include <Nux/HLayout.h>
00029 #include <Nux/VLayout.h>
00030 
00031 #include <UnityCore/CheckOptionFilter.h>
00032 
00033 #include "FilterAllButton.h"
00034 #include "FilterExpanderLabel.h"
00035 
00036 namespace unity
00037 {
00038 namespace dash
00039 {
00040 
00041 class FilterBasicButton;
00042 class FilterGenreButton;
00043 
00044 class FilterGenre : public FilterExpanderLabel
00045 {
00046   NUX_DECLARE_OBJECT_TYPE(FilterGenre, FilterExpanderLabel);
00047 public:
00048   FilterGenre(int columns, NUX_FILE_LINE_PROTO);
00049   virtual ~FilterGenre();
00050 
00051   void SetFilter(Filter::Ptr const& filter);
00052   std::string GetFilterType();
00053 
00054 protected:
00055   void InitTheme();
00056 
00057 private:
00058   void OnOptionAdded(FilterOption::Ptr const& new_filter);
00059   void OnOptionRemoved(FilterOption::Ptr const& removed_filter);
00060 
00061   nux::GridHLayout* genre_layout_;
00062   FilterAllButton* all_button_;
00063 
00064   std::vector<FilterGenreButton*> buttons_;
00065   CheckOptionFilter::Ptr filter_;
00066 };
00067 
00068 } // namespace dash
00069 } // namespace unity
00070 
00071 #endif // UNITYSHELL_FILTERGENRESWIDGET_H