source: trunk/beos/TRTransfer.h @ 14

Last change on this file since 14 was 14, checked in by root, 16 years ago

Update 2005-12-13

File size: 1.4 KB
Line 
1#ifndef TR_TRANSFER
2#define TR_TRANSFER
3
4#include <Entry.h>
5#include <ListItem.h>
6#include <Locker.h>
7#include <String.h>
8#include <View.h>
9
10#include "transmission.h"
11
12class TRTransfer : public BListItem {
13public: // Construction and Controll methods.
14        TRTransfer(const char *fullpath, node_ref node);
15        ~TRTransfer();
16
17        inline node_ref GetCachedNodeRef() { return cachedNodeRef; };
18        inline const char* GetCachedPath() { return cachedPath->String(); };
19       
20        bool SetStatus(tr_stat_t *stat, bool shade);
21       
22public: // BListItem
23        virtual void Update(BView *owner, const BFont *font);
24        virtual void DrawItem(BView *owner, BRect frame, bool complete = false);
25
26private: 
27        /*
28         * Cached data. The items stored here are _NOT_ necessairly
29         * the torrent we'll be rendering. It's likely they will be,
30         * but NOT guaranteed. They are not used for anything relating
31         * to rendering.
32         *
33         * Specifically we needed a way to cache the node_ref and
34         * reverse-lookup the node from the string path in the
35         * transmission structs. This seemed the logical place to store
36         * that information, since it ends up in a BList(View).
37         */
38        node_ref cachedNodeRef;
39        BString *cachedPath;
40
41private: // Private members used for rendering.
42        float fBaselineOffset;
43        float fLineSpacing;
44       
45        BLocker *fStatusLock;
46        tr_stat_t *fStatus;
47       
48        rgb_color fBarColor;
49       
50        char* fTimeStr;
51        char* fTransStr;
52       
53        bool fShade;
54};
55
56#endif /* TR_TRANSFER */
Note: See TracBrowser for help on using the repository browser.