• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libkonq
 

libkonq

  • libkonq
konq_popupmenu.h
1 /* This file is part of the KDE project
2  Copyright (C) 1998, 1999 David Faure <faure@kde.org>
3  Copyright (C) 2001 Holger Freyther <freyther@yahoo.com>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef __konqpopupmenu_h
22 #define __konqpopupmenu_h
23 
24 #include <sys/types.h>
25 
26 #include <tqpopupmenu.h>
27 #include <tqmap.h>
28 #include <kaction.h>
29 
30 #include <tqstringlist.h>
31 
32 #include <kfileitem.h>
33 #include <kmimetype.h> // for KDEDesktopMimeType
34 #include <libkonq_export.h>
35 
36 #include <kparts/browserextension.h>
37 
38 #include "konq_xmlguiclient.h"
39 
40 typedef TQValueList<KDEDesktopMimeType::Service> ServiceList;
41 
42 class KPropertiesDialog;
43 class KNewMenu;
44 class KService;
45 class KonqPopupMenuPlugin;
46 class KBookmarkManager;
47 
48 // TODO KDE4: change base class to KPopupMenu, see KAction::slotPopupActivated()
55 class LIBKONQ_EXPORT KonqPopupMenu : public TQPopupMenu, public KonqXMLGUIClient
56 {
57  Q_OBJECT
58 public:
59 
64  typedef uint KonqPopupFlags;
65  enum { NoFlags = 0,
66  ShowProperties = 1,
67  IsLink = 2,
68  ShowNewWindow = 4 };
69  // WARNING: bitfield. Next item is 8
70 
76  KonqPopupMenu( KBookmarkManager* manager,
77  const KFileItemList &items,
78  KURL viewURL,
79  KActionCollection & actions,
80  KNewMenu * newMenu,
81  bool showPropertiesAndFileType = true ) KDE_DEPRECATED;
82 
87  KonqPopupMenu( KBookmarkManager* manager,
88  const KFileItemList &items,
89  KURL viewURL,
90  KActionCollection & actions,
91  KNewMenu * newMenu,
92  TQWidget * parentWidget,
93  bool showPropertiesAndFileType = true ) KDE_DEPRECATED;
94 
115  KonqPopupMenu( KBookmarkManager* manager,
116  const KFileItemList &items,
117  const KURL& viewURL,
118  KActionCollection & actions,
119  KNewMenu * newMenu,
120  TQWidget * parentWidget,
121  KonqPopupFlags kpf,
122  KParts::BrowserExtension::PopupFlags f /*= KParts::BrowserExtension::DefaultPopupItems*/);
123 
127  ~KonqPopupMenu();
128 
133  void setURLTitle( const TQString& urlTitle );
134 
135  class LIBKONQ_EXPORT ProtocolInfo {
136  public:
137  ProtocolInfo();
138  bool supportsReading() const;
139  bool supportsWriting() const;
140  bool supportsDeleting() const;
141  bool supportsMoving() const;
142  bool trashIncluded() const;
143  private:
144  friend class KonqPopupMenu;
145  bool m_Reading:1;
146  bool m_Writing:1;
147  bool m_Deleting:1;
148  bool m_Moving:1;
149  bool m_TrashIncluded:1;
150  };
154  virtual KAction *action( const TQDomElement &element ) const;
155 
156 
157  virtual KActionCollection *actionCollection() const;
158  TQString mimeType( ) const;
159  KURL url( ) const;
160  KFileItemList fileItemList() const;
161  KURL::List popupURLList( ) const;
162  ProtocolInfo protocolInfo() const;
163 
164 public slots: // KDE4: why public?
165  void slotPopupNewDir();
166  void slotPopupNewView();
167  void slotPopupEmptyTrashBin();
168  void slotPopupRestoreTrashedItems();
169  void slotPopupOpenWith();
170  void slotPopupAddToBookmark();
171  void slotRunService();
172  void slotPopupMimeType();
173  void slotPopupProperties();
174  void slotOpenShareFileDialog();
175 protected:
176  KActionCollection &m_actions;
177  KActionCollection m_ownActions;
178 
179 private:
180  void init (TQWidget * parentWidget, KonqPopupFlags kpf, KParts::BrowserExtension::PopupFlags itemFlags);
181  void setup(KonqPopupFlags kpf);
182  void addPlugins( );
183  int insertServicesSubmenus(const TQMap<TQString, ServiceList>& list, TQDomElement& menu, bool isBuiltin);
184  int insertServices(const ServiceList& list, TQDomElement& menu, bool isBuiltin);
185  bool KIOSKAuthorizedAction(KConfig& cfg);
186  KPropertiesDialog* showPropertiesDialog();
187 
188  class KonqPopupMenuPrivate;
189  KonqPopupMenuPrivate *d;
190  KNewMenu *m_pMenuNew;
191  KURL m_sViewURL;
192  TQString m_sMimeType;
193  KFileItemList m_lstItems;
194  KURL::List m_lstPopupURLs;
195  TQMap<int,KService::Ptr> m_mapPopup;
196  TQMap<int,KDEDesktopMimeType::Service> m_mapPopupServices;
197  bool m_bHandleEditOperations;
198  KXMLGUIFactory *m_factory;
199  KXMLGUIBuilder *m_builder;
200  TQString attrName;
201  ProtocolInfo m_info;
202  TQPtrList<KonqPopupMenuPlugin> m_pluginList;
203  KBookmarkManager* m_pManager;
204 };
205 
206 class LIBKONQ_EXPORT KonqPopupMenuPlugin : public TQObject, public KonqXMLGUIClient {
207  Q_OBJECT
208 public:
216  KonqPopupMenuPlugin( KonqPopupMenu *_popup, const char *name ); // this should also be the parent
217  virtual ~KonqPopupMenuPlugin ( );
218 };
219 
220 #endif
221 

libkonq

Skip menu "libkonq"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libkonq

Skip menu "libkonq"
  • kate
  • kwin
  •   lib
  • libkonq
Generated for libkonq by doxygen 1.8.3.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |