Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Internet Explorer AdBlock

, 17 Jan 2008 GPL3
Internet Explorer AdBlock Add-on
ieadblock_src.zip
IE AdBlockPS
IE AdBlockps.def
IE AdBlock
AdBlockBand.rgs
AdBlockBHO.rgs
bin
XListCtrlSSDU.lib
XListCtrlSSRU.lib
IE AdBlock.def
IE AdBlock.rgs
res
bmpToolbar.bmp
checkboxes.bmp
icoSettings.ico
XListCtrl
checkboxes.bmp
// Redefinition protection
#ifndef SETTINGS_H
#define SETTINGS_H

//*********************************************************************
// INCLUDES
//*********************************************************************

#include <memory>				// Needed for singleton class
using namespace std;

//*********************************************************************
// CSettings
//*********************************************************************

class CSettings  
{
public:
	// Functions
	static	CSettings * Instance();
	bool	LoadSettings(CString sFilename);
	bool	SaveSettings(CString sFilename = _T(""));

	// Functions - General
	void	SetEnabled(bool bEnabled);
	bool	GetEnabled();

	// Functions - Blacklist
	void	SetBlackList(int index, bool bEnable);
	bool	GetBlackList(int index);
	int		GetBlackListSyncRestDays();
	void	SetBlackListSyncRestDays(int iDays);

	// Functions - Performance
	int		GetCacheSize();
	void	SetCacheSize(int iSize);
	bool	GetEnableRegularExpressions();
	void	SetEnableRegularExpressions(bool bEnable);
	bool	GetShowPerformanceMessages();
	void	SetShowPerformanceMessages(bool bEnable);
	bool	GetHandleApplets();
	void	SetHandleApplets(bool bEnable);
	bool	GetHandleEmbeds();
	void	SetHandleEmbeds(bool bEnable);
	bool	GetHandleFrames();
	void	SetHandleFrames(bool bEnable);
	bool	GetHandleImages();
	void	SetHandleImages(bool bEnable);
	bool	GetHandleScripts();
	void	SetHandleScripts(bool bEnable);
	bool	GetHandleStylesheets();
	void	SetHandleStylesheets(bool bEnable);

private:
	// Constructor & destructor
	CSettings();			// Private constructor because singleton!

	// Functions

	// Variables
	static		std::auto_ptr<CSettings> sm_inst;
	CString		m_sSettingsFile;

	// Variables - General
	bool		m_bEnabled;

	// Variables - Blacklist
	BlackListEx	m_arrBlackLists[BLACKLIST_COUNT];
	int			m_iBlackListSyncRestDays;

	// Variables - Performance
	int			m_iCacheSize;
	bool		m_bEnableRegularExpressions;
	bool		m_bShowPerformanceMessages;
	bool		m_bHandleApplets;
	bool		m_bHandleEmbeds;
	bool		m_bHandleFrames;
	bool		m_bHandleImages;
	bool		m_bHandleScripts;
	bool		m_bHandleStylesheets;
};

// End of redefinition protection
#endif // SETTINGS_H

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Share

About the Author

Geert van Horrik
Software Developer CatenaLogic
Netherlands Netherlands
I am Geert van Horrik, and I have studied Computer Science in the Netherlands.
 
I love to write software using .NET (especially the combination of WPF and C#). I am also the lead developer of Catel, an open-source application development framework for WPF, Silverlight, WP7 and WinRT with the focus on MVVM.
 
I have my own company since January 1st 2007, called CatenaLogic. This company develops commercial and non-commercial software.
 
To download (or buy) applications I have written, visit my website: http://www.catenalogic.com
Follow on   Twitter

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141216.1 | Last Updated 17 Jan 2008
Article Copyright 2008 by Geert van Horrik
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid