kexi

kexiactioncategories.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2006 Jaroslaw Staniek <js@iidea.pl>
00003 
00004    This program is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
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 GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this program; see the file COPYING.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KEXI_ACTION_CATEGORIES_H
00021 #define KEXI_ACTION_CATEGORIES_H
00022 
00023 #include <ksharedptr.h>
00024 #include "kexipart.h"
00025 
00026 namespace Kexi {
00027 
00028 enum ActionCategory
00029 {
00030     NoActionCategory = 0,      
00031     GlobalActionCategory = 1,  
00032 
00033     PartItemActionCategory = 2,
00034 
00035     WindowActionCategory = 4   
00036 
00037 };
00038 
00040 
00043 class KEXICORE_EXPORT ActionCategories : public KShared
00044 {
00045     public:
00046         ActionCategories();
00047         ~ActionCategories();
00048 
00053         void addAction(const char* name, int categories,
00054             KexiPart::ObjectTypes supportedObjectType1 = (KexiPart::ObjectTypes)0,
00055             KexiPart::ObjectTypes supportedObjectType2 = (KexiPart::ObjectTypes)0,
00056             KexiPart::ObjectTypes supportedObjectType3 = (KexiPart::ObjectTypes)0,
00057             KexiPart::ObjectTypes supportedObjectType4 = (KexiPart::ObjectTypes)0,
00058             KexiPart::ObjectTypes supportedObjectType5 = (KexiPart::ObjectTypes)0,
00059             KexiPart::ObjectTypes supportedObjectType6 = (KexiPart::ObjectTypes)0,
00060             KexiPart::ObjectTypes supportedObjectType7 = (KexiPart::ObjectTypes)0,
00061             KexiPart::ObjectTypes supportedObjectType8 = (KexiPart::ObjectTypes)0);
00062 
00063         void addGlobalAction(const char* name)
00064             { addAction(name, Kexi::GlobalActionCategory); }
00065 
00067         void addPartItemAction(const char* name)
00068             { addAction(name, Kexi::PartItemActionCategory); }
00069 
00073         void addWindowAction(const char* name,
00074             KexiPart::ObjectTypes supportedObjectType1 = (KexiPart::ObjectTypes)0,
00075             KexiPart::ObjectTypes supportedObjectType2 = (KexiPart::ObjectTypes)0,
00076             KexiPart::ObjectTypes supportedObjectType3 = (KexiPart::ObjectTypes)0,
00077             KexiPart::ObjectTypes supportedObjectType4 = (KexiPart::ObjectTypes)0,
00078             KexiPart::ObjectTypes supportedObjectType5 = (KexiPart::ObjectTypes)0,
00079             KexiPart::ObjectTypes supportedObjectType6 = (KexiPart::ObjectTypes)0,
00080             KexiPart::ObjectTypes supportedObjectType7 = (KexiPart::ObjectTypes)0,
00081             KexiPart::ObjectTypes supportedObjectType8 = (KexiPart::ObjectTypes)0)
00082             { addAction(name, Kexi::WindowActionCategory, supportedObjectType1, supportedObjectType2,
00083                 supportedObjectType3, supportedObjectType4, supportedObjectType5, supportedObjectType6,
00084                 supportedObjectType7, supportedObjectType8); }
00085 
00089         void setAllObjectTypesSupported(const char* name, bool set);
00090 
00093         int actionCategories(const char* name) const;
00094 
00097         bool actionSupportsObjectType(const char* name, KexiPart::ObjectTypes objectType) const;
00098     protected:
00099         class Private;
00100         Private *d;
00101 };
00102 
00104 KEXICORE_EXPORT ActionCategories *actionCategories();
00105 
00106 }
00107 
00108 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys