Back to index

unity  6.0.0
HudAbstractView.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2012 Canonical Ltd
00003  *
00004  * This program is free software: you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License version 3 as
00006  * published by the Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  * GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00015  *
00016  * Authored by: Andrea Azzarone <azzaronea@gmail.com>
00017  */
00018 
00019 #ifndef UNITYSHELL_HUD_ABSTRACT_VIEW_H
00020 #define UNITYSHELL_HUD_ABSTRACT_VIEW_H
00021 
00022 #include <memory>
00023 #include <string>
00024 
00025 #include <Nux/Nux.h>
00026 #include <Nux/View.h>
00027 #include <UnityCore/Hud.h>
00028 
00029 #include "unity-shared/Introspectable.h"
00030 
00031 namespace unity
00032 {
00033 namespace hud
00034 {
00035 
00036 class AbstractView : public nux::View, public unity::debug::Introspectable
00037 {
00038   NUX_DECLARE_OBJECT_TYPE(AbstractView, nux::View);
00039 public:
00040   typedef nux::ObjectPtr<AbstractView> Ptr;
00041 
00042   AbstractView();
00043 
00044   virtual void AboutToShow() = 0;
00045   virtual void AboutToHide() = 0;
00046   virtual void Relayout() = 0;
00047   virtual void ResetToDefault() = 0;
00048   virtual void SearchFinished() = 0;
00049   virtual void SetIcon(std::string const& icon_name, unsigned int tile_size, unsigned int size, unsigned int padding) = 0;
00050   virtual void SetQueries(Hud::Queries queries) = 0;
00051   virtual void SetWindowGeometry(nux::Geometry const& absolute_geo, nux::Geometry const& geo) = 0;
00052   virtual void ShowEmbeddedIcon(bool show) = 0;
00053 
00054   virtual nux::View* default_focus() const = 0;
00055 
00056   // signals
00057   sigc::signal<void, std::string> search_changed;
00058   sigc::signal<void, std::string> search_activated;
00059   sigc::signal<void, Query::Ptr> query_activated;
00060   sigc::signal<void, Query::Ptr> query_selected;
00061 };
00062 
00063 } // namespace hud
00064 } // namespace unity
00065 
00066 #endif // UNITYSHELL_HUD_ABSTRACT_VIEW_H