INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
guielement.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2009 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef HYDROQGUI_GUI_ELEMENT_H 00012 #define HYDROQGUI_GUI_ELEMENT_H 00013 00014 #include <string> 00015 #include <assert.h> 00016 #include <QString> 00017 #include <QColor> 00018 #include <QMouseEvent> 00019 #include <hydroutil/uncopyable.h> 00020 #include <hydroqguielementutil/ihumanmanager.h> 00021 #include <hydroqguielementutil/mouseeventmanager.h> 00022 #include <hydroqguielementutil/shortcutkeymanager.h> 00023 00024 class QSplitter; 00025 00026 namespace hydroqgui { 00027 class GuiElementSet; 00028 }; 00029 00030 namespace hydroqguielementutil 00031 { 00032 00034 struct GuiElementInfo 00035 { 00036 GuiElementInfo( const char *pPlatform, 00037 const char *pUniqueId, 00038 const char *pType ) 00039 : platform(pPlatform), 00040 uniqueId(pUniqueId), 00041 type(pType) 00042 {} 00043 QString platform; 00044 QString uniqueId; 00045 QString type; 00046 }; 00047 00048 00050 struct GuiElementStuff 00051 { 00052 GuiElementStuff() : 00053 humanManager(0), 00054 mouseEventManager(0), 00055 shortcutKeyManager(0), 00056 guiElementSet(0), 00057 spaceBottomRight(0) 00058 {}; 00059 00060 IHumanManager* humanManager; 00061 MouseEventManager* mouseEventManager; 00062 ShortcutKeyManager* shortcutKeyManager; 00063 hydroqgui::GuiElementSet* guiElementSet; 00064 QSplitter* spaceBottomRight; 00065 }; 00066 00067 00077 class GuiElement : public hydroutil::Uncopyable 00078 { 00079 public: 00080 00081 GuiElement( const GuiElementInfo &guiElementInfo ) 00082 : platform_(guiElementInfo.platform), 00083 uniqueId_(guiElementInfo.uniqueId), 00084 type_(guiElementInfo.type) 00085 {} 00086 00087 virtual ~GuiElement() {}; 00088 00091 virtual bool isInGlobalCS() { return false; }; 00092 00094 virtual bool isPermanentElement() const { return false; } 00095 00098 virtual void update () {}; 00099 00102 virtual QStringList contextMenu() { return QStringList(); }; 00103 00106 virtual void execute( int action ) {}; 00107 00111 virtual void setColor( QColor color ) {}; 00112 00114 virtual void setUseTransparency( bool useTransparency ) {}; 00115 00119 virtual void setFocus( bool inFocus ) {}; 00120 00123 virtual void noLongerMouseEventReceiver() {assert(!"unimplemented noLongerMouseEventReceiver");} 00124 00125 virtual void mousePressEvent(QMouseEvent *e) {assert(!"unimplemented mouse function");} 00126 virtual void mouseMoveEvent(QMouseEvent *e) {assert(!"unimplemented mouse function");} 00127 virtual void mouseReleaseEvent(QMouseEvent *e) {assert(!"unimplemented mouse function");} 00128 virtual void mouseDoubleClickEvent(QMouseEvent *e) {assert(!"unimplemented mouse function");} 00129 00131 QString platform() { return platform_; }; 00132 00134 QString uniqueId() { return uniqueId_; }; 00135 00137 QString type() { return type_; }; 00138 00139 static void setGuiElementStuff( const GuiElementStuff& stuff ) { _stuff=stuff; }; 00140 00141 protected : 00142 00143 static GuiElementStuff _stuff; 00144 00145 private: 00146 QString platform_; 00147 QString uniqueId_; 00148 QString type_; 00149 }; 00150 00151 } // namespace 00152 00153 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)