/*************************************************************************** tdeactionmap.h - description ------------------- begin : Fri Mai 19 2006 copyright : (C) 2006 by Dominik Seichter email : domseichter@web.de ***************************************************************************/ /*************************************************************************** * * * 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 _TDEACTION_MAP_H_ #define _TDEACTION_MAP_H_ #include #include #include class TDEActionCollection; class TDEActionMap; #if TDE_VERSION >= 0x030500 class TDEListViewSearchLineWidget; #endif class TDEListView; class TQListViewItem; /** Open a simple dialog containing an action map. */ class TDEActionMapDlg : public KDialogBase { public: TDEActionMapDlg( TDEActionCollection* actions, TQWidget* parent = NULL, const char* name = NULL ); /** Call this function whenever you changed the enabled/disalbed state of an action * in your application. */ void updateEnabledState(); private: TDEActionMap* m_map; }; /** * * This class is an implementation of an Action Map for KDE. * * * What is an Action Map? * * Almost every web page has a site map. According to Wikipedia, * a site map "helps visitors, and search engine robots, to find * pages on the site". Similar an Action Map should help the * user to find actions (i.e. functions or menu items) in an application. * * More concrete an Action Map is a dialog with a list of all * actions (i.e. make text bold, save file or insert image) * that can be performed in the application at its current state. * Additionally there is a search box at the top of the list so * that the user can search the list easily for a special action. * The action is executed by clicking on it. Disabled actions are * grayed out and cannot be clicked. The dialog is modeless so that * it can always be open and the normal usage of the application is not disturbed. */ class TDEActionMap : public TQWidget { Q_OBJECT public: /** Creates a new TDEActionMap widget * @param action all actions from this TDEActionCollection are displayed. * @param parent the parent * @param name the name */ TDEActionMap( TDEActionCollection* actions, TQWidget* parent = NULL, const char* name = NULL ); ~TDEActionMap(); public slots: /** Call this function whenever you changed the enabled/disalbed state of an action * in your application. */ void updateEnabledState(); private slots: void slotActionCollectionChanged(); void slotExecuteAction( TQListViewItem* item ); private: TDEActionCollection* m_actions; TDEListView* m_listView; #if TDE_VERSION >= 0x030500 TDEListViewSearchLineWidget* m_searchLine; #endif bool m_showMenuTree; bool m_grayOutItems; }; #endif // _TDEACTION_MAP_H_