Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

WWhizInterface Class Reference

This is the master control mechanism for anything residing in the WWhizInterface module. More...

#include <WWhizInterface2.h>

List of all members.

Public Types

typedef void (* TagRefreshCallback )(const TagCallbackInfo &info)
 The definition of the callback called from the tag refresh.


Public Methods

virtual void Reserved0 ()=0
 Initializes the WWhizInterface.

virtual WWhizProjectListGetProjectList (void)const=0
virtual WWhizFileListGetFileList (void)const=0
virtual CString GetWorkspaceName (void)const=0
virtual const CString& GetWorkspaceLocation (void)const=0
virtual void SetWorkspaceLocation (void)=0
 DevStudio provides no function to return the location of the workspace, so WWhizInterface provides this functionality. More...

virtual const CString& GetExtraFilename (void)=0
virtual bool GetCurrentFilename (CString &filename)const=0
virtual WWhizProjectGetCurrentProject ()const=0
virtual void ResolveFilename (const CString &rootDir,CString &filename)=0
 Resolves the filename when it contains environment variables and relative paths. More...

virtual bool RefreshFileList (void)=0
 It is wise to refresh the file list before using any file or tag commands. More...

virtual void AddProject (CString projectName)=0
 Adds a project to the list of WWhizInterface projects. More...

virtual void RemoveAllFiles (void)=0
 Performs a full cleanup of the WWhizInterface internal structures.

virtual void Reserved1 ()=0
virtual const WWhizTagGetTagMatchHead (void)const=0
virtual const WWhizTagGetTagMatchTail (void)const=0
virtual int GetTagMatchCount (void)const=0
virtual const WWhizTagGetLastMatchedTag (void)const=0
virtual const WWhizTagListGetTagList (void)const=0
virtual void RemoveAllTags (void)=0
 Performs a full cleanup of the WWhizInterface internal tag structures.

virtual void MatchTag (const WWhizTagList &tags,LPCTSTR name,WWhizTag::Type forceType=WWhizTag::LAST_TYPE)const=0
 Matches [name] against a tag list. More...

virtual bool GotoTag (const WWhizTag *tag)const=0
 If the WWhizReg registration interface exists and DevStudio is loaded, the appropriate source file is opened and the caret is positioned. More...

virtual void SetTagCallback (TagRefreshCallback callback,void *userData)=0
 Before calling RefreshTagList(), a tag callback may be set through this function. More...

virtual void RefreshTagList (bool forceRefresh=false,bool forceSave=false)=0
 Refreshes the tag list. More...

virtual void LoadTags ()=0
 Loads a list of saved tags from the disk.

virtual void SaveTags ()=0
 Saves the list of tags to the disk. More...

virtual bool GetTagUseType (WWhizTag::Type type)=0
virtual void SetTagUseType (WWhizTag::Type type,bool use)=0
 Sets the tag types considered for the MatchTag() routine. More...

virtual WWhizFileListGetGlobalFileList (void)const=0
virtual bool RefreshGlobalFileList (void)=0
 Refreshes the global file list.

virtual WWhizConfigGetConfig ()=0
virtual CTime GetLastFileRefreshTime ()const=0
virtual CTime GetLastTagRefreshTime ()const=0
virtual void SetWWhizReg (WWhizReg *wwhizReg)=0
 Sets a pointer to the Workspace Whiz! registration module. More...

virtual WWhizFileListGetActiveFileList (void)const=0
virtual DWORD GetVersion (void)const=0
virtual void AddChangedFile (CString filename)=0
 For better efficiency, WWhizInterface maintains a list of files to check for tag changes. More...

virtual void CheckActiveFilesForChanges ()=0
 After calling CheckActiveFilesForChanges(), the next tag refresh will check every file in the workspace for changes.

virtual const WWhizTagGetTagScope (const CString &filename,UINT lineNumber)=0
 Retrieves the tag whose scope contains the specified line number. More...

virtual const CString& GetWorkspaceFullPath (void)const=0


Detailed Description

This is the master control mechanism for anything residing in the WWhizInterface module.

All facilities for project information, file lists, and tag lists are accessible from this interface.

Note: Any filename passed to any WWhizInterface function is passed through ResolveFilename().


Member Typedef Documentation

typedef void(* WWhizInterface::TagRefreshCallback)(const TagCallbackInfo &info)
 

The definition of the callback called from the tag refresh.


Member Function Documentation

void WWhizInterface::AddChangedFile ( CString filename ) [pure virtual]
 

For better efficiency, WWhizInterface maintains a list of files to check for tag changes.

If a file is modified, it should be added to WWhizInterface via the AddChangedFile() function.

Parameters:
filename   The full pathname of the file that changed.

void WWhizInterface::AddProject ( CString projectName ) [pure virtual]
 

Adds a project to the list of WWhizInterface projects.

Projects (.dsp) or workspaces (.dsw) are the only file types that can be added.

Parameters:
projectName   The path to the project or workspace file to be added.

