KWWidgets
debian/tmp/usr/include/KWWidgets/vtkKWApplication.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Module:    $RCSfile: vtkKWApplication.h,v $
00004 
00005   Copyright (c) Kitware, Inc.
00006   All rights reserved.
00007   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE.  See the above copyright notice for more information.
00012 
00013 =========================================================================*/
00014 // .NAME vtkKWApplication - an application class
00015 // .SECTION Description
00016 // vtkKWApplication is the overall class that represents the entire 
00017 // application. It is also responsible for managing the vtkKWWindowBase(s) 
00018 // associated to the application.
00019 
00020 #ifndef __vtkKWApplication_h
00021 #define __vtkKWApplication_h
00022 
00023 #include "vtkKWObject.h"
00024 
00025 #include "vtkTcl.h" // Needed for Tcl_Interp
00026 #include "vtkTk.h"  // Needed for Tk_Window
00027 
00028 class vtkKWApplicationInternals;
00029 class vtkKWBalloonHelpManager;
00030 class vtkKWColorPickerDialog;
00031 class vtkKWLabel;
00032 class vtkKWLogDialog;
00033 class vtkKWMessageDialog;
00034 class vtkKWOptionDataBase;
00035 class vtkKWRegistryHelper;
00036 class vtkKWSplashScreen;
00037 class vtkKWTclInteractor;
00038 class vtkKWTextWithScrollbars;
00039 class vtkKWTheme;
00040 class vtkKWTopLevel;
00041 class vtkKWWidget;
00042 class vtkKWWindowBase;
00043 
00044 class KWWidgets_EXPORT vtkKWApplication : public vtkKWObject
00045 {
00046 public:
00047   static vtkKWApplication* New();
00048   vtkTypeRevisionMacro(vtkKWApplication,vtkKWObject);
00049   void PrintSelf(ostream& os, vtkIndent indent);
00050   
00051   // Description:
00052   // Override vtkKWObject's method. A vtkKWObject is associated to a
00053   // vtkKWApplication. Even if vtkKWApplication is a subclass of 
00054   // vtkKWObject, an application's application is actually 'itself', 
00055   // and it can not be reset.
00056   virtual vtkKWApplication *GetApplication()  { return this;  }
00057   virtual void SetApplication (vtkKWApplication*);
00058   
00059   // Description:
00060   // Start running the application, with or without arguments, and enter the
00061   // event loop. The application will exit the event loop once every 
00062   // windows has been closed.
00063   // As a convenience, if one (or more) window has been added to the 
00064   // application (using AddWindow()), and none of them has been mapped
00065   // on the screen yet, the application will automatically display the first
00066   // window by calling its Display() method.
00067   virtual void Start();
00068   virtual void Start(int argc, char *argv[]);
00069 
00070   // Description:
00071   // This method is invoked when the user exits the app
00072   // Return 1 if the app exited successfully, 0 otherwise (for example,
00073   // if some dialogs are still up, or the user did not confirm, etc).
00074   virtual int Exit();
00075 
00076   // Description:
00077   // Set/Get if a confirmation dialog should be displayed before the
00078   // application exits.
00079   vtkSetMacro(PromptBeforeExit, int);
00080   vtkGetMacro(PromptBeforeExit, int);
00081   vtkBooleanMacro(PromptBeforeExit, int);
00082 
00083   // Description:
00084   // Set/Get the value returned by the application at exit.
00085   // This can be used from scripts to set an error status
00086   vtkSetMacro(ExitStatus, int);
00087   vtkGetMacro(ExitStatus, int);
00088 
00089   // Description:
00090   // Get when application is exiting (set to 1 as soon as Exit() is called).
00091   vtkGetMacro(InExit, int);
00092 
00093   // Description:
00094   // Set/Get if the error log should be sent.emailed before application exits.
00095   vtkSetMacro(SendErrorLogBeforeExit, int);
00096   vtkGetMacro(SendErrorLogBeforeExit, int);
00097   vtkBooleanMacro(SendErrorLogBeforeExit, int);
00098 
00099   // Description:
00100   // Add, remove (i.e. close), or retrieve a window to/from this application.
00101   // Note that AddWindow() will increase the reference count of the window
00102   // that is added, RemoveWindow() will decrease it. Once the last window is
00103   // closed, Exit() is called.
00104   // Return 1 if successful, 0 otherwise
00105   virtual int AddWindow(vtkKWWindowBase *w);
00106   virtual int RemoveWindow(vtkKWWindowBase *);
00107   virtual vtkKWWindowBase* GetNthWindow(int rank);
00108 
00109   // Description:
00110   // Get the number of windows, the number of windows mapped on screen.
00111   virtual int GetNumberOfWindows();
00112   virtual int GetNumberOfWindowsMapped();
00113 
00114   // Description:
00115   // Set/Get the application name.
00116   // Also check the LimitedEditionModeName variable if you plan on running
00117   // the application in limited edition mode.
00118   vtkSetStringMacro(Name);
00119   vtkGetStringMacro(Name);
00120 
00121   // Description:
00122   // Get the major and minor application version.
00123   vtkSetMacro(MajorVersion, int);
00124   vtkGetMacro(MajorVersion, int);
00125   vtkSetMacro(MinorVersion, int);
00126   vtkGetMacro(MinorVersion, int);
00127 
00128   // Description:
00129   // Set/Get the application version name - this usually is the application 
00130   // name postfixed with the version number (major/minor).
00131   // If it has not been set, it will use the value of Name and append
00132   // the major/minor version.
00133   vtkSetStringMacro(VersionName);
00134   virtual const char* GetVersionName();
00135 
00136   // Description:
00137   // Set/Get the application release name - this is the release of the 
00138   // application version (if any), typically: beta1, beta2, final, patch1, etc.
00139   vtkSetStringMacro(ReleaseName);
00140   vtkGetStringMacro(ReleaseName);
00141 
00142   // Description:
00143   // Get the "pretty" name of the application. 
00144   // This is typically used for windows or dialogs title, About boxes, etc. 
00145   // It combines the application name, its version, and other relevant
00146   // informations (like its limited edition mode).
00147   virtual const char* GetPrettyName();
00148 
00149   // Description:
00150   // Get the most recent version this application was ever launched, if known.
00151   // Each time this application is closed, its version is automatically saved
00152   // to the registry (provided that this version is the most recent).
00153   // Use this method to retrieve which most recent version was ever launched
00154   // by your user. This can be used by newer application to detect if some
00155   // migration is needed to upgrade from an older version.
00156   // Returns 0 if no most recent version was ever recorded, or if it can not
00157   // be parsed.
00158   virtual int GetMostRecentVersionLaunched(int *major, int *minor);
00159 
00160   // Descrition:
00161   // Set/Get if the application is running in limited edition mode.
00162   // This can be used throughout the whole UI to enable or disable
00163   // features on the fly. Make sure it is *not* wrapped !
00164   //BTX 
00165   virtual void SetLimitedEditionMode(int arg);
00166   vtkBooleanMacro(LimitedEditionMode, int);
00167   vtkGetMacro(LimitedEditionMode, int);
00168   //ETX
00169 
00170   // Descrition:
00171   // Return the limited edition mode and optionally warn the user ; 
00172   // if the limited edition mode is true, display a popup warning stating
00173   // that 'feature' is not available in this mode.
00174   virtual int GetLimitedEditionModeAndWarn(const char *feature);
00175 
00176   // Descrition:
00177   // Set/Get the name of the application when it runs in limited edition mode.
00178   // This is used by GetPrettyName() for example, instead of the Name variable.
00179   // If it has not been set, it will use the value of Name and append
00180   // the "Limited Edition" to it.
00181   vtkSetStringMacro(LimitedEditionModeName);
00182   virtual const char *GetLimitedEditionModeName();
00183 
00184   // Descrition:
00185   // Set/Get if the application is running in release/production mode.
00186   // This should be set as soon as possible, before creating any UI.
00187   // The release mode (as opposed to debug/development mode) can be used
00188   // to prevent the output window from showing up, to disable the support of
00189   // specific file formats that should only be used during development, to
00190   // remove the Tcl Command Prompt, etc.
00191   //BTX 
00192   virtual void SetReleaseMode(int);
00193   vtkBooleanMacro(ReleaseMode, int);
00194   vtkGetMacro(ReleaseMode, int);
00195   //ETX
00196 
00197   // Description:
00198   // Set/Get the directory in which the application is supposed
00199   // to be installed. 
00200   virtual const char *GetInstallationDirectory();
00201   vtkSetStringMacro(InstallationDirectory);
00202   
00203   // Description:
00204   // Set/Get the directory in which the application can store
00205   // user data. 
00206   // On Windows, this is usually: 
00207   //  C:\Documents and Settings<username>\My Documents\NameOfTheApplication
00208   // On Unix/MacOSX, this is usually:
00209   //  $HOME/.NameOfTheApplication (ex: /users/barre/.VolView)
00210   virtual const char* GetUserDataDirectory();
00211   vtkSetStringMacro(UserDataDirectory);
00212   
00213   // Description:
00214   // Load and evaluate a Tcl script from a file. 
00215   // Return 1 if successful, 0 otherwise
00216   virtual int LoadScript(const char* filename);
00217 
00218   // Description:
00219   // Run an AppleScript provided as a string (don't forget to escape the
00220   // quotes). Only on Apple platforms.
00221   // Return 1 if successful, 0 otherwise
00222 #ifdef __APPLE__
00223   //BTX
00224   static int RunAppleScript(const char *text);
00225   //ETX
00226 #endif
00227 
00228   // Description:
00229   // Set/Get the "exit after load script" flag. If this flag is set, then 
00230   // the application will automatically Exit() after a call to LoadScript(). 
00231   // This is mainly used for testing purposes. Even though a Tcl script
00232   // can end with an explicit call to Exit on the application Tcl object,
00233   // this call may never be reached it the script contains an error. Setting
00234   // this variable will make sure the application will exit anyway.
00235   vtkSetClampMacro(ExitAfterLoadScript, int, 0, 1);
00236   vtkBooleanMacro(ExitAfterLoadScript, int);
00237   vtkGetMacro(ExitAfterLoadScript, int);
00238 
00239   // Description:
00240   // Set/Get the print quality.
00241   vtkGetMacro(PrintTargetDPI, double);
00242   vtkSetMacro(PrintTargetDPI, double);
00243   
00244   // Description:
00245   // Get the Registry object.
00246   //BTX
00247   vtkKWRegistryHelper *GetRegistryHelper();
00248   //ETX
00249 
00250   // Description:
00251   // Set/Get the registry application version name - this usually is the
00252   // application name postfixed with the *major* version number. The minor
00253   // version is not used so that application settings are maintained
00254   // between minor version changes.
00255   // It is typically used as the master key to store registry settings
00256   // (ex: VolView 3, ParaView1, etc.)
00257   vtkSetStringMacro(RegistryVersionName);
00258   virtual const char* GetRegistryVersionName();
00259 
00260   // Description:
00261   // Set/Get the current registry level. 
00262   // When setting/retrieving a value in/from the registry a 'level' has
00263   // to be provided as part of the parameters. If this level is greater
00264   // than the current registry level, the operation will be ignored.
00265   // Set the registry level to -1 means to ignore all the registry operations.
00266   vtkSetClampMacro(RegistryLevel, int, -1, 10);
00267   vtkGetMacro(RegistryLevel, int);
00268 
00269   // Description:
00270   // Set/Get/Delete/Query a registry value for the application.
00271   // When storing multiple arguments, separate them with spaces.
00272   // Note that if the 'level' is greater than the current registry level, 
00273   // the operation will be ignored.
00274   //BTX
00275   virtual int SetRegistryValue(
00276     int level, const char* subkey, const char* key, 
00277     const char* format, ...);
00278   //ETX
00279   virtual int GetRegistryValue(
00280     int level, const char* subkey, const char* key, char* value);
00281   virtual int DeleteRegistryValue(
00282     int level, const char* subkey, const char* key);
00283   virtual int HasRegistryValue(
00284     int level, const char* subkey, const char* key);
00285   
00286   // Description:
00287   // Retrieve a value from the registry and convert it to a type
00288   // (boolean, float, int). 
00289   // Return 0 if the value was not found.
00290   // For GetBooleanRegistryValue(), perform a boolean check of the value in
00291   // the registry. If the value at the key is equal to 'trueval', then return
00292   // true, otherwise return false.
00293   virtual float GetFloatRegistryValue(
00294     int level, const char* subkey, const char* key);
00295   virtual int GetIntRegistryValue(
00296     int level, const char* subkey, const char* key);
00297   virtual int GetBooleanRegistryValue(
00298     int level, const char* subkey, const char* key, const char* trueval);
00299   
00300   // Description:
00301   // Save/retrieve color to/from the registry. 
00302   // If the color does not exist, it will retrieve -1, -1 ,-1 and return 0
00303   // (1 if success).
00304   // Note that the subkey used here is "Colors".
00305   virtual void SaveColorRegistryValue(
00306     int level, const char *key, double rgb[3]);
00307   virtual int RetrieveColorRegistryValue(
00308     int level, const char *key, double rgb[3]);
00309 
00310   // Descrition:
00311   // Save/Retrieve the application settings to/from registry.
00312   // Do not call that method before the application name is known and the
00313   // proper registry level set (if any).
00314   virtual void RestoreApplicationSettingsFromRegistry();
00315   virtual void SaveApplicationSettingsToRegistry();
00316 
00317   // Description:
00318   // Get the database option object.
00319   //BTX
00320   vtkKWOptionDataBase *GetOptionDataBase();
00321   //ETX
00322 
00323   // Description:
00324   // Set/Get if this application supports a splash screen
00325   vtkSetMacro(SupportSplashScreen, int);
00326   vtkGetMacro(SupportSplashScreen, int);
00327   vtkBooleanMacro(SupportSplashScreen, int);
00328 
00329   // Description:
00330   // Set/Get if this application should show the splash screen at startup
00331   vtkGetMacro(SplashScreenVisibility, int);
00332   vtkSetMacro(SplashScreenVisibility, int);
00333   vtkBooleanMacro(SplashScreenVisibility, int);
00334 
00335   // Description:
00336   // Retrieve the splash screen object
00337   // This will also create the splash screen widget itself.
00338   virtual vtkKWSplashScreen* GetSplashScreen();
00339 
00340   // Description:
00341   // Set/Get if the user interface geometry should be saved (to the registry,
00342   // for example).
00343   // This is more like a hint that many widgets can query to check if
00344   // they should save their own geometry (and restore it on startup). 
00345   vtkGetMacro(SaveUserInterfaceGeometry, int);
00346   vtkSetMacro(SaveUserInterfaceGeometry, int);
00347   vtkBooleanMacro(SaveUserInterfaceGeometry, int);
00348 
00349   // Description:
00350   // Get/Set the internal character encoding of the application.
00351   virtual void SetCharacterEncoding(int val);
00352   vtkGetMacro(CharacterEncoding, int);
00353   
00354   // Description:
00355   // Get if we have some logic to check for application update online and
00356   // perform that check.
00357   virtual int HasCheckForUpdates();
00358   virtual void CheckForUpdates();
00359 
00360   // Description:
00361   // Get/Set the current theme. This will install the theme automatically.
00362   virtual void SetTheme(vtkKWTheme *theme);
00363   vtkGetObjectMacro(Theme, vtkKWTheme);
00364   
00365   // Description:
00366   // Get if we have some logic to report feedback by email and
00367   // email that feedback.
00368   // Set/Get the email address to send that feedback to.
00369   virtual int CanEmailFeedback();
00370   virtual void EmailFeedback();
00371   vtkSetStringMacro(EmailFeedbackAddress);
00372   vtkGetStringMacro(EmailFeedbackAddress);
00373 
00374   // Description:
00375   // Send email (win32 only for the moment, use MAPI).
00376   virtual int SendEmail(
00377     const char *to,
00378     const char *subject,
00379     const char *message,
00380     const char *attachment_filename,
00381     const char *extra_error_msg = NULL);
00382 
00383   // Description:
00384   // Add email feedback body and subject to output stream.
00385   // Override this function in subclasses (and/or call the superclass) to
00386   // add more information.
00387   virtual void AddEmailFeedbackBody(ostream &);
00388   virtual void AddEmailFeedbackSubject(ostream &);
00389 
00390   // Description:
00391   // Display the on-line help for this application.
00392   // Optionally provide a master window this dialog should be the slave of.
00393   virtual void DisplayHelpDialog(vtkKWTopLevel *master);
00394 
00395   // Description:
00396   // Set/Get the help starting page.
00397   // If set to a CHM/HTML page, it will be opened automatically on Windows.
00398   vtkGetStringMacro(HelpDialogStartingPage);
00399   vtkSetStringMacro(HelpDialogStartingPage);
00400 
00401   // Description:
00402   // Display the on-line tutorial for this application.
00403   // Optionally provide a master window this dialog should be the slave of.
00404   virtual void DisplayTutorial(vtkKWTopLevel *master);
00405 
00406   // Description:
00407   // Set/Get the tutorial starting page.
00408   // If set to a CHM/HTML page, it will be opened automatically on Windows.
00409   vtkGetStringMacro(TutorialStartingPage);
00410   vtkSetStringMacro(TutorialStartingPage);
00411 
00412   // Description:
00413   // Display the about dialog for this application.
00414   // Optionally provide a master window this dialog should be the slave of.
00415   virtual void DisplayAboutDialog(vtkKWTopLevel *master);
00416 
00417   // Description:
00418   // Return the Balloon Help helper object. 
00419   virtual vtkKWBalloonHelpManager *GetBalloonHelpManager();
00420 
00421   // Description:
00422   // Return the appplication-wide color picker dialog. Redefine this method
00423   // in your application sub-class to provide a customized color picker.
00424   virtual vtkKWColorPickerDialog *GetColorPickerDialog();
00425 
00426   // Description:
00427   // Evaluate Tcl script/code and perform argument substitutions.
00428   //BTX
00429   virtual const char* Script(const char* format, ...);
00430   int EvaluateBooleanExpression(const char* format, ...);
00431   //ETX
00432   
00433   // Description:
00434   // Get the interpreter being used by this application
00435   static Tcl_Interp *GetMainInterp();
00436 
00437   // Description:
00438   // Initialize Tcl/Tk
00439   // Return NULL on error (eventually provides an ostream where detailed
00440   // error messages will be stored).
00441   // One method takes argc/argv and will create an internal Tcl interpreter
00442   // on the fly, the other takes a Tcl interpreter and uses it afterward
00443   // (this is mainly intended for initialization as a Tcl package)
00444   //BTX
00445   static Tcl_Interp *InitializeTcl(int argc, char *argv[], ostream *err = 0);
00446   static Tcl_Interp *InitializeTcl(Tcl_Interp *interp, ostream *err = 0);
00447   //ETX
00448 
00449   // Description:
00450   // Call RegisterDialogUp to notify the application that a modal dialog is up,
00451   // and UnRegisterDialogUp when it is not anymore. IsDialogUp will return
00452   // if any dialog is up. 
00453   // The parameter to pass is a pointer to the dialog/toplevel/widget that is
00454   // being registered/unregistered. If there is no such widget (say, if you
00455   // are calling a builtin Tk function that creates and pops-up a dialog), pass
00456   // the adress of the class that is invoking that call.
00457   // This is used to help preventing a window or an
00458   // application to exit while a dialog is still up. This is usually not
00459   // a problem on Win32, since a modal dialog will prevent the user from
00460   // interacting with the window and exit it, but this is not the case for
00461   // other operating system where the window manager is independent from the
00462   // window contents itself. In any case, inheriting from a vtkKWTopLevel
00463   // or vtkKWDialog should take care of calling this function for you.
00464   virtual void RegisterDialogUp(vtkKWWidget *ptr);
00465   virtual void UnRegisterDialogUp(vtkKWWidget *ptr);
00466   virtual int IsDialogUp();
00467   
00468   // Description:
00469   // Open a link (media).
00470   // On Win32, use ShellExecute to trigger the default viewers.
00471   int OpenLink(const char *link);
00472 
00473   // Description:
00474   // Explore link.
00475   // On Win32, this will launch the Explorer, open it in the directory
00476   // of the link, and eventually select that link itself in the directory.
00477   int ExploreLink(const char *link);
00478 
00479   // Description:
00480   // Process/update pending events. This method brings the 
00481   // application "up to date" by entering the event loop repeatedly until
00482   // all pending events (including idle callbacks) have been processed. 
00483   virtual void ProcessPendingEvents();
00484 
00485   // Description:
00486   // Process/update idle tasks. This causes operations that are normally 
00487   // deferred, such as display updates and window layout calculations, to be
00488   // performed immediately. 
00489   virtual void ProcessIdleTasks();
00490 
00491   // Description:
00492   // Install the Tcl background error callback. Individual applications
00493   // can define a background error command if they wish to handle background
00494   // errors. A background error is one that occurs in an event handler or
00495   // some other command that didn't originate with the application. For
00496   // example, if an error occurs while executing a command specified with
00497   // asynchronously. The default implementation is to feed the Tcl error
00498   // message to a vtkErrorMacro.
00499   virtual void InstallTclBgErrorCallback();
00500 
00501   // Description:
00502   // Popup a warning/error/information/debug message.
00503   virtual void WarningMessage(const char* message);
00504   virtual void ErrorMessage(const char* message);
00505   virtual void DebugMessage(const char* message);
00506   virtual void InformationMessage(const char* message);
00507 
00508   // Description:
00509   // Display the warning/error/information/debug message log dialog.
00510   // Optionally provide a master window this dialog should be the slave of.
00511   virtual void DisplayLogDialog(vtkKWTopLevel *master);
00512   virtual vtkKWLogDialog* GetLogDialog();
00513 
00514   // Description:
00515   // Get/display the tcl interactor.
00516   // Optionally provide a master window this dialog should be the slave of.
00517   virtual void DisplayTclInteractor(vtkKWTopLevel *master);
00518   virtual vtkKWTclInteractor* GetTclInteractor();
00519 
00520   // Description:
00521   // Add system information to a stream.
00522   // Will be used to report system info in the About dialog, or the Feedback
00523   // email...
00524   virtual void AddSystemInformation(ostream &);
00525   
00526   // Description:
00527   // Some constants
00528   //BTX
00529   static const char *ExitDialogName;
00530   static const char *SendErrorLogDialogName;
00531   static const char *BalloonHelpVisibilityRegKey;
00532   static const char *SaveUserInterfaceGeometryRegKey;
00533   static const char *SplashScreenVisibilityRegKey;
00534   static const char *PrintTargetDPIRegKey;
00535   static const char *MostRecentVersionLaunchedRegKey;
00536   //ETX
00537 
00538   // Description:
00539   // Callbacks. Internal, do not use.
00540   virtual void TclBgErrorCallback(const char* message);
00541 
00542   // Description:
00543   // Put a string into the environment of the form var=value
00544   static int PutEnv(const char* value);
00545 
00546 protected:
00547   vtkKWApplication();
00548   ~vtkKWApplication();
00549 
00550   // Description:
00551   // Do one tcl event and enter the event loop, allowing the application
00552   // interface to actually run.
00553   virtual void DoOneTclEvent();
00554 
00555   // Description:
00556   // User data directory
00557   char *UserDataDirectory;
00558 
00559   char *EmailFeedbackAddress;
00560 
00561   // Description:
00562   // Create email message dialog (in case of error).
00563   virtual void CreateEmailMessageDialog(
00564     vtkKWMessageDialog *dlg,
00565     const char *to,
00566     const char *subject,
00567     const char *message,
00568     const char *attachment_filename);
00569 
00570   // Description:
00571   // Help starting page
00572   char *HelpDialogStartingPage;
00573 
00574   // Description:
00575   // Tutorial starting page
00576   char *TutorialStartingPage;
00577 
00578   // Description:
00579   // Display an on-line help page.
00580   // Used by DisplayHelpDialog() and DisplayTutorial()
00581   // Optionally provide a master window this dialog should be the slave of.
00582   virtual void DisplayHelpPage(const char *page, vtkKWTopLevel *master);
00583 
00584   // Description:
00585   // Display the exit dialog.
00586   // Optionally provide a master window this dialog should be the slave of.
00587   // Return 1 if the user wants to exit, 0 otherwise
00588   virtual int DisplayExitDialog(vtkKWTopLevel *master);
00589 
00590   // Description:
00591   // Value that is set after exit (status), flag stating that 
00592   // Exit was called, flag stating if application should exit after load script
00593   int ExitStatus;
00594   int InExit;
00595   int ExitAfterLoadScript;
00596   int PromptBeforeExit;
00597   int SendErrorLogBeforeExit;
00598 
00599   // Description:
00600   // Send the error log (prompt first).
00601   virtual int SendErrorLog();
00602 
00603   // Description:
00604   // Number of dialog that are up. See Un/RegisterDialogUp().
00605   int DialogUp;
00606 
00607   // Description:
00608   // Registry level. If a call to Set/GetRegistryValue uses a level above
00609   // this ivar, the operation is ignored.
00610   int RegistryLevel;
00611 
00612   // Description:
00613   // Flag stating if application supports splash screen, and shows it
00614   int SupportSplashScreen;
00615   int SplashScreenVisibility;
00616   virtual void CreateSplashScreen() {};
00617 
00618   // Description:
00619   // Flag stating if the UI geometry should be saved before exiting
00620   int SaveUserInterfaceGeometry;
00621 
00622   // Description:
00623   // About dialog, add text and copyrights to the about dialog.
00624   // Override this function in subclasses (and/or call the superclass) to
00625   // add more information.
00626   virtual void ConfigureAboutDialog();
00627   virtual void AddAboutText(ostream &);
00628   virtual void AddAboutCopyrights(ostream &);
00629   vtkKWMessageDialog *AboutDialog;
00630   vtkKWLabel         *AboutDialogImage;
00631   vtkKWTextWithScrollbars *AboutRuntimeInfo;
00632 
00633   // Description:
00634   // Character encoding (is passed to Tcl)
00635   int CharacterEncoding;
00636 
00637   // Description:
00638   // Print DPI
00639   double PrintTargetDPI;
00640 
00641   // Description:
00642   // Current theme
00643   vtkKWTheme *Theme;
00644 
00645   // Description:
00646   // Give a change to the application to parse the command-line arguments
00647   // and set some variables accordingly. Subclasses that do not intend
00648   // to call their super's Start(argc, argv) should make sure they
00649   // call their super's ParseCommandLineArguments.
00650   virtual void ParseCommandLineArguments(int argc, char *argv[]);
00651 
00652   // Description:
00653   // Check for an argument (example: --foo, /C, -bar, etc).
00654   // Return VTK_OK if found and set 'index' to the position of the 
00655   // argument in argv[].
00656   // Return VTK_ERROR if not found.
00657   static int CheckForArgument(
00658     int argc, char* argv[], const char *arg, int &index);
00659 
00660   // Description:
00661   // Check for a valued argument (example: --foo=bar, /C=bar, -bar=foo, etc).
00662   // Return VTK_OK if found and set 'index' to the position of the 
00663   // argument in argv[], 'value_pos' to the position right after the '='
00664   // in that argument.
00665   // Return VTK_ERROR if not found.
00666   static int CheckForValuedArgument(
00667     int argc, char* argv[], const char *arg, int &index, int &value_pos);
00668 
00669   // Description:
00670   // Try to find the path to the online updater (for example, WiseUpdt.exe)
00671   // and output that path to the ostream passed as parameter.
00672   virtual int GetCheckForUpdatesPath(ostream &path);
00673 
00674   // Description:
00675   // Deallocate/delete/reparent some internal objects in order to solve
00676   // reference loops that would prevent this instance from being deleted.
00677   virtual void PrepareForDelete();
00678 
00679   // PIMPL Encapsulation for STL containers
00680 
00681   vtkKWApplicationInternals *Internals;
00682 
00683   // Description:
00684   // Initialize VTK's Tcl packages
00685   // Return NULL on error (eventually provides an ostream where detailed
00686   // error messages will be stored).
00687   //BTX
00688   static Tcl_Interp *InitializeVTK(Tcl_Interp *interp, ostream *err = 0);
00689   //ETX
00690 
00691   // Description:
00692   // Log dialog
00693   vtkKWLogDialog *LogDialog;
00694   virtual int CreateLogDialog();
00695 
00696   // Description:
00697   // Install/restore output window
00698   virtual void InstallOutputWindow();
00699   virtual void RestoreOutputWindow();
00700 
00701   // Description:
00702   // Tcl interactor.
00703   vtkKWTclInteractor *TclInteractor;
00704 
00705   // Description:
00706   // Color picker dialog
00707   vtkKWColorPickerDialog *ColorPickerDialog;
00708 
00709 private:
00710 
00711   vtkKWRegistryHelper *RegistryHelper;
00712   vtkKWOptionDataBase *OptionDataBase;
00713   vtkKWSplashScreen *SplashScreen;
00714   vtkKWBalloonHelpManager *BalloonHelpManager;
00715 
00716   // Description:
00717   // Application name and version
00718   char *Name;
00719   char *VersionName;
00720   char *ReleaseName;
00721   int MajorVersion;
00722   int MinorVersion;
00723   char *PrettyName;
00724   vtkSetStringMacro(PrettyName);
00725   char *RegistryVersionName;
00726 
00727   // Description:
00728   // Limited edition mode, name of the application when in limited edition mode
00729   int LimitedEditionMode;
00730   char *LimitedEditionModeName;
00731 
00732   // Description:
00733   // Release mode
00734   int ReleaseMode;
00735 
00736   // Description:
00737   // Application installation directory
00738   char *InstallationDirectory;
00739   virtual void FindInstallationDirectory();
00740 
00741   vtkKWApplication(const vtkKWApplication&);   // Not implemented.
00742   void operator=(const vtkKWApplication&);  // Not implemented.
00743 };
00744 
00745 #endif