~azzar1/unity/fix-1028810

« back to all changes in this revision

Viewing changes to dash/previews/MoviePreview.h

  • Committer: Andrea Azzarone
  • Date: 2012-08-22 13:14:18 UTC
  • mfrom: (2516.1.92 unity)
  • Revision ID: azzaronea@gmail.com-20120822131418-mrfwx82k39xnvl9e
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
 
2
/*
 
3
 * Copyright 2012 Canonical Ltd.
 
4
 *
 
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.
 
8
 *
 
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.
 
14
 *
 
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/>
 
18
 *
 
19
 * Authored by: Nick Dedekind <nick.dedekind@canonical.com>
 
20
 *
 
21
 */
 
22
 
 
23
#ifndef MOVIEPREVIEW_H
 
24
#define MOVIEPREVIEW_H
 
25
 
 
26
#include "Preview.h"
 
27
#include <Nux/Nux.h>
 
28
 
 
29
namespace nux
 
30
{
 
31
class AbstractPaintLayer;
 
32
class StaticCairoText;
 
33
class VLayout;
 
34
}
 
35
 
 
36
namespace unity
 
37
{
 
38
namespace dash
 
39
{
 
40
namespace previews
 
41
{
 
42
class CoverArt;
 
43
class PreviewRatingsWidget;
 
44
class PreviewInfoHintWidget;
 
45
 
 
46
class MoviePreview : public Preview
 
47
{
 
48
public:
 
49
  typedef nux::ObjectPtr<MoviePreview> Ptr;
 
50
  NUX_DECLARE_OBJECT_TYPE(MoviePreview, Preview);
 
51
 
 
52
  MoviePreview(dash::Preview::Ptr preview_model);
 
53
  ~MoviePreview();
 
54
 
 
55
  // From debug::Introspectable
 
56
  std::string GetName() const;
 
57
  void AddProperties(GVariantBuilder* builder);
 
58
 
 
59
protected:
 
60
  virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
 
61
  virtual void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);
 
62
  virtual void PreLayoutManagement();
 
63
 
 
64
  virtual void OnNavigateOut();
 
65
  virtual void OnNavigateInComplete();
 
66
 
 
67
  void SetupBackground();
 
68
  void SetupView();
 
69
  
 
70
protected:
 
71
  nux::VLayout* full_data_layout_;
 
72
 
 
73
  nux::ObjectPtr<CoverArt> image_;
 
74
  nux::ObjectPtr<PreviewRatingsWidget> rating_;
 
75
  nux::ObjectPtr<nux::StaticCairoText> title_;
 
76
  nux::ObjectPtr<nux::StaticCairoText> subtitle_;
 
77
  nux::ObjectPtr<nux::StaticCairoText> description_;
 
78
  nux::ObjectPtr<PreviewInfoHintWidget> preview_info_hints_;
 
79
 
 
80
  typedef std::unique_ptr<nux::AbstractPaintLayer> LayerPtr;
 
81
  LayerPtr details_bg_layer_;
 
82
};
 
83
 
 
84
}
 
85
}
 
86
}
 
87
 
 
88
#endif // MOVIEPREVIEW_H