• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • kio
kfileitemactions_p.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  Copyright (C) 1998-2009 David Faure <faure@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify
5  it under the terms of the GNU Library General Public License as published
6  by the Free Software Foundation; either version 2 of the License or
7  ( at your option ) version 3 or, at the discretion of KDE e.V.
8  ( which shall act as a proxy as in section 14 of the GPLv3 ), 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 KFILEITEMACTIONS_P_H
22 #define KFILEITEMACTIONS_P_H
23 
24 #include <kfileitemlistproperties.h>
25 #include <kfileitem.h>
26 #include <kactioncollection.h>
27 #include <kserviceaction.h>
28 #include <kservice.h>
29 #include <QActionGroup>
30 #include <QObject>
31 
32 class KFileItemActions;
33 
34 typedef QList<KServiceAction> ServiceList;
35 
36 class KFileItemActionsPrivate : public QObject
37 {
38  Q_OBJECT
39 public:
40  KFileItemActionsPrivate(KFileItemActions *qq);
41  ~KFileItemActionsPrivate();
42 
43  int insertServicesSubmenus(const QMap<QString, ServiceList>& list, QMenu* menu, bool isBuiltin);
44  int insertServices(const ServiceList& list, QMenu* menu, bool isBuiltin);
45 
46  // For "open with"
47  KService::List associatedApplications(const QString& traderConstraint);
48  KAction* createAppAction(const KService::Ptr& service, bool singleOffer);
49 
50  struct ServiceRank
51  {
52  int score;
53  KService::Ptr service;
54  };
55 
56  // Inline function for sorting lists of ServiceRank
57  static bool lessRank(const ServiceRank& id1, const ServiceRank& id2)
58  {
59  return id1.score < id2.score;
60  }
61 
62  QStringList listMimeTypes(const KFileItemList& items);
63  QStringList listPreferredServiceIds(const QStringList& mimeTypeList, const QString& traderConstraint);
64 
65 public Q_SLOTS:
66  void slotRunPreferredApplications();
67 
68 private:
69  void openWithByMime(const KFileItemList& fileItems);
70 
71 private Q_SLOTS:
72  // For servicemenus
73  void slotExecuteService(QAction* act);
74  // For "open with" applications
75  void slotRunApplication(QAction* act);
76  void slotOpenWithDialog();
77 
78 public:
79  KFileItemActions* const q;
80  KFileItemListProperties m_props;
81  QStringList m_mimeTypeList;
82  QString m_traderConstraint;
83  KFileItemList m_fileOpenList;
84  QActionGroup m_executeServiceActionGroup;
85  QActionGroup m_runApplicationActionGroup;
86  QList<KAction*> m_ownActions;
87  QWidget* m_parentWidget;
88 };
89 
90 Q_DECLARE_METATYPE(KService::Ptr)
91 Q_DECLARE_METATYPE(KServiceAction)
92 
93 #endif /* KFILEITEMACTIONS_P_H */
94 
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Fri Jul 12 2013 08:54:02 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

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

kdelibs-4.10.5 API Reference

Skip menu "kdelibs-4.10.5 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal