summaryrefslogtreecommitdiffstats
path: root/kpovmodeler/pmobjectaction.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit47d455dd55be855e4cc691c32f687f723d9247ee (patch)
tree52e236aaa2576bdb3840ebede26619692fed6d7d /kpovmodeler/pmobjectaction.h
downloadtdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.tar.gz
tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpovmodeler/pmobjectaction.h')
-rw-r--r--kpovmodeler/pmobjectaction.h100
1 files changed, 100 insertions, 0 deletions
diff --git a/kpovmodeler/pmobjectaction.h b/kpovmodeler/pmobjectaction.h
new file mode 100644
index 00000000..e9a843ce
--- /dev/null
+++ b/kpovmodeler/pmobjectaction.h
@@ -0,0 +1,100 @@
+//-*-C++-*-
+/*
+**************************************************************************
+ description
+ --------------------
+ copyright : (C) 2002 by Andreas Zehender
+**************************************************************************
+
+**************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+**************************************************************************/
+
+
+#ifndef PMOBJECTACTION_H
+#define PMOBJECTACTION_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "pmvector.h"
+#include "pmcontrolpoint.h"
+#include "pmmetaobject.h"
+#include <qptrlist.h>
+#include <qstring.h>
+
+class KAction;
+
+/**
+ * Helper class for object action functions.
+ *
+ * Each object can define actions that are inserted into the context
+ * menu. This class stores informations of one action.
+ *
+ * The actionID has to be unique for each class.
+ *
+ * The member m_action is set later by the framework.
+ */
+class PMObjectAction
+{
+public:
+ /**
+ * Constructor
+ */
+ PMObjectAction( PMMetaObject* objectType, int actionID,
+ const QString& description, bool enabled = true )
+ {
+ m_class = objectType;
+ m_actionID = actionID;
+ m_description = description;
+ m_enabled = enabled;
+ m_menuID = -1;
+ }
+
+ /**
+ * Returns the class type for the action
+ */
+ PMMetaObject* objectType( ) const { return m_class; }
+ /**
+ * Returns the action ID
+ */
+ int actionID( ) const { return m_actionID; }
+ /**
+ * Returns the description
+ */
+ QString description( ) const { return m_description; }
+
+ /**
+ * Returns the enabled flag
+ */
+ bool isEnabled( ) const { return m_enabled; }
+ /**
+ * Sets the enabled flag
+ */
+ void setEnabled( bool enable ) { m_enabled = enable; }
+
+ /**
+ * Returns the menu id
+ */
+ int menuID( ) const { return m_menuID; }
+ /**
+ * Sets the menu id
+ */
+ void setMenuID( int id ) { m_menuID = id; }
+
+private:
+ PMMetaObject* m_class;
+ int m_actionID;
+ QString m_description;
+ bool m_enabled;
+ int m_menuID;
+};
+
+#endif