Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsTreeImageListener_h__
7 #define nsTreeImageListener_h__
9 #include "nsString.h"
10 #include "nsCOMPtr.h"
11 #include "nsITreeColumns.h"
12 #include "nsTreeBodyFrame.h"
13 #include "mozilla/Attributes.h"
15 // This class handles image load observation.
16 class nsTreeImageListener MOZ_FINAL : public imgINotificationObserver
17 {
18 public:
19 nsTreeImageListener(nsTreeBodyFrame *aTreeFrame);
20 ~nsTreeImageListener();
22 NS_DECL_ISUPPORTS
23 NS_DECL_IMGINOTIFICATIONOBSERVER
25 NS_IMETHOD ClearFrame();
27 friend class nsTreeBodyFrame;
29 protected:
30 void UnsuppressInvalidation() { mInvalidationSuppressed = false; }
31 void Invalidate();
32 void AddCell(int32_t aIndex, nsITreeColumn* aCol);
34 private:
35 nsTreeBodyFrame* mTreeFrame;
37 // A guard that prevents us from recursive painting.
38 bool mInvalidationSuppressed;
40 class InvalidationArea {
41 public:
42 InvalidationArea(nsITreeColumn* aCol);
43 ~InvalidationArea() { delete mNext; }
45 friend class nsTreeImageListener;
47 protected:
48 void AddRow(int32_t aIndex);
49 nsITreeColumn* GetCol() { return mCol.get(); }
50 int32_t GetMin() { return mMin; }
51 int32_t GetMax() { return mMax; }
52 InvalidationArea* GetNext() { return mNext; }
53 void SetNext(InvalidationArea* aNext) { mNext = aNext; }
55 private:
56 nsCOMPtr<nsITreeColumn> mCol;
57 int32_t mMin;
58 int32_t mMax;
59 InvalidationArea* mNext;
60 };
62 InvalidationArea* mInvalidationArea;
63 };
65 #endif // nsTreeImageListener_h__