• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 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
32class KFileItemActions;
33
34typedef QList<KServiceAction> ServiceList;
35
36class KFileItemActionsPrivate : public QObject
37{
38 Q_OBJECT
39public:
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
65public Q_SLOTS:
66 void slotRunPreferredApplications();
67
68private:
69 void openWithByMime(const KFileItemList& fileItems);
70
71private Q_SLOTS:
72 // For servicemenus
73 void slotExecuteService(QAction* act);
74 // For "open with" applications
75 void slotRunApplication(QAction* act);
76 void slotOpenWithDialog();
77
78public:
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
90Q_DECLARE_METATYPE(KService::Ptr)
91Q_DECLARE_METATYPE(KServiceAction)
92
93#endif /* KFILEITEMACTIONS_P_H */
94
KAction
KFileItemActionsPrivate
Definition: kfileitemactions_p.h:37
KFileItemActionsPrivate::insertServicesSubmenus
int insertServicesSubmenus(const QMap< QString, ServiceList > &list, QMenu *menu, bool isBuiltin)
Definition: kfileitemactions.cpp:111
KFileItemActionsPrivate::insertServices
int insertServices(const ServiceList &list, QMenu *menu, bool isBuiltin)
Definition: kfileitemactions.cpp:133
KFileItemActionsPrivate::m_runApplicationActionGroup
QActionGroup m_runApplicationActionGroup
Definition: kfileitemactions_p.h:85
KFileItemActionsPrivate::m_props
KFileItemListProperties m_props
Definition: kfileitemactions_p.h:80
KFileItemActionsPrivate::~KFileItemActionsPrivate
~KFileItemActionsPrivate()
Definition: kfileitemactions.cpp:106
KFileItemActionsPrivate::listPreferredServiceIds
QStringList listPreferredServiceIds(const QStringList &mimeTypeList, const QString &traderConstraint)
Definition: kfileitemactions.cpp:681
KFileItemActionsPrivate::m_fileOpenList
KFileItemList m_fileOpenList
Definition: kfileitemactions_p.h:83
KFileItemActionsPrivate::m_parentWidget
QWidget * m_parentWidget
Definition: kfileitemactions_p.h:87
KFileItemActionsPrivate::listMimeTypes
QStringList listMimeTypes(const KFileItemList &items)
Definition: kfileitemactions.cpp:671
KFileItemActionsPrivate::m_traderConstraint
QString m_traderConstraint
Definition: kfileitemactions_p.h:82
KFileItemActionsPrivate::associatedApplications
KService::List associatedApplications(const QString &traderConstraint)
KFileItemActionsPrivate::m_executeServiceActionGroup
QActionGroup m_executeServiceActionGroup
Definition: kfileitemactions_p.h:84
KFileItemActionsPrivate::createAppAction
KAction * createAppAction(const KService::Ptr &service, bool singleOffer)
Definition: kfileitemactions.cpp:693
KFileItemActionsPrivate::lessRank
static bool lessRank(const ServiceRank &id1, const ServiceRank &id2)
Definition: kfileitemactions_p.h:57
KFileItemActionsPrivate::q
KFileItemActions *const q
Definition: kfileitemactions_p.h:79
KFileItemActionsPrivate::m_mimeTypeList
QStringList m_mimeTypeList
Definition: kfileitemactions_p.h:81
KFileItemActionsPrivate::slotRunPreferredApplications
void slotRunPreferredApplications()
Definition: kfileitemactions.cpp:602
KFileItemActionsPrivate::m_ownActions
QList< KAction * > m_ownActions
Definition: kfileitemactions_p.h:86
KFileItemActions
This class creates and handles the actions for a url (or urls) in a popupmenu.
Definition: kfileitemactions.h:45
KFileItemListProperties
Provides information about the common properties of a group of KFileItem objects.
Definition: kfileitemlistproperties.h:50
KFileItemList
List of KFileItems, which adds a few helper methods to QList<KFileItem>.
Definition: kfileitem.h:675
KServiceAction
KSharedPtr< KService >
QAction
QList
QMap
QMenu
QObject
QWidget
kactioncollection.h
kfileitem.h
ServiceList
QList< KServiceAction > ServiceList
Definition: kfileitemactions_p.h:34
kfileitemlistproperties.h
kservice.h
kserviceaction.h
KFileItemActionsPrivate::ServiceRank
Definition: kfileitemactions_p.h:51
KFileItemActionsPrivate::ServiceRank::score
int score
Definition: kfileitemactions_p.h:52
KFileItemActionsPrivate::ServiceRank::service
KService::Ptr service
Definition: kfileitemactions_p.h:53
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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.14.38 API Reference

Skip menu "kdelibs-4.14.38 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