1 /* 2 Open Tracker License 3 4 Terms and Conditions 5 6 Copyright (c) 1991-2001, Be Incorporated. All rights reserved. 7 8 Permission is hereby granted, free of charge, to any person obtaining a copy of 9 this software and associated documentation files (the "Software"), to deal in 10 the Software without restriction, including without limitation the rights to 11 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 of the Software, and to permit persons to whom the Software is furnished to do 13 so, subject to the following conditions: 14 15 The above copyright notice and this permission notice applies to all licensees 16 and shall be included in all copies or substantial portions of the Software. 17 18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, 20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 21 BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 22 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION 23 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 25 Except as contained in this notice, the name of Be Incorporated shall not be 26 used in advertising or otherwise to promote the sale, use or other dealings in 27 this Software without prior written authorization from Be Incorporated. 28 29 BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks 30 of Be Incorporated in the United States and other countries. Other brand product 31 names are registered trademarks or trademarks of their respective holders. 32 All rights reserved. 33 */ 34 35 //-------------------------------------------------------------------- 36 // 37 // Enclosures.h 38 // 39 //-------------------------------------------------------------------- 40 41 #ifndef _ENCLOSURES_H 42 #define _ENCLOSURES_H 43 44 #include <Box.h> 45 #include <File.h> 46 #include <ListView.h> 47 #include <NodeInfo.h> 48 #include <Path.h> 49 #include <Point.h> 50 #include <Rect.h> 51 #include <ScrollView.h> 52 #include <View.h> 53 #include <Volume.h> 54 55 #include <MailMessage.h> 56 57 #define ENCLOSURES_HEIGHT 65 58 59 #define ENCLOSE_TEXT "Attachments:" 60 #define ENCLOSE_TEXT_H 7 61 #define ENCLOSE_TEXT_V 3 62 #define ENCLOSE_FIELD_V 3 63 64 class TListView; 65 class TMailWindow; 66 class TScrollView; 67 68 69 //==================================================================== 70 71 class TEnclosuresView : public BView 72 { 73 public: 74 TEnclosuresView(BRect, BRect); 75 ~TEnclosuresView(); 76 77 virtual void Draw(BRect); 78 virtual void MessageReceived(BMessage*); 79 void Focus(bool); 80 void AddEnclosuresFromMail(BEmailMessage *mail); 81 82 TListView *fList; 83 84 private: 85 bool fFocus; 86 float fOffset; 87 TMailWindow *fWindow; 88 }; 89 90 91 //==================================================================== 92 93 class TListView : public BListView 94 { 95 public: 96 TListView(BRect, TEnclosuresView *); 97 98 virtual void AttachedToWindow(); 99 virtual void MakeFocus(bool); 100 virtual void MouseDown(BPoint point); 101 virtual void KeyDown(const char *bytes,int32 numBytes); 102 103 private: 104 TEnclosuresView *fParent; 105 }; 106 107 108 //==================================================================== 109 110 class TListItem : public BListItem 111 { 112 public: 113 TListItem(entry_ref *); 114 TListItem(BMailComponent *); 115 116 virtual void DrawItem(BView *, BRect, bool); 117 virtual void Update(BView *, const BFont *); 118 119 BMailComponent *Component() { return fComponent; }; 120 entry_ref *Ref() { return &fRef; } 121 node_ref *NodeRef() { return &fNodeRef; } 122 123 private: 124 BMailComponent *fComponent; 125 entry_ref fRef; 126 node_ref fNodeRef; 127 }; 128 129 #endif // #ifndef _ENCLOSURES_H 130 131