~ubuntu-branches/debian/sid/filezilla/sid

« back to all changes in this revision

Viewing changes to src/interface/listingcomparison.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Cécile (Le_Vert)
  • Date: 2008-07-05 21:00:24 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080705210024-mvzp21zlyheschi6
Tags: 3.0.11.1-1
* wxWidgets 2.8 just entered unstable ! Upload to unstable.
* New upstream release.
* Bump Standards-Version to 3.8.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __LISTINGCOMPARISON_H__
 
2
#define __LISTINGCOMPARISON_H__
 
3
 
 
4
class CComparisonManager;
 
5
class CComparableListing
 
6
{
 
7
        friend class CComparisonManager;
 
8
public:
 
9
        CComparableListing(wxWindow* pParent);
 
10
        virtual ~CComparableListing() {}
 
11
 
 
12
        enum t_fileEntryFlags
 
13
        {
 
14
                normal,
 
15
                fill,
 
16
                different,
 
17
                newer,
 
18
                lonely
 
19
        };
 
20
 
 
21
        virtual bool CanStartComparison(wxString* pError) = 0;
 
22
        virtual void StartComparison() = 0;
 
23
        virtual bool GetNextFile(wxString& name, bool &dir, wxLongLong &size, wxDateTime& date, bool &hasTime) = 0;
 
24
        virtual void CompareAddFile(t_fileEntryFlags flags) = 0;
 
25
        virtual void FinishComparison() = 0;
 
26
        virtual void ScrollTopItem(int item) = 0;
 
27
        virtual void OnExitComparisonMode() = 0;
 
28
        
 
29
        void RefreshComparison();
 
30
        void ExitComparisonMode();
 
31
 
 
32
        bool IsComparing() const;
 
33
 
 
34
        void SetOther(CComparableListing* pOther) { m_pOther = pOther; }
 
35
        CComparableListing* GetOther() { return m_pOther; }
 
36
 
 
37
protected:
 
38
 
 
39
        wxListItemAttr m_comparisonBackgrounds[3];
 
40
 
 
41
private:
 
42
        wxWindow* m_pParent;
 
43
 
 
44
        CComparableListing* m_pOther;
 
45
        CComparisonManager* m_pComparisonManager;
 
46
};
 
47
 
 
48
class CMainFrame;
 
49
class CComparisonManager
 
50
{
 
51
public:
 
52
        CComparisonManager(CMainFrame* pMainFrame, CComparableListing* pLeft, CComparableListing* pRight);
 
53
 
 
54
        bool CompareListings();
 
55
        bool IsComparing() const { return m_isComparing; }
 
56
 
 
57
        void ExitComparisonMode();
 
58
 
 
59
        void UpdateToolState();
 
60
 
 
61
protected:
 
62
        int CompareFiles(const int dirSortMode, const wxString& local, const wxString& remote, bool localDir, bool remoteDir);
 
63
 
 
64
        CMainFrame* m_pMainFrame;
 
65
 
 
66
        // Left/right, first/second, a/b, doesn't matter
 
67
        CComparableListing* m_pLeft;
 
68
        CComparableListing* m_pRight;
 
69
 
 
70
        bool m_isComparing;
 
71
};
 
72
 
 
73
#endif //__LISTINGCOMPARISON_H__