Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

GUI/Widgets/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 =========================================================================*/
00022 #ifndef __vtkKWApplication_h
00023 #define __vtkKWApplication_h
00024 
00025 #include "vtkKWObject.h"
00026 
00027 #include "vtkTcl.h" // Needed for Tcl_Interp
00028 #include "vtkTk.h"  // Needed for Tk_Window
00029 
00030 class vtkKWLabel;
00031 class vtkKWMessageDialog;
00032 class vtkKWRegistryHelper;
00033 class vtkKWBalloonHelpManager;
00034 class vtkKWSplashScreen;
00035 class vtkKWWidget;
00036 class vtkKWWindowBase;
00037 class vtkKWText;
00038 class vtkKWTextWithScrollbars;
00039 class vtkKWApplicationInternals;
00040 class vtkKWLoadSaveDialog;
00041 
00042 class KWWIDGETS_EXPORT vtkKWApplication : public vtkKWObject
00043 {
00044 public:
00045   static vtkKWApplication* New();
00046   vtkTypeRevisionMacro(vtkKWApplication,vtkKWObject);
00047   void PrintSelf(ostream& os, vtkIndent indent);
00048   
00050 
00054   virtual vtkKWApplication *GetApplication()  { return this;  }
00055   virtual void SetApplication (vtkKWApplication*);
00057   
00059 
00060   virtual void Start();
00061   virtual void Start(int argc, char *argv[]);
00063 
00067   virtual int Exit();
00068 
00070 
00072   vtkSetMacro(PromptBeforeExit, int);
00073   vtkGetMacro(PromptBeforeExit, int);
00074   vtkBooleanMacro(PromptBeforeExit, int);
00076 
00078 
00080   vtkSetMacro(ExitStatus, int);
00081   vtkGetMacro(ExitStatus, int);
00083 
00085 
00087   vtkGetMacro(InExit, int);
00089 
00091 
00095   virtual int AddWindow(vtkKWWindowBase *w);
00096   virtual int RemoveWindow(vtkKWWindowBase *);
00098 
00100 
00101   virtual int GetNumberOfWindows();
00102   virtual vtkKWWindowBase* GetNthWindow(int rank);
00104 
00106 
00109   vtkSetStringMacro(Name);
00110   vtkGetStringMacro(Name);
00112 
00114 
00115   vtkSetMacro(MajorVersion, int);
00116   vtkGetMacro(MajorVersion, int);
00117   vtkSetMacro(MinorVersion, int);
00118   vtkGetMacro(MinorVersion, int);
00120 
00122 
00127   vtkSetStringMacro(VersionName);
00128   virtual const char* GetVersionName();
00130 
00132 
00135   vtkSetStringMacro(ReleaseName);
00136   vtkGetStringMacro(ReleaseName);
00138 
00143   virtual const char* GetPrettyName();
00144 
00145   // Descrition:
00146   // Set/Get if the application is running in limited edition mode.
00147   // This can be used throughout the whole UI to enable or disable
00148   // features on the fly. Make sure it is *not* wrapped !
00149   //BTX 
00150   virtual void SetLimitedEditionMode(int arg);
00151   vtkBooleanMacro(LimitedEditionMode, int);
00152   vtkGetMacro(LimitedEditionMode, int);
00153   //ETX
00154 
00155   // Descrition:
00156   // Convenience method that will return the limited edition mode and 
00157   // optionally warn the user ; if the limited edition mode is true, 
00158   // it will display a popup warning stating that 'feature' is not available
00159   // in this mode.
00160   virtual int GetLimitedEditionModeAndWarn(const char *feature);
00161 
00162   // Descrition:
00163   // Set/Get the name of the application when it runs in limited edition mode.
00164   // This is used by GetPrettyName() for example, instead of the Name variable.
00165   // If it has not been set, it will use the value of Name and append
00166   // the "Limited Edition" to it.
00167   vtkSetStringMacro(LimitedEditionModeName);
00168   virtual const char *GetLimitedEditionModeName();
00169 
00171 
00173   vtkGetStringMacro(InstallationDirectory);
00174   vtkSetStringMacro(InstallationDirectory);
00176   
00178 
00180   virtual char* GetUserDataDirectory();
00181   vtkSetStringMacro(UserDataDirectory);
00183   
00186   virtual int LoadScript(const char* filename);
00187 
00189 
00196   vtkSetClampMacro(ExitAfterLoadScript, int, 0, 1);
00197   vtkBooleanMacro(ExitAfterLoadScript, int);
00198   vtkGetMacro(ExitAfterLoadScript, int);
00200 
00202 
00203   vtkGetMacro(PrintTargetDPI, double);
00204   vtkSetMacro(PrintTargetDPI, double);
00206   
00208 
00209   vtkKWRegistryHelper *GetRegistryHelper();
00210   //ETX
00212 
00214 
00219   vtkSetClampMacro(RegistryLevel, int, -1, 10);
00220   vtkGetMacro(RegistryLevel, int);
00222 
00224 
00228   virtual int SetRegistryValue(
00229     int level, const char* subkey, const char* key, 
00230     const char* format, ...);
00231   //ETX
00232   virtual int GetRegistryValue(
00233     int level, const char* subkey, const char* key, char* value);
00234   virtual int DeleteRegistryValue(
00235     int level, const char* subkey, const char* key);
00236   virtual int HasRegistryValue(
00237     int level, const char* subkey, const char* key);
00239   
00241 
00246   virtual float GetFloatRegistryValue(
00247     int level, const char* subkey, const char* key);
00248   virtual int GetIntRegistryValue(
00249     int level, const char* subkey, const char* key);
00250   virtual int GetBooleanRegistryValue(
00251     int level, const char* subkey, const char* key, const char* trueval);
00253   
00255 
00258   virtual void SaveColorRegistryValue(
00259     int level, const char *key, double rgb[3]);
00260   virtual int RetrieveColorRegistryValue(
00261     int level, const char *key, double rgb[3]);
00263 
00265 
00267   virtual void SaveDialogLastPathRegistryValue(
00268     vtkKWLoadSaveDialog *dlg, const char *key);
00269   virtual void RetrieveDialogLastPathRegistryValue(
00270     vtkKWLoadSaveDialog *dlg, const char *key);
00272 
00273   // Descrition:
00274   // Save/Retrieve the application settings to/from registry.
00275   // Do not call that method before the application name is known and the
00276   // proper registry level set (if any).
00277   virtual void RestoreApplicationSettingsFromRegistry();
00278   virtual void SaveApplicationSettingsToRegistry();
00279 
00281 
00282   vtkSetMacro(SupportSplashScreen, int);
00283   vtkGetMacro(SupportSplashScreen, int);
00284   vtkBooleanMacro(SupportSplashScreen, int);
00286 
00288 
00289   vtkGetMacro(SplashScreenVisibility, int);
00290   vtkSetMacro(SplashScreenVisibility, int);
00291   vtkBooleanMacro(SplashScreenVisibility, int);
00293 
00297   virtual vtkKWSplashScreen* GetSplashScreen();
00298 
00300 
00304   vtkGetMacro(SaveUserInterfaceGeometry, int);
00305   vtkSetMacro(SaveUserInterfaceGeometry, int);
00306   vtkBooleanMacro(SaveUserInterfaceGeometry, int);
00308 
00310 
00311   virtual void SetCharacterEncoding(int val);
00312   vtkGetMacro(CharacterEncoding, int);
00314   
00316 
00318   virtual int HasCheckForUpdates();
00319   virtual void CheckForUpdates();
00321 
00323 
00325   virtual int CanEmailFeedback();
00326   virtual void EmailFeedback();
00327   vtkSetStringMacro(EmailFeedbackAddress);
00328   vtkGetStringMacro(EmailFeedbackAddress);
00330 
00333   virtual void DisplayHelpDialog(vtkKWWindowBase *master);
00334 
00336 
00338   vtkGetStringMacro(HelpDialogStartingPage);
00339   vtkSetStringMacro(HelpDialogStartingPage);
00341 
00344   virtual void DisplayAboutDialog(vtkKWWindowBase *master);
00345 
00347   vtkKWBalloonHelpManager *GetBalloonHelpManager();
00348 
00350 
00352   virtual const char* Script(const char* format, ...);
00353   int EvaluateBooleanExpression(const char* format, ...);
00354   //ETX
00356   
00358   Tcl_Interp *GetMainInterp() {return this->MainInterp;};
00359 
00361 
00366   static Tcl_Interp *InitializeTcl(int argc, char *argv[], ostream *err = 0);
00367   static Tcl_Interp *InitializeTcl(Tcl_Interp *interp, ostream *err = 0);
00368   //ETX
00370 
00372 
00386   virtual void RegisterDialogUp(vtkKWWidget *ptr);
00387   virtual void UnRegisterDialogUp(vtkKWWidget *ptr);
00388   virtual int IsDialogUp();
00390   
00393   static int OpenLink(const char *link);
00394 
00396 
00397   static const char *ExitDialogName;
00398   static const char *BalloonHelpVisibilityRegKey;
00399   static const char *SaveUserInterfaceGeometryRegKey;
00400   static const char *SplashScreenVisibilityRegKey;
00401   static const char *PrintTargetDPIRegKey;
00402   //ETX
00404 
00405 protected:
00406   vtkKWApplication();
00407   ~vtkKWApplication();
00408 
00409   Tk_Window MainWindow;
00410   Tcl_Interp *MainInterp;
00411 
00414   virtual void DoOneTclEvent();
00415 
00417 
00418   char *Name;
00419   char *VersionName;
00420   char *ReleaseName;
00421   int MajorVersion;
00422   int MinorVersion;
00423   char *PrettyName;
00424   vtkSetStringMacro(PrettyName);
00426 
00428 
00429   char *InstallationDirectory;
00430   virtual void FindInstallationDirectory();
00432 
00434   char *UserDataDirectory;
00435 
00437 
00440   virtual void AddEmailFeedbackBody(ostream &);
00441   virtual void AddEmailFeedbackSubject(ostream &);
00442   char *EmailFeedbackAddress;
00444 
00446   char *HelpDialogStartingPage;
00447 
00451   virtual int DisplayExitDialog(vtkKWWindowBase *master);
00452 
00454 
00456   int ExitStatus;
00457   int InExit;
00458   int ExitAfterLoadScript;
00459   int PromptBeforeExit;
00461 
00463   int DialogUp;
00464 
00466 
00468   int LimitedEditionMode;
00469   char *LimitedEditionModeName;
00471 
00474   int RegistryLevel;
00475 
00477 
00478   int SupportSplashScreen;
00479   int SplashScreenVisibility;
00480   virtual void CreateSplashScreen() {};
00482 
00484   int SaveUserInterfaceGeometry;
00485 
00487 
00490   virtual void ConfigureAboutDialog();
00491   virtual void AddAboutText(ostream &);
00492   virtual void AddAboutCopyrights(ostream &);
00493   vtkKWMessageDialog *AboutDialog;
00494   vtkKWLabel         *AboutDialogImage;
00495   vtkKWTextWithScrollbars *AboutRuntimeInfo;
00497 
00499   int CharacterEncoding;
00500 
00502   double PrintTargetDPI;
00503 
00505 
00508   static int CheckForArgument(
00509     int argc, char* argv[], const char *arg, int &index);
00511 
00513 
00517   static int CheckForValuedArgument(
00518     int argc, char* argv[], const char *arg, int &index, int &value_pos);
00520 
00524   virtual int GetCheckForUpdatesPath(ostream &path);
00525 
00528   virtual void PrepareForDelete();
00529 
00530   // PIMPL Encapsulation for STL containers
00531 
00532   vtkKWApplicationInternals *Internals;
00533 
00534 private:
00535 
00536   vtkKWRegistryHelper *RegistryHelper;
00537   vtkKWSplashScreen *SplashScreen;
00538   vtkKWBalloonHelpManager *BalloonHelpManager;
00539 
00540   vtkKWApplication(const vtkKWApplication&);   // Not implemented.
00541   void operator=(const vtkKWApplication&);  // Not implemented.
00542 };
00543 
00544 #endif

Generated on Tue May 30 12:31:42 2006 for ParaView by doxygen 1.3.5