void WWhizInterface::CheckActiveFilesForChanges ( ) [pure virtual]
 

After calling CheckActiveFilesForChanges(), the next tag refresh will check every file in the workspace for changes.

WWhizFileList & WWhizInterface::GetActiveFileList ( void ) const [pure virtual]
 

Returns:
Returns the file list corresponding to all the open active projects.
See also:
GetProjectList

WWhizConfig & WWhizInterface::GetConfig ( ) [pure virtual]
 

Returns:
Retrieves the WWhizConfig interface.

bool WWhizInterface::GetCurrentFilename ( CString & filename ) const [pure virtual]
 

Parameters:
filename   A reference to a CString where the currently active file's full path will be stored. If DevStudio is not running, filename will be an empty string.
Returns:
Returns true if a filename was able to be retrieved. False, otherwise.

WWhizProject * WWhizInterface::GetCurrentProject ( ) const [pure virtual]
 

Returns:
When running DevStudio, returns the WWhizProject interface to the currently active project in the workspace.

const CString & WWhizInterface::GetExtraFilename ( void ) [pure virtual]
 

Returns:
Returns the full path to the ExtraFiles.WW file.

WWhizFileList & WWhizInterface::GetFileList ( void ) const [pure virtual]
 

Returns:
Returns the file list corresponding to all the open projects.
See also:
GetProjectList

WWhizFileList & WWhizInterface::GetGlobalFileList ( void ) const [pure virtual]
 

Returns:
Retrieves the global file list, which is the list of files queried from the global include directories. (In DevStudio, they are found under Tools->Options->Directories->Include Files.)

CTime WWhizInterface::GetLastFileRefreshTime ( ) const [pure virtual]
 

Returns:
Retrieves the last time RefreshFileList() found new files.

const WWhizTag * WWhizInterface::GetLastMatchedTag ( void ) const [pure virtual]
 

Returns:
If the WWhizReg registration interface exists, returns the last tag moved to through GotoTag().

CTime WWhizInterface::GetLastTagRefreshTime ( ) const [pure virtual]
 

Returns:
Returns the last time RefreshTagList() found new tags.

WWhizProjectList & WWhizInterface::GetProjectList ( void ) const [pure virtual]
 

Returns:
Returns the list of projects considered by WWhizInterface. The list includes the projects from the open workspace and any other application-added projects, particularly through the registration module's ExtraFiles interface.

const WWhizTagList & WWhizInterface::GetTagList ( void ) const [pure virtual]
 

Returns:
Retrieves the list of tags corresponding to all of the files in GetFileList().

int WWhizInterface::GetTagMatchCount ( void ) const [pure virtual]
 

Returns:
Returns the total number of matched tags found through the MatchTag() function.

const WWhizTag * WWhizInterface::GetTagMatchHead ( void ) const [pure virtual]
 

Returns:
After performing a tag match through the MatchTag() function, GetTagMatchHead() returns the first found WWhizTag.

const WWhizTag * WWhizInterface::GetTagMatchTail ( void ) const [pure virtual]
 

Returns:
After performing a tag match through the MatchTag() function, GetTagMatchTail() returns the last found WWhizTag.

const WWhizTag * WWhizInterface::GetTagScope ( const CString & filename,
UINT lineNumber ) [pure virtual]
 

Retrieves the tag whose scope contains the specified line number.

Parameters:
filename   The name of the file where the tag resides.
lineNumber   The line number to match a tag's scope with.
Returns:
Returns the tag whose scope contains lineNumber or NULL if no tag is matched.

bool WWhizInterface::GetTagUseType ( WWhizTag::Type type ) [pure virtual]
 

Parameters:
The   tag type to query.
Returns:
Returns whether the specified tag type is considered for the MatchTag() search.

DWORD WWhizInterface::GetVersion ( void ) const [pure virtual]
 

Returns:
Returns the version of the WWhizInterface library. Bits 24-31 = Major version. Bits 16-23 = Minor version. Bits 0-15 = Build.
See also:
GetProjectList

const CString & WWhizInterface::GetWorkspaceFullPath ( void ) const [pure virtual]
 

Returns:
Returns the open workspace filename.

const CString & WWhizInterface::GetWorkspaceLocation ( void ) const [pure virtual]
 

Returns:
Returns the open workspace location. Note that this location is set through the function SetWorkspaceLocation().
See also:
SetWorkspaceLocation

CString WWhizInterface::GetWorkspaceName ( void ) const [pure virtual]
 

Returns:
Returns the open workspace filename.

bool WWhizInterface::GotoTag ( const WWhizTag * tag ) const [pure virtual]
 

If the WWhizReg registration interface exists and DevStudio is loaded, the appropriate source file is opened and the caret is positioned.

Parameters:
tag   The tag to go to.

void WWhizInterface::LoadTags ( ) [pure virtual]
 

Loads a list of saved tags from the disk.

