Back to index

unity  6.0.0
FilterMultiRangeWidget.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_FILTERMULTIRANGE_H
00024 #define UNITYSHELL_FILTERMULTIRANGE_H
00025 
00026 #include <Nux/Nux.h>
00027 #include <Nux/HLayout.h>
00028 #include <Nux/VLayout.h>
00029 #include <UnityCore/MultiRangeFilter.h>
00030 
00031 #include "FilterAllButton.h"
00032 #include "FilterBasicButton.h"
00033 #include "FilterExpanderLabel.h"
00034 
00035 namespace unity
00036 {
00037 namespace dash
00038 {
00039 
00040 class FilterMultiRangeButton;
00041 
00042 class FilterMultiRange : public FilterExpanderLabel
00043 {
00044   NUX_DECLARE_OBJECT_TYPE(FilterMultiRange, FilterExpanderLabel);
00045 public:
00046   FilterMultiRange(NUX_FILE_LINE_PROTO);
00047   virtual ~FilterMultiRange();
00048 
00049   void SetFilter(Filter::Ptr const& filter);
00050   std::string GetFilterType();
00051 
00052 protected:
00053   void InitTheme();
00054 
00055 private:
00056   void OnAllActivated(nux::View* view);
00057   void OnOptionAdded(dash::FilterOption::Ptr const& new_filter);
00058   void OnOptionRemoved(dash::FilterOption::Ptr const& removed_filter);
00059   void OnActiveChanged(bool value);
00060 
00061   nux::HLayout* layout_;
00062   FilterAllButton* all_button_;
00063 
00064   std::vector<FilterMultiRangeButton*> buttons_;
00065   MultiRangeFilter::Ptr filter_;
00066 };
00067 
00068 } // unityshell dash
00069 } // unityshell unity
00070 
00071 #endif // UNITYSHELL_FILTERMULTIRANGE_H