00001 /* 00002 Copyright (C) 1999-2006 Id Software, Inc. and contributors. 00003 For a list of contributors, see the accompanying CONTRIBUTORS file. 00004 00005 This file is part of GtkRadiant. 00006 00007 GtkRadiant is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. 00011 00012 GtkRadiant is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with GtkRadiant; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00022 #if !defined(INCLUDED_IPLUGTOOLBAR_H) 00023 #define INCLUDED_IPLUGTOOLBAR_H 00024 00025 #include <cstddef> 00026 #include "generic/constant.h" 00027 00028 class IToolbarButton { 00029 public: 00030 enum EType { 00031 eSpace, 00032 eButton, 00033 eToggleButton, 00034 eRadioButton, 00035 }; 00036 00037 virtual ~IToolbarButton(){} 00038 00039 virtual const char* getImage() const = 0; 00040 virtual const char* getText() const = 0; 00041 virtual const char* getTooltip() const = 0; 00042 virtual EType getType() const = 0; 00043 virtual void activate() const = 0; 00044 }; 00045 00046 typedef std::size_t (* PFN_TOOLBARBUTTONCOUNT)(); 00047 typedef const IToolbarButton* (* PFN_GETTOOLBARBUTTON)(std::size_t index); 00048 00049 struct _QERPlugToolbarTable { 00050 INTEGER_CONSTANT(Version, 1); 00051 STRING_CONSTANT(Name, "toolbar"); 00052 00053 PFN_TOOLBARBUTTONCOUNT m_pfnToolbarButtonCount; 00054 PFN_GETTOOLBARBUTTON m_pfnGetToolbarButton; 00055 }; 00056 00057 template<typename Type> 00058 class Modules; 00059 typedef Modules<_QERPlugToolbarTable> ToolbarModules; 00060 00061 template<typename Type> 00062 class ModulesRef; 00063 typedef ModulesRef<_QERPlugToolbarTable> ToolbarModulesRef; 00064 00065 #endif