Click here to Skip to main content
13,398,905 members (34,153 online)
Click here to Skip to main content

Stats

255.5K views
1.1K downloads
32 bookmarked
Posted 25 Jun 2007

RSS Reader Plug-in for Internet Explorer

, 17 Jul 2007
This is a toolbar for the Internet Explorer which shows information from RSS taken from the Internet.
Setup.exe
RssReader_src
RRPRssFetcher
RRPRssFetcher
res
RRPRssFetcher.ico
toolbar.bmp
RRPRssFetcher.vcproj.TEKAWADE.Prafulla V Tekawade.user
RSSReaderplugin
Debug
res
RssReaderPlugin.dll.manifest
RRPComInterfaceImplementor.rgs
RssReaderPlugin.aps
RssReaderPlugin.def
RssReaderPlugin.dsp
RssReaderPlugin.dsw
RssReaderPlugin.opt
RssReaderPlugin.plg
RssReaderPlugin.tlb
RssReaderPlugin.vcproj.TEKAWADE.Prafulla V Tekawade.user
RssReaderPluginps.def
RssReaderPluginps.mk
Setup.iss
/*
	Project		: RSS Reader plugin for Internet Explorer
	File Name	: RRPConfigurationDialog.h
	Date		: 
	Purpose		: It contains the code for the settings dialog box which is used to change 
				  the settings of the rss reader
	Note		: 
	Send comments 
	or Bugs to	: prafulla_t@users.sourceforge.net
*/
#pragma once

#include <vector>
#include "resource.h"       // main symbols
#include <winuser.h>
#include <atlwin.h>
#include <atlhost.h>
#include <atlctrls.h>
#include "RRPToolbar.h"
#include "RRPDebugInfoLogger.h"
#include "RRPConfigurationManager.h"

class RRPConfigurationDialog : public CDialogImpl<RRPConfigurationDialog> {
public :
	enum { IDD = IDD_CONFIG_DIALOG };
		
	BEGIN_MSG_MAP(RRPConfigurationDialog)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
		COMMAND_ID_HANDLER(IDC_SAVE,OnSave)
		COMMAND_ID_HANDLER(IDC_REMOVE,OnRemove)
		COMMAND_HANDLER(IDC_NEWS_COMBO, CBN_SELCHANGE, OnCbnSelchangeNewsCombo)
		COMMAND_HANDLER(IDC_TITLE, EN_SETFOCUS, OnEnSetfocusTitle)
	END_MSG_MAP()
	
	
	RRPConfigurationDialog(RRPToolbar *toolbar) {
		this->toolbar = toolbar;
		configManager = toolbar->getConfigManger();
	}

	// Handler prototypes:
//  LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
//  LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
//  LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);

	LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) {
		CenterWindow(GetParent());
		newsCombo = GetDlgItem(IDC_NEWS_COMBO);

		//Making it readonly
		CEdit cedit = ::GetWindow(newsCombo,GW_CHILD);
		
		cedit.SetReadOnly();
		
		//Fill the combo box with news button information
		fillComboBox();
		newsCombo.AddString("Add news button!!");
		newsCombo.SetCurSel(0);
		
		BOOL handled = true;
		OnCbnSelchangeNewsCombo(0,0,0,handled);

		debug = RRPDebugInfoLogger::getInstance();
		debug->setDebug(true);
		return 1;  // Let the system set the focus
	}
	
	LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) {
		return 0;
	}

	LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) {
		EndDialog(wID);
		return 0;
	}

	//Fills the combo box with information of all news buttons
	void fillComboBox() {
//		RRPConfigurationManager *ptr = new RRPConfigurationManager();
//		configManager = RRPConfigurationManager::getInstance();
		addNewsButtonIndex = 0;
		comboEntries.clear();
		//Gets the News Vetor size
		int n  = configManager->getSize();
		int count = 0;
		
		for(int i = 0;i<n;i++) {
//			NewsButtonInfo *newsButton = configManager->getItem(i);
			NewsButtonInfo *newsButton = configManager->getItem(i);
			if(newsButton) {
				newsCombo.AddString(newsButton->title);
				comboEntries.push_back(newsButton->title);
				count++;
			}
		}
		addNewsButtonIndex = count;
	}

public:
	//Invoked when the combo selection changes
	LRESULT OnCbnSelchangeNewsCombo(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT OnSave(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnRemove(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
private:
	//Checks whether the hyperlink is valid or not.
	RRPToolbar *toolbar;
	BOOL checkHyperLink(char *link);
	RRPDebugInfoLogger *debug;
	RRPConfigurationManager *configManager;
	CComboBox newsCombo;
	int addNewsButtonIndex;
	std::vector<char*> comboEntries;
	LRESULT OnEnSetfocusTitle(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
};

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 Code Project Open License (CPOL)

Share

About the Author

PrafullaT
India India
Quote : "Life is all about solving problems and enjoying their solutions !! "

You may also be interested in...

Pro
Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180218.2 | Last Updated 17 Jul 2007
Article Copyright 2007 by PrafullaT
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid