1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3
* Copyright 2012 Canonical Ltd.
5
* This program is free software: you can redistribute it and/or modify it
6
* under the terms of the GNU Lesser General Public License version 3, as
7
* published by the Free Software Foundation.
9
* This program is distributed in the hope that it will be useful, but
10
* WITHOUT ANY WARRANTY; without even the implied warranties of
11
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
12
* PURPOSE. See the applicable version of the GNU Lesser General Public
13
* License for more details.
15
* You should have received a copy of both the GNU Lesser General Public
16
* License version 3 along with this program. If not, see
17
* <http://www.gnu.org/licenses/>
19
* Authored by: Nick Dedekind <nick.dedekind@canonical.com>
23
#ifndef PREVIEWINFOHINTWIDGET_H
24
#define PREVIEWINFOHINTWIDGET_H
28
#include <UnityCore/Preview.h>
29
#include "unity-shared/Introspectable.h"
33
class StaticCairoText;
43
class PreviewInfoHintWidget : public nux::View, public debug::Introspectable
46
typedef nux::ObjectPtr<PreviewInfoHintWidget> Ptr;
47
NUX_DECLARE_OBJECT_TYPE(PreviewInfoHintWidget, nux::View);
49
PreviewInfoHintWidget(dash::Preview::Ptr preview_model, int icon_size);
50
virtual ~PreviewInfoHintWidget();
52
// From debug::Introspectable
53
std::string GetName() const;
54
void AddProperties(GVariantBuilder* builder);
56
void PreLayoutManagement();
59
virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
60
virtual void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);
62
virtual bool AcceptKeyNavFocus() { return false; }
64
void SetupBackground();
67
void IconLoaded(std::string const& texid,
69
glib::Object<GdkPixbuf> const& pixbuf,
70
std::string icon_name);
75
typedef nux::ObjectPtr<nux::StaticCairoText> StaticCairoTextPtr;
76
typedef std::pair<StaticCairoTextPtr, StaticCairoTextPtr> InfoHint;
77
std::list<InfoHint> info_hints_;
79
dash::Preview::Ptr preview_model_;
80
typedef nux::ObjectPtr<nux::BaseTexture> BaseTexturePtr;
83
} // napespace prviews
87
#endif //PREVIEWINFOHINTWIDGET_H