• 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 <tdeaction.h>
29 
30 #include <tqstringlist.h>
31 
32 #include <tdefileitem.h>
33 #include <kmimetype.h> // for KDEDesktopMimeType
34 #include <libkonq_export.h>
35 
36 #include <tdeparts/browserextension.h>
37 #include <tdeio/jobclasses.h>
38 
39 #include "konq_xmlguiclient.h"
40 
41 typedef TQValueList<KDEDesktopMimeType::Service> ServiceList;
42 
43 class KPropertiesDialog;
44 class KNewMenu;
45 class KService;
46 class KonqPopupMenuPlugin;
47 class KBookmarkManager;
48 
49 // TODO KDE4: change base class to TDEPopupMenu, see TDEAction::slotPopupActivated()
56 class LIBKONQ_EXPORT KonqPopupMenu : public TQPopupMenu, public KonqXMLGUIClient
57 {
58  TQ_OBJECT
59 public:
60 
65  typedef uint KonqPopupFlags;
66  enum { NoFlags = 0,
67  ShowProperties = 1,
68  IsLink = 2,
69  ShowNewWindow = 4 };
70  // WARNING: bitfield. Next item is 8
71 
77  KonqPopupMenu( KBookmarkManager* manager,
78  const KFileItemList &items,
79  KURL viewURL,
80  TDEActionCollection & actions,
81  KNewMenu * newMenu,
82  bool showPropertiesAndFileType = true ) TDE_DEPRECATED;
83 
88  KonqPopupMenu( KBookmarkManager* manager,
89  const KFileItemList &items,
90  KURL viewURL,
91  TDEActionCollection & actions,
92  KNewMenu * newMenu,
93  TQWidget * parentWidget,
94  bool showPropertiesAndFileType = true ) TDE_DEPRECATED;
95 
116  KonqPopupMenu( KBookmarkManager* manager,
117  const KFileItemList &items,
118  const KURL& viewURL,
119  TDEActionCollection & actions,
120  KNewMenu * newMenu,
121  TQWidget * parentWidget,
122  KonqPopupFlags kpf,
123  KParts::BrowserExtension::PopupFlags f /*= KParts::BrowserExtension::DefaultPopupItems*/);
124 
128  ~KonqPopupMenu();
129 
134  void setURLTitle( const TQString& urlTitle );
135 
136  class LIBKONQ_EXPORT ProtocolInfo {
137  public:
138  ProtocolInfo();
139  bool supportsReading() const;
140  bool supportsWriting() const;
141  bool supportsDeleting() const;
142  bool supportsMoving() const;
143  bool trashIncluded() const;
144  private:
145  friend class KonqPopupMenu;
146  bool m_Reading:1;
147  bool m_Writing:1;
148  bool m_Deleting:1;
149  bool m_Moving:1;
150  bool m_TrashIncluded:1;
151  };
155  virtual TDEAction *action( const TQDomElement &element ) const;
156 
157 
158  virtual TDEActionCollection *actionCollection() const;
159  TQString mimeType( ) const;
160  KURL url( ) const;
161  KFileItemList fileItemList() const;
162  KURL::List popupURLList( ) const;
163  ProtocolInfo protocolInfo() const;
164 
165 public slots: // KDE4: why public?
166  void slotPopupNewDir();
167  void slotPopupNewView();
168  void slotPopupEmptyTrashBin();
169  void slotPopupRestoreTrashedItems();
170  void slotPopupOpenWith();
171  void slotPopupAddToBookmark();
172  void slotRunService();
173  void slotPopupMimeType();
174  void slotPopupProperties();
175  void slotOpenShareFileDialog();
176 
177 protected:
178  TDEActionCollection &m_actions;
179  TDEActionCollection m_ownActions;
180 
181 private slots:
182  void slotLocalURL( TDEIO::LocalURLJob *, const KURL&, bool );
183  void slotLocalURLKIODestroyed( );
184 
185 private:
186  void init (TQWidget * parentWidget, KonqPopupFlags kpf, KParts::BrowserExtension::PopupFlags itemFlags);
187  void setup(KonqPopupFlags kpf);
188  void addPlugins( );
189  int insertServicesSubmenus(const TQMap<TQString, ServiceList>& list, TQDomElement& menu, bool isBuiltin);
190  int insertServices(const ServiceList& list, TQDomElement& menu, bool isBuiltin);
191  bool KIOSKAuthorizedAction(TDEConfig& cfg);
192  KPropertiesDialog* showPropertiesDialog();
193 
194  class KonqPopupMenuPrivate;
195  KonqPopupMenuPrivate *d;
196  KNewMenu *m_pMenuNew;
197  KURL m_sViewURL;
198  TQString m_sMimeType;
199  KFileItemList m_lstItems;
200  KURL::List m_lstPopupURLs;
201  TQMap<int,KService::Ptr> m_mapPopup;
202  TQMap<int,KDEDesktopMimeType::Service> m_mapPopupServices;
203  bool m_bHandleEditOperations;
204  KXMLGUIFactory *m_factory;
205  KXMLGUIBuilder *m_builder;
206  TQString attrName;
207  ProtocolInfo m_info;
208  TQPtrList<KonqPopupMenuPlugin> m_pluginList;
209  KBookmarkManager* m_pManager;
210 };
211 
212 class LIBKONQ_EXPORT KonqPopupMenuPlugin : public TQObject, public KonqXMLGUIClient {
213  TQ_OBJECT
214 public:
222  KonqPopupMenuPlugin( KonqPopupMenu *_popup, const char *name ); // this should also be the parent
223  virtual ~KonqPopupMenuPlugin ( );
224 };
225 
226 #endif
227 
KNewMenu
The 'New' submenu, both for the File menu and the RMB popup menu.
Definition: knewmenu.h:53
KonqPopupMenu
This class implements the popup menu for URLs in konqueror and kdesktop It's usage is very simple : o...
Definition: konq_popupmenu.h:57
KonqPopupMenu::action
virtual TDEAction * action(const TQDomElement &element) const
Reimplemented for internal purpose.
Definition: konq_popupmenu.cpp:1139
KonqPopupMenu::KonqPopupFlags
uint KonqPopupFlags
Flags set by the calling application (konqueror/kdesktop), unlike KParts::BrowserExtension::PopupFlag...
Definition: konq_popupmenu.h:65
KonqXMLGUIClient
This class implements common methods to manipulate the DOMDocument of KXMLGUIClient.
Definition: konq_xmlguiclient.h:35

libkonq

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

libkonq

Skip menu "libkonq"
  • kate
  • libkonq
  • twin
  •   lib
Generated for libkonq by doxygen 1.9.1
This website is maintained by Timothy Pearson.