Context.cpp

/****************************************************************************/

/**                                                                        **/

/** Copyright (c) 2005 Diodia Software          (http://www.diodia.com/)   **/

/**                                                                        **/

/** Use in any form with or without modification for commercial and non-   **/

/** commercial purposes is permitted.                                      **/

/**                                                                        **/

/****************************************************************************/

#include "stdafx.h"

#include "mshtmhst.h"

 

#include "HookC.h"

#include "ContextC.h"

#include "Commands.h"

 

/****************************************************************************/

/*

/* DESCRIPTION : ContextC constructor.

/*

/* RETURN VALUE: -

/*

/****************************************************************************/

ContextC::ContextC(HookC *Hook)

{

   mToolBandHook = Hook;

   mRegistryNotify = NULL;

   mFeedListSize = 25;

}

 

/****************************************************************************/

/*

/* DESCRIPTION : ContextC destructor.

/*

/* RETURN VALUE: -

/*

/****************************************************************************/

ContextC::~ContextC()

{

   if (mRegistryNotify)

      delete mRegistryNotify;

}

 

/****************************************************************************/

/*

/* DESCRIPTION : Get toolbar configuration.

/*

/* RETURN VALUE: URL

/*

/****************************************************************************/

std::string ContextC::GetConfigurationUrl()

{

   return std::string("res://") + mDllPath + "/ToolBandLayout.xml";

}

 

/****************************************************************************/

/*

/* DESCRIPTION : Get toolbar layout registry key.

/*

/* RETURN VALUE: Key

/*

/****************************************************************************/

void ContextC::GetRegistryKey(HKEY *MainKey, const char **SubKey, const char **Name)

{

   *MainKey = HKEY_CURRENT_USER;

   *SubKey = REG_KEY;

   *Name = "DisabledCommands";

}

 

/****************************************************************************/

/*

/* DESCRIPTION : Create commands, etc..

/*

/* RETURN VALUE: None

/*

/****************************************************************************/

void ContextC::Initialize()

{

   AddCommand(new HomeCmdC);

   AddCommand(new AboutCmdC);

   AddCommand(new HelpCmdC);

   AddCommand(new FeedListCmdC);

   AddCommand(new ManageCmdC);

   AddCommand(new GoToFeedCmdC);

 

   InitializeFeeds();

}

 

/****************************************************************************/

/*

/* DESCRIPTION : Show About dialog.

/*

/* RETURN VALUE: None

/*

/****************************************************************************/

void ContextC::ShowAboutDialog()

{

   HINSTANCE    Instance;

   SHOWHTMLDIALOGFN *ShowHTMLDialogProc;

   IMoniker    *Moniker;

   CString      Url;

   bstr_t       bUrl;

   BSTR         URL;

   bstr_t       bOptions;

 

   Url = (CString) "res://" + mDllPath + "/about.htm";

   Url.MakeLower();

   bUrl = Url;

 

   bOptions = "dialogHeight:200px;dialogWidth:340px;status=no;help=off";

 

   Instance = LoadLibrary("MSHTML.DLL");

   if (Instance)

   {

      ShowHTMLDialogProc = (SHOWHTMLDIALOGFN *) GetProcAddress(Instance, "ShowHTMLDialog");

      if (ShowHTMLDialogProc)

      {

         URL = SysAllocString(bUrl);

         CreateURLMoniker(NULL, URL, &Moniker);

         if (Moniker)

         {

            (*ShowHTMLDialogProc)(mBrowserWindow, Moniker, NULL, bOptions, NULL);

            Moniker->Release();

         }

         SysFreeString(URL);

      }

      FreeLibrary(Instance);

   }

}





Source Files
   Commands.cpp
   Context.cpp
   CreatePath.cpp
   DateParser.cpp
   DlgEditFeedC.cpp
   DlgManageFeedsC.cpp
   Hook.cpp
   Iso8601.cpp
   MsXmlMisc.cpp
   MsXmlSelect.cpp
   RegistryNotify.cpp
   RegistryUtil.cpp
   RSS.cpp
   RSS.def
   RSS.idl
   RssAction.cpp
   RssDownloader.cpp
   RssFeed.cpp
   RssHelpers.cpp
   RssInit.cpp
   RssItem.cpp
   RssMultiFeed.cpp
   RssTimer.cpp
   RssXml.cpp
   StdAfx.cpp

Header Files
   Commands.h
   ContextC.h
   DateParser.h
   DlgEditFeedC.h
   DlgManageFeedsC.h
   Helper.h
   HookC.h
   RegistryNotify.h
   RegistryNotifyC.h
   Resource.h
   RssDownloaderC.h
   RssFeedC.h
   RssHelpers.h
   RssItemC.h
   RssMultiFeedC.h
   StdAfx.h
   ThreadObject.h
   XmlHelpers.h

Resource Files
   about.htm
   DiodiaLogoSmall.gif
   logo.bmp
   manifest.xml
   read.bmp
   RSS.rc
   RSS.rgs
   ToolBandLayout.xml
 

© 2002-2008 Diodia Software