~3v1n0/unity/light-shortcuts

« back to all changes in this revision

Viewing changes to dash/previews/SocialPreviewComments.h

  • Committer: Marco Trevisan (Treviño)
  • Date: 2013-04-26 12:41:09 UTC
  • Revision ID: mail@3v1n0.net-20130426124109-t3b2shjah2omiqa2
Unity: Remove all the views, but the Shortcuts

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 2011 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: Ken VanDine <ken.vandine@canonical.com>
20
 
 *
21
 
 */
22
 
 
23
 
#ifndef SOCIAL_PREVIEW_COMMENTS_H
24
 
#define SOCIAL_PREVIEW_COMMENTS_H
25
 
 
26
 
#include <Nux/Nux.h>
27
 
#include <Nux/CairoWrapper.h>
28
 
#include <NuxCore/ObjectPtr.h>
29
 
#include "unity-shared/StaticCairoText.h"
30
 
#include "unity-shared/Introspectable.h"
31
 
#include <UnityCore/SocialPreview.h>
32
 
#include "PreviewContainer.h"
33
 
 
34
 
namespace unity
35
 
{
36
 
namespace dash
37
 
{
38
 
namespace previews
39
 
{
40
 
 
41
 
class SocialPreviewComments : public nux::View, public unity::debug::Introspectable
42
 
{
43
 
public:
44
 
  typedef nux::ObjectPtr<SocialPreviewComments> Ptr;
45
 
  NUX_DECLARE_OBJECT_TYPE(SocialPreviewComments, nux::View);
46
 
 
47
 
  SocialPreviewComments(dash::Preview::Ptr preview_model, NUX_FILE_LINE_PROTO);
48
 
 
49
 
  virtual ~SocialPreviewComments();
50
 
 
51
 
  sigc::signal<void> request_close() const { return preview_container_.request_close; }
52
 
 
53
 
protected:
54
 
 
55
 
  typedef nux::ObjectPtr<StaticCairoText> StaticCairoTextPtr;
56
 
  typedef std::pair<StaticCairoTextPtr, StaticCairoTextPtr> Comment;
57
 
  std::list<Comment> comments_;
58
 
 
59
 
  dash::Preview::Ptr preview_model_;
60
 
 
61
 
  virtual void Draw(nux::GraphicsEngine& gfx_engine, bool force_draw);
62
 
  virtual void DrawContent(nux::GraphicsEngine& gfx_engine, bool force_draw);
63
 
  virtual void PreLayoutManagement();
64
 
 
65
 
  virtual bool AcceptKeyNavFocus() { return false; }
66
 
 
67
 
  void SetupViews();
68
 
 
69
 
  virtual std::string GetName() const;
70
 
  virtual void AddProperties(GVariantBuilder* builder);
71
 
 
72
 
private:
73
 
 
74
 
  typedef std::unique_ptr<nux::CairoWrapper> NuxCairoPtr;
75
 
 
76
 
  PreviewContainer preview_container_;
77
 
};
78
 
 
79
 
}
80
 
}
81
 
}
82
 
 
83
 
#endif // SOCIAL_PREVIEW_COMMENTS_H