home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / SourceCode / MiscKit / Headers / misckit / MiscRegistration.h < prev    next >
Encoding:
Text File  |  1994-03-23  |  2.7 KB  |  78 lines

  1. //
  2. //    MiscRegistration.h -- a class to sit underneath a Registration panel
  3. //        Written by Don Yacktman Copyright (c) 1994 by Don Yacktman.
  4. //                Version 1.0.  All rights reserved.
  5. //
  6. //        This notice may not be removed from this source code.
  7. //
  8. //    This object is included in the MiscKit by permission from the author
  9. //    and its use is governed by the MiscKit license, found in the file
  10. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  11. //    for a list of all applicable permissions and restrictions.
  12. //    
  13.  
  14. #import <appkit/appkit.h>
  15.  
  16. // This object uses a NXStringTable to hold all the localizeable things
  17. // that we would want to have.  It's expected that you connect up a
  18. // string table in the .nib for this object.
  19. //
  20. // Here is a list of the keys that you can and should put in the table:
  21. //    NotRegistered    - Standard invalid key written out:  "Not registered."
  22. //    Unreg            - "This Copy Is Unregistered"  if no valid key given
  23. //    Reg                - "Copy #%s is registered"  The serial num is inserted.
  24. //    OK                - "OK"            (Alert panel button)
  25. //    CantReg            - Alert panel text:  can't write keyfile in app wrapper
  26. //    BadRegNum        - Alert panel text:  registration number is invalid
  27. //
  28. // In the future, if the string table isn't in the .nib file, we'll try
  29. // to load it from the right .lproj directory.  Right now, that won't happen.
  30. // However, if a string table is not found, then the InfoController's
  31. // string table will be used instead.
  32. //
  33.  
  34. #define MISC_UNREG_SERIAL_NUM "NREG" // string to use for an unregistered copy
  35.  
  36. #define MISC_KEY_FILE_NAME "key" // file name inside app wrapper;
  37.         // this file holds the license key
  38.  
  39. #define MISC_KEY_DEFAULT "LicenseKey"    // name of NX default that holds keys
  40. #define MISC_DEFAULT_KEY "Not registered."    // default value of NX default
  41.  
  42.  
  43. @interface MiscRegistration : Object
  44. {
  45. @public
  46.     id    strings;        // localized strings -- see docs as to what's needed
  47.     id    controller;            // MiscInfoController instance
  48.  
  49.     id    registerPanel;    // basic registration panel
  50.     id  regText;        // textfield in the register panel to give serial num
  51.     id  regNumText;        // textfield in register panel where user types ser num
  52.  
  53. @protected
  54.     id _keyFileName;    // MiscString -- path to key file inside app wrapper
  55.     id _key;            // MiscString -- current license key
  56.     id _serialNum;        // MiscString -- serial number corresponding to key
  57.     BOOL _alertOnNoWrite;    // show alert panel for unwritten key file?
  58. }
  59.  
  60. + initialize;
  61. - init;
  62. - setController:sender;
  63. - readKey;
  64. - writeKey;
  65. - readKeyFromFile;
  66. - writeKeyToFile;
  67. - registerPanel;
  68. - registration:sender;
  69. - (BOOL)registered;
  70. - (BOOL)keyOK;
  71. - registerApp:sender;
  72. - cancelRegistration:sender    ;
  73. - fillRegistrationText:textField;
  74. - (const char *)serialNumber;
  75. - (const char *)registrationKey;
  76.  
  77. @end
  78.