void WWhizInterface::MatchTag ( const WWhizTagList & tags,
LPCTSTR name,
WWhizTag::Type forceType = WWhizTag::LAST_TYPE ) const [pure virtual]
 

Matches [name] against a tag list.

The list of matched tags can be retrieved through GetTagMatchHead(), GetTagMatchTail(), and GetTagMatchCount(). Additionally, WWhizTag::GetMatchNext() and WWhizTag::GetMatchPrev() may be used for traversal.

Parameters:
tags   The tag list to match against.
name   [name] is of the format described in the Find Tag Workspace Whiz! documentation.

bool WWhizInterface::RefreshFileList ( void ) [pure virtual]
 

It is wise to refresh the file list before using any file or tag commands.

This is especially true when running in DevStudio. Since DevStudio provides no COM method of retrieving the list of files in a project, WWhizInterface is only able to retrieve its file list by parsing .dsp files. This has at least one primary disadvantage. If a change is made to the project in DevStudio, the project MUST be saved before WWhizInterface can process the change.

RefreshFileList() does a scan of .dsp files to determine if updates are necessary. This scan is very quick, so it is advised the application calls RefreshFileList() before each set of file or tag commands.

When in DevStudio, RefreshFileList() automatically adds any projects in the open workspace.

If the Workspace Whiz! registration interface is available, ExtraFiles are added, also.

bool WWhizInterface::RefreshGlobalFileList ( void ) [pure virtual]
 

Refreshes the global file list.

void WWhizInterface::RefreshTagList ( bool forceRefresh = false,
bool forceSave = false ) [pure virtual]
 

Refreshes the tag list.

If WWhizConfig::GetAutoRefreshTags() is not set and [forceRefresh] is not set, then the tags aren't refreshed.

Parameters:
forceRefresh   Forces a tag refresh.

void WWhizInterface::RemoveAllFiles ( void ) [pure virtual]
 

Performs a full cleanup of the WWhizInterface internal structures.

void WWhizInterface::RemoveAllTags ( void ) [pure virtual]
 

Performs a full cleanup of the WWhizInterface internal tag structures.

void WWhizInterface::Reserved0 ( ) [pure virtual]
 

Initializes the WWhizInterface.

void WWhizInterface::Reserved1 ( ) [pure virtual]
 

void WWhizInterface::ResolveFilename ( const CString & rootDir,
CString & filename ) [pure virtual]
 

Resolves the filename when it contains environment variables and relative paths.

Any filename can contain environment variables. This is especially true of DevStudio.

Filenames containing environment variables are of the form:

\CoolProject\Cool.dsw

Parameters:
rootDir   The root directory to be attached to the beginning of [filename] if [filename] is a relative path. If the root directory is empty, no string is prepended.
filename   The reference to the filename to be resolved. The resolved filename is stored back into this variable.

void WWhizInterface::SaveTags ( ) [pure virtual]
 

Saves the list of tags to the disk.

The tags are saved to the file Tags.WW in the directory specified by GetWorkspaceLocation().

void WWhizInterface::SetTagCallback ( TagRefreshCallback callback,
void * userData ) [pure virtual]
 

Before calling RefreshTagList(), a tag callback may be set through this function.

Parameters:
callback   The callback function.
userData   User-specified data.

void WWhizInterface::SetTagUseType ( WWhizTag::Type type,
bool use ) [pure virtual]
 

Sets the tag types considered for the MatchTag() routine.

By default, all tag types are on.

Parameters:
type   The tag type to turn on/off.
use   Set to true if the tag type should be considered for the search, false otherwise.

void WWhizInterface::SetWWhizReg ( WWhizReg * wwhizReg ) [pure virtual]
 

Sets a pointer to the Workspace Whiz! registration module.

Parameters:
wwhizReg   The pointer to the WWhizReg.mod.

void WWhizInterface::SetWorkspaceLocation ( void ) [pure virtual]
 

DevStudio provides no function to return the location of the workspace, so WWhizInterface provides this functionality.

SetWorkspaceLocation() obtains the workspace location through the WWhizInterfaceHelper.pkg file, installed via the WWhizInterfaceInstaller. If this is unavailable, then SetWorkspaceLocation() works by obtaining the current working directory when the workspace opens. This is best done by calling WWhizInterface's SetWorkspaceLocation() through the DevStudio automation function:

HRESULT CCommands::XApplicationEvents::WorkspaceOpen();

If the WWhizInterface facilities are being used without DevStudio's assistance, then set the current working directory to the directory containing the workspace and call SetWorkspaceLocation().

        _chdir("c:/Projects/MyProject");
        g_wwhizInterface->SetWorkspaceLocation();
        g_wwhizInterface->AddProject("c:/Projects/MyProject/MyProject.dsw");

Note: A call to SetWorkspaceLocation() is required, because Workspace Whiz! files, such as ExtraFiles.WW and Tags.WW, are stored in the directory returned via GetWorkspaceLocation().


The documentation for this class was generated from the following file:
Generated at Mon Jan 8 23:50:20 2001 for WWhizInterface by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000