aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/winfileassoc.h
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2014-03-09 10:13:49 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2014-03-09 10:13:49 +0000
commitf9b488772eafffe966972575241d0ff779783bec (patch)
tree67f775a8bf84c95fa6923729126b8ac24aee24ad /src/qmmpui/winfileassoc.h
parentb843d305c6433a2935713ac6e8fdf69848869f2e (diff)
downloadqmmp-f9b488772eafffe966972575241d0ff779783bec.tar.gz
qmmp-f9b488772eafffe966972575241d0ff779783bec.tar.bz2
qmmp-f9b488772eafffe966972575241d0ff779783bec.zip
added winfileaccos.h and winfileaccos.cpp
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4137 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/winfileassoc.h')
-rw-r--r--src/qmmpui/winfileassoc.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/qmmpui/winfileassoc.h b/src/qmmpui/winfileassoc.h
new file mode 100644
index 000000000..e3c34d97d
--- /dev/null
+++ b/src/qmmpui/winfileassoc.h
@@ -0,0 +1,51 @@
+/* smplayer, GUI front-end for mplayer.
+ Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+ Winfileassoc.h
+ Handles file associations in Windows
+ Author: Florin Braghis (florin@libertv.ro)
+*/
+
+#ifndef WINFILEASSOC_H
+#define WINFILEASSOC_H
+
+#include <QString>
+#include <QStringList>
+
+class WinFileAssoc
+{
+protected:
+ QString m_ClassId; //Application ClassId
+ QString m_ClassId2; //The ClassId created by explorer if user selects 'Open With...', usually smplayer.exe
+ QString m_AppName;
+
+protected:
+ bool CreateClassId(const QString& executablePath, const QString& friendlyName);
+ bool RemoveClassId();
+ bool VistaGetDefaultApps(const QStringList &extensions, QStringList& registeredExt);
+ int VistaSetAppsAsDefault(const QStringList& extensions);
+public:
+ WinFileAssoc(const QString ClassId = "MPlayerFileVideo", const QString AppName="SMPlayer");
+ //Checks the registry to see which extensions are registered with SMPlayer
+ bool GetRegisteredExtensions(const QStringList& extensionsToCheck, QStringList& registeredExtensions);
+
+ int CreateFileAssociations(const QStringList& fileExtensions);
+ int RestoreFileAssociations(const QStringList& fileExtensions);
+};
+
+#endif