Back to index

unity  6.0.0
AbstractShortcutHint.h
Go to the documentation of this file.
00001 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
00002 /*
00003  * Copyright (C) 2011 Canonical Ltd
00004  *
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU 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,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  *
00017  * Authored by: Andrea Azzarone <azzaronea@gmail.com>
00018  */
00019 
00020 #ifndef UNITYSHELL_ABSTRACT_SHORTCUT_ICON_H
00021 #define UNITYSHELL_ABSTRACT_SHORTCUT_ICON_H
00022 
00023 #include <string>
00024 
00025 #include <Nux/Nux.h>
00026 #include <NuxCore/Property.h>
00027 
00028 namespace unity
00029 {
00030 namespace shortcut
00031 {
00032 
00033 enum OptionType
00034 {
00035   COMPIZ_KEY_OPTION = 0,
00036   COMPIZ_METAKEY_OPTION,
00037   COMPIZ_MOUSE_OPTION,
00038   HARDCODED_OPTION
00039   /* GSETTINGS_OPTION,
00040    * GCONF_OPTION */
00041 };
00042 
00043 class AbstractHint
00044 {
00045 public:
00046   typedef std::shared_ptr<AbstractHint> Ptr;
00047   // Ctor
00048   AbstractHint(std::string const& category,
00049                std::string const& prefix,
00050                std::string const& postfix,
00051                std::string const& description,
00052                OptionType const type,
00053                std::string const& arg1,
00054                std::string const& arg2 = "",
00055                std::string const& arg3 = "")
00056     : category(category)
00057     , prefix(prefix)
00058     , postfix(postfix)
00059     , description(description)
00060     , type(type)
00061     , arg1(arg1)
00062     , arg2(arg2)
00063     , arg3(arg3)
00064   {
00065   }
00066 
00067   // Copy ctor
00068   AbstractHint(unity::shortcut::AbstractHint const& obj)
00069     : category(obj.category())
00070     , prefix(obj.prefix())
00071     , postfix(obj.postfix())
00072     , description(obj.description())
00073     , type(obj.type())
00074     , arg1(obj.arg1())
00075     , arg2(obj.arg2())
00076     , arg3(obj.arg3())
00077     , value(obj.value())
00078     , shortkey(obj.shortkey())
00079   {
00080   }
00081 
00082   // Dtor
00083   virtual ~AbstractHint(){};
00084 
00085   // Public Methods
00086   virtual bool Fill() = 0;
00087 
00088   // Properties
00089   nux::Property<std::string> category;
00090   nux::Property<std::string> prefix;
00091   nux::Property<std::string> postfix;
00092   nux::Property<std::string> description;
00093   nux::Property<OptionType> type;
00094   nux::Property<std::string> arg1;
00095   nux::Property<std::string> arg2;
00096   nux::Property<std::string> arg3;
00097   nux::Property<std::string> value;
00098   nux::Property<std::string> shortkey;
00099 };
00100 
00101 } // namespace shortcut
00102 } // namespace unity
00103 
00104 #endif // UNITYSHELL_ABSTRACT_SHORTCUT_ICON_H