"Fossies" - the Fresh Open Source Software Archive

Member "filezilla-3.48.1/src/interface/listingcomparison.h" (8 May 2020, 2149 Bytes) of package /linux/misc/FileZilla_3.48.1_src.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "listingcomparison.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3.48.0_vs_3.48.1.

    1 #ifndef FILEZILLA_INTERFACE_LISTINGCOMPARISON_HEADER
    2 #define FILEZILLA_INTERFACE_LISTINGCOMPARISON_HEADER
    3 
    4 #include <wx/listctrl.h>
    5 
    6 class CComparisonManager;
    7 class CComparableListing
    8 {
    9     friend class CComparisonManager;
   10 public:
   11     CComparableListing(wxWindow* pParent);
   12     virtual ~CComparableListing() = default;
   13 
   14     enum t_fileEntryFlags
   15     {
   16         normal = 1,
   17         fill = 2,
   18         different = 4,
   19         newer = 8,
   20         lonely = 16
   21     };
   22 
   23     virtual bool CanStartComparison() = 0;
   24     virtual void StartComparison() = 0;
   25     virtual bool get_next_file(std::wstring_view & name, std::wstring & path, bool &dir, int64_t &size, fz::datetime& date) = 0;
   26     virtual void CompareAddFile(t_fileEntryFlags flags) = 0;
   27     virtual void FinishComparison() = 0;
   28     virtual void ScrollTopItem(int item) = 0;
   29     virtual void OnExitComparisonMode() = 0;
   30 
   31     void RefreshComparison();
   32     void ExitComparisonMode();
   33 
   34     bool IsComparing() const;
   35 
   36     void SetOther(CComparableListing* pOther) { m_pOther = pOther; }
   37     CComparableListing* GetOther() { return m_pOther; }
   38 
   39 protected:
   40 
   41     wxListItemAttr m_comparisonBackgrounds[3];
   42 
   43 private:
   44     wxWindow* m_pParent;
   45 
   46     CComparableListing* m_pOther;
   47     CComparisonManager* m_pComparisonManager;
   48 };
   49 
   50 class CState;
   51 class CComparisonManager
   52 {
   53 public:
   54     CComparisonManager(CState& state);
   55 
   56     bool CompareListings();
   57     bool IsComparing() const { return m_isComparing; }
   58 
   59     void ExitComparisonMode();
   60 
   61     void SetListings(CComparableListing* pLeft, CComparableListing* pRight);
   62 
   63     CComparableListing* LeftListing() const { return m_pLeft; }
   64     CComparableListing* RightListing() const { return m_pRight; }
   65 
   66     void SetComparisonMode(int mode) { m_comparisonMode = mode; }
   67     void SetHideIdentical(bool hideIdentical) { m_hideIdentical = hideIdentical; }
   68 
   69 protected:
   70     int CompareFiles(const int dirSortMode, std::wstring_view const& local_path, std::wstring_view const& local, std::wstring_view const& remote_path, std::wstring_view const& remote, bool localDir, bool remoteDir);
   71 
   72     CState& m_state;
   73 
   74     // Left/right, first/second, a/b, doesn't matter
   75     CComparableListing* m_pLeft{};
   76     CComparableListing* m_pRight{};
   77 
   78     bool m_isComparing{};
   79     int m_comparisonMode{};
   80     bool m_hideIdentical{};
   81 };
   82 
   83 #endif