/*
* Copyright (C) 2011 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Authored by: Andrea Azzarone
*/
#ifndef UNITYSHELL_SHORTCUTVIEW_H
#define UNITYSHELL_SHORTCUTVIEW_H
#include
#include
#include
#include
#include
#include
#include
#include
#include "unity-shared/UnityWindowView.h"
#include "unity-shared/BackgroundEffectHelper.h"
#include "ShortcutModel.h"
namespace unity
{
namespace shortcut
{
class View : public ui::UnityWindowView
{
NUX_DECLARE_OBJECT_TYPE(View, ui::UnityWindowView);
public:
typedef nux::ObjectPtr Ptr;
// Ctor and dtor
View();
~View();
// Public methods
bool GetBaseGeometry(nux::Geometry&);
void SetAdjustment(int x, int y);
void SetModel(Model::Ptr model);
Model::Ptr GetModel();
protected:
// Protected methods
void DrawOverlay(nux::GraphicsEngine& GfxContext, bool force_draw, nux::Geometry clip);
nux::Geometry GetBackgroundGeometry();
// Introspectable methods
std::string GetName() const;
private:
// Private methods
nux::LinearLayout* CreateSectionLayout(const char* section_name);
nux::View* CreateShortKeyEntryView(AbstractHint::Ptr const& hint);
nux::LinearLayout* CreateIntermediateLayout();
void RenderColumns();
// Private members
Model::Ptr model_;
nux::VLayout* layout_;
nux::HLayout* columns_layout_;
std::vector columns_;
int x_adjustment_;
int y_adjustment_;
};
} // namespace shortcut
} // namespace unity
#endif // UNITYSHELL_SHORTCUTVIEW_H