Qmmp
/usr/src/RPM/BUILD/qmmp-1.1.7/src/qmmpui/winfileassoc.h
00001 /*  smplayer, GUI front-end for mplayer.
00002     Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net>
00003 
00004     This program is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with this program; if not, write to the Free Software
00016     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 
00019         Winfileassoc.h
00020         Handles file associations in Windows
00021         Author: Florin Braghis (florin@libertv.ro)
00022 */
00023 
00024 #ifndef WINFILEASSOC_H
00025 #define WINFILEASSOC_H
00026 
00027 #include <QString>
00028 #include <QStringList>
00029 
00030 
00034 class WinFileAssoc
00035 {
00036 protected:
00037         QString m_ClassId; //Application ClassId
00038     QString m_ClassId2; //The ClassId created by explorer if user selects 'Open With...', usually qmmp.exe
00039         QString m_AppName;
00040 
00041 protected:
00042         bool CreateClassId(const QString& executablePath, const QString& friendlyName); 
00043         bool VistaGetDefaultApps(const QStringList &extensions, QStringList& registeredExt);
00044         int  VistaSetAppsAsDefault(const QStringList& extensions);
00045 public:
00046     WinFileAssoc(const QString ClassId = "QmmpFileAudio", const QString AppName="Qmmp");
00047         //Checks the registry to see which extensions are registered with SMPlayer
00048         bool GetRegisteredExtensions(const QStringList& extensionsToCheck, QStringList& registeredExtensions);
00049     bool RemoveClassId();
00050         int CreateFileAssociations(const QStringList& fileExtensions); 
00051         int RestoreFileAssociations(const QStringList& fileExtensions);
00052 };
00053 
00054 #endif
 All Classes Functions Variables Enumerations Enumerator