home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iapp.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  4.5 KB  |  154 lines

  1. #ifndef _IAPP_
  2. #define _IAPP_
  3. /*******************************************************************************
  4. * FILE NAME: iapp.hpp                                                          *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     IApplication                                                             *
  9. *     ICurrentApplication                                                      *
  10. *                                                                              *
  11. * COPYRIGHT:                                                                   *
  12. *   IBM Open Class Library                                                     *
  13. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  14. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  15. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  16. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  17. *                                                                              *
  18. *******************************************************************************/
  19. #include <ivbase.hpp>
  20. #include <ihandle.hpp>
  21.  
  22. struct pib_s;
  23. class IResourceLibrary;
  24. class IString;
  25. class ICurrentApplication;
  26. class ICurrentApplicationData;
  27.  
  28. #pragma pack(4)
  29.  
  30.  
  31. class IApplication : public IVBase {
  32. typedef IVBase
  33.   Inherited;
  34. public:
  35. /*-------------------------------- Diagnostics -------------------------------*/
  36. virtual IString
  37.   asString    ( ) const,
  38.   asDebugInfo ( ) const;
  39.  
  40. /*---------------------------- Process Information ---------------------------*/
  41. static IProcessId
  42.   currentPID  ( );
  43.  
  44. virtual IProcessId
  45.   id          ( ) const;
  46.  
  47. static ICurrentApplication
  48.  ¤t     ( );
  49.  
  50. /*--------------------------------- Priority ---------------------------------*/
  51. enum PriorityClass {
  52.   noChange,
  53.   idleTime,
  54.   regular,
  55.   timeCritical,
  56.   foregroundServer
  57. };
  58.  
  59. virtual IApplication
  60. #ifndef IC_WIN_FLAGNOP
  61.  &adjustPriority ( long          adjustment,
  62.                    Boolean       setDescendents = false ),
  63. #endif
  64.  &setPriority    ( PriorityClass priorityClass,
  65.                    long          priorityLevel = 0,
  66.                    Boolean       setDescendents = false );
  67.  
  68. protected:
  69. /*------------------------------- Constructors -------------------------------*/
  70.   IApplication ( const IProcessId& id );
  71. virtual
  72.  ~IApplication ( );
  73.  
  74. /*------------------------ Setting Process Information -----------------------*/
  75. virtual IApplication
  76.   &setId ( const IProcessId& id );
  77.  
  78. private:
  79. /*------------------------------- Private ------------------------------------*/
  80. static ICurrentApplication
  81.  *pCurrent;
  82. IProcessId
  83.   pid;
  84. }; // IApplication
  85.  
  86.  
  87. class ICurrentApplication : public IApplication {
  88. typedef IApplication
  89.   Inherited;
  90. public:
  91. /*--------------------------------- Arguments --------------------------------*/
  92. virtual int
  93.   argc    ( ) const;
  94.  
  95. virtual IString
  96.   argv    ( int argumentNumber ) const;
  97.  
  98. virtual ICurrentApplication
  99.  &setArgs ( int               argc,
  100.             const char* const argv[] );
  101.  
  102. /*---------------------------- Resource Libraries ----------------------------*/
  103. virtual IResourceLibrary
  104.  &userResourceLibrary    ( ) const,
  105.  &resourceLibrary        ( ) const;
  106.  
  107. virtual ICurrentApplication
  108.  &setUserResourceLibrary ( const char* resLibName ),
  109.  &setResourceLibrary     ( const char* resLibName );
  110.  
  111. /*--------------------------- Starting and Stopping --------------------------*/
  112. virtual ICurrentApplication
  113.  &run  ( ),
  114.  &exit ( );
  115.  
  116. /*------------------------------- Diagnostics --------------------------------*/
  117. virtual IString
  118.   asDebugInfo ( ) const;
  119.  
  120. protected:
  121. /*------------------------------- Constructors -------------------------------*/
  122.   ICurrentApplication ( );
  123. virtual
  124.  ~ICurrentApplication ( );
  125.  
  126. /*---------------------------- Process Information ---------------------------*/
  127.  
  128. private:
  129. /*-------------------------------- Private -----------------------------------*/
  130. friend class IApplication;
  131.  
  132. IResourceLibrary
  133.  *icluiLib,
  134.  *userLib;
  135.  
  136. Boolean
  137.   exeResource;
  138.  
  139. int
  140.   argCount;
  141.  
  142. IString
  143.  *argValue;
  144.  
  145.  
  146. ICurrentApplicationData
  147.  *pCurrentApplicationData;
  148.  
  149. }; // ICurrentAppliction
  150.  
  151. #pragma pack()
  152.  
  153. #endif /* _IAPP_ */
  154.