Back to index

unity  6.0.0
ResultRenderer.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 
00024 
00025 #ifndef RESULTRENDERER_H
00026 #define RESULTRENDERER_H
00027 
00028 #include <Nux/Nux.h>
00029 #include <NuxCore/InitiallyUnownedObject.h>
00030 #include <NuxCore/Property.h>
00031 #include <dee.h>
00032 
00033 #include <UnityCore/Result.h>
00034 
00035 namespace unity
00036 {
00037 namespace dash
00038 {
00039 
00040 class ResultRenderer : public nux::InitiallyUnownedObject
00041 {
00042 public:
00043   NUX_DECLARE_OBJECT_TYPE(ResultRenderer, nux::InitiallyUnownedObject);
00044 
00045   enum ResultRendererState
00046   {
00047     RESULT_RENDERER_NORMAL,
00048     RESULT_RENDERER_ACTIVE,
00049     RESULT_RENDERER_PRELIGHT,
00050     RESULT_RENDERER_SELECTED,
00051     RESULT_RENDERER_INSENSITIVE,
00052   };
00053 
00054   ResultRenderer(NUX_FILE_LINE_PROTO);
00055   virtual ~ResultRenderer();
00056   virtual void Render(nux::GraphicsEngine& GfxContext,
00057                       Result& row,
00058                       ResultRendererState state,
00059                       nux::Geometry& geometry,
00060                       int x_offset, int y_offset);
00061 
00062   // this is just to start preloading images and text that the renderer might
00063   // need - can be ignored
00064   virtual void Preload(Result& row);
00065 
00066   // unload any previous grabbed images
00067   virtual void Unload(Result& row);
00068 
00069   nux::Property<int> width;  // the width of the element,
00070   nux::Property<int> height; // the height of the element
00071 
00072   sigc::signal<void> NeedsRedraw;
00073 };
00074 
00075 }
00076 }
00077 #endif // RESULTRENDERER_H