home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 January / macformat-033.iso / mac / Shareware City / Developers / ABox.v1.8 / Header Files / ABOtherTopic.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-23  |  4.8 KB  |  169 lines  |  [TEXT/MMCC]

  1. /*    
  2.     Copyright © 1991-1995 by TopSoft Inc.  All rights reserved.
  3.  
  4.     You may distribute this file under the terms of the TopSoft
  5.     Artistic License, accompanying this package.
  6.     
  7.     This file was developed by George (ty) Tempel in connection with TopSoft, Inc..
  8.     See the Modification History for more details.
  9.  
  10. Product
  11.     About Box
  12.  
  13. FILE
  14.     ABOtherTopic.h
  15.  
  16. NAME
  17.     ABOtherTopic.h, part of the ABox project source code,
  18.     responsible for handling the ABOtherTopic class stuff.
  19.  
  20. DESCRIPTION
  21.     This file contains defines for the about box modules.
  22.     
  23. DEVELOPED BY
  24.     George (ty) Tempel                netromancr@aol.com
  25.     All code in this file, and its associated header file was
  26.     Created by George (ty) Tempel in connection with the TopSoft, Inc.
  27.     "FilterTop" application development, except where noted.
  28.  
  29. CARETAKER - George (ty) Tempel <netromancr@aol.com>
  30.      Please consult this person for any changes or suggestions to this file.
  31.  
  32. MODIFICATION HISTORY
  33.  
  34.     dd mmm yy    -    xxx    -    patchxx: description of patch
  35.     13-july-94    -    ty    -    Initial Version Created
  36.     20-july-94    -    ty    -    initial version released
  37.     10-apr-95    -    ty    -    added support for TeachText/SimpleText 'ttro'
  38.                             documents (but only as text, no pict processing)
  39.     23-may-95    -    ty    -    changes for compatibility with the CodeWarrior CW6
  40.                             release and the associated Universal Headers from Apple:
  41.                             most methods that returned references now have "Ref" at
  42.                             the end of their methods names to prevent possible collisions
  43.                             with datatypes and classes of the same name (older versions
  44.                             of the compiler didn't have a problem with this).
  45. */
  46.  
  47. /*===========================================================================*/
  48.  
  49. /*========== Exclusion Macros ============*/
  50.  
  51. #pragma    once
  52.  
  53. #ifndef    _ABOtherTopic_
  54. #define    _ABOtherTopic_
  55.  
  56.  
  57. /*============ Header Files ==============*/
  58.  
  59. //#include    "ABLinkedList.h"
  60. #include    "ABTopicList.h"
  61. #include    "ABTopic.h"
  62. #include    "ABPict.h"
  63. #include    "ABText.h"
  64.  
  65.  
  66. /*=========== External Linkage ===========*/
  67.  
  68. /*================ Macros ================*/
  69.  
  70. /*============== Constants ===============*/
  71.  
  72. //    this is a RESERVED dummy resource ID, used to synthesize
  73. //    resources for the ABox things...
  74. #define        kABSyntheticResourceID        5100
  75. #define        kABSyntheticResourceName    "\pSynthetic ABox Resource"
  76.  
  77.  
  78.  
  79. //    These are Properties that the caller can play with:
  80. #define        kABbadFileType                '????'
  81. #define        kABFolderFileType            'fldr'
  82. #define        kABTeachTextReadOnly        'ttro'
  83.  
  84. #define        kABTopicFileType            'Tfty'
  85. typedef        OSType                        ABTopicFileType;
  86. #define        kABTopicFileTypeSize        (sizeof(ABTopicFileType))
  87.  
  88. #define        kABTopicIsFolder            'TisF'
  89. #define        kABTopicIsFolderSize        (sizeof(Boolean))
  90.  
  91. /*================ Enums =================*/
  92.  
  93. /*=============== Structs ================*/
  94.  
  95. /*=============== Typedefs ===============*/
  96.  
  97. /*=========== Class Definitions ==========*/
  98.  
  99. #define    kABOtherTopicSuperProperties    ABTopic
  100. class    ABOtherTopic : public ABTopic
  101. {
  102.     friend class ABTopicList;
  103.     
  104.     public:
  105.                                 ABOtherTopic(const FSSpec& inTopicFSSpec);
  106.         virtual                    ~ABOtherTopic(void);
  107.  
  108.         virtual    OSErr            GetProperty (ABProperty prop, 
  109.                                             void *ptr, 
  110.                                             long *ptrSize);
  111.         virtual    OSErr            SetProperty (ABProperty prop, 
  112.                                             void *ptr, 
  113.                                             long ptrSize);
  114.         
  115.         virtual    OSErr            Draw(WindowPtr window);
  116.         virtual    OSErr            Update(WindowPtr window);
  117.         virtual    Boolean            Event(EventRecord *event);
  118.         virtual    OSErr            Stop(void);
  119.         
  120.         virtual    OSErr            Resize (Rect const *field);
  121.  
  122.                 Boolean            HasBlurb(void) const { return this->BlurbRef() != NULL; }
  123.                 Boolean            DoesntHaveBlurb(void) const { return ! this->HasBlurb(); }
  124.                 
  125.                 OSType            GetFileType(void) const { return this->FileTypeRef(); }
  126.                 
  127.                 Boolean            IsFolder(void) const { return this->GetFileType() == kABFolderFileType; }
  128.                 Boolean            IsNotFolder(void) const { return ! this->IsFolder(); }
  129.                 
  130.                 Boolean            IsPicture(void) const { return this->GetFileType() == kABPictResource; }
  131.                 Boolean            IsNotPicture(void) const { return ! this->IsPicture(); }
  132.                 
  133.                 Boolean            IsText(void) const { return this->GetFileType() == kABTextResource; }
  134.                 Boolean            IsNotText(void) const { return ! this->IsText(); }
  135.                 
  136.                 Boolean            IsTeachTextReadOnly(void) const { return this->GetFileType() == kABTeachTextReadOnly; }
  137.                 Boolean            IsNotTeachTextReadOnly(void) const { return ! this->IsTeachTextReadOnly(); }
  138.                 Boolean            IsSimpleTextReadOnly(void) const { return this->IsTeachTextReadOnly(); }
  139.                 Boolean            IsNotSimpleTextReadOnly(void) const { return ! this->IsSimpleTextReadOnly(); }
  140.                 
  141.     protected:
  142.         virtual    OSErr            DoLoad (void);
  143.         virtual    OSErr            DoCheckSlides (void);
  144.  
  145.         virtual    OSErr            OpenTopic (void);
  146.         virtual    OSErr            CloseTopic (void);
  147.         
  148.     private:
  149.                 ABResource*        mBlurb;
  150.                 OSType            mFileType;
  151.                 
  152.                 ABResource*&    BlurbRef(void) const { return this->mBlurb; }
  153.                 OSType&            FileTypeRef(void) const { return this->mFileType; }
  154.  
  155. };
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162. /*========== Function Prototypes =========*/
  163.  
  164.  
  165.  
  166.  
  167. #endif    // _ABOtherTopic_
  168.  
  169.