Falkon Develop
Cross-platform Qt-based web browser
registerqappassociation.h
Go to the documentation of this file.
1/* ============================================================
2* Copyright (C) 2012-2017 S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
3* This file is part of Falkon - Qt web browser 2010-2014
4* by David Rosca <nowrep@gmail.com>
5*
6* This program is free software: you can redistribute it and/or modify
7* it under the terms of the GNU General Public License as published by
8* the Free Software Foundation, either version 3 of the License, or
9* (at your option) any later version.
10*
11* This program is distributed in the hope that it will be useful,
12* but WITHOUT ANY WARRANTY; without even the implied warranty of
13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14* GNU General Public License for more details.
15*
16* You should have received a copy of the GNU General Public License
17* along with this program. If not, see <http://www.gnu.org/licenses/>.
18* ============================================================ */
19#ifndef REGISTERQAPPASSOCIATION_H
20#define REGISTERQAPPASSOCIATION_H
21
22#include <QObject>
23#include <QHash>
24#include <QPair>
25
26#include "qzcommon.h"
27
29{
30 Q_OBJECT
31public:
32 explicit RegisterQAppAssociation(QObject* parent = nullptr);
33 explicit RegisterQAppAssociation(const QString &appRegisteredName, const QString &appPath,
34 const QString &appIcon = QString(), const QString &appDesc = QString(), QObject* parent = nullptr);
36
39 UrlAssociation
40 };
41
42 void addCapability(const QString &assocName, const QString &progId,
43 const QString &desc, const QString &iconPath, AssociationType type);
44 void removeCapability(const QString &assocName);
45
46 void setAppInfo(const QString &appRegisteredName, const QString &appPath,
47 const QString &appIcon = QString(), const QString &appDesc = QString());
48
49 bool isPerMachineRegisteration();
50 void setPerMachineRegisteration(bool enable);
51 bool registerAppCapabilities();
52 bool isVistaOrNewer();
53 bool isWin10OrNewer();
54 void registerAssociation(const QString &assocName, AssociationType type);
55 void createProgId(const QString &progId);
56
57 bool isDefaultApp(const QString &assocName, AssociationType type);
58 bool isDefaultForAllCapabilities();
59 void registerAllAssociation();
60
61 bool showNativeDefaultAppSettingsUi();
62
63private:
64 QString _appRegisteredName;
65 QString _appPath;
66 QString _appIcon;
67 QString _appDesc;
68 QString _UserRootKey;
69
70 QHash<QString, QString> _fileAssocHash; // (extension, progId)
71 QHash<QString, QString> _urlAssocHash; // (protocol, progId)
72 QHash<QString, QPair<QString, QString> > _assocDescHash; // (progId, (desc, icon))
73};
74
75#endif // REGISTERQAPPASSOCIATION_H
#define FALKON_EXPORT
Definition: qzcommon.h:28