~ubuntu-branches/ubuntu/maverick/transmission/maverick

« back to all changes in this revision

Viewing changes to beos/TRTransfer.h

  • Committer: Bazaar Package Importer
  • Author(s): Philipp Benner
  • Date: 2006-08-29 20:50:41 UTC
  • Revision ID: james.westby@ubuntu.com-20060829205041-mzhpiqksdf7pbk17
Tags: upstream-0.6.1.dfsg
ImportĀ upstreamĀ versionĀ 0.6.1.dfsg

Show diffs side-by-side

added added

removed removed

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