home *** CD-ROM | disk | FTP | other *** search
- //
- // MiscRegistration.h -- a class to sit underneath a Registration panel
- // Written by Don Yacktman Copyright (c) 1994 by Don Yacktman.
- // Version 1.0. All rights reserved.
- //
- // This notice may not be removed from this source code.
- //
- // This object is included in the MiscKit by permission from the author
- // and its use is governed by the MiscKit license, found in the file
- // "LICENSE.rtf" in the MiscKit distribution. Please refer to that file
- // for a list of all applicable permissions and restrictions.
- //
-
- #import <appkit/appkit.h>
-
- // This object uses a NXStringTable to hold all the localizeable things
- // that we would want to have. It's expected that you connect up a
- // string table in the .nib for this object.
- //
- // Here is a list of the keys that you can and should put in the table:
- // NotRegistered - Standard invalid key written out: "Not registered."
- // Unreg - "This Copy Is Unregistered" if no valid key given
- // Reg - "Copy #%s is registered" The serial num is inserted.
- // OK - "OK" (Alert panel button)
- // CantReg - Alert panel text: can't write keyfile in app wrapper
- // BadRegNum - Alert panel text: registration number is invalid
- //
- // In the future, if the string table isn't in the .nib file, we'll try
- // to load it from the right .lproj directory. Right now, that won't happen.
- // However, if a string table is not found, then the InfoController's
- // string table will be used instead.
- //
-
- #define MISC_UNREG_SERIAL_NUM "NREG" // string to use for an unregistered copy
-
- #define MISC_KEY_FILE_NAME "key" // file name inside app wrapper;
- // this file holds the license key
-
- #define MISC_KEY_DEFAULT "LicenseKey" // name of NX default that holds keys
- #define MISC_DEFAULT_KEY "Not registered." // default value of NX default
-
-
- @interface MiscRegistration : Object
- {
- @public
- id strings; // localized strings -- see docs as to what's needed
- id controller; // MiscInfoController instance
-
- id registerPanel; // basic registration panel
- id regText; // textfield in the register panel to give serial num
- id regNumText; // textfield in register panel where user types ser num
-
- @protected
- id _keyFileName; // MiscString -- path to key file inside app wrapper
- id _key; // MiscString -- current license key
- id _serialNum; // MiscString -- serial number corresponding to key
- BOOL _alertOnNoWrite; // show alert panel for unwritten key file?
- }
-
- + initialize;
- - init;
- - setController:sender;
- - readKey;
- - writeKey;
- - readKeyFromFile;
- - writeKeyToFile;
- - registerPanel;
- - registration:sender;
- - (BOOL)registered;
- - (BOOL)keyOK;
- - registerApp:sender;
- - cancelRegistration:sender ;
- - fillRegistrationText:textField;
- - (const char *)serialNumber;
- - (const char *)registrationKey;
-
- @end
-